stera-ui 0.2.0 → 0.3.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/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export { fetchRegistryIndex, fetchRegistryItem, getAllComponents, getComponent, resolveDependencies } from './registry/index.js';
2
- export { RegistryIndex, RegistryItem, RegistryItemFile, RegistryItemType, SteraConfig, configSchema, registryIndexSchema, registryItemFileSchema, registryItemSchema, registryItemTypeSchema } from './schema/index.js';
3
- export { CHECK, CONFIG_FILE, CROSS, LOGO, ProjectInfo, TransformContext, TransformFn, WARN, WriteOptions, WriteResult, applyTransforms, brand, createSpinner, detectPackageManager, detectProject, dim, findConfigPath, hasGlobalsCss, installDependencies, loadConfig, resolveOutputPath, transformImports, writeComponentFiles } from './utils/index.js';
2
+ export { RegistryFontItem, RegistryIndex, RegistryItem, RegistryItemFile, RegistryItemFont, RegistryItemType, SteraConfig, configSchema, registryIndexSchema, registryItemFileSchema, registryItemFontSchema, registryItemSchema, registryItemTypeSchema } from './schema/index.js';
3
+ export { CHECK, CONFIG_FILE, CROSS, LOGO, ProjectInfo, TransformContext, TransformFn, WARN, WriteOptions, WriteResult, applyTransforms, brand, createSpinner, detectPackageManager, detectProject, dim, findConfigPath, hasGlobalsCss, installDependencies, loadConfig, massageTreeForFonts, resolveOutputPath, transformImports, updateFonts, writeComponentFiles } from './utils/index.js';
4
4
  import 'zod';
