@shopify/cli 3.85.5 → 3.86.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 (99) hide show
  1. package/dist/assets/dev-console/extensions/dev-console/assets/index-Cj8WCHlM.js +64 -0
  2. package/dist/assets/dev-console/index.html +1 -1
  3. package/dist/assets/hydrogen/starter/package.json +1 -1
  4. package/dist/{brotli-EDFLSXX4.js → brotli-2OKV26Y6.js} +3 -3
  5. package/dist/{chunk-DHW4GI57.js → chunk-2KZOUSPH.js} +5 -5
  6. package/dist/{chunk-BQ3PZIHZ.js → chunk-4MSYMXAX.js} +16 -16
  7. package/dist/{chunk-PFBQBDNU.js → chunk-4TSN5PHA.js} +3 -3
  8. package/dist/{chunk-TE4CUUT4.js → chunk-4YT3BY2B.js} +2 -2
  9. package/dist/{chunk-MDDWB46W.js → chunk-5Q7CDSRK.js} +6 -6
  10. package/dist/{chunk-SMBX232U.js → chunk-5RBPM5MR.js} +205 -183
  11. package/dist/{chunk-UATXMR5F.js → chunk-6FH6AJI5.js} +3 -3
  12. package/dist/{chunk-75LV6AQS.js → chunk-6ONJEX7Y.js} +8 -8
  13. package/dist/{chunk-P46WMXBU.js → chunk-6UMZO4DD.js} +5 -5
  14. package/dist/{chunk-JF6DQIJR.js → chunk-7TE554OT.js} +16 -16
  15. package/dist/{chunk-NMGJYSTC.js → chunk-7VKRIIXT.js} +6 -6
  16. package/dist/{chunk-VVDGGMKJ.js → chunk-AA57B6YW.js} +3 -3
  17. package/dist/{chunk-RAZVOMJW.js → chunk-AQK2VHTY.js} +3 -3
  18. package/dist/{chunk-TXX6R3WL.js → chunk-DKRTUP7T.js} +2 -2
  19. package/dist/{chunk-O2O5GRI6.js → chunk-E25JAFOX.js} +3 -3
  20. package/dist/{chunk-IG5SOACB.js → chunk-F2V6FX7R.js} +3 -3
  21. package/dist/{chunk-UQT7B7DM.js → chunk-G3RY2PNL.js} +3 -3
  22. package/dist/{chunk-UF2X5VHR.js → chunk-GAPPN3SH.js} +3 -3
  23. package/dist/{chunk-AVSSZ6MY.js → chunk-GU76E24D.js} +7 -7
  24. package/dist/{chunk-IAX3IWUQ.js → chunk-IZMUO44N.js} +5 -5
  25. package/dist/{chunk-FGSQR4VQ.js → chunk-J5WELXX6.js} +3 -3
  26. package/dist/{chunk-GG2ELY5O.js → chunk-JMQJQNH7.js} +145 -124
  27. package/dist/{chunk-MR763CPY.js → chunk-KIMPXWRC.js} +6 -6
  28. package/dist/{chunk-TYHJPUOR.js → chunk-LDFPMZVN.js} +2 -2
  29. package/dist/{chunk-PZUWEJO3.js → chunk-LDJGMHXE.js} +4 -4
  30. package/dist/{chunk-J6T7KVRL.js → chunk-LOWKEYZ4.js} +2 -2
  31. package/dist/{chunk-G2I4CD5D.js → chunk-LPSHXR57.js} +2 -2
  32. package/dist/{chunk-FMD2ETAR.js → chunk-NIZJP24I.js} +4 -4
  33. package/dist/{chunk-FRHZJBJZ.js → chunk-NMH42STK.js} +27 -19
  34. package/dist/{chunk-NTCXWD2Q.js → chunk-O32LAXNO.js} +583 -585
  35. package/dist/{chunk-MUZ7NPCX.js → chunk-PFWYGIIB.js} +4 -4
  36. package/dist/{chunk-B5EXYCV3.js → chunk-Q2H6D2MH.js} +5 -5
  37. package/dist/{chunk-3ULYQTX3.js → chunk-TCTK5NQE.js} +8 -8
  38. package/dist/{chunk-CQSO2B3C.js → chunk-UAYSVXRU.js} +82 -31
  39. package/dist/{chunk-GQ63RYWN.js → chunk-UKECTTQZ.js} +2 -2
  40. package/dist/{chunk-R6BNSDGA.js → chunk-UXJEPFC3.js} +3 -3
  41. package/dist/{chunk-RZPYG7LO.js → chunk-WZTQS5NN.js} +25 -25
  42. package/dist/{chunk-F7F4BQYW.js → chunk-X2YIODUW.js} +56 -58
  43. package/dist/{chunk-25IMI7TH.js → chunk-XD3LXUGW.js} +5 -5
  44. package/dist/{chunk-CHLX44DR.js → chunk-ZRLTG3SU.js} +4 -4
  45. package/dist/{chunk-ODJ7LSLO.js → chunk-ZZGMPT2W.js} +3 -3
  46. package/dist/cli/commands/auth/login.js +15 -15
  47. package/dist/cli/commands/auth/login.test.js +17 -17
  48. package/dist/cli/commands/auth/logout.js +15 -15
  49. package/dist/cli/commands/auth/logout.test.js +17 -17
  50. package/dist/cli/commands/cache/clear.js +15 -15
  51. package/dist/cli/commands/debug/command-flags.js +15 -15
  52. package/dist/cli/commands/docs/generate.js +15 -15
  53. package/dist/cli/commands/docs/generate.test.js +16 -16
  54. package/dist/cli/commands/help.js +15 -15
  55. package/dist/cli/commands/kitchen-sink/async.js +16 -16
  56. package/dist/cli/commands/kitchen-sink/async.test.js +17 -17
  57. package/dist/cli/commands/kitchen-sink/index.js +18 -18
  58. package/dist/cli/commands/kitchen-sink/index.test.js +19 -19
  59. package/dist/cli/commands/kitchen-sink/prompts.js +16 -16
  60. package/dist/cli/commands/kitchen-sink/prompts.test.js +17 -17
  61. package/dist/cli/commands/kitchen-sink/static.js +16 -16
  62. package/dist/cli/commands/kitchen-sink/static.test.js +17 -17
  63. package/dist/cli/commands/notifications/generate.js +16 -16
  64. package/dist/cli/commands/notifications/list.js +16 -16
  65. package/dist/cli/commands/search.js +16 -16
  66. package/dist/cli/commands/upgrade.js +16 -16
  67. package/dist/cli/commands/upgrade.test.js +1 -1
  68. package/dist/cli/commands/version.js +16 -16
  69. package/dist/cli/commands/version.test.js +17 -17
  70. package/dist/cli/services/commands/notifications.js +11 -11
  71. package/dist/cli/services/commands/search.js +6 -6
  72. package/dist/cli/services/commands/search.test.js +7 -7
  73. package/dist/cli/services/commands/version.js +7 -7
  74. package/dist/cli/services/commands/version.test.js +9 -9
  75. package/dist/cli/services/kitchen-sink/async.js +6 -6
  76. package/dist/cli/services/kitchen-sink/prompts.js +6 -6
  77. package/dist/cli/services/kitchen-sink/static.js +6 -6
  78. package/dist/cli/services/upgrade.js +7 -7
  79. package/dist/cli/services/upgrade.test.js +9 -9
  80. package/dist/{custom-oclif-loader-X7GLA66E.js → custom-oclif-loader-Y4GWKKAU.js} +6 -6
  81. package/dist/{del-DNZ7X2HW.js → del-DIPVIUR3.js} +3 -3
  82. package/dist/{error-handler-QOTWDLMF.js → error-handler-WPYX52XY.js} +13 -13
  83. package/dist/hooks/postrun.js +11 -11
  84. package/dist/hooks/prerun.js +12 -12
  85. package/dist/{http-proxy-node16-T623PGD4.js → http-proxy-node16-K5X7BUK5.js} +3 -3
  86. package/dist/index.js +1655 -2641
  87. package/dist/{lib-DEEC6IKU.js → lib-EMZRCLCJ.js} +3 -3
  88. package/dist/{lib-JVEIEXYB.js → lib-WHI5XOGD.js} +2 -2
  89. package/dist/{local-FS3UI7PE.js → local-ZMOSXANE.js} +6 -6
  90. package/dist/{morph-D4BXY376.js → morph-EGK76SED.js} +17 -18
  91. package/dist/{multipart-parser-WSNBP656.js → multipart-parser-IYYNISJK.js} +2 -2
  92. package/dist/{node-package-manager-TX3WZQGI.js → node-package-manager-4KOKGFQG.js} +7 -7
  93. package/dist/{source-map-QCVC46UY.js → source-map-UFUVQCYE.js} +5 -5
  94. package/dist/tsconfig.tsbuildinfo +1 -1
  95. package/dist/{ui-PUN5STUM.js → ui-YYVT2VLD.js} +6 -6
  96. package/dist/{workerd-GJFM5MYN.js → workerd-35SAC4OI.js} +17 -17
  97. package/oclif.manifest.json +17 -104
  98. package/package.json +8 -12
  99. package/dist/assets/dev-console/extensions/dev-console/assets/index-ohOjvIJh.js +0 -64
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  cliInstallCommand
3
- } from "./chunk-ODJ7LSLO.js";
3
+ } from "./chunk-ZZGMPT2W.js";
4
4
  import {
5
5
  base_command_default
6
- } from "./chunk-NMGJYSTC.js";
6
+ } from "./chunk-7VKRIIXT.js";
7
7
  import {
8
8
  renderInfo
9
- } from "./chunk-GG2ELY5O.js";
9
+ } from "./chunk-JMQJQNH7.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-MUZ7NPCX.js.map
37
+ //# sourceMappingURL=chunk-PFWYGIIB.js.map
@@ -104,17 +104,17 @@ var require_cjs = __commonJS({
104
104
  "../../node_modules/.pnpm/isexe@3.1.1/node_modules/isexe/dist/cjs/index.js"(exports) {
105
105
  "use strict";
106
106
  init_cjs_shims();
107
- var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
107
+ var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
108
108
  k2 === void 0 && (k2 = k);
109
109
  var desc = Object.getOwnPropertyDescriptor(m, k);
110
110
  (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) && (desc = { enumerable: !0, get: function() {
111
111
  return m[k];
112
112
  } }), Object.defineProperty(o, k2, desc);
113
- } : function(o, m, k, k2) {
113
+ }) : (function(o, m, k, k2) {
114
114
  k2 === void 0 && (k2 = k), o[k2] = m[k];
115
- }), __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
115
+ })), __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
116
116
  Object.defineProperty(o, "default", { enumerable: !0, value: v });
