@shopify/create-app 4.6.1 → 4.7.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 (51) hide show
  1. package/dist/{analytics-HXZNGNCN.js → analytics-3C6IM5OH.js} +16 -13
  2. package/dist/analytics-TKGJW4CI.js +44 -0
  3. package/dist/{chunk-TNZEM7JJ.js → chunk-3CEBU7F7.js} +18 -15
  4. package/dist/{chunk-K5UHKI43.js → chunk-3WA6JLES.js} +33 -58
  5. package/dist/{chunk-JK6PBDEW.js → chunk-7YZDH26Z.js} +17 -17
  6. package/dist/chunk-ARIPXAMF.js +179 -0
  7. package/dist/{chunk-3JSJSGAQ.js → chunk-CCB7HUXM.js} +2 -2
  8. package/dist/chunk-CM6ALOD7.js +32 -0
  9. package/dist/{chunk-K5NLRHZR.js → chunk-E43EDJOG.js} +4 -4
  10. package/dist/{chunk-ZUKA5LQU.js → chunk-EOOWFAUQ.js} +4509 -7671
  11. package/dist/chunk-HNIAZN6U.js +14 -0
  12. package/dist/{chunk-CMK3RV4O.js → chunk-KITZ5RLX.js} +9 -6
  13. package/dist/{chunk-QK2IQEBY.js → chunk-MVIZLNDV.js} +2 -2
  14. package/dist/{chunk-ZGSDAUKG.js → chunk-NTRP5UPL.js} +21809 -346
  15. package/dist/{chunk-N7J64MYF.js → chunk-OHAG6RQT.js} +27 -18
  16. package/dist/chunk-OMR2LYUV.js +301 -0
  17. package/dist/chunk-PLO3ASNN.js +1391 -0
  18. package/dist/{chunk-ZLYYWQWW.js → chunk-SBZZKBLZ.js} +3 -3
  19. package/dist/{chunk-VLCFLRJB.js → chunk-TT7YBXNU.js} +2 -2
  20. package/dist/chunk-UW2WSGNC.js +7350 -0
  21. package/dist/{conf-store-ZYB6IGB7.js → conf-store-PMOFWF3V.js} +9 -7
  22. package/dist/{custom-oclif-loader-MNCB3QFM.js → custom-oclif-loader-HTLL62HO.js} +15 -15
  23. package/dist/{deprecations-FOMUQSMA.js → deprecations-XSONJDPJ.js} +12 -9
  24. package/dist/{environments-SWXYO6KQ.js → environments-7M5VG3ZO.js} +13 -10
  25. package/dist/{error-handler-PXVIL3GI.js → error-handler-OSY5Z5EY.js} +16 -13
  26. package/dist/{fs-FVYWMVWY.js → fs-QKWQO24G.js} +4 -3
  27. package/dist/hooks/postrun.js +5 -4
  28. package/dist/hooks/prerun.js +26 -8
  29. package/dist/index.js +2007 -1818
  30. package/dist/index.test.js +8 -8
  31. package/dist/{is-global-QP5DA2PW.js → is-global-27HWUS75.js} +4 -3
  32. package/dist/{lib-SEAHPNPA.js → lib-XCYUJYSO.js} +3 -3
  33. package/dist/{local-FQ2FNAKK.js → local-ELO22BKI.js} +3 -2
  34. package/dist/{metadata-7RRKVERI.js → metadata-4DNOT3O4.js} +4 -3
  35. package/dist/{node-package-manager-7MTYEDAO.js → node-package-manager-TZ4UXLZO.js} +14 -11
  36. package/dist/{notifications-system-GHCK5E2U.js → notifications-system-I4ONBO77.js} +17 -14
  37. package/dist/os-7AHYIADA.js +19 -0
  38. package/dist/{output-7VC5AJM7.js → output-KF5RQHUT.js} +4 -3
  39. package/dist/{system-OTGPJVTA.js → system-J2KVDFSW.js} +14 -9
  40. package/dist/tsconfig.tsbuildinfo +1 -1
  41. package/dist/{ui-3H6HVYPD.js → ui-KTYAOJV5.js} +12 -9
  42. package/dist/{upgrade-AYIRDOVJ.js → upgrade-YR43DQNI.js} +23 -20
  43. package/dist/{version-CCMJSEAI.js → version-CS66ODDA.js} +13 -10
  44. package/dist/{version-OHC3XUOI.js → version-XTE3XEL6.js} +2 -2
  45. package/oclif.manifest.json +11 -7
  46. package/package.json +3 -3
  47. package/dist/analytics-GP57RR6R.js +0 -39
  48. package/dist/chunk-BPIA4T3X.js +0 -655
  49. package/dist/chunk-HNMF25KI.js +0 -5632
  50. package/dist/chunk-T446SGE5.js +0 -21746
  51. package/dist/is-wsl-63MHD6QC.js +0 -65
