@shopify/create-app 4.9.5 → 5.0.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 (63) hide show
  1. package/dist/{analytics-GMXMHUFA.js → analytics-NVXLO3J4.js} +19 -18
  2. package/dist/analytics-WSNO62UE.js +41 -0
  3. package/dist/{chunk-KREC6ICN.js → chunk-3S4LYDKB.js} +7 -7
  4. package/dist/{chunk-EODB55BY.js → chunk-77MCGVDL.js} +2 -2
  5. package/dist/{chunk-C3P3BBJI.js → chunk-C7SNAAK3.js} +3 -2
  6. package/dist/{chunk-P3CA5HR4.js → chunk-CXCQOKSC.js} +5 -5
  7. package/dist/{chunk-VKT2I3WB.js → chunk-D7A5DYKK.js} +10 -4
  8. package/dist/{chunk-CTYX7C3B.js → chunk-DIOGWWS3.js} +2 -2
  9. package/dist/{json-error-GH4NANA7.js → chunk-DIYGDUU2.js} +9 -39
  10. package/dist/{chunk-XIWLFYMS.js → chunk-DKAJC4S3.js} +103 -1406
  11. package/dist/{chunk-A33KVF5C.js → chunk-E4XG6SVI.js} +1 -1
  12. package/dist/{chunk-MCVF3JKC.js → chunk-F5VM2BG4.js} +199 -76
  13. package/dist/chunk-GLO2DI4E.js +3036 -0
  14. package/dist/{chunk-ATC7DBGE.js → chunk-J53FSF5Q.js} +3 -3
  15. package/dist/{chunk-YNPEWPVK.js → chunk-J6OB5R2E.js} +2 -2
  16. package/dist/{chunk-57VCTLOQ.js → chunk-JZFZ3JYG.js} +7 -2
  17. package/dist/{chunk-M3RDXLNX.js → chunk-L6U3W2XC.js} +8 -9
  18. package/dist/{chunk-T6GCTKLT.js → chunk-LQDG3VBX.js} +15 -12
  19. package/dist/{chunk-VNFX6QUY.js → chunk-MRUYZVYJ.js} +5 -3
  20. package/dist/{chunk-4ZMLBA4T.js → chunk-S3XZMGTD.js} +13 -13
  21. package/dist/{chunk-44QGQFKE.js → chunk-TES7JZAA.js} +13 -11
  22. package/dist/chunk-UJ5OJF5L.js +47 -0
  23. package/dist/{chunk-DXHBESFY.js → chunk-VHVI7YNQ.js} +43 -4
  24. package/dist/{chunk-37C3NPH2.js → chunk-VKOB4EDC.js} +17 -3040
  25. package/dist/{chunk-2BEA3V4R.js → chunk-XP6ZAZM3.js} +7 -7
  26. package/dist/{chunk-2YTKLSUT.js → chunk-YCTA633Q.js} +16 -16
  27. package/dist/{chunk-EJEHENXO.js → chunk-YYP4UTTA.js} +1 -2
  28. package/dist/{chunk-HSSZIAZA.js → chunk-ZNGF52JY.js} +2 -2
  29. package/dist/command-event-context-I6WEUQYW.js +12 -0
  30. package/dist/{command-json-schema-I7V7TBDJ.js → command-json-schema-NFKBCUYJ.js} +15 -12
  31. package/dist/{conf-store-B2TSLLPW.js → conf-store-F5RVQXAB.js} +9 -8
  32. package/dist/{custom-oclif-loader-AY2YB6FA.js → custom-oclif-loader-JCV5BKJY.js} +10 -9
  33. package/dist/{deprecations-Z2FZ3CU4.js → deprecations-D6NF6OMP.js} +15 -14
  34. package/dist/{environment-5XBFWY2A.js → environment-3MKMYTQQ.js} +4 -4
  35. package/dist/environments-RFS64LOU.js +33 -0
  36. package/dist/{error-handler-CKAKQAM5.js → error-handler-JY4HXOW5.js} +19 -18
  37. package/dist/{fs-FWPTU7RX.js → fs-7KG7OY2Z.js} +7 -6
  38. package/dist/hooks/postrun.js +8 -7
  39. package/dist/hooks/prerun.js +6 -6
  40. package/dist/index.js +11717 -8171
  41. package/dist/{is-global-BKUXICTV.js → is-global-3E5IDVMO.js} +7 -6
  42. package/dist/json-error-NQH2L57S.js +48 -0
  43. package/dist/{lib-NYDMHWZM.js → lib-7M7VJIRB.js} +2 -2
  44. package/dist/{local-7ND7KIQU.js → local-ZKE22RLD.js} +5 -5
  45. package/dist/{metadata-DBZ2VQTX.js → metadata-EACJ44OR.js} +6 -6
  46. package/dist/{node-package-manager-ULP534WO.js → node-package-manager-NFYSJBUI.js} +17 -16
  47. package/dist/{notifications-system-QWLT2Y2Y.js → notifications-system-ZDDGD7AS.js} +20 -19
  48. package/dist/{os-ZBSIDHYK.js → os-VAWLBHBF.js} +8 -7
  49. package/dist/{output-5W5HBNZ7.js → output-MFN7MN4X.js} +7 -6
  50. package/dist/{path-RDYZ7Q5T.js → path-NBWFOGJ4.js} +2 -2
  51. package/dist/{prettier-BNZDRHR4.js → prettier-XM547TFN.js} +2 -2
  52. package/dist/{system-J3NNUCJW.js → system-SDCJN2UD.js} +15 -14
  53. package/dist/tsconfig.tsbuildinfo +1 -1
  54. package/dist/{ui-GGOBMVAN.js → ui-HZTN2YF4.js} +15 -14
  55. package/dist/upgrade-NSRTWSK6.js +295 -0
  56. package/dist/version-5LTDAJ3Z.js +37 -0
  57. package/dist/{version-6ZJE3O3B.js → version-XXTHXVKK.js} +2 -2
  58. package/oclif.manifest.json +11 -1
  59. package/package.json +3 -3
  60. package/dist/analytics-OBJJS2OD.js +0 -40
  61. package/dist/environments-LGI6IAQU.js +0 -32
  62. package/dist/upgrade-FKF5EE3S.js +0 -218
  63. package/dist/version-ARSWC6AU.js +0 -36
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isUnitTest
3
- } from "./chunk-P3CA5HR4.js";
3
+ } from "./chunk-CXCQOKSC.js";
4
4
  import {
5
5
  init_cjs_shims
6
6
  } from "./chunk-3XNI6LP4.js";
