-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdspack.v0.1.schema.json
More file actions
408 lines (408 loc) · 11.9 KB
/
Copy pathdspack.v0.1.schema.json
File metadata and controls
408 lines (408 loc) · 11.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/aestheticfunction/dspack/blob/main/schema/dspack.v0.1.schema.json",
"title": "dspack v0.1",
"description": "Schema for dspack v0.1 — a JSON format for representing design system corpora.",
"type": "object",
"required": ["dspack", "name"],
"properties": {
"$schema": {
"type": "string",
"description": "URI reference to this JSON Schema. Optional; consumers MUST NOT require this property."
},
"dspack": {
"type": "string",
"const": "0.1",
"description": "Specification version. MUST be \"0.1\" for documents conforming to this version."
},
"name": {
"type": "string",
"minLength": 1,
"description": "Human-readable name of the design system."
},
"description": {
"type": "string",
"description": "Brief description of the design system's purpose and scope."
},
"version": {
"type": "string",
"description": "Version of the design system content (not the spec version)."
},
"metadata": {
"$ref": "#/$defs/metadata"
},
"tokens": {
"type": "object",
"description": "Token definitions organized by category.",
"additionalProperties": {
"$ref": "#/$defs/tokenCategory"
}
},
"components": {
"type": "object",
"description": "Component definitions keyed by component ID.",
"propertyNames": {
"pattern": "^[a-z][a-z0-9-]*$"
},
"additionalProperties": {
"$ref": "#/$defs/componentEntry"
}
},
"patterns": {
"type": "array",
"description": "Pattern entries describing preferred ways of combining components.",
"items": {
"$ref": "#/$defs/patternEntry"
}
},
"antiPatterns": {
"type": "array",
"description": "Anti-pattern entries describing approaches that are deliberately ruled out.",
"items": {
"$ref": "#/$defs/antiPatternEntry"
}
},
"frameworkBindings": {
"type": "object",
"description": "Framework-specific information keyed by framework identifier.",
"propertyNames": {
"pattern": "^[a-z][a-z0-9-]*$"
},
"additionalProperties": {
"$ref": "#/$defs/frameworkBinding"
}
}
},
"additionalProperties": true,
"$defs": {
"metadata": {
"type": "object",
"description": "Extensible metadata about the dspack file.",
"properties": {
"generatedBy": {
"type": "string",
"description": "Tool or process that created this file."
},
"generatedAt": {
"type": "string",
"format": "date-time",
"description": "ISO 8601 datetime when the file was generated."
},
"source": {
"type": "string",
"description": "URL or description of the upstream source."
},
"license": {
"type": "string",
"description": "SPDX license identifier or freeform description."
}
},
"additionalProperties": true
},
"tokenCategory": {
"type": "object",
"description": "A category of tokens.",
"required": ["values"],
"properties": {
"description": {
"type": "string",
"description": "What this category covers."
},
"values": {
"type": "object",
"description": "Map of token name to token entry.",
"propertyNames": {
"pattern": "^[a-z][a-z0-9-]*$"
},
"additionalProperties": {
"$ref": "#/$defs/tokenEntry"
}
}
},
"additionalProperties": true
},
"tokenEntry": {
"type": "object",
"description": "A single token definition.",
"required": ["value"],
"properties": {
"value": {
"type": "string",
"description": "The resolved value of the token."
},
"description": {
"type": "string",
"description": "Semantic meaning of the token."
},
"type": {
"type": "string",
"description": "The value type (e.g., color, dimension, fontFamily)."
},
"deprecated": {
"type": "boolean",
"description": "Whether this token is deprecated.",
"default": false
},
"aliases": {
"type": "array",
"items": {
"type": "string"
},
"description": "Other names by which this token is known."
}
},
"additionalProperties": true
},
"componentEntry": {
"type": "object",
"description": "A component definition.",
"required": ["name", "description"],
"properties": {
"name": {
"type": "string",
"minLength": 1,
"description": "Human-readable display name."
},
"description": {
"type": "string",
"description": "What the component is for."
},
"whenToUse": {
"type": "string",
"description": "Guidance on when to use this component."
},
"whenNotToUse": {
"type": "string",
"description": "Guidance on when to choose a different component."
},
"props": {
"type": "object",
"description": "Map of prop name to prop descriptor.",
"additionalProperties": {
"$ref": "#/$defs/propDescriptor"
}
},
"tokens": {
"type": "array",
"items": {
"type": "string"
},
"description": "Token names this component depends on."
},
"relatedComponents": {
"type": "array",
"items": {
"type": "string"
},
"description": "Component IDs of related components."
},
"tags": {
"type": "array",
"items": {
"type": "string"
},
"description": "Freeform classification tags."
},
"deprecated": {
"type": "boolean",
"description": "Whether this component is deprecated.",
"default": false
},
"deprecatedMessage": {
"type": "string",
"description": "What to use instead of this component."
}
},
"additionalProperties": true
},
"propDescriptor": {
"type": "object",
"description": "Describes a single component prop.",
"required": ["type"],
"properties": {
"type": {
"type": "string",
"description": "The value type of the prop (e.g., string, number, boolean, enum)."
},
"description": {
"type": "string",
"description": "What this prop controls."
},
"values": {
"type": "array",
"description": "For enum type, the allowed values."
},
"default": {
"description": "Default value of the prop."
},
"required": {
"type": "boolean",
"description": "Whether this prop must be provided.",
"default": false
}
},
"additionalProperties": true
},
"patternEntry": {
"type": "object",
"description": "A pattern describing a preferred way of combining components.",
"required": ["id", "name", "description"],
"properties": {
"id": {
"type": "string",
"pattern": "^[a-z][a-z0-9-]*$",
"description": "Unique identifier for this pattern."
},
"name": {
"type": "string",
"minLength": 1,
"description": "Human-readable name."
},
"description": {
"type": "string",
"description": "What problem this pattern addresses."
},
"intent": {
"type": "string",
"description": "The underlying design goal or UX objective."
},
"context": {
"type": "string",
"description": "When this pattern applies."
},
"components": {
"type": "array",
"items": {
"type": "string"
},
"description": "Component IDs involved in this pattern."
},
"guidance": {
"type": "string",
"description": "Prose guidance on how to apply the pattern correctly."
},
"relatedPatterns": {
"type": "array",
"items": {
"type": "string"
},
"description": "Pattern IDs of related patterns."
},
"tags": {
"type": "array",
"items": {
"type": "string"
},
"description": "Freeform classification tags."
}
},
"additionalProperties": true
},
"antiPatternEntry": {
"type": "object",
"description": "An anti-pattern describing an approach that is deliberately ruled out.",
"required": ["id", "name", "description", "reason"],
"properties": {
"id": {
"type": "string",
"pattern": "^[a-z][a-z0-9-]*$",
"description": "Unique identifier for this anti-pattern."
},
"name": {
"type": "string",
"minLength": 1,
"description": "Human-readable name describing what not to do."
},
"description": {
"type": "string",
"description": "What this anti-pattern is."
},
"reason": {
"type": "string",
"description": "Why this approach is ruled out."
},
"insteadUse": {
"type": "string",
"description": "Pattern ID of the preferred approach."
},
"components": {
"type": "array",
"items": {
"type": "string"
},
"description": "Component IDs involved in this anti-pattern."
},
"tags": {
"type": "array",
"items": {
"type": "string"
},
"description": "Freeform classification tags."
}
},
"additionalProperties": true
},
"frameworkBinding": {
"type": "object",
"description": "Framework-specific information for the design system.",
"required": ["name"],
"properties": {
"name": {
"type": "string",
"minLength": 1,
"description": "Human-readable framework name."
},
"package": {
"type": "string",
"description": "Primary package name."
},
"installCommand": {
"type": "string",
"description": "How to install the framework binding."
},
"description": {
"type": "string",
"description": "What this binding provides."
},
"guidance": {
"type": "string",
"description": "Framework-wide guidance."
},
"components": {
"type": "object",
"description": "Per-component framework details keyed by component ID.",
"propertyNames": {
"pattern": "^[a-z][a-z0-9-]*$"
},
"additionalProperties": {
"$ref": "#/$defs/componentBinding"
}
}
},
"additionalProperties": true
},
"componentBinding": {
"type": "object",
"description": "Framework-specific details for a single component.",
"properties": {
"importPath": {
"type": "string",
"description": "Where to import the component."
},
"installCommand": {
"type": "string",
"description": "Component-specific install command."
},
"exportName": {
"type": "string",
"description": "Named export if different from the component name."
},
"guidance": {
"type": "string",
"description": "Framework-specific usage guidance for this component."
}
},
"additionalProperties": true
}
}
}