diff --git a/.build.yml b/.build.yml new file mode 100644 index 0000000..e10ded0 --- /dev/null +++ b/.build.yml @@ -0,0 +1,25 @@ +image: alpine/edge +packages: + - nodejs + - npm + - pnpm +secrets: + - 291f0e35-9b8d-43ff-844c-77c5f29c1876 +environment: + NETLIFY_SITE_ID: 390b392a-a898-491b-8500-79aa30f724d6 +tasks: + - install-deps: | + cd mcfly + pnpm i + - build: | + cd mcfly + pnpm -F site run build + - deploy: | + cd mcfly + { + set +x + . ~/.buildsecrets + set -x + } + export NETLIFY_AUTH_TOKEN + pnpm -F site run deploy \ No newline at end of file diff --git a/.build.yml.bkup b/.build.yml.bkup new file mode 100644 index 0000000..62bf0a4 --- /dev/null +++ b/.build.yml.bkup @@ -0,0 +1,24 @@ +image: archlinux +packages: + - nodejs + - npm +secrets: + - 46f739e5-4538-45dd-a79f-bf173b7a2ed9 +environment: + NETLIFY_SITE_ID: 390b392a-a898-491b-8500-79aa30f724d6 +tasks: + - setup: | + cd mcfly/site + npm i + - build: | + cd mcfly/site + NODE_ENV=production npm run build + - deploy: | + cd mcfly/site + { + set +x + . ~/.buildsecrets + set -x + } + export NETLIFY_AUTH_TOKEN + npm run deploy diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml deleted file mode 100644 index 73a6e88..0000000 --- a/.github/workflows/eslint.yml +++ /dev/null @@ -1,40 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. -# ESLint is a tool for identifying and reporting on patterns -# found in ECMAScript/JavaScript code. -# More details at https://github.com/eslint/eslint -# and https://eslint.org - -name: ESLint - -on: - push: - branches: [ "main", "master" ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ "main" ] - schedule: - - cron: '27 4 * * 2' - -jobs: - eslint: - name: Run eslint scanning - runs-on: ubuntu-latest - permissions: - contents: read - security-events: write - actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Install ESLint - run: | - npm install eslint@9.17.0 - - - name: Run ESLint - run: npx eslint . - --config eslint.config.mjs - continue-on-error: false diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 4483aed..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Test - -on: - push: - branches: ['main'] - pull_request: - # The branches below must be a subset of the branches above - branches: ['main'] - schedule: - - cron: '36 3 * * 2' - -jobs: - test: - name: Run test - runs-on: ubuntu-latest - permissions: - contents: read - security-events: write - actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Install core deps - run: cd packages/core && npm install --ignore-scripts - - - name: Run CLI tests - run: npx vitest run . - continue-on-error: false diff --git a/.gitignore b/.gitignore index 1442e61..aa8a4ea 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ html *.log* .nitro +.mcfly .netlify .cache .output diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 34ed521..82fc117 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,7 +3,8 @@ This file contains the contributing guide for our project. To contribute to our project, please follow these steps: -1. Fork the repository on GitHub. + +1. Fork the repository on [SourceHut](https://ayco.io/sh/mcfly). 2. Clone the forked repository to your local machine. 3. Create a new branch for your changes. 4. Make your changes and commit them with a descriptive message. diff --git a/README.md b/README.md index bec92bd..6b711a7 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@

- rRick & Morty cartoon + rRick & Morty cartoon

McFly