@@ -32,7 +32,7 @@ function createRuntimeMetadataContainer(defaultPublicMetadata = {}) {
32
32
  try {
33
33
  await getAndSet();
34
34
  } catch (error) {
35
- let { sendErrorToBugsnag } = await import("./error-handler-CKAKQAM5.js");
35
+ let { sendErrorToBugsnag } = await import("./error-handler-JY4HXOW5.js");
36
36
  await sendErrorToBugsnag(error, "unexpected_error");
37
37
  }
38
38
  }, durationStack = [];
@@ -75,4 +75,4 @@ export {
75
75
  addSensitiveMetadata,
76
76
  runWithTimer
77
77
  };
78
- //# sourceMappingURL=chunk-ATC7DBGE.js.map
78
+ //# sourceMappingURL=chunk-J53FSF5Q.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  captureOutput,
3
3
  require_lib
4
- } from "./chunk-XIWLFYMS.js";
4
+ } from "./chunk-DKAJC4S3.js";
5
5
  import {
6
6
  require_semver
7
7
  } from "./chunk-OQ3KXXGH.js";
@@ -52,4 +52,4 @@ export {
52
52
  isPreReleaseVersion,
53
53
  isMajorVersionChange
54
54
  };
55
- //# sourceMappingURL=chunk-YNPEWPVK.js.map
55
+ //# sourceMappingURL=chunk-J6OB5R2E.js.map
@@ -108,6 +108,7 @@ var basename = function(p, extension) {
108
108
 
109
109
  // ../cli-kit/dist/public/node/path.js
110
110
  import { fileURLToPath } from "url";
111
+ import { relative as nativeRelative, isAbsolute as nativeIsAbsolute, sep as nativeSeparator } from "node:path";
111
112
  function joinPath(...paths) {
112
113
  return join(...paths);
113
114
  }
@@ -145,7 +146,11 @@ function relativizePath(path2, dir = cwd2()) {
145
146
  let result = commonParentDirectory(path2, dir), relativePath2 = relative(dir, path2), relativeComponents = relativePath2.split("/").filter((component) => component === "..").length;
146
147
  return result === "/" || relativePath2 === "" || relativeComponents > 2 ? path2 : relativePath2;
147
148
  }
148
- function isSubpath(mainPath, subpath) {
149
+ function isSubpath(mainPath, subpath, options = { native: !1 }) {
150
+ if (options.native) {
151
+ let relativePath3 = nativeRelative(mainPath, subpath);
152
+ return relativePath3 !== ".." && !relativePath3.startsWith(`..${nativeSeparator}`) && !nativeIsAbsolute(relativePath3);
153
+ }
149
154
  let relativePath2 = relative(mainPath, subpath);
150
155
  return !relativePath2.startsWith("..") && !isAbsolutePath(relativePath2);
151
156
  }
@@ -197,4 +202,4 @@ export {
197
202
  sniffForJson,
198
203
  sanitizeRelativePath
199
204
  };
200
- //# sourceMappingURL=chunk-57VCTLOQ.js.map
205
+ //# sourceMappingURL=chunk-JZFZ3JYG.js.map
@@ -3,13 +3,13 @@ import {
3
3
  flushStdout,
4
4
  stringifyMessage,
5
5
  tokenItemToString
6
- } from "./chunk-37C3NPH2.js";
6
+ } from "./chunk-VKOB4EDC.js";
7
7
  import {
8
8
  require_lib
9
- } from "./chunk-EJEHENXO.js";
9
+ } from "./chunk-YYP4UTTA.js";
10
10
  import {
11
11
  normalizePath
12
- } from "./chunk-57VCTLOQ.js";
12
+ } from "./chunk-JZFZ3JYG.js";
13
13
  import {
14
14
  __toESM,
15
15
  init_cjs_shims
@@ -114,12 +114,12 @@ async function handler(error) {
114
114
  let maybeError = error;
115
115
  fatal = new BugError(maybeError?.message ?? "Unknown error"), maybeError?.stack && (fatal.stack = maybeError?.stack);
116
116
  }
117
- let { jsonOutputEnabled } = await import("./environment-5XBFWY2A.js");
118
- if (jsonOutputEnabled()) {
119
- let { renderFatalErrorAsJson } = await import("./json-error-GH4NANA7.js");
117
+ let { jsonOutputEnabled } = await import("./environment-3MKMYTQQ.js"), { commandEventOutputMode } = await import("./command-event-context-I6WEUQYW.js");
118
+ if (jsonOutputEnabled() || commandEventOutputMode() === "json") {
119
+ let { renderFatalErrorAsJson } = await import("./json-error-NQH2L57S.js");
120
120
  return renderFatalErrorAsJson(fatal), await flushStdout(), error;
121
121
  }
122
- let { renderFatalError } = await import("./ui-GGOBMVAN.js");
122
+ let { renderFatalError } = await import("./ui-HZTN2YF4.js");
123
123
  return renderFatalError(fatal), Promise.resolve(error);
124
124
  }
125
125
  function errorMapper(error) {
@@ -184,7 +184,6 @@ export {
184
184
  graphQLErrorCodes,
185
185
  isRateLimitCode,
186
186
  isPermissionCode,
187
- hasRateLimitCode,
188
187
  isGatewayErrorStatus,
189
188
  FatalErrorType,
190
189
  CancelExecution,
@@ -198,4 +197,4 @@ export {
198
197
  shouldReportErrorAsUnexpected,
199
198
  cleanSingleStackTracePath
200
199
  };
201
- //# sourceMappingURL=chunk-M3RDXLNX.js.map
200
+ //# sourceMappingURL=chunk-L6U3W2XC.js.map
@@ -1,26 +1,28 @@
1
1
  import {
2
2
  jsonOutputEnabled
3
- } from "./chunk-DXHBESFY.js";
3
+ } from "./chunk-VHVI7YNQ.js";
4
4
  import {
5
5
  defineJsonOutputSchema
6
- } from "./chunk-EODB55BY.js";
6
+ } from "./chunk-77MCGVDL.js";
7
7
  import {
8
8
  collectLog,
9
- commandDiagnosticEventSchema,
10
- commandEventOutputMode,
11
- commandEventSchema,
12
- commandProgressEventSchema,
13
9
  consoleWarn,
14
10
  output,
15
11
  outputDebug,
16
12
  outputInfo,
17
13
  outputWarn,
18
- outputWhereAppropriate,
19
- runWithCommandEvents
20
- } from "./chunk-37C3NPH2.js";
14
+ outputWhereAppropriate
15
+ } from "./chunk-VKOB4EDC.js";
21
16
  import {
22
17
  isUnitTest
23
- } from "./chunk-P3CA5HR4.js";
18
+ } from "./chunk-CXCQOKSC.js";
19
+ import {
20
+ commandDiagnosticEventSchema,
21
+ commandEventOutputMode,
22
+ commandEventSchema,
23
+ commandProgressEventSchema,
24
+ runWithCommandEvents
25
+ } from "./chunk-GLO2DI4E.js";
24
26
  import {
25
27
  init_cjs_shims
26
28
  } from "./chunk-3XNI6LP4.js";