@@ -2,32 +2,35 @@ import {
2
2
  getEnvironmentData,
3
3
  getSensitiveEnvironmentData,
4
4
  startAnalytics
5
- } from "./chunk-ZGSDAUKG.js";
5
+ } from "./chunk-NTRP5UPL.js";
6
6
  import "./chunk-MSED5ZFM.js";
7
- import "./chunk-K5UHKI43.js";
8
- import "./chunk-VLCFLRJB.js";
7
+ import "./chunk-TT7YBXNU.js";
9
8
  import "./chunk-G53O4PDO.js";
10
- import "./chunk-CMK3RV4O.js";
11
- import "./chunk-HNMF25KI.js";
12
- import "./chunk-ZLYYWQWW.js";
13
- import "./chunk-T446SGE5.js";
14
- import "./chunk-K5NLRHZR.js";
9
+ import "./chunk-3WA6JLES.js";
10
+ import "./chunk-KITZ5RLX.js";
11
+ import "./chunk-EOOWFAUQ.js";
12
+ import "./chunk-PLO3ASNN.js";
13
+ import "./chunk-SBZZKBLZ.js";
14
+ import "./chunk-ARIPXAMF.js";
15
+ import "./chunk-CM6ALOD7.js";
16
+ import "./chunk-E43EDJOG.js";
15
17
  import "./chunk-ODCXYGJ2.js";
16
18
  import "./chunk-LBXDGVFS.js";
17
- import "./chunk-D6NYWNY2.js";
18
19
  import "./chunk-JGGOQOPO.js";
19
20
  import "./chunk-OQ3KXXGH.js";
20
- import "./chunk-QK2IQEBY.js";
21
- import "./chunk-ZUKA5LQU.js";
22
- import "./chunk-BPIA4T3X.js";
21
+ import "./chunk-MVIZLNDV.js";
22
+ import "./chunk-UW2WSGNC.js";
23
+ import "./chunk-OMR2LYUV.js";
23
24
  import "./chunk-7OHJH7BF.js";
25
+ import "./chunk-HNIAZN6U.js";
24
26
  import "./chunk-C3J4HVUN.js";
25
27
  import "./chunk-UFLX7QDP.js";
26
28
  import "./chunk-SI4LHZYW.js";
29
+ import "./chunk-D6NYWNY2.js";
27
30
  import "./chunk-3XNI6LP4.js";
28
31
  export {
29
32
  getEnvironmentData,
30
33
  getSensitiveEnvironmentData,
31
34
  startAnalytics
32
35
  };
33
- //# sourceMappingURL=analytics-HXZNGNCN.js.map
36
+ //# sourceMappingURL=analytics-3C6IM5OH.js.map
@@ -0,0 +1,44 @@
1
+ import {
2
+ compileData,
3
+ recordError,
4
+ recordEvent,
5
+ recordRetry,
6
+ recordTiming,
7
+ reportAnalyticsEvent,
8
+ sendAnalyticsEventFromStdin
9
+ } from "./chunk-NTRP5UPL.js";
10
+ import "./chunk-MSED5ZFM.js";
11
+ import "./chunk-TT7YBXNU.js";
12
+ import "./chunk-G53O4PDO.js";
13
+ import "./chunk-3WA6JLES.js";
14
+ import "./chunk-KITZ5RLX.js";
15
+ import "./chunk-EOOWFAUQ.js";
16
+ import "./chunk-PLO3ASNN.js";
17
+ import "./chunk-SBZZKBLZ.js";
18
+ import "./chunk-ARIPXAMF.js";
19
+ import "./chunk-CM6ALOD7.js";
20
+ import "./chunk-E43EDJOG.js";
21
+ import "./chunk-ODCXYGJ2.js";
22
+ import "./chunk-LBXDGVFS.js";
23
+ import "./chunk-JGGOQOPO.js";
24
+ import "./chunk-OQ3KXXGH.js";
25
+ import "./chunk-MVIZLNDV.js";
26
+ import "./chunk-UW2WSGNC.js";
27
+ import "./chunk-OMR2LYUV.js";
28
+ import "./chunk-7OHJH7BF.js";
29
+ import "./chunk-HNIAZN6U.js";
30
+ import "./chunk-C3J4HVUN.js";
31
+ import "./chunk-UFLX7QDP.js";
32
+ import "./chunk-SI4LHZYW.js";
33
+ import "./chunk-D6NYWNY2.js";
34
+ import "./chunk-3XNI6LP4.js";
35
+ export {
36
+ compileData,
37
+ recordError,
38
+ recordEvent,
39
+ recordRetry,
40
+ recordTiming,
41
+ reportAnalyticsEvent,
42
+ sendAnalyticsEventFromStdin
43
+ };
44
+ //# sourceMappingURL=analytics-TKGJW4CI.js.map
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  renderWarning
3
- } from "./chunk-HNMF25KI.js";
3
+ } from "./chunk-EOOWFAUQ.js";
4
4
  import {
5
5
  addSensitiveMetadata
6
- } from "./chunk-ZLYYWQWW.js";
6
+ } from "./chunk-SBZZKBLZ.js";
7
7
  import {
8
8
  AbortError
9
- } from "./chunk-T446SGE5.js";
9
+ } from "./chunk-ARIPXAMF.js";
10
10
  import {
11
11
  fileExists,
12
12
  findPathUp,
13
13
  readFile,
14
14
  writeFile
15
- } from "./chunk-ZUKA5LQU.js";
15
+ } from "./chunk-UW2WSGNC.js";
16
16
  import {
17
17
  cwd
18
18
  } from "./chunk-C3J4HVUN.js";
