@aestheticfunction/dspack-emit 0.4.0 → 0.4.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.
- package/dist/transform/profile-load.d.ts +2 -2
- package/dist/transform/profile-load.js +3 -5
- package/dist/transform/profile-schema.d.ts +8 -0
- package/dist/transform/profile-schema.js +382 -0
- package/dist/validate/ajv.js +2 -4
- package/dist/validate/meta/catalog-meta.d.ts +10 -0
- package/dist/validate/meta/catalog-meta.js +157 -0
- package/package.json +2 -2
- package/src/browser-boundary.test.ts +47 -0
- package/src/schema-mirrors.test.ts +30 -0
- package/src/transform/profile-load.ts +4 -7
- package/src/transform/profile-schema.ts +382 -0
- package/src/validate/ajv.ts +2 -6
- package/src/validate/meta/catalog-meta.ts +167 -0
- package/dist/transform/profile.v1.schema.json +0 -153
- package/dist/validate/meta/a2ui-catalog.meta.0_9_1.json +0 -39
- package/dist/validate/meta/a2ui-catalog.meta.1_0.json +0 -34
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { Profile } from "./profiles.js";
|
|
2
|
+
/** The profile schema, as shipped (also exported for hosts that surface it in UI). */
|
|
3
|
+
export { profileSchema } from "./profile-schema.js";
|
|
2
4
|
export interface ProfileLoadIssue {
|
|
3
5
|
/** JSON path into the offending document (ajv instancePath). */
|
|
4
6
|
path: string;
|
|
@@ -8,8 +10,6 @@ export declare class ProfileLoadError extends Error {
|
|
|
8
10
|
readonly issues: ProfileLoadIssue[];
|
|
9
11
|
constructor(issues: ProfileLoadIssue[]);
|
|
10
12
|
}
|
|
11
|
-
/** The profile schema, as shipped (also exported for hosts that surface it in UI). */
|
|
12
|
-
export declare const profileSchema: Record<string, unknown>;
|
|
13
13
|
/**
|
|
14
14
|
* Validate `json` as a v1 profile document and return the engine-ready
|
|
15
15
|
* `Profile`. The `profileVersion` envelope field is stripped — it belongs to
|
|
@@ -12,10 +12,11 @@
|
|
|
12
12
|
* convention as the catalog gates (src/validate/ajv.ts) and the dspack
|
|
13
13
|
* harness.
|
|
14
14
|
*/
|
|
15
|
-
import { readFileSync } from "node:fs";
|
|
16
|
-
import { fileURLToPath } from "node:url";
|
|
17
15
|
import Ajv2020 from "ajv/dist/2020.js";
|
|
18
16
|
import addFormats from "ajv-formats";
|
|
17
|
+
import { profileSchema } from "./profile-schema.js";
|
|
18
|
+
/** The profile schema, as shipped (also exported for hosts that surface it in UI). */
|
|
19
|
+
export { profileSchema } from "./profile-schema.js";
|
|
19
20
|
export class ProfileLoadError extends Error {
|
|
20
21
|
issues;
|
|
21
22
|
constructor(issues) {
|
|
@@ -29,9 +30,6 @@ export class ProfileLoadError extends Error {
|
|
|
29
30
|
this.name = "ProfileLoadError";
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
|
-
const schemaPath = fileURLToPath(new URL("./profile.v1.schema.json", import.meta.url));
|
|
33
|
-
/** The profile schema, as shipped (also exported for hosts that surface it in UI). */
|
|
34
|
-
export const profileSchema = JSON.parse(readFileSync(schemaPath, "utf8"));
|
|
35
33
|
let compiled;
|
|
36
34
|
function validator() {
|
|
37
35
|
if (!compiled) {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime mirror of profile.v1.schema.json. The .json file stays the
|
|
3
|
+
* reviewable schema document (docs/PROFILES.md links it); this constant
|
|
4
|
+
* exists because loadProfile must run in a browser bundle (dspack-studio
|
|
5
|
+
* composer), where readFileSync is not available. src/schema-mirrors.test.ts
|
|
6
|
+
* asserts mirror and JSON stay identical — edit both together.
|
|
7
|
+
*/
|
|
8
|
+
export declare const profileSchema: Record<string, unknown>;
|
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime mirror of profile.v1.schema.json. The .json file stays the
|
|
3
|
+
* reviewable schema document (docs/PROFILES.md links it); this constant
|
|
4
|
+
* exists because loadProfile must run in a browser bundle (dspack-studio
|
|
5
|
+
* composer), where readFileSync is not available. src/schema-mirrors.test.ts
|
|
6
|
+
* asserts mirror and JSON stay identical — edit both together.
|
|
7
|
+
*/
|
|
8
|
+
export const profileSchema = {
|
|
9
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
10
|
+
"$id": "https://aestheticfunction.github.io/dspack-emit/schema/profile.v1.schema.json",
|
|
11
|
+
"title": "dspack-emit a2ui Profile v1",
|
|
12
|
+
"description": "JSON form of the a2ui target's mapping Profile. Mirrors the TypeScript Profile interface in src/transform/profiles.ts one to one; loadProfile() validates against this schema before the engine runs.",
|
|
13
|
+
"type": "object",
|
|
14
|
+
"additionalProperties": false,
|
|
15
|
+
"patternProperties": {
|
|
16
|
+
"^x-": {}
|
|
17
|
+
},
|
|
18
|
+
"required": [
|
|
19
|
+
"profileVersion",
|
|
20
|
+
"catalogTitle",
|
|
21
|
+
"catalogDescription",
|
|
22
|
+
"catalogIdBase",
|
|
23
|
+
"instructions",
|
|
24
|
+
"primaryColorToken",
|
|
25
|
+
"components",
|
|
26
|
+
"synthesized",
|
|
27
|
+
"casualtyComponents",
|
|
28
|
+
"surfaceSynthesis"
|
|
29
|
+
],
|
|
30
|
+
"properties": {
|
|
31
|
+
"profileVersion": {
|
|
32
|
+
"const": "1"
|
|
33
|
+
},
|
|
34
|
+
"catalogTitle": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"minLength": 1
|
|
37
|
+
},
|
|
38
|
+
"catalogDescription": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"minLength": 1
|
|
41
|
+
},
|
|
42
|
+
"catalogIdBase": {
|
|
43
|
+
"type": "string",
|
|
44
|
+
"format": "uri",
|
|
45
|
+
"pattern": "^https://"
|
|
46
|
+
},
|
|
47
|
+
"instructions": {
|
|
48
|
+
"type": "string"
|
|
49
|
+
},
|
|
50
|
+
"primaryColorToken": {
|
|
51
|
+
"type": "object",
|
|
52
|
+
"additionalProperties": false,
|
|
53
|
+
"required": [
|
|
54
|
+
"category",
|
|
55
|
+
"name"
|
|
56
|
+
],
|
|
57
|
+
"properties": {
|
|
58
|
+
"category": {
|
|
59
|
+
"type": "string",
|
|
60
|
+
"minLength": 1
|
|
61
|
+
},
|
|
62
|
+
"name": {
|
|
63
|
+
"type": "string",
|
|
64
|
+
"minLength": 1
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"components": {
|
|
69
|
+
"type": "array",
|
|
70
|
+
"items": {
|
|
71
|
+
"$ref": "#/$defs/componentPlan"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"synthesized": {
|
|
75
|
+
"type": "array",
|
|
76
|
+
"items": {
|
|
77
|
+
"$ref": "#/$defs/componentPlan"
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"casualtyComponents": {
|
|
81
|
+
"type": "array",
|
|
82
|
+
"items": {
|
|
83
|
+
"type": "object",
|
|
84
|
+
"additionalProperties": false,
|
|
85
|
+
"patternProperties": {
|
|
86
|
+
"^x-": {}
|
|
87
|
+
},
|
|
88
|
+
"required": [
|
|
89
|
+
"dspackId",
|
|
90
|
+
"attempted",
|
|
91
|
+
"class",
|
|
92
|
+
"reason"
|
|
93
|
+
],
|
|
94
|
+
"properties": {
|
|
95
|
+
"dspackId": {
|
|
96
|
+
"$ref": "#/$defs/dspackId"
|
|
97
|
+
},
|
|
98
|
+
"attempted": {
|
|
99
|
+
"type": "string",
|
|
100
|
+
"minLength": 1
|
|
101
|
+
},
|
|
102
|
+
"class": {
|
|
103
|
+
"enum": [
|
|
104
|
+
"maps-cleanly",
|
|
105
|
+
"synthesis-defaults",
|
|
106
|
+
"lossy",
|
|
107
|
+
"cannot-represent"
|
|
108
|
+
]
|
|
109
|
+
},
|
|
110
|
+
"reason": {
|
|
111
|
+
"type": "string",
|
|
112
|
+
"minLength": 1
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
"intentionallyOmitted": {
|
|
118
|
+
"type": "array",
|
|
119
|
+
"items": {
|
|
120
|
+
"$ref": "#/$defs/dspackId"
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
"surfaceSynthesis": {
|
|
124
|
+
"type": "object",
|
|
125
|
+
"additionalProperties": false,
|
|
126
|
+
"required": [
|
|
127
|
+
"textComponent",
|
|
128
|
+
"textProp",
|
|
129
|
+
"wrapComponent",
|
|
130
|
+
"wrapChildrenProp"
|
|
131
|
+
],
|
|
132
|
+
"properties": {
|
|
133
|
+
"textComponent": {
|
|
134
|
+
"$ref": "#/$defs/a2uiName"
|
|
135
|
+
},
|
|
136
|
+
"textProp": {
|
|
137
|
+
"type": "string",
|
|
138
|
+
"minLength": 1
|
|
139
|
+
},
|
|
140
|
+
"wrapComponent": {
|
|
141
|
+
"$ref": "#/$defs/a2uiName"
|
|
142
|
+
},
|
|
143
|
+
"wrapChildrenProp": {
|
|
144
|
+
"type": "string",
|
|
145
|
+
"minLength": 1
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
"$defs": {
|
|
151
|
+
"dspackId": {
|
|
152
|
+
"type": "string",
|
|
153
|
+
"pattern": "^[a-z][a-z0-9-]*$"
|
|
154
|
+
},
|
|
155
|
+
"a2uiName": {
|
|
156
|
+
"type": "string",
|
|
157
|
+
"pattern": "^[A-Z][A-Za-z0-9]*$"
|
|
158
|
+
},
|
|
159
|
+
"componentPlan": {
|
|
160
|
+
"type": "object",
|
|
161
|
+
"additionalProperties": false,
|
|
162
|
+
"patternProperties": {
|
|
163
|
+
"^x-": {}
|
|
164
|
+
},
|
|
165
|
+
"required": [
|
|
166
|
+
"a2ui",
|
|
167
|
+
"commons",
|
|
168
|
+
"structural",
|
|
169
|
+
"required"
|
|
170
|
+
],
|
|
171
|
+
"properties": {
|
|
172
|
+
"a2ui": {
|
|
173
|
+
"$ref": "#/$defs/a2uiName"
|
|
174
|
+
},
|
|
175
|
+
"dspackId": {
|
|
176
|
+
"$ref": "#/$defs/dspackId"
|
|
177
|
+
},
|
|
178
|
+
"description": {
|
|
179
|
+
"type": "string"
|
|
180
|
+
},
|
|
181
|
+
"commons": {
|
|
182
|
+
"type": "array",
|
|
183
|
+
"items": {
|
|
184
|
+
"type": "string",
|
|
185
|
+
"minLength": 1
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
"structural": {
|
|
189
|
+
"type": "object",
|
|
190
|
+
"additionalProperties": {
|
|
191
|
+
"type": "object",
|
|
192
|
+
"additionalProperties": false,
|
|
193
|
+
"required": [
|
|
194
|
+
"schema",
|
|
195
|
+
"description",
|
|
196
|
+
"synthNote"
|
|
197
|
+
],
|
|
198
|
+
"properties": {
|
|
199
|
+
"schema": {},
|
|
200
|
+
"description": {
|
|
201
|
+
"type": "string",
|
|
202
|
+
"minLength": 1
|
|
203
|
+
},
|
|
204
|
+
"synthNote": {
|
|
205
|
+
"type": "string",
|
|
206
|
+
"minLength": 1
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
"propMap": {
|
|
212
|
+
"type": "object",
|
|
213
|
+
"additionalProperties": {
|
|
214
|
+
"type": "object",
|
|
215
|
+
"additionalProperties": false,
|
|
216
|
+
"required": [
|
|
217
|
+
"a2ui",
|
|
218
|
+
"kind"
|
|
219
|
+
],
|
|
220
|
+
"properties": {
|
|
221
|
+
"a2ui": {
|
|
222
|
+
"type": "string",
|
|
223
|
+
"minLength": 1
|
|
224
|
+
},
|
|
225
|
+
"kind": {
|
|
226
|
+
"enum": [
|
|
227
|
+
"enum",
|
|
228
|
+
"string",
|
|
229
|
+
"boolean",
|
|
230
|
+
"number"
|
|
231
|
+
]
|
|
232
|
+
},
|
|
233
|
+
"targetEnum": {
|
|
234
|
+
"type": "array",
|
|
235
|
+
"items": {
|
|
236
|
+
"type": "string"
|
|
237
|
+
},
|
|
238
|
+
"minItems": 1
|
|
239
|
+
},
|
|
240
|
+
"valueMap": {
|
|
241
|
+
"type": "object",
|
|
242
|
+
"additionalProperties": {
|
|
243
|
+
"type": "string"
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
"default": {
|
|
247
|
+
"type": "string"
|
|
248
|
+
},
|
|
249
|
+
"description": {
|
|
250
|
+
"type": "string"
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
"required": {
|
|
256
|
+
"type": "array",
|
|
257
|
+
"items": {
|
|
258
|
+
"type": "string"
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
"surfacePlan": {
|
|
262
|
+
"type": "object",
|
|
263
|
+
"additionalProperties": false,
|
|
264
|
+
"properties": {
|
|
265
|
+
"subText": {
|
|
266
|
+
"type": "object",
|
|
267
|
+
"additionalProperties": {
|
|
268
|
+
"type": "string"
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
"subButtonText": {
|
|
272
|
+
"type": "object",
|
|
273
|
+
"additionalProperties": {
|
|
274
|
+
"type": "string"
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
"actionProp": {
|
|
278
|
+
"type": "string"
|
|
279
|
+
},
|
|
280
|
+
"textChildProp": {
|
|
281
|
+
"type": "string"
|
|
282
|
+
},
|
|
283
|
+
"textProp": {
|
|
284
|
+
"type": "string"
|
|
285
|
+
},
|
|
286
|
+
"childProp": {
|
|
287
|
+
"type": "string"
|
|
288
|
+
},
|
|
289
|
+
"childrenProp": {
|
|
290
|
+
"type": "string"
|
|
291
|
+
},
|
|
292
|
+
"structuralPassthrough": {
|
|
293
|
+
"type": "array",
|
|
294
|
+
"items": {
|
|
295
|
+
"type": "string"
|
|
296
|
+
}
|
|
297
|
+
},
|
|
298
|
+
"subTable": {
|
|
299
|
+
"type": "object",
|
|
300
|
+
"additionalProperties": false,
|
|
301
|
+
"required": [
|
|
302
|
+
"caption",
|
|
303
|
+
"header",
|
|
304
|
+
"headerCell",
|
|
305
|
+
"body",
|
|
306
|
+
"row",
|
|
307
|
+
"cell",
|
|
308
|
+
"targetCaption",
|
|
309
|
+
"targetColumns",
|
|
310
|
+
"targetRows",
|
|
311
|
+
"drops"
|
|
312
|
+
],
|
|
313
|
+
"properties": {
|
|
314
|
+
"caption": {
|
|
315
|
+
"type": "string"
|
|
316
|
+
},
|
|
317
|
+
"header": {
|
|
318
|
+
"type": "string"
|
|
319
|
+
},
|
|
320
|
+
"headerCell": {
|
|
321
|
+
"type": "string"
|
|
322
|
+
},
|
|
323
|
+
"body": {
|
|
324
|
+
"type": "string"
|
|
325
|
+
},
|
|
326
|
+
"row": {
|
|
327
|
+
"type": "string"
|
|
328
|
+
},
|
|
329
|
+
"cell": {
|
|
330
|
+
"type": "string"
|
|
331
|
+
},
|
|
332
|
+
"targetCaption": {
|
|
333
|
+
"type": "string"
|
|
334
|
+
},
|
|
335
|
+
"targetColumns": {
|
|
336
|
+
"type": "string"
|
|
337
|
+
},
|
|
338
|
+
"targetRows": {
|
|
339
|
+
"type": "string"
|
|
340
|
+
},
|
|
341
|
+
"drops": {
|
|
342
|
+
"type": "object",
|
|
343
|
+
"additionalProperties": {
|
|
344
|
+
"type": "string"
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
},
|
|
349
|
+
"subFlatten": {
|
|
350
|
+
"type": "object",
|
|
351
|
+
"additionalProperties": false,
|
|
352
|
+
"required": [
|
|
353
|
+
"transparent",
|
|
354
|
+
"asText"
|
|
355
|
+
],
|
|
356
|
+
"properties": {
|
|
357
|
+
"transparent": {
|
|
358
|
+
"type": "array",
|
|
359
|
+
"items": {
|
|
360
|
+
"$ref": "#/$defs/dspackId"
|
|
361
|
+
}
|
|
362
|
+
},
|
|
363
|
+
"asText": {
|
|
364
|
+
"type": "object",
|
|
365
|
+
"additionalProperties": {
|
|
366
|
+
"type": "string"
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
},
|
|
373
|
+
"subCoverage": {
|
|
374
|
+
"type": "object",
|
|
375
|
+
"additionalProperties": {
|
|
376
|
+
"type": "string"
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
};
|
package/dist/validate/ajv.js
CHANGED
|
@@ -12,11 +12,9 @@
|
|
|
12
12
|
* 3. instance: every component instance in the hand-authored surface validates
|
|
13
13
|
* against the catalog's own #/$defs/anyComponent.
|
|
14
14
|
*/
|
|
15
|
-
import { readFileSync } from "node:fs";
|
|
16
|
-
import { fileURLToPath } from "node:url";
|
|
17
15
|
import Ajv2020 from "ajv/dist/2020.js";
|
|
18
16
|
import addFormats from "ajv-formats";
|
|
19
|
-
|
|
17
|
+
import { catalogMetaSchemas } from "./meta/catalog-meta.js";
|
|
20
18
|
function newAjv() {
|
|
21
19
|
const ajv = new Ajv2020({ strict: false, allErrors: true, validateFormats: true });
|
|
22
20
|
addFormats(ajv);
|
|
@@ -77,7 +75,7 @@ export function validateCatalog(catalog, version, surface) {
|
|
|
77
75
|
errors: exts.length ? [...new Set(exts)] : undefined,
|
|
78
76
|
});
|
|
79
77
|
// Gate 2 — catalog shape.
|
|
80
|
-
const meta =
|
|
78
|
+
const meta = catalogMetaSchemas[version];
|
|
81
79
|
const validateShape = newAjv().compile(meta);
|
|
82
80
|
const shapeOk = validateShape(catalog);
|
|
83
81
|
gates.push({
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime mirrors of the catalog-shape meta-schemas. The .json files beside
|
|
3
|
+
* this module stay the reviewable documents (README points reviewers at
|
|
4
|
+
* src/validate/meta/); these constants exist because validateCatalog must run
|
|
5
|
+
* in a browser bundle (dspack-studio composer), where readFileSync is not
|
|
6
|
+
* available. src/schema-mirrors.test.ts asserts mirror and JSON stay
|
|
7
|
+
* identical — edit both together.
|
|
8
|
+
*/
|
|
9
|
+
import type { A2uiVersion, Json } from "../../types.js";
|
|
10
|
+
export declare const catalogMetaSchemas: Record<A2uiVersion, Json>;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
export const catalogMetaSchemas = {
|
|
2
|
+
"0.9.1": {
|
|
3
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
|
+
"$id": "https://rdombrowski.dev/meta/a2ui-catalog.v0_9_1.json",
|
|
5
|
+
"title": "A2UI catalog shape (v0.9.1)",
|
|
6
|
+
"description": "Structural invariants an A2UI v0.9.1 catalog must satisfy, derived from the checked-in basic catalog fixture. The version-distinguishing requirement is $defs.theme (with primaryColor).",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"required": [
|
|
9
|
+
"$schema",
|
|
10
|
+
"$id",
|
|
11
|
+
"catalogId",
|
|
12
|
+
"title",
|
|
13
|
+
"description",
|
|
14
|
+
"components",
|
|
15
|
+
"$defs"
|
|
16
|
+
],
|
|
17
|
+
"properties": {
|
|
18
|
+
"catalogId": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"format": "uri"
|
|
21
|
+
},
|
|
22
|
+
"$id": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"format": "uri"
|
|
25
|
+
},
|
|
26
|
+
"components": {
|
|
27
|
+
"type": "object",
|
|
28
|
+
"minProperties": 1,
|
|
29
|
+
"additionalProperties": {
|
|
30
|
+
"type": "object",
|
|
31
|
+
"required": [
|
|
32
|
+
"allOf",
|
|
33
|
+
"unevaluatedProperties"
|
|
34
|
+
],
|
|
35
|
+
"properties": {
|
|
36
|
+
"allOf": {
|
|
37
|
+
"type": "array",
|
|
38
|
+
"minItems": 1
|
|
39
|
+
},
|
|
40
|
+
"unevaluatedProperties": {
|
|
41
|
+
"const": false
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"$defs": {
|
|
47
|
+
"type": "object",
|
|
48
|
+
"required": [
|
|
49
|
+
"anyComponent",
|
|
50
|
+
"theme"
|
|
51
|
+
],
|
|
52
|
+
"not": {
|
|
53
|
+
"required": [
|
|
54
|
+
"surfaceProperties"
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
"properties": {
|
|
58
|
+
"anyComponent": {
|
|
59
|
+
"type": "object",
|
|
60
|
+
"required": [
|
|
61
|
+
"oneOf"
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
"theme": {
|
|
65
|
+
"type": "object",
|
|
66
|
+
"required": [
|
|
67
|
+
"properties"
|
|
68
|
+
],
|
|
69
|
+
"properties": {
|
|
70
|
+
"properties": {
|
|
71
|
+
"type": "object",
|
|
72
|
+
"required": [
|
|
73
|
+
"primaryColor"
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"1.0": {
|
|
83
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
84
|
+
"$id": "https://rdombrowski.dev/meta/a2ui-catalog.v1_0.json",
|
|
85
|
+
"title": "A2UI catalog shape (v1.0)",
|
|
86
|
+
"description": "Structural invariants an A2UI v1.0 catalog must satisfy, derived from the checked-in basic catalog fixture. The version-distinguishing requirement is $defs.surfaceProperties (and the absence of $defs.theme).",
|
|
87
|
+
"type": "object",
|
|
88
|
+
"required": [
|
|
89
|
+
"$schema",
|
|
90
|
+
"$id",
|
|
91
|
+
"catalogId",
|
|
92
|
+
"title",
|
|
93
|
+
"description",
|
|
94
|
+
"components",
|
|
95
|
+
"$defs"
|
|
96
|
+
],
|
|
97
|
+
"properties": {
|
|
98
|
+
"catalogId": {
|
|
99
|
+
"type": "string",
|
|
100
|
+
"format": "uri"
|
|
101
|
+
},
|
|
102
|
+
"$id": {
|
|
103
|
+
"type": "string",
|
|
104
|
+
"format": "uri"
|
|
105
|
+
},
|
|
106
|
+
"instructions": {
|
|
107
|
+
"type": "string"
|
|
108
|
+
},
|
|
109
|
+
"components": {
|
|
110
|
+
"type": "object",
|
|
111
|
+
"minProperties": 1,
|
|
112
|
+
"additionalProperties": {
|
|
113
|
+
"type": "object",
|
|
114
|
+
"required": [
|
|
115
|
+
"allOf",
|
|
116
|
+
"unevaluatedProperties"
|
|
117
|
+
],
|
|
118
|
+
"properties": {
|
|
119
|
+
"allOf": {
|
|
120
|
+
"type": "array",
|
|
121
|
+
"minItems": 1
|
|
122
|
+
},
|
|
123
|
+
"unevaluatedProperties": {
|
|
124
|
+
"const": false
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"$defs": {
|
|
130
|
+
"type": "object",
|
|
131
|
+
"required": [
|
|
132
|
+
"anyComponent",
|
|
133
|
+
"surfaceProperties"
|
|
134
|
+
],
|
|
135
|
+
"not": {
|
|
136
|
+
"required": [
|
|
137
|
+
"theme"
|
|
138
|
+
]
|
|
139
|
+
},
|
|
140
|
+
"properties": {
|
|
141
|
+
"anyComponent": {
|
|
142
|
+
"type": "object",
|
|
143
|
+
"required": [
|
|
144
|
+
"oneOf"
|
|
145
|
+
]
|
|
146
|
+
},
|
|
147
|
+
"surfaceProperties": {
|
|
148
|
+
"type": "object",
|
|
149
|
+
"required": [
|
|
150
|
+
"properties"
|
|
151
|
+
]
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aestheticfunction/dspack-emit",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "dspack emitters: compile a dspack design-system contract and dspack surfaces into protocol targets — an A2UI catalog + surface messages (gates A1-A3) and json-render catalog/registry modules + specs (gates J1-J3).",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
],
|
|
19
19
|
"scripts": {
|
|
20
20
|
"transform": "tsx src/cli.ts",
|
|
21
|
-
"build": "tsc -p tsconfig.json
|
|
21
|
+
"build": "tsc -p tsconfig.json",
|
|
22
22
|
"prepare": "npm run build",
|
|
23
23
|
"build:catalogs": "tsx src/cli.ts --in input/shadcn-ui.dspack.json --a2ui-version 0.9.1 --out out && tsx src/cli.ts --in input/shadcn-ui.dspack.json --a2ui-version 1.0 --out out",
|
|
24
24
|
"test": "vitest run",
|