@@ -81,6 +83,7 @@ function renderCommandEventAsJson(event) {
81
83
 
82
84
  export {
83
85
  runWithCommandEventsForCommand,
84
- commandEventOutputSchema
86
+ commandEventOutputSchema,
87
+ renderCommandEventAsJson
85
88
  };
86
- //# sourceMappingURL=chunk-T6GCTKLT.js.map
89
+ //# sourceMappingURL=chunk-LQDG3VBX.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  defineJsonOutputSchema
3
- } from "./chunk-EODB55BY.js";
3
+ } from "./chunk-77MCGVDL.js";
4
4
  import {
5
5
  external_exports
6
- } from "./chunk-37C3NPH2.js";
6
+ } from "./chunk-GLO2DI4E.js";
7
7
  import {
8
8
  init_cjs_shims
9
9
  } from "./chunk-3XNI6LP4.js";
@@ -45,6 +45,8 @@ var JsonErrorCustomSectionSchema = external_exports.object({
45
45
  });
46
46
 
47
47
  export {
48
+ JsonAbortErrorSchema,
49
+ JsonErrorSchema,
48
50
  jsonErrorOutputSchema
49
51
  };
50
- //# sourceMappingURL=chunk-VNFX6QUY.js.map
52
+ //# sourceMappingURL=chunk-MRUYZVYJ.js.map
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  AbortError,
6
6
  BugError