117
- } : function(o, v) {
117
+ }) : function(o, v) {
118
118
  o.default = v;
119
119
  }), __importStar = exports && exports.__importStar || function(mod) {
120
120
  if (mod && mod.__esModule) return mod;
@@ -205,4 +205,4 @@ var require_lib = __commonJS({
205
205
  export {
206
206
  require_lib
207
207
  };
208
- //# sourceMappingURL=chunk-B5EXYCV3.js.map
208
+ //# sourceMappingURL=chunk-Q2H6D2MH.js.map
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  base_command_default
3
- } from "./chunk-NMGJYSTC.js";
3
+ } from "./chunk-7VKRIIXT.js";
4
4
  import {
5
5
  cacheClear
6
- } from "./chunk-CQSO2B3C.js";
6
+ } from "./chunk-UAYSVXRU.js";
7
7
  import {
8
8
  environmentVariables,
9
9
  isTruthy
10
- } from "./chunk-GG2ELY5O.js";
10
+ } from "./chunk-JMQJQNH7.js";
11
11
  import {
12
12
  require_lib
13
- } from "./chunk-F7F4BQYW.js";
13
+ } from "./chunk-X2YIODUW.js";
14
14
  import {
15
15
  __toESM,
16
16
  init_cjs_shims
@@ -26,7 +26,7 @@ init_cjs_shims();
26
26
  init_cjs_shims();
27
27
  import { fileURLToPath } from "node:url";
28
28
  async function launchCLI(options) {
29
- let { errorHandler } = await import("./error-handler-QOTWDLMF.js"), { isDevelopment } = await import("./local-FS3UI7PE.js"), oclif = await import("./lib-DEEC6IKU.js"), { ShopifyConfig } = await import("./custom-oclif-loader-X7GLA66E.js");
29
+ let { errorHandler } = await import("./error-handler-WPYX52XY.js"), { isDevelopment } = await import("./local-ZMOSXANE.js"), oclif = await import("./lib-EMZRCLCJ.js"), { ShopifyConfig } = await import("./custom-oclif-loader-Y4GWKKAU.js");
30
30
  isDevelopment() && (oclif.default.settings.debug = !0);
31
31
  try {
32
32
  let config = new ShopifyConfig({ root: fileURLToPath(options.moduleURL) });
@@ -41,7 +41,7 @@ var import_core = __toESM(require_lib());
41
41
  async function exitIfOldNodeVersion(versions = process.versions) {
42
42
  let nodeVersion = versions.node, nodeMajorVersion = Number(nodeVersion.split(".")[0]);
43
43
  if (nodeMajorVersion < 18) {
44
- let { renderError } = await import("./ui-PUN5STUM.js");
44
+ let { renderError } = await import("./ui-YYVT2VLD.js");
45
45
  renderError({
46
46
  headline: "Upgrade to a supported Node version now.",
47
47
  body: [
@@ -68,7 +68,7 @@ async function runCLI(options, launchCLI2 = launchCLI, argv = process.argv, env
68
68
  return setupEnvironmentVariables(options, argv, env), options.runInCreateMode && await addInitToArgvWhenRunningCreateCLI(options, argv), forceNoColor(argv, env), await exitIfOldNodeVersion(versions), launchCLI2({ moduleURL: options.moduleURL });
69
69
  }
70
70
  async function addInitToArgvWhenRunningCreateCLI(options, argv = process.argv) {
71
- let { findUpAndReadPackageJson } = await import("./node-package-manager-TX3WZQGI.js"), { moduleDirectory } = await import("./path-GB4VIEM6.js"), name = (await findUpAndReadPackageJson(moduleDirectory(options.moduleURL))).content.name.replace("@shopify/create-", "");
71
+ let { findUpAndReadPackageJson } = await import("./node-package-manager-4KOKGFQG.js"), { moduleDirectory } = await import("./path-GB4VIEM6.js"), name = (await findUpAndReadPackageJson(moduleDirectory(options.moduleURL))).content.name.replace("@shopify/create-", "");
72
72
  if (argv.findIndex((arg) => arg.includes("init")) === -1) {
73
73
  let initIndex2 = argv.findIndex((arg) => arg.match(new RegExp(`bin(\\/|\\\\)+(create-${name}|dev|run)`))) + 1;
74
74
  argv.splice(initIndex2, 0, "init");
@@ -117,4 +117,4 @@ export {
117
117
  jsonFlag,
118
118
  ClearCache
119
119
  };
120
- //# sourceMappingURL=chunk-3ULYQTX3.js.map
120
+ //# sourceMappingURL=chunk-TCTK5NQE.js.map
@@ -6,6 +6,7 @@ import {
6
6
  envPaths,
7
7
  exec,
8
8
  fileExists,
9
+ fileHasWritePermissions,
9
10
  findPathUp,
10
11
  glob,
11
12
  inferPackageManagerForGlobalCLI,
@@ -17,11 +18,12 @@ import {
17
18
  readFile,
18
19
  require_get_stream,
19
20
  runWithTimer,
21
+ unixFileIsOwnedByCurrentUser,
20
22
  writeFile
21
- } from "./chunk-GG2ELY5O.js";
23
+ } from "./chunk-JMQJQNH7.js";
22
24
  import {
23
25
  require_semver
24
- } from "./chunk-F7F4BQYW.js";
26
+ } from "./chunk-X2YIODUW.js";
25
27
  import {
26
28
  dirname,
27
29
  joinPath
@@ -7589,7 +7591,7 @@ var require_polyfills = __commonJS({
7589
7591
  }), fs3.chown && !fs3.lchown && (fs3.lchown = function(path4, uid, gid, cb) {
7590
7592
  cb && process.nextTick(cb);
7591
7593
  }, fs3.lchownSync = function() {
7592
- }), platform === "win32" && (fs3.rename = typeof fs3.rename != "function" ? fs3.rename : function(fs$rename) {
7594
+ }), platform === "win32" && (fs3.rename = typeof fs3.rename != "function" ? fs3.rename : (function(fs$rename) {
7593
7595
  function rename(from, to, cb) {
7594
7596
  var start = Date.now(), backoff = 0;
7595
7597
  fs$rename(from, to, function CB(er) {
@@ -7605,7 +7607,7 @@ var require_polyfills = __commonJS({
7605
7607
  });
7606
7608
  }
7607
7609
  return Object.setPrototypeOf && Object.setPrototypeOf(rename, fs$rename), rename;
7608
- }(fs3.rename)), fs3.read = typeof fs3.read != "function" ? fs3.read : function(fs$read) {
7610
+ })(fs3.rename)), fs3.read = typeof fs3.read != "function" ? fs3.read : (function(fs$read) {
7609
7611
  function read(fd, buffer, offset, length, position, callback_) {
7610
7612
  var callback;
7611
7613
  if (callback_ && typeof callback_ == "function") {
@@ -7619,7 +7621,7 @@ var require_polyfills = __commonJS({
7619
7621
  return fs$read.call(fs3, fd, buffer, offset, length, position, callback);
7620
7622
  }
7621
7623
  return Object.setPrototypeOf && Object.setPrototypeOf(read, fs$read), read;
7622
- }(fs3.read), fs3.readSync = typeof fs3.readSync != "function" ? fs3.readSync : /* @__PURE__ */ function(fs$readSync) {
7624
+ })(fs3.read), fs3.readSync = typeof fs3.readSync != "function" ? fs3.readSync : /* @__PURE__ */ (function(fs$readSync) {
7623
7625
  return function(fd, buffer, offset, length, position) {
7624
7626
  for (var eagCounter = 0; ; )
7625
7627
  try {
@@ -7632,7 +7634,7 @@ var require_polyfills = __commonJS({
7632
7634
  throw er;
7633
7635
  }
7634
7636
  };
7635
- }(fs3.readSync);
7637
+ })(fs3.readSync);
7636
7638
  function patchLchmod(fs4) {
7637
7639
  fs4.lchmod = function(path4, mode, callback) {
7638
7640
  fs4.open(
@@ -7865,7 +7867,7 @@ var require_graceful_fs = __commonJS({
7865
7867
  m = "GFS4: " + m.split(/\n/).join(`
7866
7868
  GFS4: `), console.error(m);
7867
7869
  });
7868
- fs3[gracefulQueue] || (queue = global[gracefulQueue] || [], publishQueue(fs3, queue), fs3.close = function(fs$close) {
7870
+ fs3[gracefulQueue] || (queue = global[gracefulQueue] || [], publishQueue(fs3, queue), fs3.close = (function(fs$close) {
7869
7871
  function close(fd, cb) {
7870
7872
  return fs$close.call(fs3, fd, function(err) {
7871
7873
  err || resetQueue(), typeof cb == "function" && cb.apply(this, arguments);
@@ -7874,14 +7876,14 @@ GFS4: `), console.error(m);
7874
7876
  return Object.defineProperty(close, previousSymbol, {
7875
7877
  value: fs$close
7876
7878
  }), close;
7877
- }(fs3.close), fs3.closeSync = function(fs$closeSync) {
7879
+ })(fs3.close), fs3.closeSync = (function(fs$closeSync) {
7878
7880
  function closeSync(fd) {
7879
7881
  fs$closeSync.apply(fs3, arguments), resetQueue();
7880
7882
  }
7881
7883
  return Object.defineProperty(closeSync, previousSymbol, {
7882
7884
  value: fs$closeSync
7883
7885
  }), closeSync;
7884
- }(fs3.closeSync), /\bgfs4\b/i.test(process.env.NODE_DEBUG || "") && process.on("exit", function() {
7886
+ })(fs3.closeSync), /\bgfs4\b/i.test(process.env.NODE_DEBUG || "") && process.on("exit", function() {
7885
7887
  debug(fs3[gracefulQueue]), __require("assert").equal(fs3[gracefulQueue].length, 0);
7886
7888
  }));
7887
7889
  var queue;
@@ -8105,15 +8107,15 @@ var require_dist2 = __commonJS({
8105
8107
  "../../node_modules/.pnpm/@pnpm+network.ca-file@1.0.2/node_modules/@pnpm/network.ca-file/dist/index.js"(exports) {
8106
8108
  "use strict";
8107
8109
  init_cjs_shims();
8108
- var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
8110
+ var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
8109
8111
  k2 === void 0 && (k2 = k);
8110
8112
  var desc = Object.getOwnPropertyDescriptor(m, k);
8111
8113
  (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) && (desc = { enumerable: !0, get: function() {
8112
8114
  return m[k];
8113
8115
  } }), Object.defineProperty(o, k2, desc);
8114
- } : function(o, m, k, k2) {
8116
+ }) : (function(o, m, k, k2) {
8115
8117
  k2 === void 0 && (k2 = k), o[k2] = m[k];
8116
- }), __exportStar = exports && exports.__exportStar || function(m, exports2) {
8118
+ })), __exportStar = exports && exports.__exportStar || function(m, exports2) {
8117
8119
  for (var p in m) p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p) && __createBinding(exports2, m, p);
8118
8120
  };
8119
8121
  Object.defineProperty(exports, "__esModule", { value: !0 });
@@ -8728,10 +8730,11 @@ var require_conf = __commonJS({
8728
8730
  };
8729
8731
  function deserializeEnvVal(envKey, envValue) {
8730
8732
  function deserializeList(envValue2) {
8731
- let npmConfigSep = `
8733
+ return envValue2.indexOf(`
8732
8734
 
8733
- `;
8734
- return envValue2.indexOf(npmConfigSep) ? envValue2.split(npmConfigSep) : envValue2.split(",");
8735
+ `) ? envValue2.split(`
8736
+
8737
+ `) : envValue2.split(",");
8735
8738
  }
8736
8739
  switch (envKey) {
8737
8740
  case "hoist-pattern":
@@ -8857,7 +8860,7 @@ var require_defaults2 = __commonJS({
8857
8860
  searchopts: "",
8858
8861
  searchexclude: null,
8859
8862
  searchlimit: 20,
8860
- searchstaleness: 15 * 60,
8863
+ searchstaleness: 900,
8861
8864
  "send-metrics": !1,
8862
8865
  shell: osenv.shell(),
8863
8866
  shrinkwrap: !0,
@@ -9825,32 +9828,80 @@ var LocalStorage = class {
9825
9828
  *
9826
9829
  * @param key - The key to get.
9827
9830
  * @returns The value.
9831
+ * @throws AbortError if a permission error occurs.
9832
+ * @throws BugError if an unexpected error occurs.
9828
9833
  */
9829
9834
  get(key) {
9830
- return this.config.get(key);
9835
+ try {
9836
+ return this.config.get(key);
9837
+ } catch (error) {
9838
+ this.handleError(error, "get");
9839
+ }
9831
9840
  }
9832
9841
  /**
9833
9842
  * Set a value in the local storage.
9834
9843
  *
9835
9844
  * @param key - The key to set.
9836
9845
  * @param value - The value to set.
9846
+ * @throws AbortError if a permission error occurs.
9847
+ * @throws BugError if an unexpected error occurs.
9837
9848
  */
9838
9849
  set(key, value) {
9839
- this.config.set(key, value);
9850
+ try {
9851
+ this.config.set(key, value);
9852
+ } catch (error) {
9853
+ this.handleError(error, "set");
9854
+ }
9840
9855
  }
9841
9856
  /**
9842
9857
  * Delete a value from the local storage.
9843
9858
  *
9844
9859
  * @param key - The key to delete.
9860
+ * @throws AbortError if a permission error occurs.
9861
+ * @throws BugError if an unexpected error occurs.
9845
9862
  */
9846
9863
  delete(key) {
9847
- this.config.delete(key);
9864
+ try {
9865
+ this.config.delete(key);
9866
+ } catch (error) {
9867
+ this.handleError(error, "delete");
9868
+ }
9848
9869
  }
9849
9870
  /**
9850
9871
  * Clear the local storage (delete all values).
9872
+ *
9873
+ * @throws AbortError if a permission error occurs.
9874
+ * @throws BugError if an unexpected error occurs.
9851
9875
  */
9852
9876
  clear() {
9853
- this.config.clear();
9877
+ try {
9878
+ this.config.clear();
9879
+ } catch (error) {
9880
+ this.handleError(error, "clear");
9881
+ }
9882
+ }
9883
+ /**
9884
+ * Handle errors from config operations.
9885
+ * If the error is permission-related, throw an AbortError with helpful hints.
9886
+ * Otherwise, throw a BugError.
9887
+ *
9888
+ * @param error - The error that occurred.
9889
+ * @param operation - The operation that failed.
9890
+ * @throws AbortError if the error is permission-related.
9891
+ * @throws BugError if the error is not permission-related.
9892
+ */
9893
+ handleError(error, operation) {
9894
+ throw this.isPermissionError() ? new AbortError(`Failed to access local storage (${operation}): ${error}`, this.tryMessage()) : new BugError(`Unexpected error while accessing local storage at ${this.config.path} (${operation}): ${error}`);
9895
+ }
9896
+ isPermissionError() {
9897
+ let canAccessFile = fileHasWritePermissions(this.config.path), canAccessFolder = fileHasWritePermissions(dirname(this.config.path)), ownsFile = unixFileIsOwnedByCurrentUser(this.config.path);
9898
+ return !canAccessFile || !canAccessFolder || ownsFile === !1;
9899
+ }
9900
+ tryMessage() {
9901
+ let ownsFile = unixFileIsOwnedByCurrentUser(this.config.path), ownsFolder = unixFileIsOwnedByCurrentUser(dirname(this.config.path)), message = ["Check that you have write permissions for", { filePath: this.config.path }];
9902
+ return (ownsFile === !1 || ownsFolder === !1) && message.push("- The file is owned by a different user. This typically happens when Shopify CLI was previously run with elevated permissions (e.g., sudo)."), message.push(`
9903
+
9904
+ To resolve this, remove the Shopify CLI preferences folder:`), message.push({ command: `rm -rf ${dirname(this.config.path)}` }), message;
9854
9905
  }
9855
9906
  };
9856
9907
 
@@ -13214,7 +13265,7 @@ var { buffer: getBuffer } = import_get_stream2.default, supportsBrotli = dist_de
13214
13265
  }
13215
13266
  _prepareCache(cache) {
13216
13267
  if (!cacheableStore.has(cache)) {
13217
- let cacheableRequest = new dist_default3((requestOptions, handler) => {
13268
+ let cacheableRequest = new dist_default3(((requestOptions, handler) => {
13218
13269
  let result = requestOptions._request(requestOptions, handler);
13219
13270
  return dist_default2.promise(result) && (result.once = (event, handler2) => {
13220
13271
  if (event === "error")
@@ -13236,7 +13287,7 @@ var { buffer: getBuffer } = import_get_stream2.default, supportsBrotli = dist_de
13236
13287
  throw new Error(`Unknown HTTP2 promise event: ${event}`);
13237
13288
  return result;
13238
13289
  }), result;
13239
- }, cache);
13290
+ }), cache);
13240
13291
  cacheableStore.set(cache, cacheableRequest.request());
13241
13292
  }
13242
13293
  }
@@ -13518,7 +13569,7 @@ var delay = async (ms) => new Promise((resolve) => {
13518
13569
  configurable: !1,
13519
13570
  writable: !1
13520
13571
  });
13521
- let got2 = (url, options, defaultOptions2 = defaults2.options) => {
13572
+ let got2 = ((url, options, defaultOptions2 = defaults2.options) => {
13522
13573
  let request = new Request(url, options, defaultOptions2), promise, lastHandler = (normalized) => (request.options = normalized, request._noPipe = !normalized.isStream, request.flush(), normalized.isStream ? request : (promise || (promise = asPromise(request)), promise)), iteration = 0, iterateHandlers = (newOptions) => {
13523
13574
  let result = (defaults2.handlers[iteration++] ?? lastHandler)(newOptions, iterateHandlers);
13524
13575
  if (dist_default2.promise(result) && !request.options.isStream && (promise || (promise = asPromise(request)), result !== promise)) {
@@ -13530,7 +13581,7 @@ var delay = async (ms) => new Promise((resolve) => {
13530
13581
  return result;
13531
13582
  };
13532
13583
  return iterateHandlers(request.options);
13533
- };
13584
+ });
13534
13585
  got2.extend = (...instancesOrOptions) => {
13535
13586
  let options = new Options(void 0, void 0, defaults2.options), handlers = [...defaults2.handlers], mutableDefaults;
13536
13587
  for (let value of instancesOrOptions)
@@ -13541,7 +13592,7 @@ var delay = async (ms) => new Promise((resolve) => {
13541
13592
  mutableDefaults: !!mutableDefaults
13542
13593
  });
13543
13594
  };
13544
- let paginateEach = async function* (url, options) {
13595
+ let paginateEach = (async function* (url, options) {
13545
13596
  let normalizedOptions = new Options(url, options, defaults2.options);
13546
13597
  normalizedOptions.resolveBodyOnly = !1;
13547
13598
  let { pagination } = normalizedOptions;
@@ -13563,15 +13614,15 @@ var delay = async (ms) => new Promise((resolve) => {
13563
13614
  return;
13564
13615
  optionsToMerge === response.request.options ? normalizedOptions = response.request.options : (normalizedOptions.merge(optionsToMerge), assert2.any([dist_default2.urlInstance, dist_default2.undefined], optionsToMerge.url), optionsToMerge.url !== void 0 && (normalizedOptions.prefixUrl = "", normalizedOptions.url = optionsToMerge.url)), numberOfRequests++;
13565
13616
  }
13566
- };
13567
- got2.paginate = paginateEach, got2.paginate.all = async (url, options) => {
13617
+ });
13618
+ got2.paginate = paginateEach, got2.paginate.all = (async (url, options) => {
13568
13619
  let results = [];
13569
13620
  for await (let item of paginateEach(url, options))
13570
13621
  results.push(item);
13571
13622
  return results;
13572
- }, got2.paginate.each = paginateEach, got2.stream = (url, options) => got2(url, { ...options, isStream: !0 });
13623
+ }), got2.paginate.each = paginateEach, got2.stream = ((url, options) => got2(url, { ...options, isStream: !0 }));
13573
13624
  for (let method of aliases)
13574
- got2[method] = (url, options) => got2(url, { ...options, method }), got2.stream[method] = (url, options) => got2(url, { ...options, method, isStream: !0 });
13625
+ got2[method] = ((url, options) => got2(url, { ...options, method })), got2.stream[method] = ((url, options) => got2(url, { ...options, method, isStream: !0 }));
13575
13626
  return defaults2.mutableDefaults || (Object.freeze(defaults2.handlers), defaults2.options.freeze()), Object.defineProperty(got2, "defaults", {
13576
13627
  value: defaults2,
13577
13628
  writable: !1,
@@ -13657,7 +13708,7 @@ async function latestVersion(packageName, options) {
13657
13708
  }
13658
13709
 
13659
13710
  // ../cli-kit/dist/public/node/node-package-manager.js
13660
- var import_semver3 = __toESM(require_semver(), 1), yarnLockfile = "yarn.lock", npmLockfile = "package-lock.json", pnpmLockfile = "pnpm-lock.yaml", bunLockfile = "bun.lockb", pnpmWorkspaceFile = "pnpm-workspace.yaml", lockfiles = [yarnLockfile, pnpmLockfile, npmLockfile, bunLockfile], lockfilesByManager = {
13711
+ var import_semver3 = __toESM(require_semver()), yarnLockfile = "yarn.lock", npmLockfile = "package-lock.json", pnpmLockfile = "pnpm-lock.yaml", bunLockfile = "bun.lockb", pnpmWorkspaceFile = "pnpm-workspace.yaml", lockfiles = [yarnLockfile, pnpmLockfile, npmLockfile, bunLockfile], lockfilesByManager = {
13661
13712
  yarn: yarnLockfile,
13662
13713
  npm: npmLockfile,
13663
13714
  pnpm: pnpmLockfile,
@@ -13972,4 +14023,4 @@ deep-extend/lib/deep-extend.js:
13972
14023
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
13973
14024
  *)
13974
14025
  */
13975
- //# sourceMappingURL=chunk-CQSO2B3C.js.map
14026
+ //# sourceMappingURL=chunk-UAYSVXRU.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  clearCollectedLogs,
3
3
  collectedLogs
4
- } from "./chunk-GG2ELY5O.js";
4
+ } from "./chunk-JMQJQNH7.js";
5
5
  import {
6
6
  init_cjs_shims
7
7
  } from "./chunk-PKR7KJ6P.js";
@@ -33,4 +33,4 @@ function mockAndCaptureOutput() {
33
33
  export {
34
34
  mockAndCaptureOutput
35
35
  };
36
- //# sourceMappingURL=chunk-GQ63RYWN.js.map
36
+ //# sourceMappingURL=chunk-UKECTTQZ.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  staticService
3
- } from "./chunk-TXX6R3WL.js";
3
+ } from "./chunk-DKRTUP7T.js";
4
4
  import {
5
5
  base_command_default
6
- } from "./chunk-NMGJYSTC.js";
6
+ } from "./chunk-7VKRIIXT.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-R6BNSDGA.js.map
28
+ //# sourceMappingURL=chunk-UXJEPFC3.js.map
@@ -4,18 +4,18 @@ import {
4
4
  import {
5
5
  fanoutHooks,
6
6
  reportAnalyticsEvent
7
- } from "./chunk-SMBX232U.js";
7
+ } from "./chunk-5RBPM5MR.js";
8
8
  import {
9
9
  getEnvironmentData,
10
10
  getLastSeenUserIdAfterAuth,
11
11
  isLocalEnvironment
12
- } from "./chunk-FRHZJBJZ.js";
12
+ } from "./chunk-NMH42STK.js";
13
13
  import {
14
14
  runWithRateLimit
15
- } from "./chunk-CQSO2B3C.js";
15
+ } from "./chunk-UAYSVXRU.js";
16
16
  import {
17
17
  CLI_KIT_VERSION
18
- } from "./chunk-TYHJPUOR.js";
18
+ } from "./chunk-LDFPMZVN.js";
19
19
  import {
20
20
  AbortSilentError,
21
21
  CancelExecution,
@@ -30,10 +30,10 @@ import {
30
30
  reportingRateLimit,
31
31
  require_stacktracey,
32
32
  shouldReportErrorAsUnexpected
33
- } from "./chunk-GG2ELY5O.js";
33
+ } from "./chunk-JMQJQNH7.js";
34
34
  import {
35
35
  require_lib
36
- } from "./chunk-F7F4BQYW.js";
36
+ } from "./chunk-X2YIODUW.js";
37
37
  import {
38
38
  cwd,
39
39
  isAbsolutePath,
@@ -111,25 +111,25 @@ var require_stackframe = __commonJS({
111
111
  });
112
112
  };
113
113
  for (var i = 0; i < booleanProps.length; i++)
114
- StackFrame.prototype["get" + _capitalize(booleanProps[i])] = _getter(booleanProps[i]), StackFrame.prototype["set" + _capitalize(booleanProps[i])] = /* @__PURE__ */ function(p) {
114
+ StackFrame.prototype["get" + _capitalize(booleanProps[i])] = _getter(booleanProps[i]), StackFrame.prototype["set" + _capitalize(booleanProps[i])] = /* @__PURE__ */ (function(p) {
115
115
  return function(v) {
116
116
  this[p] = !!v;
117
117
  };
118
- }(booleanProps[i]);
118
+ })(booleanProps[i]);
119
119
  for (var j = 0; j < numericProps.length; j++)
120
- StackFrame.prototype["get" + _capitalize(numericProps[j])] = _getter(numericProps[j]), StackFrame.prototype["set" + _capitalize(numericProps[j])] = /* @__PURE__ */ function(p) {
120
+ StackFrame.prototype["get" + _capitalize(numericProps[j])] = _getter(numericProps[j]), StackFrame.prototype["set" + _capitalize(numericProps[j])] = /* @__PURE__ */ (function(p) {
121
121
  return function(v) {
122
122
  if (!_isNumber(v))
123
123
  throw new TypeError(p + " must be a Number");
124
124
  this[p] = Number(v);
125
125
  };
126
- }(numericProps[j]);
126
+ })(numericProps[j]);
127
127
  for (var k = 0; k < stringProps.length; k++)
128
- StackFrame.prototype["get" + _capitalize(stringProps[k])] = _getter(stringProps[k]), StackFrame.prototype["set" + _capitalize(stringProps[k])] = /* @__PURE__ */ function(p) {
128
+ StackFrame.prototype["get" + _capitalize(stringProps[k])] = _getter(stringProps[k]), StackFrame.prototype["set" + _capitalize(stringProps[k])] = /* @__PURE__ */ (function(p) {
129
129
  return function(v) {
130
130
  this[p] = String(v);
131
131
  };
132
- }(stringProps[k]);
132
+ })(stringProps[k]);
133
133
  return StackFrame;
134
134
  });
135
135
  }
@@ -480,7 +480,7 @@ var require_bugsnag = __commonJS({
480
480
  typeof window < "u" ? g = window : typeof global < "u" ? g = global : typeof self < "u" ? g = self : g = this, g.bugsnag = f();
481
481
  }
482
482
  })(function() {
483
- var define2, module2, exports2, Breadcrumb = /* @__PURE__ */ function() {
483
+ var define2, module2, exports2, Breadcrumb = /* @__PURE__ */ (function() {
484
484
  function Breadcrumb2(message, metadata, type, timestamp) {
485
485
  timestamp === void 0 && (timestamp = /* @__PURE__ */ new Date()), this.type = type, this.message = message, this.metadata = metadata, this.timestamp = timestamp;
486
486
  }
@@ -493,7 +493,7 @@ var require_bugsnag = __commonJS({
493
493
  metaData: this.metadata
494
494
  };
495
495
  }, Breadcrumb2;
496
- }(), _$Breadcrumb_7 = Breadcrumb, _$breadcrumbTypes_12 = ["navigation", "request", "process", "log", "user", "state", "error", "manual"], _$reduce_22 = function(arr, fn, accum) {
496
+ })(), _$Breadcrumb_7 = Breadcrumb, _$breadcrumbTypes_12 = ["navigation", "request", "process", "log", "user", "state", "error", "manual"], _$reduce_22 = function(arr, fn, accum) {
497
497
  for (var val = accum, i = 0, len = arr.length; i < len; i++) val = fn(val, arr[i], i, arr);
498
498
  return val;
499
499
  }, _$filter_17 = function(arr, fn) {
@@ -946,7 +946,7 @@ var require_bugsnag = __commonJS({
946
946
  return n;
947
947
  }, _extends.apply(null, arguments);
948
948
  }
949
- var StackGenerator = require_stack_generator(), Event = /* @__PURE__ */ function() {
949
+ var StackGenerator = require_stack_generator(), Event = /* @__PURE__ */ (function() {
950
950
  function Event2(errorClass, errorMessage, stacktrace, handledState, originalError) {
951
951
  stacktrace === void 0 && (stacktrace = []), handledState === void 0 && (handledState = defaultHandledState()), this.apiKey = void 0, this.context = void 0, this.groupingHash = void 0, this.originalError = originalError, this._handledState = handledState, this.severity = this._handledState.severity, this.unhandled = this._handledState.unhandled, this.app = {}, this.device = {}, this.request = {}, this.breadcrumbs = [], this.threads = [], this._metadata = {}, this._features = [], this._featuresIndex = {}, this._user = {}, this._session = void 0, this._correlation = void 0, this._groupingDiscriminator = void 0, this.errors = [createBugsnagError(errorClass, errorMessage, Event2.__type, stacktrace)];
952
952
  }
@@ -1011,7 +1011,7 @@ var require_bugsnag = __commonJS({
1011
1011
  correlation: this._correlation
1012
1012
  };
1013
1013
  }, Event2;
1014
- }(), formatStackframe = function(frame) {
1014
+ })(), formatStackframe = function(frame) {
1015
1015
  var f = {
1016
1016
  file: frame.fileName,
1017
1017
  method: normaliseFunctionName(frame.functionName),
@@ -1205,7 +1205,7 @@ var require_bugsnag = __commonJS({
1205
1205
  return letter + timestamp + counter + print + random;
1206
1206
  }
1207
1207
  cuid.fingerprint = _$fingerprint_2, cuid.isCuid = _$isCuid_3;
1208
- var _$cuid_1 = cuid, Session = /* @__PURE__ */ function() {
1208
+ var _$cuid_1 = cuid, Session = /* @__PURE__ */ (function() {
1209
1209
  function Session2() {
1210
1210
  this.id = _$cuid_1(), this.startedAt = /* @__PURE__ */ new Date(), this._handled = 0, this._unhandled = 0, this._user = {}, this.app = {}, this.device = {};
1211
1211
  }
@@ -1230,8 +1230,8 @@ var require_bugsnag = __commonJS({
1230
1230
  }, _proto._track = function(event) {
1231
1231
  this[event._handledState.unhandled ? "_unhandled" : "_handled"] += 1;
1232
1232
  }, Session2;
1233
- }(), _$Session_34 = Session, __add_8 = _$featureFlagDelegate_23.add, __clear_8 = _$featureFlagDelegate_23.clear, __merge_8 = _$featureFlagDelegate_23.merge, HUB_PREFIX = "00000", HUB_NOTIFY = "https://notify.insighthub.smartbear.com", HUB_SESSION = "https://sessions.insighthub.smartbear.com", noop = function() {
1234
- }, Client = /* @__PURE__ */ function() {
1233
+ })(), _$Session_34 = Session, __add_8 = _$featureFlagDelegate_23.add, __clear_8 = _$featureFlagDelegate_23.clear, __merge_8 = _$featureFlagDelegate_23.merge, HUB_PREFIX = "00000", HUB_NOTIFY = "https://notify.insighthub.smartbear.com", HUB_SESSION = "https://sessions.insighthub.smartbear.com", noop = function() {
1234
+ }, Client = /* @__PURE__ */ (function() {
1235
1235
  function Client2(configuration, schema2, internalPlugins2, notifier) {
1236
1236
  var _this = this;
1237
1237
  schema2 === void 0 && (schema2 = _$config_9.schema), internalPlugins2 === void 0 && (internalPlugins2 = []), this._notifier = notifier, this._config = {}, this._schema = schema2, this._delivery = {
@@ -1393,7 +1393,7 @@ var require_bugsnag = __commonJS({
1393
1393
  });
1394
1394
  });
1395
1395
  }, Client2;
1396
- }(), generateConfigErrorMessage = function(errors, rawInput) {
1396
+ })(), generateConfigErrorMessage = function(errors, rawInput) {
1397
1397
  var er = new Error(`Invalid configuration
1398
1398
  ` + _$map_21(_$keys_20(errors), function(key) {
1399
1399
  return " - " + key + " " + errors[key] + ", got " + stringify(rawInput[key]);
@@ -1835,7 +1835,7 @@ metadata was removed`
1835
1835
  if (err && err.message !== "premature close") return cb(err);
1836
1836
  cb(null, slicer.getCode());
1837
1837
  });
1838
- }, CodeRange = /* @__PURE__ */ function(_Writable) {
1838
+ }, CodeRange = /* @__PURE__ */ (function(_Writable) {
1839
1839
  function CodeRange2(opts) {
1840
1840
  var _this;
1841
1841
  return _this = _Writable.call(this, ___extends_45({}, opts, {
@@ -1849,7 +1849,7 @@ metadata was removed`
1849
1849
  }, _proto.getCode = function() {
1850
1850
  return this._code;
1851
1851
  }, CodeRange2;
1852
- }(Writable), pMapSeries = function(ps) {
1852
+ })(Writable), pMapSeries = function(ps) {
1853
1853
  return new Promise(function(resolve2, reject) {
1854
1854
  var res = [];
1855
1855
  ps.reduce(function(accum, p) {
@@ -1928,7 +1928,7 @@ metadata was removed`
1928
1928
  return t2.__proto__ = e2, t2;
1929
1929
  }, ___setPrototypeOf_49(t, e);
1930
1930
  }
1931
- var DEFAULT_SUMMARY_INTERVAL = 10 * 1e3, Emitter = __require("events").EventEmitter, _$tracker_49 = /* @__PURE__ */ function(_Emitter) {
1931
+ var DEFAULT_SUMMARY_INTERVAL = 10 * 1e3, Emitter = __require("events").EventEmitter, _$tracker_49 = /* @__PURE__ */ (function(_Emitter) {
1932
1932
  function SessionTracker(intervalLength) {
1933
1933
  var _this;
1934
1934
  return _this = _Emitter.call(this) || this, _this._sessions = /* @__PURE__ */ new Map(), _this._interval = null, _this._intervalLength = intervalLength || DEFAULT_SUMMARY_INTERVAL, _this._summarize = _this._summarize.bind(_this), _this;
@@ -1951,7 +1951,7 @@ metadata was removed`
1951
1951
  }), _this2._sessions.delete(key);
1952
1952
  }), summary.length && this.emit("summary", summary);
1953
1953
  }, SessionTracker;
1954
- }(Emitter), dateToMsKey = function(d) {
1954
+ })(Emitter), dateToMsKey = function(d) {
1955
1955
  var dk = new Date(d);
1956
1956
  return dk.setSeconds(0), dk.setMilliseconds(0), dk.toISOString();
1957
1957
  }, _$session_48 = {
@@ -2237,4 +2237,4 @@ export {
2237
2237
  registerCleanBugsnagErrorsFromWithinPlugins,
2238
2238
  addBugsnagMetadata
2239
2239
  };
2240
- //# sourceMappingURL=chunk-RZPYG7LO.js.map
2240
+ //# sourceMappingURL=chunk-WZTQS5NN.js.map