@shopify/create-app 3.65.2 → 3.66.0

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 (86) hide show
  1. package/dist/chunk-2RSJVBMF.js +5625 -0
  2. package/dist/{chunk-Z65QJ5D7.js → chunk-4DRC2PSU.js} +17 -30
  3. package/dist/chunk-4OD45DDO.js +31508 -0
  4. package/dist/chunk-522OB3EU.js +45 -0
  5. package/dist/{chunk-JTKTLA7L.js → chunk-5U24TEX5.js} +5434 -10324
  6. package/dist/{chunk-GJPZCXGT.js → chunk-6A7MXLVB.js} +159 -405
  7. package/dist/{chunk-ZYKRTO5P.js → chunk-7ZCQLP5Y.js} +3 -3
  8. package/dist/{chunk-5LBEKXRW.js → chunk-FIJKOZJF.js} +19 -55
  9. package/dist/{chunk-QSKQTKTB.js → chunk-FT6PCF6E.js} +2441 -5551
  10. package/dist/chunk-GIUM5DCQ.js +2144 -0
  11. package/dist/chunk-HIAKHDLR.js +54 -0
  12. package/dist/chunk-LLSRDN3T.js +15352 -0
  13. package/dist/chunk-LTDD2GRL.js +111 -0
  14. package/dist/{chunk-63QVG2CD.js → chunk-NGBYQF44.js} +9 -9
  15. package/dist/chunk-NLC7NBUB.js +80 -0
  16. package/dist/{chunk-FMKVOTQK.js → chunk-O5K4AU7Q.js} +18 -34
  17. package/dist/chunk-OMDEA7TV.js +10615 -0
  18. package/dist/chunk-PNN7RS7Y.js +105 -0
  19. package/dist/{chunk-ZPL24Y2D.js → chunk-POZ5MGPT.js} +13 -18
  20. package/dist/chunk-T7T35H4F.js +108 -0
  21. package/dist/chunk-UBB7JKND.js +55 -0
  22. package/dist/chunk-VSLR7ET4.js +3034 -0
  23. package/dist/{chunk-SAO7C4LP.js → chunk-VZVGAREJ.js} +46821 -101962
  24. package/dist/{chunk-KDNBKIH4.js → chunk-WBQF4CSV.js} +12 -22
  25. package/dist/chunk-XVNW332R.js +524 -0
  26. package/dist/{chunk-YB6D4XQ7.js → chunk-Y4ECGRAF.js} +13 -23
  27. package/dist/chunk-ZAUZQLNO.js +3774 -0
  28. package/dist/chunk-ZULFH3SL.js +1847 -0
  29. package/dist/commands/init.d.ts +0 -1
  30. package/dist/commands/init.js +27 -27
  31. package/dist/commands/init.test.js +51 -70
  32. package/dist/{constants-24TFXZKQ.js → constants-WG7I7G3O.js} +5 -5
  33. package/dist/custom-oclif-loader-JKRJZ56E.js +47 -0
  34. package/dist/del-NW5KFKFP.js +1820 -0
  35. package/dist/devtools-UBOREV57.js +2572 -0
  36. package/dist/error-handler-26SLAJTC.js +35 -0
  37. package/dist/hooks/postrun.js +35 -42
  38. package/dist/hooks/prerun.js +58 -36
  39. package/dist/index.js +7 -7
  40. package/dist/lib-3K5QYF3J.js +9 -0
  41. package/dist/{local-3VUKCW4R.js → local-H6TW5MNX.js} +13 -13
  42. package/dist/magic-string.es-3RXPUXZF.js +843 -0
  43. package/dist/multipart-parser-QKUAJJP5.js +193 -0
  44. package/dist/{node-package-manager-HYZRZNU6.js → node-package-manager-QAUN6HGS.js} +16 -14
  45. package/dist/open-MZGVNFZO.js +197 -0
  46. package/dist/out-KDGAD475.js +6 -0
  47. package/dist/{path-CFPIDSWV.js → path-L375JOQ2.js} +4 -4
  48. package/dist/prompts/init.js +13 -13
  49. package/dist/prompts/init.test.js +42 -59
  50. package/dist/services/init.js +20 -20
  51. package/dist/services/init.test.js +5 -5
  52. package/dist/system-ZI2HKAKO.js +26 -0
  53. package/dist/tsconfig.tsbuildinfo +1 -1
  54. package/dist/{ui-7NEDEALP.js → ui-727JEZUX.js} +13 -13
  55. package/dist/utils/template/cleanup.js +13 -13
  56. package/dist/utils/template/cleanup.test.js +18 -30
  57. package/dist/utils/template/npm.js +15 -15
  58. package/dist/utils/template/npm.test.js +48 -87
  59. package/oclif.manifest.json +1 -1
  60. package/package.json +3 -4
  61. package/dist/chunk-3US34ZNP.js +0 -145
  62. package/dist/chunk-3XYIOBQ2.js +0 -22131
  63. package/dist/chunk-6IZMEXPW.js +0 -105
  64. package/dist/chunk-7DRS5WXI.js +0 -7843
  65. package/dist/chunk-DL3MKXVR.js +0 -4754
  66. package/dist/chunk-HDVJ5FPK.js +0 -63
  67. package/dist/chunk-IKO7JBOJ.js +0 -14788
  68. package/dist/chunk-LSCXQWNO.js +0 -822
  69. package/dist/chunk-M2VKB6RG.js +0 -146
  70. package/dist/chunk-MCED27CG.js +0 -5626
  71. package/dist/chunk-SWNRLCC6.js +0 -61
  72. package/dist/chunk-T5LLJYYS.js +0 -195
  73. package/dist/chunk-U5LTJVWL.js +0 -3185
  74. package/dist/chunk-WR7YKB6H.js +0 -44962
  75. package/dist/chunk-YC4FLMDD.js +0 -74
  76. package/dist/chunk-ZRUHMMSQ.js +0 -2477
  77. package/dist/custom-oclif-loader-5KBN3RSN.js +0 -83
  78. package/dist/del-ZCPTGWOA.js +0 -2847
  79. package/dist/devtools-5N4JAP3R.js +0 -3588
  80. package/dist/error-handler-GTW2KSRC.js +0 -35
  81. package/dist/lib-CTSCLPNV.js +0 -9
  82. package/dist/magic-string.es-ATGURXGQ.js +0 -1353
  83. package/dist/multipart-parser-KYOHF24X.js +0 -360
  84. package/dist/open-JRS7RW22.js +0 -291
  85. package/dist/out-OKI3G7I5.js +0 -6
  86. package/dist/system-4S4YXUXZ.js +0 -26
