@shopify/cli 3.75.4 → 3.76.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 (79) hide show
  1. package/dist/{chunk-NNHELYN3.js → chunk-247SAMPG.js} +3 -3
  2. package/dist/{chunk-KRPDLCMT.js → chunk-2LCBNWGB.js} +11 -11
  3. package/dist/{chunk-3FPXLCF5.js → chunk-3HWN5QZP.js} +3 -3
  4. package/dist/{chunk-WCTQ65EF.js → chunk-7MKO46I5.js} +3 -3
  5. package/dist/{chunk-QGAHQAXG.js → chunk-AS4YOVZB.js} +3 -3
  6. package/dist/{chunk-HV2KH53A.js → chunk-AW63CHBD.js} +3 -3
  7. package/dist/{chunk-Y3V7CDDP.js → chunk-CUEBFCNF.js} +4 -4
  8. package/dist/{chunk-CBIPUP4Q.js → chunk-DSEDXHIL.js} +3 -3
  9. package/dist/{chunk-EFDLFMUG.js → chunk-F5WG7YRC.js} +2 -2
  10. package/dist/{chunk-O5UY3K6F.js → chunk-FKVY6WNT.js} +4 -4
  11. package/dist/{chunk-DFK6H6Q2.js → chunk-FSL57OBM.js} +59 -19
  12. package/dist/{chunk-VH3W76GN.js → chunk-FVI46GAE.js} +3 -3
  13. package/dist/{chunk-3CB5D2ZO.js → chunk-GDAGNYN6.js} +2 -2
  14. package/dist/{chunk-LH3QC4DP.js → chunk-GSC3DSZN.js} +4 -3
  15. package/dist/{chunk-OSDKLELI.js → chunk-IB2GR2NI.js} +4 -4
  16. package/dist/{chunk-LRTITZPZ.js → chunk-IGXCBQCI.js} +2 -2
  17. package/dist/{chunk-EPSGPKFO.js → chunk-IV3Z7KW6.js} +5 -5
  18. package/dist/{chunk-LWZVD7VH.js → chunk-KRBTUAPG.js} +3 -3
  19. package/dist/{chunk-4IY25QPC.js → chunk-LQLKKAEX.js} +3 -3
  20. package/dist/{chunk-R6ST4Q4K.js → chunk-M7TO4P43.js} +2 -2
  21. package/dist/{chunk-R2KFJZQF.js → chunk-NGMTB27N.js} +36 -15
  22. package/dist/{chunk-DLW5TTAO.js → chunk-OAIHYIZM.js} +3 -3
  23. package/dist/{chunk-2OX7ESM2.js → chunk-OLVUPFMV.js} +6 -6
  24. package/dist/{chunk-R27Y5T4H.js → chunk-QFEXM6TL.js} +2 -2
  25. package/dist/{chunk-V4FD5VKG.js → chunk-R3OLOJM7.js} +74 -11
  26. package/dist/{chunk-37RGPUOL.js → chunk-SPTKJZLQ.js} +3 -3
  27. package/dist/{chunk-IROHTJ5D.js → chunk-VCFDSABQ.js} +6 -6
  28. package/dist/{chunk-ARR2ZV5X.js → chunk-WF3LQ6VY.js} +3 -3
  29. package/dist/{chunk-TPUB2CUK.js → chunk-WJRSLVVW.js} +2 -2
  30. package/dist/{chunk-WHYTGJJU.js → chunk-WRB46MIH.js} +10 -9
  31. package/dist/{chunk-VIMSAJBK.js → chunk-WXEVFXY4.js} +93 -163
  32. package/dist/{chunk-7DRESMZH.js → chunk-Y5V7ZNMS.js} +3 -3
  33. package/dist/{chunk-IAFN3BTU.js → chunk-YJUMZEX7.js} +2 -2
  34. package/dist/{chunk-7DV7FO6D.js → chunk-YWGDPGEE.js} +7 -6
  35. package/dist/cli/commands/auth/logout.js +11 -12
  36. package/dist/cli/commands/auth/logout.test.js +12 -13
  37. package/dist/cli/commands/cache/clear.js +10 -11
  38. package/dist/cli/commands/debug/command-flags.js +10 -11
  39. package/dist/cli/commands/docs/generate.js +10 -11
  40. package/dist/cli/commands/docs/generate.test.js +10 -11
  41. package/dist/cli/commands/help.js +10 -11
  42. package/dist/cli/commands/kitchen-sink/async.js +11 -12
  43. package/dist/cli/commands/kitchen-sink/async.test.js +11 -12
  44. package/dist/cli/commands/kitchen-sink/index.js +13 -14
  45. package/dist/cli/commands/kitchen-sink/index.test.js +13 -14
  46. package/dist/cli/commands/kitchen-sink/prompts.js +11 -12
  47. package/dist/cli/commands/kitchen-sink/prompts.test.js +11 -12
  48. package/dist/cli/commands/kitchen-sink/static.js +11 -12
  49. package/dist/cli/commands/kitchen-sink/static.test.js +11 -12
  50. package/dist/cli/commands/notifications/generate.js +11 -12
  51. package/dist/cli/commands/notifications/list.js +11 -12
  52. package/dist/cli/commands/search.js +11 -12
  53. package/dist/cli/commands/upgrade.js +11 -12
  54. package/dist/cli/commands/version.js +11 -12
  55. package/dist/cli/commands/version.test.js +11 -12
  56. package/dist/cli/services/commands/notifications.js +6 -6
  57. package/dist/cli/services/commands/search.js +2 -2
  58. package/dist/cli/services/commands/search.test.js +2 -2
  59. package/dist/cli/services/commands/version.js +3 -3
  60. package/dist/cli/services/commands/version.test.js +4 -4
  61. package/dist/cli/services/kitchen-sink/async.js +2 -2
  62. package/dist/cli/services/kitchen-sink/prompts.js +2 -2
  63. package/dist/cli/services/kitchen-sink/static.js +2 -2
  64. package/dist/cli/services/upgrade.js +3 -3
  65. package/dist/cli/services/upgrade.test.js +5 -7
  66. package/dist/{custom-oclif-loader-24E7DVTH.js → custom-oclif-loader-K3EL2OAR.js} +2 -2
  67. package/dist/{error-handler-7V7HCPFM.js → error-handler-BADTRHFV.js} +8 -9
  68. package/dist/hooks/postrun.js +8 -8
  69. package/dist/hooks/prerun.js +10 -8
  70. package/dist/index.js +7204 -6858
  71. package/dist/{local-WHLQPZNS.js → local-OPE3NHTK.js} +2 -2
  72. package/dist/{node-AJELTNRR.js → node-KXPRSMZI.js} +12 -13
  73. package/dist/{node-package-manager-KULBOPYH.js → node-package-manager-I364XLRB.js} +3 -3
  74. package/dist/tsconfig.tsbuildinfo +1 -1
  75. package/dist/{ui-B4IIF7YO.js → ui-OLBMRQ45.js} +2 -2
  76. package/dist/{workerd-PWW3BB6B.js → workerd-U7MSRKWK.js} +12 -13
  77. package/oclif.manifest.json +46 -22
  78. package/package.json +6 -6
  79. package/dist/chunk-VTTVH23Q.js +0 -63
