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.
@@ -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(' Clone Foldkit as a submodule so your AI assistant can\n' +
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 submodule add https://github.com/foldkit/foldkit.git repos/foldkit')}`);
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-foldkit-app",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "description": "Create Foldkit applications",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -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 submodule. The `examples/` directory and `packages/typing-game/client/src/` in particular are the best reference for what idiomatic Foldkit apps look like.
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 `submodule_prompted: false`, offer to run `git submodule add https://github.com/foldkit/foldkit.git repos/foldkit` 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.
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
- submodule_prompted: false
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` submodule 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.
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
 
@@ -8,6 +8,6 @@
8
8
  </head>
9
9
  <body>
10
10
  <div id="root"></div>
11
- <script type="module" src="./src/main.ts"></script>
11
+ <script type="module" src="./src/entry.ts"></script>
12
12
  </body>
13
13
  </html>
@@ -5,6 +5,6 @@ import { defineConfig } from 'vite'
5
5
  export default defineConfig({
6
6
  plugins: [tailwindcss(), foldkit({ devToolsMcpPort: 9988 })],
7
7
  optimizeDeps: {
8
- entries: ['src/main.ts'],
8
+ entries: ['src/entry.ts'],
9
9
  },
10
10
  })