@tanstack/cta-engine 0.10.0-alpha.19 → 0.10.0-alpha.21

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.
Files changed (69) hide show
  1. package/dist/add-ons.js +5 -14
  2. package/dist/add-to-app.js +118 -74
  3. package/dist/config-file.js +9 -7
  4. package/dist/create-app.js +112 -34
  5. package/dist/custom-add-ons/add-on.js +175 -0
  6. package/dist/custom-add-ons/shared.js +117 -0
  7. package/dist/custom-add-ons/starter.js +84 -0
  8. package/dist/environment.js +59 -12
  9. package/dist/file-helpers.js +108 -2
  10. package/dist/frameworks.js +15 -1
  11. package/dist/index.js +12 -5
  12. package/dist/integrations/shadcn.js +10 -4
  13. package/dist/options.js +9 -0
  14. package/dist/package-json.js +7 -4
  15. package/dist/special-steps/index.js +24 -0
  16. package/dist/special-steps/rimraf-node-modules.js +16 -0
  17. package/dist/template-file.js +3 -13
  18. package/dist/types/add-ons.d.ts +3 -4
  19. package/dist/types/add-to-app.d.ts +16 -3
  20. package/dist/types/config-file.d.ts +4 -3
  21. package/dist/types/create-app.d.ts +1 -7
  22. package/dist/types/custom-add-ons/add-on.d.ts +69 -0
  23. package/dist/types/custom-add-ons/shared.d.ts +15 -0
  24. package/dist/types/custom-add-ons/starter.d.ts +7 -0
  25. package/dist/types/environment.d.ts +2 -1
  26. package/dist/types/file-helpers.d.ts +10 -0
  27. package/dist/types/frameworks.d.ts +2 -0
  28. package/dist/types/index.d.ts +13 -6
  29. package/dist/types/integrations/shadcn.d.ts +1 -1
  30. package/dist/types/options.d.ts +2 -0
  31. package/dist/types/package-json.d.ts +5 -0
  32. package/dist/types/package-manager.d.ts +6 -2
  33. package/dist/types/special-steps/index.d.ts +2 -0
  34. package/dist/types/special-steps/rimraf-node-modules.d.ts +2 -0
  35. package/dist/types/template-file.d.ts +1 -1
  36. package/dist/types/types.d.ts +752 -70
  37. package/dist/types.js +65 -1
  38. package/package.json +9 -3
  39. package/src/add-ons.ts +7 -19
  40. package/src/add-to-app.ts +196 -102
  41. package/src/config-file.ts +16 -13
  42. package/src/create-app.ts +129 -75
  43. package/src/custom-add-ons/add-on.ts +261 -0
  44. package/src/custom-add-ons/shared.ts +161 -0
  45. package/src/custom-add-ons/starter.ts +126 -0
  46. package/src/environment.ts +70 -11
  47. package/src/file-helpers.ts +164 -2
  48. package/src/frameworks.ts +21 -1
  49. package/src/index.ts +46 -11
  50. package/src/integrations/shadcn.ts +14 -4
  51. package/src/options.ts +11 -0
  52. package/src/package-json.ts +13 -6
  53. package/src/special-steps/index.ts +36 -0
  54. package/src/special-steps/rimraf-node-modules.ts +25 -0
  55. package/src/template-file.ts +3 -18
  56. package/src/types.ts +143 -85
  57. package/tests/add-ons.test.ts +5 -5
  58. package/tests/add-to-app.test.ts +358 -0
  59. package/tests/config-file.test.ts +15 -11
  60. package/tests/create-app.test.ts +43 -67
  61. package/tests/custom-add-ons/add-on.test.ts +12 -0
  62. package/tests/custom-add-ons/shared.test.ts +257 -0
  63. package/tests/custom-add-ons/starter.test.ts +58 -0
  64. package/tests/environment.test.ts +19 -0
  65. package/tests/integrations/shadcn.test.ts +48 -63
  66. package/tests/options.test.ts +42 -0
  67. package/tests/setupVitest.ts +6 -0
  68. package/tests/template-file.test.ts +54 -91
  69. package/vitest.config.ts +2 -0
@@ -1,61 +1,736 @@
1
+ import z from 'zod';
1
2
  import type { CODE_ROUTER, FILE_ROUTER } from './constants.js';
2
3
  import type { PackageManager } from './package-manager.js';
3
- export type TemplateOptions = 'typescript' | 'javascript' | 'file-router';
4
4
  export type Mode = typeof CODE_ROUTER | typeof FILE_ROUTER;