7
- } from "./chunk-M3RDXLNX.js";
7
+ } from "./chunk-L6U3W2XC.js";
8
8
  import {
9
9
  fileExistsSync,
10
10
  fileHasWritePermissions,
@@ -12,21 +12,21 @@ import {
12
12
  outputContent,
13
13
  outputDebug,
14
14
  unixFileIsOwnedByCurrentUser
15
- } from "./chunk-37C3NPH2.js";
15
+ } from "./chunk-VKOB4EDC.js";
16
16
  import {
17
17
  isUnitTest
18
- } from "./chunk-P3CA5HR4.js";
18
+ } from "./chunk-CXCQOKSC.js";
19
19
  import {
20
20
  envPaths,
21
21
  environmentVariables
22
- } from "./chunk-C3P3BBJI.js";
22
+ } from "./chunk-C7SNAAK3.js";
23
23
  import {
24
24
  require_semver
25
25
  } from "./chunk-OQ3KXXGH.js";
26
26
  import {
27
27
  dirname,
28
28
  resolvePath
29
- } from "./chunk-57VCTLOQ.js";
29
+ } from "./chunk-JZFZ3JYG.js";
30
30
  import {
31
31
  __commonJS,
32
32
  __toESM,
@@ -5488,26 +5488,26 @@ init_cjs_shims();
5488
5488
  init_cjs_shims();
5489
5489
  import path from "node:path";
5490
5490
 
5491
- // ../../node_modules/.pnpm/when-exit@2.1.5/node_modules/when-exit/dist/node/index.js
5491
+ // ../../node_modules/.pnpm/when-exit@2.1.5_patch_hash=dd8a5ad3c180e5b767f6050ad69222568dd4f0111de3769c24841d0caa8f26f7/node_modules/when-exit/dist/node/index.js
5492
5492
  init_cjs_shims();
5493
5493
 
5494
- // ../../node_modules/.pnpm/when-exit@2.1.5/node_modules/when-exit/dist/node/interceptor.js
5494
+ // ../../node_modules/.pnpm/when-exit@2.1.5_patch_hash=dd8a5ad3c180e5b767f6050ad69222568dd4f0111de3769c24841d0caa8f26f7/node_modules/when-exit/dist/node/interceptor.js
5495
5495
  init_cjs_shims();
5496
5496
  import process5 from "node:process";
5497
5497
 
5498
- // ../../node_modules/.pnpm/when-exit@2.1.5/node_modules/when-exit/dist/node/constants.js
5498
+ // ../../node_modules/.pnpm/when-exit@2.1.5_patch_hash=dd8a5ad3c180e5b767f6050ad69222568dd4f0111de3769c24841d0caa8f26f7/node_modules/when-exit/dist/node/constants.js
5499
5499
  init_cjs_shims();
5500
5500
  import process4 from "node:process";
5501
5501
  var IS_LINUX = process4.platform === "linux", IS_WINDOWS = process4.platform === "win32";
5502
5502
 
5503
- // ../../node_modules/.pnpm/when-exit@2.1.5/node_modules/when-exit/dist/node/signals.js
5503
+ // ../../node_modules/.pnpm/when-exit@2.1.5_patch_hash=dd8a5ad3c180e5b767f6050ad69222568dd4f0111de3769c24841d0caa8f26f7/node_modules/when-exit/dist/node/signals.js
5504
5504
  init_cjs_shims();
5505
5505
  var Signals = ["SIGHUP", "SIGINT", "SIGTERM"];
5506
5506
  IS_WINDOWS || Signals.push("SIGALRM", "SIGABRT", "SIGVTALRM", "SIGXCPU", "SIGXFSZ", "SIGUSR2", "SIGTRAP", "SIGSYS", "SIGQUIT", "SIGIOT");
5507
5507
  IS_LINUX && Signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
5508
5508
  var signals_default = Signals;
5509
5509
 
5510
- // ../../node_modules/.pnpm/when-exit@2.1.5/node_modules/when-exit/dist/node/interceptor.js
5510
+ // ../../node_modules/.pnpm/when-exit@2.1.5_patch_hash=dd8a5ad3c180e5b767f6050ad69222568dd4f0111de3769c24841d0caa8f26f7/node_modules/when-exit/dist/node/interceptor.js
5511
5511
  var Interceptor = class {
5512
5512
  /* CONSTRUCTOR */
5513
5513
  constructor() {
@@ -5516,7 +5516,7 @@ var Interceptor = class {
5516
5516
  this.exited = !0;
5517
5517
  for (let callback of this.callbacks)
5518
5518
  callback();
5519
- signal && (IS_WINDOWS && signal !== "SIGINT" && signal !== "SIGTERM" && signal !== "SIGKILL" ? process5.kill(process5.pid, "SIGTERM") : process5.kill(process5.pid, signal));
5519
+ signal && process5.listenerCount(signal) === 0 && (IS_WINDOWS && signal !== "SIGINT" && signal !== "SIGTERM" && signal !== "SIGKILL" ? process5.kill(process5.pid, "SIGTERM") : process5.kill(process5.pid, signal));
5520
5520
  }
5521
5521
  }, this.hook = () => {
5522
5522
  process5.once("exit", () => this.exit());
@@ -5531,7 +5531,7 @@ var Interceptor = class {
5531
5531
  }
5532
5532
  }, interceptor_default = new Interceptor();
5533
5533
 
5534
- // ../../node_modules/.pnpm/when-exit@2.1.5/node_modules/when-exit/dist/node/index.js
5534
+ // ../../node_modules/.pnpm/when-exit@2.1.5_patch_hash=dd8a5ad3c180e5b767f6050ad69222568dd4f0111de3769c24841d0caa8f26f7/node_modules/when-exit/dist/node/index.js
5535
5535
  var whenExit = interceptor_default.register, node_default = whenExit;
5536
5536
 
5537
5537
  // ../../node_modules/.pnpm/atomically@2.1.1/node_modules/atomically/dist/utils/temp.js
@@ -6139,4 +6139,4 @@ export {
6139
6139
  getCachedPartnerAccountStatus,
6140
6140
  setCachedPartnerAccountStatus
6141
6141
  };
6142
- //# sourceMappingURL=chunk-4ZMLBA4T.js.map
6142
+ //# sourceMappingURL=chunk-S3XZMGTD.js.map
@@ -1,32 +1,34 @@
1
1
  import {
2
2
  fetch
3
- } from "./chunk-MCVF3JKC.js";
3
+ } from "./chunk-F5VM2BG4.js";
4
4
  import {
5
5
  versionSatisfies
6
- } from "./chunk-KREC6ICN.js";
6
+ } from "./chunk-3S4LYDKB.js";
7
7
  import {
8
8
  CLI_KIT_VERSION
9
- } from "./chunk-HSSZIAZA.js";
9
+ } from "./chunk-ZNGF52JY.js";
10
10
  import {
11
11
  cacheRetrieve,
12
12
  cacheStore
13
- } from "./chunk-4ZMLBA4T.js";
13
+ } from "./chunk-S3XZMGTD.js";
14
14
  import {
15
15
  exec,
16
16
  renderError,
17
17
  renderInfo,
18
18
  renderWarning
19
- } from "./chunk-XIWLFYMS.js";
19
+ } from "./chunk-DKAJC4S3.js";
20
20
  import {
21
21
  jsonOutputEnabled
22
- } from "./chunk-DXHBESFY.js";
22
+ } from "./chunk-VHVI7YNQ.js";
23
23
  import {
24
24
  AbortSilentError
25
- } from "./chunk-M3RDXLNX.js";
25
+ } from "./chunk-L6U3W2XC.js";
26
26
  import {
27
- external_exports,
28
27
  outputDebug
29
- } from "./chunk-37C3NPH2.js";
28
+ } from "./chunk-VKOB4EDC.js";
29
+ import {
30
+ external_exports
31
+ } from "./chunk-GLO2DI4E.js";
30
32
  import {
31
33
  isTruthy
32
34
  } from "./chunk-HNIAZN6U.js";