@@ -18,9 +18,9 @@ I often wonder what it would look like to build sites & apps knowing just the ba I thought: -- What if I knew how to write HTML and I can have a dynamic web page from that? -- What if I knew how to build custom elements and that's all the component system I needed? -- What if I can write HTML fragments and assemble them easily in a page? +- What if I knew how to write [HTML](https://developer.mozilla.org/en-US/docs/Web/HTML) and I can have a dynamic web page from that? +- What if I knew how to build [custom elements](https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_custom_elements) and that's all the component system I needed? +- What if I can write [HTML fragments](https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment) and [assemble them](https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_shadow_DOM) easily in a page? - What if I did not have to worry about the [ever-growing number of ways to have a place on the Web](https://ayos.blog/places-in-the-web/)? **McFly** is my reimagination of web development: Back to the basics. Into the future. @@ -70,11 +70,28 @@ The following are the project packages published on the NPM registry: | Package | Description | Version | | ------------------------------------------------------ | -------------------------------------------- | ---------------------------------------------------------------- | -| [`@mcflyjs/cli`](https://ayco.io/n/@mcflyjs/cli) | The McFly CLI tooling | ![npm version](https://img.shields.io/npm/v/%40mcflyjs%2Fcli) | | [`@mcflyjs/config`](https://ayco.io/n/@mcflyjs/config) | Nitro server config for McFly projects | ![npm version](https://img.shields.io/npm/v/%40mcflyjs%2Fconfig) | | [`@mcflyjs/core`](https://ayco.io/n/@mcflyjs/core) | Route event and config handlers | ![npm version](https://img.shields.io/npm/v/%40mcflyjs%2Fcore) | | [`create-mcfly`](https://ayco.io/n/create-mcfly) | Script for scaffolding a new McFly workspace | ![npm version](https://img.shields.io/npm/v/create-mcfly) | +## Project setup + +After cloning the project, you will need [node](https://nodejs.org/en/download) and [pnpm installed](https://pnpm.io/installation). When you are sure that you have `node` and `pnpm`, then run the following to download the dependencies: + +``` +corepack enable +pnpm i +``` + +The following commands are available to you on this project. Add more, or modify them as needed in your `./package.json` file. + +| Command | Action | +| ----------------------- | ----------------------------------------------------- | +| pnpm run site | Start the development server for https://mcfly.js.org | +| pnpm run template:basic | Start the development server for the basic template | +| pnpm run build | Locally generate the app's build files to `./output` | +| pnpm run preview | Preview the built app locally | + ## More info This framework is a result of [an exploration](https://social.ayco.io/@ayo/111195315785886977) for using [Nitro](https://nitro.build) and custom elements using a minimal [Web Component Base](https://WebComponent.io) class. diff --git a/assets/mcfly-logo-sm-bkup.png b/assets/mcfly-logo-sm-bkup.png new file mode 100644 index 0000000..11c805e Binary files /dev/null and b/assets/mcfly-logo-sm-bkup.png differ diff --git a/assets/mcfly-logo-sm.png b/assets/mcfly-logo-sm.png new file mode 100644 index 0000000..451aa56 Binary files /dev/null and b/assets/mcfly-logo-sm.png differ diff --git a/assets/mcfly-logo.png b/assets/mcfly-logo.png new file mode 100644 index 0000000..8c8b950 Binary files /dev/null and b/assets/mcfly-logo.png differ diff --git a/netlify.toml b/netlify.toml new file mode 100644 index 0000000..93d4324 --- /dev/null +++ b/netlify.toml @@ -0,0 +1,3 @@ +[build] +base = "site" +publish = "dist" \ No newline at end of file diff --git a/package.json b/package.json index 35ef8ad..00d7c98 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "eslint-plugin-prettier": "^5.2.1", "globals": "^15.14.0", "husky": "^9.1.7", + "netlify-cli": "^18.0.0", "prettier": "^3.4.2", "vitest": "^2.1.8" }, diff --git a/packages/config/README.md b/packages/config/README.md index cfea8b7..4d0a048 100644 --- a/packages/config/README.md +++ b/packages/config/README.md @@ -1,5 +1,5 @@

- rRick & Morty cartoon + rRick & Morty cartoon

McFly

@@ -17,18 +17,22 @@ I often wonder what it would look like to build sites & apps knowing just the basics. I thought: -- What if I knew how to write HTML and I can have a dynamic web page from that? -- What if I knew how to build custom elements and that's all the component system I needed? -- What if I can write HTML fragments and assemble them easily in a page? + +- What if I knew how to write [HTML](https://developer.mozilla.org/en-US/docs/Web/HTML) and I can have a dynamic web page from that? +- What if I knew how to build [custom elements](https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_custom_elements) and that's all the component system I needed? +- What if I can write [HTML fragments](https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment) and [assemble them](https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_shadow_DOM) easily in a page? - What if I did not have to worry about the [ever-growing number of ways to have a place on the Web](https://ayos.blog/places-in-the-web/)? **McFly** is my reimagination of web development: Back to the basics. Into the future. ## Project Status + We are currently in a Proof of Concept phase. All parts are subject to breaking changes in minor releases. ## Try it today + Run the following to generate a McFly starter project. + ``` npm create mcfly@latest ``` @@ -42,36 +46,43 @@ npm create mcfly@latest ✅ Deploy anywhere, even the Edge
## Special directories + **1. `./src/pages/`** + - file-based routing for `.html` files - directly use custom elements & static fragments (no imports or registry maintenance needed) - use `