@shopify/cli 3.75.3 → 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 (83) hide show
  1. package/dist/assets/hydrogen/starter/CHANGELOG.md +9 -0
  2. package/dist/assets/hydrogen/starter/package.json +3 -3
  3. package/dist/{chunk-YJQB4KNO.js → chunk-247SAMPG.js} +3 -3
  4. package/dist/{chunk-FNGSPBMI.js → chunk-2LCBNWGB.js} +11 -11
  5. package/dist/{chunk-BI6OG3SW.js → chunk-3HWN5QZP.js} +3 -3
  6. package/dist/{chunk-33Y36JTQ.js → chunk-7MKO46I5.js} +3 -3
  7. package/dist/{chunk-G4AWJOUT.js → chunk-AS4YOVZB.js} +3 -3
  8. package/dist/{chunk-PD5FJTJV.js → chunk-AW63CHBD.js} +3 -3
  9. package/dist/{chunk-MW2DSTSP.js → chunk-CUEBFCNF.js} +4 -4
  10. package/dist/{chunk-5R65XQBB.js → chunk-DSEDXHIL.js} +3 -3
  11. package/dist/{chunk-GXE74MLK.js → chunk-F5WG7YRC.js} +2 -2
  12. package/dist/{chunk-B5KBQUD7.js → chunk-FKVY6WNT.js} +4 -4
  13. package/dist/{chunk-WMN57UOI.js → chunk-FSL57OBM.js} +127 -87
  14. package/dist/{chunk-QODWZ6PQ.js → chunk-FVI46GAE.js} +3 -3
  15. package/dist/{chunk-EIDXBYRF.js → chunk-GDAGNYN6.js} +2 -2
  16. package/dist/{chunk-22VHHB6E.js → chunk-GSC3DSZN.js} +3 -2
  17. package/dist/{chunk-MAEFXTUW.js → chunk-IB2GR2NI.js} +4 -4
  18. package/dist/{chunk-3QMRSRBQ.js → chunk-IGXCBQCI.js} +2 -2
  19. package/dist/{chunk-LCLDLGWN.js → chunk-IV3Z7KW6.js} +5 -5
  20. package/dist/{chunk-IKLIMBXL.js → chunk-KRBTUAPG.js} +3 -3
  21. package/dist/{chunk-G4WKRFAA.js → chunk-LLYJXSNC.js} +3 -3
  22. package/dist/{chunk-QGVSI72K.js → chunk-LQLKKAEX.js} +3 -3
  23. package/dist/{chunk-A2VS5S6I.js → chunk-M7TO4P43.js} +2 -2
  24. package/dist/{chunk-5U5CBWN6.js → chunk-NGMTB27N.js} +36 -15
  25. package/dist/{chunk-YFC422QN.js → chunk-OAIHYIZM.js} +3 -3
  26. package/dist/{chunk-2NZ7C43W.js → chunk-OLVUPFMV.js} +6 -6
  27. package/dist/{chunk-USS26MJN.js → chunk-QFEXM6TL.js} +2 -2
  28. package/dist/{chunk-C33FHDOM.js → chunk-R3OLOJM7.js} +74 -11
  29. package/dist/{chunk-VJRNACS6.js → chunk-SPTKJZLQ.js} +3 -3
  30. package/dist/{chunk-K4H4V3DT.js → chunk-VCFDSABQ.js} +6 -6
  31. package/dist/{chunk-OV2HTJBT.js → chunk-WF3LQ6VY.js} +3 -3
  32. package/dist/{chunk-KD3XBFOR.js → chunk-WJRSLVVW.js} +2 -2
  33. package/dist/{chunk-LZMNVVKL.js → chunk-WRB46MIH.js} +10 -9
  34. package/dist/{chunk-RR6KDBGU.js → chunk-WXEVFXY4.js} +93 -163
  35. package/dist/{chunk-KTZUTNES.js → chunk-Y5V7ZNMS.js} +3 -3
  36. package/dist/{chunk-JTBKPH2T.js → chunk-YJUMZEX7.js} +2 -2
  37. package/dist/{chunk-WZLRLCYA.js → chunk-YWGDPGEE.js} +7 -6
  38. package/dist/cli/commands/auth/logout.js +11 -12
  39. package/dist/cli/commands/auth/logout.test.js +12 -13
  40. package/dist/cli/commands/cache/clear.js +10 -11
  41. package/dist/cli/commands/debug/command-flags.js +10 -11
  42. package/dist/cli/commands/docs/generate.js +10 -11
  43. package/dist/cli/commands/docs/generate.test.js +10 -11
  44. package/dist/cli/commands/help.js +10 -11
  45. package/dist/cli/commands/kitchen-sink/async.js +11 -12
  46. package/dist/cli/commands/kitchen-sink/async.test.js +11 -12
  47. package/dist/cli/commands/kitchen-sink/index.js +13 -14
  48. package/dist/cli/commands/kitchen-sink/index.test.js +13 -14
  49. package/dist/cli/commands/kitchen-sink/prompts.js +11 -12
  50. package/dist/cli/commands/kitchen-sink/prompts.test.js +11 -12
  51. package/dist/cli/commands/kitchen-sink/static.js +11 -12
  52. package/dist/cli/commands/kitchen-sink/static.test.js +11 -12
  53. package/dist/cli/commands/notifications/generate.js +11 -12
  54. package/dist/cli/commands/notifications/list.js +11 -12
  55. package/dist/cli/commands/search.js +11 -12
  56. package/dist/cli/commands/upgrade.js +11 -12
  57. package/dist/cli/commands/version.js +11 -12
  58. package/dist/cli/commands/version.test.js +11 -12
  59. package/dist/cli/services/commands/notifications.js +6 -6
  60. package/dist/cli/services/commands/search.js +2 -2
  61. package/dist/cli/services/commands/search.test.js +2 -2
  62. package/dist/cli/services/commands/version.js +3 -3
  63. package/dist/cli/services/commands/version.test.js +4 -4
  64. package/dist/cli/services/kitchen-sink/async.js +2 -2
  65. package/dist/cli/services/kitchen-sink/prompts.js +2 -2
  66. package/dist/cli/services/kitchen-sink/static.js +2 -2
  67. package/dist/cli/services/upgrade.js +3 -3
  68. package/dist/cli/services/upgrade.test.js +5 -7
  69. package/dist/{custom-oclif-loader-T46YXHAL.js → custom-oclif-loader-K3EL2OAR.js} +2 -2
  70. package/dist/{error-handler-CQQM6XL7.js → error-handler-BADTRHFV.js} +8 -9
  71. package/dist/hooks/postrun.js +8 -8
  72. package/dist/hooks/prerun.js +10 -8
  73. package/dist/index.js +7314 -6967
  74. package/dist/{local-UIVNM7TY.js → local-OPE3NHTK.js} +2 -2
  75. package/dist/{morph-K3QSNZNW.js → morph-WRZ7XCTF.js} +9 -9
  76. package/dist/{node-Y5CCPBME.js → node-KXPRSMZI.js} +14 -15
  77. package/dist/{node-package-manager-LYGJUDK2.js → node-package-manager-I364XLRB.js} +3 -3
  78. package/dist/tsconfig.tsbuildinfo +1 -1
  79. package/dist/{ui-6CY7AHOT.js → ui-OLBMRQ45.js} +2 -2
  80. package/dist/{workerd-S3A3XU2A.js → workerd-U7MSRKWK.js} +13 -14
  81. package/oclif.manifest.json +46 -22
  82. package/package.json +7 -7
  83. package/dist/chunk-CM7HYAXG.js +0 -63
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  searchService
3
- } from "./chunk-3QMRSRBQ.js";
3
+ } from "./chunk-IGXCBQCI.js";
4
4
  import {
5
5
  base_command_default
6
- } from "./chunk-LZMNVVKL.js";
6
+ } from "./chunk-WRB46MIH.js";
7
7
  import {
8
8
  require_lib
9
9
  } from "./chunk-VSKRQ3JT.js";