@@ -1623,7 +1623,8 @@ function encodeToml(content) {
1623
1623
  }
1624
1624
 
1625
1625
  // ../cli-kit/dist/public/node/toml/toml-file.js
1626
- var import_toml_patch = __toESM(require_toml_patch()), TomlFileError = class extends AbortError {
1626
+ var import_toml_patch = __toESM(require_toml_patch(), 1), TomlFileError = class extends AbortError {
1627
+ path;
1627
1628
  constructor(path, message) {
1628
1629
  super(message), this.name = "TomlFileError", this.path = path;
1629
1630
  }
@@ -1641,8 +1642,11 @@ var import_toml_patch = __toESM(require_toml_patch()), TomlFileError = class ext
1641
1642
  let raw = await readFile(path), file = new _TomlFile(path, {});
1642
1643
  return file.content = file.decode(raw), file;
1643
1644
  }
1645
+ path;
1646
+ content;
1647
+ errors = [];
1644
1648
  constructor(path, content) {
1645
- this.errors = [], this.path = path, this.content = content;
1649
+ this.path = path, this.content = content;
1646
1650
  }
1647
1651
  /**
1648
1652
  * Surgically patch values in the TOML file, preserving comments and formatting.
@@ -1710,22 +1714,21 @@ var import_toml_patch = __toESM(require_toml_patch()), TomlFileError = class ext
1710
1714
  try {
1711
1715
  return decodeToml(raw);
1712
1716
  } catch (err) {
1713
- if (err.line !== void 0 && err.col !== void 0) {
1714
- let description = String(err.message).split(`
1717
+ let tomlError = err;
1718
+ if (tomlError.line !== void 0 && tomlError.col !== void 0) {
1719
+ let description = String(tomlError.message).split(`
1715
1720
  `)[0] ?? "Invalid TOML";
1716
- throw new TomlFileError(this.path, `${description} at row ${err.line}, col ${err.col}`);
1721
+ throw new TomlFileError(this.path, `${description} at row ${tomlError.line}, col ${tomlError.col}`);
1717
1722
  }
1718
1723
  throw err;
1719
1724
  }
1720
1725
  }
1721
1726
  };
1722
1727
  function flattenToPatchEntries(obj, prefix = []) {
1723
- let entries = [];
1724
- for (let [key, value] of Object.entries(obj)) {
1728
+ return Object.entries(obj).flatMap(([key, value]) => {
1725
1729
  let path = [...prefix, key];
1726
- value !== null && typeof value == "object" && !Array.isArray(value) ? entries.push(...flattenToPatchEntries(value, path)) : entries.push([path, value]);
1727
- }
1728
- return entries;
1730
+ return value !== null && typeof value == "object" && !Array.isArray(value) ? flattenToPatchEntries(value, path) : [[path, value]];
1731
+ });
1729
1732
  }
1730
1733
 
1731
1734
  // ../cli-kit/dist/public/node/environments.js
@@ -1771,4 +1774,4 @@ export {
1771
1774
  loadEnvironment,
1772
1775
  environmentFilePath
1773
1776
  };
1774
- //# sourceMappingURL=chunk-TNZEM7JJ.js.map
1777
+ //# sourceMappingURL=chunk-3CEBU7F7.js.map
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  cacheRetrieve,
3
3
  cacheRetrieveOrRepopulate
4
- } from "./chunk-CMK3RV4O.js";
4
+ } from "./chunk-KITZ5RLX.js";
5
5
  import {
6
6
  AbortController,
7
7
  exec
8
- } from "./chunk-HNMF25KI.js";
8
+ } from "./chunk-EOOWFAUQ.js";
9
9
  import {
10
10
  runWithTimer
11
- } from "./chunk-ZLYYWQWW.js";
11
+ } from "./chunk-SBZZKBLZ.js";
12
12
  import {
13
13
  AbortError,
14
14
  BugError
15
- } from "./chunk-T446SGE5.js";
15
+ } from "./chunk-ARIPXAMF.js";
16
16
  import {
17
17
  require_semver
18
18
  } from "./chunk-OQ3KXXGH.js";
@@ -27,7 +27,7 @@ import {
27
27
  outputToken,
28
28
  readFile,
29
29
  writeFile
30
- } from "./chunk-ZUKA5LQU.js";
30
+ } from "./chunk-UW2WSGNC.js";
31
31
  import {
32
32
  dirname,
33
33
  joinPath
@@ -245,63 +245,35 @@ async function addNPMDependenciesWithoutVersionIfNeeded(dependencies, options) {
245
245
  await addNPMDependenciesIfNeeded(dependencies.map((dependency) => ({ name: dependency, version: void 0 })), options);
246
246
  }
247
247
  function argumentsToAddDependenciesWithNPM(dependency, type) {
248
- let command = ["install"];
249
- switch (command = command.concat(dependency), type) {
250
- case "dev":
251
- command.push("--save-dev");
252
- break;
253
- case "peer":
254
- command.push("--save-peer");
255
- break;
256
- case "prod":
257
- command.push("--save-prod");
258
- break;
259
- }
248
+ let command = ["install", dependency, {
249
+ dev: "--save-dev",
250
+ peer: "--save-peer",
251
+ prod: "--save-prod"
252
+ }[type]];
260
253
  return dependency.match(/@\d/g) && command.push("--save-exact"), command;
261
254
  }
262
255
  function argumentsToAddDependenciesWithYarn(dependencies, type, addAtRoot = !1) {
263
- let command = ["add"];
264
- switch (addAtRoot && command.push("-W"), command = command.concat(dependencies), type) {
265
- case "dev":
266
- command.push("--dev");
267
- break;
268
- case "peer":
269
- command.push("--peer");
270
- break;
271
- case "prod":
272
- command.push("--prod");
273
- break;
274
- }
275
- return command;
256
+ let typeFlags = {
257
+ dev: "--dev",
258
+ peer: "--peer",
259
+ prod: "--prod"
260
+ };
261
+ return ["add", ...addAtRoot ? ["-W"] : [], ...dependencies, typeFlags[type]];
276
262
  }
277
263
  function argumentsToAddDependenciesWithPNPM(dependencies, type, addAtRoot = !1) {
278
- let command = ["add"];
279
- switch (addAtRoot && command.push("-w"), command = command.concat(dependencies), type) {
280
- case "dev":
281
- command.push("--save-dev");
282
- break;
283
- case "peer":
284
- command.push("--save-peer");
285
- break;
286
- case "prod":
287
- command.push("--save-prod");
288
- break;
289
- }
290
- return command;
264
+ let typeFlags = {
265
+ dev: "--save-dev",
266
+ peer: "--save-peer",
267
+ prod: "--save-prod"
268
+ };
269
+ return ["add", ...addAtRoot ? ["-w"] : [], ...dependencies, typeFlags[type]];
291
270
  }
292
271
  function argumentsToAddDependenciesWithBun(dependencies, type) {
293
- let command = ["add"];
294
- switch (command = command.concat(dependencies), type) {
295
- case "dev":
296
- command.push("--development");
297
- break;
298
- case "peer":
299
- command.push("--optional");
300
- break;
301
- case "prod":
302
- break;
303
- }
304
- return command;
272
+ let flag = {
273
+ dev: "--development",
274
+ peer: "--optional"
275
+ }[type];
276
+ return ["add", ...dependencies, ...flag ? [flag] : []];
305
277
  }
306
278
  async function findUpAndReadPackageJson(fromDirectory) {
307
279
  let packageJsonPath = await findPathUp("package.json", { cwd: fromDirectory, type: "file" });
@@ -312,8 +284,11 @@ async function findUpAndReadPackageJson(fromDirectory) {
312
284
  throw new FindUpAndReadPackageJsonNotFoundError(fromDirectory);
313
285
  }
314
286
  async function addResolutionOrOverride(directory, dependencies) {
315
- let packageManager2 = await getPackageManager(directory), packageJsonPath = joinPath(directory, "package.json"), packageJsonContent = await readAndParsePackageJson(packageJsonPath);
316
- packageManager2 === "yarn" && (packageJsonContent.resolutions = packageJsonContent.resolutions ? { ...packageJsonContent.resolutions, ...dependencies } : dependencies), (packageManager2 === "npm" || packageManager2 === "pnpm" || packageManager2 === "bun") && (packageJsonContent.overrides = packageJsonContent.overrides ? { ...packageJsonContent.overrides, ...dependencies } : dependencies), await writeFile(packageJsonPath, JSON.stringify(packageJsonContent, null, 2));
287
+ let packageManager2 = await getPackageManager(directory), packageJsonContent = await readAndParsePackageJson(joinPath(directory, "package.json")), key = packageManager2 === "yarn" ? "resolutions" : "overrides";
288
+ packageJsonContent[key] = {
289
+ ...packageJsonContent[key],
290
+ ...dependencies
291
+ }, await writePackageJSON(directory, packageJsonContent);
317
292
  }
318
293
  async function getLatestNPMPackageVersion(name) {
319
294
  return outputDebug(outputContent`Getting the latest version of NPM package: ${outputToken.raw(name)}`), runWithTimer("cmd_all_timing_network_ms")(async () => {
@@ -369,4 +344,4 @@ export {
369
344
  writePackageJSON,
370
345
  inferPackageManager
371
346
  };
372
- //# sourceMappingURL=chunk-K5UHKI43.js.map
347
+ //# sourceMappingURL=chunk-3WA6JLES.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  treeKill
3
- } from "./chunk-QK2IQEBY.js";
3
+ } from "./chunk-MVIZLNDV.js";
4
4
  import {
5
5
  init_cjs_shims
6
6
  } from "./chunk-3XNI6LP4.js";
@@ -26,22 +26,22 @@ function waitForPostRunHookAndExit() {
26
26
  }
27
27
  var hook = async ({ config, Command }) => {
28
28
  await detectStopCommand(Command);
29
- let metadata = await import("./metadata-7RRKVERI.js"), { commandStartOptions } = metadata.getAllSensitiveMetadata();
29
+ let metadata = await import("./metadata-4DNOT3O4.js"), { commandStartOptions } = metadata.getAllSensitiveMetadata();
30
30
  commandStartOptions && await metadata.addSensitiveMetadata(() => ({
31
31
  commandStartOptions: {
32
32
  ...commandStartOptions,
33
33
  endTime: (/* @__PURE__ */ new Date()).getTime()
