@shopify/cli 3.47.5 → 3.48.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/cli/services/demo.d.ts +32 -0
- package/dist/cli/services/demo.js +1 -0
- package/dist/cli/services/demo.js.map +1 -1
- package/dist/cli/services/kitchen-sink/prompts.js +46 -21
- package/dist/cli/services/kitchen-sink/prompts.js.map +1 -1
- package/dist/cli/services/kitchen-sink/static.js +5 -1
- package/dist/cli/services/kitchen-sink/static.js.map +1 -1
- package/dist/cli/services/upgrade.js +19 -9
- package/dist/cli/services/upgrade.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +15 -12
|
@@ -9379,6 +9379,7 @@ declare const renderConfirmationPromptStepSchema: zod.ZodObject<{
|
|
|
9379
9379
|
color: zod.ZodOptional<zod.ZodString>;
|
|
9380
9380
|
header: zod.ZodString;
|
|
9381
9381
|
helperText: zod.ZodOptional<zod.ZodString>;
|
|
9382
|
+
bullet: zod.ZodOptional<zod.ZodString>;
|
|
9382
9383
|
items: zod.ZodArray<zod.ZodUnion<[zod.ZodType<string | {
|
|
9383
9384
|
command: string;
|
|
9384
9385
|
} | {
|
|
@@ -9487,6 +9488,7 @@ declare const renderConfirmationPromptStepSchema: zod.ZodObject<{
|
|
|
9487
9488
|
})[])[];
|
|
9488
9489
|
color?: string | undefined;
|
|
9489
9490
|
helperText?: string | undefined;
|
|
9491
|
+
bullet?: string | undefined;
|
|
9490
9492
|
}, {
|
|
9491
9493
|
header: string;
|
|
9492
9494
|
items: (string | {
|
|
@@ -9526,6 +9528,7 @@ declare const renderConfirmationPromptStepSchema: zod.ZodObject<{
|
|
|
9526
9528
|
})[])[];
|
|
9527
9529
|
color?: string | undefined;
|
|
9528
9530
|
helperText?: string | undefined;
|
|
9531
|
+
bullet?: string | undefined;
|
|
9529
9532
|
}>, "many">]>>;
|
|
9530
9533
|
gitDiff: zod.ZodOptional<zod.ZodObject<{
|
|
9531
9534
|
baselineContent: zod.ZodString;
|
|
@@ -9691,6 +9694,7 @@ declare const renderConfirmationPromptStepSchema: zod.ZodObject<{
|
|
|
9691
9694
|
})[])[];
|
|
9692
9695
|
color?: string | undefined;
|
|
9693
9696
|
helperText?: string | undefined;
|
|
9697
|
+
bullet?: string | undefined;
|
|
9694
9698
|
}[] | undefined;
|
|
9695
9699
|
gitDiff?: {
|
|
9696
9700
|
baselineContent: string;
|
|
@@ -9848,6 +9852,7 @@ declare const renderConfirmationPromptStepSchema: zod.ZodObject<{
|
|
|
9848
9852
|
})[])[];
|
|
9849
9853
|
color?: string | undefined;
|
|
9850
9854
|
helperText?: string | undefined;
|
|
9855
|
+
bullet?: string | undefined;
|
|
9851
9856
|
}[] | undefined;
|
|
9852
9857
|
gitDiff?: {
|
|
9853
9858
|
baselineContent: string;
|
|
@@ -10008,6 +10013,7 @@ declare const renderConfirmationPromptStepSchema: zod.ZodObject<{
|
|
|
10008
10013
|
})[])[];
|
|
10009
10014
|
color?: string | undefined;
|
|
10010
10015
|
helperText?: string | undefined;
|
|
10016
|
+
bullet?: string | undefined;
|
|
10011
10017
|
}[] | undefined;
|
|
10012
10018
|
gitDiff?: {
|
|
10013
10019
|
baselineContent: string;
|
|
@@ -10170,6 +10176,7 @@ declare const renderConfirmationPromptStepSchema: zod.ZodObject<{
|
|
|
10170
10176
|
})[])[];
|
|
10171
10177
|
color?: string | undefined;
|
|
10172
10178
|
helperText?: string | undefined;
|
|
10179
|
+
bullet?: string | undefined;
|
|
10173
10180
|
}[] | undefined;
|
|
10174
10181
|
gitDiff?: {
|
|
10175
10182
|
baselineContent: string;
|
|
@@ -10455,6 +10462,7 @@ declare const renderSelectPromptStepSchema: zod.ZodObject<{
|
|
|
10455
10462
|
color: zod.ZodOptional<zod.ZodString>;
|
|
10456
10463
|
header: zod.ZodString;
|
|
10457
10464
|
helperText: zod.ZodOptional<zod.ZodString>;
|
|
10465
|
+
bullet: zod.ZodOptional<zod.ZodString>;
|
|
10458
10466
|
items: zod.ZodArray<zod.ZodUnion<[zod.ZodType<string | {
|
|
10459
10467
|
command: string;
|
|
10460
10468
|
} | {
|
|
@@ -10563,6 +10571,7 @@ declare const renderSelectPromptStepSchema: zod.ZodObject<{
|
|
|
10563
10571
|
})[])[];
|
|
10564
10572
|
color?: string | undefined;
|
|
10565
10573
|
helperText?: string | undefined;
|
|
10574
|
+
bullet?: string | undefined;
|
|
10566
10575
|
}, {
|
|
10567
10576
|
header: string;
|
|
10568
10577
|
items: (string | {
|
|
@@ -10602,6 +10611,7 @@ declare const renderSelectPromptStepSchema: zod.ZodObject<{
|
|
|
10602
10611
|
})[])[];
|
|
10603
10612
|
color?: string | undefined;
|
|
10604
10613
|
helperText?: string | undefined;
|
|
10614
|
+
bullet?: string | undefined;
|
|
10605
10615
|
}>, "many">]>>;
|
|
10606
10616
|
gitDiff: zod.ZodOptional<zod.ZodObject<{
|
|
10607
10617
|
baselineContent: zod.ZodString;
|
|
@@ -10770,6 +10780,7 @@ declare const renderSelectPromptStepSchema: zod.ZodObject<{
|
|
|
10770
10780
|
})[])[];
|
|
10771
10781
|
color?: string | undefined;
|
|
10772
10782
|
helperText?: string | undefined;
|
|
10783
|
+
bullet?: string | undefined;
|
|
10773
10784
|
}[] | undefined;
|
|
10774
10785
|
gitDiff?: {
|
|
10775
10786
|
baselineContent: string;
|
|
@@ -10932,6 +10943,7 @@ declare const renderSelectPromptStepSchema: zod.ZodObject<{
|
|
|
10932
10943
|
})[])[];
|
|
10933
10944
|
color?: string | undefined;
|
|
10934
10945
|
helperText?: string | undefined;
|
|
10946
|
+
bullet?: string | undefined;
|
|
10935
10947
|
}[] | undefined;
|
|
10936
10948
|
gitDiff?: {
|
|
10937
10949
|
baselineContent: string;
|
|
@@ -11097,6 +11109,7 @@ declare const renderSelectPromptStepSchema: zod.ZodObject<{
|
|
|
11097
11109
|
})[])[];
|
|
11098
11110
|
color?: string | undefined;
|
|
11099
11111
|
helperText?: string | undefined;
|
|
11112
|
+
bullet?: string | undefined;
|
|
11100
11113
|
}[] | undefined;
|
|
11101
11114
|
gitDiff?: {
|
|
11102
11115
|
baselineContent: string;
|
|
@@ -11264,6 +11277,7 @@ declare const renderSelectPromptStepSchema: zod.ZodObject<{
|
|
|
11264
11277
|
})[])[];
|
|
11265
11278
|
color?: string | undefined;
|
|
11266
11279
|
helperText?: string | undefined;
|
|
11280
|
+
bullet?: string | undefined;
|
|
11267
11281
|
}[] | undefined;
|
|
11268
11282
|
gitDiff?: {
|
|
11269
11283
|
baselineContent: string;
|
|
@@ -20898,6 +20912,7 @@ export declare const demoStepsSchema: zod.ZodObject<{
|
|
|
20898
20912
|
color: zod.ZodOptional<zod.ZodString>;
|
|
20899
20913
|
header: zod.ZodString;
|
|
20900
20914
|
helperText: zod.ZodOptional<zod.ZodString>;
|
|
20915
|
+
bullet: zod.ZodOptional<zod.ZodString>;
|
|
20901
20916
|
items: zod.ZodArray<zod.ZodUnion<[zod.ZodType<string | {
|
|
20902
20917
|
command: string;
|
|
20903
20918
|
} | {
|
|
@@ -21006,6 +21021,7 @@ export declare const demoStepsSchema: zod.ZodObject<{
|
|
|
21006
21021
|
})[])[];
|
|
21007
21022
|
color?: string | undefined;
|
|
21008
21023
|
helperText?: string | undefined;
|
|
21024
|
+
bullet?: string | undefined;
|
|
21009
21025
|
}, {
|
|
21010
21026
|
header: string;
|
|
21011
21027
|
items: (string | {
|
|
@@ -21045,6 +21061,7 @@ export declare const demoStepsSchema: zod.ZodObject<{
|
|
|
21045
21061
|
})[])[];
|
|
21046
21062
|
color?: string | undefined;
|
|
21047
21063
|
helperText?: string | undefined;
|
|
21064
|
+
bullet?: string | undefined;
|
|
21048
21065
|
}>, "many">]>>;
|
|
21049
21066
|
gitDiff: zod.ZodOptional<zod.ZodObject<{
|
|
21050
21067
|
baselineContent: zod.ZodString;
|
|
@@ -21210,6 +21227,7 @@ export declare const demoStepsSchema: zod.ZodObject<{
|
|
|
21210
21227
|
})[])[];
|
|
21211
21228
|
color?: string | undefined;
|
|
21212
21229
|
helperText?: string | undefined;
|
|
21230
|
+
bullet?: string | undefined;
|
|
21213
21231
|
}[] | undefined;
|
|
21214
21232
|
gitDiff?: {
|
|
21215
21233
|
baselineContent: string;
|
|
@@ -21367,6 +21385,7 @@ export declare const demoStepsSchema: zod.ZodObject<{
|
|
|
21367
21385
|
})[])[];
|
|
21368
21386
|
color?: string | undefined;
|
|
21369
21387
|
helperText?: string | undefined;
|
|
21388
|
+
bullet?: string | undefined;
|
|
21370
21389
|
}[] | undefined;
|
|
21371
21390
|
gitDiff?: {
|
|
21372
21391
|
baselineContent: string;
|
|
@@ -21527,6 +21546,7 @@ export declare const demoStepsSchema: zod.ZodObject<{
|
|
|
21527
21546
|
})[])[];
|
|
21528
21547
|
color?: string | undefined;
|
|
21529
21548
|
helperText?: string | undefined;
|
|
21549
|
+
bullet?: string | undefined;
|
|
21530
21550
|
}[] | undefined;
|
|
21531
21551
|
gitDiff?: {
|
|
21532
21552
|
baselineContent: string;
|
|
@@ -21689,6 +21709,7 @@ export declare const demoStepsSchema: zod.ZodObject<{
|
|
|
21689
21709
|
})[])[];
|
|
21690
21710
|
color?: string | undefined;
|
|
21691
21711
|
helperText?: string | undefined;
|
|
21712
|
+
bullet?: string | undefined;
|
|
21692
21713
|
}[] | undefined;
|
|
21693
21714
|
gitDiff?: {
|
|
21694
21715
|
baselineContent: string;
|
|
@@ -21972,6 +21993,7 @@ export declare const demoStepsSchema: zod.ZodObject<{
|
|
|
21972
21993
|
color: zod.ZodOptional<zod.ZodString>;
|
|
21973
21994
|
header: zod.ZodString;
|
|
21974
21995
|
helperText: zod.ZodOptional<zod.ZodString>;
|
|
21996
|
+
bullet: zod.ZodOptional<zod.ZodString>;
|
|
21975
21997
|
items: zod.ZodArray<zod.ZodUnion<[zod.ZodType<string | {
|
|
21976
21998
|
command: string;
|
|
21977
21999
|
} | {
|
|
@@ -22080,6 +22102,7 @@ export declare const demoStepsSchema: zod.ZodObject<{
|
|
|
22080
22102
|
})[])[];
|
|
22081
22103
|
color?: string | undefined;
|
|
22082
22104
|
helperText?: string | undefined;
|
|
22105
|
+
bullet?: string | undefined;
|
|
22083
22106
|
}, {
|
|
22084
22107
|
header: string;
|
|
22085
22108
|
items: (string | {
|
|
@@ -22119,6 +22142,7 @@ export declare const demoStepsSchema: zod.ZodObject<{
|
|
|
22119
22142
|
})[])[];
|
|
22120
22143
|
color?: string | undefined;
|
|
22121
22144
|
helperText?: string | undefined;
|
|
22145
|
+
bullet?: string | undefined;
|
|
22122
22146
|
}>, "many">]>>;
|
|
22123
22147
|
gitDiff: zod.ZodOptional<zod.ZodObject<{
|
|
22124
22148
|
baselineContent: zod.ZodString;
|
|
@@ -22287,6 +22311,7 @@ export declare const demoStepsSchema: zod.ZodObject<{
|
|
|
22287
22311
|
})[])[];
|
|
22288
22312
|
color?: string | undefined;
|
|
22289
22313
|
helperText?: string | undefined;
|
|
22314
|
+
bullet?: string | undefined;
|
|
22290
22315
|
}[] | undefined;
|
|
22291
22316
|
gitDiff?: {
|
|
22292
22317
|
baselineContent: string;
|
|
@@ -22449,6 +22474,7 @@ export declare const demoStepsSchema: zod.ZodObject<{
|
|
|
22449
22474
|
})[])[];
|
|
22450
22475
|
color?: string | undefined;
|
|
22451
22476
|
helperText?: string | undefined;
|
|
22477
|
+
bullet?: string | undefined;
|
|
22452
22478
|
}[] | undefined;
|
|
22453
22479
|
gitDiff?: {
|
|
22454
22480
|
baselineContent: string;
|
|
@@ -22614,6 +22640,7 @@ export declare const demoStepsSchema: zod.ZodObject<{
|
|
|
22614
22640
|
})[])[];
|
|
22615
22641
|
color?: string | undefined;
|
|
22616
22642
|
helperText?: string | undefined;
|
|
22643
|
+
bullet?: string | undefined;
|
|
22617
22644
|
}[] | undefined;
|
|
22618
22645
|
gitDiff?: {
|
|
22619
22646
|
baselineContent: string;
|
|
@@ -22781,6 +22808,7 @@ export declare const demoStepsSchema: zod.ZodObject<{
|
|
|
22781
22808
|
})[])[];
|
|
22782
22809
|
color?: string | undefined;
|
|
22783
22810
|
helperText?: string | undefined;
|
|
22811
|
+
bullet?: string | undefined;
|
|
22784
22812
|
}[] | undefined;
|
|
22785
22813
|
gitDiff?: {
|
|
22786
22814
|
baselineContent: string;
|
|
@@ -24612,6 +24640,7 @@ export declare const demoStepsSchema: zod.ZodObject<{
|
|
|
24612
24640
|
})[])[];
|
|
24613
24641
|
color?: string | undefined;
|
|
24614
24642
|
helperText?: string | undefined;
|
|
24643
|
+
bullet?: string | undefined;
|
|
24615
24644
|
}[] | undefined;
|
|
24616
24645
|
gitDiff?: {
|
|
24617
24646
|
baselineContent: string;
|
|
@@ -24780,6 +24809,7 @@ export declare const demoStepsSchema: zod.ZodObject<{
|
|
|
24780
24809
|
})[])[];
|
|
24781
24810
|
color?: string | undefined;
|
|
24782
24811
|
helperText?: string | undefined;
|
|
24812
|
+
bullet?: string | undefined;
|
|
24783
24813
|
}[] | undefined;
|
|
24784
24814
|
gitDiff?: {
|
|
24785
24815
|
baselineContent: string;
|
|
@@ -26415,6 +26445,7 @@ export declare const demoStepsSchema: zod.ZodObject<{
|
|
|
26415
26445
|
})[])[];
|
|
26416
26446
|
color?: string | undefined;
|
|
26417
26447
|
helperText?: string | undefined;
|
|
26448
|
+
bullet?: string | undefined;
|
|
26418
26449
|
}[] | undefined;
|
|
26419
26450
|
gitDiff?: {
|
|
26420
26451
|
baselineContent: string;
|
|
@@ -26583,6 +26614,7 @@ export declare const demoStepsSchema: zod.ZodObject<{
|
|
|
26583
26614
|
})[])[];
|
|
26584
26615
|
color?: string | undefined;
|
|
26585
26616
|
helperText?: string | undefined;
|
|
26617
|
+
bullet?: string | undefined;
|
|
26586
26618
|
}[] | undefined;
|
|
26587
26619
|
gitDiff?: {
|
|
26588
26620
|
baselineContent: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"demo.js","sourceRoot":"","sources":["../../../src/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AAK,EAAE,MAAgB,EAAE,EAAE;oBACjC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;wBACxB,MAAM,EAAC,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAC,GAAG,IAAI,CAAA;wBACjD,IAAI,YAAY;4BAAE,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,CAAA;wBAC5C,4CAA4C;wBAC5C,MAAM,KAAK,CAAC,QAAQ,CAAC,CAAA;wBACrB,IAAI,UAAU;4BAAE,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;qBACzC;gBACH,CAAC;aACF,CAAA;QACH,CAAC,CAAC,CAAA;QACF,MAAM,gBAAgB,CAAC,EAAC,SAAS,EAAE,mBAAmB,EAAE,MAAM,EAAC,CAAC,CAAA;IAClE,CAAC,CAAA;AACH,CAAC","sourcesContent":["import {AbortError, BugError} from '@shopify/cli-kit/node/error'\nimport {outputInfo} from '@shopify/cli-kit/node/output'\nimport {sleep} from '@shopify/cli-kit/node/system'\nimport {\n renderFatalError,\n renderInfo,\n renderSuccess,\n renderTable,\n renderConcurrent,\n renderTasks,\n renderWarning,\n renderAutocompletePrompt,\n renderConfirmationPrompt,\n renderSelectPrompt,\n renderTextPrompt,\n} from '@shopify/cli-kit/node/ui'\nimport {zod} from '@shopify/cli-kit/node/schema'\nimport {Writable} from 'stream'\n\nfunction oneOrMore<T>(singular: zod.ZodType<T>) {\n return zod.union([singular, zod.array(singular)])\n}\nconst scalar = zod.union([zod.string(), zod.number(), zod.boolean(), zod.null(), zod.undefined()])\nconst linkSchema = zod.object({label: zod.string(), url: zod.string()})\nconst inlineTokenSchema = zod.union([\n zod.string(),\n zod.object({command: zod.string()}),\n zod.object({link: linkSchema}),\n zod.object({char: zod.string().length(1)}),\n zod.object({userInput: zod.string()}),\n zod.object({subdued: zod.string()}),\n zod.object({filePath: zod.string()}),\n zod.object({bold: zod.string()}),\n])\nconst headlineTokenSchema = oneOrMore(\n zod.union([\n zod.string(),\n zod.object({command: zod.string()}),\n zod.object({char: zod.string().length(1)}),\n zod.object({userInput: zod.string()}),\n zod.object({subdued: zod.string()}),\n zod.object({filePath: zod.string()}),\n ]),\n)\n// type InlineToken = zod.infer<typeof inlineTokenSchema>\nconst inlineTokenItemSchema = oneOrMore(inlineTokenSchema)\n// type InlineTokenItem = zod.infer<typeof inlineTokenItemSchema>\nconst listSchema = zod.object({\n list: zod.object({\n title: zod.string().optional(),\n items: zod.array(inlineTokenItemSchema),\n ordered: zod.boolean().optional(),\n }),\n})\nconst tokenItemSchema = oneOrMore(zod.union([inlineTokenSchema, listSchema]))\n\nconst tableSchema = zod.object({\n rows: zod.array(zod.object({}).catchall(scalar)),\n columns: zod.object({}).catchall(\n zod.object({\n header: zod.string().optional(),\n color: zod.string().optional(),\n }),\n ),\n})\nconst infoTableSchema = zod.union([\n zod.object({}).catchall(zod.array(inlineTokenItemSchema)),\n zod.array(\n zod.object({\n color: zod.string().optional(),\n header: zod.string(),\n helperText: zod.string().optional(),\n items: zod.array(inlineTokenItemSchema),\n }),\n ),\n])\n\nconst abstractDemoStepSchema = zod.object({\n type: zod.string(),\n properties: zod.object({}),\n // optional properties for documentation purposes\n title: zod.string().optional(),\n description: zod.string().optional(),\n})\n\nconst outputStepSchema = abstractDemoStepSchema.extend({\n type: zod.literal('output'),\n properties: zod.object({\n content: zod.string(),\n }),\n})\ntype OutputStep = zod.infer<typeof outputStepSchema>\n\nconst renderStepPropertiesSchema = zod.object({\n headline: headlineTokenSchema.optional(),\n body: tokenItemSchema.optional(),\n nextSteps: zod.array(inlineTokenItemSchema).optional(),\n reference: zod.array(inlineTokenItemSchema).optional(),\n link: linkSchema.optional(),\n customSections: zod\n .array(\n zod.object({\n title: zod.string().optional(),\n body: tokenItemSchema,\n }),\n )\n .optional(),\n orderedNextSteps: zod.boolean().optional(),\n})\nconst renderInfoStepSchema = abstractDemoStepSchema.extend({\n type: zod.literal('info'),\n properties: renderStepPropertiesSchema,\n})\ntype RenderInfoStep = zod.infer<typeof renderInfoStepSchema>\nconst renderSuccessStepSchema = abstractDemoStepSchema.extend({\n type: zod.literal('success'),\n properties: renderStepPropertiesSchema,\n})\ntype RenderSuccessStep = zod.infer<typeof renderSuccessStepSchema>\nconst renderWarningStepSchema = abstractDemoStepSchema.extend({\n type: zod.literal('warning'),\n properties: renderStepPropertiesSchema,\n})\ntype RenderWarningStep = zod.infer<typeof renderWarningStepSchema>\n\nconst renderFatalErrorStepSchema = abstractDemoStepSchema.extend({\n type: zod.literal('fatalError'),\n properties: zod.object({\n errorType: zod.union([zod.literal('abort'), zod.literal('bug')]),\n message: zod.string(),\n tryMessage: zod.string().optional(),\n nextSteps: zod.array(inlineTokenItemSchema).optional(),\n }),\n})\ntype RenderFatalErrorStep = zod.infer<typeof renderFatalErrorStepSchema>\n\nconst renderTableStepSchema = abstractDemoStepSchema.extend({\n type: zod.literal('table'),\n properties: tableSchema,\n})\ntype RenderTableStep = zod.infer<typeof renderTableStepSchema>\n\nconst renderAutoCompletePromptStepSchema = abstractDemoStepSchema.extend({\n type: zod.literal('autocompletePrompt'),\n properties: zod.object({\n message: zod.string(),\n choices: zod.array(\n zod.object({\n label: zod.string(),\n value: zod.string(),\n }),\n ),\n }),\n})\ntype RenderAutocompletePromptStep = zod.infer<typeof renderAutoCompletePromptStepSchema>\n\nconst renderConfirmationPromptStepSchema = abstractDemoStepSchema.extend({\n type: zod.literal('confirmationPrompt'),\n properties: zod.object({\n message: headlineTokenSchema,\n infoTable: infoTableSchema.optional(),\n gitDiff: zod\n .object({\n baselineContent: zod.string(),\n updatedContent: zod.string(),\n })\n .optional(),\n defaultValue: zod.boolean().optional(),\n confirmationMessage: zod.string(),\n cancellationMessage: zod.string(),\n }),\n})\ntype RenderConfirmationPromptStep = zod.infer<typeof renderConfirmationPromptStepSchema>\n\nconst renderSelectPromptStepSchema = abstractDemoStepSchema.extend({\n type: zod.literal('selectPrompt'),\n properties: zod.object({\n message: headlineTokenSchema,\n choices: zod.array(\n zod.object({\n label: zod.string(),\n value: zod.string(),\n key: zod.string().length(1).optional(),\n group: zod.string().optional(),\n disabled: zod.boolean().optional(),\n }),\n ),\n defaultValue: zod.string().optional(),\n infoTable: infoTableSchema.optional(),\n gitDiff: zod\n .object({\n baselineContent: zod.string(),\n updatedContent: zod.string(),\n })\n .optional(),\n }),\n})\ntype RenderSelectPromptStep = zod.infer<typeof renderSelectPromptStepSchema>\n\nconst renderTextPromptStepSchema = abstractDemoStepSchema.extend({\n type: zod.literal('textPrompt'),\n properties: zod.object({\n message: zod.string(),\n defaultValue: zod.string().optional(),\n password: zod.boolean().optional(),\n allowEmpty: zod.boolean().optional(),\n }),\n})\ntype RenderTextPromptStep = zod.infer<typeof renderTextPromptStepSchema>\n\nconst sleepStepSchema = abstractDemoStepSchema.extend({\n type: zod.literal('sleep'),\n properties: zod.object({\n duration: zod.number(),\n }),\n})\ntype SleepStep = zod.infer<typeof sleepStepSchema>\n\nconst taskbarStepSchema = abstractDemoStepSchema.extend({\n type: zod.literal('taskbar'),\n properties: zod.object({\n steps: zod.array(\n zod.object({\n title: zod.string(),\n duration: zod.number(),\n }),\n ),\n }),\n})\ntype TaskbarStep = zod.infer<typeof taskbarStepSchema>\n\nconst renderConcurrentPropertiesSchema = zod.object({\n processes: zod.array(\n zod.object({\n prefix: zod.string(),\n steps: zod.array(\n zod.object({\n startMessage: zod.string().optional(),\n duration: zod.number(),\n endMessage: zod.string().optional(),\n }),\n ),\n }),\n ),\n footer: zod\n .object({\n shortcuts: zod.array(\n zod.object({\n key: zod.string(),\n action: zod.string(),\n }),\n ),\n subTitle: zod.string().optional(),\n })\n .optional(),\n})\ntype RenderConcurrentProperties = zod.infer<typeof renderConcurrentPropertiesSchema>\nconst renderConcurrentStepSchema = abstractDemoStepSchema.extend({\n type: zod.literal('concurrent'),\n properties: renderConcurrentPropertiesSchema,\n})\ntype RenderConcurrentStep = zod.infer<typeof renderConcurrentStepSchema>\n\nexport type DemoStep =\n | OutputStep\n | RenderInfoStep\n | RenderSuccessStep\n | RenderWarningStep\n | RenderTableStep\n | RenderFatalErrorStep\n | RenderAutocompletePromptStep\n | RenderConfirmationPromptStep\n | RenderSelectPromptStep\n | RenderTextPromptStep\n | SleepStep\n | TaskbarStep\n | RenderConcurrentStep\n\nconst demoStepSchema = zod.discriminatedUnion('type', [\n outputStepSchema,\n renderInfoStepSchema,\n renderSuccessStepSchema,\n renderWarningStepSchema,\n renderTableStepSchema,\n renderFatalErrorStepSchema,\n renderAutoCompletePromptStepSchema,\n renderConfirmationPromptStepSchema,\n renderSelectPromptStepSchema,\n renderTextPromptStepSchema,\n sleepStepSchema,\n taskbarStepSchema,\n renderConcurrentStepSchema,\n])\nexport const demoStepsSchema = zod.object({\n $schema: zod.string().optional(),\n command: zod.string().optional(),\n steps: zod.array(demoStepSchema),\n})\ntype DemoSteps = zod.infer<typeof demoStepsSchema>\n\nexport async function demo(stepsJsonData: DemoSteps) {\n const {steps, command} = demoStepsSchema.parse(stepsJsonData)\n const executors = steps.map(executorForStep)\n\n await simulateTyping(command)\n for (const executor of executors) {\n // eslint-disable-next-line no-await-in-loop\n await executor()\n }\n}\n\nasync function simulateTyping(text?: string) {\n if (!text) return\n\n // eslint-disable-next-line no-console\n console.clear()\n process.stdout.write('$ ')\n const chars = text.split('')\n while (chars.length > 0) {\n const char = chars.shift()!\n process.stdout.write(char)\n // eslint-disable-next-line no-await-in-loop\n await sleep(0.1 + Math.random() / 10)\n }\n process.stdout.write('\\n')\n await sleep(1 + Math.random() / 10)\n}\n\nfunction executorForStep(step: DemoStep): () => Promise<void> {\n switch (step.type) {\n case 'output':\n return async () => {\n outputInfo(step.properties.content)\n }\n case 'sleep':\n return async () => {\n await sleep(step.properties.duration)\n }\n case 'taskbar':\n return taskbarExecutor(step.properties.steps)\n case 'concurrent':\n return concurrentExecutor(step.properties)\n case 'info':\n return async () => {\n renderInfo(step.properties)\n }\n case 'success':\n return async () => {\n renderSuccess(step.properties)\n }\n case 'warning':\n return async () => {\n renderWarning(step.properties)\n }\n case 'fatalError':\n return async () => {\n const {errorType, message, nextSteps, tryMessage} = step.properties\n if (errorType === 'abort') {\n renderFatalError(new AbortError(message, tryMessage, nextSteps))\n } else {\n renderFatalError(new BugError(message, tryMessage))\n }\n }\n case 'table':\n return async () => {\n renderTable(step.properties as Parameters<typeof renderTable>[0])\n }\n case 'autocompletePrompt':\n return async () => {\n await renderAutocompletePrompt(step.properties)\n }\n case 'confirmationPrompt':\n return async () => {\n await renderConfirmationPrompt(step.properties as Parameters<typeof renderConfirmationPrompt>[0])\n }\n case 'selectPrompt':\n return async () => {\n await renderSelectPrompt(step.properties as Parameters<typeof renderSelectPrompt>[0])\n }\n case 'textPrompt':\n return async () => {\n await renderTextPrompt(step.properties)\n }\n default:\n throw new Error(`Unknown step type: ${(step as DemoStep).type}`)\n }\n}\n\nfunction taskbarExecutor(steps: {title: string; duration: number}[]) {\n return async () => {\n const tasks = steps.map(({title, duration}) => {\n return {\n title,\n task: async () => sleep(duration),\n }\n })\n await renderTasks(tasks)\n }\n}\n\nfunction concurrentExecutor({processes, footer}: RenderConcurrentProperties) {\n return async () => {\n const concurrentProcesses = processes.map(({prefix, steps}) => {\n return {\n prefix,\n action: async (stdout: Writable) => {\n for (const step of steps) {\n const {startMessage, duration, endMessage} = step\n if (startMessage) stdout.write(startMessage)\n // eslint-disable-next-line no-await-in-loop\n await sleep(duration)\n if (endMessage) stdout.write(endMessage)\n }\n },\n }\n })\n await renderConcurrent({processes: concurrentProcesses, footer})\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"demo.js","sourceRoot":"","sources":["../../../src/cli/services/demo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,QAAQ,EAAC,MAAM,6BAA6B,CAAA;AAChE,OAAO,EAAC,UAAU,EAAC,MAAM,8BAA8B,CAAA;AACvD,OAAO,EAAC,KAAK,EAAC,MAAM,8BAA8B,CAAA;AAClD,OAAO,EACL,gBAAgB,EAChB,UAAU,EACV,aAAa,EACb,WAAW,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AK,CAAC,YAAY,CAAC,CAAA;wBAC5C,4CAA4C;wBAC5C,MAAM,KAAK,CAAC,QAAQ,CAAC,CAAA;wBACrB,IAAI,UAAU;4BAAE,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;qBACzC;gBACH,CAAC;aACF,CAAA;QACH,CAAC,CAAC,CAAA;QACF,MAAM,gBAAgB,CAAC,EAAC,SAAS,EAAE,mBAAmB,EAAE,MAAM,EAAC,CAAC,CAAA;IAClE,CAAC,CAAA;AACH,CAAC","sourcesContent":["import {AbortError, BugError} from '@shopify/cli-kit/node/error'\nimport {outputInfo} from '@shopify/cli-kit/node/output'\nimport {sleep} from '@shopify/cli-kit/node/system'\nimport {\n renderFatalError,\n renderInfo,\n renderSuccess,\n renderTable,\n renderConcurrent,\n renderTasks,\n renderWarning,\n renderAutocompletePrompt,\n renderConfirmationPrompt,\n renderSelectPrompt,\n renderTextPrompt,\n} from '@shopify/cli-kit/node/ui'\nimport {zod} from '@shopify/cli-kit/node/schema'\nimport {Writable} from 'stream'\n\nfunction oneOrMore<T>(singular: zod.ZodType<T>) {\n return zod.union([singular, zod.array(singular)])\n}\nconst scalar = zod.union([zod.string(), zod.number(), zod.boolean(), zod.null(), zod.undefined()])\nconst linkSchema = zod.object({label: zod.string(), url: zod.string()})\nconst inlineTokenSchema = zod.union([\n zod.string(),\n zod.object({command: zod.string()}),\n zod.object({link: linkSchema}),\n zod.object({char: zod.string().length(1)}),\n zod.object({userInput: zod.string()}),\n zod.object({subdued: zod.string()}),\n zod.object({filePath: zod.string()}),\n zod.object({bold: zod.string()}),\n])\nconst headlineTokenSchema = oneOrMore(\n zod.union([\n zod.string(),\n zod.object({command: zod.string()}),\n zod.object({char: zod.string().length(1)}),\n zod.object({userInput: zod.string()}),\n zod.object({subdued: zod.string()}),\n zod.object({filePath: zod.string()}),\n ]),\n)\n// type InlineToken = zod.infer<typeof inlineTokenSchema>\nconst inlineTokenItemSchema = oneOrMore(inlineTokenSchema)\n// type InlineTokenItem = zod.infer<typeof inlineTokenItemSchema>\nconst listSchema = zod.object({\n list: zod.object({\n title: zod.string().optional(),\n items: zod.array(inlineTokenItemSchema),\n ordered: zod.boolean().optional(),\n }),\n})\nconst tokenItemSchema = oneOrMore(zod.union([inlineTokenSchema, listSchema]))\n\nconst tableSchema = zod.object({\n rows: zod.array(zod.object({}).catchall(scalar)),\n columns: zod.object({}).catchall(\n zod.object({\n header: zod.string().optional(),\n color: zod.string().optional(),\n }),\n ),\n})\nconst infoTableSchema = zod.union([\n zod.object({}).catchall(zod.array(inlineTokenItemSchema)),\n zod.array(\n zod.object({\n color: zod.string().optional(),\n header: zod.string(),\n helperText: zod.string().optional(),\n bullet: zod.string().optional(),\n items: zod.array(inlineTokenItemSchema),\n }),\n ),\n])\n\nconst abstractDemoStepSchema = zod.object({\n type: zod.string(),\n properties: zod.object({}),\n // optional properties for documentation purposes\n title: zod.string().optional(),\n description: zod.string().optional(),\n})\n\nconst outputStepSchema = abstractDemoStepSchema.extend({\n type: zod.literal('output'),\n properties: zod.object({\n content: zod.string(),\n }),\n})\ntype OutputStep = zod.infer<typeof outputStepSchema>\n\nconst renderStepPropertiesSchema = zod.object({\n headline: headlineTokenSchema.optional(),\n body: tokenItemSchema.optional(),\n nextSteps: zod.array(inlineTokenItemSchema).optional(),\n reference: zod.array(inlineTokenItemSchema).optional(),\n link: linkSchema.optional(),\n customSections: zod\n .array(\n zod.object({\n title: zod.string().optional(),\n body: tokenItemSchema,\n }),\n )\n .optional(),\n orderedNextSteps: zod.boolean().optional(),\n})\nconst renderInfoStepSchema = abstractDemoStepSchema.extend({\n type: zod.literal('info'),\n properties: renderStepPropertiesSchema,\n})\ntype RenderInfoStep = zod.infer<typeof renderInfoStepSchema>\nconst renderSuccessStepSchema = abstractDemoStepSchema.extend({\n type: zod.literal('success'),\n properties: renderStepPropertiesSchema,\n})\ntype RenderSuccessStep = zod.infer<typeof renderSuccessStepSchema>\nconst renderWarningStepSchema = abstractDemoStepSchema.extend({\n type: zod.literal('warning'),\n properties: renderStepPropertiesSchema,\n})\ntype RenderWarningStep = zod.infer<typeof renderWarningStepSchema>\n\nconst renderFatalErrorStepSchema = abstractDemoStepSchema.extend({\n type: zod.literal('fatalError'),\n properties: zod.object({\n errorType: zod.union([zod.literal('abort'), zod.literal('bug')]),\n message: zod.string(),\n tryMessage: zod.string().optional(),\n nextSteps: zod.array(inlineTokenItemSchema).optional(),\n }),\n})\ntype RenderFatalErrorStep = zod.infer<typeof renderFatalErrorStepSchema>\n\nconst renderTableStepSchema = abstractDemoStepSchema.extend({\n type: zod.literal('table'),\n properties: tableSchema,\n})\ntype RenderTableStep = zod.infer<typeof renderTableStepSchema>\n\nconst renderAutoCompletePromptStepSchema = abstractDemoStepSchema.extend({\n type: zod.literal('autocompletePrompt'),\n properties: zod.object({\n message: zod.string(),\n choices: zod.array(\n zod.object({\n label: zod.string(),\n value: zod.string(),\n }),\n ),\n }),\n})\ntype RenderAutocompletePromptStep = zod.infer<typeof renderAutoCompletePromptStepSchema>\n\nconst renderConfirmationPromptStepSchema = abstractDemoStepSchema.extend({\n type: zod.literal('confirmationPrompt'),\n properties: zod.object({\n message: headlineTokenSchema,\n infoTable: infoTableSchema.optional(),\n gitDiff: zod\n .object({\n baselineContent: zod.string(),\n updatedContent: zod.string(),\n })\n .optional(),\n defaultValue: zod.boolean().optional(),\n confirmationMessage: zod.string(),\n cancellationMessage: zod.string(),\n }),\n})\ntype RenderConfirmationPromptStep = zod.infer<typeof renderConfirmationPromptStepSchema>\n\nconst renderSelectPromptStepSchema = abstractDemoStepSchema.extend({\n type: zod.literal('selectPrompt'),\n properties: zod.object({\n message: headlineTokenSchema,\n choices: zod.array(\n zod.object({\n label: zod.string(),\n value: zod.string(),\n key: zod.string().length(1).optional(),\n group: zod.string().optional(),\n disabled: zod.boolean().optional(),\n }),\n ),\n defaultValue: zod.string().optional(),\n infoTable: infoTableSchema.optional(),\n gitDiff: zod\n .object({\n baselineContent: zod.string(),\n updatedContent: zod.string(),\n })\n .optional(),\n }),\n})\ntype RenderSelectPromptStep = zod.infer<typeof renderSelectPromptStepSchema>\n\nconst renderTextPromptStepSchema = abstractDemoStepSchema.extend({\n type: zod.literal('textPrompt'),\n properties: zod.object({\n message: zod.string(),\n defaultValue: zod.string().optional(),\n password: zod.boolean().optional(),\n allowEmpty: zod.boolean().optional(),\n }),\n})\ntype RenderTextPromptStep = zod.infer<typeof renderTextPromptStepSchema>\n\nconst sleepStepSchema = abstractDemoStepSchema.extend({\n type: zod.literal('sleep'),\n properties: zod.object({\n duration: zod.number(),\n }),\n})\ntype SleepStep = zod.infer<typeof sleepStepSchema>\n\nconst taskbarStepSchema = abstractDemoStepSchema.extend({\n type: zod.literal('taskbar'),\n properties: zod.object({\n steps: zod.array(\n zod.object({\n title: zod.string(),\n duration: zod.number(),\n }),\n ),\n }),\n})\ntype TaskbarStep = zod.infer<typeof taskbarStepSchema>\n\nconst renderConcurrentPropertiesSchema = zod.object({\n processes: zod.array(\n zod.object({\n prefix: zod.string(),\n steps: zod.array(\n zod.object({\n startMessage: zod.string().optional(),\n duration: zod.number(),\n endMessage: zod.string().optional(),\n }),\n ),\n }),\n ),\n footer: zod\n .object({\n shortcuts: zod.array(\n zod.object({\n key: zod.string(),\n action: zod.string(),\n }),\n ),\n subTitle: zod.string().optional(),\n })\n .optional(),\n})\ntype RenderConcurrentProperties = zod.infer<typeof renderConcurrentPropertiesSchema>\nconst renderConcurrentStepSchema = abstractDemoStepSchema.extend({\n type: zod.literal('concurrent'),\n properties: renderConcurrentPropertiesSchema,\n})\ntype RenderConcurrentStep = zod.infer<typeof renderConcurrentStepSchema>\n\nexport type DemoStep =\n | OutputStep\n | RenderInfoStep\n | RenderSuccessStep\n | RenderWarningStep\n | RenderTableStep\n | RenderFatalErrorStep\n | RenderAutocompletePromptStep\n | RenderConfirmationPromptStep\n | RenderSelectPromptStep\n | RenderTextPromptStep\n | SleepStep\n | TaskbarStep\n | RenderConcurrentStep\n\nconst demoStepSchema = zod.discriminatedUnion('type', [\n outputStepSchema,\n renderInfoStepSchema,\n renderSuccessStepSchema,\n renderWarningStepSchema,\n renderTableStepSchema,\n renderFatalErrorStepSchema,\n renderAutoCompletePromptStepSchema,\n renderConfirmationPromptStepSchema,\n renderSelectPromptStepSchema,\n renderTextPromptStepSchema,\n sleepStepSchema,\n taskbarStepSchema,\n renderConcurrentStepSchema,\n])\nexport const demoStepsSchema = zod.object({\n $schema: zod.string().optional(),\n command: zod.string().optional(),\n steps: zod.array(demoStepSchema),\n})\ntype DemoSteps = zod.infer<typeof demoStepsSchema>\n\nexport async function demo(stepsJsonData: DemoSteps) {\n const {steps, command} = demoStepsSchema.parse(stepsJsonData)\n const executors = steps.map(executorForStep)\n\n await simulateTyping(command)\n for (const executor of executors) {\n // eslint-disable-next-line no-await-in-loop\n await executor()\n }\n}\n\nasync function simulateTyping(text?: string) {\n if (!text) return\n\n // eslint-disable-next-line no-console\n console.clear()\n process.stdout.write('$ ')\n const chars = text.split('')\n while (chars.length > 0) {\n const char = chars.shift()!\n process.stdout.write(char)\n // eslint-disable-next-line no-await-in-loop\n await sleep(0.1 + Math.random() / 10)\n }\n process.stdout.write('\\n')\n await sleep(1 + Math.random() / 10)\n}\n\nfunction executorForStep(step: DemoStep): () => Promise<void> {\n switch (step.type) {\n case 'output':\n return async () => {\n outputInfo(step.properties.content)\n }\n case 'sleep':\n return async () => {\n await sleep(step.properties.duration)\n }\n case 'taskbar':\n return taskbarExecutor(step.properties.steps)\n case 'concurrent':\n return concurrentExecutor(step.properties)\n case 'info':\n return async () => {\n renderInfo(step.properties)\n }\n case 'success':\n return async () => {\n renderSuccess(step.properties)\n }\n case 'warning':\n return async () => {\n renderWarning(step.properties)\n }\n case 'fatalError':\n return async () => {\n const {errorType, message, nextSteps, tryMessage} = step.properties\n if (errorType === 'abort') {\n renderFatalError(new AbortError(message, tryMessage, nextSteps))\n } else {\n renderFatalError(new BugError(message, tryMessage))\n }\n }\n case 'table':\n return async () => {\n renderTable(step.properties as Parameters<typeof renderTable>[0])\n }\n case 'autocompletePrompt':\n return async () => {\n await renderAutocompletePrompt(step.properties)\n }\n case 'confirmationPrompt':\n return async () => {\n await renderConfirmationPrompt(step.properties as Parameters<typeof renderConfirmationPrompt>[0])\n }\n case 'selectPrompt':\n return async () => {\n await renderSelectPrompt(step.properties as Parameters<typeof renderSelectPrompt>[0])\n }\n case 'textPrompt':\n return async () => {\n await renderTextPrompt(step.properties)\n }\n default:\n throw new Error(`Unknown step type: ${(step as DemoStep).type}`)\n }\n}\n\nfunction taskbarExecutor(steps: {title: string; duration: number}[]) {\n return async () => {\n const tasks = steps.map(({title, duration}) => {\n return {\n title,\n task: async () => sleep(duration),\n }\n })\n await renderTasks(tasks)\n }\n}\n\nfunction concurrentExecutor({processes, footer}: RenderConcurrentProperties) {\n return async () => {\n const concurrentProcesses = processes.map(({prefix, steps}) => {\n return {\n prefix,\n action: async (stdout: Writable) => {\n for (const step of steps) {\n const {startMessage, duration, endMessage} = step\n if (startMessage) stdout.write(startMessage)\n // eslint-disable-next-line no-await-in-loop\n await sleep(duration)\n if (endMessage) stdout.write(endMessage)\n }\n },\n }\n })\n await renderConcurrent({processes: concurrentProcesses, footer})\n }\n}\n"]}
|
|
@@ -1,38 +1,33 @@
|
|
|
1
|
-
import { renderAutocompletePrompt, renderConfirmationPrompt, renderSelectPrompt, renderTextPrompt, } from '@shopify/cli-kit/node/ui';
|
|
1
|
+
import { renderAutocompletePrompt, renderConfirmationPrompt, renderSelectPrompt, renderTextPrompt, renderDangerousConfirmationPrompt, } from '@shopify/cli-kit/node/ui';
|
|
2
|
+
import figures from '@shopify/cli-kit/node/figures';
|
|
2
3
|
export async function prompts() {
|
|
3
4
|
// renderSelectPrompt
|
|
4
5
|
await renderSelectPrompt({
|
|
5
6
|
message: 'Associate your project with the org Castile Ventures?',
|
|
6
7
|
choices: [
|
|
7
|
-
{ label: 'first', value: 'first',
|
|
8
|
-
{ label: 'second', value: 'second'
|
|
8
|
+
{ label: 'first', value: 'first', disabled: true },
|
|
9
|
+
{ label: 'second', value: 'second' },
|
|
9
10
|
{ label: 'third (limit reached)', value: 'third', disabled: true },
|
|
10
11
|
{ label: 'fourth (limit reached)', value: 'fourth', disabled: true },
|
|
11
|
-
{ label: 'fifth', value: 'fifth', group: 'Automations',
|
|
12
|
+
{ label: 'fifth', value: 'fifth', group: 'Automations', disabled: true },
|
|
12
13
|
{ label: 'sixth', value: 'sixth', group: 'Automations' },
|
|
13
14
|
{ label: 'seventh', value: 'seventh' },
|
|
14
15
|
{ label: 'eighth (limit reached)', value: 'eighth', group: 'Merchant Admin', disabled: true },
|
|
15
16
|
{ label: 'ninth', value: 'ninth', group: 'Merchant Admin' },
|
|
16
17
|
{ label: 'tenth', value: 'tenth' },
|
|
17
18
|
],
|
|
18
|
-
infoTable:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
{
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
{ label: 'seventh', value: 'seventh' },
|
|
30
|
-
{ label: 'eighth (limit reached)', value: 'eighth', group: 'Merchant Admin', disabled: true },
|
|
31
|
-
{ label: 'ninth', value: 'ninth', group: 'Merchant Admin' },
|
|
32
|
-
{ label: 'tenth', value: 'tenth' },
|
|
19
|
+
infoTable: [
|
|
20
|
+
{
|
|
21
|
+
header: 'add',
|
|
22
|
+
items: ['new-ext'],
|
|
23
|
+
bullet: '+',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
header: 'remove',
|
|
27
|
+
items: ['integrated-demand-ext', 'order-discount'],
|
|
28
|
+
bullet: '-',
|
|
29
|
+
},
|
|
33
30
|
],
|
|
34
|
-
infoTable: { add: ['new-ext'], remove: ['integrated-demand-ext', 'order-discount'] },
|
|
35
|
-
submitWithShortcuts: true,
|
|
36
31
|
});
|
|
37
32
|
// renderTextPrompt
|
|
38
33
|
await renderTextPrompt({
|
|
@@ -125,9 +120,17 @@ export async function prompts() {
|
|
|
125
120
|
cancellationMessage: 'Cancel',
|
|
126
121
|
};
|
|
127
122
|
await renderConfirmationPrompt(options);
|
|
123
|
+
const infoMessage = {
|
|
124
|
+
title: {
|
|
125
|
+
color: 'red',
|
|
126
|
+
text: `${figures.warning} This can't be undone.`,
|
|
127
|
+
},
|
|
128
|
+
body: 'The action you are executing should be confirmed to proceed.',
|
|
129
|
+
};
|
|
128
130
|
const dangerousPromptOptions = {
|
|
129
131
|
message: `Delete the following themes from the store?`,
|
|
130
132
|
infoTable: { '': themes },
|
|
133
|
+
infoMessage,
|
|
131
134
|
confirmationMessage: 'Yes, delete them',
|
|
132
135
|
cancellationMessage: 'Cancel',
|
|
133
136
|
defaultValue: false,
|
|
@@ -164,5 +167,27 @@ ANOTHER_VARIABLE="1706e3c332432rd41343dfcf18fa282125ab"`;
|
|
|
164
167
|
confirmationMessage: 'Yes, confirm changes',
|
|
165
168
|
cancellationMessage: 'No, make changes later',
|
|
166
169
|
});
|
|
170
|
+
// renderTextPrompt with dangerous confirmation
|
|
171
|
+
await renderDangerousConfirmationPrompt({
|
|
172
|
+
message: 'Release this version of Mega App?',
|
|
173
|
+
infoTable: [
|
|
174
|
+
{
|
|
175
|
+
header: 'Includes',
|
|
176
|
+
items: [
|
|
177
|
+
'My subscription extension',
|
|
178
|
+
'Order discount function',
|
|
179
|
+
'Subscription cancelled trigger',
|
|
180
|
+
'Add subscription action',
|
|
181
|
+
],
|
|
182
|
+
bullet: '+',
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
header: 'Removes',
|
|
186
|
+
items: ['product-discount-function', 'product-subscription-extension'],
|
|
187
|
+
bullet: '-',
|
|
188
|
+
},
|
|
189
|
+
],
|
|
190
|
+
confirmation: 'Mega App',
|
|
191
|
+
});
|
|
167
192
|
}
|
|
168
193
|
//# sourceMappingURL=prompts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../../../src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F;QACD;YACE,cAAc;YACd;gBACE,OAAO,EAAE,KAAK,CAAC,GAAG;aACnB;SACF;KACF,CAAA;IAED,2BAA2B;IAC3B,MAAM,OAAO,GAAG;QACd,OAAO,EAAE,wCAAwC;QACjD,SAAS,EAAE,EAAC,EAAE,EAAE,MAAM,EAAC;QACvB,mBAAmB,EAAE,eAAe;QACpC,mBAAmB,EAAE,QAAQ;KAC9B,CAAA;IAED,MAAM,wBAAwB,CAAC,OAAO,CAAC,CAAA;IAEvC,MAAM,sBAAsB,GAAG;QAC7B,OAAO,EAAE,6CAA6C;QACtD,SAAS,EAAE,EAAC,EAAE,EAAE,MAAM,EAAC;QACvB,mBAAmB,EAAE,kBAAkB;QACvC,mBAAmB,EAAE,QAAQ;QAC7B,YAAY,EAAE,KAAK;KACpB,CAAA;IAED,MAAM,wBAAwB,CAAC,sBAAsB,CAAC,CAAA;IAEtD,MAAM,eAAe,GAAG;;;;;;;;;wDAS8B,CAAA;IACtD,MAAM,cAAc,GAAG;;;;;;;;;;wDAU+B,CAAA;IAEtD,MAAM,wBAAwB,CAAC;QAC7B,OAAO,EAAE,CAAC,oCAAoC,EAAE,EAAC,QAAQ,EAAE,MAAM,EAAC,EAAE,OAAO,CAAC;QAC5E,OAAO,EAAE;YACP,eAAe;YACf,cAAc;SACf;QACD,YAAY,EAAE,IAAI;QAClB,mBAAmB,EAAE,sBAAsB;QAC3C,mBAAmB,EAAE,wBAAwB;KAC9C,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import {\n renderAutocompletePrompt,\n renderConfirmationPrompt,\n renderSelectPrompt,\n renderTextPrompt,\n} from '@shopify/cli-kit/node/ui'\n\nexport async function prompts() {\n // renderSelectPrompt\n await renderSelectPrompt({\n message: 'Associate your project with the org Castile Ventures?',\n choices: [\n {label: 'first', value: 'first', key: 'f', disabled: true},\n {label: 'second', value: 'second', key: 's'},\n {label: 'third (limit reached)', value: 'third', disabled: true},\n {label: 'fourth (limit reached)', value: 'fourth', disabled: true},\n {label: 'fifth', value: 'fifth', group: 'Automations', key: 'a', disabled: true},\n {label: 'sixth', value: 'sixth', group: 'Automations'},\n {label: 'seventh', value: 'seventh'},\n {label: 'eighth (limit reached)', value: 'eighth', group: 'Merchant Admin', disabled: true},\n {label: 'ninth', value: 'ninth', group: 'Merchant Admin'},\n {label: 'tenth', value: 'tenth'},\n ],\n infoTable: {add: ['new-ext'], remove: ['integrated-demand-ext', 'order-discount']},\n })\n\n await renderSelectPrompt({\n message: 'Associate your project with the org Castile Ventures? (using a shortcut will submit)',\n choices: [\n {label: 'first', value: 'first', key: 'f'},\n {label: 'second', value: 'second', key: 's'},\n {label: 'third (limit reached)', value: 'third', disabled: true},\n {label: 'fourth (limit reached)', value: 'fourth', disabled: true},\n {label: 'fifth', value: 'fifth', group: 'Automations', key: 'a'},\n {label: 'sixth', value: 'sixth', group: 'Automations'},\n {label: 'seventh', value: 'seventh'},\n {label: 'eighth (limit reached)', value: 'eighth', group: 'Merchant Admin', disabled: true},\n {label: 'ninth', value: 'ninth', group: 'Merchant Admin'},\n {label: 'tenth', value: 'tenth'},\n ],\n infoTable: {add: ['new-ext'], remove: ['integrated-demand-ext', 'order-discount']},\n submitWithShortcuts: true,\n })\n\n // renderTextPrompt\n await renderTextPrompt({\n message: 'App project name (can be changed later)',\n defaultValue: 'expansive commerce app',\n validate: (value) => {\n if (value.includes('shopify')) return 'Can\\'t include \"shopify\" in the name'\n },\n })\n\n // renderAutocompletePrompt\n const database = [\n {label: 'first', value: 'first'},\n {label: 'second', value: 'second'},\n {label: 'third', value: 'third'},\n {label: 'fourth', value: 'fourth'},\n {label: 'fifth', value: 'fifth'},\n {label: 'sixth', value: 'sixth'},\n {label: 'seventh', value: 'seventh'},\n {label: 'eighth', value: 'eighth'},\n {label: 'ninth', value: 'ninth'},\n {label: 'tenth', value: 'tenth'},\n {label: 'eleventh', value: 'eleventh'},\n {label: 'twelfth', value: 'twelfth'},\n {label: 'thirteenth', value: 'thirteenth'},\n {label: 'fourteenth', value: 'fourteenth'},\n {label: 'fifteenth', value: 'fifteenth'},\n {label: 'sixteenth', value: 'sixteenth'},\n {label: 'seventeenth', value: 'seventeenth'},\n {label: 'eighteenth', value: 'eighteenth'},\n {label: 'nineteenth', value: 'nineteenth'},\n {label: 'twentieth', value: 'twentieth'},\n {label: 'twenty-first', value: 'twenty-first'},\n {label: 'twenty-second', value: 'twenty-second'},\n {label: 'twenty-third', value: 'twenty-third'},\n {label: 'twenty-fourth', value: 'twenty-fourth'},\n {label: 'twenty-fifth', value: 'twenty-fifth'},\n {label: 'twenty-sixth', value: 'twenty-sixth'},\n {label: 'twenty-seventh', value: 'twenty-seventh'},\n {label: 'twenty-eighth', value: 'twenty-eighth'},\n {label: 'twenty-ninth', value: 'twenty-ninth'},\n {label: 'thirtieth', value: 'thirtieth'},\n {label: 'thirty-first', value: 'thirty-first'},\n {label: 'thirty-second', value: 'thirty-second'},\n {label: 'thirty-third', value: 'thirty-third'},\n {label: 'thirty-fourth', value: 'thirty-fourth'},\n {label: 'thirty-fifth', value: 'thirty-fifth'},\n {label: 'thirty-sixth', value: 'thirty-sixth'},\n {label: 'thirty-seventh', value: 'thirty-seventh'},\n {label: 'thirty-eighth', value: 'thirty-eighth'},\n {label: 'thirty-ninth', value: 'thirty-ninth'},\n {label: 'fortieth', value: 'fortieth'},\n {label: 'forty-first', value: 'forty-first'},\n {label: 'forty-second', value: 'forty-second'},\n {label: 'forty-third', value: 'forty-third'},\n {label: 'forty-fourth', value: 'forty-fourth'},\n {label: 'forty-fifth', value: 'forty-fifth'},\n {label: 'forty-sixth', value: 'forty-sixth'},\n {label: 'forty-seventh', value: 'forty-seventh'},\n {label: 'forty-eighth', value: 'forty-eighth'},\n {label: 'forty-ninth', value: 'forty-ninth'},\n {label: 'fiftieth', value: 'fiftieth'},\n ]\n\n await renderAutocompletePrompt({\n message: 'Template',\n choices: database,\n search(term: string) {\n return Promise.resolve({data: database.filter((item) => item.label.includes(term))})\n },\n })\n\n const themes = [\n [\n 'first theme',\n {\n subdued: `(#${1})`,\n },\n ],\n [\n 'second theme',\n {\n subdued: `(#${2})`,\n },\n ],\n ]\n\n // renderConfirmationPrompt\n const options = {\n message: `Add the following themes to the store?`,\n infoTable: {'': themes},\n confirmationMessage: 'Yes, add them',\n cancellationMessage: 'Cancel',\n }\n\n await renderConfirmationPrompt(options)\n\n const dangerousPromptOptions = {\n message: `Delete the following themes from the store?`,\n infoTable: {'': themes},\n confirmationMessage: 'Yes, delete them',\n cancellationMessage: 'Cancel',\n defaultValue: false,\n }\n\n await renderConfirmationPrompt(dangerousPromptOptions)\n\n const baselineContent = `PUBLIC_STOREFRONT_ID=\"51242144\"\nPUBLIC_STOREFRONT_API_TOKEN=\"54851233448511\"\nCONTENTFUL_API_KEY=\"1706e3c3190ee8a71cd41343dfcf18fa282125ab\"\nfiller1\nfiller2\nfiller3\nfiller4\nfiller5\nPUBLIC_STORE_DOMAIN=\"hydrogen-preview.myshopify.com\"\nANOTHER_VARIABLE=\"1706e3c332432rd41343dfcf18fa282125ab\"`\n const updatedContent = `PUBLIC STOREFRONT ID=\"40863422\"\nPUBLIC_STOREFRONT_API_TOKEN=\"72b7532439ae17c24c16e587d6cc9325e5\"\nCONTENTFUL_API_KEY=\"1706e3c3190ee8a71cd41343dfcf18fa282125ab\"\nfiller1\nfiller2\nfiller3\nfiller4\nfiller5\nPUBLIC_STORE_DOMAIN=\"snowdevil-production.myshopify.com\"\nPRIVATE_STOREFRONT_API_TOKEN-\"shpat_2257475ad5ddjfhef8db4355e5fc2011\"\nANOTHER_VARIABLE=\"1706e3c332432rd41343dfcf18fa282125ab\"`\n\n await renderConfirmationPrompt({\n message: ['Make the following changes to your', {filePath: '.env'}, 'file?'],\n gitDiff: {\n baselineContent,\n updatedContent,\n },\n defaultValue: true,\n confirmationMessage: 'Yes, confirm changes',\n cancellationMessage: 'No, make changes later',\n })\n}\n"]}
|
|
1
|
+
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../../../src/cli/services/kitchen-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AE,sBAAsB;QAC3C,mBAAmB,EAAE,wBAAwB;KAC9C,CAAC,CAAA;IAEF,+CAA+C;IAC/C,MAAM,iCAAiC,CAAC;QACtC,OAAO,EAAE,mCAAmC;QAC5C,SAAS,EAAE;YACT;gBACE,MAAM,EAAE,UAAU;gBAClB,KAAK,EAAE;oBACL,2BAA2B;oBAC3B,yBAAyB;oBACzB,gCAAgC;oBAChC,yBAAyB;iBAC1B;gBACD,MAAM,EAAE,GAAG;aACZ;YACD;gBACE,MAAM,EAAE,SAAS;gBACjB,KAAK,EAAE,CAAC,2BAA2B,EAAE,gCAAgC,CAAC;gBACtE,MAAM,EAAE,GAAG;aACZ;SACF;QACD,YAAY,EAAE,UAAU;KACzB,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import {\n renderAutocompletePrompt,\n renderConfirmationPrompt,\n renderSelectPrompt,\n renderTextPrompt,\n renderDangerousConfirmationPrompt,\n} from '@shopify/cli-kit/node/ui'\nimport figures from '@shopify/cli-kit/node/figures'\n\nexport async function prompts() {\n // renderSelectPrompt\n await renderSelectPrompt({\n message: 'Associate your project with the org Castile Ventures?',\n choices: [\n {label: 'first', value: 'first', disabled: true},\n {label: 'second', value: 'second'},\n {label: 'third (limit reached)', value: 'third', disabled: true},\n {label: 'fourth (limit reached)', value: 'fourth', disabled: true},\n {label: 'fifth', value: 'fifth', group: 'Automations', disabled: true},\n {label: 'sixth', value: 'sixth', group: 'Automations'},\n {label: 'seventh', value: 'seventh'},\n {label: 'eighth (limit reached)', value: 'eighth', group: 'Merchant Admin', disabled: true},\n {label: 'ninth', value: 'ninth', group: 'Merchant Admin'},\n {label: 'tenth', value: 'tenth'},\n ],\n infoTable: [\n {\n header: 'add',\n items: ['new-ext'],\n bullet: '+',\n },\n {\n header: 'remove',\n items: ['integrated-demand-ext', 'order-discount'],\n bullet: '-',\n },\n ],\n })\n\n // renderTextPrompt\n await renderTextPrompt({\n message: 'App project name (can be changed later)',\n defaultValue: 'expansive commerce app',\n validate: (value) => {\n if (value.includes('shopify')) return 'Can\\'t include \"shopify\" in the name'\n },\n })\n\n // renderAutocompletePrompt\n const database = [\n {label: 'first', value: 'first'},\n {label: 'second', value: 'second'},\n {label: 'third', value: 'third'},\n {label: 'fourth', value: 'fourth'},\n {label: 'fifth', value: 'fifth'},\n {label: 'sixth', value: 'sixth'},\n {label: 'seventh', value: 'seventh'},\n {label: 'eighth', value: 'eighth'},\n {label: 'ninth', value: 'ninth'},\n {label: 'tenth', value: 'tenth'},\n {label: 'eleventh', value: 'eleventh'},\n {label: 'twelfth', value: 'twelfth'},\n {label: 'thirteenth', value: 'thirteenth'},\n {label: 'fourteenth', value: 'fourteenth'},\n {label: 'fifteenth', value: 'fifteenth'},\n {label: 'sixteenth', value: 'sixteenth'},\n {label: 'seventeenth', value: 'seventeenth'},\n {label: 'eighteenth', value: 'eighteenth'},\n {label: 'nineteenth', value: 'nineteenth'},\n {label: 'twentieth', value: 'twentieth'},\n {label: 'twenty-first', value: 'twenty-first'},\n {label: 'twenty-second', value: 'twenty-second'},\n {label: 'twenty-third', value: 'twenty-third'},\n {label: 'twenty-fourth', value: 'twenty-fourth'},\n {label: 'twenty-fifth', value: 'twenty-fifth'},\n {label: 'twenty-sixth', value: 'twenty-sixth'},\n {label: 'twenty-seventh', value: 'twenty-seventh'},\n {label: 'twenty-eighth', value: 'twenty-eighth'},\n {label: 'twenty-ninth', value: 'twenty-ninth'},\n {label: 'thirtieth', value: 'thirtieth'},\n {label: 'thirty-first', value: 'thirty-first'},\n {label: 'thirty-second', value: 'thirty-second'},\n {label: 'thirty-third', value: 'thirty-third'},\n {label: 'thirty-fourth', value: 'thirty-fourth'},\n {label: 'thirty-fifth', value: 'thirty-fifth'},\n {label: 'thirty-sixth', value: 'thirty-sixth'},\n {label: 'thirty-seventh', value: 'thirty-seventh'},\n {label: 'thirty-eighth', value: 'thirty-eighth'},\n {label: 'thirty-ninth', value: 'thirty-ninth'},\n {label: 'fortieth', value: 'fortieth'},\n {label: 'forty-first', value: 'forty-first'},\n {label: 'forty-second', value: 'forty-second'},\n {label: 'forty-third', value: 'forty-third'},\n {label: 'forty-fourth', value: 'forty-fourth'},\n {label: 'forty-fifth', value: 'forty-fifth'},\n {label: 'forty-sixth', value: 'forty-sixth'},\n {label: 'forty-seventh', value: 'forty-seventh'},\n {label: 'forty-eighth', value: 'forty-eighth'},\n {label: 'forty-ninth', value: 'forty-ninth'},\n {label: 'fiftieth', value: 'fiftieth'},\n ]\n\n await renderAutocompletePrompt({\n message: 'Template',\n choices: database,\n search(term: string) {\n return Promise.resolve({data: database.filter((item) => item.label.includes(term))})\n },\n })\n\n const themes = [\n [\n 'first theme',\n {\n subdued: `(#${1})`,\n },\n ],\n [\n 'second theme',\n {\n subdued: `(#${2})`,\n },\n ],\n ]\n\n // renderConfirmationPrompt\n const options = {\n message: `Add the following themes to the store?`,\n infoTable: {'': themes},\n confirmationMessage: 'Yes, add them',\n cancellationMessage: 'Cancel',\n }\n\n await renderConfirmationPrompt(options)\n\n const infoMessage = {\n title: {\n color: 'red',\n text: `${figures.warning} This can't be undone.`,\n },\n body: 'The action you are executing should be confirmed to proceed.',\n }\n\n const dangerousPromptOptions = {\n message: `Delete the following themes from the store?`,\n infoTable: {'': themes},\n infoMessage,\n confirmationMessage: 'Yes, delete them',\n cancellationMessage: 'Cancel',\n defaultValue: false,\n }\n\n await renderConfirmationPrompt(dangerousPromptOptions)\n\n const baselineContent = `PUBLIC_STOREFRONT_ID=\"51242144\"\nPUBLIC_STOREFRONT_API_TOKEN=\"54851233448511\"\nCONTENTFUL_API_KEY=\"1706e3c3190ee8a71cd41343dfcf18fa282125ab\"\nfiller1\nfiller2\nfiller3\nfiller4\nfiller5\nPUBLIC_STORE_DOMAIN=\"hydrogen-preview.myshopify.com\"\nANOTHER_VARIABLE=\"1706e3c332432rd41343dfcf18fa282125ab\"`\n const updatedContent = `PUBLIC STOREFRONT ID=\"40863422\"\nPUBLIC_STOREFRONT_API_TOKEN=\"72b7532439ae17c24c16e587d6cc9325e5\"\nCONTENTFUL_API_KEY=\"1706e3c3190ee8a71cd41343dfcf18fa282125ab\"\nfiller1\nfiller2\nfiller3\nfiller4\nfiller5\nPUBLIC_STORE_DOMAIN=\"snowdevil-production.myshopify.com\"\nPRIVATE_STOREFRONT_API_TOKEN-\"shpat_2257475ad5ddjfhef8db4355e5fc2011\"\nANOTHER_VARIABLE=\"1706e3c332432rd41343dfcf18fa282125ab\"`\n\n await renderConfirmationPrompt({\n message: ['Make the following changes to your', {filePath: '.env'}, 'file?'],\n gitDiff: {\n baselineContent,\n updatedContent,\n },\n defaultValue: true,\n confirmationMessage: 'Yes, confirm changes',\n cancellationMessage: 'No, make changes later',\n })\n\n // renderTextPrompt with dangerous confirmation\n await renderDangerousConfirmationPrompt({\n message: 'Release this version of Mega App?',\n infoTable: [\n {\n header: 'Includes',\n items: [\n 'My subscription extension',\n 'Order discount function',\n 'Subscription cancelled trigger',\n 'Add subscription action',\n ],\n bullet: '+',\n },\n {\n header: 'Removes',\n items: ['product-discount-function', 'product-subscription-extension'],\n bullet: '-',\n },\n ],\n confirmation: 'Mega App',\n })\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AbortError, BugError } from '@shopify/cli-kit/node/error';
|
|
2
|
-
import { renderFatalError, renderInfo, renderSuccess, renderTable, renderWarning } from '@shopify/cli-kit/node/ui';
|
|
2
|
+
import { renderError, renderFatalError, renderInfo, renderSuccess, renderTable, renderWarning, } from '@shopify/cli-kit/node/ui';
|
|
3
3
|
export async function staticService() {
|
|
4
4
|
// Banners
|
|
5
5
|
renderInfo({
|
|
@@ -144,6 +144,10 @@ export async function staticService() {
|
|
|
144
144
|
],
|
|
145
145
|
];
|
|
146
146
|
renderFatalError(new AbortError('No Organization found', undefined, nextSteps));
|
|
147
|
+
renderError({
|
|
148
|
+
headline: "Version couldn't be released.",
|
|
149
|
+
body: 'This version needs to be submitted for review and approved by Shopify before it can be released.',
|
|
150
|
+
});
|
|
147
151
|
renderTable({
|
|
148
152
|
rows: [
|
|
149
153
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"static.js","sourceRoot":"","sources":["../../../../src/cli/services/kitchen-sink/static.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,QAAQ,EAAC,MAAM,6BAA6B,CAAA;AAChE,OAAO,
|
|
1
|
+
{"version":3,"file":"static.js","sourceRoot":"","sources":["../../../../src/cli/services/kitchen-sink/static.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,QAAQ,EAAC,MAAM,6BAA6B,CAAA;AAChE,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,UAAU,EACV,aAAa,EACb,WAAW,EACX,aAAa,GACd,MAAM,0BAA0B,CAAA;AAEjC,MAAM,CAAC,KAAK,UAAU,aAAa;IACjC,UAAU;IACV,UAAU,CAAC;QACT,QAAQ,EAAE,uBAAuB;QACjC,IAAI,EAAE,CAAC,KAAK,EAAE,EAAC,OAAO,EAAE,yBAAyB,EAAC,EAAE,EAAC,IAAI,EAAE,GAAG,EAAC,CAAC;KACjE,CAAC,CAAA;IAEF,UAAU,CAAC;QACT,QAAQ,EAAE;YACR,wDAAwD;YACxD,EAAC,QAAQ,EAAE,8BAA8B,EAAC;YAC1C,EAAC,IAAI,EAAE,GAAG,EAAC;SACZ;QACD,IAAI,EAAE;YACJ,uCAAuC;YACvC;gBACE,IAAI,EAAE;oBACJ,KAAK,EAAE;wBACL,CAAC,KAAK,EAAE,EAAC,OAAO,EAAE,yBAAyB,EAAC,CAAC;wBAC7C,CAAC,KAAK,EAAE,EAAC,OAAO,EAAE,gBAAgB,EAAC,CAAC;qBACrC;iBACF;aACF;SACF;KACF,CAAC,CAAA;IAEF,UAAU,CAAC;QACT,QAAQ,EAAE,CAAC,EAAC,SAAS,EAAE,QAAQ,EAAC,EAAE,iCAAiC,CAAC;QACpE,SAAS,EAAE;YACT;gBACE,KAAK;gBACL;oBACE,OAAO,EAAE,qBA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'@shopify/cli-kit/node/error'\nimport {\n renderError,\n renderFatalError,\n renderInfo,\n renderSuccess,\n renderTable,\n renderWarning,\n} from '@shopify/cli-kit/node/ui'\n\nexport async function staticService() {\n // Banners\n renderInfo({\n headline: 'CLI update available.',\n body: ['Run', {command: 'npm run shopify upgrade'}, {char: '.'}],\n })\n\n renderInfo({\n headline: [\n 'To connect this project to your shopify store cd into:',\n {filePath: '/my-store/hydrogen.config.js'},\n {char: '.'},\n ],\n body: [\n 'You can also try the following steps:',\n {\n list: {\n items: [\n ['Run', {command: 'shopify project connect'}],\n ['Run', {command: 'hydrogen start'}],\n ],\n },\n },\n ],\n })\n\n renderInfo({\n headline: [{userInput: 'my-app'}, 'initialized and ready to build.'],\n nextSteps: [\n [\n 'Run',\n {\n command: 'cd verification-app',\n },\n ],\n [\n 'To preview your project, run',\n {\n command: 'npm app dev',\n },\n ],\n [\n 'To add extensions, run',\n {\n command: 'npm generate extension',\n },\n ],\n ],\n reference: [\n [\n 'Run',\n {\n command: 'npm shopify help',\n },\n ],\n {\n link: {\n label: 'Dev docs',\n url: 'https://shopify.dev',\n },\n },\n ],\n customSections: [\n {\n title: 'Custom section',\n body: {\n list: {\n items: [{link: {label: 'Item 1', url: 'https://shopify.com'}}, 'Item 2'],\n },\n },\n },\n {\n title: 'Custom section 2',\n body: {\n list: {\n items: ['Item 1', 'Item 2', 'Item 3'],\n },\n },\n },\n ],\n })\n\n renderSuccess({\n headline: 'CLI updated.',\n body: 'You are now running version 3.47.',\n })\n\n renderSuccess({\n headline: 'Deployment successful.',\n body: 'Your extensions have been uploaded to your Shopify Partners Dashboard.',\n nextSteps: [\n {\n link: {\n label: 'See your deployment and set it live',\n url: 'https://partners.shopify.com/1797046/apps/4523695/deployments',\n },\n },\n ],\n })\n\n renderWarning({\n headline: 'You have reached your limit of checkout extensions for this app.',\n body: 'You can free up space for a new one by deleting an existing one.',\n })\n\n renderWarning({\n headline: 'Required access scope update.',\n body: 'The deadline for re-selecting your app scopes is May 1, 2022.',\n reference: [\n {\n link: {\n label: 'Dev docs',\n url: 'https://shopify.dev/app/scopes',\n },\n },\n ],\n })\n\n // Stack trace\n const somethingWentWrong = new BugError('Something went wrong.')\n\n somethingWentWrong.stack = `\n Error: Unexpected error\n at Module._compile (internal/modules/cjs/loader.js:1137:30)\n at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)\n at Module.load (internal/modules/cjs/loader.js:985:32)\n at Function.Module._load (internal/modules/cjs/loader.js:878:14)\n`\n\n renderFatalError(somethingWentWrong)\n\n // Next Steps\n const nextSteps = [\n [\n 'Have you',\n {\n link: {\n label: 'created a Shopify Partners organization',\n url: 'https://partners.shopify.com/signup',\n },\n },\n {\n char: '?',\n },\n ],\n 'Have you confirmed your accounts from the emails you received?',\n [\n 'Need to connect to a different App or organization? Run the command again with',\n {\n command: '--reset',\n },\n ],\n ]\n\n renderFatalError(new AbortError('No Organization found', undefined, nextSteps))\n\n renderError({\n headline: \"Version couldn't be released.\",\n body: 'This version needs to be submitted for review and approved by Shopify before it can be released.',\n })\n\n renderTable({\n rows: [\n {\n id: '1',\n name: 'John Doe',\n email: 'jon@doe.com',\n },\n {\n id: '2',\n name: 'Jane Doe',\n email: 'jane@doe.com',\n },\n {\n id: '3',\n name: 'John Smith',\n email: 'jon@smith.com',\n },\n ],\n columns: {\n id: {\n header: 'ID',\n color: 'red',\n },\n name: {\n header: 'Name',\n color: 'dim',\n },\n email: {},\n },\n })\n}\n"]}
|