@@ -111,7 +113,7 @@ async function showNotificationsIfNeeded(currentSurfaces, environment = process.
111
113
  throw new AbortSilentError();
112
114
  let errorMessage = `Error showing notifications: ${error.message}`;
113
115
  outputDebug(errorMessage);
114
- let { sendErrorToBugsnag } = await import("./error-handler-CKAKQAM5.js");
116
+ let { sendErrorToBugsnag } = await import("./error-handler-JY4HXOW5.js");
115
117
  await sendErrorToBugsnag(errorMessage, "unexpected_error");
116
118
  }
117
119
  }
@@ -225,4 +227,4 @@ export {
225
227
  filterNotifications,
226
228
  stringifyFilters
227
229
  };
228
- //# sourceMappingURL=chunk-44QGQFKE.js.map
230
+ //# sourceMappingURL=chunk-TES7JZAA.js.map
@@ -0,0 +1,47 @@
1
+ import {
2
+ exec
3
+ } from "./chunk-DKAJC4S3.js";
4
+ import {
5
+ outputInfo
6
+ } from "./chunk-VKOB4EDC.js";
7
+ import {
8
+ commandEventOutputMode
9
+ } from "./chunk-GLO2DI4E.js";
10
+ import {
11
+ init_cjs_shims
12
+ } from "./chunk-3XNI6LP4.js";
13
+
14
+ // ../cli-kit/dist/public/node/upgrade/output.js
15
+ init_cjs_shims();
16
+ import { Writable } from "node:stream";
17
+ import { StringDecoder } from "node:string_decoder";
18
+ function upgradeOutputStreams() {
19
+ return commandEventOutputMode() !== "json" ? { stdout: process.stdout, stderr: process.stderr } : { stdout: diagnosticStream(), stderr: diagnosticStream() };
20
+ }
21
+ function diagnosticStream() {
22
+ let decoder = new StringDecoder("utf8");
23
+ return new Writable({
24
+ write(chunk, _encoding, callback) {
25
+ let message = decoder.write(chunk);
26
+ message && outputInfo(message), callback();
27
+ },
28
+ final(callback) {
29
+ let message = decoder.end();
30
+ message && outputInfo(message), callback();
31
+ }
32
+ });
33
+ }
34
+ async function execUpgradeCommand(command, args) {
35
+ let streams = upgradeOutputStreams();
36
+ try {
37
+ await exec(command, args, streams.stdout === process.stdout ? { stdio: "inherit" } : { stdin: "inherit", ...streams });
38
+ } finally {
39
+ streams.stdout !== process.stdout && streams.stdout.end(), streams.stderr !== process.stderr && streams.stderr.end();
40
+ }
41
+ }
42
+
43
+ export {
44
+ upgradeOutputStreams,
45
+ execUpgradeCommand
46
+ };
47
+ //# sourceMappingURL=chunk-UJ5OJF5L.js.map
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  environmentVariables,
3
3
  systemEnvironmentVariables