@@ -45,4 +45,4 @@ var import_core = __toESM(require_lib(), 1), Search = class _Search extends base
45
45
  export {
46
46
  Search
47
47
  };
48
- //# sourceMappingURL=chunk-QODWZ6PQ.js.map
48
+ //# sourceMappingURL=chunk-FVI46GAE.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  renderConcurrent,
3
3
  renderTasks
4
- } from "./chunk-C33FHDOM.js";
4
+ } from "./chunk-R3OLOJM7.js";
5
5
  import {
6
6
  init_cjs_shims
7
7
  } from "./chunk-PKR7KJ6P.js";
@@ -43,4 +43,4 @@ async function asyncTasks() {
43
43
  export {
44
44
  asyncTasks
45
45
  };
46
- //# sourceMappingURL=chunk-EIDXBYRF.js.map
46
+ //# sourceMappingURL=chunk-GDAGNYN6.js.map
@@ -21,7 +21,7 @@ import {
21
21
  require_get_stream,
22
22
  runWithTimer,
23
23
  writeFile
24
- } from "./chunk-C33FHDOM.js";
24
+ } from "./chunk-R3OLOJM7.js";
25
25
  import {
26
26
  dirname,
27
27
  joinPath
@@ -13684,6 +13684,7 @@ export {
13684
13684
  cacheStore,
13685
13685
  cacheRetrieve,
13686
13686
  cacheClear,
13687
+ timeIntervalToMilliseconds,
13687
13688
  runAtMinimumInterval,
13688
13689
  runWithRateLimit,
13689
13690
  yarnLockfile,
@@ -13748,4 +13749,4 @@ deep-extend/lib/deep-extend.js:
13748
13749
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
13749
13750
  *)
13750
13751
  */
13751
- //# sourceMappingURL=chunk-22VHHB6E.js.map
13752
+ //# sourceMappingURL=chunk-GSC3DSZN.js.map
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  cliInstallCommand
3
- } from "./chunk-OV2HTJBT.js";
3
+ } from "./chunk-WF3LQ6VY.js";
4
4
  import {
5
5
  base_command_default
6
- } from "./chunk-LZMNVVKL.js";
6
+ } from "./chunk-WRB46MIH.js";
7
7
  import {
8
8
  renderInfo
9
- } from "./chunk-C33FHDOM.js";
9
+ } from "./chunk-R3OLOJM7.js";
10
10
  import {
11
11
  init_cjs_shims
12
12
  } from "./chunk-PKR7KJ6P.js";
