Compare commits
11 commits
fastify-re
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 64bdba6afd | |||
| 01f5a674e7 | |||
| c961125d88 | |||
| 320d183803 | |||
| c4f8a2c779 | |||
| 97c04c21b9 | |||
| 785e08008b | |||
| fc18f3611b | |||
| 566c8964e5 | |||
| efa9b8b4f7 | |||
| 6edab54354 |
17 changed files with 2412 additions and 6710 deletions
|
|
@ -1,3 +1,2 @@
|
|||
echo "post-commit..."
|
||||
git push gh
|
||||
git push sh
|
||||
git push sh
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -19,50 +19,7 @@ To start or participate on discussions, see our [mcfly-discussions](https://list
|
|||
|
||||
## Contribute Code
|
||||
|
||||
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. :)
|
||||
Due to still figuring out how parts fit together, we are not ready for code contributions.
|
||||
|
||||
## Get in touch
|
||||
|
||||
|
|
|
|||
22
README.md
22
README.md
|
|
@ -1,5 +1,5 @@
|
|||
<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>
|
||||
|
||||
<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 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/)?
|
||||
- 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._
|
||||
|
||||
|
|
@ -29,11 +29,13 @@ I thought:
|
|||
|
||||
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
|
||||
- [ ] file-based HTML pages routing & templating via Eta
|
||||
- [ ] file-based HTML pages routing
|
||||
- [ ] HTML templating via Eta
|
||||
- [ ] auto-registry of custom elements
|
||||
- [ ] SSR custom elements
|
||||
- [ ] SSG
|
||||
- [ ] SSG builds
|
||||
|
||||
## Try it today
|
||||
|
||||
|
|
@ -62,12 +64,12 @@ npm create mcfly@latest
|
|||
|
||||
The following are the project packages published on the NPM registry:
|
||||
|
||||
| Package | Description | Version |
|
||||
| :----------------------------------------------------- | --------------------------------------------- | ---------------------------------------------------------------- |
|
||||
| [`@mcflyjs/config`](https://ayco.io/n/@mcflyjs/config) | Configuration handling for McFly projects |  |
|
||||
| [`@mcflyjs/core`](https://ayco.io/n/@mcflyjs/core) | Commands & runtime handling |  |
|
||||
| [`@mcflyjs/fastify`](https://ayco.io/n/@mcflyjs/core) | Adapter for using fastify as server framework |  |
|
||||
| [`create-mcfly`](https://ayco.io/n/create-mcfly) | Script for scaffolding a new McFly workspace |  |
|
||||
| Package | Description | Version |
|
||||
| :------------------------------------------------------- | --------------------------------------------- | ---------------------------------------------------------------------- |
|
||||
| [`@mcflyjs/config`](https://ayco.io/n/@mcflyjs/config) | Configuration handling for McFly projects |  |
|
||||
| [`@mcflyjs/core`](https://ayco.io/n/@mcflyjs/core) | Commands & runtime handling |  |
|
||||
| [`@mcflyjs/fastify`](https://ayco.io/n/@mcflyjs/fastify) | Adapter for using fastify as server framework |  |
|
||||
| [`create-mcfly`](https://ayco.io/n/create-mcfly) | Script for scaffolding a new McFly workspace |  |
|
||||
|
||||
## Project setup
|
||||
|
||||
|
|
|
|||
|
|
@ -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 don’t need anything else than `git` and `email` to collaborate.
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
export default {
|
||||
from: 'root',
|
||||
}
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
"build:deps": "pnpm -F @mcflyjs/core build && pnpm -F @mcflyjs/config build",
|
||||
"build:site": "pnpm -F site build",
|
||||
"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",
|
||||
"cli": "node ./packages/core/cli/index.js",
|
||||
"test": "vitest --run",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<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>
|
||||
|
||||
<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 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/)?
|
||||
- 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.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<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>
|
||||
|
||||
<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 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/)?
|
||||
- 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.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,18 @@
|
|||
#!/usr/bin/env node
|
||||
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({
|
||||
meta: {
|
||||
name: 'mcfly',
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<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>
|
||||
|
||||
<h1 align="center">Create McFly</h1>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "create-mcfly",
|
||||
"version": "0.4.7",
|
||||
"version": "0.4.8",
|
||||
"description": "Create a new McFly app",
|
||||
"type": "module",
|
||||
"bin": {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<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>
|
||||
|
||||
<h1 align="center">McFly Fastify Adapter</h1>
|
||||
|
|
|
|||
|
|
@ -12,5 +12,8 @@
|
|||
"dependencies": {
|
||||
"@fastify/autoload": "6.3.1",
|
||||
"fastify": "5.8.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@mcflyjs/core": "workspace:*"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,13 @@ import Fastify from 'fastify'
|
|||
import AutoLoad from '@fastify/autoload'
|
||||
import path from 'node:path'
|
||||
|
||||
/**
|
||||
* @typedef {import('@mcflyjs/core').ServerConfig} ServerConfig
|
||||
*/
|
||||
|
||||
/**
|
||||
* @param {ServerConfig} param
|
||||
*/
|
||||
export default ({ rootDir, apiDir, logger, port }) => {
|
||||
const server = Fastify()
|
||||
const portNumber = port ?? 3000
|
||||
|
|
|
|||
9002
pnpm-lock.yaml
9002
pnpm-lock.yaml
File diff suppressed because it is too large
Load diff
|
|
@ -1,5 +1,5 @@
|
|||
<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>
|
||||
|
||||
<h1 align="center">McFly Docs</h1>
|
||||
|
|
|
|||
Loading…
Reference in a new issue