openuispec 0.1.24 → 0.1.25
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/cli/init.ts +35 -12
- package/package.json +1 -1
package/cli/init.ts
CHANGED
|
@@ -252,18 +252,41 @@ This means the project has existing UI code but hasn't been specced yet. Your jo
|
|
|
252
252
|
4. **Extract tokens** — scan for colors, fonts, spacing and create files in \`${specDir}/tokens/\`.
|
|
253
253
|
5. **Update the manifest** — fill in \`data_model\` and \`api.endpoints\` in \`${specDir}/openuispec.yaml\`.
|
|
254
254
|
|
|
255
|
-
##
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
255
|
+
## OpenUISpec Source Of Truth
|
|
256
|
+
|
|
257
|
+
OpenUISpec spec files are the primary source of truth for UI behavior across platforms.
|
|
258
|
+
|
|
259
|
+
### Start from spec when:
|
|
260
|
+
- the request changes screen structure
|
|
261
|
+
- the request changes navigation
|
|
262
|
+
- the request changes fields, actions, validation, or data binding
|
|
263
|
+
- the request changes tokens, variants, contracts, flows, or localization
|
|
264
|
+
- the request affects more than one platform
|
|
265
|
+
- the request is phrased in product/UI terms rather than platform-code terms
|
|
266
|
+
|
|
267
|
+
Spec-first workflow:
|
|
268
|
+
1. Read \`${specDir}/openuispec.yaml\` and the relevant spec files first.
|
|
269
|
+
2. Update the spec first.
|
|
270
|
+
3. Update the affected generated/native UI code to match the spec.
|
|
271
|
+
4. Run \`openuispec validate\`.
|
|
272
|
+
5. Verify the affected UI targets build/run if possible.
|
|
273
|
+
6. Only then run \`openuispec drift --snapshot --target <target>\` for affected targets.
|
|
274
|
+
7. Run \`openuispec drift --target <target>\` as a bookkeeping check.
|
|
275
|
+
|
|
276
|
+
### Start from platform code when:
|
|
277
|
+
- the change is platform-specific polish
|
|
278
|
+
- the change is a local bug fix that does not alter shared semantic behavior
|
|
279
|
+
- the request explicitly asks for an iOS-only, Android-only, or web-only adjustment
|
|
280
|
+
|
|
281
|
+
Platform-first workflow:
|
|
282
|
+
1. Update native/platform code.
|
|
283
|
+
2. If the change affects shared semantics, sync the spec afterward.
|
|
284
|
+
3. If the change is intentionally platform-specific, document it in \`platform/*.yaml\` when appropriate.
|
|
285
|
+
|
|
286
|
+
### Never do this:
|
|
287
|
+
- Do not snapshot drift immediately after changing spec unless the UI code has also been updated.
|
|
288
|
+
- Do not treat \`openuispec drift\` as proof that generated UI matches the spec.
|
|
289
|
+
- Do not modify generated UI without checking whether the spec must change first.
|
|
267
290
|
|
|
268
291
|
## CLI commands
|
|
269
292
|
- \`openuispec init\` — scaffold a new spec project
|