5
- export type FileBundleHandler = {
6
- getFiles: () => Promise<Array<string>>;
7
- getFileContents: (path: string) => Promise<string>;
8
- };
9
- export type Integration = {
10
- type: 'provider' | 'root-provider' | 'layout' | 'header-user';
11
- path: string;
12
- jsName: string;
13
- };
14
- export type AddOnDefinition = {
5
+ export type StatusStepType = 'file' | 'command' | 'info' | 'package-manager' | 'other';
6
+ export declare const AddOnBaseSchema: z.ZodObject<{
7
+ id: z.ZodString;
8
+ name: z.ZodString;
9
+ description: z.ZodString;
10
+ author: z.ZodOptional<z.ZodString>;
11
+ version: z.ZodOptional<z.ZodString>;
12
+ link: z.ZodOptional<z.ZodString>;
13
+ license: z.ZodOptional<z.ZodString>;
14
+ warning: z.ZodOptional<z.ZodString>;
15
+ type: z.ZodEnum<["add-on", "example", "starter", "toolchain"]>;
16
+ command: z.ZodOptional<z.ZodObject<{
17
+ command: z.ZodString;
18
+ args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
19
+ }, "strip", z.ZodTypeAny, {
20
+ command: string;
21
+ args?: string[] | undefined;
22
+ }, {
23
+ command: string;
24
+ args?: string[] | undefined;
25
+ }>>;
26
+ routes: z.ZodOptional<z.ZodArray<z.ZodObject<{
27
+ url: z.ZodOptional<z.ZodString>;
28
+ name: z.ZodOptional<z.ZodString>;
29
+ path: z.ZodString;
30
+ jsName: z.ZodString;
31
+ }, "strip", z.ZodTypeAny, {
32
+ path: string;
33
+ jsName: string;
34
+ name?: string | undefined;
35
+ url?: string | undefined;
36
+ }, {
37
+ path: string;
38
+ jsName: string;
39
+ name?: string | undefined;
40
+ url?: string | undefined;
41
+ }>, "many">>;
42
+ packageAdditions: z.ZodOptional<z.ZodObject<{
43
+ dependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
44
+ devDependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
45
+ scripts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
46
+ }, "strip", z.ZodTypeAny, {
47
+ dependencies?: Record<string, string> | undefined;
48
+ devDependencies?: Record<string, string> | undefined;
49
+ scripts?: Record<string, string> | undefined;
50
+ }, {
51
+ dependencies?: Record<string, string> | undefined;
52
+ devDependencies?: Record<string, string> | undefined;
53
+ scripts?: Record<string, string> | undefined;
54
+ }>>;
55
+ shadcnComponents: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
56
+ dependsOn: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
57
+ smallLogo: z.ZodOptional<z.ZodString>;
58
+ logo: z.ZodOptional<z.ZodString>;
59
+ addOnSpecialSteps: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
60
+ createSpecialSteps: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
61
+ }, "strip", z.ZodTypeAny, {
15
62
  id: string;
16
63
  name: string;
17
64
  description: string;
18
- type: 'add-on' | 'example' | 'starter' | 'toolchain';
19
- link: string;
20
- templates: Array<string>;
21
- routes?: Array<{
22
- url: string;
23
- name: string;
65
+ type: "add-on" | "example" | "starter" | "toolchain";
66
+ command?: {
67
+ command: string;
68
+ args?: string[] | undefined;
69
+ } | undefined;
70
+ author?: string | undefined;
71
+ version?: string | undefined;
72
+ link?: string | undefined;
73
+ license?: string | undefined;
74
+ warning?: string | undefined;
75
+ routes?: {
24
76
  path: string;
25
77
  jsName: string;
26
- }>;
27
- packageAdditions: {
28
- dependencies?: Record<string, string>;
29
- devDependencies?: Record<string, string>;
30
- scripts?: Record<string, string>;
31
- };
78
+ name?: string | undefined;
79
+ url?: string | undefined;
80
+ }[] | undefined;
81
+ packageAdditions?: {
82
+ dependencies?: Record<string, string> | undefined;
83
+ devDependencies?: Record<string, string> | undefined;
84
+ scripts?: Record<string, string> | undefined;
85
+ } | undefined;
86
+ shadcnComponents?: string[] | undefined;
87
+ dependsOn?: string[] | undefined;
88
+ smallLogo?: string | undefined;
89
+ logo?: string | undefined;
90
+ addOnSpecialSteps?: string[] | undefined;
91
+ createSpecialSteps?: string[] | undefined;
92
+ }, {
93
+ id: string;
94
+ name: string;
95
+ description: string;
96
+ type: "add-on" | "example" | "starter" | "toolchain";
32
97
  command?: {
33
98
  command: string;
34
- args?: Array<string>;
35
- };
36
- readme?: string;
37
- phase: 'setup' | 'add-on';
38
- shadcnComponents?: Array<string>;
39
- warning?: string;
40
- dependsOn?: Array<string>;
41
- integrations?: Array<Integration>;
42
- variables?: Array<Variable>;
43
- files?: Record<string, string>;
44
- deletedFiles?: Array<string>;
45
- };
46
- export type StarterDefinition = AddOnDefinition & {
47
- type: 'starter';
48
- version: string;
49
- author: string;
50
- link: string;
51
- license: string;
52
- mode: Mode;
99
+ args?: string[] | undefined;
100
+ } | undefined;
101
+ author?: string | undefined;
102
+ version?: string | undefined;
103
+ link?: string | undefined;
104
+ license?: string | undefined;
105
+ warning?: string | undefined;
106
+ routes?: {
107
+ path: string;
108
+ jsName: string;
109
+ name?: string | undefined;
110
+ url?: string | undefined;
111
+ }[] | undefined;
112
+ packageAdditions?: {
113
+ dependencies?: Record<string, string> | undefined;
114
+ devDependencies?: Record<string, string> | undefined;
115
+ scripts?: Record<string, string> | undefined;
116
+ } | undefined;
117
+ shadcnComponents?: string[] | undefined;
118
+ dependsOn?: string[] | undefined;
119
+ smallLogo?: string | undefined;
120
+ logo?: string | undefined;
121
+ addOnSpecialSteps?: string[] | undefined;
122
+ createSpecialSteps?: string[] | undefined;
123
+ }>;
124
+ export declare const StarterSchema: z.ZodObject<{
125
+ id: z.ZodString;
126
+ name: z.ZodString;
127
+ description: z.ZodString;
128
+ author: z.ZodOptional<z.ZodString>;
129
+ version: z.ZodOptional<z.ZodString>;
130
+ link: z.ZodOptional<z.ZodString>;
131
+ license: z.ZodOptional<z.ZodString>;
132
+ warning: z.ZodOptional<z.ZodString>;
133
+ type: z.ZodEnum<["add-on", "example", "starter", "toolchain"]>;
134
+ command: z.ZodOptional<z.ZodObject<{
135
+ command: z.ZodString;
136
+ args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
137
+ }, "strip", z.ZodTypeAny, {
138
+ command: string;
139
+ args?: string[] | undefined;
140
+ }, {
141
+ command: string;
142
+ args?: string[] | undefined;
143
+ }>>;
144
+ routes: z.ZodOptional<z.ZodArray<z.ZodObject<{
145
+ url: z.ZodOptional<z.ZodString>;
146
+ name: z.ZodOptional<z.ZodString>;
147
+ path: z.ZodString;
148
+ jsName: z.ZodString;
149
+ }, "strip", z.ZodTypeAny, {
150
+ path: string;
151
+ jsName: string;
152
+ name?: string | undefined;
153
+ url?: string | undefined;
154
+ }, {
155
+ path: string;
156
+ jsName: string;
157
+ name?: string | undefined;
158
+ url?: string | undefined;
159
+ }>, "many">>;
160
+ packageAdditions: z.ZodOptional<z.ZodObject<{
161
+ dependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
162
+ devDependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
163
+ scripts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
164
+ }, "strip", z.ZodTypeAny, {
165
+ dependencies?: Record<string, string> | undefined;
166
+ devDependencies?: Record<string, string> | undefined;
167
+ scripts?: Record<string, string> | undefined;
168
+ }, {
169
+ dependencies?: Record<string, string> | undefined;
170
+ devDependencies?: Record<string, string> | undefined;
171
+ scripts?: Record<string, string> | undefined;
172
+ }>>;
173
+ shadcnComponents: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
174
+ dependsOn: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
175
+ smallLogo: z.ZodOptional<z.ZodString>;
176
+ logo: z.ZodOptional<z.ZodString>;
177
+ addOnSpecialSteps: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
178
+ createSpecialSteps: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
179
+ } & {
180
+ framework: z.ZodString;
181
+ mode: z.ZodString;
182
+ typescript: z.ZodBoolean;
183
+ tailwind: z.ZodBoolean;
184
+ banner: z.ZodOptional<z.ZodString>;
185
+ }, "strip", z.ZodTypeAny, {
186
+ id: string;
187
+ name: string;
188
+ description: string;
189
+ type: "add-on" | "example" | "starter" | "toolchain";
190
+ framework: string;
191
+ mode: string;
192
+ typescript: boolean;
193
+ tailwind: boolean;
194
+ command?: {
195
+ command: string;
196
+ args?: string[] | undefined;
197
+ } | undefined;
198
+ author?: string | undefined;
199
+ version?: string | undefined;
200
+ link?: string | undefined;
201
+ license?: string | undefined;
202
+ warning?: string | undefined;
203
+ routes?: {
204
+ path: string;
205
+ jsName: string;
206
+ name?: string | undefined;
207
+ url?: string | undefined;
208
+ }[] | undefined;
209
+ packageAdditions?: {
210
+ dependencies?: Record<string, string> | undefined;
211
+ devDependencies?: Record<string, string> | undefined;
212
+ scripts?: Record<string, string> | undefined;
213
+ } | undefined;
214
+ shadcnComponents?: string[] | undefined;
215
+ dependsOn?: string[] | undefined;
216
+ smallLogo?: string | undefined;
217
+ logo?: string | undefined;
218
+ addOnSpecialSteps?: string[] | undefined;
219
+ createSpecialSteps?: string[] | undefined;
220
+ banner?: string | undefined;
221
+ }, {
222
+ id: string;
223
+ name: string;
224
+ description: string;
225
+ type: "add-on" | "example" | "starter" | "toolchain";
226
+ framework: string;
227
+ mode: string;
228
+ typescript: boolean;
229
+ tailwind: boolean;
230
+ command?: {
231
+ command: string;
232
+ args?: string[] | undefined;
233
+ } | undefined;
234
+ author?: string | undefined;
235
+ version?: string | undefined;
236
+ link?: string | undefined;
237
+ license?: string | undefined;
238
+ warning?: string | undefined;
239
+ routes?: {
240
+ path: string;
241
+ jsName: string;
242
+ name?: string | undefined;
243
+ url?: string | undefined;
244
+ }[] | undefined;
245
+ packageAdditions?: {
246
+ dependencies?: Record<string, string> | undefined;
247
+ devDependencies?: Record<string, string> | undefined;
248
+ scripts?: Record<string, string> | undefined;
249
+ } | undefined;
250
+ shadcnComponents?: string[] | undefined;
251
+ dependsOn?: string[] | undefined;
252
+ smallLogo?: string | undefined;
253
+ logo?: string | undefined;
254
+ addOnSpecialSteps?: string[] | undefined;
255
+ createSpecialSteps?: string[] | undefined;
256
+ banner?: string | undefined;
257
+ }>;
258
+ export declare const StarterCompiledSchema: z.ZodObject<{
259
+ id: z.ZodString;
260
+ name: z.ZodString;
261
+ description: z.ZodString;
262
+ author: z.ZodOptional<z.ZodString>;
263
+ version: z.ZodOptional<z.ZodString>;
264
+ link: z.ZodOptional<z.ZodString>;
265
+ license: z.ZodOptional<z.ZodString>;
266
+ warning: z.ZodOptional<z.ZodString>;
267
+ type: z.ZodEnum<["add-on", "example", "starter", "toolchain"]>;
268
+ command: z.ZodOptional<z.ZodObject<{
269
+ command: z.ZodString;
270
+ args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
271
+ }, "strip", z.ZodTypeAny, {
272
+ command: string;
273
+ args?: string[] | undefined;
274
+ }, {
275
+ command: string;
276
+ args?: string[] | undefined;
277
+ }>>;
278
+ routes: z.ZodOptional<z.ZodArray<z.ZodObject<{
279
+ url: z.ZodOptional<z.ZodString>;
280
+ name: z.ZodOptional<z.ZodString>;
281
+ path: z.ZodString;
282
+ jsName: z.ZodString;
283
+ }, "strip", z.ZodTypeAny, {
284
+ path: string;
285
+ jsName: string;
286
+ name?: string | undefined;
287
+ url?: string | undefined;
288
+ }, {
289
+ path: string;
290
+ jsName: string;
291
+ name?: string | undefined;
292
+ url?: string | undefined;
293
+ }>, "many">>;
294
+ packageAdditions: z.ZodOptional<z.ZodObject<{
295
+ dependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
296
+ devDependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
297
+ scripts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
298
+ }, "strip", z.ZodTypeAny, {
299
+ dependencies?: Record<string, string> | undefined;
300
+ devDependencies?: Record<string, string> | undefined;
301
+ scripts?: Record<string, string> | undefined;
302
+ }, {
303
+ dependencies?: Record<string, string> | undefined;
304
+ devDependencies?: Record<string, string> | undefined;
305
+ scripts?: Record<string, string> | undefined;
306
+ }>>;
307
+ shadcnComponents: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
308
+ dependsOn: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
309
+ smallLogo: z.ZodOptional<z.ZodString>;
310
+ logo: z.ZodOptional<z.ZodString>;
311
+ addOnSpecialSteps: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
312
+ createSpecialSteps: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
313
+ } & {
314
+ framework: z.ZodString;
315
+ mode: z.ZodString;
316
+ typescript: z.ZodBoolean;
317
+ tailwind: z.ZodBoolean;
318
+ banner: z.ZodOptional<z.ZodString>;
319
+ } & {
320
+ files: z.ZodRecord<z.ZodString, z.ZodString>;
321
+ deletedFiles: z.ZodArray<z.ZodString, "many">;
322
+ }, "strip", z.ZodTypeAny, {
323
+ id: string;
324
+ name: string;
325
+ description: string;
326
+ type: "add-on" | "example" | "starter" | "toolchain";
327
+ framework: string;
328
+ mode: string;
329
+ typescript: boolean;
330
+ tailwind: boolean;
331
+ files: Record<string, string>;
332
+ deletedFiles: string[];
333
+ command?: {
334
+ command: string;
335
+ args?: string[] | undefined;
336
+ } | undefined;
337
+ author?: string | undefined;
338
+ version?: string | undefined;
339
+ link?: string | undefined;
340
+ license?: string | undefined;
341
+ warning?: string | undefined;
342
+ routes?: {
343
+ path: string;
344
+ jsName: string;
345
+ name?: string | undefined;
346
+ url?: string | undefined;
347
+ }[] | undefined;
348
+ packageAdditions?: {
349
+ dependencies?: Record<string, string> | undefined;
350
+ devDependencies?: Record<string, string> | undefined;
351
+ scripts?: Record<string, string> | undefined;
352
+ } | undefined;
353
+ shadcnComponents?: string[] | undefined;
354
+ dependsOn?: string[] | undefined;
355
+ smallLogo?: string | undefined;
356
+ logo?: string | undefined;
357
+ addOnSpecialSteps?: string[] | undefined;
358
+ createSpecialSteps?: string[] | undefined;
359
+ banner?: string | undefined;
360
+ }, {
361
+ id: string;
362
+ name: string;
363
+ description: string;
364
+ type: "add-on" | "example" | "starter" | "toolchain";
53
365
  framework: string;
366
+ mode: string;
54
367
  typescript: boolean;
55
368
  tailwind: boolean;
369
+ files: Record<string, string>;
370
+ deletedFiles: string[];
371
+ command?: {
372
+ command: string;
373
+ args?: string[] | undefined;
374
+ } | undefined;
375
+ author?: string | undefined;
376
+ version?: string | undefined;
377
+ link?: string | undefined;
378
+ license?: string | undefined;
379
+ warning?: string | undefined;
380
+ routes?: {
381
+ path: string;
382
+ jsName: string;
383
+ name?: string | undefined;
384
+ url?: string | undefined;
385
+ }[] | undefined;
386
+ packageAdditions?: {
387
+ dependencies?: Record<string, string> | undefined;
388
+ devDependencies?: Record<string, string> | undefined;
389
+ scripts?: Record<string, string> | undefined;
390
+ } | undefined;
391
+ shadcnComponents?: string[] | undefined;
392
+ dependsOn?: string[] | undefined;
393
+ smallLogo?: string | undefined;
394
+ logo?: string | undefined;
395
+ addOnSpecialSteps?: string[] | undefined;
396
+ createSpecialSteps?: string[] | undefined;
397
+ banner?: string | undefined;
398
+ }>;
399
+ export declare const IntegrationSchema: z.ZodObject<{
400
+ type: z.ZodString;
401
+ path: z.ZodString;
402
+ jsName: z.ZodString;
403
+ }, "strip", z.ZodTypeAny, {
404
+ type: string;
405
+ path: string;
406
+ jsName: string;
407
+ }, {
408
+ type: string;
409
+ path: string;
410
+ jsName: string;
411
+ }>;
412
+ export declare const AddOnInfoSchema: z.ZodObject<{
413
+ id: z.ZodString;
414
+ name: z.ZodString;
415
+ description: z.ZodString;
416
+ author: z.ZodOptional<z.ZodString>;
417
+ version: z.ZodOptional<z.ZodString>;
418
+ link: z.ZodOptional<z.ZodString>;
419
+ license: z.ZodOptional<z.ZodString>;
420
+ warning: z.ZodOptional<z.ZodString>;
421
+ type: z.ZodEnum<["add-on", "example", "starter", "toolchain"]>;
422
+ command: z.ZodOptional<z.ZodObject<{
423
+ command: z.ZodString;
424
+ args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
425
+ }, "strip", z.ZodTypeAny, {
426
+ command: string;
427
+ args?: string[] | undefined;
428
+ }, {
429
+ command: string;
430
+ args?: string[] | undefined;
431
+ }>>;
432
+ routes: z.ZodOptional<z.ZodArray<z.ZodObject<{
433
+ url: z.ZodOptional<z.ZodString>;
434
+ name: z.ZodOptional<z.ZodString>;
435
+ path: z.ZodString;
436
+ jsName: z.ZodString;
437
+ }, "strip", z.ZodTypeAny, {
438
+ path: string;
439
+ jsName: string;
440
+ name?: string | undefined;
441
+ url?: string | undefined;
442
+ }, {
443
+ path: string;
444
+ jsName: string;
445
+ name?: string | undefined;
446
+ url?: string | undefined;
447
+ }>, "many">>;
448
+ packageAdditions: z.ZodOptional<z.ZodObject<{
449
+ dependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
450
+ devDependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
451
+ scripts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
452
+ }, "strip", z.ZodTypeAny, {
453
+ dependencies?: Record<string, string> | undefined;
454
+ devDependencies?: Record<string, string> | undefined;
455
+ scripts?: Record<string, string> | undefined;
456
+ }, {
457
+ dependencies?: Record<string, string> | undefined;
458
+ devDependencies?: Record<string, string> | undefined;
459
+ scripts?: Record<string, string> | undefined;
460
+ }>>;
461
+ shadcnComponents: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
462
+ dependsOn: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
463
+ smallLogo: z.ZodOptional<z.ZodString>;
464
+ logo: z.ZodOptional<z.ZodString>;
465
+ addOnSpecialSteps: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
466
+ createSpecialSteps: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
467
+ } & {
468
+ modes: z.ZodArray<z.ZodString, "many">;
469
+ integrations: z.ZodOptional<z.ZodArray<z.ZodObject<{
470
+ type: z.ZodString;
471
+ path: z.ZodString;
472
+ jsName: z.ZodString;
473
+ }, "strip", z.ZodTypeAny, {
474
+ type: string;
475
+ path: string;
476
+ jsName: string;
477
+ }, {
478
+ type: string;
479
+ path: string;
480
+ jsName: string;
481
+ }>, "many">>;
482
+ phase: z.ZodEnum<["setup", "add-on"]>;
483
+ readme: z.ZodOptional<z.ZodString>;
484
+ }, "strip", z.ZodTypeAny, {
485
+ id: string;
486
+ name: string;
487
+ description: string;
488
+ type: "add-on" | "example" | "starter" | "toolchain";
489
+ modes: string[];
490
+ phase: "add-on" | "setup";
491
+ command?: {
492
+ command: string;
493
+ args?: string[] | undefined;
494
+ } | undefined;
495
+ author?: string | undefined;
496
+ version?: string | undefined;
497
+ link?: string | undefined;
498
+ license?: string | undefined;
499
+ warning?: string | undefined;
500
+ routes?: {
501
+ path: string;
502
+ jsName: string;
503
+ name?: string | undefined;
504
+ url?: string | undefined;
505
+ }[] | undefined;
506
+ packageAdditions?: {
507
+ dependencies?: Record<string, string> | undefined;
508
+ devDependencies?: Record<string, string> | undefined;
509
+ scripts?: Record<string, string> | undefined;
510
+ } | undefined;
511
+ shadcnComponents?: string[] | undefined;
512
+ dependsOn?: string[] | undefined;
513
+ smallLogo?: string | undefined;
514
+ logo?: string | undefined;
515
+ addOnSpecialSteps?: string[] | undefined;
516
+ createSpecialSteps?: string[] | undefined;
517
+ integrations?: {
518
+ type: string;
519
+ path: string;
520
+ jsName: string;
521
+ }[] | undefined;
522
+ readme?: string | undefined;
523
+ }, {
524
+ id: string;
525
+ name: string;
526
+ description: string;
527
+ type: "add-on" | "example" | "starter" | "toolchain";
528
+ modes: string[];
529
+ phase: "add-on" | "setup";
530
+ command?: {
531
+ command: string;
532
+ args?: string[] | undefined;
533
+ } | undefined;
534
+ author?: string | undefined;
535
+ version?: string | undefined;
536
+ link?: string | undefined;
537
+ license?: string | undefined;
538
+ warning?: string | undefined;
539
+ routes?: {
540
+ path: string;
541
+ jsName: string;
542
+ name?: string | undefined;
543
+ url?: string | undefined;
544
+ }[] | undefined;
545
+ packageAdditions?: {
546
+ dependencies?: Record<string, string> | undefined;
547
+ devDependencies?: Record<string, string> | undefined;
548
+ scripts?: Record<string, string> | undefined;
549
+ } | undefined;
550
+ shadcnComponents?: string[] | undefined;
551
+ dependsOn?: string[] | undefined;
552
+ smallLogo?: string | undefined;
553
+ logo?: string | undefined;
554
+ addOnSpecialSteps?: string[] | undefined;
555
+ createSpecialSteps?: string[] | undefined;
556
+ integrations?: {
557
+ type: string;
558
+ path: string;
559
+ jsName: string;
560
+ }[] | undefined;
561
+ readme?: string | undefined;
562
+ }>;
563
+ export declare const AddOnCompiledSchema: z.ZodObject<{
564
+ id: z.ZodString;
565
+ name: z.ZodString;
566
+ description: z.ZodString;
567
+ author: z.ZodOptional<z.ZodString>;
568
+ version: z.ZodOptional<z.ZodString>;
569
+ link: z.ZodOptional<z.ZodString>;
570
+ license: z.ZodOptional<z.ZodString>;
571
+ warning: z.ZodOptional<z.ZodString>;
572
+ type: z.ZodEnum<["add-on", "example", "starter", "toolchain"]>;
573
+ command: z.ZodOptional<z.ZodObject<{
574
+ command: z.ZodString;
575
+ args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
576
+ }, "strip", z.ZodTypeAny, {
577
+ command: string;
578
+ args?: string[] | undefined;
579
+ }, {
580
+ command: string;
581
+ args?: string[] | undefined;
582
+ }>>;
583
+ routes: z.ZodOptional<z.ZodArray<z.ZodObject<{
584
+ url: z.ZodOptional<z.ZodString>;
585
+ name: z.ZodOptional<z.ZodString>;
586
+ path: z.ZodString;
587
+ jsName: z.ZodString;
588
+ }, "strip", z.ZodTypeAny, {
589
+ path: string;
590
+ jsName: string;
591
+ name?: string | undefined;
592
+ url?: string | undefined;
593
+ }, {
594
+ path: string;
595
+ jsName: string;
596
+ name?: string | undefined;
597
+ url?: string | undefined;
598
+ }>, "many">>;
599
+ packageAdditions: z.ZodOptional<z.ZodObject<{
600
+ dependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
601
+ devDependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
602
+ scripts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
603
+ }, "strip", z.ZodTypeAny, {
604
+ dependencies?: Record<string, string> | undefined;
605
+ devDependencies?: Record<string, string> | undefined;
606
+ scripts?: Record<string, string> | undefined;
607
+ }, {
608
+ dependencies?: Record<string, string> | undefined;
609
+ devDependencies?: Record<string, string> | undefined;
610
+ scripts?: Record<string, string> | undefined;
611
+ }>>;
612
+ shadcnComponents: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
613
+ dependsOn: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
614
+ smallLogo: z.ZodOptional<z.ZodString>;
615
+ logo: z.ZodOptional<z.ZodString>;
616
+ addOnSpecialSteps: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
617
+ createSpecialSteps: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
618
+ } & {
619
+ modes: z.ZodArray<z.ZodString, "many">;
620
+ integrations: z.ZodOptional<z.ZodArray<z.ZodObject<{
621
+ type: z.ZodString;
622
+ path: z.ZodString;
623
+ jsName: z.ZodString;
624
+ }, "strip", z.ZodTypeAny, {
625
+ type: string;
626
+ path: string;
627
+ jsName: string;
628
+ }, {
629
+ type: string;
630
+ path: string;
631
+ jsName: string;
632
+ }>, "many">>;
633
+ phase: z.ZodEnum<["setup", "add-on"]>;
634
+ readme: z.ZodOptional<z.ZodString>;
635
+ } & {
636
+ files: z.ZodRecord<z.ZodString, z.ZodString>;
637
+ deletedFiles: z.ZodArray<z.ZodString, "many">;
638
+ }, "strip", z.ZodTypeAny, {
639
+ id: string;
640
+ name: string;
641
+ description: string;
642
+ type: "add-on" | "example" | "starter" | "toolchain";
643
+ files: Record<string, string>;
644
+ deletedFiles: string[];
645
+ modes: string[];
646
+ phase: "add-on" | "setup";
647
+ command?: {
648
+ command: string;
649
+ args?: string[] | undefined;
650
+ } | undefined;
651
+ author?: string | undefined;
652
+ version?: string | undefined;
653
+ link?: string | undefined;
654
+ license?: string | undefined;
655
+ warning?: string | undefined;
656
+ routes?: {
657
+ path: string;
658
+ jsName: string;
659
+ name?: string | undefined;
660
+ url?: string | undefined;
661
+ }[] | undefined;
662
+ packageAdditions?: {
663
+ dependencies?: Record<string, string> | undefined;
664
+ devDependencies?: Record<string, string> | undefined;
665
+ scripts?: Record<string, string> | undefined;
666
+ } | undefined;
667
+ shadcnComponents?: string[] | undefined;
668
+ dependsOn?: string[] | undefined;
669
+ smallLogo?: string | undefined;
670
+ logo?: string | undefined;
671
+ addOnSpecialSteps?: string[] | undefined;
672
+ createSpecialSteps?: string[] | undefined;
673
+ integrations?: {
674
+ type: string;
675
+ path: string;
676
+ jsName: string;
677
+ }[] | undefined;
678
+ readme?: string | undefined;
679
+ }, {
680
+ id: string;
681
+ name: string;
682
+ description: string;
683
+ type: "add-on" | "example" | "starter" | "toolchain";
684
+ files: Record<string, string>;
685
+ deletedFiles: string[];
686
+ modes: string[];
687
+ phase: "add-on" | "setup";
688
+ command?: {
689
+ command: string;
690
+ args?: string[] | undefined;
691
+ } | undefined;
692
+ author?: string | undefined;
693
+ version?: string | undefined;
694
+ link?: string | undefined;
695
+ license?: string | undefined;
696
+ warning?: string | undefined;
697
+ routes?: {
698
+ path: string;
699
+ jsName: string;
700
+ name?: string | undefined;
701
+ url?: string | undefined;
702
+ }[] | undefined;
703
+ packageAdditions?: {
704
+ dependencies?: Record<string, string> | undefined;
705
+ devDependencies?: Record<string, string> | undefined;
706
+ scripts?: Record<string, string> | undefined;
707
+ } | undefined;
708
+ shadcnComponents?: string[] | undefined;
709
+ dependsOn?: string[] | undefined;
710
+ smallLogo?: string | undefined;
711
+ logo?: string | undefined;
712
+ addOnSpecialSteps?: string[] | undefined;
713
+ createSpecialSteps?: string[] | undefined;
714
+ integrations?: {
715
+ type: string;
716
+ path: string;
717
+ jsName: string;
718
+ }[] | undefined;
719
+ readme?: string | undefined;
720
+ }>;
721
+ export type Integration = z.infer<typeof IntegrationSchema>;
722
+ export type AddOnBase = z.infer<typeof AddOnBaseSchema>;
723
+ export type StarterInfo = z.infer<typeof StarterSchema>;
724
+ export type StarterCompiled = z.infer<typeof StarterCompiledSchema>;
725
+ export type AddOnInfo = z.infer<typeof AddOnInfoSchema>;
726
+ export type AddOnCompiled = z.infer<typeof AddOnCompiledSchema>;
727
+ export type FileBundleHandler = {
728
+ getFiles: () => Promise<Array<string>>;
729
+ getFileContents: (path: string) => Promise<string>;
730
+ getDeletedFiles: () => Promise<Array<string>>;
56
731
  };