@@ -1,25 +1,25 @@
1
1
  import {
2
2
  fetch,
3
3
  z
4
- } from "./chunk-O5UY3K6F.js";
4
+ } from "./chunk-FKVY6WNT.js";
5
5
  import {
6
6
  CLI_KIT_VERSION
7
- } from "./chunk-EFDLFMUG.js";
7
+ } from "./chunk-F5WG7YRC.js";
8
8
  import {
9
9
  cacheRetrieve,
10
- cacheRetrieveOrRepopulate,
11
10
  cacheStore,
12
11
  versionSatisfies
13
- } from "./chunk-LH3QC4DP.js";
12
+ } from "./chunk-GSC3DSZN.js";
14
13
  import {
15
14
  AbortSilentError,
15
+ exec,
16
16
  isTruthy,
17
17
  jsonOutputEnabled,
18
18
  outputDebug,
19
19
  renderError,
20
20
  renderInfo,
21
21
  renderWarning
22
- } from "./chunk-V4FD5VKG.js";
22
+ } from "./chunk-R3OLOJM7.js";
23
23
  import {
24
24
  init_cjs_shims
25
25
  } from "./chunk-PKR7KJ6P.js";
@@ -41,7 +41,7 @@ function setCurrentCommandId(commandId) {
41
41
  }
