@shopify/cli 3.84.2 → 3.85.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) 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-OCEWRJZI.js → chunk-62H2KYOJ.js} +17 -21
  5. package/dist/{chunk-6A27UWO7.js → chunk-6YB46YWH.js} +4 -4
  6. package/dist/{chunk-L5OKA4W4.js → chunk-7JE3EHN3.js} +7 -7
  7. package/dist/chunk-7LEPNDDJ.js +87 -0
  8. package/dist/{chunk-MXDBI4PG.js → chunk-7N5JGLLX.js} +5 -5
  9. package/dist/{chunk-HMDWNGIV.js → chunk-AM4QB5OM.js} +206 -100
  10. package/dist/{chunk-W5G2YPO2.js → chunk-BQ3PZIHZ.js} +7 -7
  11. package/dist/{chunk-TFVMB62A.js → chunk-CKYPRLQQ.js} +19 -18
  12. package/dist/{chunk-AQVXNWM2.js → chunk-CNY4KRKG.js} +2 -2
  13. package/dist/{del-SAZHGAZZ.js → chunk-EFOOQV72.js} +17 -378
  14. package/dist/{chunk-3FBDJEGD.js → chunk-F7F4BQYW.js} +1824 -762
  15. package/dist/{chunk-66VZYBID.js → chunk-F7J5CUMZ.js} +4 -4
  16. package/dist/{chunk-2TBGVDDK.js → chunk-FLHWGFGH.js} +3 -3
  17. package/dist/{chunk-JHLYV5K7.js → chunk-G6OERDCU.js} +7 -7
  18. package/dist/{chunk-6JFZSZKE.js → chunk-GGNBWCCE.js} +16380 -5793
  19. package/dist/chunk-IWFYXDPH.js +109 -0
  20. package/dist/{chunk-7UHRC35E.js → chunk-J3DHMVKN.js} +2 -2
  21. package/dist/{chunk-Z6MEYGAG.js → chunk-JDI5KJ6D.js} +3 -3
  22. package/dist/chunk-KIC7OBUL.js +4654 -0
  23. package/dist/{chunk-YUI23PKV.js → chunk-KJT4XRJY.js} +2 -2
  24. package/dist/{chunk-46YOOMEM.js → chunk-LOJKECKW.js} +2 -2
  25. package/dist/{chunk-TAA5HGRT.js → chunk-MHFD5A4P.js} +666 -589
  26. package/dist/{chunk-QS5WPZTS.js → chunk-O47I6ERR.js} +10 -9
  27. package/dist/{chunk-KHBZ52PT.js → chunk-OXCV2R7K.js} +43 -19
  28. package/dist/{chunk-XD5EFQE2.js → chunk-OXVB7GS3.js} +5 -5
  29. package/dist/{chunk-UOLT7THS.js → chunk-PYZUPEOA.js} +3 -3
  30. package/dist/{chunk-G74IQQ6M.js → chunk-Q64LTCDT.js} +3 -3
  31. package/dist/{chunk-DCU33ZNP.js → chunk-R7QUG5YH.js} +3 -3
  32. package/dist/{chunk-YPRC4TK6.js → chunk-S3MBABAK.js} +187 -43
  33. package/dist/{chunk-ZRU5CKDG.js → chunk-TRKSH2XY.js} +4 -4
  34. package/dist/{chunk-BSKQ4RKV.js → chunk-TVWMGUCW.js} +3 -3
  35. package/dist/{chunk-G5R6YD27.js → chunk-UATXMR5F.js} +2 -103
  36. package/dist/{chunk-DZCCH5OM.js → chunk-UYWDOH6Y.js} +8 -8
  37. package/dist/{chunk-BX2C6EVM.js → chunk-VCGC2OW6.js} +2 -2
  38. package/dist/{chunk-YNNUWX3I.js → chunk-VMPHJR5V.js} +4 -4
  39. package/dist/{chunk-7YVG6N4O.js → chunk-W54BTT4L.js} +2 -2
  40. package/dist/{chunk-RTTTZZGY.js → chunk-XKHE52EY.js} +4 -4
  41. package/dist/{chunk-MRQXBTNU.js → chunk-XNKJ52IR.js} +3 -3
  42. package/dist/{chunk-EG6MBBEN.js → chunk-Y2JP6WFP.js} +2 -2
  43. package/dist/{chunk-M6EH6UKK.js → chunk-YIQ4GHA2.js} +4 -4
  44. package/dist/{chunk-ZBPY6YL5.js → chunk-YJZEHV2H.js} +8 -8
  45. package/dist/{chunk-T2Z26YN7.js → chunk-ZZACM6JY.js} +3 -3
  46. package/dist/cli/commands/auth/login.d.ts +8 -0
  47. package/dist/cli/commands/auth/login.js +28 -0
  48. package/dist/cli/commands/auth/login.test.js +53 -0
  49. package/dist/cli/commands/auth/logout.js +15 -17
  50. package/dist/cli/commands/auth/logout.test.js +20 -22
  51. package/dist/cli/commands/cache/clear.js +15 -16
  52. package/dist/cli/commands/debug/command-flags.js +15 -16
  53. package/dist/cli/commands/docs/generate.js +15 -16
  54. package/dist/cli/commands/docs/generate.test.js +21 -22
  55. package/dist/cli/commands/help.js +15 -16
  56. package/dist/cli/commands/kitchen-sink/async.js +16 -17
  57. package/dist/cli/commands/kitchen-sink/async.test.js +17 -18
  58. package/dist/cli/commands/kitchen-sink/index.js +18 -19
  59. package/dist/cli/commands/kitchen-sink/index.test.js +21 -22
  60. package/dist/cli/commands/kitchen-sink/prompts.js +16 -17
  61. package/dist/cli/commands/kitchen-sink/prompts.test.js +17 -18
  62. package/dist/cli/commands/kitchen-sink/static.js +16 -17
  63. package/dist/cli/commands/kitchen-sink/static.test.js +17 -18
  64. package/dist/cli/commands/notifications/generate.js +16 -17
  65. package/dist/cli/commands/notifications/list.js +16 -17
  66. package/dist/cli/commands/search.js +16 -17
  67. package/dist/cli/commands/upgrade.js +16 -17
  68. package/dist/cli/commands/upgrade.test.js +1 -1
  69. package/dist/cli/commands/version.js +16 -17
  70. package/dist/cli/commands/version.test.js +17 -18
  71. package/dist/cli/services/commands/notifications.js +11 -12
  72. package/dist/cli/services/commands/search.js +7 -8
  73. package/dist/cli/services/commands/search.test.js +8 -9
  74. package/dist/cli/services/commands/version.js +8 -9
  75. package/dist/cli/services/commands/version.test.js +10 -11
  76. package/dist/cli/services/kitchen-sink/async.js +7 -8
  77. package/dist/cli/services/kitchen-sink/prompts.js +7 -8
  78. package/dist/cli/services/kitchen-sink/static.js +7 -8
  79. package/dist/cli/services/upgrade.js +8 -9
  80. package/dist/cli/services/upgrade.test.js +13 -14
  81. package/dist/configs/all.yml +3 -3
  82. package/dist/configs/recommended.yml +3 -3
  83. package/dist/{custom-oclif-loader-BBMEEF2H.js → custom-oclif-loader-MVTJFCUD.js} +11 -12
  84. package/dist/data/latest.json +1 -1
  85. package/dist/data/objects.json +2 -2
  86. package/dist/data/shopify_system_translations.json +82 -24
  87. package/dist/data/tags.json +10 -10
  88. package/dist/del-DNZ7X2HW.js +377 -0
  89. package/dist/{error-handler-734CUCMD.js → error-handler-OEZ5DBZB.js} +13 -14
  90. package/dist/hooks/postrun.js +13 -15
  91. package/dist/hooks/prerun.js +14 -15
  92. package/dist/index.d.ts +1 -1
  93. package/dist/index.js +7792 -5700
  94. package/dist/{lib-OSXFX3I2.js → lib-DEEC6IKU.js} +3 -4
  95. package/dist/{local-5AKZWHSS.js → local-72XWEFWL.js} +7 -8
  96. package/dist/{morph-TYIH255V.js → morph-5D7H6MU2.js} +13 -11
  97. package/dist/{node-package-manager-DMOU4DTB.js → node-package-manager-TTBSTZXN.js} +8 -9
  98. package/dist/{npa-E675GQOI.js → npa-LHT53SWR.js} +3 -5
  99. package/dist/{path-GB4VIEM6.js → path-COZT77T2.js} +2 -2
  100. package/dist/tsconfig.tsbuildinfo +1 -1
  101. package/dist/{ui-JQXGLHMO.js → ui-XUA267UA.js} +9 -8
  102. package/dist/{workerd-FTKMK3NR.js → workerd-KJQYQH4A.js} +23 -23
  103. package/oclif.manifest.json +79 -9
  104. package/package.json +10 -10
  105. package/dist/chunk-CP3BRHWK.js +0 -33
  106. package/dist/chunk-EZQWZ57B.js +0 -53
  107. package/dist/chunk-SJMHVGQ5.js +0 -119
  108. package/dist/chunk-SM7O6ZFJ.js +0 -1216
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  errorHandler,
3
3
  registerCleanBugsnagErrorsFromWithinPlugins