@@ -0,0 +1,193 @@
1
+ import {
2
+ FormData,
3
+ file_default
4
+ } from "./chunk-VSLR7ET4.js";
5
+ import {
6
+ init_cjs_shims
7
+ } from "./chunk-POZ5MGPT.js";
8
+
9
+ // ../../node_modules/.pnpm/node-fetch@3.3.2/node_modules/node-fetch/src/utils/multipart-parser.js
10
+ init_cjs_shims();
11
+ var s = 0, S = {
12
+ START_BOUNDARY: s++,
13
+ HEADER_FIELD_START: s++,
14
+ HEADER_FIELD: s++,
15
+ HEADER_VALUE_START: s++,
16
+ HEADER_VALUE: s++,
17
+ HEADER_VALUE_ALMOST_DONE: s++,
18
+ HEADERS_ALMOST_DONE: s++,
19
+ PART_DATA_START: s++,
20
+ PART_DATA: s++,
21
+ END: s++
22
+ }, f = 1, F = {
23
+ PART_BOUNDARY: f,
24
+ LAST_BOUNDARY: f *= 2
25
+ }, LF = 10, CR = 13, SPACE = 32, HYPHEN = 45, COLON = 58, A = 97, Z = 122, lower = (c) => c | 32, noop = () => {
26
+ }, MultipartParser = class {
27
+ /**
28
+ * @param {string} boundary
29
+ */
30
+ constructor(boundary) {
31
+ this.index = 0, this.flags = 0, this.onHeaderEnd = noop, this.onHeaderField = noop, this.onHeadersEnd = noop, this.onHeaderValue = noop, this.onPartBegin = noop, this.onPartData = noop, this.onPartEnd = noop, this.boundaryChars = {}, boundary = `\r
32
+ --` + boundary;
33
+ let ui8a = new Uint8Array(boundary.length);
34
+ for (let i = 0; i < boundary.length; i++)
35
+ ui8a[i] = boundary.charCodeAt(i), this.boundaryChars[ui8a[i]] = !0;
36
+ this.boundary = ui8a, this.lookbehind = new Uint8Array(this.boundary.length + 8), this.state = S.START_BOUNDARY;
37
+ }
38
+ /**
39
+ * @param {Uint8Array} data
40
+ */
41
+ write(data) {
42
+ let i = 0, length_ = data.length, previousIndex = this.index, { lookbehind, boundary, boundaryChars, index, state, flags } = this, boundaryLength = this.boundary.length, boundaryEnd = boundaryLength - 1, bufferLength = data.length, c, cl, mark = (name) => {
43
+ this[name + "Mark"] = i;
44
+ }, clear = (name) => {
45
+ delete this[name + "Mark"];
46
+ }, callback = (callbackSymbol, start, end, ui8a) => {
47
+ (start === void 0 || start !== end) && this[callbackSymbol](ui8a && ui8a.subarray(start, end));
48
+ }, dataCallback = (name, clear2) => {
49
+ let markSymbol = name + "Mark";
50
+ markSymbol in this && (clear2 ? (callback(name, this[markSymbol], i, data), delete this[markSymbol]) : (callback(name, this[markSymbol], data.length, data), this[markSymbol] = 0));
51
+ };
52
+ for (i = 0; i < length_; i++)
53
+ switch (c = data[i], state) {
54
+ case S.START_BOUNDARY:
55
+ if (index === boundary.length - 2) {
56
+ if (c === HYPHEN)
57
+ flags |= F.LAST_BOUNDARY;
58
+ else if (c !== CR)
59
+ return;
60
+ index++;
61
+ break;
62
+ } else if (index - 1 === boundary.length - 2) {
63
+ if (flags & F.LAST_BOUNDARY && c === HYPHEN)
64
+ state = S.END, flags = 0;
65
+ else if (!(flags & F.LAST_BOUNDARY) && c === LF)
66
+ index = 0, callback("onPartBegin"), state = S.HEADER_FIELD_START;
67
+ else
68
+ return;
69
+ break;
70
+ }
71
+ c !== boundary[index + 2] && (index = -2), c === boundary[index + 2] && index++;
72
+ break;
73
+ case S.HEADER_FIELD_START:
74
+ state = S.HEADER_FIELD, mark("onHeaderField"), index = 0;
75
+ case S.HEADER_FIELD:
76
+ if (c === CR) {
77
+ clear("onHeaderField"), state = S.HEADERS_ALMOST_DONE;
78
+ break;
79
+ }
80
+ if (index++, c === HYPHEN)
81
+ break;
82
+ if (c === COLON) {
83
+ if (index === 1)
84
+ return;
85
+ dataCallback("onHeaderField", !0), state = S.HEADER_VALUE_START;
86
+ break;
87
+ }
88
+ if (cl = lower(c), cl < A || cl > Z)
89
+ return;
90
+ break;
91
+ case S.HEADER_VALUE_START:
92
+ if (c === SPACE)
93
+ break;
94
+ mark("onHeaderValue"), state = S.HEADER_VALUE;
95
+ case S.HEADER_VALUE:
96
+ c === CR && (dataCallback("onHeaderValue", !0), callback("onHeaderEnd"), state = S.HEADER_VALUE_ALMOST_DONE);
97
+ break;
98
+ case S.HEADER_VALUE_ALMOST_DONE:
99
+ if (c !== LF)
100
+ return;
101
+ state = S.HEADER_FIELD_START;
102
+ break;
103
+ case S.HEADERS_ALMOST_DONE:
104
+ if (c !== LF)
105
+ return;
106
+ callback("onHeadersEnd"), state = S.PART_DATA_START;
107
+ break;
108
+ case S.PART_DATA_START:
109
+ state = S.PART_DATA, mark("onPartData");
110
+ case S.PART_DATA:
111
+ if (previousIndex = index, index === 0) {
112
+ for (i += boundaryEnd; i < bufferLength && !(data[i] in boundaryChars); )
113
+ i += boundaryLength;
114
+ i -= boundaryEnd, c = data[i];
115
+ }
116
+ if (index < boundary.length)
117
+ boundary[index] === c ? (index === 0 && dataCallback("onPartData", !0), index++) : index = 0;
118
+ else if (index === boundary.length)
119
+ index++, c === CR ? flags |= F.PART_BOUNDARY : c === HYPHEN ? flags |= F.LAST_BOUNDARY : index = 0;
120
+ else if (index - 1 === boundary.length)
121
+ if (flags & F.PART_BOUNDARY) {
122
+ if (index = 0, c === LF) {
123
+ flags &= ~F.PART_BOUNDARY, callback("onPartEnd"), callback("onPartBegin"), state = S.HEADER_FIELD_START;
124
+ break;
125
+ }
126
+ } else
127
+ flags & F.LAST_BOUNDARY && c === HYPHEN ? (callback("onPartEnd"), state = S.END, flags = 0) : index = 0;
128
+ if (index > 0)
129
+ lookbehind[index - 1] = c;
130
+ else if (previousIndex > 0) {
131
+ let _lookbehind = new Uint8Array(lookbehind.buffer, lookbehind.byteOffset, lookbehind.byteLength);
132
+ callback("onPartData", 0, previousIndex, _lookbehind), previousIndex = 0, mark("onPartData"), i--;
133
+ }
134
+ break;
135
+ case S.END:
136
+ break;
137
+ default:
138
+ throw new Error(`Unexpected state entered: ${state}`);
139
+ }
140
+ dataCallback("onHeaderField"), dataCallback("onHeaderValue"), dataCallback("onPartData"), this.index = index, this.state = state, this.flags = flags;
141
+ }
142
+ end() {
143
+ if (this.state === S.HEADER_FIELD_START && this.index === 0 || this.state === S.PART_DATA && this.index === this.boundary.length)
144
+ this.onPartEnd();
145
+ else if (this.state !== S.END)
146
+ throw new Error("MultipartParser.end(): stream ended unexpectedly");
147
+ }
148
+ };
149
+ function _fileName(headerValue) {
150
+ let m = headerValue.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i);
151
+ if (!m)
152
+ return;
153
+ let match = m[2] || m[3] || "", filename = match.slice(match.lastIndexOf("\\") + 1);
154
+ return filename = filename.replace(/%22/g, '"'), filename = filename.replace(/&#(\d{4});/g, (m2, code) => String.fromCharCode(code)), filename;
155
+ }
156
+ async function toFormData(Body, ct) {
157
+ if (!/multipart/i.test(ct))
158
+ throw new TypeError("Failed to fetch");
159
+ let m = ct.match(/boundary=(?:"([^"]+)"|([^;]+))/i);
160
+ if (!m)
161
+ throw new TypeError("no or bad content-type header, no multipart boundary");
162
+ let parser = new MultipartParser(m[1] || m[2]), headerField, headerValue, entryValue, entryName, contentType, filename, entryChunks = [], formData = new FormData(), onPartData = (ui8a) => {
163
+ entryValue += decoder.decode(ui8a, { stream: !0 });
164
+ }, appendToFile = (ui8a) => {
165
+ entryChunks.push(ui8a);
166
+ }, appendFileToFormData = () => {
167
+ let file = new file_default(entryChunks, filename, { type: contentType });
168
+ formData.append(entryName, file);
169
+ }, appendEntryToFormData = () => {
170
+ formData.append(entryName, entryValue);
171
+ }, decoder = new TextDecoder("utf-8");
172
+ decoder.decode(), parser.onPartBegin = function() {
173
+ parser.onPartData = onPartData, parser.onPartEnd = appendEntryToFormData, headerField = "", headerValue = "", entryValue = "", entryName = "", contentType = "", filename = null, entryChunks.length = 0;
174
+ }, parser.onHeaderField = function(ui8a) {
175
+ headerField += decoder.decode(ui8a, { stream: !0 });
176
+ }, parser.onHeaderValue = function(ui8a) {
177
+ headerValue += decoder.decode(ui8a, { stream: !0 });
178
+ }, parser.onHeaderEnd = function() {
179
+ if (headerValue += decoder.decode(), headerField = headerField.toLowerCase(), headerField === "content-disposition") {
180
+ let m2 = headerValue.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);
181
+ m2 && (entryName = m2[2] || m2[3] || ""), filename = _fileName(headerValue), filename && (parser.onPartData = appendToFile, parser.onPartEnd = appendFileToFormData);
182
+ } else
183
+ headerField === "content-type" && (contentType = headerValue);
184
+ headerValue = "", headerField = "";
185
+ };
186
+ for await (let chunk of Body)
187
+ parser.write(chunk);
188
+ return parser.end(), formData;
189
+ }
190
+ export {
191
+ toFormData
192
+ };
193
+ //# sourceMappingURL=multipart-parser-QKUAJJP5.js.map
@@ -7,6 +7,7 @@ import {
7
7
  addNPMDependenciesWithoutVersionIfNeeded,
8
8
  addResolutionOrOverride,
9
9
  bunLockfile,
10
+ checkForCachedNewVersion,
10
11
  checkForNewVersion,
11
12
  findUpAndReadPackageJson,
12
13
  getDependencies,
@@ -26,19 +27,19 @@ import {
26
27
  versionSatisfies,
27
28
  writePackageJSON,
28
29
  yarnLockfile
29
- } from "./chunk-3XYIOBQ2.js";
30
- import "./chunk-WR7YKB6H.js";
31
- import "./chunk-LSCXQWNO.js";
32
- import "./chunk-5LBEKXRW.js";
33
- import "./chunk-Z65QJ5D7.js";
34
- import "./chunk-M2VKB6RG.js";
35
- import "./chunk-SAO7C4LP.js";
36
- import "./chunk-GJPZCXGT.js";
37
- import "./chunk-MCED27CG.js";
38
- import "./chunk-YC4FLMDD.js";
39
- import "./chunk-SWNRLCC6.js";
40
- import "./chunk-T5LLJYYS.js";
41
- import "./chunk-ZPL24Y2D.js";
30
+ } from "./chunk-LLSRDN3T.js";
31
+ import "./chunk-4OD45DDO.js";
32
+ import "./chunk-XVNW332R.js";
33
+ import "./chunk-FIJKOZJF.js";
34
+ import "./chunk-4DRC2PSU.js";
35
+ import "./chunk-LTDD2GRL.js";
36
+ import "./chunk-VZVGAREJ.js";
37
+ import "./chunk-6A7MXLVB.js";
38
+ import "./chunk-ZAUZQLNO.js";
39
+ import "./chunk-UBB7JKND.js";
40
+ import "./chunk-522OB3EU.js";
41
+ import "./chunk-PNN7RS7Y.js";
42
+ import "./chunk-POZ5MGPT.js";
42
43
  export {
43
44
  FindUpAndReadPackageJsonNotFoundError,
44
45
  PackageJsonNotFoundError,
@@ -48,6 +49,7 @@ export {
48
49
  addNPMDependenciesWithoutVersionIfNeeded,
49
50
  addResolutionOrOverride,
50
51
  bunLockfile,
52
+ checkForCachedNewVersion,
51
53
  checkForNewVersion,
52
54
  findUpAndReadPackageJson,
53
55
  getDependencies,
@@ -68,4 +70,4 @@ export {
68
70
  writePackageJSON,
69
71
  yarnLockfile
70
72
  };
71
- //# sourceMappingURL=node-package-manager-HYZRZNU6.js.map
73
+ //# sourceMappingURL=node-package-manager-QAUN6HGS.js.map
@@ -0,0 +1,197 @@
1
+ import {
2
+ require_is_docker,
3
+ require_is_wsl
4
+ } from "./chunk-UBB7JKND.js";
5
+ import {
6
+ __commonJS,
7
+ __require,
8
+ init_cjs_shims
9
+ } from "./chunk-POZ5MGPT.js";
10
+
11
+ // ../../node_modules/.pnpm/define-lazy-prop@2.0.0/node_modules/define-lazy-prop/index.js
12
+ var require_define_lazy_prop = __commonJS({
13
+ "../../node_modules/.pnpm/define-lazy-prop@2.0.0/node_modules/define-lazy-prop/index.js"(exports, module) {
14
+ "use strict";
15
+ init_cjs_shims();
16
+ module.exports = (object, propertyName, fn) => {
17
+ let define = (value) => Object.defineProperty(object, propertyName, { value, enumerable: !0, writable: !0 });
18
+ return Object.defineProperty(object, propertyName, {
19
+ configurable: !0,
20
+ enumerable: !0,
21
+ get() {
22
+ let result = fn();
23
+ return define(result), result;
24
+ },
25
+ set(value) {
26
+ define(value);
27
+ }
28
+ }), object;
29
+ };
30
+ }
31
+ });
32
+
33
+ // ../../node_modules/.pnpm/open@8.4.2/node_modules/open/index.js
34
+ var require_open = __commonJS({
35
+ "../../node_modules/.pnpm/open@8.4.2/node_modules/open/index.js"(exports, module) {
36
+ init_cjs_shims();
37
+ var path = __require("path"), childProcess = __require("child_process"), { promises: fs, constants: fsConstants } = __require("fs"), isWsl = require_is_wsl(), isDocker = require_is_docker(), defineLazyProperty = require_define_lazy_prop(), localXdgOpenPath = path.join(__dirname, "xdg-open"), { platform, arch } = process, hasContainerEnv = () => {
38
+ try {
39
+ return fs.statSync("/run/.containerenv"), !0;
40
+ } catch {
41
+ return !1;
42
+ }
43
+ }, cachedResult;
44
+ function isInsideContainer() {
45
+ return cachedResult === void 0 && (cachedResult = hasContainerEnv() || isDocker()), cachedResult;
46
+ }
47
+ var getWslDrivesMountPoint = /* @__PURE__ */ (() => {
48
+ let defaultMountPoint = "/mnt/", mountPoint;
49
+ return async function() {
50
+ if (mountPoint)
51
+ return mountPoint;
52
+ let configFilePath = "/etc/wsl.conf", isConfigFileExists = !1;
53
+ try {
54
+ await fs.access(configFilePath, fsConstants.F_OK), isConfigFileExists = !0;
55
+ } catch {
56
+ }
57
+ if (!isConfigFileExists)
58
+ return defaultMountPoint;
59
+ let configContent = await fs.readFile(configFilePath, { encoding: "utf8" }), configMountPoint = /(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(configContent);
60
+ return configMountPoint ? (mountPoint = configMountPoint.groups.mountPoint.trim(), mountPoint = mountPoint.endsWith("/") ? mountPoint : `${mountPoint}/`, mountPoint) : defaultMountPoint;
61
+ };
62
+ })(), pTryEach = async (array, mapper) => {
63
+ let latestError;
64
+ for (let item of array)
65
+ try {
66
+ return await mapper(item);
67
+ } catch (error) {
68
+ latestError = error;
69
+ }
70
+ throw latestError;
71
+ }, baseOpen = async (options) => {
72
+ if (options = {
73
+ wait: !1,
74
+ background: !1,
75
+ newInstance: !1,
76
+ allowNonzeroExitCode: !1,
77
+ ...options
78
+ }, Array.isArray(options.app))
79
+ return pTryEach(options.app, (singleApp) => baseOpen({
80
+ ...options,
81
+ app: singleApp
82
+ }));
83
+ let { name: app, arguments: appArguments = [] } = options.app || {};
84
+ if (appArguments = [...appArguments], Array.isArray(app))
85
+ return pTryEach(app, (appName) => baseOpen({
86
+ ...options,
87
+ app: {
88
+ name: appName,
89
+ arguments: appArguments
90
+ }
91
+ }));
92
+ let command, cliArguments = [], childProcessOptions = {};
93
+ if (platform === "darwin")
94
+ command = "open", options.wait && cliArguments.push("--wait-apps"), options.background && cliArguments.push("--background"), options.newInstance && cliArguments.push("--new"), app && cliArguments.push("-a", app);
95
+ else if (platform === "win32" || isWsl && !isInsideContainer() && !app) {
96
+ let mountPoint = await getWslDrivesMountPoint();
97
+ command = isWsl ? `${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe` : `${process.env.SYSTEMROOT}\\System32\\WindowsPowerShell\\v1.0\\powershell`, cliArguments.push(
98
+ "-NoProfile",
99
+ "-NonInteractive",
100
+ "\u2013ExecutionPolicy",
101
+ "Bypass",
102
+ "-EncodedCommand"
103
+ ), isWsl || (childProcessOptions.windowsVerbatimArguments = !0);
104
+ let encodedArguments = ["Start"];
105
+ options.wait && encodedArguments.push("-Wait"), app ? (encodedArguments.push(`"\`"${app}\`""`, "-ArgumentList"), options.target && appArguments.unshift(options.target)) : options.target && encodedArguments.push(`"${options.target}"`), appArguments.length > 0 && (appArguments = appArguments.map((arg) => `"\`"${arg}\`""`), encodedArguments.push(appArguments.join(","))), options.target = Buffer.from(encodedArguments.join(" "), "utf16le").toString("base64");
106
+ } else {
107
+ if (app)
108
+ command = app;
109
+ else {
110
+ let isBundled = !__dirname || __dirname === "/", exeLocalXdgOpen = !1;
111
+ try {
112
+ await fs.access(localXdgOpenPath, fsConstants.X_OK), exeLocalXdgOpen = !0;
113
+ } catch {
114
+ }
115
+ command = process.versions.electron || platform === "android" || isBundled || !exeLocalXdgOpen ? "xdg-open" : localXdgOpenPath;
116
+ }
117
+ appArguments.length > 0 && cliArguments.push(...appArguments), options.wait || (childProcessOptions.stdio = "ignore", childProcessOptions.detached = !0);
118
+ }
119
+ options.target && cliArguments.push(options.target), platform === "darwin" && appArguments.length > 0 && cliArguments.push("--args", ...appArguments);
120
+ let subprocess = childProcess.spawn(command, cliArguments, childProcessOptions);
121
+ return options.wait ? new Promise((resolve, reject) => {
122
+ subprocess.once("error", reject), subprocess.once("close", (exitCode) => {
123
+ if (!options.allowNonzeroExitCode && exitCode > 0) {
124
+ reject(new Error(`Exited with code ${exitCode}`));
125
+ return;
126
+ }
127
+ resolve(subprocess);
128
+ });
129
+ }) : (subprocess.unref(), subprocess);
130
+ }, open = (target, options) => {
131
+ if (typeof target != "string")
132
+ throw new TypeError("Expected a `target`");
133
+ return baseOpen({
134
+ ...options,
135
+ target
136
+ });
137
+ }, openApp = (name, options) => {
138
+ if (typeof name != "string")
139
+ throw new TypeError("Expected a `name`");
140
+ let { arguments: appArguments = [] } = options || {};
141
+ if (appArguments != null && !Array.isArray(appArguments))
142
+ throw new TypeError("Expected `appArguments` as Array type");
143
+ return baseOpen({
144
+ ...options,
145
+ app: {
146
+ name,
147
+ arguments: appArguments
148
+ }
149
+ });
150
+ };
151
+ function detectArchBinary(binary) {
152
+ if (typeof binary == "string" || Array.isArray(binary))
153
+ return binary;
154
+ let { [arch]: archBinary } = binary;
155
+ if (!archBinary)
156
+ throw new Error(`${arch} is not supported`);
157
+ return archBinary;
158
+ }
159
+ function detectPlatformBinary({ [platform]: platformBinary }, { wsl }) {
160
+ if (wsl && isWsl)
161
+ return detectArchBinary(wsl);
162
+ if (!platformBinary)
163
+ throw new Error(`${platform} is not supported`);
164
+ return detectArchBinary(platformBinary);
165
+ }
166
+ var apps = {};
167
+ defineLazyProperty(apps, "chrome", () => detectPlatformBinary({
168
+ darwin: "google chrome",
169
+ win32: "chrome",
170
+ linux: ["google-chrome", "google-chrome-stable", "chromium"]
171
+ }, {
172
+ wsl: {
173
+ ia32: "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",
174
+ x64: ["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe", "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]
175
+ }
176
+ }));
177
+ defineLazyProperty(apps, "firefox", () => detectPlatformBinary({
178
+ darwin: "firefox",
179
+ win32: "C:\\Program Files\\Mozilla Firefox\\firefox.exe",
180
+ linux: "firefox"
181
+ }, {
182
+ wsl: "/mnt/c/Program Files/Mozilla Firefox/firefox.exe"
183
+ }));
184
+ defineLazyProperty(apps, "edge", () => detectPlatformBinary({
185
+ darwin: "microsoft edge",
186
+ win32: "msedge",
187
+ linux: ["microsoft-edge", "microsoft-edge-dev"]
188
+ }, {
189
+ wsl: "/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"
190
+ }));
191
+ open.apps = apps;
192
+ open.openApp = openApp;
193
+ module.exports = open;
194
+ }
195
+ });
196
+ export default require_open();
197
+ //# sourceMappingURL=open-MZGVNFZO.js.map
@@ -0,0 +1,6 @@
1
+ import {
2
+ require_out
3
+ } from "./chunk-ZAUZQLNO.js";
4
+ import "./chunk-POZ5MGPT.js";
5
+ export default require_out();
6
+ //# sourceMappingURL=out-KDGAD475.js.map
@@ -13,9 +13,9 @@ import {
13
13
  resolvePath,
14
14
  sniffForJson,
15
15
  sniffForPath
16
- } from "./chunk-Z65QJ5D7.js";
17
- import "./chunk-T5LLJYYS.js";
18
- import "./chunk-ZPL24Y2D.js";
16
+ } from "./chunk-4DRC2PSU.js";
17
+ import "./chunk-PNN7RS7Y.js";
18
+ import "./chunk-POZ5MGPT.js";
19
19
  export {
20
20
  basename,
21
21
  cwd,
@@ -32,4 +32,4 @@ export {
32
32
  sniffForJson,
33
33
  sniffForPath
34
34
  };
35
- //# sourceMappingURL=path-CFPIDSWV.js.map
35
+ //# sourceMappingURL=path-L375JOQ2.js.map
@@ -3,19 +3,19 @@ import {
3
3
  isPredefinedTemplate,
4
4
  templates,
5
5
  visibleTemplates
6
- } from "../chunk-3US34ZNP.js";
7
- import "../chunk-WR7YKB6H.js";
8
- import "../chunk-LSCXQWNO.js";
9
- import "../chunk-5LBEKXRW.js";
10
- import "../chunk-Z65QJ5D7.js";
11
- import "../chunk-M2VKB6RG.js";
12
- import "../chunk-SAO7C4LP.js";
13
- import "../chunk-GJPZCXGT.js";
14
- import "../chunk-MCED27CG.js";
15
- import "../chunk-YC4FLMDD.js";
16
- import "../chunk-SWNRLCC6.js";
17
- import "../chunk-T5LLJYYS.js";
18
- import "../chunk-ZPL24Y2D.js";
6
+ } from "../chunk-T7T35H4F.js";
7
+ import "../chunk-4OD45DDO.js";
8
+ import "../chunk-XVNW332R.js";
9
+ import "../chunk-FIJKOZJF.js";
10
+ import "../chunk-4DRC2PSU.js";
11
+ import "../chunk-LTDD2GRL.js";
12
+ import "../chunk-VZVGAREJ.js";
13
+ import "../chunk-6A7MXLVB.js";
14
+ import "../chunk-ZAUZQLNO.js";
15
+ import "../chunk-UBB7JKND.js";
16
+ import "../chunk-522OB3EU.js";
17
+ import "../chunk-PNN7RS7Y.js";
18
+ import "../chunk-POZ5MGPT.js";
19
19
  export {
20
20
  init_default as default,
21
21
  isPredefinedTemplate,
@@ -1,80 +1,70 @@
1
1
  import {
2
2
  init_default
3
- } from "../chunk-3US34ZNP.js";
3
+ } from "../chunk-T7T35H4F.js";
4
4
  import {
5
5
  installGlobalCLIPrompt,
6
6
  renderSelectPrompt,
7
7
  renderText,
8
8
  renderTextPrompt
9
- } from "../chunk-WR7YKB6H.js";
10
- import "../chunk-LSCXQWNO.js";
11
- import "../chunk-5LBEKXRW.js";
12
- import "../chunk-Z65QJ5D7.js";
13
- import "../chunk-M2VKB6RG.js";
14
- import "../chunk-SAO7C4LP.js";
15
- import "../chunk-GJPZCXGT.js";
16
- import "../chunk-MCED27CG.js";
17
- import "../chunk-YC4FLMDD.js";
9
+ } from "../chunk-4OD45DDO.js";
10
+ import "../chunk-XVNW332R.js";
11
+ import "../chunk-FIJKOZJF.js";
12
+ import "../chunk-4DRC2PSU.js";
13
+ import "../chunk-LTDD2GRL.js";
14
+ import "../chunk-VZVGAREJ.js";
15
+ import "../chunk-6A7MXLVB.js";
16
+ import "../chunk-ZAUZQLNO.js";
17
+ import "../chunk-UBB7JKND.js";
18
18
  import {
19
19
  beforeEach,
20
20
  describe,
21
21
  globalExpect,
22
22
  test,
23
23
  vi
24
- } from "../chunk-IKO7JBOJ.js";
25
- import "../chunk-SWNRLCC6.js";
26
- import "../chunk-T5LLJYYS.js";
24
+ } from "../chunk-OMDEA7TV.js";
25
+ import "../chunk-522OB3EU.js";
26
+ import "../chunk-PNN7RS7Y.js";
27
27
  import {
28
28
  init_cjs_shims
29
- } from "../chunk-ZPL24Y2D.js";
29
+ } from "../chunk-POZ5MGPT.js";
30
30
 
