@shopify/create-app 3.58.2 → 3.59.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.
Files changed (82) hide show
  1. package/dist/chunk-3JLUTHGR.js +114 -0
  2. package/dist/chunk-3JNB3A7C.js +14080 -0
  3. package/dist/chunk-6IZ3YCE6.js +144 -0
  4. package/dist/chunk-7XQTD3L4.js +213522 -0
  5. package/dist/chunk-DJYDRQPG.js +30996 -0
  6. package/dist/chunk-DY2DAXN2.js +104 -0
  7. package/dist/chunk-F6KQQF76.js +7817 -0
  8. package/dist/chunk-FBB6KUZG.js +821 -0
  9. package/dist/chunk-G6FN5VUE.js +102 -0
  10. package/dist/chunk-GXPKATXW.js +194 -0
  11. package/dist/chunk-HCBGYFVF.js +99 -0
  12. package/dist/chunk-IL6UMTVA.js +62 -0
  13. package/dist/chunk-LKGDG6WW.js +87 -0
  14. package/dist/chunk-M63RTPGR.js +63 -0
  15. package/dist/chunk-OFS45IA7.js +2468 -0
  16. package/dist/chunk-P4TVG45N.js +900 -0
  17. package/dist/chunk-SSNXQGVF.js +11 -0
  18. package/dist/chunk-TDBGZYDD.js +45349 -0
  19. package/dist/chunk-TMGCRPEZ.js +4283 -0
  20. package/dist/chunk-UVY6LL5H.js +145 -0
  21. package/dist/chunk-VJ2TN2CW.js +72 -0
  22. package/dist/chunk-WCNR75S2.js +73 -0
  23. package/dist/chunk-WETZUTXU.js +18914 -0
  24. package/dist/chunk-WK5TEOA2.js +37 -0
  25. package/dist/chunk-X4SHWSZZ.js +3179 -0
  26. package/dist/chunk-YJIQMGQH.js +13764 -0
  27. package/dist/chunk-YLEF4RUH.js +144 -0
  28. package/dist/chunk-ZPB26OWQ.js +5605 -0
  29. package/dist/commands/init.js +31 -123
  30. package/dist/commands/init.test.js +123 -0
  31. package/dist/constants-K3R4N3N3.js +19 -0
  32. package/dist/custom-oclif-loader-2S5LB2FS.js +83 -0
  33. package/dist/del-A5YM6R3Y.js +2846 -0
  34. package/dist/devtools-KQM4GF6J.js +3685 -0
  35. package/dist/error-handler-N3GIE2DS.js +34 -0
  36. package/dist/hooks/postrun.js +108 -2
  37. package/dist/hooks/prerun.js +77 -2
  38. package/dist/index.js +22 -7
  39. package/dist/lib-76JUGQYQ.js +8 -0
  40. package/dist/local-NYXQXMB7.js +59 -0
  41. package/dist/magic-string.es-6WMSFIAX.js +1291 -0
  42. package/dist/multipart-parser-O2BQODS2.js +359 -0
  43. package/dist/node-package-manager-3J3VEQCR.js +68 -0
  44. package/dist/open-B7XFJJCK.js +290 -0
  45. package/dist/out-JZ52TJE3.js +5 -0
  46. package/dist/path-HO4HBKK5.js +28 -0
  47. package/dist/prompts/init.js +23 -118
  48. package/dist/prompts/init.test.js +115 -0
  49. package/dist/services/init.js +25 -139
  50. package/dist/services/init.test.js +18 -0
  51. package/dist/system-5VPAJEUM.js +25 -0
  52. package/dist/ui-D34IKHO6.js +49 -0
  53. package/dist/utils/template/cleanup.js +18 -19
  54. package/dist/utils/template/cleanup.test.js +74 -0
  55. package/dist/utils/template/npm.js +22 -58
  56. package/dist/utils/template/npm.test.js +153 -0
  57. package/dist/yoga.wasm +0 -0
  58. package/oclif.manifest.json +1 -1
  59. package/package.json +5 -6
  60. package/dist/commands/init.d.ts +0 -20
  61. package/dist/commands/init.js.map +0 -1
  62. package/dist/constants.d.ts +0 -1
  63. package/dist/constants.js +0 -2
  64. package/dist/constants.js.map +0 -1
  65. package/dist/hooks/postrun.d.ts +0 -1
  66. package/dist/hooks/postrun.js.map +0 -1
  67. package/dist/hooks/prerun.d.ts +0 -1
  68. package/dist/hooks/prerun.js.map +0 -1
  69. package/dist/index.d.ts +0 -2
  70. package/dist/index.js.map +0 -1
  71. package/dist/prompts/init.d.ts +0 -39
  72. package/dist/prompts/init.js.map +0 -1
  73. package/dist/services/init.d.ts +0 -9
  74. package/dist/services/init.js.map +0 -1
  75. package/dist/tsconfig.tsbuildinfo +0 -1
  76. package/dist/utils/template/cleanup.d.ts +0 -1
  77. package/dist/utils/template/cleanup.js.map +0 -1
  78. package/dist/utils/template/npm.d.ts +0 -12
  79. package/dist/utils/template/npm.js.map +0 -1
  80. package/dist/utils/versions.d.ts +0 -1
  81. package/dist/utils/versions.js +0 -21
  82. package/dist/utils/versions.js.map +0 -1