package/dist/index.js CHANGED
@@ -9,9 +9,10 @@ import {
9
9
  configSchema,
10
10
  registryIndexSchema,
11
11
  registryItemFileSchema,
12
+ registryItemFontSchema,
12
13
  registryItemSchema,
13
14
  registryItemTypeSchema
14
- } from "./chunk-AXIACJ2C.js";
15
+ } from "./chunk-3KADOWKC.js";
15
16
  import {
16
17
  CHECK,
17
18
  CONFIG_FILE,
@@ -28,10 +29,12 @@ import {
28
29
  hasGlobalsCss,
29
30
  installDependencies,
30
31
  loadConfig,
32
+ massageTreeForFonts,
31
33
  resolveOutputPath,
32
34
  transformImports,
35
+ updateFonts,
33
36
  writeComponentFiles
34
- } from "./chunk-MFUZBXO6.js";
37
+ } from "./chunk-26HP67ZM.js";
35
38
  export {
36
39
  CHECK,
37
40
  CONFIG_FILE,
@@ -53,12 +56,15 @@ export {
53
56
  hasGlobalsCss,
54
57
  installDependencies,
55
58
  loadConfig,
59
+ massageTreeForFonts,
56
60
  registryIndexSchema,
57
61
  registryItemFileSchema,
62
+ registryItemFontSchema,
58
63
  registryItemSchema,
59
64
  registryItemTypeSchema,
60
65
  resolveDependencies,
61
66
  resolveOutputPath,
62
67
  transformImports,
68
+ updateFonts,
63
69
  writeComponentFiles
64
70
  };
@@ -1,143 +1,403 @@
1
1
  import { z } from 'zod';
2
2
 
3
- declare const registryItemTypeSchema: z.ZodEnum<["registry:ui", "registry:component", "registry:hook", "registry:lib", "registry:style"]>;
3
+ declare const registryItemTypeSchema: z.ZodEnum<["registry:ui", "registry:component", "registry:hook", "registry:lib", "registry:style", "registry:font"]>;
4
4
  type RegistryItemType = z.infer<typeof registryItemTypeSchema>;
5
5
  declare const registryItemFileSchema: z.ZodObject<{
6
6
  path: z.ZodString;
7
- type: z.ZodEnum<["registry:ui", "registry:component", "registry:hook", "registry:lib", "registry:style"]>;
7
+ type: z.ZodEnum<["registry:ui", "registry:component", "registry:hook", "registry:lib", "registry:style", "registry:font"]>;
8
8
  content: z.ZodOptional<z.ZodString>;
9
9
  target: z.ZodOptional<z.ZodString>;
10
10
  }, "strip", z.ZodTypeAny, {
11
- type: "registry:ui" | "registry:component" | "registry:hook" | "registry:lib" | "registry:style";
12
11
  path: string;
12
+ type: "registry:ui" | "registry:component" | "registry:hook" | "registry:lib" | "registry:style" | "registry:font";
13
13
  content?: string | undefined;
14
14
  target?: string | undefined;
15
15
  }, {
16
- type: "registry:ui" | "registry:component" | "registry:hook" | "registry:lib" | "registry:style";
17
16
  path: string;
17
+ type: "registry:ui" | "registry:component" | "registry:hook" | "registry:lib" | "registry:style" | "registry:font";
18
18
  content?: string | undefined;
19
19
  target?: string | undefined;
20
20
  }>;
21
21
  type RegistryItemFile = z.infer<typeof registryItemFileSchema>;
22
- declare const registryItemSchema: z.ZodObject<{
22
+ declare const registryItemFontSchema: z.ZodObject<{
23
+ family: z.ZodString;
24
+ provider: z.ZodLiteral<"google">;
25
+ import: z.ZodString;
26
+ variable: z.ZodString;
27
+ weight: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
28
+ subsets: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
29
+ selector: z.ZodOptional<z.ZodString>;
30
+ dependency: z.ZodOptional<z.ZodString>;
31
+ }, "strip", z.ZodTypeAny, {
32
+ family: string;
33
+ provider: "google";
34
+ import: string;
35
+ variable: string;
36
+ weight?: string[] | undefined;
37
+ subsets?: string[] | undefined;
38
+ selector?: string | undefined;
39
+ dependency?: string | undefined;
40
+ }, {
41
+ family: string;
42
+ provider: "google";
43
+ import: string;
44
+ variable: string;
45
+ weight?: string[] | undefined;
46
+ subsets?: string[] | undefined;
47
+ selector?: string | undefined;
48
+ dependency?: string | undefined;
49
+ }>;
50
+ type RegistryItemFont = z.infer<typeof registryItemFontSchema>;
51
+ declare const registryItemSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
52
+ name: z.ZodString;
53
+ dependencies: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
54
+ registryDependencies: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
55
+ } & {
56
+ type: z.ZodLiteral<"registry:font">;
57
+ font: z.ZodObject<{
58
+ family: z.ZodString;
59
+ provider: z.ZodLiteral<"google">;
60
+ import: z.ZodString;
61
+ variable: z.ZodString;
62
+ weight: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
63
+ subsets: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
64
+ selector: z.ZodOptional<z.ZodString>;
65
+ dependency: z.ZodOptional<z.ZodString>;
66
+ }, "strip", z.ZodTypeAny, {
67
+ family: string;
68
+ provider: "google";
69
+ import: string;
70
+ variable: string;
71
+ weight?: string[] | undefined;
72
+ subsets?: string[] | undefined;
73
+ selector?: string | undefined;
74
+ dependency?: string | undefined;
75
+ }, {
76
+ family: string;
77
+ provider: "google";
78
+ import: string;
79
+ variable: string;
80
+ weight?: string[] | undefined;
81
+ subsets?: string[] | undefined;
82
+ selector?: string | undefined;
83
+ dependency?: string | undefined;
84
+ }>;
85
+ files: z.ZodOptional<z.ZodArray<z.ZodObject<{
86
+ path: z.ZodString;
87
+ type: z.ZodEnum<["registry:ui", "registry:component", "registry:hook", "registry:lib", "registry:style", "registry:font"]>;
88
+ content: z.ZodOptional<z.ZodString>;
89
+ target: z.ZodOptional<z.ZodString>;
90
+ }, "strip", z.ZodTypeAny, {
91
+ path: string;
92
+ type: "registry:ui" | "registry:component" | "registry:hook" | "registry:lib" | "registry:style" | "registry:font";
93
+ content?: string | undefined;
94
+ target?: string | undefined;
95
+ }, {
96
+ path: string;
97
+ type: "registry:ui" | "registry:component" | "registry:hook" | "registry:lib" | "registry:style" | "registry:font";
98
+ content?: string | undefined;
99
+ target?: string | undefined;
100
+ }>, "many">>;
101
+ }, "strip", z.ZodTypeAny, {
102
+ type: "registry:font";
103
+ name: string;
104
+ font: {
105
+ family: string;
106
+ provider: "google";
107
+ import: string;
108
+ variable: string;
109
+ weight?: string[] | undefined;
110
+ subsets?: string[] | undefined;
111
+ selector?: string | undefined;
112
+ dependency?: string | undefined;
113
+ };
114
+ dependencies?: string[] | undefined;
115
+ registryDependencies?: string[] | undefined;
116
+ files?: {
117
+ path: string;
118
+ type: "registry:ui" | "registry:component" | "registry:hook" | "registry:lib" | "registry:style" | "registry:font";
119
+ content?: string | undefined;
120
+ target?: string | undefined;
121
+ }[] | undefined;
122
+ }, {
123
+ type: "registry:font";
124
+ name: string;
125
+ font: {
126
+ family: string;
127
+ provider: "google";
128
+ import: string;
129
+ variable: string;
130
+ weight?: string[] | undefined;
131
+ subsets?: string[] | undefined;
132
+ selector?: string | undefined;
133
+ dependency?: string | undefined;
134
+ };
135
+ dependencies?: string[] | undefined;
136
+ registryDependencies?: string[] | undefined;
137
+ files?: {
138
+ path: string;
139
+ type: "registry:ui" | "registry:component" | "registry:hook" | "registry:lib" | "registry:style" | "registry:font";
140
+ content?: string | undefined;
141
+ target?: string | undefined;
142
+ }[] | undefined;
143
+ }>, z.ZodObject<{
23
144
  name: z.ZodString;
24
- type: z.ZodEnum<["registry:ui", "registry:component", "registry:hook", "registry:lib", "registry:style"]>;
25
145
  dependencies: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
26
146
  registryDependencies: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
147
+ } & {
148
+ type: z.ZodEnum<["registry:ui", "registry:component", "registry:hook", "registry:lib", "registry:style"]>;
27
149
  files: z.ZodArray<z.ZodObject<{
28
150
  path: z.ZodString;
29
- type: z.ZodEnum<["registry:ui", "registry:component", "registry:hook", "registry:lib", "registry:style"]>;
151
+ type: z.ZodEnum<["registry:ui", "registry:component", "registry:hook", "registry:lib", "registry:style", "registry:font"]>;
30
152
  content: z.ZodOptional<z.ZodString>;
31
153
  target: z.ZodOptional<z.ZodString>;
32
154
  }, "strip", z.ZodTypeAny, {
33
- type: "registry:ui" | "registry:component" | "registry:hook" | "registry:lib" | "registry:style";
34
155
  path: string;
156
+ type: "registry:ui" | "registry:component" | "registry:hook" | "registry:lib" | "registry:style" | "registry:font";
35
157
  content?: string | undefined;
36
158
  target?: string | undefined;
37
159
  }, {
38
- type: "registry:ui" | "registry:component" | "registry:hook" | "registry:lib" | "registry:style";
39
160
  path: string;
161
+ type: "registry:ui" | "registry:component" | "registry:hook" | "registry:lib" | "registry:style" | "registry:font";
40
162
  content?: string | undefined;
41
163
  target?: string | undefined;
42
164
  }>, "many">;
43
165
  }, "strip", z.ZodTypeAny, {
44
- name: string;
45
166
  type: "registry:ui" | "registry:component" | "registry:hook" | "registry:lib" | "registry:style";
167
+ name: string;
46
168
  files: {
47
- type: "registry:ui" | "registry:component" | "registry:hook" | "registry:lib" | "registry:style";
48
169
  path: string;
170
+ type: "registry:ui" | "registry:component" | "registry:hook" | "registry:lib" | "registry:style" | "registry:font";
49
171
  content?: string | undefined;
50
172
  target?: string | undefined;
51
173
  }[];
52
174
  dependencies?: string[] | undefined;
53
175
  registryDependencies?: string[] | undefined;
54
176
  }, {
55
- name: string;
56
177
  type: "registry:ui" | "registry:component" | "registry:hook" | "registry:lib" | "registry:style";
178
+ name: string;
57
179
  files: {
58
- type: "registry:ui" | "registry:component" | "registry:hook" | "registry:lib" | "registry:style";
59
180
  path: string;
181
+ type: "registry:ui" | "registry:component" | "registry:hook" | "registry:lib" | "registry:style" | "registry:font";
60
182
  content?: string | undefined;
61
183
  target?: string | undefined;
62
184
  }[];
63
185
  dependencies?: string[] | undefined;
64
186
  registryDependencies?: string[] | undefined;
65
- }>;
187
+ }>]>;
66
188
  type RegistryItem = z.infer<typeof registryItemSchema>;
