diff --git a/.prettierignore b/.prettierignore
index 68f3cc5..8888cda 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -6,6 +6,6 @@
**/*.yml
**/*.yaml
-templates
+templates/**
**/public/*
\ No newline at end of file
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index f428d53..154633a 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -28,7 +28,7 @@ After setting up `git send-email` you can now follow the steps below to start ha
1️⃣ Clone the repository to your local machine, then go into the project directory:
```bash
-$ git clone https://git.sr.ht/~ayoayco/mcfly
+$ git clone https://git.ayo.run/ayo/mcfly
$ cd mcfly
```
diff --git a/README.md b/README.md
index efcac10..d032fbb 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
-
+
McFly
diff --git a/eslint.config.mjs b/eslint.config.mjs
index 0490e0e..9016691 100644
--- a/eslint.config.mjs
+++ b/eslint.config.mjs
@@ -16,7 +16,7 @@ export default [
eslintPluginPrettierRecommended,
includeIgnoreFile(gitignorePath),
{
- ignores: ['site/*', 'templates/*', '**/public/*', 'demo/*'],
+ ignores: ['site/*', 'templates/**', '**/public/*', 'demo/*'],
},
{
rules: {
diff --git a/package.json b/package.json
index dc9b539..5cf9ffb 100644
--- a/package.json
+++ b/package.json
@@ -13,7 +13,6 @@
"build:site:preview": "pnpm -F site build:preview",
"template:basic": "pnpm run build && pnpm -F basic-template start",
"create:mcfly": "node ./packages/create-mcfly",
- "create:component": "node ./packages/create-component",
"cli": "node ./packages/core/cli/index.js",
"test": "vitest --run",
"lint": "eslint . --config eslint.config.mjs --cache",
diff --git a/packages/config/README.md b/packages/config/README.md
index 89f9fb1..9ed2883 100644
--- a/packages/config/README.md
+++ b/packages/config/README.md
@@ -1,5 +1,5 @@
-
+
McFly
diff --git a/packages/config/package.json b/packages/config/package.json
index 2361018..77f3c3d 100644
--- a/packages/config/package.json
+++ b/packages/config/package.json
@@ -1,6 +1,6 @@
{
"name": "@mcflyjs/config",
- "version": "0.2.9",
+ "version": "0.3.0-alpha",
"description": "Nitro configuration for McFly apps",
"type": "module",
"main": "./dist/index.js",
@@ -19,7 +19,7 @@
},
"repository": {
"type": "git",
- "url": "https://git.sr.ht/~ayoayco/mcfly",
+ "url": "https://git.ayo.run/ayo/mcfly",
"directory": "packages/config"
},
"author": "Ayo Ayco",
diff --git a/packages/core/README.md b/packages/core/README.md
index 89f9fb1..9ed2883 100644
--- a/packages/core/README.md
+++ b/packages/core/README.md
@@ -1,5 +1,5 @@
-
+
McFly
diff --git a/packages/core/package.json b/packages/core/package.json
index 3f8d7bd..21f4aa4 100644
--- a/packages/core/package.json
+++ b/packages/core/package.json
@@ -1,6 +1,6 @@
{
"name": "@mcflyjs/core",
- "version": "0.8.8",
+ "version": "0.9.0-alpha",
"description": "McFly core package",
"type": "module",
"main": "./dist/index.js",
@@ -26,7 +26,7 @@
},
"repository": {
"type": "git",
- "url": "https://git.sr.ht/~ayoayco/mcfly",
+ "url": "https://git.ayo.run/ayo/mcfly",
"directory": "packages/core"
},
"author": "Ayo Ayco",
diff --git a/packages/create-mcfly/README.md b/packages/create-mcfly/README.md
index 20dbd69..6317444 100644
--- a/packages/create-mcfly/README.md
+++ b/packages/create-mcfly/README.md
@@ -1,5 +1,5 @@
-
+
Create McFly
diff --git a/packages/create-mcfly/src/index.ts b/packages/create-mcfly/index.js
similarity index 83%
rename from packages/create-mcfly/src/index.ts
rename to packages/create-mcfly/index.js
index 95f6eb8..8ca8da7 100755
--- a/packages/create-mcfly/src/index.ts
+++ b/packages/create-mcfly/index.js
@@ -7,15 +7,15 @@ import { spawnSync } from 'node:child_process'
import path from 'node:path'
const [, , directoryArg] = process.argv
-
-type PromptAction = {
- prompt: string
- info?: string
- startMessage: string
- command: string
- subCommand: string
- error: string
-}
+/**
+ * @typedef {Object} PromptAction
+ * @property {string} prompt - The prompt text to display
+ * @property {string} [info] - Additional information about the prompt
+ * @property {string} startMessage - Message to show when starting the action
+ * @property {string} command - The command to execute
+ * @property {string} subCommand - The subcommand to execute
+ * @property {string} error - Error message to display on failure
+ */
/**
* Create McFly App
@@ -42,7 +42,10 @@ async function create() {
const hasErrors = await downloadTemplateToDirectory(directory)
if (!hasErrors) {
- const prompts: PromptAction[] = [
+ /**
+ * @type {Array}
+ */
+ const prompts = [
{
prompt: `Would you like to install the dependencies to ${colorize(
'bold',
@@ -80,7 +83,7 @@ async function create() {
* @param {string} directory
* @returns string
*/
-function getSafeDirectory(directory: string): string {
+function getSafeDirectory(directory) {
const { platform } = process
const locale = path[platform === `win32` ? `win32` : `posix`]
const localePath = directory.split(path.sep).join(locale.sep)
@@ -92,16 +95,14 @@ function getSafeDirectory(directory: string): string {
* @param {string} directory
* @returns Promise hasErrors
*/
-async function downloadTemplateToDirectory(
- directory: string
-): Promise {
+async function downloadTemplateToDirectory(directory) {
let hasErrors = false
try {
consola.start(
`Copying template to ${colorize('bold', getSafeDirectory(directory))}...`
)
- await downloadTemplate('sourcehut:ayoayco/mcfly/templates/basic', {
+ await downloadTemplate('github:ayo-run/mcfly/templates/basic', {
dir: directory,
})
} catch (ㆆ_ㆆ) {
@@ -123,11 +124,11 @@ async function downloadTemplateToDirectory(
* @param {string} cwd
* @returns Promise | undefined>
*/
-async function askPrompts(
- prompts: PromptAction[],
- cwd: string
-): Promise {
- const results: boolean[] = []
+async function askPrompts(prompts, cwd) {
+ /**
+ * @type {Array}
+ */
+ const results = []
for (const p of prompts) {
const userIntends = await consola.prompt(p.prompt, {
@@ -169,7 +170,7 @@ async function askPrompts(
* @param {string} directory
* @param {boolean} installDeps
*/
-function showResults(directory: string, installDeps: boolean) {
+function showResults(directory, installDeps) {
let nextActions = [
`Go to your project by running ${colorize('yellow', `cd ${directory}`)}`,
]
@@ -189,7 +190,7 @@ function showResults(directory: string, installDeps: boolean) {
'bold',
'McFly'
)} app is ready: ${directory}\n\nNext actions: ${nextActions
- .map((action, index) => `\n${++index}. ${action}`)
+ .map((action, index) => `\n${index}. ${action}`)
.join('')}`
consola.box(result)
diff --git a/packages/create-mcfly/package.json b/packages/create-mcfly/package.json
index 395aa65..28043ad 100644
--- a/packages/create-mcfly/package.json
+++ b/packages/create-mcfly/package.json
@@ -4,24 +4,22 @@
"description": "Create a new McFly app",
"type": "module",
"bin": {
- "create-mcfly": "./dist/index.js"
+ "create-mcfly": "./index.js"
},
- "main": "./dist/index.js",
+ "main": "./index.js",
"exports": {
".": {
- "types": "./dist/index.d.ts",
- "default": "./dist/index.js"
+ "default": "./index.js"
}
},
"scripts": {
- "build": "tsc --erasableSyntaxOnly",
"version": "npm version",
"publish": "npm publish",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
- "url": "https://git.sr.ht/~ayoayco/mcfly",
+ "url": "https://git.ayo.run/ayo/mcfly",
"directory": "packages/create-mcfly"
},
"author": "Ayo Ayco",
diff --git a/packages/create-mcfly/tsconfig.json b/packages/create-mcfly/tsconfig.json
deleted file mode 100644
index ab2dec0..0000000
--- a/packages/create-mcfly/tsconfig.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "extends": "../../tsconfig.base.json",
- "include": ["src"],
- "compilerOptions": {
- "allowJs": true,
- "emitDeclarationOnly": false,
- "declarationDir": "./dist",
- "outDir": "./dist"
- }
-}
diff --git a/packages/fastify/LICENSE b/packages/fastify/LICENSE
new file mode 100644
index 0000000..009a8d8
--- /dev/null
+++ b/packages/fastify/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2026 Ayo Ayco
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/packages/fastify/README.md b/packages/fastify/README.md
new file mode 100644
index 0000000..5c4547f
--- /dev/null
+++ b/packages/fastify/README.md
@@ -0,0 +1,72 @@
+
+
+
+
+McFly Fastify Adapter
+
+Use fastify as a server framework in McFly
+
+```
+npm create mcfly@latest
+```
+
+McFly is a no-framework framework
that assists in building on the Web
+
+
+
+
+
+
+
+## Features
+
+The time has come for vanilla Web tech. 🎉
+
+✅ Create web apps with vanilla custom elements
+✅ Write real .HTML files
+✅ Have no frameworks or reactivity libraries on the browser
+✅ Use server-side rendering
+✅ Deploy anywhere
+
+## Special directories
+
+**1. `./src/pages/`**
+
+- file-based routing for `.html` files
+- directly use custom elements & static fragments (no imports or registry maintenance needed)
+- use `
+
+
+
+ {{ project.name }}
+ {{ project.description }}
+
+
+ Welcome to {{ project.name }}
+ Server date time: {{new Date().toLocaleString()}}
+
+ Here's an interactive custom element:
+
+
+
+class MyHelloWorld extends WebComponent {
+ static props = {
+ myName: "World",
+ count: 0
+ }
+
+ updateLabel() {
+ this.props.myName = `Clicked ${++this.props.count}x`;
+ }
+
+ get template() {
+ return html`
+ <button onClick=${() => this.updateLabel()} style="cursor:pointer">
+ Hello ${this.props.myName}!
+ </button>`;
+ }
+}
+
+
+
+ Learn how to build components easily at WebComponent.io
+
+
+
+