-
Notifications
You must be signed in to change notification settings - Fork 214
Expand file tree
/
Copy pathprogram.json
More file actions
793 lines (792 loc) · 38.4 KB
/
program.json
File metadata and controls
793 lines (792 loc) · 38.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
{
"_ai": {
"instruction": "This file defines the CLI behavior for generating React projects using templates and presets. AI agents can use this to guide interactive or programmatic project creation.",
"expectedUse": "Provides schema and data for decision making during app generation."
},
"$schema": "http://json-schema.org/draft-07/schema#",
"metadata": {
"name": "pwa-kit-create-app",
"description": "This file contains the schema for the pwa-kit-create-app CLI tool. Includes the schemas for presets, templates, validators, and questions. It also includes the data for those presets, templates, and validators."
},
"schemas": {
"answers": {
"type": "object",
"_ai": {
"instruction": "Use this during project creation when piping in answers from stdin. It's very important that you include the template id keyed as `general.presetOrTemplateId` in the answers object. This can be derived from the `templateId` property of the preset object or the `id` property of the template object.",
"expectedUse": "This data object is used to store the answers to the template questions asked by the program and answered by the user."
}
},
"questions": {
"type": "array",
"items": {
"type": "object",
"required": [
"name",
"message"
],
"properties": {
"name": {
"type": "string",
"_ai": {
"instruction": "This value maps directly to the key in the answers object.",
"expectedUse": "Use this to store or retrieve the corresponding answer."
}
},
"message": {
"type": "string"
},
"type": {
"type": "string",
"_ai": {
"instruction": "This defines the prompt type (e.g., list, input, confirm). Determines how to display the question.",
"expectedUse": "Configure the appropriate UI for asking the question."
}
},
"choices": {
"type": "array",
"items": {
"type": "object",
"required": [
"name",
"value"
],
"properties": {
"name": {
"type": "string"
},
"value": {}
}
},
"_ai": {
"instruction": "Only used when type is 'list', 'rawlist', 'checkbox', or similar. These are the selectable options.",
"expectedUse": "Render multiple choice options to the user."
}
}
},
"additionalProperties": true
},
"_ai": {
"instruction": "Defines the questions to be asked to the user or AI agent to gather required input for project generation.",
"expectedUse": "Used to drive interactive or programmatic question-and-answer flows."
}
},
"presets": {
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"name",
"description",
"answers",
"private",
"templateId"
],
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"shortDescription": {
"type": "string"
},
"templateId": {
"type": "string"
},
"answers": {
"type": "object",
"additionalProperties": {},
"_ai": {
"instruction": "These are default answers pre-filled when this preset is selected. They should be merged with user-supplied answers, where user-supplied values take precedence.",
"expectedUse": "Auto-filling answers to questions without prompting the user unless a value is missing or overridden."
}
},
"private": {
"type": "boolean",
"_ai": {
"instruction": "This property is used to filter what presets are shown to the user. If the preset is private, it should NOT be shown to the user in a list of selectable presets.",
"expectedUse": "Hiding presets from the user."
}
}
},
"additionalProperties": false
},
"_ai": {
"instruction": "This property is used as a source of all available presets. When an AI agent is asked to select a preset, the selected preset should be returned as the 'general.presetOrTemplateId' property including all the presets answers under the 'answers' property.",
"expectedUse": "List of all available presets."
}
},
"templates": {
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"name",
"description",
"source",
"questions",
"private"
],
"properties": {
"id": {
"type": "string",
"_ai": {
"instruction": "When creating a new project using a template, this property should be renamed to `presetOrTemplateId` and is used to identify the template.",
"expectedUse": "Used as a unique identifier for the template."
}
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"shortDescription": {
"type": "string"
},
"source": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"npm",
"name"
]
},
"name": {
"type": "string"
}
},
"required": [
"type"
],
"_ai": {
"instruction": "This defines how the template is sourced. If 'npm', then 'name' must be the NPM package name. If 'bundle', the template is included directly in the CLI.",
"expectedUse": "Used to determine how to fetch and prepare the template for project creation."
}
},
"questions": {
"$ref": "questions.json",
"_ai": {
"instruction": "This property references the Inquirer Question interface defined here https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/inquirer/index.d.ts",
"expectedUse": "Instruct agent on how to ask the user questions."
}
},
"assets": {
"type": "array",
"items": {
"type": "string"
}
},
"answers": {
"type": "object",
"additionalProperties": {},
"_ai": {
"instruction": "These are default answers pre-filled when this template is selected. They should be merged with user-supplied answers, where user-supplied values take precedence.",
"expectedUse": "Auto-filling answers to questions without prompting the user unless a value is missing or overridden."
}
},
"private": {
"type": "boolean",
"_ai": {
"instruction": "This property is used to filter what templates are shown to the user.",
"expectedUse": "Hiding templates from the user."
}
}
},
"additionalProperties": false
},
"_ai": {
"instruction": "Do not display templates that are private. Answer is a key/value pair where the key is `project.template` and the value is the template id.",
"expectedUse": "Asking the user which template they want to use."
}
},
"validators": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "The unique identifier for the validator."
},
"name": {
"type": "string",
"description": "The name of the validator."
},
"description": {
"type": "string",
"description": "A brief description of what the validator does."
},
"message": {
"type": "string",
"description": "The error message to display if validation fails.",
"_ai": {
"instruction": "When validation fails, use this message to inform the user what went wrong.",
"expectedUse": "For validation error feedback."
}
},
"regex": {
"type": "string",
"description": "The validation logic, often a regular expression or a reference to a function.",
"_ai": {
"instruction": "Use this regex to validate the user input.",
"expectedUse": "For validation of user input."
}
}
},
"required": [
"id",
"name",
"description",
"message",
"regex"
]
},
"_ai": {
"instruction": "These validators can be applied to template questions to ensure valid input. Each validator has a unique `id` that is referenced from questions.",
"expectedUse": "Validating user input for questions during project creation."
}
},
"options": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"defaultValue": {
"type": "string"
}
},
"required": [
"name",
"description"
],
"_ai": {
"instruction": "This option modifies the behavior of the CLI tool. Use `defaultValue` if the option is not provided.",
"expectedUse": "Determine which CLI flags can be included when generating the command."
}
},
"_ai": {
"instruction": "These are the options/arguments that can be passed to the @salesforce/pwa-kit-create-app CLI tool. Do not use options that aren't listed here.",
"expectedUse": "Instruct agent on how to use the @salesforce/pwa-kit-create-app CLI tool to create a new PWA Kit project."
}
},
"examples": {
"type": "array",
"items": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"command": {
"type": "string"
}
},
"required": [
"description",
"command"
],
"_ai": {
"instruction": "Each example shows how to use the CLI tool with real command-line input.",
"expectedUse": "Show examples in documentation or when the agent is generating usage examples."
}
}
}
},
"data": {
"presets": [
{
"id": "retail-react-app-demo",
"name": "Retail React App Demo",
"description": "Generate a project using the settings for a special B2C Commerce instance that is used for demo purposes. No questions are asked. Use this preset to try out PWA Kit.",
"shortDescription": "The Retail app with demo Commerce Cloud instance",
"templateId": "retail-react-app",
"answers": {
"project.extend": true,
"project.hybrid": false,
"project.name": "demo-storefront",
"project.commerce.instanceUrl": "https://production-sitegenesis-dw.demandware.net",
"project.commerce.clientId": "44cfcf31-d64d-4227-9cce-1d9b0716c321",
"project.commerce.siteId": "RefArch",
"project.commerce.organizationId": "f_ecom_aaia_prd",
"project.commerce.shortCode": "xfdy2axw",
"project.commerce.isSlasPrivate": false,
"project.einstein.clientId": "1ea06c6e-c936-4324-bcf0-fada93f83bb1",
"project.einstein.siteId": "aaij-MobileFirst",
"project.dataCloud.appSourceId": "7ae070a6-f4ec-4def-a383-d9cacc3f20a1",
"project.dataCloud.tenantId": "g82wgnrvm-ywk9dggrrw8mtggy.pc-rnd",
"project.demo.enableDemoSettings": false
},
"private": false
},
{
"id": "retail-react-app-demo-site-internal",
"name": "Retail React App Demo Store",
"description": "Generates a project using the settings for a special B2C Commerce instance that is used for demo purposes. The demo site is accessible at https://pwa-kit.mobify-storefront.com/ This environment uses a SLAS private client and has social and passwordless login enabled. This environment is set up to use multiple locales. Future features that are enabled for the demo environment may be added to this preset.",
"shortDescription": "The Retail app with demo Commerce Cloud instance and a private SLAS client",
"templateId": "retail-react-app",
"answers": {
"project.extend": false,
"project.hybrid": false,
"project.name": "demo-storefront",
"project.commerce.instanceUrl": "https://zzrf-001.dx.commercecloud.salesforce.com",
"project.commerce.clientId": "083859f2-5d93-4209-b999-a112266d63a0",
"project.commerce.siteId": "RefArchGlobal",
"project.commerce.organizationId": "f_ecom_zzrf_001",
"project.commerce.shortCode": "kv7kzm78",
"project.commerce.isSlasPrivate": true,
"project.einstein.clientId": "1ea06c6e-c936-4324-bcf0-fada93f83bb1",
"project.einstein.siteId": "aaij-MobileFirst",
"project.dataCloud.appSourceId": "7ae070a6-f4ec-4def-a383-d9cacc3f20a1",
"project.dataCloud.tenantId": "g82wgnrvm-ywk9dggrrw8mtggy.pc-rnd",
"project.demo.enableDemoSettings": true
},
"private": true
},
{
"id": "retail-react-app-test-project",
"name": "Retail React App Test Project",
"description": "",
"templateId": "retail-react-app",
"answers": {
"project.extend": true,
"project.hybrid": false,
"project.name": "retail-react-app",
"project.commerce.instanceUrl": "https://zzrf-001.dx.commercecloud.salesforce.com",
"project.commerce.clientId": "c9c45bfd-0ed3-4aa2-9971-40f88962b836",
"project.commerce.siteId": "RefArch",
"project.commerce.organizationId": "f_ecom_zzrf_001",
"project.commerce.shortCode": "kv7kzm78",
"project.commerce.isSlasPrivate": false,
"project.einstein.clientId": "1ea06c6e-c936-4324-bcf0-fada93f83bb1",
"project.einstein.siteId": "aaij-MobileFirst",
"project.dataCloud.appSourceId": "7ae070a6-f4ec-4def-a383-d9cacc3f20a1",
"project.dataCloud.tenantId": "g82wgnrvm-ywk9dggrrw8mtggy.pc-rnd",
"project.demo.enableDemoSettings": false
},
"private": true
},
{
"id": "retail-react-app-private-slas-client",
"name": "Retail React App Private SLAS client project",
"description": "",
"templateId": "retail-react-app",
"answers": {
"project.extend": true,
"project.hybrid": false,
"project.name": "retail-react-app",
"project.commerce.instanceUrl": "https://zzrf-002.dx.commercecloud.salesforce.com",
"project.commerce.clientId": "89655706-9a0d-49ba-a1e5-18bb2d616374",
"project.commerce.siteId": "RefArch",
"project.commerce.organizationId": "f_ecom_zzrf_002",
"project.commerce.shortCode": "kv7kzm78",
"project.commerce.isSlasPrivate": true,
"project.einstein.clientId": "1ea06c6e-c936-4324-bcf0-fada93f83bb1",
"project.einstein.siteId": "aaij-MobileFirst",
"project.dataCloud.appSourceId": "7ae070a6-f4ec-4def-a383-d9cacc3f20a1",
"project.dataCloud.tenantId": "g82wgnrvm-ywk9dggrrw8mtggy.pc-rnd",
"project.demo.enableDemoSettings": false,
"project.login.passwordless.enabled": true,
"project.login.social.enabled": true
},
"private": true
},
{
"id": "retail-react-app-bug-bounty",
"name": "Retail React App Bug Bounty Project",
"description": "",
"templateId": "retail-react-app",
"answers": {
"project.extend": true,
"project.hybrid": false,
"project.name": "retail-react-app",
"project.commerce.instanceUrl": "https://zzec-006.dx.commercecloud.salesforce.com",
"project.commerce.clientId": "b56e7ad3-2237-42c9-8f55-41e63ebca420",
"project.commerce.siteId": "RefArch",
"project.commerce.organizationId": "f_ecom_zzec_006",
"project.commerce.shortCode": "staging-001",
"project.commerce.isSlasPrivate": true,
"project.einstein.clientId": "1ea06c6e-c936-4324-bcf0-fada93f83bb1",
"project.einstein.siteId": "aaij-MobileFirst",
"project.dataCloud.appSourceId": "7ae070a6-f4ec-4def-a383-d9cacc3f20a1",
"project.dataCloud.tenantId": "g82wgnrvm-ywk9dggrrw8mtggy.pc-rnd",
"project.demo.enableDemoSettings": false
},
"private": true
},
{
"id": "retail-react-app-hybrid-test-project",
"name": "Retail React App Hybrid Test Private SLAS Project",
"description": "",
"templateId": "retail-react-app",
"answers": {
"project.extend": true,
"project.hybrid": true,
"project.name": "retail-react-app",
"project.commerce.instanceUrl": "https://test.phased-launch-testing.com/",
"project.commerce.clientId": "99b4e081-00cf-454a-95b0-26ac2b824931",
"project.commerce.siteId": "RefArch",
"project.commerce.organizationId": "f_ecom_bdpx_dev",
"project.commerce.shortCode": "xitgmcd3",
"project.commerce.isSlasPrivate": true,
"project.einstein.clientId": "1ea06c6e-c936-4324-bcf0-fada93f83bb1",
"project.einstein.siteId": "aaij-MobileFirst",
"project.dataCloud.appSourceId": "7ae070a6-f4ec-4def-a383-d9cacc3f20a1",
"project.dataCloud.tenantId": "g82wgnrvm-ywk9dggrrw8mtggy.pc-rnd",
"project.demo.enableDemoSettings": false
},
"private": true
},
{
"id": "retail-react-app-hybrid-public-client-test-project",
"name": "Retail React App Hybrid Test Public SLAS client project",
"description": "",
"templateId": "retail-react-app",
"answers": {
"project.extend": true,
"project.hybrid": true,
"project.name": "retail-react-app",
"project.commerce.instanceUrl": "https://www.phased-launch-testing.com/",
"project.commerce.clientId": "e7e22b7f-a904-4f3a-8022-49dbee696485",
"project.commerce.siteId": "RefArch",
"project.commerce.organizationId": "f_ecom_bjnl_prd",
"project.commerce.shortCode": "performance-001",
"project.commerce.isSlasPrivate": false,
"project.einstein.clientId": "1ea06c6e-c936-4324-bcf0-fada93f83bb1",
"project.einstein.siteId": "aaij-MobileFirst",
"project.dataCloud.appSourceId": "7ae070a6-f4ec-4def-a383-d9cacc3f20a1",
"project.dataCloud.tenantId": "g82wgnrvm-ywk9dggrrw8mtggy.pc-rnd",
"project.demo.enableDemoSettings": false
},
"private": true
},
{
"id": "retail-react-app-performance-tests",
"name": "Retail React App for performance tests",
"description": "",
"templateId": "retail-react-app",
"answers": {
"project.extend": false,
"project.hybrid": false,
"project.name": "retail-react-app",
"project.commerce.instanceUrl": "https://zzrf-001.dx.commercecloud.salesforce.com",
"project.commerce.clientId": "9629ef22-f8b8-4987-90ac-b815be3940c8",
"project.commerce.siteId": "SiteNemesis",
"project.commerce.organizationId": "f_ecom_tbbn_prd",
"project.commerce.shortCode": "performance-001",
"project.commerce.isSlasPrivate": true,
"project.einstein.clientId": "1ea06c6e-c936-4324-bcf0-fada93f83bb1",
"project.einstein.siteId": "aaij-MobileFirst",
"project.dataCloud.appSourceId": "7ae070a6-f4ec-4def-a383-d9cacc3f20a1",
"project.dataCloud.tenantId": "g82wgnrvm-ywk9dggrrw8mtggy.pc-rnd",
"project.demo.enableDemoSettings": false,
"project.partialHydrationEnabled": true,
"project.contentSecurityPolicy": {
"useDefaults": true,
"directives": {
"img-src": [
"*.commercecloud.salesforce.com",
"*.demandware.net",
"*.sfcc-store-internal.net"
],
"script-src": [
"storage.googleapis.com",
"*.sfcc-store-internal.net"
],
"connect-src": [
"api.cquotient.com",
"*.c360a.salesforce.com",
"*.salesforce-scrt.com",
"*.sfcc-store-internal.net"
],
"frame-src": [
"*.site.com"
]
}
}
},
"private": true
},
{
"id": "typescript-minimal-test-project",
"name": "Template Minimal Test Project",
"description": "",
"templateId": "typescript-minimal",
"answers": {
"project.name": "typescript-minimal"
},
"private": true
},
{
"id": "express-minimal-test-project",
"name": "Express Minimal Test Project",
"description": "",
"templateId": "typescript-minimal",
"answers": {
"project.name": "express-minimal"
},
"private": true
}
],
"templates": [
{
"id": "retail-react-app",
"name": "Retail React App",
"description": "Generate a project using custom settings by answering questions about a B2C Commerce instance. Use this preset to connect to an existing instance, such as a sandbox.",
"shortDescription": "The Retail app using your own Commerce Cloud instance",
"source": {
"type": "npm",
"name": "@salesforce/retail-react-app"
},
"questions": [
{
"name": "project.extend",
"message": "Do you wish to use template extensibility?",
"type": "list",
"choices": [
{
"name": "Yes",
"value": true
},
{
"name": "No",
"value": false
}
]
},
{
"name": "project.name",
"message": "What is the name of your Project?",
"validator": "validProjectName",
"_ai": {
"instruction": "Should validate the user input using the 'validateProjectName' validator.",
"expectedUse": "Instruct agent on how to validate user input."
}
},
{
"name": "project.commerce.instanceUrl",
"message": "What is the URL for your Commerce Cloud instance?",
"validator": "validUrl",
"_ai": {
"instruction": "Should validate the user input using the 'validUrl' validator.",
"expectedUse": "Instruct agent on how to validate user input."
}
},
{
"name": "project.commerce.clientId",
"message": "What is your SLAS Client ID?",
"validator": "validClientId",
"_ai": {
"instruction": "Should validate the user input using the 'validClientId' validator.",
"expectedUse": "Instruct agent on how to validate user input."
}
},
{
"name": "project.commerce.isSlasPrivate",
"message": "Is your SLAS client private?",
"type": "list",
"choices": [
{
"name": "Yes",
"value": true
},
{
"name": "No",
"value": false
}
]
},
{
"name": "project.commerce.siteId",
"message": "What is your Site ID in Business Manager?",
"validator": "validSiteId",
"_ai": {
"instruction": "Should validate the user input using the 'validSiteId' validator.",
"expectedUse": "Instruct agent on how to validate user input."
}
},
{
"name": "project.commerce.organizationId",
"message": "What is your Commerce API organization ID in Business Manager?",
"validator": "validOrganizationId",
"_ai": {
"instruction": "Should validate the user input using the 'validOrganizationId' validator.",
"expectedUse": "Instruct agent on how to validate user input."
}
},
{
"name": "project.commerce.shortCode",
"message": "What is your Commerce API short code in Business Manager?",
"validator": "validShortCode",
"_ai": {
"instruction": "Should validate the user input using the 'validShortCode' validator.",
"expectedUse": "Instruct agent on how to validate user input."
}
}
],
"assets": [
"translations"
],
"private": false
},
{
"id": "typescript-minimal",
"name": "Template Minimal Project",
"description": "Generate a project using a bare-bones TypeScript app template. Use this as a TypeScript starting point or as a base on top of which to build new TypeScript project templates for Managed Runtime.",
"source": {
"type": "bundle"
},
"questions": [
{
"name": "project.name",
"message": "What is the name of your Project?",
"validator": "validateProjectName",
"_ai": {
"instruction": "Should validate the user input using the 'validateProjectName' validator.",
"expectedUse": "Instruct agent on how to validate user input."
}
}
],
"private": true
},
{
"id": "express-minimal",
"name": "Express Minimal Project",
"description": "Generate a project using a bare-bones express app template. Use this as a starting point for APIs or as a base on top of which to build new project templates for Managed Runtime.",
"source": {
"type": "bundle"
},
"questions": [
{
"name": "project.name",
"message": "What is the name of your Project?",
"validator": "validateProjectName",
"_ai": {
"instruction": "Should validate the user input using the 'validateProjectName' validator.",
"expectedUse": "Instruct agent on how to validate user input."
}
}
],
"private": true
},
{
"id": "mrt-reference-app",
"name": "Managed Runtime Reference App",
"description": "",
"source": {
"type": "bundle"
},
"questions": [
{
"name": "project.name",
"message": "What is the name of your Project?",
"validator": "validateProjectName",
"_ai": {
"instruction": "Should validate the user input using the 'validateProjectName' validator.",
"expectedUse": "Instruct agent on how to validate user input."
}
}
],
"answers": {
"project.name": "mrt-reference-app"
},
"private": true
}
],
"validators": [
{
"id": "validProjectName",
"name": "Valid Project Name",
"description": "Ensures the project name is valid (letters, numbers, space, hyphens, 1-20 characters).",
"message": "Value can only contain letters, numbers, space and hyphens; with a maximum length is 20 characters.",
"regex": "^[a-zA-Z0-9-\\\\s]{1,20}$"
},
{
"id": "validUrl",
"name": "Valid URL",
"description": "Ensures the value is an absolute URL.",
"message": "Value must be an absolute URL",
"regex": "^(https?):\\/\\/[^\\s/$.?#].[^\\s]*$"
},
{
"id": "validSiteId",
"name": "Valid Site ID",
"description": "Ensures the Site ID is valid.",
"message": "Valid characters are alphanumeric, hyphen, or underscore",
"regex": "^[a-z0-9_-]+$"
},
{
"id": "validShortCode",
"name": "Valid Short Code",
"description": "Ensures the short code is valid.",
"message": "Invalid format. Use docs to find more information about valid configurations: https://developer.salesforce.com/docs/commerce/commerce-api/guide/commerce-api-configuration-values",
"regex": "^([0-9A-Z]{8})$"
},
{
"id": "validClientId",
"name": "Valid Client ID",
"description": "Ensures the client ID is valid.",
"message": "Invalid format. Use docs to find more information about valid configurations: https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html",
"regex": "^([0-9A-Z]{8}-[0-9A-Z]{4}-[0-9A-Z]{4}-[0-9A-Z]{4}-[0-9A-Z]{12}|aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)$"
},
{
"id": "validOrganizationId",
"name": "Valid Organization ID",
"description": "Ensures the organization ID is valid.",
"message": "Invalid format. Use docs to find more information about valid configurations: https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html",
"regex": "^(f_ecom)_([A-Z]{4})_(prd|stg|dev|[0-9]{3}|s[0-9]{2})$"
}
],
"options": [
{
"name": "--outputDir <path>",
"description": "Path to the output directory for the new project"
},
{
"name": "--preset <name>",
"description": "The name of a project preset to use."
},
{
"name": "--templateVersion <version>",
"description": "The version of the template to be generated when it's source is NPM.",
"defaultValue": "latest"
},
{
"name": "--verbose",
"description": "Print additional logging information to the console."
},
{
"name": "--stdio",
"description": "Accept project generation answers from stdin as JSON"
},
{
"name": "--displayProgram",
"description": "Display the program.json file detailing the program schema/data and exit"
}
],
"examples": [
{
"description": "Generate a project using a preset",
"command": "npx @salesforce/pwa-kit-create-app --preset retail-react-app-demo"
},
{
"description": "Generate a project using answers from stdin",
"command": "echo {\"project.name\":\"MyProject\", ...} | npx @salesforce/pwa-kit-create-app --stdio"
}
]
}
}