Compare commits

..

11 commits

Author SHA1 Message Date
Ayo
64bdba6afd chore: remove gh from remote repo 2026-06-05 09:46:19 +02:00
Ayo
01f5a674e7 chore: update template:basic monorepo script 2026-06-04 18:00:45 +02:00
Ayo
c961125d88 chore: mention generic plugin system for using server frameworks 2026-06-04 15:57:34 +02:00
Ayo
320d183803 chore: remove unused config 2026-06-04 15:53:20 +02:00
Ayo
c4f8a2c779 refactor(fastify): use ServerConfig type from core 2026-06-04 15:50:44 +02:00
Ayo
97c04c21b9 chore: update logo image url 2026-06-04 15:03:20 +02:00
Ayo
785e08008b chore: separate items for html routing & templating 2026-06-04 15:00:11 +02:00
Ayo
fc18f3611b chore: fix url to fastify adapter package 2026-06-04 13:32:55 +02:00
Ayo
566c8964e5 chore: update packages version tags 2026-06-04 13:27:44 +02:00
Ayo
efa9b8b4f7 chore(create-mcfly): release v0.4.8 2026-06-04 13:23:45 +02:00
Ayo
6edab54354 feat: new architecture to support server framework plugin
- generic `server.serve` config
- new demo workspace
- new basic template
- updated readme

Reviewed-on: https://git.ayo.run/ayo/mcfly/pulls/3
Co-authored-by: Ayo <ayo@ayco.io>
Co-committed-by: Ayo <ayo@ayco.io>
2026-06-04 11:17:09 +00:00
17 changed files with 2412 additions and 6710 deletions

View file

@ -1,3 +1,2 @@
echo "post-commit..." echo "post-commit..."
git push gh git push sh
git push sh

View file

@ -1,4 +0,0 @@
# Rough list of changes
1. Expose a `McFly` object containing event properties to `server:setup` scripts. Useful for handling requests like form submission.
2. Add a cozy demo page for form handling using the exposed `McFly` object

View file