42
42
 
43
43
  // ../cli-kit/dist/public/node/notifications-system.js
44
- var URL = "https://cdn.shopify.com/static/cli/notifications.json", CACHE_DURATION_IN_MS = 3600 * 1e3;
44
+ var URL = "https://cdn.shopify.com/static/cli/notifications.json", EMPTY_CACHE_MESSAGE = "Cache is empty";
45
45
  function url() {
46
46
  return process.env.SHOPIFY_CLI_NOTIFICATIONS_URL ?? URL;
47
47
  }
@@ -65,7 +65,7 @@ var NotificationSchema = z.object({
65
65
  }), NotificationsSchema = z.object({ notifications: z.array(NotificationSchema) });
66
66
  async function showNotificationsIfNeeded(currentSurfaces, environment = process.env) {
67
67
  try {
68
- if (skipNotifications(environment))
68
+ if (skipNotifications(environment) || jsonOutputEnabled(environment))
69
69
  return;
70
70
  let notifications = await getNotifications(), commandId = getCurrentCommandId(), notificationsToShow = filterNotifications(notifications.notifications, commandId, currentSurfaces);
71
71
  outputDebug(`Notifications to show: ${notificationsToShow.length}`), await renderNotifications(notificationsToShow);
@@ -73,13 +73,14 @@ async function showNotificationsIfNeeded(currentSurfaces, environment = process.
73
73
  if (error.message === "abort")
74
74
  throw new AbortSilentError();
75
75
  let errorMessage = `Error retrieving notifications: ${error.message}`;
76
- outputDebug(errorMessage);
77
- let { sendErrorToBugsnag } = await import("./error-handler-7V7HCPFM.js");
76
+ if (outputDebug(errorMessage), error.message === EMPTY_CACHE_MESSAGE)
77
+ return;
78
+ let { sendErrorToBugsnag } = await import("./error-handler-BADTRHFV.js");
78
79
  await sendErrorToBugsnag(errorMessage, "unexpected_error");
79
80
  }
80
81
  }
81
- function skipNotifications(environment) {
82
- return isTruthy(environment.CI) || isTruthy(environment.SHOPIFY_UNIT_TEST) || jsonOutputEnabled(environment);
82
+ function skipNotifications(environment = process.env) {
83
+ return isTruthy(environment.CI) || isTruthy(environment.SHOPIFY_UNIT_TEST);
83
84
  }
84
85
  async function renderNotifications(notifications) {
85
86
  notifications.slice(0, 2).forEach((notification) => {
@@ -105,15 +106,33 @@ async function renderNotifications(notifications) {
105
106
  });
106
107
  }
107
108
  async function getNotifications() {
108
- let cacheKey = `notifications-${url()}`, rawNotifications = await cacheRetrieveOrRepopulate(cacheKey, fetchNotifications, CACHE_DURATION_IN_MS), notifications = JSON.parse(rawNotifications);
109
+ let cacheKey = `notifications-${url()}`, rawNotifications = cacheRetrieve(cacheKey)?.value;
110
+ if (!rawNotifications)
111
+ throw new Error(EMPTY_CACHE_MESSAGE);
112
+ let notifications = JSON.parse(rawNotifications);
109
113
  return NotificationsSchema.parse(notifications);
110
114
  }
111
115
  async function fetchNotifications() {
112
- outputDebug("No cached notifications found. Fetching them...");
116
+ outputDebug("Fetching notifications...");
113
117
  let response = await fetch(url(), { signal: AbortSignal.timeout(3 * 1e3) });
114
118
  if (response.status !== 200)
115
119
  throw new Error(`Failed to fetch notifications: ${response.statusText}`);
116
- return response.text();
120
+ let rawNotifications = await response.text(), notifications = JSON.parse(rawNotifications), result = NotificationsSchema.parse(notifications);
121
+ return await cacheNotifications(rawNotifications), result;
122
+ }
123
+ async function cacheNotifications(notifications) {
124
+ cacheStore(`notifications-${url()}`, notifications), outputDebug(`Notifications from ${url()} stored in the cache`);
125
+ }
126
+ function fetchNotificationsInBackground(currentCommand, argv = process.argv, environment = process.env) {
127
+ if (skipNotifications(environment))
128
+ return;
129
+ let command = "shopify", args = ["notifications", "list"];
130
+ if (argv[0] && argv[0] !== "shopify") {
131
+ command = argv[0];
132
+ let indexValue = currentCommand.split(":")[0] ?? "", index = argv.indexOf(indexValue);
133
+ index > 0 && args.unshift(...argv.slice(1, index));
134
+ }
135
+ exec(command, args, { background: !0, env: { ...process.env, SHOPIFY_CLI_NO_ANALYTICS: "1" } });
117
136
  }
118
137
  function filterNotifications(notifications, commandId, currentSurfaces, today = new Date((/* @__PURE__ */ new Date()).setUTCHours(0, 0, 0, 0)), currentVersion = CLI_KIT_VERSION) {
119
138
  return notifications.filter((notification) => filterByVersion(notification, currentVersion)).filter((notifications2) => filterByDate(notifications2, today)).filter((notification) => filterByCommand(notification, commandId)).filter((notification) => filterBySurface(notification, commandId, currentSurfaces)).filter((notification) => filterByFrequency(notification));
@@ -160,6 +179,8 @@ export {
160
179
  setCurrentCommandId,
161
180
  showNotificationsIfNeeded,
162
181
  getNotifications,
182
+ fetchNotifications,
183
+ fetchNotificationsInBackground,
163
184
  stringifyFilters
164
185
  };
165
- //# sourceMappingURL=chunk-R2KFJZQF.js.map
186
+ //# sourceMappingURL=chunk-NGMTB27N.js.map
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  base_command_default
3
- } from "./chunk-WHYTGJJU.js";
3
+ } from "./chunk-WRB46MIH.js";
4
4
  import {
5
5
  mkdir,
6
6
  outputInfo,
7
7
  rmdir,
8
8
  writeFile
9
- } from "./chunk-V4FD5VKG.js";
9
+ } from "./chunk-R3OLOJM7.js";
10
10
  import {
11
11
  cwd,
12
12
  joinPath
@@ -115,4 +115,4 @@ export {
115
115
  writeCommandFlagInterface,
116
116
  writeCommandUsageExampleFile
117
117
  };
118
- //# sourceMappingURL=chunk-DLW5TTAO.js.map
118
+ //# sourceMappingURL=chunk-OAIHYIZM.js.map
@@ -2,16 +2,16 @@ import {
2
2
  getEnvironmentData,
3
3
  getLastSeenUserIdAfterAuth,
4
4
  getSensitiveEnvironmentData
5
- } from "./chunk-VIMSAJBK.js";
5
+ } from "./chunk-WXEVFXY4.js";
6
6
  import {
7
7
  fetch
8
- } from "./chunk-O5UY3K6F.js";
8
+ } from "./chunk-FKVY6WNT.js";
9
9
  import {
10
10
  CLI_KIT_VERSION
11
- } from "./chunk-EFDLFMUG.js";
11
+ } from "./chunk-F5WG7YRC.js";
12
12
  import {
13
13
  runWithRateLimit
14
- } from "./chunk-LH3QC4DP.js";
14
+ } from "./chunk-GSC3DSZN.js";
15
15
  import {
16
16
  alwaysLogAnalytics,
17
17
  alwaysLogMetrics,
@@ -28,7 +28,7 @@ import {
28
28
  outputDebug,
29
29
  outputToken,
30
30
  reportingRateLimit
31
- } from "./chunk-V4FD5VKG.js";
31
+ } from "./chunk-R3OLOJM7.js";
32
32
  import {
33
33
  __commonJS,
34
34
  __esm,
@@ -15930,4 +15930,4 @@ export {
15930
15930
  requestIdsCollection,
15931
15931
  reportAnalyticsEvent
15932
15932
  };
15933
- //# sourceMappingURL=chunk-2OX7ESM2.js.map
15933
+ //# sourceMappingURL=chunk-OLVUPFMV.js.map
@@ -7,7 +7,7 @@ import {
7
7
  renderSuccess,
8
8
  renderTable,
9
9
  renderWarning
10
- } from "./chunk-V4FD5VKG.js";
10
+ } from "./chunk-R3OLOJM7.js";
11
11
  import {
12
12
  init_cjs_shims
13
13
  } from "./chunk-PKR7KJ6P.js";
