openuispec 0.1.6 → 0.1.7
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 +47 -0
- package/package.json +1 -1
package/cli/init.ts
CHANGED
|
@@ -170,6 +170,39 @@ OpenUISpec is a YAML-based format that describes your app's UI semantically —
|
|
|
170
170
|
- \`draft\` — actively being specced. Tracked by drift.
|
|
171
171
|
- \`ready\` — fully specified (default if omitted). Tracked by drift.
|
|
172
172
|
|
|
173
|
+
## JSON Schemas (validation & file structure)
|
|
174
|
+
|
|
175
|
+
**IMPORTANT:** Before creating or editing any spec file, read the corresponding JSON Schema to understand the valid structure. Schemas are located in the installed package:
|
|
176
|
+
|
|
177
|
+
\`\`\`
|
|
178
|
+
node_modules/openuispec/schema/
|
|
179
|
+
├── openuispec.schema.json ← root manifest (openuispec.yaml)
|
|
180
|
+
├── screen.schema.json ← screen files (screens/*.yaml)
|
|
181
|
+
├── flow.schema.json ← flow files (flows/*.yaml)
|
|
182
|
+
├── platform.schema.json ← platform overrides (platform/*.yaml)
|
|
183
|
+
├── locale.schema.json ← locale files (locales/*.json)
|
|
184
|
+
├── custom-contract.schema.json ← custom contracts (contracts/*.yaml)
|
|
185
|
+
├── tokens/
|
|
186
|
+
│ ├── color.schema.json ← tokens/color.yaml
|
|
187
|
+
│ ├── typography.schema.json ← tokens/typography.yaml
|
|
188
|
+
│ ├── spacing.schema.json ← tokens/spacing.yaml
|
|
189
|
+
│ ├── elevation.schema.json ← tokens/elevation.yaml
|
|
190
|
+
│ ├── motion.schema.json ← tokens/motion.yaml
|
|
191
|
+
│ ├── layout.schema.json ← tokens/layout.yaml
|
|
192
|
+
│ ├── themes.schema.json ← tokens/themes.yaml
|
|
193
|
+
│ └── icons.schema.json ← tokens/icons.yaml
|
|
194
|
+
└── defs/
|
|
195
|
+
├── common.schema.json ← shared types (icons, badges, etc.)
|
|
196
|
+
├── action.schema.json ← 13 action types (discriminated union)
|
|
197
|
+
├── data-binding.schema.json ← data sources, state, params
|
|
198
|
+
├── adaptive.schema.json ← adaptive override pattern
|
|
199
|
+
└── validation.schema.json ← validation rule definitions
|
|
200
|
+
\`\`\`
|
|
201
|
+
|
|
202
|
+
**Workflow:** read the schema → create the YAML file → run \`openuispec validate\` to verify.
|
|
203
|
+
|
|
204
|
+
**Example spec files:** \`node_modules/openuispec/examples/taskflow/\` — a complete app demonstrating all file types. Read these for real-world examples of screens, flows, tokens, and platform overrides.
|
|
205
|
+
|
|
173
206
|
## Spec format quick reference
|
|
174
207
|
|
|
175
208
|
- **7 contract families:** nav_container, surface, action_trigger, input_field, data_display, collection, feedback
|
|
@@ -255,6 +288,20 @@ This means the project has existing UI code but hasn't been specced yet. Your jo
|
|
|
255
288
|
2. Run \`openuispec drift --snapshot --target <target>\` for each affected platform.
|
|
256
289
|
3. Run \`openuispec drift\` to verify no untracked drift remains.
|
|
257
290
|
|
|
291
|
+
## JSON Schemas — read before creating spec files
|
|
292
|
+
Before creating or editing any spec file, read the corresponding JSON Schema to understand the valid structure. Schemas are in the installed package:
|
|
293
|
+
- \`node_modules/openuispec/schema/openuispec.schema.json\` — root manifest
|
|
294
|
+
- \`node_modules/openuispec/schema/screen.schema.json\` — screens
|
|
295
|
+
- \`node_modules/openuispec/schema/flow.schema.json\` — flows
|
|
296
|
+
- \`node_modules/openuispec/schema/platform.schema.json\` — platform overrides
|
|
297
|
+
- \`node_modules/openuispec/schema/locale.schema.json\` — locales
|
|
298
|
+
- \`node_modules/openuispec/schema/custom-contract.schema.json\` — custom contracts
|
|
299
|
+
- \`node_modules/openuispec/schema/tokens/*.schema.json\` — token files (color, typography, spacing, elevation, motion, layout, themes, icons)
|
|
300
|
+
- \`node_modules/openuispec/schema/defs/*.schema.json\` — shared types (actions, data-binding, adaptive, validation, common)
|
|
301
|
+
|
|
302
|
+
Workflow: read the schema → create the YAML → run \`openuispec validate\`.
|
|
303
|
+
Example spec files: \`node_modules/openuispec/examples/taskflow/\` — a complete app with all file types.
|
|
304
|
+
|
|
258
305
|
## Spec format reference
|
|
259
306
|
- 7 contract families: nav_container, surface, action_trigger, input_field, data_display, collection, feedback
|
|
260
307
|
- Custom contracts: prefixed with \`x_\` (e.g., \`x_media_player\`)
|