189
+ type RegistryFontItem = Extract<RegistryItem, {
190
+ type: "registry:font";
191
+ }>;
67
192
  declare const registryIndexSchema: z.ZodObject<{
68
193
  name: z.ZodString;
69
- items: z.ZodArray<z.ZodObject<{
194
+ items: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
70
195
  name: z.ZodString;
71
- type: z.ZodEnum<["registry:ui", "registry:component", "registry:hook", "registry:lib", "registry:style"]>;
72
196
  dependencies: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
73
197
  registryDependencies: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
198
+ } & {
199
+ type: z.ZodLiteral<"registry:font">;
200
+ font: z.ZodObject<{
201
+ family: z.ZodString;
202
+ provider: z.ZodLiteral<"google">;
203
+ import: z.ZodString;
204
+ variable: z.ZodString;
205
+ weight: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
206
+ subsets: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
207
+ selector: z.ZodOptional<z.ZodString>;
208
+ dependency: z.ZodOptional<z.ZodString>;
209
+ }, "strip", z.ZodTypeAny, {
210
+ family: string;
211
+ provider: "google";
212
+ import: string;
213
+ variable: string;
214
+ weight?: string[] | undefined;
215
+ subsets?: string[] | undefined;
216
+ selector?: string | undefined;
217
+ dependency?: string | undefined;
218
+ }, {
219
+ family: string;
220
+ provider: "google";
221
+ import: string;
222
+ variable: string;
223
+ weight?: string[] | undefined;
224
+ subsets?: string[] | undefined;
225
+ selector?: string | undefined;
226
+ dependency?: string | undefined;
227
+ }>;
228
+ files: z.ZodOptional<z.ZodArray<z.ZodObject<{
229
+ path: z.ZodString;
230
+ type: z.ZodEnum<["registry:ui", "registry:component", "registry:hook", "registry:lib", "registry:style", "registry:font"]>;
231
+ content: z.ZodOptional<z.ZodString>;
232
+ target: z.ZodOptional<z.ZodString>;
233
+ }, "strip", z.ZodTypeAny, {
234
+ path: string;
235
+ type: "registry:ui" | "registry:component" | "registry:hook" | "registry:lib" | "registry:style" | "registry:font";
236
+ content?: string | undefined;
237
+ target?: string | undefined;
238
+ }, {
239
+ path: string;
240
+ type: "registry:ui" | "registry:component" | "registry:hook" | "registry:lib" | "registry:style" | "registry:font";
241
+ content?: string | undefined;
242
+ target?: string | undefined;
243
+ }>, "many">>;
244
+ }, "strip", z.ZodTypeAny, {
245
+ type: "registry:font";
246
+ name: string;
247
+ font: {
248
+ family: string;
249
+ provider: "google";
250
+ import: string;
251
+ variable: string;
252
+ weight?: string[] | undefined;
253
+ subsets?: string[] | undefined;
254
+ selector?: string | undefined;
255
+ dependency?: string | undefined;
256
+ };
257
+ dependencies?: string[] | undefined;
258
+ registryDependencies?: string[] | undefined;
259
+ files?: {
260
+ path: string;
261
+ type: "registry:ui" | "registry:component" | "registry:hook" | "registry:lib" | "registry:style" | "registry:font";
262
+ content?: string | undefined;
263
+ target?: string | undefined;
264
+ }[] | undefined;
265
+ }, {
266
+ type: "registry:font";
267
+ name: string;
268
+ font: {
269
+ family: string;
270
+ provider: "google";
271
+ import: string;
272
+ variable: string;
273
+ weight?: string[] | undefined;
274
+ subsets?: string[] | undefined;
275
+ selector?: string | undefined;
276
+ dependency?: string | undefined;
277
+ };
278
+ dependencies?: string[] | undefined;
279
+ registryDependencies?: string[] | undefined;
280
+ files?: {
281
+ path: string;
282
+ type: "registry:ui" | "registry:component" | "registry:hook" | "registry:lib" | "registry:style" | "registry:font";
283
+ content?: string | undefined;
284
+ target?: string | undefined;
285
+ }[] | undefined;
286
+ }>, z.ZodObject<{
287
+ name: z.ZodString;
288
+ dependencies: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
289
+ registryDependencies: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
290
+ } & {
291
+ type: z.ZodEnum<["registry:ui", "registry:component", "registry:hook", "registry:lib", "registry:style"]>;
74
292
  files: z.ZodArray<z.ZodObject<{
75
293
  path: z.ZodString;
76
- type: z.ZodEnum<["registry:ui", "registry:component", "registry:hook", "registry:lib", "registry:style"]>;
294
+ type: z.ZodEnum<["registry:ui", "registry:component", "registry:hook", "registry:lib", "registry:style", "registry:font"]>;
77
295
  content: z.ZodOptional<z.ZodString>;
78
296
  target: z.ZodOptional<z.ZodString>;
79
297
  }, "strip", z.ZodTypeAny, {
80
- type: "registry:ui" | "registry:component" | "registry:hook" | "registry:lib" | "registry:style";
81
298
  path: string;
299
+ type: "registry:ui" | "registry:component" | "registry:hook" | "registry:lib" | "registry:style" | "registry:font";
82
300
  content?: string | undefined;
83
301
  target?: string | undefined;
84
302
  }, {
85
- type: "registry:ui" | "registry:component" | "registry:hook" | "registry:lib" | "registry:style";
86
303
  path: string;
304
+ type: "registry:ui" | "registry:component" | "registry:hook" | "registry:lib" | "registry:style" | "registry:font";
87
305
  content?: string | undefined;
88
306
  target?: string | undefined;
89
307
  }>, "many">;
90
308
  }, "strip", z.ZodTypeAny, {
91
- name: string;
92
309
  type: "registry:ui" | "registry:component" | "registry:hook" | "registry:lib" | "registry:style";
310
+ name: string;
93
311
  files: {
94
- type: "registry:ui" | "registry:component" | "registry:hook" | "registry:lib" | "registry:style";
95
312
  path: string;
313
+ type: "registry:ui" | "registry:component" | "registry:hook" | "registry:lib" | "registry:style" | "registry:font";
96
314
  content?: string | undefined;
97
315
  target?: string | undefined;
98
316
  }[];
99
317
  dependencies?: string[] | undefined;
100
318
  registryDependencies?: string[] | undefined;
101
319
  }, {
102
- name: string;
103
320
  type: "registry:ui" | "registry:component" | "registry:hook" | "registry:lib" | "registry:style";
321
+ name: string;
104
322
  files: {
105
- type: "registry:ui" | "registry:component" | "registry:hook" | "registry:lib" | "registry:style";
106
323
  path: string;
324
+ type: "registry:ui" | "registry:component" | "registry:hook" | "registry:lib" | "registry:style" | "registry:font";
107
325
  content?: string | undefined;
108
326
  target?: string | undefined;
109
327
  }[];
110
328
  dependencies?: string[] | undefined;
111
329
  registryDependencies?: string[] | undefined;
112
- }>, "many">;
330
+ }>]>, "many">;
113
331
  }, "strip", z.ZodTypeAny, {
114
332
  name: string;
115
- items: {
333
+ items: ({
334
+ type: "registry:font";
116
335
  name: string;
336
+ font: {
337
+ family: string;
338
+ provider: "google";
339
+ import: string;
340
+ variable: string;
341
+ weight?: string[] | undefined;
342
+ subsets?: string[] | undefined;
343
+ selector?: string | undefined;
344
+ dependency?: string | undefined;
345
+ };
346
+ dependencies?: string[] | undefined;
347
+ registryDependencies?: string[] | undefined;
348
+ files?: {
349
+ path: string;
350
+ type: "registry:ui" | "registry:component" | "registry:hook" | "registry:lib" | "registry:style" | "registry:font";
351
+ content?: string | undefined;
352
+ target?: string | undefined;
353
+ }[] | undefined;
354
+ } | {
117
355
  type: "registry:ui" | "registry:component" | "registry:hook" | "registry:lib" | "registry:style";
356
+ name: string;
118
357
  files: {
119
- type: "registry:ui" | "registry:component" | "registry:hook" | "registry:lib" | "registry:style";
120
358
  path: string;
359
+ type: "registry:ui" | "registry:component" | "registry:hook" | "registry:lib" | "registry:style" | "registry:font";
121
360
  content?: string | undefined;
122
361
  target?: string | undefined;
123
362
  }[];
124
363
  dependencies?: string[] | undefined;
125
364
  registryDependencies?: string[] | undefined;
126
- }[];
365
+ })[];
127
366
  }, {
128
367
  name: string;
129
- items: {
368
+ items: ({
369
+ type: "registry:font";
130
370
  name: string;
371
+ font: {
372
+ family: string;
373
+ provider: "google";
374
+ import: string;
375
+ variable: string;
376
+ weight?: string[] | undefined;
377
+ subsets?: string[] | undefined;
378
+ selector?: string | undefined;
379
+ dependency?: string | undefined;
380
+ };
381
+ dependencies?: string[] | undefined;
382
+ registryDependencies?: string[] | undefined;
383
+ files?: {
384
+ path: string;
385
+ type: "registry:ui" | "registry:component" | "registry:hook" | "registry:lib" | "registry:style" | "registry:font";
386
+ content?: string | undefined;
387
+ target?: string | undefined;
388
+ }[] | undefined;
389
+ } | {
131
390
  type: "registry:ui" | "registry:component" | "registry:hook" | "registry:lib" | "registry:style";
391
+ name: string;
132
392
  files: {
133
- type: "registry:ui" | "registry:component" | "registry:hook" | "registry:lib" | "registry:style";
134
393
  path: string;
394
+ type: "registry:ui" | "registry:component" | "registry:hook" | "registry:lib" | "registry:style" | "registry:font";
135
395
  content?: string | undefined;
136
396
  target?: string | undefined;
137
397
  }[];
138
398
  dependencies?: string[] | undefined;
139
399
  registryDependencies?: string[] | undefined;
140
- }[];
400
+ })[];
141
401
  }>;
