@shopify/cli 3.84.1 → 3.85.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 (105) hide show
  1. package/README.md +1 -1
  2. package/dist/{chokidar-KCZH6DIC.js → chokidar-TTCYG5AA.js} +5 -5
  3. package/dist/{chokidar-XPSJ2FUJ.js → chokidar-XUA2BN3J.js} +5 -5
  4. package/dist/{chunk-TW3OHW6H.js → chunk-2IA24ROR.js} +10 -9
  5. package/dist/{chunk-R3FZ7BFA.js → chunk-2IEQZDJI.js} +3 -3
  6. package/dist/{chunk-77NCO4UD.js → chunk-47CMAYQE.js} +3 -3
  7. package/dist/{chunk-MCEP4L5M.js → chunk-4JN3JAPL.js} +3 -3
  8. package/dist/{chunk-JNDSQA4U.js → chunk-5FNCRAPA.js} +3 -3
  9. package/dist/{chunk-KS7CKFXX.js → chunk-76S5M67J.js} +7 -7
  10. package/dist/{chunk-PQCWFPSI.js → chunk-A26YXFMX.js} +8 -8
  11. package/dist/{chunk-JJH27HLJ.js → chunk-AJOVRT5K.js} +3 -3
  12. package/dist/{chunk-57KJCVB5.js → chunk-AJYT5DKD.js} +2 -2
  13. package/dist/{chunk-HMDWNGIV.js → chunk-AM4QB5OM.js} +206 -100
  14. package/dist/{chunk-SKEV2KRG.js → chunk-B36FYNEM.js} +664 -587
  15. package/dist/{chunk-JB4IBM6F.js → chunk-BB4VAGLH.js} +2 -2
  16. package/dist/{chunk-W5G2YPO2.js → chunk-BQ3PZIHZ.js} +7 -7
  17. package/dist/{chunk-GWETXJR2.js → chunk-C4XAKIGB.js} +8 -8
  18. package/dist/{chunk-2HA6WHOK.js → chunk-DJVJNSKZ.js} +2 -2
  19. package/dist/{chunk-IM2PF4V5.js → chunk-DKG2TMNN.js} +2 -2
  20. package/dist/{del-SAZHGAZZ.js → chunk-EFOOQV72.js} +17 -378
  21. package/dist/{chunk-3FBDJEGD.js → chunk-F7F4BQYW.js} +1824 -762
  22. package/dist/{chunk-66VZYBID.js → chunk-F7J5CUMZ.js} +4 -4
  23. package/dist/{chunk-IRF44N7J.js → chunk-G2VTHDI5.js} +42 -18
  24. package/dist/{chunk-2M63OZ6L.js → chunk-HNHQAN5R.js} +3 -3
  25. package/dist/chunk-IWFYXDPH.js +109 -0
  26. package/dist/{chunk-NBOUUR2C.js → chunk-JF6OJWJV.js} +3 -3
  27. package/dist/{chunk-Y4JV2C2F.js → chunk-JR35C77F.js} +3 -3
  28. package/dist/{chunk-K5XXB73S.js → chunk-K2VBTQSL.js} +187 -43
  29. package/dist/chunk-KU6FTMKN.js +87 -0
  30. package/dist/{chunk-MQQ5ZTSK.js → chunk-NYUWDGSK.js} +7 -7
  31. package/dist/{chunk-DVZ22YSP.js → chunk-PUO72IWW.js} +16 -20
  32. package/dist/{chunk-42TDSAFO.js → chunk-T3FBGLW4.js} +4 -4
  33. package/dist/{chunk-G5R6YD27.js → chunk-UATXMR5F.js} +2 -103
  34. package/dist/{chunk-4JIM2QT7.js → chunk-UGBL65P2.js} +4 -4
  35. package/dist/{chunk-QO4ILPU2.js → chunk-VELVK2EZ.js} +4 -4
  36. package/dist/{chunk-5G56F2K6.js → chunk-VLSFD7SJ.js} +19 -18
  37. package/dist/{chunk-FYGQPHYH.js → chunk-WRIQTRQE.js} +2 -2
  38. package/dist/{chunk-7AEOEVGT.js → chunk-XO7GQ2WG.js} +3 -3
  39. package/dist/{chunk-FUWTEDP2.js → chunk-XTCT7ABH.js} +16379 -5792
  40. package/dist/{chunk-N2463ZYG.js → chunk-Y4DWHLHN.js} +3 -3
  41. package/dist/{chunk-ES5N6OQW.js → chunk-Y7JIZJYE.js} +5 -5
  42. package/dist/{chunk-DNXNKHZO.js → chunk-Z7TXQNKI.js} +2 -2
  43. package/dist/chunk-ZAVXS5HH.js +4654 -0
  44. package/dist/{chunk-DSKW7GLZ.js → chunk-ZXKNRG53.js} +5 -5
  45. package/dist/cli/commands/auth/login.d.ts +8 -0
  46. package/dist/cli/commands/auth/login.js +28 -0
  47. package/dist/cli/commands/auth/login.test.js +53 -0
  48. package/dist/cli/commands/auth/logout.js +15 -17
  49. package/dist/cli/commands/auth/logout.test.js +20 -22
  50. package/dist/cli/commands/cache/clear.js +15 -16
  51. package/dist/cli/commands/debug/command-flags.js +15 -16
  52. package/dist/cli/commands/docs/generate.js +15 -16
  53. package/dist/cli/commands/docs/generate.test.js +21 -22
  54. package/dist/cli/commands/help.js +15 -16
  55. package/dist/cli/commands/kitchen-sink/async.js +16 -17
  56. package/dist/cli/commands/kitchen-sink/async.test.js +17 -18
  57. package/dist/cli/commands/kitchen-sink/index.js +18 -19
  58. package/dist/cli/commands/kitchen-sink/index.test.js +21 -22
  59. package/dist/cli/commands/kitchen-sink/prompts.js +16 -17
  60. package/dist/cli/commands/kitchen-sink/prompts.test.js +17 -18
  61. package/dist/cli/commands/kitchen-sink/static.js +16 -17
  62. package/dist/cli/commands/kitchen-sink/static.test.js +17 -18
  63. package/dist/cli/commands/notifications/generate.js +16 -17
  64. package/dist/cli/commands/notifications/list.js +16 -17
  65. package/dist/cli/commands/search.js +16 -17
  66. package/dist/cli/commands/upgrade.js +16 -17
  67. package/dist/cli/commands/upgrade.test.js +1 -1
  68. package/dist/cli/commands/version.js +16 -17
  69. package/dist/cli/commands/version.test.js +17 -18
  70. package/dist/cli/services/commands/notifications.js +11 -12
  71. package/dist/cli/services/commands/search.js +7 -8
  72. package/dist/cli/services/commands/search.test.js +8 -9
  73. package/dist/cli/services/commands/version.js +8 -9
  74. package/dist/cli/services/commands/version.test.js +10 -11
  75. package/dist/cli/services/kitchen-sink/async.js +7 -8
  76. package/dist/cli/services/kitchen-sink/prompts.js +7 -8
  77. package/dist/cli/services/kitchen-sink/static.js +7 -8
  78. package/dist/cli/services/upgrade.js +8 -9
  79. package/dist/cli/services/upgrade.test.js +12 -13
  80. package/dist/configs/all.yml +3 -0
  81. package/dist/configs/recommended.yml +3 -0
  82. package/dist/{custom-oclif-loader-LOMFS5PB.js → custom-oclif-loader-J2DN7UTY.js} +11 -12
  83. package/dist/data/objects.json +2 -2
  84. package/dist/data/shopify_system_translations.json +69 -22
  85. package/dist/data/tags.json +10 -10
  86. package/dist/del-DNZ7X2HW.js +377 -0
  87. package/dist/{error-handler-TQKQ3EAE.js → error-handler-JJ76ZQMC.js} +13 -14
  88. package/dist/hooks/postrun.js +13 -15
  89. package/dist/hooks/prerun.js +14 -15
  90. package/dist/index.d.ts +1 -1
  91. package/dist/index.js +7477 -5649
  92. package/dist/{lib-OSXFX3I2.js → lib-DEEC6IKU.js} +3 -4
  93. package/dist/{local-76WZCPFM.js → local-2JWTG2IJ.js} +7 -8
  94. package/dist/{morph-TYIH255V.js → morph-5D7H6MU2.js} +13 -11
  95. package/dist/{node-package-manager-OCGFQDFC.js → node-package-manager-YCQL3774.js} +8 -9
  96. package/dist/{npa-E675GQOI.js → npa-LHT53SWR.js} +3 -5
  97. package/dist/tsconfig.tsbuildinfo +1 -1
  98. package/dist/{ui-A52PK2HZ.js → ui-HITLA3H3.js} +9 -8
  99. package/dist/{workerd-PHNPZMMV.js → workerd-KHWXFNPK.js} +22 -22
  100. package/oclif.manifest.json +79 -9
  101. package/package.json +10 -10
  102. package/dist/chunk-CP3BRHWK.js +0 -33
  103. package/dist/chunk-EZQWZ57B.js +0 -53
  104. package/dist/chunk-T4K4LRMO.js +0 -1216
  105. package/dist/chunk-YQVYH3XF.js +0 -119
