create-foldkit-app 0.10.0 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/commands/create.js
CHANGED
|
@@ -81,12 +81,15 @@ const displaySuccessMessage = (name, packageManager) => Effect.gen(function* ()
|
|
|
81
81
|
yield* Console.log('');
|
|
82
82
|
yield* Console.log(chalk.bold('AI-Assisted Development'));
|
|
83
83
|
yield* Console.log('');
|
|
84
|
-
yield* Console.log('
|
|
85
|
-
' reference the source, examples, and documentation
|
|
84
|
+
yield* Console.log(' Vendor Foldkit in as a git subtree so your AI assistant can\n' +
|
|
85
|
+
' reference the source, examples, and documentation. Commit\n' +
|
|
86
|
+
' the scaffold first so subtree has a base commit to merge into:');
|
|
86
87
|
yield* Console.log('');
|
|
87
88
|
yield* Console.log(` > ${chalk.cyan('cd')} ${name}`);
|
|
88
89
|
yield* Console.log(` > ${chalk.cyan('git init')}`);
|
|
89
|
-
yield* Console.log(` > ${chalk.cyan('git
|
|
90
|
+
yield* Console.log(` > ${chalk.cyan('git add .')}`);
|
|
91
|
+
yield* Console.log(` > ${chalk.cyan('git commit -m "chore: initial commit"')}`);
|
|
92
|
+
yield* Console.log(` > ${chalk.cyan('git subtree add --prefix=repos/foldkit https://github.com/foldkit/foldkit.git main --squash')}`);
|
|
90
93
|
yield* Console.log('');
|
|
91
94
|
yield* Console.log(` Details: ${chalk.cyan('foldkit.dev/ai/overview')}`);
|
|
92
95
|
yield* Console.log('');
|
package/package.json
CHANGED
package/templates/base/AGENTS.md
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
This is a Foldkit app — a framework built on Effect-TS.
|
|
4
4
|
|
|
5
|
-
If `./repos/foldkit` exists, it contains the full Foldkit repository as a git
|
|
5
|
+
If `./repos/foldkit` exists, it contains the full Foldkit repository, vendored in as a git subtree. The `examples/` directory and `packages/typing-game/client/src/` in particular are the best reference for what idiomatic Foldkit apps look like. Treat the subtree as read-only reference: never import from `repos/foldkit/` in your project source. Imports must come from the `foldkit` npm package.
|
|
6
6
|
|
|
7
|
-
If `./repos/foldkit` does not exist and the line below says `
|
|
7
|
+
If `./repos/foldkit` does not exist and the line below says `subtree_prompted: false`, offer to run `git subtree add --prefix=repos/foldkit https://github.com/foldkit/foldkit.git main --squash`. This gives you access to the full source, examples, and docs. Whether the user accepts or declines, update the value to `true` so it isn't asked again.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
subtree_prompted: false
|
|
10
10
|
|
|
11
11
|
## Project Conventions
|
|
12
12
|
|
|
@@ -133,6 +133,8 @@ Don't reach for Mount just because the work happens to coincide with an element
|
|
|
133
133
|
|
|
134
134
|
### File Organization
|
|
135
135
|
|
|
136
|
+
A Foldkit app lives in two files. `src/main.ts` holds the pure definitions: Model, Messages, init, update, view. `src/entry.ts` imports them and boots the runtime with `Runtime.makeProgram` and `Runtime.run`. `index.html` references `entry.ts`. The split keeps `main.ts` importable from tests without booting a runtime as a side effect. Never call `Runtime.run` from `main.ts`.
|
|
137
|
+
|
|
136
138
|
Use uppercase section headers (`// MODEL`, `// MESSAGE`, `// INIT`, `// UPDATE`, `// COMMAND`, `// VIEW`) to make files easier to skim. These are for wayfinding — they make it clear where things live and where new code should go. Use domain-specific headers too when it helps (e.g. `// PHYSICS`, `// ROUTING`).
|
|
137
139
|
|
|
138
140
|
Even after extracting some sections to their own files (e.g. `message.ts`), the remaining file may still benefit from headers. Extract to separate files when it helps with organization.
|
|
@@ -143,7 +145,7 @@ Test update functions with `foldkit/test`. Since update is pure — `(Model, Mes
|
|
|
143
145
|
|
|
144
146
|
Use `Story.story` to chain steps into a readable narrative: set initial Model → send Message → assert → resolve Command → assert again. Use `Scene.scene` for feature-level testing through the view — clicking buttons, typing into inputs, pressing keys — with accessible locators (`Scene.role`, `Scene.label`, `Scene.placeholder`). Every `Command.define` must include result Message schemas so Commands can be resolved in tests.
|
|
145
147
|
|
|
146
|
-
If the `repos/foldkit`
|
|
148
|
+
If the `repos/foldkit` subtree is available, study the `.test.ts` files in `repos/foldkit/examples/` for patterns — they cover simple Command resolution, multi-step interactions, and Submodel OutMessage assertions.
|
|
147
149
|
|
|
148
150
|
## Debugging with Foldkit DevTools
|
|
149
151
|
|