@forumone/throughline-design-contract 0.0.1 → 0.2.0
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/CHANGELOG.md +7 -0
- package/LICENSE +21 -0
- package/README.md +135 -28
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/lint.d.ts +38 -0
- package/dist/lint.d.ts.map +1 -0
- package/dist/lint.js +110 -0
- package/dist/lint.js.map +1 -0
- package/dist/loader.d.ts +42 -0
- package/dist/loader.d.ts.map +1 -0
- package/dist/loader.js +79 -0
- package/dist/loader.js.map +1 -0
- package/dist/manifest.d.ts +449 -0
- package/dist/manifest.d.ts.map +1 -0
- package/dist/manifest.js +29 -0
- package/dist/manifest.js.map +1 -0
- package/dist/schema.d.ts +276 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +110 -0
- package/dist/schema.js.map +1 -0
- package/package.json +58 -7
package/dist/schema.d.ts
ADDED
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* The current version of the contract schema. Bump this when making a
|
|
4
|
+
* backwards-incompatible change to the shape. Manifests declare the
|
|
5
|
+
* version they satisfy so the loader can reject mismatches loudly.
|
|
6
|
+
*/
|
|
7
|
+
export declare const CONTRACT_VERSION = "1.0.0";
|
|
8
|
+
declare const FieldTypeSchema: z.ZodEnum<["text", "richtext", "link", "image", "video", "select", "group", "array", "boolean", "number"]>;
|
|
9
|
+
declare const PlacementSchema: z.ZodEnum<["page", "section", "inline"]>;
|
|
10
|
+
declare const CategorySchema: z.ZodEnum<["hero", "section", "card", "media", "cta", "navigation", "data", "form", "utility"]>;
|
|
11
|
+
export type ContentField = {
|
|
12
|
+
name: string;
|
|
13
|
+
type: z.infer<typeof FieldTypeSchema>;
|
|
14
|
+
required: boolean;
|
|
15
|
+
maxLength?: number | undefined;
|
|
16
|
+
constraints?: string | undefined;
|
|
17
|
+
of?: ContentField[] | undefined;
|
|
18
|
+
};
|
|
19
|
+
/** Input shape for {@link ContentFieldSchema}: defaulted fields are optional. */
|
|
20
|
+
export type ContentFieldInput = {
|
|
21
|
+
name: string;
|
|
22
|
+
type: z.infer<typeof FieldTypeSchema>;
|
|
23
|
+
required?: boolean | undefined;
|
|
24
|
+
maxLength?: number | undefined;
|
|
25
|
+
constraints?: string | undefined;
|
|
26
|
+
of?: ContentFieldInput[] | undefined;
|
|
27
|
+
};
|
|
28
|
+
export declare const ComponentContractSchema: z.ZodObject<{
|
|
29
|
+
name: z.ZodString;
|
|
30
|
+
category: z.ZodEnum<["hero", "section", "card", "media", "cta", "navigation", "data", "form", "utility"]>;
|
|
31
|
+
description: z.ZodString;
|
|
32
|
+
intent: z.ZodString;
|
|
33
|
+
composition: z.ZodObject<{
|
|
34
|
+
placement: z.ZodArray<z.ZodEnum<["page", "section", "inline"]>, "atleastone">;
|
|
35
|
+
maxPerPage: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
36
|
+
requiredSiblings: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
37
|
+
forbiddenAdjacent: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
38
|
+
allowedSlots: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
|
|
39
|
+
}, "strip", z.ZodTypeAny, {
|
|
40
|
+
placement: ["page" | "section" | "inline", ...("page" | "section" | "inline")[]];
|
|
41
|
+
maxPerPage: number | null;
|
|
42
|
+
requiredSiblings: string[];
|
|
43
|
+
forbiddenAdjacent: string[];
|
|
44
|
+
allowedSlots?: Record<string, string[]> | undefined;
|
|
45
|
+
}, {
|
|
46
|
+
placement: ["page" | "section" | "inline", ...("page" | "section" | "inline")[]];
|
|
47
|
+
maxPerPage?: number | null | undefined;
|
|
48
|
+
requiredSiblings?: string[] | undefined;
|
|
49
|
+
forbiddenAdjacent?: string[] | undefined;
|
|
50
|
+
allowedSlots?: Record<string, string[]> | undefined;
|
|
51
|
+
}>;
|
|
52
|
+
content: z.ZodObject<{
|
|
53
|
+
fields: z.ZodArray<z.ZodType<ContentField, z.ZodTypeDef, ContentFieldInput>, "many">;
|
|
54
|
+
variants: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
55
|
+
name: z.ZodString;
|
|
56
|
+
description: z.ZodString;
|
|
57
|
+
whenToUse: z.ZodString;
|
|
58
|
+
}, "strip", z.ZodTypeAny, {
|
|
59
|
+
name: string;
|
|
60
|
+
description: string;
|
|
61
|
+
whenToUse: string;
|
|
62
|
+
}, {
|
|
63
|
+
name: string;
|
|
64
|
+
description: string;
|
|
65
|
+
whenToUse: string;
|
|
66
|
+
}>, "many">>;
|
|
67
|
+
}, "strip", z.ZodTypeAny, {
|
|
68
|
+
fields: ContentField[];
|
|
69
|
+
variants?: {
|
|
70
|
+
name: string;
|
|
71
|
+
description: string;
|
|
72
|
+
whenToUse: string;
|
|
73
|
+
}[] | undefined;
|
|
74
|
+
}, {
|
|
75
|
+
fields: ContentFieldInput[];
|
|
76
|
+
variants?: {
|
|
77
|
+
name: string;
|
|
78
|
+
description: string;
|
|
79
|
+
whenToUse: string;
|
|
80
|
+
}[] | undefined;
|
|
81
|
+
}>;
|
|
82
|
+
tokens: z.ZodObject<{
|
|
83
|
+
consumes: z.ZodArray<z.ZodString, "many">;
|
|
84
|
+
configurable: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
85
|
+
prop: z.ZodString;
|
|
86
|
+
tokenGroup: z.ZodString;
|
|
87
|
+
allowedValues: z.ZodArray<z.ZodString, "many">;
|
|
88
|
+
}, "strip", z.ZodTypeAny, {
|
|
89
|
+
prop: string;
|
|
90
|
+
tokenGroup: string;
|
|
91
|
+
allowedValues: string[];
|
|
92
|
+
}, {
|
|
93
|
+
prop: string;
|
|
94
|
+
tokenGroup: string;
|
|
95
|
+
allowedValues: string[];
|
|
96
|
+
}>, "many">>;
|
|
97
|
+
}, "strip", z.ZodTypeAny, {
|
|
98
|
+
consumes: string[];
|
|
99
|
+
configurable?: {
|
|
100
|
+
prop: string;
|
|
101
|
+
tokenGroup: string;
|
|
102
|
+
allowedValues: string[];
|
|
103
|
+
}[] | undefined;
|
|
104
|
+
}, {
|
|
105
|
+
consumes: string[];
|
|
106
|
+
configurable?: {
|
|
107
|
+
prop: string;
|
|
108
|
+
tokenGroup: string;
|
|
109
|
+
allowedValues: string[];
|
|
110
|
+
}[] | undefined;
|
|
111
|
+
}>;
|
|
112
|
+
accessibility: z.ZodObject<{
|
|
113
|
+
role: z.ZodOptional<z.ZodString>;
|
|
114
|
+
keyboardSupport: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
115
|
+
screenReaderBehavior: z.ZodString;
|
|
116
|
+
contentWarnings: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
117
|
+
}, "strip", z.ZodTypeAny, {
|
|
118
|
+
keyboardSupport: string[];
|
|
119
|
+
screenReaderBehavior: string;
|
|
120
|
+
contentWarnings: string[];
|
|
121
|
+
role?: string | undefined;
|
|
122
|
+
}, {
|
|
123
|
+
screenReaderBehavior: string;
|
|
124
|
+
role?: string | undefined;
|
|
125
|
+
keyboardSupport?: string[] | undefined;
|
|
126
|
+
contentWarnings?: string[] | undefined;
|
|
127
|
+
}>;
|
|
128
|
+
examples: z.ZodArray<z.ZodObject<{
|
|
129
|
+
label: z.ZodString;
|
|
130
|
+
intent: z.ZodString;
|
|
131
|
+
storyId: z.ZodString;
|
|
132
|
+
}, "strip", z.ZodTypeAny, {
|
|
133
|
+
intent: string;
|
|
134
|
+
label: string;
|
|
135
|
+
storyId: string;
|
|
136
|
+
}, {
|
|
137
|
+
intent: string;
|
|
138
|
+
label: string;
|
|
139
|
+
storyId: string;
|
|
140
|
+
}>, "many">;
|
|
141
|
+
antiExamples: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
142
|
+
label: z.ZodString;
|
|
143
|
+
why: z.ZodString;
|
|
144
|
+
useInstead: z.ZodOptional<z.ZodString>;
|
|
145
|
+
}, "strip", z.ZodTypeAny, {
|
|
146
|
+
label: string;
|
|
147
|
+
why: string;
|
|
148
|
+
useInstead?: string | undefined;
|
|
149
|
+
}, {
|
|
150
|
+
label: string;
|
|
151
|
+
why: string;
|
|
152
|
+
useInstead?: string | undefined;
|
|
153
|
+
}>, "many">>;
|
|
154
|
+
behavior: z.ZodDefault<z.ZodObject<{
|
|
155
|
+
fetchesData: z.ZodDefault<z.ZodBoolean>;
|
|
156
|
+
hasClientState: z.ZodDefault<z.ZodBoolean>;
|
|
157
|
+
animates: z.ZodDefault<z.ZodBoolean>;
|
|
158
|
+
requiresAnalytics: z.ZodDefault<z.ZodBoolean>;
|
|
159
|
+
}, "strip", z.ZodTypeAny, {
|
|
160
|
+
fetchesData: boolean;
|
|
161
|
+
hasClientState: boolean;
|
|
162
|
+
animates: boolean;
|
|
163
|
+
requiresAnalytics: boolean;
|
|
164
|
+
}, {
|
|
165
|
+
fetchesData?: boolean | undefined;
|
|
166
|
+
hasClientState?: boolean | undefined;
|
|
167
|
+
animates?: boolean | undefined;
|
|
168
|
+
requiresAnalytics?: boolean | undefined;
|
|
169
|
+
}>>;
|
|
170
|
+
}, "strip", z.ZodTypeAny, {
|
|
171
|
+
name: string;
|
|
172
|
+
category: "section" | "hero" | "card" | "media" | "cta" | "navigation" | "data" | "form" | "utility";
|
|
173
|
+
description: string;
|
|
174
|
+
intent: string;
|
|
175
|
+
composition: {
|
|
176
|
+
placement: ["page" | "section" | "inline", ...("page" | "section" | "inline")[]];
|
|
177
|
+
maxPerPage: number | null;
|
|
178
|
+
requiredSiblings: string[];
|
|
179
|
+
forbiddenAdjacent: string[];
|
|
180
|
+
allowedSlots?: Record<string, string[]> | undefined;
|
|
181
|
+
};
|
|
182
|
+
content: {
|
|
183
|
+
fields: ContentField[];
|
|
184
|
+
variants?: {
|
|
185
|
+
name: string;
|
|
186
|
+
description: string;
|
|
187
|
+
whenToUse: string;
|
|
188
|
+
}[] | undefined;
|
|
189
|
+
};
|
|
190
|
+
tokens: {
|
|
191
|
+
consumes: string[];
|
|
192
|
+
configurable?: {
|
|
193
|
+
prop: string;
|
|
194
|
+
tokenGroup: string;
|
|
195
|
+
allowedValues: string[];
|
|
196
|
+
}[] | undefined;
|
|
197
|
+
};
|
|
198
|
+
accessibility: {
|
|
199
|
+
keyboardSupport: string[];
|
|
200
|
+
screenReaderBehavior: string;
|
|
201
|
+
contentWarnings: string[];
|
|
202
|
+
role?: string | undefined;
|
|
203
|
+
};
|
|
204
|
+
examples: {
|
|
205
|
+
intent: string;
|
|
206
|
+
label: string;
|
|
207
|
+
storyId: string;
|
|
208
|
+
}[];
|
|
209
|
+
antiExamples: {
|
|
210
|
+
label: string;
|
|
211
|
+
why: string;
|
|
212
|
+
useInstead?: string | undefined;
|
|
213
|
+
}[];
|
|
214
|
+
behavior: {
|
|
215
|
+
fetchesData: boolean;
|
|
216
|
+
hasClientState: boolean;
|
|
217
|
+
animates: boolean;
|
|
218
|
+
requiresAnalytics: boolean;
|
|
219
|
+
};
|
|
220
|
+
}, {
|
|
221
|
+
name: string;
|
|
222
|
+
category: "section" | "hero" | "card" | "media" | "cta" | "navigation" | "data" | "form" | "utility";
|
|
223
|
+
description: string;
|
|
224
|
+
intent: string;
|
|
225
|
+
composition: {
|
|
226
|
+
placement: ["page" | "section" | "inline", ...("page" | "section" | "inline")[]];
|
|
227
|
+
maxPerPage?: number | null | undefined;
|
|
228
|
+
requiredSiblings?: string[] | undefined;
|
|
229
|
+
forbiddenAdjacent?: string[] | undefined;
|
|
230
|
+
allowedSlots?: Record<string, string[]> | undefined;
|
|
231
|
+
};
|
|
232
|
+
content: {
|
|
233
|
+
fields: ContentFieldInput[];
|
|
234
|
+
variants?: {
|
|
235
|
+
name: string;
|
|
236
|
+
description: string;
|
|
237
|
+
whenToUse: string;
|
|
238
|
+
}[] | undefined;
|
|
239
|
+
};
|
|
240
|
+
tokens: {
|
|
241
|
+
consumes: string[];
|
|
242
|
+
configurable?: {
|
|
243
|
+
prop: string;
|
|
244
|
+
tokenGroup: string;
|
|
245
|
+
allowedValues: string[];
|
|
246
|
+
}[] | undefined;
|
|
247
|
+
};
|
|
248
|
+
accessibility: {
|
|
249
|
+
screenReaderBehavior: string;
|
|
250
|
+
role?: string | undefined;
|
|
251
|
+
keyboardSupport?: string[] | undefined;
|
|
252
|
+
contentWarnings?: string[] | undefined;
|
|
253
|
+
};
|
|
254
|
+
examples: {
|
|
255
|
+
intent: string;
|
|
256
|
+
label: string;
|
|
257
|
+
storyId: string;
|
|
258
|
+
}[];
|
|
259
|
+
antiExamples?: {
|
|
260
|
+
label: string;
|
|
261
|
+
why: string;
|
|
262
|
+
useInstead?: string | undefined;
|
|
263
|
+
}[] | undefined;
|
|
264
|
+
behavior?: {
|
|
265
|
+
fetchesData?: boolean | undefined;
|
|
266
|
+
hasClientState?: boolean | undefined;
|
|
267
|
+
animates?: boolean | undefined;
|
|
268
|
+
requiresAnalytics?: boolean | undefined;
|
|
269
|
+
} | undefined;
|
|
270
|
+
}>;
|
|
271
|
+
export type ComponentContract = z.infer<typeof ComponentContractSchema>;
|
|
272
|
+
export type ComponentCategory = z.infer<typeof CategorySchema>;
|
|
273
|
+
export type ComponentPlacement = z.infer<typeof PlacementSchema>;
|
|
274
|
+
export type ContentFieldType = z.infer<typeof FieldTypeSchema>;
|
|
275
|
+
export {};
|
|
276
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,UAAU,CAAA;AAEvC,QAAA,MAAM,eAAe,4GAWnB,CAAA;AAEF,QAAA,MAAM,eAAe,0CAAwC,CAAA;AAE7D,QAAA,MAAM,cAAc,iGAU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AAK,CAAC,OAAO,eAAe,CAAC,CAAA;AAChE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAA"}
|
package/dist/schema.js
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* The current version of the contract schema. Bump this when making a
|
|
4
|
+
* backwards-incompatible change to the shape. Manifests declare the
|
|
5
|
+
* version they satisfy so the loader can reject mismatches loudly.
|
|
6
|
+
*/
|
|
7
|
+
export const CONTRACT_VERSION = '1.0.0';
|
|
8
|
+
const FieldTypeSchema = z.enum([
|
|
9
|
+
'text',
|
|
10
|
+
'richtext',
|
|
11
|
+
'link',
|
|
12
|
+
'image',
|
|
13
|
+
'video',
|
|
14
|
+
'select',
|
|
15
|
+
'group',
|
|
16
|
+
'array',
|
|
17
|
+
'boolean',
|
|
18
|
+
'number',
|
|
19
|
+
]);
|
|
20
|
+
const PlacementSchema = z.enum(['page', 'section', 'inline']);
|
|
21
|
+
const CategorySchema = z.enum([
|
|
22
|
+
'hero',
|
|
23
|
+
'section',
|
|
24
|
+
'card',
|
|
25
|
+
'media',
|
|
26
|
+
'cta',
|
|
27
|
+
'navigation',
|
|
28
|
+
'data',
|
|
29
|
+
'form',
|
|
30
|
+
'utility',
|
|
31
|
+
]);
|
|
32
|
+
const ContentFieldSchema = z.lazy(() => z.object({
|
|
33
|
+
name: z.string().min(1),
|
|
34
|
+
type: FieldTypeSchema,
|
|
35
|
+
required: z.boolean().default(false),
|
|
36
|
+
maxLength: z.number().int().positive().optional(),
|
|
37
|
+
/** Human-readable constraint description the AI reasons about. */
|
|
38
|
+
constraints: z.string().optional(),
|
|
39
|
+
/** For array or group fields, the nested field shape. */
|
|
40
|
+
of: z.array(ContentFieldSchema).optional(),
|
|
41
|
+
}));
|
|
42
|
+
export const ComponentContractSchema = z.object({
|
|
43
|
+
// Identity
|
|
44
|
+
name: z.string().min(1).regex(/^[A-Z][A-Za-z0-9]+$/, 'Component names must be PascalCase'),
|
|
45
|
+
category: CategorySchema,
|
|
46
|
+
description: z.string().min(20).max(280),
|
|
47
|
+
intent: z.string().min(20).max(500),
|
|
48
|
+
// Composition
|
|
49
|
+
composition: z.object({
|
|
50
|
+
placement: z.array(PlacementSchema).nonempty(),
|
|
51
|
+
maxPerPage: z.number().int().positive().nullable().default(null),
|
|
52
|
+
requiredSiblings: z.array(z.string()).default([]),
|
|
53
|
+
forbiddenAdjacent: z.array(z.string()).default([]),
|
|
54
|
+
allowedSlots: z.record(z.string(), z.array(z.string())).optional(),
|
|
55
|
+
}),
|
|
56
|
+
// Content
|
|
57
|
+
content: z.object({
|
|
58
|
+
fields: z.array(ContentFieldSchema),
|
|
59
|
+
variants: z
|
|
60
|
+
.array(z.object({
|
|
61
|
+
name: z.string(),
|
|
62
|
+
description: z.string(),
|
|
63
|
+
whenToUse: z.string(),
|
|
64
|
+
}))
|
|
65
|
+
.optional(),
|
|
66
|
+
}),
|
|
67
|
+
// Tokens
|
|
68
|
+
tokens: z.object({
|
|
69
|
+
consumes: z.array(z.string()),
|
|
70
|
+
configurable: z
|
|
71
|
+
.array(z.object({
|
|
72
|
+
prop: z.string(),
|
|
73
|
+
tokenGroup: z.string(),
|
|
74
|
+
allowedValues: z.array(z.string()),
|
|
75
|
+
}))
|
|
76
|
+
.optional(),
|
|
77
|
+
}),
|
|
78
|
+
// Accessibility
|
|
79
|
+
accessibility: z.object({
|
|
80
|
+
role: z.string().optional(),
|
|
81
|
+
keyboardSupport: z.array(z.string()).default([]),
|
|
82
|
+
screenReaderBehavior: z.string().min(10),
|
|
83
|
+
contentWarnings: z.array(z.string()).default([]),
|
|
84
|
+
}),
|
|
85
|
+
// Examples
|
|
86
|
+
examples: z
|
|
87
|
+
.array(z.object({
|
|
88
|
+
label: z.string(),
|
|
89
|
+
intent: z.string(),
|
|
90
|
+
storyId: z.string(),
|
|
91
|
+
}))
|
|
92
|
+
.min(1, 'Each component must have at least one example'),
|
|
93
|
+
antiExamples: z
|
|
94
|
+
.array(z.object({
|
|
95
|
+
label: z.string(),
|
|
96
|
+
why: z.string(),
|
|
97
|
+
useInstead: z.string().optional(),
|
|
98
|
+
}))
|
|
99
|
+
.default([]),
|
|
100
|
+
// Behavioral
|
|
101
|
+
behavior: z
|
|
102
|
+
.object({
|
|
103
|
+
fetchesData: z.boolean().default(false),
|
|
104
|
+
hasClientState: z.boolean().default(false),
|
|
105
|
+
animates: z.boolean().default(false),
|
|
106
|
+
requiresAnalytics: z.boolean().default(false),
|
|
107
|
+
})
|
|
108
|
+
.default({}),
|
|
109
|
+
});
|
|
110
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,OAAO,CAAA;AAEvC,MAAM,eAAe,GAAG,CAAC,CAAC,IAAI,CAAC;IAC7B,MAAM;IACN,UAAU;IACV,MAAM;IACN,OAAO;IACP,OAAO;IACP,QAAQ;IACR,OAAO;IACP,OAAO;IACP,SAAS;IACT,QAAQ;CACT,CAAC,CAAA;AAEF,MAAM,eAAe,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAA;AAE7D,MAAM,cAAc,GAAG,CAAC,CAAC,IAAI,CAAC;IAC5B,MAAM;IACN,SAAS;IACT,MAAM;IACN,OAAO;IACP,KAAK;IACL,YAAY;IACZ,MAAM;IACN,MAAM;IACN,SAAS;CACV,CAAC,CAAA;AAqBF,MAAM,kBAAkB,GAA6D,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAC/F,CAAC,CAAC,MAAM,CAAC;IACP,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG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
|
+
"description": "The contract every AI-ready design system satisfies to be consumable by Throughline.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./lint": {
|
|
14
|
+
"types": "./dist/lint.d.ts",
|
|
15
|
+
"default": "./dist/lint.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist",
|
|
20
|
+
"README.md",
|
|
21
|
+
"CHANGELOG.md"
|
|
22
|
+
],
|
|
5
23
|
"keywords": [
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
24
|
+
"throughline",
|
|
25
|
+
"design-system",
|
|
26
|
+
"ai-ready",
|
|
27
|
+
"payload"
|
|
28
|
+
],
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "git+https://github.com/forumone/throughline.git",
|
|
33
|
+
"directory": "packages/design-contract"
|
|
34
|
+
},
|
|
35
|
+
"homepage": "https://github.com/forumone/throughline/tree/main/packages/design-contract#readme",
|
|
36
|
+
"bugs": {
|
|
37
|
+
"url": "https://github.com/forumone/throughline/issues"
|
|
38
|
+
},
|
|
39
|
+
"publishConfig": {
|
|
40
|
+
"access": "public"
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"zod": "^3.23.0"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@types/node": "^20.17.0",
|
|
47
|
+
"eslint": "^9.15.0",
|
|
48
|
+
"typescript": "^5.6.0",
|
|
49
|
+
"vitest": "^2.1.0",
|
|
50
|
+
"@forumone/throughline-eslint-config": "0.0.0",
|
|
51
|
+
"@forumone/throughline-tsconfig": "0.0.0"
|
|
52
|
+
},
|
|
53
|
+
"scripts": {
|
|
54
|
+
"build": "tsc -b",
|
|
55
|
+
"dev": "tsc -b -w",
|
|
56
|
+
"clean": "rm -rf dist .turbo *.tsbuildinfo",
|
|
57
|
+
"typecheck": "tsc --noEmit",
|
|
58
|
+
"lint": "eslint src",
|
|
59
|
+
"test": "vitest run"
|
|
60
|
+
}
|
|
61
|
+
}
|