142
402
  type RegistryIndex = z.infer<typeof registryIndexSchema>;
143
403
  declare const configSchema: z.ZodObject<{
@@ -206,4 +466,4 @@ declare const configSchema: z.ZodObject<{
206
466
  }>;
207
467
  type SteraConfig = z.infer<typeof configSchema>;
208
468
 
209
- export { type RegistryIndex, type RegistryItem, type RegistryItemFile, type RegistryItemType, type SteraConfig, configSchema, registryIndexSchema, registryItemFileSchema, registryItemSchema, registryItemTypeSchema };
469
+ export { type RegistryFontItem, type RegistryIndex, type RegistryItem, type RegistryItemFile, type RegistryItemFont, type RegistryItemType, type SteraConfig, configSchema, registryIndexSchema, registryItemFileSchema, registryItemFontSchema, registryItemSchema, registryItemTypeSchema };
@@ -2,13 +2,15 @@ import {
2
2
  configSchema,
3
3
  registryIndexSchema,
4
4
  registryItemFileSchema,
5
+ registryItemFontSchema,
5
6
  registryItemSchema,
6
7
  registryItemTypeSchema
7
- } from "../chunk-AXIACJ2C.js";
8
+ } from "../chunk-3KADOWKC.js";
8
9
  export {
9
10
  configSchema,
10
11
  registryIndexSchema,
11
12
  registryItemFileSchema,
13
+ registryItemFontSchema,
12
14
  registryItemSchema,
13
15
  registryItemTypeSchema
14
16
  };
