create-foldkit-app 0.22.1 → 0.23.0
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/README.md +1 -1
- package/dist/examples.js +3 -3
- package/package.json +5 -5
- package/templates/base/AGENTS.md +2 -2
package/README.md
CHANGED
|
@@ -39,7 +39,7 @@ The CLI prompts you for a project name, starter example, and package manager. Pa
|
|
|
39
39
|
| `generative-art` | Perlin-noise flow field with evolving particle trails, mouse vortex, and high-frequency Messages |
|
|
40
40
|
| `auth` | Authentication with Submodels, OutMessage, and protected routes |
|
|
41
41
|
| `shopping-cart` | Complex state management with nested Models and routing |
|
|
42
|
-
| `
|
|
42
|
+
| `state-machine` | Experimental state machine checkout with guarded branches and edge Commands |
|
|
43
43
|
| `pixel-art` | Pixel editor with undo/redo, UI components, and localStorage persistence |
|
|
44
44
|
| `websocket-chat` | Managed resources with WebSocket integration |
|
|
45
45
|
| `managed-resource-layer` | Layer-backed ManagedResource lifecycle with an Effect service |
|
package/dist/examples.js
CHANGED
|
@@ -19,7 +19,7 @@ export const EXAMPLE_VALUES = [
|
|
|
19
19
|
'generative-art',
|
|
20
20
|
'auth',
|
|
21
21
|
'shopping-cart',
|
|
22
|
-
'
|
|
22
|
+
'state-machine',
|
|
23
23
|
'pixel-art',
|
|
24
24
|
'websocket-chat',
|
|
25
25
|
'managed-resource-layer',
|
|
@@ -131,8 +131,8 @@ export const examples = [
|
|
|
131
131
|
description: 'Complex state management with nested models and routing',
|
|
132
132
|
},
|
|
133
133
|
{
|
|
134
|
-
value: '
|
|
135
|
-
title: '
|
|
134
|
+
value: 'state-machine',
|
|
135
|
+
title: 'state-machine',
|
|
136
136
|
description: 'Checkout workflow powered by the experimental state machine module with guarded branches and edge Commands',
|
|
137
137
|
},
|
|
138
138
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-foldkit-app",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.0",
|
|
4
4
|
"description": "Create Foldkit applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -12,15 +12,15 @@
|
|
|
12
12
|
"templates"
|
|
13
13
|
],
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@effect/platform-node": "4.0.0-beta.
|
|
16
|
-
"@effect/platform-node-shared": "4.0.0-beta.
|
|
15
|
+
"@effect/platform-node": "4.0.0-beta.102",
|
|
16
|
+
"@effect/platform-node-shared": "4.0.0-beta.102",
|
|
17
17
|
"chalk": "^5.6.2",
|
|
18
|
-
"effect": "4.0.0-beta.
|
|
18
|
+
"effect": "4.0.0-beta.102",
|
|
19
19
|
"rimraf": "^6.1.3",
|
|
20
20
|
"typescript": "^6.0.3"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@effect/vitest": "4.0.0-beta.
|
|
23
|
+
"@effect/vitest": "4.0.0-beta.102",
|
|
24
24
|
"@types/node": "^25.9.3",
|
|
25
25
|
"vitest": "^4.1.9"
|
|
26
26
|
},
|
package/templates/base/AGENTS.md
CHANGED
|
@@ -52,7 +52,7 @@ Use `evo()` from `foldkit/struct` for immutable model updates. Never spread or `
|
|
|
52
52
|
|
|
53
53
|
### View
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
Every view receives `h`, the typed Html builder, as its last parameter (`view: (model, h) => ...`; `Submodel.defineView` passes the child's own). Never construct a builder; reach for `h.div`, `h.OnClick`, etc. off the parameter, and give extracted view helpers an `h: HtmlBuilder<Message>` last parameter that callers thread through. Only where no builder is in scope, typically module scope, use `inertHtml` from `foldkit/html`, aliased `ih` so the two builders stay distinguishable. Use `h.empty` (not `null`) for conditional rendering, `M.value().pipe(M.tagsExhaustive({...}))` for discriminated unions, and `Array.match` for lists that may be empty.
|
|
56
56
|
|
|
57
57
|
Keys are for mapped list items only: key each row by a stable Model identifier (`h.keyed('li')(item.id, [], [...])`), never by array position, and never derive a key from displayed data. Never key branches; the build gives each view function's output its own identity, so branch switches replace DOM automatically. When switching an inline same-tag ternary must reset DOM state, extract each arm into its own named view function.
|
|
58
58
|
|
|
@@ -84,7 +84,7 @@ Name each test file for its test style, beside the code under test: `story.test.
|
|
|
84
84
|
- Use `Option` instead of `null` or `undefined`. Prefix Option-typed values with `maybe*`. Match with `Option.match`; don't unwrap with `Option.map(...)` + `Option.getOrElse(...)` when you can just match.
|
|
85
85
|
- Use Effect modules over native methods in `pipe` chains (`Array.map`, `String.startsWith`, `Array.findFirst`). Native methods are fine when calling directly on a named variable.
|
|
86
86
|
- Never cast Schema values with `as Type`. Use the callable constructor: `SucceededLogin({ sessionId })`, not `{ _tag: 'SucceededLogin', sessionId } as Message`.
|
|
87
|
-
- Always `Array.
|
|
87
|
+
- Always `Array.isArrayEmpty` / `Array.isArrayNonEmpty` (not `.length === 0` / `.length > 0`). Use `Array.match` when handling both empty and non-empty cases.
|
|
88
88
|
- Never use `for` loops or `let` for iteration. Reach for `Array.map`, `Array.filterMap`, `Array.makeBy`, `Array.reduce`.
|
|
89
89
|
- Never use `T[]`. Always `Array<T>` or `ReadonlyArray<T>`.
|
|
90
90
|
- Always use `Effect.Match`, never `switch`.
|