@@ -34,4 +34,4 @@ var Upgrade = class extends base_command_default {
34
34
  export {
35
35
  Upgrade
36
36
  };
37
- //# sourceMappingURL=chunk-MAEFXTUW.js.map
37
+ //# sourceMappingURL=chunk-IB2GR2NI.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  openURL
3
- } from "./chunk-C33FHDOM.js";
3
+ } from "./chunk-R3OLOJM7.js";
4
4
  import {
5
5
  init_cjs_shims
6
6
  } from "./chunk-PKR7KJ6P.js";
@@ -15,4 +15,4 @@ async function searchService(query) {
15
15
  export {
16
16
  searchService
17
17
  };
18
- //# sourceMappingURL=chunk-3QMRSRBQ.js.map
18
+ //# sourceMappingURL=chunk-IGXCBQCI.js.map
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  prompts
3
- } from "./chunk-A2VS5S6I.js";
3
+ } from "./chunk-M7TO4P43.js";
4
4
  import {
5
5
  staticService
6
- } from "./chunk-USS26MJN.js";
6
+ } from "./chunk-QFEXM6TL.js";
7
7
  import {
8
8
  asyncTasks
9
- } from "./chunk-EIDXBYRF.js";
9
+ } from "./chunk-GDAGNYN6.js";
10
10
  import {
11
11
  base_command_default
12
- } from "./chunk-LZMNVVKL.js";
12
+ } from "./chunk-WRB46MIH.js";
13
13
  import {
14
14
  init_cjs_shims
15
15
  } from "./chunk-PKR7KJ6P.js";
