@tanstack/cta-engine 0.28.0 → 0.29.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/add-ons.js +13 -0
- package/dist/add-to-app.js +15 -1
- package/dist/create-app.js +13 -3
- package/dist/custom-add-ons/shared.js +7 -4
- package/dist/environment.js +16 -5
- package/dist/frameworks.js +5 -0
- package/dist/index.js +1 -1
- package/dist/package-json.js +32 -2
- package/dist/special-steps/index.js +3 -1
- package/dist/special-steps/post-init-script.js +31 -0
- package/dist/template-file.js +7 -0
- package/dist/types/add-ons.d.ts +1 -0
- package/dist/types/custom-add-ons/add-on.d.ts +14 -3
- package/dist/types/index.d.ts +2 -2
- package/dist/types/registry.d.ts +8 -8
- package/dist/types/special-steps/post-init-script.d.ts +2 -0
- package/dist/types/types.d.ts +433 -32
- package/dist/types.js +17 -0
- package/package.json +1 -1
- package/src/add-ons.ts +18 -0
- package/src/add-to-app.ts +20 -1
- package/src/create-app.ts +18 -1
- package/src/custom-add-ons/shared.ts +7 -4
- package/src/environment.ts +15 -5
- package/src/frameworks.ts +6 -1
- package/src/index.ts +5 -1
- package/src/package-json.ts +40 -4
- package/src/special-steps/index.ts +3 -1
- package/src/special-steps/post-init-script.ts +52 -0
- package/src/template-file.ts +8 -0
- package/src/types.ts +37 -1
- package/tests/add-on-options.test.ts +332 -0
- package/tests/conditional-packages.test.ts +418 -0
- package/tests/filename-processing.test.ts +275 -0
- package/tests/package-json.test.ts +3 -3
- package/tests/special-steps.test.ts +165 -0
- package/tests/template-context.test.ts +314 -0
package/dist/types/types.d.ts
CHANGED
|
@@ -1,6 +1,108 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
2
|
import type { PackageManager } from './package-manager.js';
|
|
3
3
|
export type StatusStepType = 'file' | 'command' | 'info' | 'package-manager' | 'other';
|
|
4
|
+
export declare const AddOnSelectOptionSchema: z.ZodObject<{
|
|
5
|
+
type: z.ZodLiteral<"select">;
|
|
6
|
+
label: z.ZodString;
|
|
7
|
+
description: z.ZodOptional<z.ZodString>;
|
|
8
|
+
default: z.ZodString;
|
|
9
|
+
options: z.ZodArray<z.ZodObject<{
|
|
10
|
+
value: z.ZodString;
|
|
11
|
+
label: z.ZodString;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
value: string;
|
|
14
|
+
label: string;
|
|
15
|
+
}, {
|
|
16
|
+
value: string;
|
|
17
|
+
label: string;
|
|
18
|
+
}>, "many">;
|
|
19
|
+
}, "strip", z.ZodTypeAny, {
|
|
20
|
+
type: "select";
|
|
21
|
+
options: {
|
|
22
|
+
value: string;
|
|
23
|
+
label: string;
|
|
24
|
+
}[];
|
|
25
|
+
label: string;
|
|
26
|
+
default: string;
|
|
27
|
+
description?: string | undefined;
|
|
28
|
+
}, {
|
|
29
|
+
type: "select";
|
|
30
|
+
options: {
|
|
31
|
+
value: string;
|
|
32
|
+
label: string;
|
|
33
|
+
}[];
|
|
34
|
+
label: string;
|
|
35
|
+
default: string;
|
|
36
|
+
description?: string | undefined;
|
|
37
|
+
}>;
|
|
38
|
+
export declare const AddOnOptionSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
39
|
+
type: z.ZodLiteral<"select">;
|
|
40
|
+
label: z.ZodString;
|
|
41
|
+
description: z.ZodOptional<z.ZodString>;
|
|
42
|
+
default: z.ZodString;
|
|
43
|
+
options: z.ZodArray<z.ZodObject<{
|
|
44
|
+
value: z.ZodString;
|
|
45
|
+
label: z.ZodString;
|
|
46
|
+
}, "strip", z.ZodTypeAny, {
|
|
47
|
+
value: string;
|
|
48
|
+
label: string;
|
|
49
|
+
}, {
|
|
50
|
+
value: string;
|
|
51
|
+
label: string;
|
|
52
|
+
}>, "many">;
|
|
53
|
+
}, "strip", z.ZodTypeAny, {
|
|
54
|
+
type: "select";
|
|
55
|
+
options: {
|
|
56
|
+
value: string;
|
|
57
|
+
label: string;
|
|
58
|
+
}[];
|
|
59
|
+
label: string;
|
|
60
|
+
default: string;
|
|
61
|
+
description?: string | undefined;
|
|
62
|
+
}, {
|
|
63
|
+
type: "select";
|
|
64
|
+
options: {
|
|
65
|
+
value: string;
|
|
66
|
+
label: string;
|
|
67
|
+
}[];
|
|
68
|
+
label: string;
|
|
69
|
+
default: string;
|
|
70
|
+
description?: string | undefined;
|
|
71
|
+
}>]>;
|
|
72
|
+
export declare const AddOnOptionsSchema: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
73
|
+
type: z.ZodLiteral<"select">;
|
|
74
|
+
label: z.ZodString;
|
|
75
|
+
description: z.ZodOptional<z.ZodString>;
|
|
76
|
+
default: z.ZodString;
|
|
77
|
+
options: z.ZodArray<z.ZodObject<{
|
|
78
|
+
value: z.ZodString;
|
|
79
|
+
label: z.ZodString;
|
|
80
|
+
}, "strip", z.ZodTypeAny, {
|
|
81
|
+
value: string;
|
|
82
|
+
label: string;
|
|
83
|
+
}, {
|
|
84
|
+
value: string;
|
|
85
|
+
label: string;
|
|
86
|
+
}>, "many">;
|
|
87
|
+
}, "strip", z.ZodTypeAny, {
|
|
88
|
+
type: "select";
|
|
89
|
+
options: {
|
|
90
|
+
value: string;
|
|
91
|
+
label: string;
|
|
92
|
+
}[];
|
|
93
|
+
label: string;
|
|
94
|
+
default: string;
|
|
95
|
+
description?: string | undefined;
|
|
96
|
+
}, {
|
|
97
|
+
type: "select";
|
|
98
|
+
options: {
|
|
99
|
+
value: string;
|
|
100
|
+
label: string;
|
|
101
|
+
}[];
|
|
102
|
+
label: string;
|
|
103
|
+
default: string;
|
|
104
|
+
description?: string | undefined;
|
|
105
|
+
}>]>>;
|
|
4
106
|
export declare const AddOnBaseSchema: z.ZodObject<{
|
|
5
107
|
id: z.ZodString;
|
|
6
108
|
name: z.ZodString;
|
|
@@ -56,16 +158,62 @@ export declare const AddOnBaseSchema: z.ZodObject<{
|
|
|
56
158
|
logo: z.ZodOptional<z.ZodString>;
|
|
57
159
|
addOnSpecialSteps: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
58
160
|
createSpecialSteps: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
161
|
+
postInitSpecialSteps: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
162
|
+
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
163
|
+
type: z.ZodLiteral<"select">;
|
|
164
|
+
label: z.ZodString;
|
|
165
|
+
description: z.ZodOptional<z.ZodString>;
|
|
166
|
+
default: z.ZodString;
|
|
167
|
+
options: z.ZodArray<z.ZodObject<{
|
|
168
|
+
value: z.ZodString;
|
|
169
|
+
label: z.ZodString;
|
|
170
|
+
}, "strip", z.ZodTypeAny, {
|
|
171
|
+
value: string;
|
|
172
|
+
label: string;
|
|
173
|
+
}, {
|
|
174
|
+
value: string;
|
|
175
|
+
label: string;
|
|
176
|
+
}>, "many">;
|
|
177
|
+
}, "strip", z.ZodTypeAny, {
|
|
178
|
+
type: "select";
|
|
179
|
+
options: {
|
|
180
|
+
value: string;
|
|
181
|
+
label: string;
|
|
182
|
+
}[];
|
|
183
|
+
label: string;
|
|
184
|
+
default: string;
|
|
185
|
+
description?: string | undefined;
|
|
186
|
+
}, {
|
|
187
|
+
type: "select";
|
|
188
|
+
options: {
|
|
189
|
+
value: string;
|
|
190
|
+
label: string;
|
|
191
|
+
}[];
|
|
192
|
+
label: string;
|
|
193
|
+
default: string;
|
|
194
|
+
description?: string | undefined;
|
|
195
|
+
}>]>>>;
|
|
59
196
|
default: z.ZodOptional<z.ZodBoolean>;
|
|
60
197
|
}, "strip", z.ZodTypeAny, {
|
|
198
|
+
type: "add-on" | "example" | "starter" | "toolchain" | "host";
|
|
199
|
+
description: string;
|
|
61
200
|
id: string;
|
|
62
201
|
name: string;
|
|
63
|
-
description: string;
|
|
64
|
-
type: "add-on" | "example" | "starter" | "toolchain" | "host";
|
|
65
202
|
command?: {
|
|
66
203
|
command: string;
|
|
67
204
|
args?: string[] | undefined;
|
|
68
205
|
} | undefined;
|
|
206
|
+
options?: Record<string, {
|
|
207
|
+
type: "select";
|
|
208
|
+
options: {
|
|
209
|
+
value: string;
|
|
210
|
+
label: string;
|
|
211
|
+
}[];
|
|
212
|
+
label: string;
|
|
213
|
+
default: string;
|
|
214
|
+
description?: string | undefined;
|
|
215
|
+
}> | undefined;
|
|
216
|
+
default?: boolean | undefined;
|
|
69
217
|
author?: string | undefined;
|
|
70
218
|
version?: string | undefined;
|
|
71
219
|
link?: string | undefined;
|
|
@@ -88,16 +236,27 @@ export declare const AddOnBaseSchema: z.ZodObject<{
|
|
|
88
236
|
logo?: string | undefined;
|
|
89
237
|
addOnSpecialSteps?: string[] | undefined;
|
|
90
238
|
createSpecialSteps?: string[] | undefined;
|
|
91
|
-
|
|
239
|
+
postInitSpecialSteps?: string[] | undefined;
|
|
92
240
|
}, {
|
|
241
|
+
type: "add-on" | "example" | "starter" | "toolchain" | "host";
|
|
242
|
+
description: string;
|
|
93
243
|
id: string;
|
|
94
244
|
name: string;
|
|
95
|
-
description: string;
|
|
96
|
-
type: "add-on" | "example" | "starter" | "toolchain" | "host";
|
|
97
245
|
command?: {
|
|
98
246
|
command: string;
|
|
99
247
|
args?: string[] | undefined;
|
|
100
248
|
} | undefined;
|
|
249
|
+
options?: Record<string, {
|
|
250
|
+
type: "select";
|
|
251
|
+
options: {
|
|
252
|
+
value: string;
|
|
253
|
+
label: string;
|
|
254
|
+
}[];
|
|
255
|
+
label: string;
|
|
256
|
+
default: string;
|
|
257
|
+
description?: string | undefined;
|
|
258
|
+
}> | undefined;
|
|
259
|
+
default?: boolean | undefined;
|
|
101
260
|
author?: string | undefined;
|
|
102
261
|
version?: string | undefined;
|
|
103
262
|
link?: string | undefined;
|
|
@@ -120,7 +279,7 @@ export declare const AddOnBaseSchema: z.ZodObject<{
|
|
|
120
279
|
logo?: string | undefined;
|
|
121
280
|
addOnSpecialSteps?: string[] | undefined;
|
|
122
281
|
createSpecialSteps?: string[] | undefined;
|
|
123
|
-
|
|
282
|
+
postInitSpecialSteps?: string[] | undefined;
|
|
124
283
|
}>;
|
|
125
284
|
export declare const StarterSchema: z.ZodObject<{
|
|
126
285
|
id: z.ZodString;
|
|
@@ -177,6 +336,41 @@ export declare const StarterSchema: z.ZodObject<{
|
|
|
177
336
|
logo: z.ZodOptional<z.ZodString>;
|
|
178
337
|
addOnSpecialSteps: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
179
338
|
createSpecialSteps: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
339
|
+
postInitSpecialSteps: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
340
|
+
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
341
|
+
type: z.ZodLiteral<"select">;
|
|
342
|
+
label: z.ZodString;
|
|
343
|
+
description: z.ZodOptional<z.ZodString>;
|
|
344
|
+
default: z.ZodString;
|
|
345
|
+
options: z.ZodArray<z.ZodObject<{
|
|
346
|
+
value: z.ZodString;
|
|
347
|
+
label: z.ZodString;
|
|
348
|
+
}, "strip", z.ZodTypeAny, {
|
|
349
|
+
value: string;
|
|
350
|
+
label: string;
|
|
351
|
+
}, {
|
|
352
|
+
value: string;
|
|
353
|
+
label: string;
|
|
354
|
+
}>, "many">;
|
|
355
|
+
}, "strip", z.ZodTypeAny, {
|
|
356
|
+
type: "select";
|
|
357
|
+
options: {
|
|
358
|
+
value: string;
|
|
359
|
+
label: string;
|
|
360
|
+
}[];
|
|
361
|
+
label: string;
|
|
362
|
+
default: string;
|
|
363
|
+
description?: string | undefined;
|
|
364
|
+
}, {
|
|
365
|
+
type: "select";
|
|
366
|
+
options: {
|
|
367
|
+
value: string;
|
|
368
|
+
label: string;
|
|
369
|
+
}[];
|
|
370
|
+
label: string;
|
|
371
|
+
default: string;
|
|
372
|
+
description?: string | undefined;
|
|
373
|
+
}>]>>>;
|
|
180
374
|
default: z.ZodOptional<z.ZodBoolean>;
|
|
181
375
|
} & {
|
|
182
376
|
framework: z.ZodString;
|
|
@@ -185,10 +379,10 @@ export declare const StarterSchema: z.ZodObject<{
|
|
|
185
379
|
tailwind: z.ZodBoolean;
|
|
186
380
|
banner: z.ZodOptional<z.ZodString>;
|
|
187
381
|
}, "strip", z.ZodTypeAny, {
|
|
382
|
+
type: "add-on" | "example" | "starter" | "toolchain" | "host";
|
|
383
|
+
description: string;
|
|
188
384
|
id: string;
|
|
189
385
|
name: string;
|
|
190
|
-
description: string;
|
|
191
|
-
type: "add-on" | "example" | "starter" | "toolchain" | "host";
|
|
192
386
|
framework: string;
|
|
193
387
|
mode: string;
|
|
194
388
|
typescript: boolean;
|
|
@@ -197,6 +391,17 @@ export declare const StarterSchema: z.ZodObject<{
|
|
|
197
391
|
command: string;
|
|
198
392
|
args?: string[] | undefined;
|
|
199
393
|
} | undefined;
|
|
394
|
+
options?: Record<string, {
|
|
395
|
+
type: "select";
|
|
396
|
+
options: {
|
|
397
|
+
value: string;
|
|
398
|
+
label: string;
|
|
399
|
+
}[];
|
|
400
|
+
label: string;
|
|
401
|
+
default: string;
|
|
402
|
+
description?: string | undefined;
|
|
403
|
+
}> | undefined;
|
|
404
|
+
default?: boolean | undefined;
|
|
200
405
|
author?: string | undefined;
|
|
201
406
|
version?: string | undefined;
|
|
202
407
|
link?: string | undefined;
|
|
@@ -219,13 +424,13 @@ export declare const StarterSchema: z.ZodObject<{
|
|
|
219
424
|
logo?: string | undefined;
|
|
220
425
|
addOnSpecialSteps?: string[] | undefined;
|
|
221
426
|
createSpecialSteps?: string[] | undefined;
|
|
222
|
-
|
|
427
|
+
postInitSpecialSteps?: string[] | undefined;
|
|
223
428
|
banner?: string | undefined;
|
|
224
429
|
}, {
|
|
430
|
+
type: "add-on" | "example" | "starter" | "toolchain" | "host";
|
|
431
|
+
description: string;
|
|
225
432
|
id: string;
|
|
226
433
|
name: string;
|
|
227
|
-
description: string;
|
|
228
|
-
type: "add-on" | "example" | "starter" | "toolchain" | "host";
|
|
229
434
|
framework: string;
|
|
230
435
|
mode: string;
|
|
231
436
|
typescript: boolean;
|
|
@@ -234,6 +439,17 @@ export declare const StarterSchema: z.ZodObject<{
|
|
|
234
439
|
command: string;
|
|
235
440
|
args?: string[] | undefined;
|
|
236
441
|
} | undefined;
|
|
442
|
+
options?: Record<string, {
|
|
443
|
+
type: "select";
|
|
444
|
+
options: {
|
|
445
|
+
value: string;
|
|
446
|
+
label: string;
|
|
447
|
+
}[];
|
|
448
|
+
label: string;
|
|
449
|
+
default: string;
|
|
450
|
+
description?: string | undefined;
|
|
451
|
+
}> | undefined;
|
|
452
|
+
default?: boolean | undefined;
|
|
237
453
|
author?: string | undefined;
|
|
238
454
|
version?: string | undefined;
|
|
239
455
|
link?: string | undefined;
|
|
@@ -256,7 +472,7 @@ export declare const StarterSchema: z.ZodObject<{
|
|
|
256
472
|
logo?: string | undefined;
|
|
257
473
|
addOnSpecialSteps?: string[] | undefined;
|
|
258
474
|
createSpecialSteps?: string[] | undefined;
|
|
259
|
-
|
|
475
|
+
postInitSpecialSteps?: string[] | undefined;
|
|
260
476
|
banner?: string | undefined;
|
|
261
477
|
}>;
|
|
262
478
|
export declare const StarterCompiledSchema: z.ZodObject<{
|
|
@@ -314,6 +530,41 @@ export declare const StarterCompiledSchema: z.ZodObject<{
|
|
|
314
530
|
logo: z.ZodOptional<z.ZodString>;
|
|
315
531
|
addOnSpecialSteps: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
316
532
|
createSpecialSteps: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
533
|
+
postInitSpecialSteps: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
534
|
+
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
535
|
+
type: z.ZodLiteral<"select">;
|
|
536
|
+
label: z.ZodString;
|
|
537
|
+
description: z.ZodOptional<z.ZodString>;
|
|
538
|
+
default: z.ZodString;
|
|
539
|
+
options: z.ZodArray<z.ZodObject<{
|
|
540
|
+
value: z.ZodString;
|
|
541
|
+
label: z.ZodString;
|
|
542
|
+
}, "strip", z.ZodTypeAny, {
|
|
543
|
+
value: string;
|
|
544
|
+
label: string;
|
|
545
|
+
}, {
|
|
546
|
+
value: string;
|
|
547
|
+
label: string;
|
|
548
|
+
}>, "many">;
|
|
549
|
+
}, "strip", z.ZodTypeAny, {
|
|
550
|
+
type: "select";
|
|
551
|
+
options: {
|
|
552
|
+
value: string;
|
|
553
|
+
label: string;
|
|
554
|
+
}[];
|
|
555
|
+
label: string;
|
|
556
|
+
default: string;
|
|
557
|
+
description?: string | undefined;
|
|
558
|
+
}, {
|
|
559
|
+
type: "select";
|
|
560
|
+
options: {
|
|
561
|
+
value: string;
|
|
562
|
+
label: string;
|
|
563
|
+
}[];
|
|
564
|
+
label: string;
|
|
565
|
+
default: string;
|
|
566
|
+
description?: string | undefined;
|
|
567
|
+
}>]>>>;
|
|
317
568
|
default: z.ZodOptional<z.ZodBoolean>;
|
|
318
569
|
} & {
|
|
319
570
|
framework: z.ZodString;
|
|
@@ -325,10 +576,10 @@ export declare const StarterCompiledSchema: z.ZodObject<{
|
|
|
325
576
|
files: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
326
577
|
deletedFiles: z.ZodArray<z.ZodString, "many">;
|
|
327
578
|
}, "strip", z.ZodTypeAny, {
|
|
579
|
+
type: "add-on" | "example" | "starter" | "toolchain" | "host";
|
|
580
|
+
description: string;
|
|
328
581
|
id: string;
|
|
329
582
|
name: string;
|
|
330
|
-
description: string;
|
|
331
|
-
type: "add-on" | "example" | "starter" | "toolchain" | "host";
|
|
332
583
|
framework: string;
|
|
333
584
|
mode: string;
|
|
334
585
|
typescript: boolean;
|
|
@@ -339,6 +590,17 @@ export declare const StarterCompiledSchema: z.ZodObject<{
|
|
|
339
590
|
command: string;
|
|
340
591
|
args?: string[] | undefined;
|
|
341
592
|
} | undefined;
|
|
593
|
+
options?: Record<string, {
|
|
594
|
+
type: "select";
|
|
595
|
+
options: {
|
|
596
|
+
value: string;
|
|
597
|
+
label: string;
|
|
598
|
+
}[];
|
|
599
|
+
label: string;
|
|
600
|
+
default: string;
|
|
601
|
+
description?: string | undefined;
|
|
602
|
+
}> | undefined;
|
|
603
|
+
default?: boolean | undefined;
|
|
342
604
|
author?: string | undefined;
|
|
343
605
|
version?: string | undefined;
|
|
344
606
|
link?: string | undefined;
|
|
@@ -361,13 +623,13 @@ export declare const StarterCompiledSchema: z.ZodObject<{
|
|
|
361
623
|
logo?: string | undefined;
|
|
362
624
|
addOnSpecialSteps?: string[] | undefined;
|
|
363
625
|
createSpecialSteps?: string[] | undefined;
|
|
364
|
-
|
|
626
|
+
postInitSpecialSteps?: string[] | undefined;
|
|
365
627
|
banner?: string | undefined;
|
|
366
628
|
}, {
|
|
629
|
+
type: "add-on" | "example" | "starter" | "toolchain" | "host";
|
|
630
|
+
description: string;
|
|
367
631
|
id: string;
|
|
368
632
|
name: string;
|
|
369
|
-
description: string;
|
|
370
|
-
type: "add-on" | "example" | "starter" | "toolchain" | "host";
|
|
371
633
|
framework: string;
|
|
372
634
|
mode: string;
|
|
373
635
|
typescript: boolean;
|
|
@@ -378,6 +640,17 @@ export declare const StarterCompiledSchema: z.ZodObject<{
|
|
|
378
640
|
command: string;
|
|
379
641
|
args?: string[] | undefined;
|
|
380
642
|
} | undefined;
|
|
643
|
+
options?: Record<string, {
|
|
644
|
+
type: "select";
|
|
645
|
+
options: {
|
|
646
|
+
value: string;
|
|
647
|
+
label: string;
|
|
648
|
+
}[];
|
|
649
|
+
label: string;
|
|
650
|
+
default: string;
|
|
651
|
+
description?: string | undefined;
|
|
652
|
+
}> | undefined;
|
|
653
|
+
default?: boolean | undefined;
|
|
381
654
|
author?: string | undefined;
|
|
382
655
|
version?: string | undefined;
|
|
383
656
|
link?: string | undefined;
|
|
@@ -400,7 +673,7 @@ export declare const StarterCompiledSchema: z.ZodObject<{
|
|
|
400
673
|
logo?: string | undefined;
|
|
401
674
|
addOnSpecialSteps?: string[] | undefined;
|
|
402
675
|
createSpecialSteps?: string[] | undefined;
|
|
403
|
-
|
|
676
|
+
postInitSpecialSteps?: string[] | undefined;
|
|
404
677
|
banner?: string | undefined;
|
|
405
678
|
}>;
|
|
406
679
|
export declare const IntegrationSchema: z.ZodObject<{
|
|
@@ -477,6 +750,41 @@ export declare const AddOnInfoSchema: z.ZodObject<{
|
|
|
477
750
|
logo: z.ZodOptional<z.ZodString>;
|
|
478
751
|
addOnSpecialSteps: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
479
752
|
createSpecialSteps: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
753
|
+
postInitSpecialSteps: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
754
|
+
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
755
|
+
type: z.ZodLiteral<"select">;
|
|
756
|
+
label: z.ZodString;
|
|
757
|
+
description: z.ZodOptional<z.ZodString>;
|
|
758
|
+
default: z.ZodString;
|
|
759
|
+
options: z.ZodArray<z.ZodObject<{
|
|
760
|
+
value: z.ZodString;
|
|
761
|
+
label: z.ZodString;
|
|
762
|
+
}, "strip", z.ZodTypeAny, {
|
|
763
|
+
value: string;
|
|
764
|
+
label: string;
|
|
765
|
+
}, {
|
|
766
|
+
value: string;
|
|
767
|
+
label: string;
|
|
768
|
+
}>, "many">;
|
|
769
|
+
}, "strip", z.ZodTypeAny, {
|
|
770
|
+
type: "select";
|
|
771
|
+
options: {
|
|
772
|
+
value: string;
|
|
773
|
+
label: string;
|
|
774
|
+
}[];
|
|
775
|
+
label: string;
|
|
776
|
+
default: string;
|
|
777
|
+
description?: string | undefined;
|
|
778
|
+
}, {
|
|
779
|
+
type: "select";
|
|
780
|
+
options: {
|
|
781
|
+
value: string;
|
|
782
|
+
label: string;
|
|
783
|
+
}[];
|
|
784
|
+
label: string;
|
|
785
|
+
default: string;
|
|
786
|
+
description?: string | undefined;
|
|
787
|
+
}>]>>>;
|
|
480
788
|
default: z.ZodOptional<z.ZodBoolean>;
|
|
481
789
|
} & {
|
|
482
790
|
modes: z.ZodArray<z.ZodString, "many">;
|
|
@@ -502,16 +810,27 @@ export declare const AddOnInfoSchema: z.ZodObject<{
|
|
|
502
810
|
phase: z.ZodEnum<["setup", "add-on"]>;
|
|
503
811
|
readme: z.ZodOptional<z.ZodString>;
|
|
504
812
|
}, "strip", z.ZodTypeAny, {
|
|
813
|
+
type: "add-on" | "example" | "starter" | "toolchain" | "host";
|
|
814
|
+
description: string;
|
|
505
815
|
id: string;
|
|
506
816
|
name: string;
|
|
507
|
-
description: string;
|
|
508
|
-
type: "add-on" | "example" | "starter" | "toolchain" | "host";
|
|
509
817
|
modes: string[];
|
|
510
818
|
phase: "add-on" | "setup";
|
|
511
819
|
command?: {
|
|
512
820
|
command: string;
|
|
513
821
|
args?: string[] | undefined;
|
|
514
822
|
} | undefined;
|
|
823
|
+
options?: Record<string, {
|
|
824
|
+
type: "select";
|
|
825
|
+
options: {
|
|
826
|
+
value: string;
|
|
827
|
+
label: string;
|
|
828
|
+
}[];
|
|
829
|
+
label: string;
|
|
830
|
+
default: string;
|
|
831
|
+
description?: string | undefined;
|
|
832
|
+
}> | undefined;
|
|
833
|
+
default?: boolean | undefined;
|
|
515
834
|
author?: string | undefined;
|
|
516
835
|
version?: string | undefined;
|
|
517
836
|
link?: string | undefined;
|
|
@@ -534,7 +853,7 @@ export declare const AddOnInfoSchema: z.ZodObject<{
|
|
|
534
853
|
logo?: string | undefined;
|
|
535
854
|
addOnSpecialSteps?: string[] | undefined;
|
|
536
855
|
createSpecialSteps?: string[] | undefined;
|
|
537
|
-
|
|
856
|
+
postInitSpecialSteps?: string[] | undefined;
|
|
538
857
|
integrations?: {
|
|
539
858
|
type?: string | undefined;
|
|
540
859
|
code?: string | undefined;
|
|
@@ -544,16 +863,27 @@ export declare const AddOnInfoSchema: z.ZodObject<{
|
|
|
544
863
|
}[] | undefined;
|
|
545
864
|
readme?: string | undefined;
|
|
546
865
|
}, {
|
|
866
|
+
type: "add-on" | "example" | "starter" | "toolchain" | "host";
|
|
867
|
+
description: string;
|
|
547
868
|
id: string;
|
|
548
869
|
name: string;
|
|
549
|
-
description: string;
|
|
550
|
-
type: "add-on" | "example" | "starter" | "toolchain" | "host";
|
|
551
870
|
modes: string[];
|
|
552
871
|
phase: "add-on" | "setup";
|
|
553
872
|
command?: {
|
|
554
873
|
command: string;
|
|
555
874
|
args?: string[] | undefined;
|
|
556
875
|
} | undefined;
|
|
876
|
+
options?: Record<string, {
|
|
877
|
+
type: "select";
|
|
878
|
+
options: {
|
|
879
|
+
value: string;
|
|
880
|
+
label: string;
|
|
881
|
+
}[];
|
|
882
|
+
label: string;
|
|
883
|
+
default: string;
|
|
884
|
+
description?: string | undefined;
|
|
885
|
+
}> | undefined;
|
|
886
|
+
default?: boolean | undefined;
|
|
557
887
|
author?: string | undefined;
|
|
558
888
|
version?: string | undefined;
|
|
559
889
|
link?: string | undefined;
|
|
@@ -576,7 +906,7 @@ export declare const AddOnInfoSchema: z.ZodObject<{
|
|
|
576
906
|
logo?: string | undefined;
|
|
577
907
|
addOnSpecialSteps?: string[] | undefined;
|
|
578
908
|
createSpecialSteps?: string[] | undefined;
|
|
579
|
-
|
|
909
|
+
postInitSpecialSteps?: string[] | undefined;
|
|
580
910
|
integrations?: {
|
|
581
911
|
type?: string | undefined;
|
|
582
912
|
code?: string | undefined;
|
|
@@ -641,6 +971,41 @@ export declare const AddOnCompiledSchema: z.ZodObject<{
|
|
|
641
971
|
logo: z.ZodOptional<z.ZodString>;
|
|
642
972
|
addOnSpecialSteps: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
643
973
|
createSpecialSteps: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
974
|
+
postInitSpecialSteps: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
975
|
+
options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
976
|
+
type: z.ZodLiteral<"select">;
|
|
977
|
+
label: z.ZodString;
|
|
978
|
+
description: z.ZodOptional<z.ZodString>;
|
|
979
|
+
default: z.ZodString;
|
|
980
|
+
options: z.ZodArray<z.ZodObject<{
|
|
981
|
+
value: z.ZodString;
|
|
982
|
+
label: z.ZodString;
|
|
983
|
+
}, "strip", z.ZodTypeAny, {
|
|
984
|
+
value: string;
|
|
985
|
+
label: string;
|
|
986
|
+
}, {
|
|
987
|
+
value: string;
|
|
988
|
+
label: string;
|
|
989
|
+
}>, "many">;
|
|
990
|
+
}, "strip", z.ZodTypeAny, {
|
|
991
|
+
type: "select";
|
|
992
|
+
options: {
|
|
993
|
+
value: string;
|
|
994
|
+
label: string;
|
|
995
|
+
}[];
|
|
996
|
+
label: string;
|
|
997
|
+
default: string;
|
|
998
|
+
description?: string | undefined;
|
|
999
|
+
}, {
|
|
1000
|
+
type: "select";
|
|
1001
|
+
options: {
|
|
1002
|
+
value: string;
|
|
1003
|
+
label: string;
|
|
1004
|
+
}[];
|
|
1005
|
+
label: string;
|
|
1006
|
+
default: string;
|
|
1007
|
+
description?: string | undefined;
|
|
1008
|
+
}>]>>>;
|
|
644
1009
|
default: z.ZodOptional<z.ZodBoolean>;
|
|
645
1010
|
} & {
|
|
646
1011
|
modes: z.ZodArray<z.ZodString, "many">;
|
|
@@ -668,11 +1033,12 @@ export declare const AddOnCompiledSchema: z.ZodObject<{
|
|
|
668
1033
|
} & {
|
|
669
1034
|
files: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
670
1035
|
deletedFiles: z.ZodArray<z.ZodString, "many">;
|
|
1036
|
+
packageTemplate: z.ZodOptional<z.ZodString>;
|
|
671
1037
|
}, "strip", z.ZodTypeAny, {
|
|
1038
|
+
type: "add-on" | "example" | "starter" | "toolchain" | "host";
|
|
1039
|
+
description: string;
|
|
672
1040
|
id: string;
|
|
673
1041
|
name: string;
|
|
674
|
-
description: string;
|
|
675
|
-
type: "add-on" | "example" | "starter" | "toolchain" | "host";
|
|
676
1042
|
files: Record<string, string>;
|
|
677
1043
|
deletedFiles: string[];
|
|
678
1044
|
modes: string[];
|
|
@@ -681,6 +1047,17 @@ export declare const AddOnCompiledSchema: z.ZodObject<{
|
|
|
681
1047
|
command: string;
|
|
682
1048
|
args?: string[] | undefined;
|
|
683
1049
|
} | undefined;
|
|
1050
|
+
options?: Record<string, {
|
|
1051
|
+
type: "select";
|
|
1052
|
+
options: {
|
|
1053
|
+
value: string;
|
|
1054
|
+
label: string;
|
|
1055
|
+
}[];
|
|
1056
|
+
label: string;
|
|
1057
|
+
default: string;
|
|
1058
|
+
description?: string | undefined;
|
|
1059
|
+
}> | undefined;
|
|
1060
|
+
default?: boolean | undefined;
|
|
684
1061
|
author?: string | undefined;
|
|
685
1062
|
version?: string | undefined;
|
|
686
1063
|
link?: string | undefined;
|
|
@@ -703,7 +1080,7 @@ export declare const AddOnCompiledSchema: z.ZodObject<{
|
|
|
703
1080
|
logo?: string | undefined;
|
|
704
1081
|
addOnSpecialSteps?: string[] | undefined;
|
|
705
1082
|
createSpecialSteps?: string[] | undefined;
|
|
706
|
-
|
|
1083
|
+
postInitSpecialSteps?: string[] | undefined;
|
|
707
1084
|
integrations?: {
|
|
708
1085
|
type?: string | undefined;
|
|
709
1086
|
code?: string | undefined;
|
|
@@ -712,11 +1089,12 @@ export declare const AddOnCompiledSchema: z.ZodObject<{
|
|
|
712
1089
|
import?: string | undefined;
|
|
713
1090
|
}[] | undefined;
|
|
714
1091
|
readme?: string | undefined;
|
|
1092
|
+
packageTemplate?: string | undefined;
|
|
715
1093
|
}, {
|
|
1094
|
+
type: "add-on" | "example" | "starter" | "toolchain" | "host";
|
|
1095
|
+
description: string;
|
|
716
1096
|
id: string;
|
|
717
1097
|
name: string;
|
|
718
|
-
description: string;
|
|
719
|
-
type: "add-on" | "example" | "starter" | "toolchain" | "host";
|
|
720
1098
|
files: Record<string, string>;
|
|
721
1099
|
deletedFiles: string[];
|
|
722
1100
|
modes: string[];
|
|
@@ -725,6 +1103,17 @@ export declare const AddOnCompiledSchema: z.ZodObject<{
|
|
|
725
1103
|
command: string;
|
|
726
1104
|
args?: string[] | undefined;
|
|
727
1105
|
} | undefined;
|
|
1106
|
+
options?: Record<string, {
|
|
1107
|
+
type: "select";
|
|
1108
|
+
options: {
|
|
1109
|
+
value: string;
|
|
1110
|
+
label: string;
|
|
1111
|
+
}[];
|
|
1112
|
+
label: string;
|
|
1113
|
+
default: string;
|
|
1114
|
+
description?: string | undefined;
|
|
1115
|
+
}> | undefined;
|
|
1116
|
+
default?: boolean | undefined;
|
|
728
1117
|
author?: string | undefined;
|
|
729
1118
|
version?: string | undefined;
|
|
730
1119
|
link?: string | undefined;
|
|
@@ -747,7 +1136,7 @@ export declare const AddOnCompiledSchema: z.ZodObject<{
|
|
|
747
1136
|
logo?: string | undefined;
|
|
748
1137
|
addOnSpecialSteps?: string[] | undefined;
|
|
749
1138
|
createSpecialSteps?: string[] | undefined;
|
|
750
|
-
|
|
1139
|
+
postInitSpecialSteps?: string[] | undefined;
|
|
751
1140
|
integrations?: {
|
|
752
1141
|
type?: string | undefined;
|
|
753
1142
|
code?: string | undefined;
|
|
@@ -756,19 +1145,28 @@ export declare const AddOnCompiledSchema: z.ZodObject<{
|
|
|
756
1145
|
import?: string | undefined;
|
|
757
1146
|
}[] | undefined;
|
|
758
1147
|
readme?: string | undefined;
|
|
1148
|
+
packageTemplate?: string | undefined;
|
|
759
1149
|
}>;
|
|
1150
|
+
export type AddOnSelectOption = z.infer<typeof AddOnSelectOptionSchema>;
|
|
1151
|
+
export type AddOnOption = z.infer<typeof AddOnOptionSchema>;
|
|
1152
|
+
export type AddOnOptions = z.infer<typeof AddOnOptionsSchema>;
|
|
760
1153
|
export type Integration = z.infer<typeof IntegrationSchema>;
|
|
761
1154
|
export type AddOnBase = z.infer<typeof AddOnBaseSchema>;
|
|
762
1155
|
export type StarterInfo = z.infer<typeof StarterSchema>;
|
|
763
1156
|
export type StarterCompiled = z.infer<typeof StarterCompiledSchema>;
|
|
764
1157
|
export type AddOnInfo = z.infer<typeof AddOnInfoSchema>;
|
|
765
1158
|
export type AddOnCompiled = z.infer<typeof AddOnCompiledSchema>;
|
|
1159
|
+
export interface AddOnSelection {
|
|
1160
|
+
id: string;
|
|
1161
|
+
enabled: boolean;
|
|
1162
|
+
options: Record<string, any>;
|
|
1163
|
+
}
|
|
766
1164
|
export type FileBundleHandler = {
|
|
767
1165
|
getFiles: () => Promise<Array<string>>;
|
|
768
1166
|
getFileContents: (path: string) => Promise<string>;
|
|
769
1167
|
getDeletedFiles: () => Promise<Array<string>>;
|
|
770
1168
|
};
|
|
771
|
-
export type AddOn =
|
|
1169
|
+
export type AddOn = AddOnCompiled & FileBundleHandler;
|
|
772
1170
|
export type Starter = StarterCompiled & FileBundleHandler;
|
|
773
1171
|
export type FrameworkDefinition = {
|
|
774
1172
|
id: string;
|
|
@@ -798,6 +1196,7 @@ export interface Options {
|
|
|
798
1196
|
packageManager: PackageManager;
|
|
799
1197
|
git: boolean;
|
|
800
1198
|
chosenAddOns: Array<AddOn>;
|
|
1199
|
+
addOnOptions: Record<string, Record<string, any>>;
|
|
801
1200
|
starter?: Starter | undefined;
|
|
802
1201
|
}
|
|
803
1202
|
export type SerializedOptions = Omit<Options, 'chosenAddOns' | 'starter' | 'framework'> & {
|
|
@@ -815,7 +1214,9 @@ type FileEnvironment = {
|
|
|
815
1214
|
copyFile: (from: string, to: string) => Promise<void>;
|
|
816
1215
|
writeFile: (path: string, contents: string) => Promise<void>;
|
|
817
1216
|
writeFileBase64: (path: string, base64Contents: string) => Promise<void>;
|
|
818
|
-
execute: (command: string, args: Array<string>, cwd: string
|
|
1217
|
+
execute: (command: string, args: Array<string>, cwd: string, options?: {
|
|
1218
|
+
inherit?: boolean;
|
|
1219
|
+
}) => Promise<{
|
|
819
1220
|
stdout: string;
|
|
820
1221
|
}>;
|
|
821
1222
|
deleteFile: (path: string) => Promise<void>;
|