@ -19,50 +19,7 @@ To start or participate on discussions, see our [mcfly-discussions](https://list
## Contribute Code ## Contribute Code
We use `git` and `email` here -- it is actually fun! Due to still figuring out how parts fit together, we are not ready for code contributions.
To get started, setup [git send-email](https://git-send-email.io).
After setting up `git send-email` you can now follow the steps below to start hacking:
1⃣ Clone the repository to your local machine, then go into the project directory:
```bash
$ git clone https://git.ayo.run/ayo/mcfly
$ cd mcfly
```
2⃣ Create a new branch for your changes:
```bash
$ git checkout -b my-branch
```
3⃣ Make your changes, and then commit them with a descriptive message using [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/):
```bash
$ git commit -m "feat(core): implement server-side rendering"
```
4⃣ Use `git send-email` to send a patch:
```bash
$ git send-email --to="~ayoayco/mcfly-patches@lists.sr.ht" HEAD^
```
### Tips:
💡 You can set the default "to" address for the project:
```bash
$ git config sendemail.to "~ayoayco/mcfly-patches@lists.sr.ht"
```
💡 The `HEAD^` bit is a reference to the latest commit, which will be added to your patch. This could be a range of commits as well if you have mutiple commits.
5⃣ After successfully sending your patch, wait for a response from us whether the patch needs rework... or a notification if it gets merged!
> As a summary, we use `git` and `email` to collaborate on McFly. You have to set up [git send-email](https://git-send-email.io) and send patches via email. :)
## Get in touch ## Get in touch

View file

@ -1,5 +1,5 @@
<p align="center"> <p align="center">
<img width="250" src="https://git.ayo.run/ayo/mcfly/blob/main/assets/mcfly-logo-sm.png" alt="McFly logo" /> <img width="250" src="https://git.ayo.run/ayo/mcfly/raw/branch/main/assets/mcfly-logo-sm.png" alt="McFly logo" />
</p> </p>
<h1 align="center">McFly</h1> <h1 align="center">McFly</h1>
@ -21,7 +21,7 @@ I thought:
- 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 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 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 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/)? - What if I did not have to worry about the [ever-growing number of ways to have a place on the Web](https://v1.ayos.blog/places-in-the-web/)?
**McFly** is my reimagination of web development: _Back to the basics. Into the future._ **McFly** is my reimagination of web development: _Back to the basics. Into the future._
@ -29,11 +29,13 @@ I thought:
We are currently in a focused rewrite. All parts are subject to breaking changes in minor releases. We are currently in a focused rewrite. All parts are subject to breaking changes in minor releases.
- [x] generic plugin system for using server frameworks
- [x] file-based API routing via fastify as server framework - [x] file-based API routing via fastify as server framework
- [ ] file-based HTML pages routing & templating via Eta - [ ] file-based HTML pages routing
- [ ] HTML templating via Eta
- [ ] auto-registry of custom elements - [ ] auto-registry of custom elements
- [ ] SSR custom elements - [ ] SSR custom elements
- [ ] SSG - [ ] SSG builds
## Try it today ## Try it today
@ -62,12 +64,12 @@ npm create mcfly@latest
The following are the project packages published on the NPM registry: The following are the project packages published on the NPM registry:
| Package | Description | Version | | Package | Description | Version |
| :----------------------------------------------------- | --------------------------------------------- | ---------------------------------------------------------------- | | :------------------------------------------------------- | --------------------------------------------- | ---------------------------------------------------------------------- |
| [`@mcflyjs/config`](https://ayco.io/n/@mcflyjs/config) | Configuration handling for McFly projects | ![npm version](https://img.shields.io/npm/v/%40mcflyjs%2Fconfig) | | [`@mcflyjs/config`](https://ayco.io/n/@mcflyjs/config) | Configuration handling for McFly projects | ![npm version](https://img.shields.io/npm/v/%40mcflyjs%2Fconfig/alpha) |
| [`@mcflyjs/core`](https://ayco.io/n/@mcflyjs/core) | Commands & runtime handling | ![npm version](https://img.shields.io/npm/v/%40mcflyjs%2Fcore) | | [`@mcflyjs/core`](https://ayco.io/n/@mcflyjs/core) | Commands & runtime handling | ![npm version](https://img.shields.io/npm/v/%40mcflyjs%2Fcore/alpha) |
| [`@mcflyjs/fastify`](https://ayco.io/n/@mcflyjs/core) | Adapter for using fastify as server framework | ![npm version](https://img.shields.io/npm/v/%40mcflyjs%2Fcore) | | [`@mcflyjs/fastify`](https://ayco.io/n/@mcflyjs/fastify) | Adapter for using fastify as server framework | ![npm version](https://img.shields.io/npm/v/%40mcflyjs%2Ffastify) |
| [`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) | | [`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 ## Project setup

View file

@ -1,3 +0,0 @@
# Values (initial)
Our core values include leaning on open standards and decentralized technologies, which do not require any form of lock-in. Therefore, you dont need anything else than `git` and `email` to collaborate.

View file

@ -1,3 +0,0 @@
export default {
from: 'root',
}

View file

@ -11,7 +11,7 @@
"build:deps": "pnpm -F @mcflyjs/core build && pnpm -F @mcflyjs/config build", "build:deps": "pnpm -F @mcflyjs/core build && pnpm -F @mcflyjs/config build",
"build:site": "pnpm -F site build", "build:site": "pnpm -F site build",
"build:site:preview": "pnpm -F site build:preview", "build:site:preview": "pnpm -F site build:preview",
"template:basic": "pnpm run build && pnpm -F basic-template start", "template:basic": "pnpm run build && pnpm -F mcfly-basic start",
"create:mcfly": "node ./packages/create-mcfly", "create:mcfly": "node ./packages/create-mcfly",
"cli": "node ./packages/core/cli/index.js", "cli": "node ./packages/core/cli/index.js",
"test": "vitest --run", "test": "vitest --run",

View file

@ -1,5 +1,5 @@
<p align="center"> <p align="center">
<img width="250" src="https://git.ayo.run/ayo/mcfly/blob/main/assets/mcfly-logo-sm.png" alt="McFly Logo" /> <img width="250" src="https://git.ayo.run/ayo/mcfly/raw/branch/main/assets/mcfly-logo-sm.png" alt="McFly Logo" />
</p> </p>
<h1 align="center">McFly</h1> <h1 align="center">McFly</h1>
@ -21,7 +21,7 @@ I thought:
- 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 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 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 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/)? - What if I did not have to worry about the [ever-growing number of ways to have a place on the Web](https://v1.ayos.blog/places-in-the-web/)?
**McFly** is my reimagination of web development: Back to the basics. Into the future. **McFly** is my reimagination of web development: Back to the basics. Into the future.

View file

@ -1,5 +1,5 @@
<p align="center"> <p align="center">
<img width="250" src="https://git.ayo.run/ayo/mcfly/blob/main/assets/mcfly-logo-sm.png" alt="McFly Logo" /> <img width="250" src="https://git.ayo.run/ayo/mcfly/raw/branch/main/assets/mcfly-logo-sm.png" alt="McFly Logo" />
</p> </p>
<h1 align="center">McFly</h1> <h1 align="center">McFly</h1>
@ -21,7 +21,7 @@ I thought:
- 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 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 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 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/)? - What if I did not have to worry about the [ever-growing number of ways to have a place on the Web](https://v1.ayos.blog/places-in-the-web/)?
**McFly** is my reimagination of web development: Back to the basics. Into the future. **McFly** is my reimagination of web development: Back to the basics. Into the future.

View file

@ -1,6 +1,18 @@
#!/usr/bin/env node #!/usr/bin/env node
import { defineCommand, runMain, type ArgsDef, type CommandDef } from 'citty' import { defineCommand, runMain, type ArgsDef, type CommandDef } from 'citty'
export type Logger = {
log: Function
error: Function
}
export type ServerConfig = {
rootDir: string
apiDir: string
port: number
logger: Logger
}
const main: CommandDef<ArgsDef> = defineCommand({ const main: CommandDef<ArgsDef> = defineCommand({
meta: { meta: {
name: 'mcfly', name: 'mcfly',

View file

@ -1,5 +1,5 @@
<p align="center"> <p align="center">
<img width="250" src="https://git.ayo.run/ayo/mcfly/blob/main/assets/mcfly-logo-sm.png" alt="McFly Logo" /> <img width="250" src="https://git.ayo.run/ayo/mcfly/raw/branch/main/assets/mcfly-logo-sm.png" alt="McFly Logo" />
</p> </p>
<h1 align="center">Create McFly</h1> <h1 align="center">Create McFly</h1>

View file

@ -1,6 +1,6 @@
{ {
"name": "create-mcfly", "name": "create-mcfly",
"version": "0.4.7", "version": "0.4.8",
"description": "Create a new McFly app", "description": "Create a new McFly app",
"type": "module", "type": "module",
"bin": { "bin": {

View file

@ -1,5 +1,5 @@
<p align="center"> <p align="center">
<img width="250" src="https://git.ayo.run/ayo/mcfly/blob/main/assets/mcfly-logo-sm.png" alt="McFly Logo" /> <img width="250" src="https://git.ayo.run/ayo/mcfly/raw/branch/main/assets/mcfly-logo-sm.png" alt="McFly Logo" />
</p> </p>
<h1 align="center">McFly Fastify Adapter</h1> <h1 align="center">McFly Fastify Adapter</h1>

View file

@ -12,5 +12,8 @@
"dependencies": { "dependencies": {
"@fastify/autoload": "6.3.1", "@fastify/autoload": "6.3.1",
"fastify": "5.8.5" "fastify": "5.8.5"
},
"devDependencies": {
"@mcflyjs/core": "workspace:*"
} }
} }

View file

@ -2,6 +2,13 @@ import Fastify from 'fastify'
import AutoLoad from '@fastify/autoload' import AutoLoad from '@fastify/autoload'
import path from 'node:path' import path from 'node:path'
/**
* @typedef {import('@mcflyjs/core').ServerConfig} ServerConfig
*/
/**
* @param {ServerConfig} param
*/
export default ({ rootDir, apiDir, logger, port }) => { export default ({ rootDir, apiDir, logger, port }) => {
const server = Fastify() const server = Fastify()
const portNumber = port ?? 3000 const portNumber = port ?? 3000

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,5 @@
<p align="center"> <p align="center">
<img width="250" src="https://git.ayo.run/ayo/mcfly/blob/main/assets/mcfly-logo-sm.png" alt="McFly Logo" /> <img width="250" src="https://git.ayo.run/ayo/mcfly/raw/branch/main/assets/mcfly-logo-sm.png" alt="McFly Logo" />
</p> </p>
<h1 align="center">McFly Docs</h1> <h1 align="center">McFly Docs</h1>