Compare commits

..

12 commits

Author SHA1 Message Date
Ayo
df15c7cc10 Merge branch 'main' into fastify-rewrite 2026-06-04 13:15:18 +02:00
Ayo
ad0cec51b6 feat: new basic template 2026-06-04 13:02:20 +02:00
Ayo
9928a9b125 chore: udpate readme 2026-06-04 09:43:43 +02:00
Ayo
a1bfd77968 chore: update project status 2026-06-04 09:32:13 +02:00
Ayo
6c3efdec32 chore: add serve command TODO 2026-06-04 09:28:40 +02:00
Ayo
8a0e463fb2 chore: add rootDir to config package tsconfig 2026-06-04 09:20:17 +02:00
Ayo
903c01c005 refactor: remove unused type import 2026-06-03 22:20:13 +02:00
Ayo
b285e0a73b feat: expose mcfly logger to server framework; log api URL 2026-06-03 22:17:05 +02:00
Ayo
7c0949c518 chore: comment todo 2026-05-25 22:57:42 +02:00
Ayo
8a55ca61de feat: new demo workspace 2026-05-25 22:55:57 +02:00
Ayo
185c274621 chore: remove create-component package 2026-05-25 22:55:25 +02:00
Ayo
08c2497fab feat: use fastify as server
- remove nitropack
- new @mcflyjs/fastify package
- test-core workspace for testing the new setup
2026-05-25 22:43:15 +02:00
15 changed files with 6704 additions and 2407 deletions

4
CHANGESET.md Normal file
View file

@ -0,0 +1,4 @@
# 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,7 +19,50 @@ To start or participate on discussions, see our [mcfly-discussions](https://list
## Contribute Code ## Contribute Code
Due to still figuring out how parts fit together, we are not ready for code contributions. We use `git` and `email` here -- it is actually fun!
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/raw/branch/main/assets/mcfly-logo-sm.png" alt="McFly logo" /> <img width="250" src="https://git.ayo.run/ayo/mcfly/blob/main/assets/mcfly-logo-sm.png" alt="McFly logo" />
</p> </p>
<h1 align="center">McFly</h1> <h1 align="center">McFly</h1>
@ -29,13 +29,11 @@ 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 - [ ] file-based HTML pages routing & templating via Eta
- [ ] HTML templating via Eta
- [ ] auto-registry of custom elements - [ ] auto-registry of custom elements
- [ ] SSR custom elements - [ ] SSR custom elements
- [ ] SSG builds - [ ] SSG
## Try it today ## Try it today
@ -64,12 +62,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/alpha) | | [`@mcflyjs/config`](https://ayco.io/n/@mcflyjs/config) | Configuration handling for McFly projects | ![npm version](https://img.shields.io/npm/v/%40mcflyjs%2Fconfig) |
| [`@mcflyjs/core`](https://ayco.io/n/@mcflyjs/core) | Commands & runtime handling | ![npm version](https://img.shields.io/npm/v/%40mcflyjs%2Fcore/alpha) | | [`@mcflyjs/core`](https://ayco.io/n/@mcflyjs/core) | Commands & runtime handling | ![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) | | [`@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) |
| [`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

3
VALUES.md Normal file
View file

@ -0,0 +1,3 @@
# 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.

3
mcfly.config.mjs Normal file
View file

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

View file

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

View file

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

View file

@ -1,18 +1,6 @@
#!/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/raw/branch/main/assets/mcfly-logo-sm.png" alt="McFly Logo" /> <img width="250" src="https://git.ayo.run/ayo/mcfly/blob/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.8", "version": "0.4.7",
"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/raw/branch/main/assets/mcfly-logo-sm.png" alt="McFly Logo" /> <img width="250" src="https://git.ayo.run/ayo/mcfly/blob/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,8 +12,5 @@
"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,13 +2,6 @@ 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/raw/branch/main/assets/mcfly-logo-sm.png" alt="McFly Logo" /> <img width="250" src="https://git.ayo.run/ayo/mcfly/blob/main/assets/mcfly-logo-sm.png" alt="McFly Logo" />
</p> </p>
<h1 align="center">McFly Docs</h1> <h1 align="center">McFly Docs</h1>