@@ -203,4 +203,4 @@ async function staticService() {
203
203
  export {
204
204
  staticService
205
205
  };
206
- //# sourceMappingURL=chunk-R27Y5T4H.js.map
206
+ //# sourceMappingURL=chunk-QFEXM6TL.js.map
@@ -23777,14 +23777,14 @@ var homedir = os3.homedir(), tmpdir2 = os3.tmpdir(), { env } = process3, macos =
23777
23777
  temp: path5.join(tmpdir2, name)
23778
23778
  };
23779
23779
  }, linux = (name) => {
23780
- let username = path5.basename(homedir);
23780
+ let username2 = path5.basename(homedir);
23781
23781
  return {
23782
23782
  data: path5.join(env.XDG_DATA_HOME || path5.join(homedir, ".local", "share"), name),
23783
23783
  config: path5.join(env.XDG_CONFIG_HOME || path5.join(homedir, ".config"), name),
23784
23784
  cache: path5.join(env.XDG_CACHE_HOME || path5.join(homedir, ".cache"), name),
23785
23785
  // https://wiki.debian.org/XDGBaseDirectorySpecification#state
23786
23786
  log: path5.join(env.XDG_STATE_HOME || path5.join(homedir, ".local", "state"), name),
23787
- temp: path5.join(tmpdir2, username, name)
23787
+ temp: path5.join(tmpdir2, username2, name)
23788
23788
  };
23789
23789
  };