@@ -1,9 +1,9 @@
1
- import {
2
- require_picomatch
3
- } from "./chunk-7IK72W75.js";
4
1
  import {
5
2
  require_normalize_path
6
3
  } from "./chunk-X7YTIMNN.js";
4
+ import {
5
+ require_picomatch
6
+ } from "./chunk-7IK72W75.js";
7
7
  import {
8
8
  __commonJS,
9
9
  __require,
@@ -494,4 +494,4 @@ export {
494
494
  require_anymatch,
495
495
  require_is_binary_path
496
496
  };
497
- //# sourceMappingURL=chunk-66VZYBID.js.map
497
+ //# sourceMappingURL=chunk-F7J5CUMZ.js.map
@@ -18,14 +18,14 @@ import {
18
18
  require_get_stream,
19
19
  runWithTimer,
20
20
  writeFile
21
- } from "./chunk-SKEV2KRG.js";
21
+ } from "./chunk-B36FYNEM.js";
22
+ import {
23
+ require_semver
24
+ } from "./chunk-F7F4BQYW.js";
22
25
  import {
23
26
  dirname,
24
27
  joinPath
25
28
  } from "./chunk-EG6MBBEN.js";
26
- import {
27
- require_semver
28
- } from "./chunk-HMDWNGIV.js";
29
29
  import {
30
30
  __commonJS,
31
31
  __export,
@@ -9859,15 +9859,24 @@ var _instance;
9859
9859
  function cliKitStore() {
9860
9860
  return _instance || (_instance = new LocalStorage({ projectName: `shopify-cli-kit${isUnitTest() ? "-test" : ""}` })), _instance;
9861
9861
  }
9862
- function getSession(config = cliKitStore()) {
9862
+ function getSessions(config = cliKitStore()) {
9863
9863
  return outputDebug(outputContent`Getting session store...`), config.get("sessionStore");
9864
9864
  }
9865
- function setSession(session, config = cliKitStore()) {
9865
+ function setSessions(session, config = cliKitStore()) {
9866
9866
  outputDebug(outputContent`Setting session store...`), config.set("sessionStore", session);
9867
9867
  }
9868
- function removeSession(config = cliKitStore()) {
9868
+ function removeSessions(config = cliKitStore()) {
9869
9869
  outputDebug(outputContent`Removing session store...`), config.delete("sessionStore");
9870
9870
  }
9871
+ function getCurrentSessionId(config = cliKitStore()) {
9872
+ return outputDebug(outputContent`Getting current session ID...`), config.get("currentSessionId");
9873
+ }
9874
+ function setCurrentSessionId(sessionId, config = cliKitStore()) {
9875
+ outputDebug(outputContent`Setting current session ID...`), config.set("currentSessionId", sessionId);
9876
+ }
9877
+ function removeCurrentSessionId(config = cliKitStore()) {
9878
+ outputDebug(outputContent`Removing current session ID...`), config.delete("currentSessionId");
9879
+ }
9871
9880
  async function cacheRetrieveOrRepopulate(key, fn, timeout, config = cliKitStore()) {
9872
9881
  let cached = cacheRetrieve(key, config);
9873
9882
  if (cached?.value !== void 0 && (timeout === void 0 || Date.now() - cached.timestamp < timeout))
@@ -9876,11 +9885,11 @@ async function cacheRetrieveOrRepopulate(key, fn, timeout, config = cliKitStore(
9876
9885
  return cacheStore(key, value, config), value;
9877
9886
  }
9878
9887
  function cacheStore(key, value, config = cliKitStore()) {
9879
- let cache = config.get("cache") || {};
9888
+ let cache = config.get("cache") ?? {};
9880
9889
  cache[key] = { value, timestamp: Date.now() }, config.set("cache", cache);
9881
9890
  }
9882
9891
  function cacheRetrieve(key, config = cliKitStore()) {
9883
- return (config.get("cache") || {})[key];
9892
+ return (config.get("cache") ?? {})[key];
9884
9893
  }
9885
9894
  function cacheClear(config = cliKitStore()) {
9886
9895
  config.delete("cache");
@@ -9889,11 +9898,11 @@ function timeIntervalToMilliseconds({ days = 0, hours = 0, minutes = 0, seconds
9889
9898
  return (days * 24 * 60 * 60 + hours * 60 * 60 + minutes * 60 + seconds) * 1e3;
9890
9899
  }
9891
9900
  async function runAtMinimumInterval(key, timeout, task, config = cliKitStore()) {
9892
- let cache = config.get("cache") || {}, cacheKey = `most-recent-occurrence-${key}`, cached = cache[cacheKey];
9901
+ let cache = config.get("cache") ?? {}, cacheKey = `most-recent-occurrence-${key}`, cached = cache[cacheKey];
9893
9902
  return cached?.value !== void 0 && Date.now() - cached.timestamp < timeIntervalToMilliseconds(timeout) ? !1 : (await task(), cache[cacheKey] = { value: !0, timestamp: Date.now() }, config.set("cache", cache), !0);
9894
9903
  }
9895
9904
  async function runWithRateLimit(options, config = cliKitStore()) {
9896
- let { key, limit, timeout, task } = options, cache = config.get("cache") || {}, cacheKey = `rate-limited-occurrences-${key}`, cached = cache[cacheKey], now = Date.now();
9905
+ let { key, limit, timeout, task } = options, cache = config.get("cache") ?? {}, cacheKey = `rate-limited-occurrences-${key}`, cached = cache[cacheKey], now = Date.now();
9897
9906
  if (cached?.value) {
9898
9907
  let windowStart = now - timeIntervalToMilliseconds(timeout), occurrences = cached.value.filter((occurrence) => occurrence >= windowStart);
9899
9908
  if (occurrences.length >= limit)
@@ -10528,7 +10537,7 @@ import urlLib from "node:url";
10528
10537
  import crypto2 from "node:crypto";
10529
10538
  import stream, { PassThrough as PassThroughStream } from "node:stream";
10530
10539
 
10531
- // ../../node_modules/.pnpm/normalize-url@8.0.1/node_modules/normalize-url/index.js
10540
+ // ../../node_modules/.pnpm/normalize-url@8.1.0/node_modules/normalize-url/index.js
10532
10541
  init_cjs_shims();
10533
10542
  var DATA_URL_DEFAULT_MIME_TYPE = "text/plain", DATA_URL_DEFAULT_CHARSET = "us-ascii", testParameter = (name, filters) => filters.some((filter) => filter instanceof RegExp ? filter.test(name) : filter === name), supportedProtocols = /* @__PURE__ */ new Set([
10534
10543
  "https:",
@@ -10573,6 +10582,8 @@ function normalizeUrl(urlString, options) {
10573
10582
  removeDirectoryIndex: !1,
10574
10583
  removeExplicitPort: !1,
10575
10584
  sortQueryParameters: !0,
10585
+ removePath: !1,
10586
+ transformPath: !1,
10576
10587
  ...options
10577
10588
  }, typeof options.defaultProtocol == "string" && !options.defaultProtocol.endsWith(":") && (options.defaultProtocol = `${options.defaultProtocol}:`), urlString = urlString.trim(), /^data:/i.test(urlString))
10578
10589
  return normalizeDataURL(urlString, options);
@@ -10597,13 +10608,17 @@ function normalizeUrl(urlString, options) {
10597
10608
  }
10598
10609
  if (urlObject.pathname)
10599
10610
  try {
10600
- urlObject.pathname = decodeURI(urlObject.pathname);
10611
+ urlObject.pathname = decodeURI(urlObject.pathname).replace(/\\/g, "%5C");
10601
10612
  } catch {
10602
10613
  }
10603
10614
  if (options.removeDirectoryIndex === !0 && (options.removeDirectoryIndex = [/^index\.[a-z]+$/]), Array.isArray(options.removeDirectoryIndex) && options.removeDirectoryIndex.length > 0) {
10604
10615
  let pathComponents = urlObject.pathname.split("/"), lastComponent = pathComponents[pathComponents.length - 1];
10605
10616
  testParameter(lastComponent, options.removeDirectoryIndex) && (pathComponents = pathComponents.slice(0, -1), urlObject.pathname = pathComponents.slice(1).join("/") + "/");
10606
10617
  }
10618
+ if (options.removePath && (urlObject.pathname = "/"), options.transformPath && typeof options.transformPath == "function") {
10619
+ let pathComponents = urlObject.pathname.split("/").filter(Boolean), newComponents = options.transformPath(pathComponents);
10620
+ urlObject.pathname = newComponents?.length > 0 ? `/${newComponents.join("/")}` : "/";
10621
+ }
10607
10622
  if (urlObject.hostname && (urlObject.hostname = urlObject.hostname.replace(/\.$/, ""), options.stripWWW && /^www\.(?!www\.)[a-z\-\d]{1,63}\.[a-z.\-\d]{2,63}$/.test(urlObject.hostname) && (urlObject.hostname = urlObject.hostname.replace(/^www\./, ""))), Array.isArray(options.removeQueryParameters))
10608
10623
  for (let key of [...urlObject.searchParams.keys()])
10609
10624
  testParameter(key, options.removeQueryParameters) && urlObject.searchParams.delete(key);
@@ -10611,11 +10626,17 @@ function normalizeUrl(urlString, options) {
10611
10626
  for (let key of [...urlObject.searchParams.keys()])
10612
10627
  testParameter(key, options.keepQueryParameters) || urlObject.searchParams.delete(key);
10613
10628
  if (options.sortQueryParameters) {
10629
+ let originalSearch = urlObject.search;
10614
10630
  urlObject.searchParams.sort();
10615
10631
  try {
10616
10632
  urlObject.search = decodeURIComponent(urlObject.search);
10617
10633
  } catch {
10618
10634
  }
10635
+ let partsWithoutEquals = originalSearch.slice(1).split("&").filter((p) => p && !p.includes("="));
10636
+ for (let part of partsWithoutEquals) {
10637
+ let decoded = decodeURIComponent(part);
10638
+ urlObject.search = urlObject.search.replace(`?${decoded}=`, `?${decoded}`).replace(`&${decoded}=`, `&${decoded}`);
10639
+ }
10619
10640
  }
10620
10641
  options.removeTrailingSlash && (urlObject.pathname = urlObject.pathname.replace(/\/$/, "")), options.removeExplicitPort && urlObject.port && (urlObject.port = "");
10621
10642
  let oldUrlString = urlString;
@@ -13636,7 +13657,7 @@ async function latestVersion(packageName, options) {
13636
13657
  }
13637
13658
 
13638
13659
  // ../cli-kit/dist/public/node/node-package-manager.js
13639
- 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 = {
13660
+ 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 = {
13640
13661
  yarn: yarnLockfile,
13641
13662
  npm: npmLockfile,
13642
13663
  pnpm: pnpmLockfile,
@@ -13876,9 +13897,12 @@ function inferPackageManager(optionsPackageManager, env = process.env) {
13876
13897
  export {
13877
13898
  require_ajv,
13878
13899
  LocalStorage,
13879
- getSession,
13880
- setSession,
13881
- removeSession,
13900
+ getSessions,
13901
+ setSessions,
13902
+ removeSessions,
13903
+ getCurrentSessionId,
13904
+ setCurrentSessionId,
13905
+ removeCurrentSessionId,
13882
13906
  cacheRetrieveOrRepopulate,
13883
13907
  cacheStore,
13884
13908
  cacheRetrieve,
@@ -13948,4 +13972,4 @@ deep-extend/lib/deep-extend.js:
13948
13972
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
13949
13973
  *)
13950
13974
  */
13951
- //# sourceMappingURL=chunk-IRF44N7J.js.map
13975
+ //# sourceMappingURL=chunk-G2VTHDI5.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  prompts
3
- } from "./chunk-DNXNKHZO.js";
3
+ } from "./chunk-Z7TXQNKI.js";
4
4
  import {
5
5
  base_command_default
6
- } from "./chunk-TW3OHW6H.js";
6
+ } from "./chunk-2IA24ROR.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-2M63OZ6L.js.map
28
+ //# sourceMappingURL=chunk-HNHQAN5R.js.map
@@ -0,0 +1,109 @@
1
+ import {
2
+ require_balanced_match
3
+ } from "./chunk-XE5EOEBL.js";
4
+ import {
5
+ __commonJS,
6
+ init_cjs_shims
7
+ } from "./chunk-PKR7KJ6P.js";
8
+
9
+ // ../../node_modules/.pnpm/brace-expansion@2.0.2/node_modules/brace-expansion/index.js
10
+ var require_brace_expansion = __commonJS({
11
+ "../../node_modules/.pnpm/brace-expansion@2.0.2/node_modules/brace-expansion/index.js"(exports, module) {
12
+ init_cjs_shims();
13
+ var balanced = require_balanced_match();
14
+ module.exports = expandTop;
15
+ var escSlash = "\0SLASH" + Math.random() + "\0", escOpen = "\0OPEN" + Math.random() + "\0", escClose = "\0CLOSE" + Math.random() + "\0", escComma = "\0COMMA" + Math.random() + "\0", escPeriod = "\0PERIOD" + Math.random() + "\0";
16
+ function numeric(str) {
17
+ return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0);
18
+ }
19
+ function escapeBraces(str) {
20
+ return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod);
21
+ }
22
+ function unescapeBraces(str) {
23
+ return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join(".");
24
+ }
25
+ function parseCommaParts(str) {
26
+ if (!str)
27
+ return [""];
28
+ var parts = [], m = balanced("{", "}", str);
29
+ if (!m)
30
+ return str.split(",");
31
+ var pre = m.pre, body = m.body, post = m.post, p = pre.split(",");
32
+ p[p.length - 1] += "{" + body + "}";
33
+ var postParts = parseCommaParts(post);
34
+ return post.length && (p[p.length - 1] += postParts.shift(), p.push.apply(p, postParts)), parts.push.apply(parts, p), parts;
35
+ }
36
+ function expandTop(str) {
37
+ return str ? (str.substr(0, 2) === "{}" && (str = "\\{\\}" + str.substr(2)), expand(escapeBraces(str), !0).map(unescapeBraces)) : [];
38
+ }
39
+ function embrace(str) {
40
+ return "{" + str + "}";
41
+ }
42
+ function isPadded(el) {
43
+ return /^-?0\d/.test(el);
44
+ }
45
+ function lte(i, y) {
46
+ return i <= y;
47
+ }
48
+ function gte(i, y) {
49
+ return i >= y;
50
+ }
51
+ function expand(str, isTop) {
52
+ var expansions = [], m = balanced("{", "}", str);
53
+ if (!m) return [str];
54
+ var pre = m.pre, post = m.post.length ? expand(m.post, !1) : [""];
55
+ if (/\$$/.test(m.pre))
56
+ for (var k = 0; k < post.length; k++) {
57
+ var expansion = pre + "{" + m.body + "}" + post[k];
58
+ expansions.push(expansion);
59
+ }
60
+ else {
61
+ var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body), isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body), isSequence = isNumericSequence || isAlphaSequence, isOptions = m.body.indexOf(",") >= 0;
62
+ if (!isSequence && !isOptions)
63
+ return m.post.match(/,(?!,).*\}/) ? (str = m.pre + "{" + m.body + escClose + m.post, expand(str)) : [str];
64
+ var n;
65
+ if (isSequence)
66
+ n = m.body.split(/\.\./);
67
+ else if (n = parseCommaParts(m.body), n.length === 1 && (n = expand(n[0], !1).map(embrace), n.length === 1))
68
+ return post.map(function(p) {
69
+ return m.pre + n[0] + p;
70
+ });
71
+ var N;
72
+ if (isSequence) {
73
+ var x = numeric(n[0]), y = numeric(n[1]), width = Math.max(n[0].length, n[1].length), incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1, test = lte, reverse = y < x;
74
+ reverse && (incr *= -1, test = gte);
75
+ var pad = n.some(isPadded);
76
+ N = [];
77
+ for (var i = x; test(i, y); i += incr) {
78
+ var c;
79
+ if (isAlphaSequence)
80
+ c = String.fromCharCode(i), c === "\\" && (c = "");
81
+ else if (c = String(i), pad) {
82
+ var need = width - c.length;
83
+ if (need > 0) {
84
+ var z = new Array(need + 1).join("0");
85
+ i < 0 ? c = "-" + z + c.slice(1) : c = z + c;
86
+ }
87
+ }
88
+ N.push(c);
89
+ }
90
+ } else {
91
+ N = [];
92
+ for (var j = 0; j < n.length; j++)
93
+ N.push.apply(N, expand(n[j], !1));
94
+ }
95
+ for (var j = 0; j < N.length; j++)
96
+ for (var k = 0; k < post.length; k++) {
97
+ var expansion = pre + N[j] + post[k];
98
+ (!isTop || isSequence || expansion) && expansions.push(expansion);
99
+ }
100
+ }
101
+ return expansions;
102
+ }
103
+ }
104
+ });
105
+
106
+ export {
107
+ require_brace_expansion
108
+ };
109
+ //# sourceMappingURL=chunk-IWFYXDPH.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  staticService
3
- } from "./chunk-IM2PF4V5.js";
3
+ } from "./chunk-DKG2TMNN.js";
4
4
  import {
5
5
  base_command_default
6
- } from "./chunk-TW3OHW6H.js";
6
+ } from "./chunk-2IA24ROR.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-NBOUUR2C.js.map
28
+ //# sourceMappingURL=chunk-JF6OJWJV.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  versionService
3
- } from "./chunk-R3FZ7BFA.js";
3
+ } from "./chunk-2IEQZDJI.js";
4
4
  import {
5
5
  base_command_default
6
- } from "./chunk-TW3OHW6H.js";
6
+ } from "./chunk-2IA24ROR.js";
7
7
  import {
8
8
  init_cjs_shims
9
9
  } from "./chunk-PKR7KJ6P.js";
@@ -22,4 +22,4 @@ var Version = class extends base_command_default {
22
22
  export {
23
23
  Version
24
24
  };
25
- //# sourceMappingURL=chunk-Y4JV2C2F.js.map
25
+ //# sourceMappingURL=chunk-JR35C77F.js.map
@@ -1,17 +1,18 @@
1
1
  import {
2
2
  getEnvironmentData,
3
3
  getLastSeenUserIdAfterAuth,
4
- getSensitiveEnvironmentData
5
- } from "./chunk-T4K4LRMO.js";
4
+ getSensitiveEnvironmentData,
5
+ requestIdsCollection
6
+ } from "./chunk-ZAVXS5HH.js";
6
7
  import {
7
8
  fetch
8
- } from "./chunk-DVZ22YSP.js";
9
- import {
10
- CLI_KIT_VERSION
11
- } from "./chunk-FYGQPHYH.js";
9
+ } from "./chunk-PUO72IWW.js";
12
10
  import {
13
11
  runWithRateLimit
14
- } from "./chunk-IRF44N7J.js";
12
+ } from "./chunk-G2VTHDI5.js";
13
+ import {
14
+ CLI_KIT_VERSION
15
+ } from "./chunk-WRIQTRQE.js";
15
16
  import {
16
17
  alwaysLogAnalytics,
17
18
  alwaysLogMetrics,
@@ -21,14 +22,13 @@ import {
21
22
  getArrayContainsDuplicates,
22
23
  getArrayRejectingUndefined,
23
24
  isShopify,
24
- isSpinEnvironment,
25
25
  isUnitTest,
26
26
  opentelemetryDomain,
27
27
  outputContent,
28
28
  outputDebug,
29
29
  outputToken,
30
30
  reportingRateLimit
31
- } from "./chunk-SKEV2KRG.js";
31
+ } from "./chunk-B36FYNEM.js";
32
32
  import {
33
33
  __commonJS,
34
34
  __esm,
@@ -15503,6 +15503,165 @@ var buildHeaders = (currentTime) => ({
15503
15503
  "X-Monorail-Edge-Event-Sent-At-Ms": currentTime.toString()
15504
15504
  });
15505
15505
 
15506
+ // ../cli-kit/dist/private/node/analytics/storage.js
15507
+ init_cjs_shims();
15508
+
15509
+ // ../cli-kit/dist/private/node/analytics/error-categorizer.js
15510
+ init_cjs_shims();
15511
+ var ErrorCategory;
15512
+ (function(ErrorCategory2) {
15513
+ ErrorCategory2.Liquid = "LIQUID", ErrorCategory2.ThemeCheck = "THEME_CHECK", ErrorCategory2.Network = "NETWORK", ErrorCategory2.FileSystem = "FILE_SYSTEM", ErrorCategory2.Authentication = "AUTHENTICATION", ErrorCategory2.Validation = "VALIDATION", ErrorCategory2.Permission = "PERMISSION", ErrorCategory2.RateLimit = "RATE_LIMIT", ErrorCategory2.Json = "JSON", ErrorCategory2.Unknown = "UNKNOWN";
15514
+ })(ErrorCategory || (ErrorCategory = {}));
15515
+ var ERROR_CATEGORY_TERMS = {
15516
+ [ErrorCategory.Liquid]: ["liquid"],
15517
+ [ErrorCategory.Json]: ["json", "parse response"],
15518
+ [ErrorCategory.ThemeCheck]: ["theme check"],
15519
+ [ErrorCategory.Authentication]: ["unauthorized", "forbidden", "auth", "token", "credential"],
15520
+ [ErrorCategory.Network]: [
15521
+ "eai_again",
15522
+ "econn",
15523
+ "enetunreach",
15524
+ "enotfound",
15525
+ "epipe",
15526
+ "etimedout",
15527
+ "fetch",
15528
+ "network",
15529
+ "request",
15530
+ "socket",
15531
+ "the operation was aborted",
15532
+ "timed out",
15533
+ "timeout"
15534
+ ],
15535
+ [ErrorCategory.FileSystem]: ["enoent", "eacces", "file", "directory", "path"],
15536
+ [ErrorCategory.Permission]: ["permission", "denied", "access", "insufficient"],
15537
+ [ErrorCategory.RateLimit]: ["rate limit", "too many requests", "throttle"],
15538
+ [ErrorCategory.Validation]: ["validation", "invalid", "required"]
15539
+ };
15540
+ function categorizeError(error) {
15541
+ if (!(error instanceof Error))
15542
+ return ErrorCategory.Unknown;
15543
+ let message = error.message.toLowerCase();
15544
+ for (let [category, terms] of Object.entries(ERROR_CATEGORY_TERMS))
15545
+ if (terms.some((term) => message.includes(term)))
15546
+ return category;
15547
+ return ErrorCategory.Unknown;
15548
+ }
15549
+ function formatErrorMessage(error, category) {
15550
+ let message = error instanceof Error ? error.message : String(error);
15551
+ return (ERROR_FORMATTERS[category] || formatGenericError)(message);
15552
+ }
15553
+ var ERROR_FORMATTERS = {
15554
+ [ErrorCategory.Network]: formatNetworkError,
15555
+ [ErrorCategory.Authentication]: formatGenericError,
15556
+ [ErrorCategory.FileSystem]: formatGenericError,
15557
+ [ErrorCategory.RateLimit]: formatGenericError,
15558
+ [ErrorCategory.Json]: formatGenericError,
15559
+ [ErrorCategory.Validation]: formatGenericError,
15560
+ [ErrorCategory.Permission]: formatGenericError,
15561
+ [ErrorCategory.Liquid]: formatGenericError,
15562
+ [ErrorCategory.ThemeCheck]: formatGenericError,
15563
+ [ErrorCategory.Unknown]: formatGenericError
15564
+ };
15565
+ function formatNetworkError(message) {
15566
+ let httpStatusMatch = message.match(/\b([1-5]\d{2})\b/), connectionErrorMatch = message.match(/\b(E[A-Z]+)\b/), graphqlCodeMatch = message.match(/(?:code|error)[:\s]*(\d{3})/i), normalized = message.toLowerCase().substring(0, 50);
15567
+ return httpStatusMatch?.[1] ? normalized = `http-${httpStatusMatch[1]}-${normalized.replace(/\b\d{3}\b/g, "").trim()}` : graphqlCodeMatch?.[1] ? normalized = `http-${graphqlCodeMatch[1]}-${normalized.replace(/(?:code|error)[:\s]*\d{3}/gi, "").trim()}` : connectionErrorMatch?.[1] ? normalized = `http-000-${connectionErrorMatch[1].toLowerCase()}-${normalized.replace(/\b[eE][A-Z]+\b/g, "").trim()}` : normalized = `http-000-${normalized}`, normalized.replace(/[^a-zA-Z0-9-]/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "").substring(0, 50);
15568
+ }
15569
+ function formatGenericError(message) {
15570
+ return message.toLowerCase().substring(0, 50).replace(/[^a-zA-Z0-9]/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
15571
+ }
15572
+
15573
+ // ../cli-kit/dist/private/node/analytics/bounded-collections.js
15574
+ init_cjs_shims();
15575
+ var BArray = class extends Array {
15576
+ push(...items) {
15577
+ let result = super.push(...items);
15578
+ return this.enforceLimit(), result;
15579
+ }
15580
+ clear() {
15581
+ this.length = 0;
15582
+ }
15583
+ toArray() {
15584
+ return [...this];
15585
+ }
15586
+ enforceLimit() {
15587
+ for (; this.length > 1e3; )
15588
+ this.shift();
15589
+ }
15590
+ }, BMap = class extends Map {
15591
+ constructor() {
15592
+ super(...arguments), this.insertionOrder = [];
15593
+ }
15594
+ set(key, value) {
15595
+ return this.has(key) || this.insertionOrder.push(key), super.set(key, value), this.enforceLimit(), this;
15596
+ }
15597
+ delete(key) {
15598
+ let index = this.insertionOrder.indexOf(key);
15599
+ return index > -1 && this.insertionOrder.splice(index, 1), super.delete(key);
15600
+ }
15601
+ clear() {
15602
+ this.insertionOrder = [], super.clear();
15603
+ }
15604
+ toObject() {
15605
+ return Object.fromEntries(this);
15606
+ }
15607
+ enforceLimit() {
15608
+ for (; this.size > 1e3 && this.insertionOrder.length > 0; ) {
15609
+ let oldestKey = this.insertionOrder.shift();
15610
+ oldestKey !== void 0 && super.delete(oldestKey);
15611
+ }
15612
+ }
15613
+ };
15614
+
15615
+ // ../cli-kit/dist/private/node/analytics/storage.js
15616
+ var _runtimeAnalyticsStore = {
15617
+ timings: new BArray(),
15618
+ activeTimings: new BMap(),
15619
+ errors: new BArray(),
15620
+ retries: new BArray(),
15621
+ events: new BArray()
15622
+ };
15623
+ function recordTiming(eventName) {
15624
+ let now = Date.now();
15625
+ if (!_runtimeAnalyticsStore.activeTimings.has(eventName)) {
15626
+ _runtimeAnalyticsStore.activeTimings.set(eventName, now), recordEvent(`timing:start:${eventName}`);
15627
+ return;
15628
+ }
15629
+ let startTime = _runtimeAnalyticsStore.activeTimings.get(eventName);
15630
+ if (startTime === void 0)
15631
+ return;
15632
+ let duration = now - startTime;
15633
+ _runtimeAnalyticsStore.timings.push({
15634
+ event: eventName,
15635
+ duration
15636
+ }), _runtimeAnalyticsStore.activeTimings.delete(eventName), recordEvent(`timing:end:${eventName}`);
15637
+ }
15638
+ function recordError(error) {
15639
+ let category = categorizeError(error), errorEntry = {
15640
+ category,
15641
+ message: (error instanceof Error ? error.message : String(error)).substring(0, 200),
15642
+ timestamp: Date.now()
15643
+ };
15644
+ if (errorEntry.category === ErrorCategory.Unknown && !errorEntry.message)
15645
+ return;
15646
+ _runtimeAnalyticsStore.errors.push(errorEntry);
15647
+ let normalizedErrorCategory = category.toLowerCase(), normalizedErrorMessage = formatErrorMessage(error, category);
15648
+ recordEvent(`error:${normalizedErrorCategory}:${normalizedErrorMessage}`);
15649
+ }
15650
+ function recordEvent(eventName) {
15651
+ _runtimeAnalyticsStore.events.push({
15652
+ name: eventName,
15653
+ timestamp: Date.now()
15654
+ });
15655
+ }
15656
+ function compileData() {
15657
+ return {
15658
+ timings: _runtimeAnalyticsStore.timings.toArray(),
15659
+ errors: _runtimeAnalyticsStore.errors.toArray(),
15660
+ retries: _runtimeAnalyticsStore.retries.toArray(),
15661
+ events: _runtimeAnalyticsStore.events.toArray()
15662
+ };
15663
+ }
15664
+
15506
15665
  // ../cli-kit/dist/private/node/otel-metrics.js
15507
15666
  init_cjs_shims();
15508
15667
 
@@ -15768,7 +15927,7 @@ function defaultOtelOptions() {
15768
15927
  }
15769
15928
  function createMetricRecorder(options) {
15770
15929
  let recorder = "console";
15771
- return options.skipMetricAnalytics || isUnitTest() || isSpinEnvironment() || (recorder = {
15930
+ return options.skipMetricAnalytics || isUnitTest() || (recorder = {
15772
15931
  type: "otel",
15773
15932
  otel: globalOtelService(options)
15774
15933
  }), recorder;
@@ -15798,36 +15957,6 @@ function recordCommandTiming(recorder, labels, timing) {
15798
15957
  timing.active > 0 && (recorder.otel.record(Name.Duration, timing.active, labels), recorder.otel.record(Name.Elapsed, timing.active, { ...labels, stage: "active" })), timing.network > 0 && recorder.otel.record(Name.Elapsed, timing.network, { ...labels, stage: "network" }), timing.prompt > 0 && recorder.otel.record(Name.Elapsed, timing.prompt, { ...labels, stage: "prompt" });
15799
15958
  }
15800
15959
 
15801
- // ../cli-kit/dist/private/node/request-ids.js
15802
- init_cjs_shims();
15803
- var RequestIDCollection = class _RequestIDCollection {
15804
- constructor() {
15805
- this.requestIds = [];
15806
- }
15807
- static getInstance() {
15808
- return _RequestIDCollection.instance || (_RequestIDCollection.instance = new _RequestIDCollection()), _RequestIDCollection.instance;
15809
- }
15810
- /**
15811
- * Add a request ID to the collection
15812
- * We only report the first MAX_REQUEST_IDS request IDs.
15813
- */
15814
- addRequestId(requestId) {
15815
- requestId && this.requestIds.length < 100 && this.requestIds.push(requestId);
15816
- }
15817
- /**
15818
- * Get all collected request IDs
15819
- */
15820
- getRequestIds() {
15821
- return this.requestIds;
15822
- }
15823
- /**
15824
- * Clear all stored request IDs
15825
- */
15826
- clear() {
15827
- this.requestIds = [];
15828
- }
15829
- }, requestIdsCollection = RequestIDCollection.getInstance();
15830
-
15831
15960
  // ../cli-kit/dist/public/node/analytics.js
15832
15961
  async function reportAnalyticsEvent(options) {
15833
15962
  try {
@@ -15924,11 +16053,26 @@ function sanitizePayload2(payload) {
15924
16053
  let sanitizedPayloadString = JSON.stringify(payload).replace(/shptka_\w*/g, "*****");
15925
16054
  return JSON.parse(sanitizedPayloadString);
15926
16055
  }
16056
+ function recordTiming2(eventName) {
16057
+ recordTiming(eventName);
16058
+ }
16059
+ function recordError2(error) {
16060
+ return recordError(error), error;
16061
+ }
16062
+ function recordEvent2(eventName) {
16063
+ recordEvent(eventName);
16064
+ }
16065
+ function compileData2() {
16066
+ return compileData();
16067
+ }
15927
16068
 
15928
16069
  export {
15929
16070
  fanoutHooks,
15930
16071
  getListOfTunnelPlugins,
15931
- requestIdsCollection,
15932
- reportAnalyticsEvent
16072
+ reportAnalyticsEvent,
16073
+ recordTiming2 as recordTiming,
16074
+ recordError2 as recordError,
16075
+ recordEvent2 as recordEvent,
16076
+ compileData2 as compileData
15933
16077
  };
15934
- //# sourceMappingURL=chunk-K5XXB73S.js.map
16078
+ //# sourceMappingURL=chunk-K2VBTQSL.js.map