4
- } from "./chunk-C3P3BBJI.js";
4
+ } from "./chunk-C7SNAAK3.js";
5
5
  import {
6
6
  isTruthy
7
7
  } from "./chunk-HNIAZN6U.js";
8
8
  import {
9
9
  sniffForJson
10
- } from "./chunk-57VCTLOQ.js";
10
+ } from "./chunk-JZFZ3JYG.js";
11
11
  import {
12
12
  init_cjs_shims
13
13
  } from "./chunk-3XNI6LP4.js";
@@ -34,13 +34,48 @@ function nonRandomUUID(subject) {
34
34
  return crypto.createHash("sha1").update(Buffer.from("6ba7b810-9dad-11d1-80b4-00c04fd430c8".replace(/-/g, ""), "hex")).update(subject).digest().toString("hex").replace(/(.{8})(.{4})(.{4})(.{4})(.{12})/, "$1-$2-$3-$4-$5");
35
35
  }
36
36
 
37
+ // ../cli-kit/dist/private/node/session/automation-token.js
38
+ init_cjs_shims();
39
+ var SERVICE_ACCOUNT_TOKEN = environmentVariables.serviceAccountToken, APP_TOKEN = environmentVariables.appAutomationToken, PARTNERS_TOKEN = environmentVariables.partnersToken;
40
+ function automationTokenVariable(env = process.env) {
41
+ return [SERVICE_ACCOUNT_TOKEN, APP_TOKEN, PARTNERS_TOKEN].find((name) => env[name] !== void 0);
42
+ }
43
+ function automationTokenAuthMethod(env = process.env) {
44
+ return automationTokenVariable(env) === SERVICE_ACCOUNT_TOKEN ? "service_account_token" : "partners_token";
45
+ }
46
+ function deprecatedAutomationTokenVariable(env = process.env) {
47
+ if (automationTokenVariablesProblem(env))
48
+ return;
49
+ let variable = automationTokenVariable(env);
50
+ return variable === APP_TOKEN || variable === PARTNERS_TOKEN ? variable : void 0;
51
+ }
52
+ function automationTokenVariablesProblem(env = process.env) {
53
+ if (env[SERVICE_ACCOUNT_TOKEN] !== void 0) {
54
+ let conflictingVariables = [APP_TOKEN, PARTNERS_TOKEN].filter((name) => env[name] !== void 0);
55
+ if (conflictingVariables.length > 0)
56
+ return {
57
+ message: `${SERVICE_ACCOUNT_TOKEN} can't be set together with ${conflictingVariables.join(" or ")}.`,
58
+ tryMessage: `Unset ${conflictingVariables.join(" and ")}, or unset ${SERVICE_ACCOUNT_TOKEN}.`
59
+ };
60
+ }
61
+ let variable = automationTokenVariable(env);
62
+ if (variable && env[variable] === "")
63
+ return {
64
+ message: `${variable} is set but empty.`,
65
+ tryMessage: "Set it to an automation token, or unset it to log in with your Shopify account."
66
+ };
67
+ }
68
+
37
69
  // ../cli-kit/dist/public/node/environment.js