23790
23790
  function envPaths(name, { suffix = "nodejs" } = {}) {
@@ -23941,6 +23941,9 @@ function buildProcessTree(parentPid, tree, pidsToProcess, spawnChildProcessesLis
23941
23941
  ps.on("close", onClose);
23942
23942
  }
23943
23943
 
23944
+ // ../cli-kit/dist/public/node/os.js
23945
+ init_cjs_shims();
23946
+
23944
23947
  // ../../node_modules/.pnpm/execa@7.2.0/node_modules/execa/index.js
23945
23948
  init_cjs_shims();
23946
23949
  var import_cross_spawn = __toESM(require_cross_spawn(), 1);
@@ -24780,17 +24783,74 @@ function create$(options) {
24780
24783
  }
24781
24784
  var $ = create$();
24782
24785
 
24786
+ // ../cli-kit/dist/public/node/os.js
24787
+ import { userInfo as osUserInfo } from "os";
24788
+ async function username(platform2 = process.platform) {
24789
+ outputDebug(outputContent`Obtaining user name...`);
24790
+ let environmentVariable = getEnvironmentVariable();
24791
+ if (environmentVariable)
24792
+ return environmentVariable;
24793
+ let userInfoUsername = getUsernameFromOsUserInfo();
24794
+ if (userInfoUsername)
24795
+ return userInfoUsername;
24796
+ try {
24797
+ if (platform2 === "win32") {
24798
+ let { stdout } = await execa("whoami");
24799
+ return cleanWindowsCommand(stdout);
24800
+ }
24801
+ let { stdout: userId } = await execa("id", ["-u"]);
24802
+ try {
24803
+ let { stdout } = await execa("id", ["-un", userId]);
24804
+ return stdout;
24805
+ } catch {
24806
+ }
24807
+ return makeUsernameFromId(userId);
24808
+ } catch {
24809
+ return null;
24810
+ }
24811
+ }
24812
+ function platformAndArch(platform2 = process.platform, arch = process.arch) {
24813
+ let archString;
24814
+ return arch === "x64" ? archString = "amd64" : arch === "ia32" ? archString = "386" : archString = arch, { platform: platform2.match(/^win.+/) ? "windows" : platform2, arch: archString };
24815
+ }
24816
+ function getEnvironmentVariable() {
24817
+ let { env: env3 } = process;
24818
+ return env3.SUDO_USER || env3.C9_USER || env3.LOGNAME || env3.USER || env3.LNAME || env3.USERNAME;
24819
+ }
24820
+ function getUsernameFromOsUserInfo() {
24821
+ try {
24822
+ return osUserInfo().username;
24823
+ } catch {
24824
+ return null;
24825
+ }
24826
+ }
24827
+ function cleanWindowsCommand(value) {
24828
+ return value.replace(/^.*\\/, "");
24829
+ }
24830
+ function makeUsernameFromId(userId) {
24831
+ return `no-username-${userId}`;
24832
+ }
24833
+
24783
24834
  // ../cli-kit/dist/public/node/system.js
24784
24835
  var import_which = __toESM(require_lib2());
24785
24836
  async function openURL(url) {
24786
- await (await import("./open-BHIF7E3E.js")).default(url);
24837
+ let externalOpen = await import("./open-BHIF7E3E.js");
24838
+ try {
24839
+ return await externalOpen.default(url), !0;
24840
+ } catch {
24841
+ return !1;
24842
+ }
24787
24843
  }
24788
24844
  async function captureOutput(command, args, options) {
24789
24845
  return (await buildExec(command, args, options)).stdout;
24790
24846
  }
24791
24847
  async function exec2(command, args, options) {
24848
+ if (options) {
24849
+ let runningOnWindows = platformAndArch().platform === "windows";
24850
+ options.background = runningOnWindows ? !1 : options.background;
24851
+ }
24792
24852
  let commandProcess = buildExec(command, args, options);
24793
- options?.stderr && options.stderr !== "inherit" && commandProcess.stderr?.pipe(options.stderr, { end: !1 }), options?.stdout && options.stdout !== "inherit" && commandProcess.stdout?.pipe(options.stdout, { end: !1 });
24853
+ options?.background && commandProcess.unref(), options?.stderr && options.stderr !== "inherit" && commandProcess.stderr?.pipe(options.stderr, { end: !1 }), options?.stdout && options.stdout !== "inherit" && commandProcess.stdout?.pipe(options.stdout, { end: !1 });
24794
24854
  let aborted = !1;
24795
24855
  options?.signal?.addEventListener("abort", () => {
24796
24856
  let pid = commandProcess.pid;
@@ -24818,16 +24878,18 @@ function buildExec(command, args, options) {
24818
24878
  env: env3,
24819
24879
  cwd: executionCwd,
24820
24880
  input: options?.input,
24821
- stdio: options?.stdio,
24881
+ stdio: options?.background ? "ignore" : options?.stdio,
24822
24882
  stdin: options?.stdin,
24823
24883
  stdout: options?.stdout === "inherit" ? "inherit" : void 0,
24824
24884
  stderr: options?.stderr === "inherit" ? "inherit" : void 0,
24825
24885
  // Setting this to false makes it possible to kill the main process
24826
24886
  // and all its sub-processes with Ctrl+C on Windows
24827
- windowsHide: !1
24887
+ windowsHide: !1,
24888
+ detached: options?.background,
24889
+ cleanup: !options?.background
24828
24890
  });
24829
24891
  return outputDebug(`
24830
- Running system process:
24892
+ Running system process${options?.background ? " in background" : ""}:
24831
24893
  \xB7 Command: ${command} ${args.join(" ")}
24832
24894
  \xB7 Working directory: ${executionCwd}
24833
24895
  `), commandProcess;
@@ -29343,7 +29405,7 @@ function formatSection(title, body) {
29343
29405
  }
29344
29406
 
29345
29407
  // ../cli-kit/dist/public/node/error.js
29346
- var import_core2 = __toESM(require_lib()), import_ts_error = __toESM(require_cjs()), FatalErrorType;
29408
+ var import_core2 = __toESM(require_lib(), 1), import_ts_error = __toESM(require_cjs(), 1), FatalErrorType;
29347
29409
  (function(FatalErrorType2) {
29348
29410
  FatalErrorType2[FatalErrorType2.Abort = 0] = "Abort", FatalErrorType2[FatalErrorType2.AbortSilent = 1] = "AbortSilent", FatalErrorType2[FatalErrorType2.Bug = 2] = "Bug";
29349
29411
  })(FatalErrorType || (FatalErrorType = {}));
@@ -29471,7 +29533,7 @@ function createRuntimeMetadataContainer(defaultPublicMetadata = {}) {
29471
29533
  try {
29472
29534
  await getAndSet();
29473
29535
  } catch (error) {
29474
- let { sendErrorToBugsnag } = await import("./error-handler-7V7HCPFM.js");
29536
+ let { sendErrorToBugsnag } = await import("./error-handler-BADTRHFV.js");
29475
29537
  await sendErrorToBugsnag(error, "unexpected_error");
29476
29538
  }
29477
29539
  }, durationStack = [];
@@ -31270,8 +31332,9 @@ export {
31270
31332
  npmRunPathEnv,
31271
31333
  mimicFunction,
31272
31334
  require_get_stream,
31273
- execa,
31274
31335
  execaSync,
31336
+ username,
31337
+ platformAndArch,
31275
31338
  openURL,
31276
31339
  captureOutput,
31277
31340
  exec2 as exec,
@@ -31476,4 +31539,4 @@ react-reconciler/cjs/react-reconciler-constants.development.js:
31476
31539
  * LICENSE file in the root directory of this source tree.
31477
31540
  *)
31478
31541
  */
31479
- //# sourceMappingURL=chunk-V4FD5VKG.js.map
31542
+ //# sourceMappingURL=chunk-R3OLOJM7.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  prompts
3
- } from "./chunk-R6ST4Q4K.js";
3
+ } from "./chunk-M7TO4P43.js";
4
4
  import {
5
5
  base_command_default
6
- } from "./chunk-WHYTGJJU.js";
6
+ } from "./chunk-WRB46MIH.js";
7
7
  import {
8
8
  init_cjs_shims
9
9
  } from "./chunk-PKR7KJ6P.js";
