openuispec 0.1.12 → 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 +32 -26
- 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,12 +250,12 @@ This project generates native code for: **${targetList}**
|
|
|
247
250
|
|
|
248
251
|
## Learn more
|
|
249
252
|
|
|
250
|
-
All docs and examples are
|
|
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.
|
|
251
254
|
|
|
252
|
-
- Full spec: \`
|
|
253
|
-
- Example app: \`
|
|
254
|
-
- JSON Schemas: \`
|
|
255
|
-
-
|
|
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\`
|
|
256
259
|
`;
|
|
257
260
|
}
|
|
258
261
|
|
|
@@ -311,15 +314,18 @@ This means the project has existing UI code but hasn't been specced yet. Your jo
|
|
|
311
314
|
2. Run \`openuispec drift --snapshot --target <target>\` for each affected platform.
|
|
312
315
|
3. Run \`openuispec drift\` to verify no untracked drift remains.
|
|
313
316
|
|
|
314
|
-
## Learning OpenUISpec —
|
|
315
|
-
All documentation is
|
|
316
|
-
1. **
|
|
317
|
-
2. **
|
|
318
|
-
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
|
|
319
324
|
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
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
|
|
323
329
|
|
|
324
330
|
## Token file structure — root wrapper key required
|
|
325
331
|
Every token file must have a single root key matching the token type. Do NOT put properties at the top level.
|
|
@@ -335,7 +341,7 @@ Every token file must have a single root key matching the token type. Do NOT put
|
|
|
335
341
|
## File formats and schemas — read before creating spec files
|
|
336
342
|
Before creating or editing any spec file, read the corresponding JSON Schema. Do not guess the file format.
|
|
337
343
|
|
|
338
|
-
| File | Schema (in \`
|
|
344
|
+
| File | Schema (in \`schema/\` inside the installed package) | Root key |
|
|
339
345
|
|------|--------|----------|
|
|
340
346
|
| \`openuispec.yaml\` | \`openuispec.schema.json\` | \`spec_version\` |
|
|
341
347
|
| \`screens/*.yaml\` | \`screen.schema.json\` | \`<screen_id>\` |
|
|
@@ -354,7 +360,7 @@ Before creating or editing any spec file, read the corresponding JSON Schema. Do
|
|
|
354
360
|
|
|
355
361
|
Shared type definitions (actions, data-binding, adaptive, validation, common) are in \`schema/defs/\`.
|
|
356
362
|
|
|
357
|
-
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\`.
|
|
358
364
|
|
|
359
365
|
## Spec format reference
|
|
360
366
|
- 7 contract families: nav_container, surface, action_trigger, input_field, data_display, collection, feedback
|
|
@@ -499,7 +505,7 @@ Commands:
|
|
|
499
505
|
|
|
500
506
|
AI rules have been added to CLAUDE.md and AGENTS.md.
|
|
501
507
|
|
|
502
|
-
Docs:
|
|
508
|
+
Docs: https://openuispec.rsteam.uz
|
|
503
509
|
`);
|
|
504
510
|
} catch (err) {
|
|
505
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))`);
|