57
- export type AddOn = AddOnDefinition & FileBundleHandler;
58
- export type Starter = StarterDefinition & FileBundleHandler;
732
+ export type AddOn = AddOnInfo & FileBundleHandler;
733
+ export type Starter = StarterCompiled & FileBundleHandler;
59
734
  export type FrameworkDefinition = {
60
735
  id: string;
61
736
  name: string;
@@ -71,18 +746,22 @@ export type Framework = FrameworkDefinition & FileBundleHandler & {
71
746
  getAddOns: () => Array<AddOn>;
72
747
  };
73
748
  export interface Options {
74
- framework: Framework;
75
749
  projectName: string;
750
+ targetDir: string;
751
+ framework: Framework;
752
+ mode: Mode;
76
753
  typescript: boolean;
77
754
  tailwind: boolean;
78
755
  packageManager: PackageManager;
79
- mode: Mode;
80
- addOns: boolean;
81
- chosenAddOns: Array<AddOn>;
82
756
  git: boolean;
83
- variableValues: Record<string, string | number | boolean>;
84
- starter?: AddOn | undefined;
757
+ chosenAddOns: Array<AddOn>;
758
+ starter?: Starter | undefined;
85
759
  }
760
+ export type SerializedOptions = Omit<Options, 'chosenAddOns' | 'starter' | 'framework'> & {
761
+ chosenAddOns: Array<string>;
762
+ starter?: string | undefined;
763
+ framework: string;
764
+ };
86
765
  type ProjectEnvironment = {
87
766
  startRun: () => void;
88
767
  finishRun: () => void;
@@ -92,11 +771,33 @@ type FileEnvironment = {
92
771
  appendFile: (path: string, contents: string) => Promise<void>;
93
772
  copyFile: (from: string, to: string) => Promise<void>;
94
773
  writeFile: (path: string, contents: string) => Promise<void>;
95
- execute: (command: string, args: Array<string>, cwd: string) => Promise<void>;
774
+ writeFileBase64: (path: string, base64Contents: string) => Promise<void>;
775
+ execute: (command: string, args: Array<string>, cwd: string) => Promise<{
776
+ stdout: string;
777
+ }>;
96
778
  deleteFile: (path: string) => Promise<void>;
97
779
  exists: (path: string) => boolean;
780
+ isDirectory: (path: string) => boolean;
781
+ readFile: (path: string) => Promise<string>;
782
+ readdir: (path: string) => Promise<Array<string>>;
783
+ rimraf: (path: string) => Promise<void>;
784
+ };
785
+ export type StatusEvent = {
786
+ id: string;
787
+ type: StatusStepType;
788
+ message: string;
789
+ };
790
+ export type StopEvent = {
791
+ id: string;
98
792
  };
99
793
  type UIEnvironment = {
794
+ appName: string;
795
+ startStep: (info: {
796
+ id: string;
797
+ type: StatusStepType;
798
+ message: string;
799
+ }) => void;
800
+ finishStep: (id: string, finalMessage: string) => void;
100
801
  intro: (message: string) => void;
101
802
  outro: (message: string) => void;
102
803
  info: (title?: string, message?: string) => void;
@@ -109,23 +810,4 @@ type UIEnvironment = {
109
810
  confirm: (message: string) => Promise<boolean>;
110
811
  };
111
812
  export type Environment = ProjectEnvironment & FileEnvironment & UIEnvironment;
112
- type BooleanVariable = {
113
- name: string;
114
- default: boolean;
115
- description: string;
116
- type: 'boolean';
117
- };
118
- type NumberVariable = {
119
- name: string;
120
- default: number;
121
- description: string;
122
- type: 'number';
123
- };
124
- type StringVariable = {
125
- name: string;
126
- default: string;
127
- description: string;
128
- type: 'string';
129
- };
130
- export type Variable = BooleanVariable | NumberVariable | StringVariable;
131
813
  export {};