@@ -25,4 +25,4 @@ var KitchenSinkPrompts = class extends base_command_default {
25
25
  export {
26
26
  KitchenSinkPrompts
27
27
  };
28
- //# sourceMappingURL=chunk-37RGPUOL.js.map
28
+ //# sourceMappingURL=chunk-SPTKJZLQ.js.map
@@ -4,16 +4,16 @@ import {
4
4
  import {
5
5
  fanoutHooks,
6
6
  reportAnalyticsEvent
7
- } from "./chunk-2OX7ESM2.js";
7
+ } from "./chunk-OLVUPFMV.js";
8
8
  import {
9
9
  getEnvironmentData
10
- } from "./chunk-VIMSAJBK.js";
10
+ } from "./chunk-WXEVFXY4.js";
11
11
  import {
12
12
  CLI_KIT_VERSION
13
- } from "./chunk-EFDLFMUG.js";
13
+ } from "./chunk-F5WG7YRC.js";
14
14
  import {
15
15
  runWithRateLimit
16
- } from "./chunk-LH3QC4DP.js";
16
+ } from "./chunk-GSC3DSZN.js";
17
17
  import {
18
18
  AbortSilentError,
19
19
  CancelExecution,
@@ -28,7 +28,7 @@ import {
28
28
  reportingRateLimit,
29
29
  require_stacktracey,
30
30
  shouldReportErrorAsUnexpected
31
- } from "./chunk-V4FD5VKG.js";
31
+ } from "./chunk-R3OLOJM7.js";
32
32
  import {
33
33
  cwd,
34
34
  isAbsolutePath,
@@ -2136,4 +2136,4 @@ export {
2136
2136
  registerCleanBugsnagErrorsFromWithinPlugins,
2137
2137
  addBugsnagMetadata
2138
2138
  };
2139
- //# sourceMappingURL=chunk-IROHTJ5D.js.map
2139
+ //# sourceMappingURL=chunk-VCFDSABQ.js.map
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  packageManagerFromUserAgent
3
- } from "./chunk-LH3QC4DP.js";
3
+ } from "./chunk-GSC3DSZN.js";
4
4
  import {
5
5
  currentProcessIsGlobal,
6
6
  inferPackageManagerForGlobalCLI,
7
7
  outputContent,
8
8
  outputToken
9
- } from "./chunk-V4FD5VKG.js";
9
+ } from "./chunk-R3OLOJM7.js";
10
10
  import {
11
11
  init_cjs_shims
12
12
  } from "./chunk-PKR7KJ6P.js";