@@ -1,4 +1,4 @@
1
- import { RegistryItem } from '../schema/index.js';
1
+ import { RegistryItem, RegistryFontItem } from '../schema/index.js';
2
2
  import 'zod';
3
3
 
4
4
  interface SteraConfig {
@@ -106,4 +106,30 @@ declare function createSpinner(text: string): {
106
106
  fail(msg: string): void;
107
107
  };
108
108
 
109
- export { CHECK, CONFIG_FILE, CROSS, LOGO, type ProjectInfo, type TransformContext, type TransformFn, WARN, type WriteOptions, type WriteResult, applyTransforms, brand, createSpinner, detectPackageManager, detectProject, dim, findConfigPath, hasGlobalsCss, installDependencies, loadConfig, resolveOutputPath, transformImports, writeComponentFiles };
109
+ interface FontTreeResult {
110
+ /** CSS variables to set in @theme inline */
111
+ cssVars: Record<string, string>;
112
+ /** npm dependencies to install */
113
+ dependencies: string[];
114
+ /** CSS @import lines to add (fontsource) */
115
+ cssImports: string[];
116
+ }
117
+ /**
118
+ * Process font items and return CSS variables, dependencies, and imports
119
+ * based on the detected framework.
120
+ *
121
+ * - **Next.js**: Sets CSS vars to self-referencing `var(--font-sans)`.
122
+ * The actual font loading is handled by next/font in the layout file.
123
+ * - **Other frameworks**: Installs @fontsource-variable/* packages and
124
+ * adds @import lines to CSS. Sets CSS vars to the font family string.
125
+ */
126
+ declare function massageTreeForFonts(fonts: RegistryFontItem[], project: ProjectInfo): FontTreeResult;
127
+ /**
128
+ * For Next.js projects: patch the layout file with next/font/google imports
129
+ * and update the <html> className using AST manipulation.
130
+ */
131
+ declare function updateFonts(fonts: RegistryFontItem[], project: ProjectInfo, cwd: string, options?: {
132
+ silent?: boolean;
133
+ }): Promise<void>;
134
+
135
+ export { CHECK, CONFIG_FILE, CROSS, LOGO, type ProjectInfo, type TransformContext, type TransformFn, WARN, type WriteOptions, type WriteResult, applyTransforms, brand, createSpinner, detectPackageManager, detectProject, dim, findConfigPath, hasGlobalsCss, installDependencies, loadConfig, massageTreeForFonts, resolveOutputPath, transformImports, updateFonts, writeComponentFiles };
@@ -14,10 +14,12 @@ import {
14
14
  hasGlobalsCss,
15
15
  installDependencies,
16
16
  loadConfig,
17
+ massageTreeForFonts,
17
18
  resolveOutputPath,
18
19
  transformImports,
20
+ updateFonts,
19
21
  writeComponentFiles
20
- } from "../chunk-MFUZBXO6.js";
22
+ } from "../chunk-26HP67ZM.js";
21
23
  export {
22
24
  CHECK,
23
25
  CONFIG_FILE,
@@ -34,7 +36,9 @@ export {
34
36
  hasGlobalsCss,
35
37
  installDependencies,
36
38
  loadConfig,
39
+ massageTreeForFonts,
37
40
  resolveOutputPath,
38
41
  transformImports,
42
+ updateFonts,
39
43
  writeComponentFiles
40
44
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stera-ui",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "type": "module",
5
5
  "description": "Add Stera UI components to your project.",
6
6
  "license": "MIT",
@@ -37,6 +37,7 @@
37
37
  "@inquirer/prompts": "^7.0.0",
38
38
  "commander": "^13.1.0",
39
39
  "execa": "^9.6.1",
40
+ "ts-morph": "^27.0.2",
40
41
  "tsconfig-paths": "^4.2.0",
41
42
  "zod": "^3.24.0"
42
43
  },