@@ -34,4 +34,4 @@ var KitchenSinkAll = class extends base_command_default {
34
34
  export {
35
35
  KitchenSinkAll
36
36
  };
37
- //# sourceMappingURL=chunk-LCLDLGWN.js.map
37
+ //# sourceMappingURL=chunk-IV3Z7KW6.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  staticService
3
- } from "./chunk-USS26MJN.js";
3
+ } from "./chunk-QFEXM6TL.js";
4
4
  import {
5
5
  base_command_default
6
- } from "./chunk-LZMNVVKL.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 KitchenSinkStatic = class extends base_command_default {
25
25
  export {
26
26
  KitchenSinkStatic
27
27
  };
28
- //# sourceMappingURL=chunk-IKLIMBXL.js.map
28
+ //# sourceMappingURL=chunk-KRBTUAPG.js.map
@@ -2,7 +2,7 @@ import {
2
2
  init_cjs_shims
3
3
  } from "./chunk-PKR7KJ6P.js";
4
4
 
5
- // ../../node_modules/.pnpm/@shopify+cli-hydrogen@9.0.7_@graphql-codegen+cli@5.0.4_react-dom@17.0.2_react@17.0.2/node_modules/@shopify/cli-hydrogen/dist/lib/find-port.js
5
+ // ../../node_modules/.pnpm/@shopify+cli-hydrogen@9.0.8_@graphql-codegen+cli@5.0.4_react-dom@17.0.2_react@17.0.2/node_modules/@shopify/cli-hydrogen/dist/lib/find-port.js
6
6
  init_cjs_shims();
7
7
 
8
8
  // ../../node_modules/.pnpm/get-port@7.1.0/node_modules/get-port/index.js
@@ -94,7 +94,7 @@ function portNumbers(from, to) {
94
94
  }(from, to);
95
95
  }
96
96
 