@@ -25,4 +25,4 @@ export {
25
25
  cliInstallCommand,
26
26
  getOutputUpdateCLIReminder
27
27
  };
28
- //# sourceMappingURL=chunk-ARR2ZV5X.js.map
28
+ //# sourceMappingURL=chunk-WF3LQ6VY.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  base_command_default
3
- } from "./chunk-WHYTGJJU.js";
3
+ } from "./chunk-WRB46MIH.js";
4
4
  import {
5
5
  require_lib
6
6
  } from "./chunk-VSKRQ3JT.js";
@@ -43,4 +43,4 @@ var HelpCommand = class _HelpCommand extends base_command_default {
43
43
  export {
44
44
  HelpCommand
45
45
  };
46
- //# sourceMappingURL=chunk-TPUB2CUK.js.map
46
+ //# sourceMappingURL=chunk-WJRSLVVW.js.map
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  errorHandler,
3
3
  registerCleanBugsnagErrorsFromWithinPlugins
4
- } from "./chunk-IROHTJ5D.js";
4
+ } from "./chunk-VCFDSABQ.js";
5
5
  import {
6
6
  setCurrentCommandId,
7
7
  showNotificationsIfNeeded
8
- } from "./chunk-R2KFJZQF.js";
8
+ } from "./chunk-NGMTB27N.js";
9
9
  import {
10
10
  AbortError,
11
11
  addPublicMetadata,
@@ -22,7 +22,7 @@ import {
22
22
  renderWarning,
23
23
  terminalSupportsPrompting,
24
24
  underscore
25
- } from "./chunk-V4FD5VKG.js";
25
+ } from "./chunk-R3OLOJM7.js";
26
26
  import {
27
27
  cwd
28
28
  } from "./chunk-57Q6OQG4.js";
