create-foldkit-app 0.31.0 → 0.31.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.
|
@@ -60,7 +60,7 @@ When composing one of those results, bind the whole result to a value named afte
|
|
|
60
60
|
|
|
61
61
|
Pass optional Commands directly to APIs that accept them: `Command.mapMessages(homeInit.commands, toParentMessage)`. Use `result.commands ?? []` only when the next operation requires a concrete array for spreading, concatenating, execution, or an assertion.
|
|
62
62
|
|
|
63
|
-
`Update.Return<Model, Message>`
|
|
63
|
+
Use `Update.Return<Model, Message>` when an update cannot emit an OutMessage. It prevents a result containing an OutMessage from entering code that would keep only its Model and Commands. A result with no `outMessage` can still be used where `Update.ReturnWithOutMessage<Model, Message, OutMessage>` is expected. The missing field means that update emitted no OutMessage.
|
|
64
64
|
|
|
65
65
|
Manual unpacking of a child result usually means the site should use `Update.foldChild` or `Update.foldChildStep`.
|
|
66
66
|
|
|
@@ -68,7 +68,7 @@ Use `Update.combine` when a later Step should receive the Model produced by an e
|
|
|
68
68
|
|
|
69
69
|
When the OutMessage is already known while constructing a new result, include it directly: `{ model, commands, outMessage }`. Use `Update.withOutMessage` when attaching an OutMessage to an existing plain return or when the value has the type `OutMessage | undefined`. Pipe an existing return into the helper: `pipe(dialogClose, Update.withOutMessage(outMessage))`. When constructing the plain return in the same expression, pass it first: `Update.withOutMessage({ model, commands }, outMessage)`.
|
|
70
70
|
|
|
71
|
-
Add `toParentOutMessage` only when at least one child OutMessage
|
|
71
|
+
Add `toParentOutMessage` only when at least one child OutMessage should continue to the current Submodel's parent. For partial forwarding, match every child variant and return `undefined` for the variants that stop here. Omit `toParentOutMessage` when every variant stops here. `foldOutMessage` still handles each variant locally, including variants that continue upward. Never write `toParentOutMessage: () => undefined`.
|
|
72
72
|
|
|
73
73
|
Use `evo()` from `foldkit/struct` for immutable model updates. Never spread or `Object.assign`.
|
|
74
74
|
|
|
@@ -109,7 +109,7 @@ Scene runs at any level, since a page's own `update`/`view` pair drops into `sce
|
|
|
109
109
|
## Code Style
|
|
110
110
|
|
|
111
111
|
- Encode state in discriminated unions, not booleans or nullable fields. `Idle | Loading | Error | Ok`, not `isLoading: boolean`. Make impossible states unrepresentable.
|
|
112
|
-
- Use `Option` for absence in the Model and domain values instead of `null` or `undefined`. Foldkit return records are the exception: omit `commands` and `outMessage` when absent. A partial `toParentOutMessage` mapper returns `undefined` for each
|
|
112
|
+
- Use `Option` for absence in the Model and domain values instead of `null` or `undefined`. Foldkit return records are the exception: omit `commands` and `outMessage` when absent. A partial `toParentOutMessage` mapper returns `undefined` for each child variant that stops at this Submodel. Prefix Option-typed values with `maybe*`. Match with `Option.match`; don't unwrap with `Option.map(...)` + `Option.getOrElse(...)` when you can just match.
|
|
113
113
|
- 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.
|
|
114
114
|
- Never cast Schema values with `as Type`. Use the callable constructor: `Message.SucceededLogin({ sessionId })`, not `{ _tag: 'SucceededLogin', sessionId } as Message`.
|
|
115
115
|
- Always `Array.isArrayEmpty` / `Array.isArrayNonEmpty` (not `.length === 0` / `.length > 0`). Use `Array.match` when handling both empty and non-empty cases.
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"channel": "stable",
|
|
4
|
-
"sourceCommit": "
|
|
4
|
+
"sourceCommit": "a7edce98aebd4863db715e549c0b13d5ccc97bb7",
|
|
5
5
|
"packages": {
|
|
6
|
-
"create-foldkit-app": "0.31.
|
|
7
|
-
"@foldkit/devtools": "0.
|
|
8
|
-
"@foldkit/devtools-mcp": "0.19.
|
|
9
|
-
"foldkit": "0.
|
|
6
|
+
"create-foldkit-app": "0.31.1",
|
|
7
|
+
"@foldkit/devtools": "0.154.0",
|
|
8
|
+
"@foldkit/devtools-mcp": "0.19.1",
|
|
9
|
+
"foldkit": "0.154.0",
|
|
10
10
|
"@foldkit/markdown": "0.8.0",
|
|
11
|
-
"@foldkit/oxlint-plugin": "0.
|
|
12
|
-
"@foldkit/ui": "0.
|
|
11
|
+
"@foldkit/oxlint-plugin": "0.10.0",
|
|
12
|
+
"@foldkit/ui": "0.154.0",
|
|
13
13
|
"@foldkit/vite-plugin": "0.19.0"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@foldkit/devtools": "0.
|
|
16
|
+
"@foldkit/devtools": "0.154.0",
|
|
17
17
|
"@foldkit/vite-plugin": "0.19.0",
|
|
18
|
-
"@foldkit/devtools-mcp": "0.19.
|
|
19
|
-
"@foldkit/oxlint-plugin": "0.
|
|
18
|
+
"@foldkit/devtools-mcp": "0.19.1",
|
|
19
|
+
"@foldkit/oxlint-plugin": "0.10.0",
|
|
20
20
|
"@trivago/prettier-plugin-sort-imports": "^6.0.2",
|
|
21
21
|
"@types/node": "^25.9.3",
|
|
22
22
|
"happy-dom": "^20.10.4",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-foldkit-app",
|
|
3
|
-
"version": "0.31.
|
|
3
|
+
"version": "0.31.1",
|
|
4
4
|
"description": "Create Foldkit applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"url": "https://github.com/foldkit/foldkit.git",
|
|
39
39
|
"directory": "packages/create-foldkit-app"
|
|
40
40
|
},
|
|
41
|
+
"homepage": "https://foldkit.dev/get-started/getting-started",
|
|
41
42
|
"publishConfig": {
|
|
42
43
|
"access": "public"
|
|
43
44
|
},
|