38
70
  function getEnvironmentVariables() {
39
71
  return process.env;
40
72
  }
41
73
  function getAppAutomationToken() {
42
74
  let env = getEnvironmentVariables();
43
- return env[environmentVariables.appAutomationToken] ?? env[environmentVariables.partnersToken];
75
+ if (automationTokenVariablesProblem(env))
76
+ return;
77
+ let variable = automationTokenVariable(env);
78
+ return variable ? env[variable] : void 0;
44
79
  }
45
80
  function getOrganization() {
46
81
  return getEnvironmentVariables()[environmentVariables.organization];
@@ -77,6 +112,10 @@ export {
77
112
  fileHash,
78
113
  randomUUID,
79
114
  nonRandomUUID,
115
+ automationTokenVariable,
116
+ automationTokenAuthMethod,
117
+ deprecatedAutomationTokenVariable,
118
+ automationTokenVariablesProblem,
80
119
  getEnvironmentVariables,
81
120
  getAppAutomationToken,
82
121
  getOrganization,
@@ -86,4 +125,4 @@ export {
86
125
  skipNetworkLevelRetry,
87
126
  maxRequestTimeForNetworkCallsMs
88
127
  };
89
- //# sourceMappingURL=chunk-DXHBESFY.js.map
128
+ //# sourceMappingURL=chunk-VHVI7YNQ.js.map