@@ -1552,7 +1552,7 @@ var import_core = __toESM(require_lib()), BaseCommand = class extends import_cor
1552
1552
  }
1553
1553
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1554
1554
  async init() {
1555
- return this.exitWithTimestampWhenEnvVariablePresent(), setCurrentCommandId(this.id || ""), isDevelopment() || await registerCleanBugsnagErrorsFromWithinPlugins(this.config), this.showNpmFlagWarning(), await showNotificationsIfNeeded(), super.init();
1555
+ return this.exitWithTimestampWhenEnvVariablePresent(), setCurrentCommandId(this.id ?? ""), isDevelopment() || await registerCleanBugsnagErrorsFromWithinPlugins(this.config), this.showNpmFlagWarning(), await showNotificationsIfNeeded(), super.init();
1556
1556
  }
1557
1557
  // NPM creates an environment variable for every flag passed to a script.
1558
1558
  // This function checks for the presence of any of the available CLI flags
@@ -1594,17 +1594,17 @@ This flag is required in non-interactive terminal environments, such as a CI env
1594
1594
  }
1595
1595
  async resultWithEnvironment(originalResult, options, argv) {
1596
1596
  let flags = originalResult.flags, environmentsFileName = this.environmentsFilename();
1597
- if (!flags.environment || !environmentsFileName)
1597
+ if (!flags.environment?.length || !environmentsFileName || flags.environment.length > 1)
1598
1598
  return originalResult;
1599
- let environment = await loadEnvironment(flags.environment, environmentsFileName, { from: flags.path });
1599
+ let environment = await loadEnvironment(flags.environment[0], environmentsFileName, { from: flags.path });
1600
1600
  if (!environment)
1601
1601
  return originalResult;
1602
1602
  let noDefaultsResult = await super.parse(noDefaultsOptions(options), argv), result = await super.parse(options, [
1603
1603
  // Need to specify argv default because we're merging with argsFromEnvironment.
1604
- ...argv || this.argv,
1604
+ ...argv ?? this.argv,
1605
1605
  ...argsFromEnvironment(environment, options, noDefaultsResult)
1606
1606
  ]);
1607
- return reportEnvironmentApplication(noDefaultsResult.flags, result.flags, flags.environment, environment), result;
1607
+ return reportEnvironmentApplication(noDefaultsResult.flags, result.flags, flags.environment[0], environment), result;
1608
1608
  }
1609
1609
  };
1610
1610
  BaseCommand.baseFlags = {};
@@ -1660,6 +1660,7 @@ var base_command_default = BaseCommand;
1660
1660
  export {
1661
1661
  decodeToml,
1662
1662
  encodeToml,
1663
+ loadEnvironment,
1663
1664
  base_command_default
1664
1665
  };
1665
- //# sourceMappingURL=chunk-WHYTGJJU.js.map
1666
+ //# sourceMappingURL=chunk-WRB46MIH.js.map