97
- // ../../node_modules/.pnpm/@shopify+cli-hydrogen@9.0.7_@graphql-codegen+cli@5.0.4_react-dom@17.0.2_react@17.0.2/node_modules/@shopify/cli-hydrogen/dist/lib/find-port.js
97
+ // ../../node_modules/.pnpm/@shopify+cli-hydrogen@9.0.8_@graphql-codegen+cli@5.0.4_react-dom@17.0.2_react@17.0.2/node_modules/@shopify/cli-hydrogen/dist/lib/find-port.js
98
98
  function findPort(portPreference, range = 100) {
99
99
  return getPorts({
100
100
  port: portNumbers(portPreference, portPreference + range)
@@ -104,4 +104,4 @@ function findPort(portPreference, range = 100) {
104
104
  export {
105
105
  findPort
106
106
  };
107
- //# sourceMappingURL=chunk-G4WKRFAA.js.map
107
+ //# sourceMappingURL=chunk-LLYJXSNC.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  generate
3
- } from "./chunk-WZLRLCYA.js";
3
+ } from "./chunk-YWGDPGEE.js";
4
4
  import {
5
5
  base_command_default
6
- } from "./chunk-LZMNVVKL.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 Generate = class extends base_command_default {
25
25
  export {
26
26
  Generate
27
27
  };
28
- //# sourceMappingURL=chunk-QGVSI72K.js.map
28
+ //# sourceMappingURL=chunk-LQLKKAEX.js.map
@@ -5,7 +5,7 @@ import {
5
5
  renderDangerousConfirmationPrompt,
6
6
  renderSelectPrompt,
7
7
  renderTextPrompt
8
- } from "./chunk-C33FHDOM.js";
8
+ } from "./chunk-R3OLOJM7.js";
9
9
  import {
10
10
  init_cjs_shims
11
11
  } from "./chunk-PKR7KJ6P.js";
@@ -175,4 +175,4 @@ async function prompts() {
175
175
  export {
176
176
  prompts
177
177
  };
178
- //# sourceMappingURL=chunk-A2VS5S6I.js.map
178
+ //# sourceMappingURL=chunk-M7TO4P43.js.map
@@ -1,25 +1,25 @@
1
1
  import {
2
2
  fetch,
3
3
  z
4
- } from "./chunk-B5KBQUD7.js";
4
+ } from "./chunk-FKVY6WNT.js";
5
5
  import {
6
6
  CLI_KIT_VERSION
7
- } from "./chunk-GXE74MLK.js";
7
+ } from "./chunk-F5WG7YRC.js";
8
8
  import {
9
9
  cacheRetrieve,
10
- cacheRetrieveOrRepopulate,
11
10
  cacheStore,
12
11
  versionSatisfies
13
- } from "./chunk-22VHHB6E.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-C33FHDOM.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-CQQM6XL7.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-5U5CBWN6.js.map
186
+ //# sourceMappingURL=chunk-NGMTB27N.js.map
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  base_command_default
3
- } from "./chunk-LZMNVVKL.js";
3
+ } from "./chunk-WRB46MIH.js";
4
4
  import {
5
5
  mkdir,
6
6
  outputInfo,
7
7
  rmdir,
8
8
  writeFile
9
- } from "./chunk-C33FHDOM.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-YFC422QN.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-RR6KDBGU.js";
5
+ } from "./chunk-WXEVFXY4.js";
6
6
  import {
7
7
  fetch
8
- } from "./chunk-B5KBQUD7.js";
8
+ } from "./chunk-FKVY6WNT.js";
9
9
  import {
10
10
  CLI_KIT_VERSION
11
- } from "./chunk-GXE74MLK.js";
11
+ } from "./chunk-F5WG7YRC.js";
12
12
  import {
13
13
  runWithRateLimit
14
- } from "./chunk-22VHHB6E.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-C33FHDOM.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-2NZ7C43W.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-C33FHDOM.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-USS26MJN.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-CQQM6XL7.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-C33FHDOM.js.map
31542
+ //# sourceMappingURL=chunk-R3OLOJM7.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  prompts
3
- } from "./chunk-A2VS5S6I.js";
3
+ } from "./chunk-M7TO4P43.js";
4
4
  import {
5
5
  base_command_default
6
- } from "./chunk-LZMNVVKL.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-VJRNACS6.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-2NZ7C43W.js";
7
+ } from "./chunk-OLVUPFMV.js";
8
8
  import {
9
9
  getEnvironmentData
10
- } from "./chunk-RR6KDBGU.js";
10
+ } from "./chunk-WXEVFXY4.js";
11
11
  import {
12
12
  CLI_KIT_VERSION
13
- } from "./chunk-GXE74MLK.js";
13
+ } from "./chunk-F5WG7YRC.js";
14
14
  import {
15
15
  runWithRateLimit
16
- } from "./chunk-22VHHB6E.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-C33FHDOM.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-K4H4V3DT.js.map
2139
+ //# sourceMappingURL=chunk-VCFDSABQ.js.map
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  packageManagerFromUserAgent
3
- } from "./chunk-22VHHB6E.js";
3
+ } from "./chunk-GSC3DSZN.js";
4
4
  import {
5
5
  currentProcessIsGlobal,
6
6
  inferPackageManagerForGlobalCLI,
7
7
  outputContent,
8
8
  outputToken
9
- } from "./chunk-C33FHDOM.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-OV2HTJBT.js.map
28
+ //# sourceMappingURL=chunk-WF3LQ6VY.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  base_command_default
3
- } from "./chunk-LZMNVVKL.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-KD3XBFOR.js.map
46
+ //# sourceMappingURL=chunk-WJRSLVVW.js.map