34
34
  }
35
35
  }));
36
- let { postrun: deprecationsHook } = await import("./deprecations-FOMUQSMA.js");
36
+ let { postrun: deprecationsHook } = await import("./deprecations-XSONJDPJ.js");
37
37
  deprecationsHook(Command);
38
- let { outputDebug } = await import("./output-7VC5AJM7.js"), command = Command.id.replace(/:/g, " ");
39
- outputDebug(`Completed command ${command}`), !command.includes("notifications") && !command.includes("upgrade") && await autoUpgradeIfNeeded();
40
- let { reportAnalyticsEvent } = await import("./analytics-GP57RR6R.js");
38
+ let { outputDebug } = await import("./output-KF5RQHUT.js"), command = Command.id.replace(/:/g, " ");
39
+ outputDebug(`Completed command ${command}`), !command.includes("notifications") && !command.includes("upgrade") && !command.includes("send-analytics") && await autoUpgradeIfNeeded();
40
+ let { reportAnalyticsEvent } = await import("./analytics-TKGJW4CI.js");
41
41
  await reportAnalyticsEvent({ config, exitMode: "ok" }), postRunHookCompleted = !0;
42
42
  };
43
43
  async function autoUpgradeIfNeeded() {
44
- let { versionToAutoUpgrade, warnIfUpgradeAvailable } = await import("./upgrade-AYIRDOVJ.js"), newerVersion = versionToAutoUpgrade();
44
+ let { versionToAutoUpgrade, warnIfUpgradeAvailable } = await import("./upgrade-YR43DQNI.js"), newerVersion = versionToAutoUpgrade();
45
45
  if (!newerVersion) {
46
46
  await warnIfUpgradeAvailable();
47
47
  return;
@@ -49,7 +49,7 @@ async function autoUpgradeIfNeeded() {
49
49
  if (process.env.SHOPIFY_CLI_FORCE_AUTO_UPGRADE === "1")
50
50
  await performAutoUpgrade(newerVersion);
51
51
  else {
52
- let { runAtMinimumInterval } = await import("./conf-store-ZYB6IGB7.js");
52
+ let { runAtMinimumInterval } = await import("./conf-store-PMOFWF3V.js");
53
53
  await runAtMinimumInterval("auto-upgrade", { days: 1 }, async () => {
54
54
  await performAutoUpgrade(newerVersion);
55
55
  });
@@ -57,11 +57,11 @@ async function autoUpgradeIfNeeded() {
57
57
  }
58
58
  async function performAutoUpgrade(newerVersion) {
59
59
  let [{ CLI_KIT_VERSION }, { isMajorVersionChange }, { outputWarn, outputDebug }, { getOutputUpdateCLIReminder, runCLIUpgrade, hasBlockingAutoUpgradeNotification }, metadata] = await Promise.all([
60
- import("./version-OHC3XUOI.js"),
61
- import("./version-CCMJSEAI.js"),
62
- import("./output-7VC5AJM7.js"),
63
- import("./upgrade-AYIRDOVJ.js"),
64
- import("./metadata-7RRKVERI.js")
60
+ import("./version-XTE3XEL6.js"),
61
+ import("./version-CS66ODDA.js"),
62
+ import("./output-KF5RQHUT.js"),
63
+ import("./upgrade-YR43DQNI.js"),
64
+ import("./metadata-4DNOT3O4.js")
65
65
  ]);
66
66
  if (isMajorVersionChange(CLI_KIT_VERSION, newerVersion)) {
67
67
  outputWarn(getOutputUpdateCLIReminder(newerVersion, !0)), await metadata.addPublicMetadata(() => ({
@@ -81,8 +81,8 @@ async function performAutoUpgrade(newerVersion) {
81
81
  let errorMessage = `Auto-upgrade failed: ${error}`;
82
82
  outputDebug(errorMessage), outputWarn(getOutputUpdateCLIReminder(newerVersion)), await metadata.addPublicMetadata(() => ({ env_auto_upgrade_success: !1 }));
83
83
  let [{ sendErrorToBugsnag }, { inferPackageManagerForGlobalCLI }] = await Promise.all([
84
- import("./error-handler-PXVIL3GI.js"),
85
- import("./is-global-QP5DA2PW.js")
84
+ import("./error-handler-OSY5Z5EY.js"),
85
+ import("./is-global-27HWUS75.js")
86
86
  ]), enrichedError = Object.assign(new Error(errorMessage), {
87
87
  packageManager: inferPackageManagerForGlobalCLI(),
88
88
  platform: process.platform,
@@ -96,7 +96,7 @@ async function detectStopCommand(commandClass) {
96
96
  if (commandClass && "analyticsStopCommand" in commandClass && typeof commandClass.analyticsStopCommand == "function") {
97
97
  let stopCommand = commandClass.analyticsStopCommand();
98
98
  if (stopCommand) {
99
- let metadata = await import("./metadata-7RRKVERI.js"), { commandStartOptions } = metadata.getAllSensitiveMetadata();
99
+ let metadata = await import("./metadata-4DNOT3O4.js"), { commandStartOptions } = metadata.getAllSensitiveMetadata();
100
100
  if (!commandStartOptions)
101
101
  return;
102
102
  await metadata.addSensitiveMetadata(() => ({
@@ -114,4 +114,4 @@ export {
114
114
  waitForPostRunHookAndExit,
115
115
  hook
116
116
  };
117
- //# sourceMappingURL=chunk-JK6PBDEW.js.map
117
+ //# sourceMappingURL=chunk-7YZDH26Z.js.map
@@ -0,0 +1,179 @@
1
+ import {
2
+ require_lib
3
+ } from "./chunk-E43EDJOG.js";
4
+ import {
5
+ TokenizedString,
6
+ stringifyMessage,
7
+ tokenItemToString
8
+ } from "./chunk-UW2WSGNC.js";
9
+ import {
10
+ normalizePath
11
+ } from "./chunk-C3J4HVUN.js";
12
+ import {
13
+ __toESM,
14
+ init_cjs_shims
15
+ } from "./chunk-3XNI6LP4.js";
16
+
17
+ // ../cli-kit/dist/public/node/error.js
18
+ init_cjs_shims();
19
+
20
+ // ../cli-kit/dist/private/node/analytics/graphql-error-codes.js
21
+ init_cjs_shims();
22
+ var RATE_LIMIT_CODES = /* @__PURE__ */ new Set(["THROTTLED", "429"]), PERMISSION_CODES = /* @__PURE__ */ new Set(["ACCESS_DENIED", "access_denied"]);
23
+ function graphQLErrorCodes(errors) {
24
+ return Array.isArray(errors) ? errors.flatMap((entry) => {
25
+ let found = [], error = entry, code = error?.extensions?.code;
26
+ typeof code == "string" && found.push(code);
27
+ let appErrors = error?.extensions?.app_errors?.errors;
28
+ if (Array.isArray(appErrors))
29
+ for (let appError of appErrors) {
30
+ let category = appError?.category;
31
+ typeof category == "string" && found.push(category);
32
+ }
33
+ return found;
34
+ }) : [];
35
+ }
36
+ function isRateLimitCode(code) {
37
+ return code !== void 0 && RATE_LIMIT_CODES.has(code);
38
+ }
39
+ function isPermissionCode(code) {
40
+ return code !== void 0 && PERMISSION_CODES.has(code);
41
+ }
42
+ function hasRateLimitCode(errors) {
43
+ return graphQLErrorCodes(errors).some(isRateLimitCode);
44
+ }
45
+
46
+ // ../cli-kit/dist/public/node/error.js
47
+ var import_core = __toESM(require_lib(), 1), FatalErrorType;
48
+ (function(FatalErrorType2) {
49
+ FatalErrorType2[FatalErrorType2.Abort = 0] = "Abort", FatalErrorType2[FatalErrorType2.AbortSilent = 1] = "AbortSilent", FatalErrorType2[FatalErrorType2.Bug = 2] = "Bug";
50
+ })(FatalErrorType || (FatalErrorType = {}));
51
+ var CancelExecution = class extends Error {
52
+ }, FatalError = class extends Error {
53
+ tryMessage;
54
+ type;
55
+ nextSteps;
56
+ formattedMessage;
57
+ customSections;
58
+ skipOclifErrorHandling;
59
+ /**
60
+ * Creates a new FatalError error.
61
+ *
62
+ * @param message - The error message.
63
+ * @param type - The type of fatal error.
64
+ * @param tryMessage - The message that recommends next steps to the user.
65
+ * You can pass a string a {@link TokenizedString} or a {@link TokenItem}
66
+ * if you need to style the message inside the error Banner component.
67
+ * @param nextSteps - Message to show as "next steps" with suggestions to solve the issue.
68
+ * @param customSections - Custom sections to show in the error banner. To be used if nextSteps is not enough.
69
+ */
70
+ constructor(message, type, tryMessage = null, nextSteps, customSections) {
71
+ let messageIsOutputMessage = typeof message == "string" || "value" in message;
72
+ super(messageIsOutputMessage ? stringifyMessage(message) : tokenItemToString(message)), tryMessage ? tryMessage instanceof TokenizedString ? this.tryMessage = stringifyMessage(tryMessage) : this.tryMessage = tryMessage : this.tryMessage = null, this.type = type, this.nextSteps = nextSteps, this.customSections = customSections, this.skipOclifErrorHandling = !0, messageIsOutputMessage || (this.formattedMessage = message);
73
+ }
74
+ }, AbortError = class extends FatalError {
75
+ constructor(message, tryMessage = null, nextSteps, customSections) {
76
+ super(message, FatalErrorType.Abort, tryMessage, nextSteps, customSections);
77
+ }
78
+ }, ExternalError = class extends FatalError {
79
+ command;
80
+ args;
81
+ constructor(message, command, args, tryMessage = null) {
82
+ super(message, FatalErrorType.Abort, tryMessage), this.command = command, this.args = args;
83
+ }
84
+ }, AbortSilentError = class extends FatalError {
85
+ constructor() {
86
+ super("", FatalErrorType.AbortSilent);
87
+ }
88
+ }, BugError = class extends FatalError {
89
+ constructor(message, tryMessage = null) {
90
+ super(message, FatalErrorType.Bug, tryMessage);
91
+ }
92
+ };
93
+ async function handler(error) {
94
+ let fatal;
95
+ if (isFatal(error))
96
+ fatal = error;
97
+ else if (typeof error == "string")
98
+ fatal = new BugError(error);
99
+ else if (error instanceof Error)
100
+ fatal = new BugError(error.message), fatal.stack = error.stack;
101
+ else {
102
+ let maybeError = error;
103
+ fatal = new BugError(maybeError?.message ?? "Unknown error"), maybeError?.stack && (fatal.stack = maybeError?.stack);
104
+ }
105
+ let { renderFatalError } = await import("./ui-KTYAOJV5.js");
106
+ return renderFatalError(fatal), Promise.resolve(error);
107
+ }
108
+ function errorMapper(error) {
109
+ if (error instanceof import_core.Errors.CLIError) {
110
+ let mappedError = new AbortError(error.message);
111
+ return mappedError.stack = error.stack, Promise.resolve(mappedError);
112
+ } else
113
+ return Promise.resolve(error);
114
+ }
115
+ function isFatal(error) {
116
+ try {
117
+ return Object.prototype.hasOwnProperty.call(error, "type");
118
+ } catch {
119
+ return !1;
120
+ }
121
+ }
122
+ function shouldReportErrorAsUnexpected(error) {
123
+ if (!isFatal(error)) {
124
+ if (error instanceof Error) {
125
+ if (isExpectedApiError(error))
126
+ return !1;
127
+ let message = error.message;
128
+ return !errorMessageImpliesEnvironmentIssue(message);
129
+ }
130
+ return !0;
131
+ }
132
+ return error.type === FatalErrorType.Bug;
133
+ }
134
+ function isExpectedApiError(error) {
135
+ let candidate = error;
136
+ if (typeof candidate.response != "object" || candidate.response === null || candidate.request === void 0)
137
+ return !1;
138
+ let status = candidate.response.status;
139
+ return status === 401 || status === 429 ? !0 : hasRateLimitCode(candidate.response.errors);
140
+ }
141
+ function cleanSingleStackTracePath(filePath) {
142
+ return normalizePath(filePath).replace("file:/", "/").replace(/^\/?[A-Z]:/, "");
143
+ }
144
+ function errorMessageImpliesEnvironmentIssue(message) {
145
+ return [
146
+ "EPERM: operation not permitted, scandir",
147
+ "EPERM: operation not permitted, rename",
148
+ "EACCES: permission denied",
149
+ "EPERM: operation not permitted, symlink",
150
+ "This version of npm supports the following node versions",
151
+ "EBUSY: resource busy or locked",
152
+ "ENOTEMPTY: directory not empty",
153
+ "getaddrinfo ENOTFOUND",
154
+ "Client network socket disconnected before secure TLS connection was established",
155
+ "spawn EPERM",
156
+ "socket hang up",
157
+ "The user aborted a request.",
158
+ "write EPIPE",
159
+ "Unsupported platform"
160
+ ].some((issueMessage) => message.includes(issueMessage));
161
+ }
162
+
163
+ export {
164
+ graphQLErrorCodes,
165
+ isRateLimitCode,
166
+ isPermissionCode,
167
+ hasRateLimitCode,
168
+ CancelExecution,
169
+ FatalError,
170
+ AbortError,
171
+ ExternalError,
172
+ AbortSilentError,
173
+ BugError,
174
+ handler,
175
+ errorMapper,
176
+ shouldReportErrorAsUnexpected,
177
+ cleanSingleStackTracePath
178
+ };
179
+ //# sourceMappingURL=chunk-ARIPXAMF.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  captureOutput,
3
3
  require_lib
4
- } from "./chunk-HNMF25KI.js";
4
+ } from "./chunk-EOOWFAUQ.js";
5
5
  import {
6
6
  require_semver
7
7
  } from "./chunk-OQ3KXXGH.js";
@@ -52,4 +52,4 @@ export {
52
52
  isPreReleaseVersion,
53
53
  isMajorVersionChange
54
54
  };
55
- //# sourceMappingURL=chunk-3JSJSGAQ.js.map
55
+ //# sourceMappingURL=chunk-CCB7HUXM.js.map
@@ -0,0 +1,32 @@
1
+ import {
2
+ init_cjs_shims
3
+ } from "./chunk-3XNI6LP4.js";
4
+
5
+ // ../../node_modules/.pnpm/mimic-fn@4.0.0/node_modules/mimic-fn/index.js
6
+ init_cjs_shims();
7
+ var copyProperty = (to, from, property, ignoreNonConfigurable) => {
8
+ if (property === "length" || property === "prototype" || property === "arguments" || property === "caller")
9
+ return;
10
+ let toDescriptor = Object.getOwnPropertyDescriptor(to, property), fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
11
+ !canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable || Object.defineProperty(to, property, fromDescriptor);
12
+ }, canCopyProperty = function(toDescriptor, fromDescriptor) {
13
+ return toDescriptor === void 0 || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
14
+ }, changePrototype = (to, from) => {
15
+ let fromPrototype = Object.getPrototypeOf(from);
16
+ fromPrototype !== Object.getPrototypeOf(to) && Object.setPrototypeOf(to, fromPrototype);
17
+ }, wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}*/
18
+ ${fromBody}`, toStringDescriptor = Object.getOwnPropertyDescriptor(Function.prototype, "toString"), toStringName = Object.getOwnPropertyDescriptor(Function.prototype.toString, "name"), changeToString = (to, from, name) => {
19
+ let withName = name === "" ? "" : `with ${name.trim()}() `, newToString = wrappedToString.bind(null, withName, from.toString());
20
+ Object.defineProperty(newToString, "name", toStringName), Object.defineProperty(to, "toString", { ...toStringDescriptor, value: newToString });
21
+ };
22
+ function mimicFunction(to, from, { ignoreNonConfigurable = !1 } = {}) {
23
+ let { name } = to;
24
+ for (let property of Reflect.ownKeys(from))
25
+ copyProperty(to, from, property, ignoreNonConfigurable);
26
+ return changePrototype(to, from), changeToString(to, from, name), to;
27
+ }
28
+
29
+ export {
30
+ mimicFunction
31
+ };
32
+ //# sourceMappingURL=chunk-CM6ALOD7.js.map
@@ -5,12 +5,12 @@ import {
5
5
  import {
6
6
  require_is_wsl
7
7
  } from "./chunk-LBXDGVFS.js";
8
- import {
9
- require_typescript
10
- } from "./chunk-D6NYWNY2.js";
11
8
  import {
12
9
  require_semver
13
10
  } from "./chunk-OQ3KXXGH.js";
11
+ import {
12
+ require_typescript
13
+ } from "./chunk-D6NYWNY2.js";
14
14
  import {
15
15
  __commonJS,
16
16
  __require,
@@ -11802,4 +11802,4 @@ ejs/lib/ejs.js:
11802
11802
  * @license {@link http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0}
11803
11803
  *)
11804
11804
  */
11805
- //# sourceMappingURL=chunk-K5NLRHZR.js.map
11805
+ //# sourceMappingURL=chunk-E43EDJOG.js.map