openuispec 0.1.11 → 0.1.13
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/index.ts +1 -1
- package/cli/init.ts +33 -24
- package/package.json +1 -1
- package/schema/validate.ts +2 -4
package/cli/index.ts
CHANGED
package/cli/init.ts
CHANGED
|
@@ -170,16 +170,19 @@ 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
|
-
## Learning OpenUISpec —
|
|
173
|
+
## Learning OpenUISpec — where to find the docs
|
|
174
174
|
|
|
175
|
-
All documentation is included in the installed package
|
|
176
|
-
1. **
|
|
177
|
-
2. **
|
|
178
|
-
3. **
|
|
175
|
+
All documentation is included in the installed \`openuispec\` package. Search for it in this order:
|
|
176
|
+
1. **Local:** \`node_modules/openuispec/\` (if installed as a project dependency)
|
|
177
|
+
2. **Global:** run \`npm root -g\` to find the global prefix, then look in \`<prefix>/openuispec/\`
|
|
178
|
+
3. **Online fallback:** if the package is not installed at all, fetch from:
|
|
179
|
+
- \`https://openuispec.rsteam.uz/llms-full.txt\` — complete spec + all JSON schemas in one file
|
|
180
|
+
- \`https://openuispec.rsteam.uz/llms.txt\` — concise summary with links
|
|
179
181
|
|
|
180
|
-
|
|
181
|
-
- \`
|
|
182
|
-
- \`
|
|
182
|
+
Inside the package:
|
|
183
|
+
- **Full specification:** \`spec/openuispec-v0.1.md\`
|
|
184
|
+
- **Example app:** \`examples/taskflow/\`
|
|
185
|
+
- **JSON Schemas:** \`schema/\`
|
|
183
186
|
|
|
184
187
|
## Token file structure — root wrapper key required
|
|
185
188
|
|
|
@@ -219,9 +222,9 @@ Root keys: \`color\`, \`typography\`, \`spacing\`, \`elevation\`, \`motion\`, \`
|
|
|
219
222
|
| \`tokens/themes.yaml\` | \`tokens/themes.schema.json\` | \`themes\` |
|
|
220
223
|
| \`tokens/icons.yaml\` | \`tokens/icons.schema.json\` | \`icons\` |
|
|
221
224
|
|
|
222
|
-
All schemas are in \`
|
|
225
|
+
All schemas are in \`schema/\` inside the installed package. Shared type definitions (actions, data-binding, adaptive, validation, common) are in \`schema/defs/\`.
|
|
223
226
|
|
|
224
|
-
**Workflow:** read the schema → read an example from \`
|
|
227
|
+
**Workflow:** read the schema → read an example from \`examples/taskflow/\` → create the YAML → run \`openuispec validate\`.
|
|
225
228
|
|
|
226
229
|
## Spec format quick reference
|
|
227
230
|
|
|
@@ -247,9 +250,12 @@ This project generates native code for: **${targetList}**
|
|
|
247
250
|
|
|
248
251
|
## Learn more
|
|
249
252
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
-
|
|
253
|
+
All docs and examples are in the installed \`openuispec\` package — check \`node_modules/openuispec/\` or run \`npm root -g\` for the global install path.
|
|
254
|
+
|
|
255
|
+
- Full spec: \`spec/openuispec-v0.1.md\`
|
|
256
|
+
- Example app: \`examples/taskflow/\`
|
|
257
|
+
- JSON Schemas: \`schema/\`
|
|
258
|
+
- Online reference: \`https://openuispec.rsteam.uz/llms-full.txt\`
|
|
253
259
|
`;
|
|
254
260
|
}
|
|
255
261
|
|
|
@@ -308,15 +314,18 @@ This means the project has existing UI code but hasn't been specced yet. Your jo
|
|
|
308
314
|
2. Run \`openuispec drift --snapshot --target <target>\` for each affected platform.
|
|
309
315
|
3. Run \`openuispec drift\` to verify no untracked drift remains.
|
|
310
316
|
|
|
311
|
-
## Learning OpenUISpec —
|
|
312
|
-
All documentation is
|
|
313
|
-
1. **
|
|
314
|
-
2. **
|
|
315
|
-
3. **
|
|
317
|
+
## Learning OpenUISpec — where to find the docs
|
|
318
|
+
All documentation is in the installed \`openuispec\` package. Search in this order:
|
|
319
|
+
1. **Local:** \`node_modules/openuispec/\` (project dependency)
|
|
320
|
+
2. **Global:** run \`npm root -g\` to get the global prefix, then look in \`<prefix>/openuispec/\`
|
|
321
|
+
3. **Online fallback:** if not installed, fetch from:
|
|
322
|
+
- \`https://openuispec.rsteam.uz/llms-full.txt\` — complete spec + all JSON schemas
|
|
323
|
+
- \`https://openuispec.rsteam.uz/llms.txt\` — concise summary with links
|
|
316
324
|
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
325
|
+
Inside the package:
|
|
326
|
+
1. **Full specification:** \`spec/openuispec-v0.1.md\` — the complete spec (read this to understand the format)
|
|
327
|
+
2. **Example app:** \`examples/taskflow/\` — a complete working app with all file types
|
|
328
|
+
3. **JSON Schemas:** \`schema/\` — validation schemas that define the exact structure of every file type
|
|
320
329
|
|
|
321
330
|
## Token file structure — root wrapper key required
|
|
322
331
|
Every token file must have a single root key matching the token type. Do NOT put properties at the top level.
|
|
@@ -332,7 +341,7 @@ Every token file must have a single root key matching the token type. Do NOT put
|
|
|
332
341
|
## File formats and schemas — read before creating spec files
|
|
333
342
|
Before creating or editing any spec file, read the corresponding JSON Schema. Do not guess the file format.
|
|
334
343
|
|
|
335
|
-
| File | Schema (in \`
|
|
344
|
+
| File | Schema (in \`schema/\` inside the installed package) | Root key |
|
|
336
345
|
|------|--------|----------|
|
|
337
346
|
| \`openuispec.yaml\` | \`openuispec.schema.json\` | \`spec_version\` |
|
|
338
347
|
| \`screens/*.yaml\` | \`screen.schema.json\` | \`<screen_id>\` |
|
|
@@ -351,7 +360,7 @@ Before creating or editing any spec file, read the corresponding JSON Schema. Do
|
|
|
351
360
|
|
|
352
361
|
Shared type definitions (actions, data-binding, adaptive, validation, common) are in \`schema/defs/\`.
|
|
353
362
|
|
|
354
|
-
Workflow: read the schema → read an example from \`
|
|
363
|
+
Workflow: read the schema → read an example from \`examples/taskflow/\` → create the YAML → run \`openuispec validate\`.
|
|
355
364
|
|
|
356
365
|
## Spec format reference
|
|
357
366
|
- 7 contract families: nav_container, surface, action_trigger, input_field, data_display, collection, feedback
|
|
@@ -496,7 +505,7 @@ Commands:
|
|
|
496
505
|
|
|
497
506
|
AI rules have been added to CLAUDE.md and AGENTS.md.
|
|
498
507
|
|
|
499
|
-
|
|
508
|
+
Docs: https://openuispec.rsteam.uz
|
|
500
509
|
`);
|
|
501
510
|
} catch (err) {
|
|
502
511
|
rl.close();
|
package/package.json
CHANGED
package/schema/validate.ts
CHANGED
|
@@ -97,10 +97,8 @@ function validateFile(
|
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
// Convert schema URL to a local path for display
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
"node_modules/openuispec/schema/",
|
|
103
|
-
);
|
|
100
|
+
const schemaRelPath = schemaId.replace(BASE, "");
|
|
101
|
+
const schemaLocalPath = resolve(SCHEMA_DIR, schemaRelPath);
|
|
104
102
|
|
|
105
103
|
const errors: ErrorObject[] = validate.errors ?? [];
|
|
106
104
|
console.log(` FAIL ${name} (${errors.length} error(s))`);
|