@@ -0,0 +1,144 @@
1
+ import {
2
+ generateRandomNameForSubdirectory,
3
+ installGlobalCLIPrompt,
4
+ renderSelectPrompt,
5
+ renderText,
6
+ renderTextPrompt
7
+ } from "./chunk-TDBGZYDD.js";
8
+ import {
9
+ __export,
10
+ init_cjs_shims
11
+ } from "./chunk-M63RTPGR.js";
12
+
13
+ // src/prompts/init.ts
14
+ var init_exports = {};
15
+ __export(init_exports, {
16
+ default: () => init_default,
17
+ isPredefinedTemplate: () => isPredefinedTemplate,
18
+ templates: () => templates,
19
+ visibleTemplates: () => visibleTemplates
20
+ });
21
+ init_cjs_shims();
22
+ var templates = {
23
+ remix: {
24
+ url: "https://github.com/Shopify/shopify-app-template-remix",
25
+ label: "Start with Remix (recommended)",
26
+ visible: true,
27
+ branches: {
28
+ prompt: "For your Remix template, which language do you want?",
29
+ options: {
30
+ javascript: { branch: "javascript", label: "JavaScript" },
31
+ typescript: { branch: "main", label: "TypeScript" }
32
+ }
33
+ }
34
+ },
35
+ none: {
36
+ url: "https://github.com/Shopify/shopify-app-template-none",
37
+ label: "Start by adding your first extension",
38
+ visible: true
39
+ },
40
+ node: {
41
+ url: "https://github.com/Shopify/shopify-app-template-node",
42
+ visible: false
43
+ },
44
+ php: {
45
+ url: "https://github.com/Shopify/shopify-app-template-php",
46
+ visible: false
47
+ },
48
+ ruby: {
49
+ url: "https://github.com/Shopify/shopify-app-template-ruby",
50
+ visible: false
51
+ }
52
+ };
53
+ var allTemplates = Object.keys(templates);
54
+ var visibleTemplates = allTemplates.filter((key) => templates[key].visible);
55
+ var templateOptionsInOrder = ["remix", "none"];
56
+ var init = async (options) => {
57
+ let name = options.name;
58
+ let template = options.template;
59
+ const flavor = options.flavor;
60
+ const defaults = {
61
+ name: await generateRandomNameForSubdirectory({ suffix: "app", directory: options.directory }),
62
+ template: templates.remix.url
63
+ };
64
+ let welcomed = false;
65
+ if (!name) {
66
+ renderText({ text: "\nWelcome. Let\u2019s get started by naming your app project. You can change it later." });
67
+ welcomed = true;
68
+ name = await renderTextPrompt({
69
+ message: "Your project name?",
70
+ defaultValue: defaults.name,
71
+ validate: (value) => {
72
+ if (value.length === 0) {
73
+ return "App name can't be empty";
74
+ }
75
+ if (value.length > 30) {
76
+ return "Enter a shorter name (30 character max.)";
77
+ }
78
+ if (value.toLowerCase().includes("shopify")) {
79
+ return "App name can't include the word 'shopify'";
80
+ }
81
+ }
82
+ });
83
+ }
84
+ if (!template) {
85
+ if (!welcomed) {
86
+ renderText({ text: "\nWelcome. Let\u2019s get started by choosing a template for your app project." });
87
+ welcomed = true;
88
+ }
89
+ template = await renderSelectPrompt({
90
+ choices: templateOptionsInOrder.map((key) => {
91
+ return {
92
+ label: templates[key].label || key,
93
+ value: key
94
+ };
95
+ }),
96
+ message: "Get started building your app:",
97
+ defaultValue: allTemplates.find((key) => templates[key].url === defaults.template)
98
+ });
99
+ }
100
+ const answers = {
101
+ ...options,
102
+ name,
103
+ template,
104
+ templateType: isPredefinedTemplate(template) ? template : "custom",
105
+ globalCLIResult: { install: false, alreadyInstalled: false }
106
+ };
107
+ let selectedUrl;
108
+ let branch;
109
+ if (answers.templateType !== "custom") {
110
+ const selectedTemplate = templates[answers.templateType];
111
+ selectedUrl = selectedTemplate.url;
112
+ if (selectedTemplate.branches) {
113
+ if (flavor) {
114
+ branch = selectedTemplate.branches.options[flavor]?.branch;
115
+ } else {
116
+ branch = await renderSelectPrompt({
117
+ message: selectedTemplate.branches.prompt || "Choose a flavor:",
118
+ choices: Object.entries(selectedTemplate.branches.options).map(([_key, branch2]) => ({
119
+ value: branch2.branch,
120
+ label: branch2.label
121
+ }))
122
+ });
123
+ }
124
+ }
125
+ }
126
+ if (branch) {
127
+ selectedUrl += `#${branch}`;
128
+ }
129
+ answers.template = selectedUrl || answers.template || defaults.template;
130
+ answers.globalCLIResult = await installGlobalCLIPrompt();
131
+ return answers;
132
+ };
133
+ var init_default = init;
134
+ function isPredefinedTemplate(template) {
135
+ return allTemplates.includes(template);
136
+ }
137
+
138
+ export {
139
+ templates,
140
+ visibleTemplates,
141
+ init_default,
142
+ isPredefinedTemplate,
143
+ init_exports
144
+ };