31
31
  // src/prompts/init.test.ts
32
32
  init_cjs_shims();
33
33
  vi.mock("@shopify/cli-kit/node/ui");
34
34
  vi.mock("@shopify/cli-kit/node/is-global");
35
- var globalCLIResult = { install: true, alreadyInstalled: false };
35
+ var globalCLIResult = { install: !0, alreadyInstalled: !1 };
36
36
  describe("init", () => {
37
37
  beforeEach(() => {
38
38
  vi.mocked(installGlobalCLIPrompt).mockResolvedValue(globalCLIResult);
39
- });
40
- test("when name is not passed", async () => {
41
- const answers = {
39
+ }), test("when name is not passed", async () => {
40
+ let answers = {
42
41
  name: "app"
43
- };
44
- const options = { template: "template", directory: "/" };
42
+ }, options = { template: "template", directory: "/" };
45
43
  vi.mocked(renderTextPrompt).mockResolvedValueOnce(answers.name);
46
- const got = await init_default(options);
44
+ let got = await init_default(options);
47
45
  globalExpect(renderText).toHaveBeenCalledWith({
48
- text: "\nWelcome. Let\u2019s get started by naming your app project. You can change it later."
49
- });
50
- globalExpect(renderTextPrompt).toHaveBeenCalledWith({
46
+ text: `
47
+ Welcome. Let\u2019s get started by naming your app project. You can change it later.`
48
+ }), globalExpect(renderTextPrompt).toHaveBeenCalledWith({
51
49
  message: "Your project name?",
52
50
  defaultValue: globalExpect.stringMatching(/^\w+-\w+-app$/),
53
51
  validate: globalExpect.any(Function)
54
- });
55
- globalExpect(got).toEqual({ ...options, ...answers, templateType: "custom", globalCLIResult });
56
- });
57
- test("when name is passed", async () => {
58
- const answers = {
52
+ }), globalExpect(got).toEqual({ ...options, ...answers, templateType: "custom", globalCLIResult });
53
+ }), test("when name is passed", async () => {
54
+ let answers = {
59
55
  template: "https://github.com/Shopify/shopify-app-template-remix"
60
- };
61
- const options = { name: "app", directory: "/" };
62
- const got = await init_default(options);
56
+ }, options = { name: "app", directory: "/" }, got = await init_default(options);
63
57
  globalExpect(renderText).toHaveBeenCalledWith({
64
- text: "\nWelcome. Let\u2019s get started by choosing a template for your app project."
65
- });
66
- globalExpect(renderTextPrompt).not.toHaveBeenCalled();
67
- globalExpect(got).toEqual({ ...options, ...answers, templateType: "custom", globalCLIResult });
68
- });
69
- test("it renders the label for the template options", async () => {
70
- const answers = {
58
+ text: `
59
+ Welcome. Let\u2019s get started by choosing a template for your app project.`
60
+ }), globalExpect(renderTextPrompt).not.toHaveBeenCalled(), globalExpect(got).toEqual({ ...options, ...answers, templateType: "custom", globalCLIResult });
61
+ }), test("it renders the label for the template options", async () => {
62
+ let answers = {
71
63
  name: "app",
72
64
  template: "https://github.com/Shopify/shopify-app-template-none"
73
- };
74
- const options = { directory: "/" };
75
- vi.mocked(renderTextPrompt).mockResolvedValueOnce(answers.name);
76
- vi.mocked(renderSelectPrompt).mockResolvedValueOnce("none");
77
- const got = await init_default(options);
65
+ }, options = { directory: "/" };
66
+ vi.mocked(renderTextPrompt).mockResolvedValueOnce(answers.name), vi.mocked(renderSelectPrompt).mockResolvedValueOnce("none");
67
+ let got = await init_default(options);
78
68
  globalExpect(renderSelectPrompt).toHaveBeenCalledWith({
79
69
  choices: [
80
70
  { label: "Start with Remix (recommended)", value: "remix" },
@@ -82,19 +72,14 @@ describe("init", () => {
82
72
  ],
83
73
  message: "Get started building your app:",
84
74
  defaultValue: "remix"
85
- });
86
- globalExpect(got).toEqual({ ...options, ...answers, templateType: "none", globalCLIResult });
87
- });
88
- test("it renders branches for templates that have them", async () => {
89
- const answers = {
75
+ }), globalExpect(got).toEqual({ ...options, ...answers, templateType: "none", globalCLIResult });
76
+ }), test("it renders branches for templates that have them", async () => {
77
+ let answers = {
90
78
  name: "app",
91
79
  template: "https://github.com/Shopify/shopify-app-template-remix#javascript"
92
- };
93
- const options = { directory: "/" };
94
- vi.mocked(renderTextPrompt).mockResolvedValueOnce(answers.name);
95
- vi.mocked(renderSelectPrompt).mockResolvedValueOnce("remix");
96
- vi.mocked(renderSelectPrompt).mockResolvedValueOnce("javascript");
97
- const got = await init_default(options);
80
+ }, options = { directory: "/" };
81
+ vi.mocked(renderTextPrompt).mockResolvedValueOnce(answers.name), vi.mocked(renderSelectPrompt).mockResolvedValueOnce("remix"), vi.mocked(renderSelectPrompt).mockResolvedValueOnce("javascript");
82
+ let got = await init_default(options);
98
83
  globalExpect(renderSelectPrompt).toHaveBeenCalledWith({
99
84
  choices: [
100
85
  { label: "Start with Remix (recommended)", value: "remix" },
@@ -102,15 +87,13 @@ describe("init", () => {
102
87
  ],
103
88
  message: "Get started building your app:",
104
89
  defaultValue: "remix"
105
- });
106
- globalExpect(renderSelectPrompt).toHaveBeenCalledWith({
90
+ }), globalExpect(renderSelectPrompt).toHaveBeenCalledWith({
107
91
  choices: [
108
92
  { label: "JavaScript", value: "javascript" },
109
93
  { label: "TypeScript", value: "main" }
110
94
  ],
111
95
  message: "For your Remix template, which language do you want?"
112
- });
113
- globalExpect(got).toEqual({ ...options, ...answers, templateType: "remix", globalCLIResult });
96
+ }), globalExpect(got).toEqual({ ...options, ...answers, templateType: "remix", globalCLIResult });
114
97
  });
115
98
  });
116
99
  //# sourceMappingURL=init.test.js.map