4
- } from "./chunk-TFVMB62A.js";
4
+ } from "./chunk-CKYPRLQQ.js";
5
5
  import {
6
6
  setCurrentCommandId,
7
7
  showNotificationsIfNeeded
8
- } from "./chunk-ZBPY6YL5.js";
8
+ } from "./chunk-YJZEHV2H.js";
9
9
  import {
10
10
  hashString
11
- } from "./chunk-OCEWRJZI.js";
11
+ } from "./chunk-62H2KYOJ.js";
12
12
  import {
13
13
  AbortError,
14
14
  addPublicMetadata,
@@ -24,13 +24,13 @@ import {
24
24
  renderWarning,
25
25
  terminalSupportsPrompting,
26
26
  underscore
27
- } from "./chunk-TAA5HGRT.js";
28
- import {
29
- cwd
30
- } from "./chunk-EG6MBBEN.js";
27
+ } from "./chunk-MHFD5A4P.js";
31
28
  import {
32
29
  require_lib
33
- } from "./chunk-3FBDJEGD.js";
30
+ } from "./chunk-F7F4BQYW.js";
31
+ import {
32
+ cwd
33
+ } from "./chunk-Y2JP6WFP.js";
34
34
  import {
35
35
  __commonJS,
36
36
  __require,
@@ -1689,6 +1689,7 @@ export {
1689
1689
  decodeToml,
1690
1690
  encodeToml,
1691
1691
  loadEnvironment,
1692
+ noDefaultsOptions,
1692
1693
  base_command_default
1693
1694
  };
1694
- //# sourceMappingURL=chunk-QS5WPZTS.js.map
1695
+ //# sourceMappingURL=chunk-O47I6ERR.js.map
@@ -18,14 +18,14 @@ import {
18
18
  require_get_stream,
19
19
  runWithTimer,
20
20
  writeFile
21
- } from "./chunk-TAA5HGRT.js";
21
+ } from "./chunk-MHFD5A4P.js";
22
+ import {
23
+ require_semver
24
+ } from "./chunk-F7F4BQYW.js";
22
25
  import {
23
26
  dirname,
24
27
  joinPath
25
- } from "./chunk-EG6MBBEN.js";
26
- import {
27
- require_semver
28
- } from "./chunk-HMDWNGIV.js";
28
+ } from "./chunk-Y2JP6WFP.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()), 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(), 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 = {
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-KHBZ52PT.js.map
13975
+ //# sourceMappingURL=chunk-OXCV2R7K.js.map
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  list
3
- } from "./chunk-MXDBI4PG.js";
3
+ } from "./chunk-7N5JGLLX.js";
4
4
  import {
5
5
  base_command_default
6
- } from "./chunk-QS5WPZTS.js";
6
+ } from "./chunk-O47I6ERR.js";
7
7
  import {
8
8
  sendErrorToBugsnag
9
- } from "./chunk-TFVMB62A.js";
9
+ } from "./chunk-CKYPRLQQ.js";
10
10
  import {
11
11
  require_lib
12
- } from "./chunk-3FBDJEGD.js";
12
+ } from "./chunk-F7F4BQYW.js";
13
13
  import {
14
14
  __toESM,
15
15
  init_cjs_shims
@@ -49,4 +49,4 @@ var List = class _List extends base_command_default {
49
49
  export {
50
50
  List
51
51
  };
52
- //# sourceMappingURL=chunk-XD5EFQE2.js.map
52
+ //# sourceMappingURL=chunk-OXVB7GS3.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  versionService
3
- } from "./chunk-T2Z26YN7.js";
3
+ } from "./chunk-ZZACM6JY.js";
4
4
  import {
5
5
  base_command_default
6
- } from "./chunk-QS5WPZTS.js";
6
+ } from "./chunk-O47I6ERR.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-UOLT7THS.js.map
25
+ //# sourceMappingURL=chunk-PYZUPEOA.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  staticService
3
- } from "./chunk-BX2C6EVM.js";
3
+ } from "./chunk-VCGC2OW6.js";
4
4
  import {
5
5
  base_command_default
6
- } from "./chunk-QS5WPZTS.js";
6
+ } from "./chunk-O47I6ERR.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-G74IQQ6M.js.map
28
+ //# sourceMappingURL=chunk-Q64LTCDT.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  base_command_default
3
- } from "./chunk-QS5WPZTS.js";
3
+ } from "./chunk-O47I6ERR.js";
4
4
  import {
5
5
  require_lib
6
- } from "./chunk-3FBDJEGD.js";
6
+ } from "./chunk-F7F4BQYW.js";
7
7
  import {
8
8
  __toESM,
9
9
  init_cjs_shims
@@ -46,4 +46,4 @@ var HelpCommand = class _HelpCommand extends base_command_default {
46
46
  export {
47
47
  HelpCommand
48
48
  };
49
- //# sourceMappingURL=chunk-DCU33ZNP.js.map
49
+ //# sourceMappingURL=chunk-R7QUG5YH.js.map
@@ -1,17 +1,18 @@
1
1
  import {
2
2
  getEnvironmentData,
3
3
  getLastSeenUserIdAfterAuth,
4
- getSensitiveEnvironmentData
5
- } from "./chunk-SM7O6ZFJ.js";
4
+ getSensitiveEnvironmentData,
5
+ requestIdsCollection
6
+ } from "./chunk-KIC7OBUL.js";
6
7
  import {
7
8
  fetch
8
- } from "./chunk-OCEWRJZI.js";
9
- import {
10
- CLI_KIT_VERSION
11
- } from "./chunk-YUI23PKV.js";
9
+ } from "./chunk-62H2KYOJ.js";
12
10
  import {
13
11
  runWithRateLimit
14
- } from "./chunk-KHBZ52PT.js";
12
+ } from "./chunk-OXCV2R7K.js";
13
+ import {
14
+ CLI_KIT_VERSION
15
+ } from "./chunk-KJT4XRJY.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-TAA5HGRT.js";
31
+ } from "./chunk-MHFD5A4P.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-YPRC4TK6.js.map
16078
+ //# sourceMappingURL=chunk-S3MBABAK.js.map
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  base_command_default
3
- } from "./chunk-QS5WPZTS.js";
3
+ } from "./chunk-O47I6ERR.js";
4
4
  import {
5
5
  outputResult,
6
6
  renderTable
7
- } from "./chunk-TAA5HGRT.js";
7
+ } from "./chunk-MHFD5A4P.js";
8
8
  import {
9
9
  require_lib
10
- } from "./chunk-3FBDJEGD.js";
10
+ } from "./chunk-F7F4BQYW.js";
11
11
  import {
12
12
  __toESM,
13
13
  init_cjs_shims
@@ -84,4 +84,4 @@ var import_core = __toESM(require_lib(), 1), CommandFlags = class _CommandFlags
84
84
  export {
85
85
  CommandFlags
86
86
  };
87
- //# sourceMappingURL=chunk-ZRU5CKDG.js.map
87
+ //# sourceMappingURL=chunk-TRKSH2XY.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  generate
3
- } from "./chunk-MXDBI4PG.js";
3
+ } from "./chunk-7N5JGLLX.js";
4
4
  import {
5
5
  base_command_default
6
- } from "./chunk-QS5WPZTS.js";
6
+ } from "./chunk-O47I6ERR.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-BSKQ4RKV.js.map
28
+ //# sourceMappingURL=chunk-TVWMGUCW.js.map