@shopify/create-app 4.0.0 → 4.1.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 (38) hide show
  1. package/README.md +2 -2
  2. package/dist/{analytics-XUVDQAYG.js → analytics-RYQKQ4DG.js} +11 -11
  3. package/dist/{analytics-XLT3JDGP.js → analytics-ZSO2XN53.js} +11 -11
  4. package/dist/{chunk-UMSYG5WJ.js → chunk-32DG2OXV.js} +15 -15
  5. package/dist/{chunk-ANIFE3UR.js → chunk-7OFS6B2C.js} +2 -2
  6. package/dist/{chunk-4CS37CS5.js → chunk-A6TJPMVH.js} +6 -10
  7. package/dist/{chunk-LNOZTAML.js → chunk-BMI6QCMV.js} +10 -11
  8. package/dist/{chunk-YIHECXVH.js → chunk-C5OLLQWI.js} +10 -42
  9. package/dist/{chunk-QN5KFM2B.js → chunk-CEGG2EWP.js} +2 -2
  10. package/dist/{chunk-IGDZPTDH.js → chunk-JT5MT2JE.js} +6 -6
  11. package/dist/{chunk-JUV7D377.js → chunk-MIECGF3H.js} +3 -3
  12. package/dist/{chunk-DNF3EUMN.js → chunk-PVHOBK32.js} +5 -5
  13. package/dist/{chunk-YUPQUA3D.js → chunk-RB7BXTZQ.js} +4 -4
  14. package/dist/{chunk-STHW3YIX.js → chunk-S4YEA2XG.js} +10 -10
  15. package/dist/{chunk-37G3KLO2.js → chunk-SWITKWBS.js} +3 -3
  16. package/dist/{chunk-DHAC6KEL.js → chunk-TS6LOJXS.js} +10 -10
  17. package/dist/{chunk-QMXFPY46.js → chunk-TVUF42MB.js} +2 -2
  18. package/dist/{conf-store-RAVX2WFV.js → conf-store-R26LOTXD.js} +5 -5
  19. package/dist/{deprecations-2QTB3736.js → deprecations-JWETMJFF.js} +7 -7
  20. package/dist/{environments-LTWWRWCC.js → environments-VKYG7DMX.js} +8 -8
  21. package/dist/{error-handler-KHJE653Z.js → error-handler-YXGIUGKI.js} +11 -11
  22. package/dist/{fs-XENRLBMU.js → fs-HPLMOQQD.js} +3 -3
  23. package/dist/hooks/postrun.js +4 -4
  24. package/dist/hooks/prerun.js +6 -6
  25. package/dist/index.js +234 -140
  26. package/dist/{is-global-KZMSAFQT.js → is-global-OXCPPXM7.js} +3 -3
  27. package/dist/{local-NQALOHJX.js → local-6ARTMTVE.js} +2 -4
  28. package/dist/{metadata-FXCUDE5I.js → metadata-Z65VJ53L.js} +3 -3
  29. package/dist/{node-package-manager-7R7HDW4R.js → node-package-manager-Q3Y2FSRM.js} +9 -9
  30. package/dist/{notifications-system-7QMDSL5Y.js → notifications-system-2HPAOE4P.js} +12 -12
  31. package/dist/{output-PQSQ7U45.js → output-MCH67S5U.js} +3 -3
  32. package/dist/{system-W4MMMHEV.js → system-YW6RJ2KQ.js} +7 -7
  33. package/dist/{ui-2FROV2IT.js → ui-AYUE37Z3.js} +7 -7
  34. package/dist/{upgrade-FAUZ7VAF.js → upgrade-DNAT5W4B.js} +13 -13
  35. package/dist/{version-T73ZLUJK.js → version-2J64V5CP.js} +2 -2
  36. package/dist/{version-HKPHVW5M.js → version-V77ZX5N2.js} +8 -8
  37. package/oclif.manifest.json +1 -1
  38. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -7,14 +7,14 @@ import {
7
7
  TomlFileError,
8
8
  loadEnvironment,
9
9
  require_toml_patch
10
- } from "./chunk-DNF3EUMN.js";
10
+ } from "./chunk-PVHOBK32.js";
11
11
  import {
12
12
  require_normalize_path
13
13
  } from "./chunk-X7YTIMNN.js";
14
14
  import {
15
15
  setCurrentCommandId,
16
16
  showNotificationsIfNeeded
17
- } from "./chunk-DHAC6KEL.js";
17
+ } from "./chunk-TS6LOJXS.js";
18
18
  import {
19
19
  ClientError,
20
20
  DevServerCore,
@@ -90,7 +90,7 @@ import {
90
90
  shopifyFetch,
91
91
  storeAdminUrl,
92
92
  z
93
- } from "./chunk-STHW3YIX.js";
93
+ } from "./chunk-S4YEA2XG.js";
94
94
  import {
95
95
  setNextDeprecationDate
96
96
  } from "./chunk-JCETIRLI.js";
@@ -112,22 +112,22 @@ import {
112
112
  usesWorkspaces,
113
113
  versionSatisfies,
114
114
  writePackageJSON
115
- } from "./chunk-IGDZPTDH.js";
115
+ } from "./chunk-JT5MT2JE.js";
116
116
  import {
117
117
  CLI_KIT_VERSION
118
- } from "./chunk-ANIFE3UR.js";
118
+ } from "./chunk-7OFS6B2C.js";
119
119
  import "./chunk-VBBBCVMH.js";
120
120
  import {
121
121
  LocalStorage,
122
122
  require_ajv,
123
123
  runAtMinimumInterval,
124
124
  serviceEnvironment
125
- } from "./chunk-YUPQUA3D.js";
125
+ } from "./chunk-RB7BXTZQ.js";
126
126
  import {
127
127
  globalCLIVersion,
128
128
  isPreReleaseVersion,
129
129
  localCLIVersion
130
- } from "./chunk-QMXFPY46.js";
130
+ } from "./chunk-TVUF42MB.js";
131
131
  import {
132
132
  AbortController as AbortController2,
133
133
  AbortSignal,
@@ -168,20 +168,20 @@ import {
168
168
  useAbortSignal,
169
169
  useConcurrentOutputContext,
170
170
  username
171
- } from "./chunk-YIHECXVH.js";
171
+ } from "./chunk-C5OLLQWI.js";
172
172
  import {
173
173
  addPublicMetadata,
174
174
  addSensitiveMetadata,
175
175
  createRuntimeMetadataContainer,
176
176
  runWithTimer
177
- } from "./chunk-37G3KLO2.js";
177
+ } from "./chunk-SWITKWBS.js";
178
178
  import {
179
179
  AbortError,
180
180
  AbortSilentError,
181
181
  BugError,
182
182
  CancelExecution,
183
183
  import_ts_error
184
- } from "./chunk-JUV7D377.js";
184
+ } from "./chunk-MIECGF3H.js";
185
185
  import {
186
186
  require_commonjs,
187
187
  require_lib
@@ -193,10 +193,10 @@ import "./chunk-PES3XMQM.js";
193
193
  import "./chunk-6OOTYTVB.js";
194
194
  import {
195
195
  waitForPostRunHookAndExit
196
- } from "./chunk-UMSYG5WJ.js";
196
+ } from "./chunk-32DG2OXV.js";
197
197
  import {
198
198
  treeKill
199
- } from "./chunk-QN5KFM2B.js";
199
+ } from "./chunk-CEGG2EWP.js";
200
200
  import {
201
201
  Box_default,
202
202
  Link,
@@ -301,7 +301,7 @@ import {
301
301
  use_stdout_default,
302
302
  writeFile,
303
303
  writeFileSync
304
- } from "./chunk-LNOZTAML.js";
304
+ } from "./chunk-BMI6QCMV.js";
305
305
  import {
306
306
  codespacePortForwardingDomain,
307
307
  codespaceURL,
@@ -311,14 +311,13 @@ import {
311
311
  gitpodURL,
312
312
  hasGit,
313
313
  isDevelopment,
314
- isHostedAppsMode,
315
314
  isShopify,
316
315
  isTerminalInteractive,
317
316
  isTruthy,
318
317
  isUnitTest,
319
318
  isVerbose,
320
319
  themeKitAccessDomain
321
- } from "./chunk-4CS37CS5.js";
320
+ } from "./chunk-A6TJPMVH.js";
322
321
  import "./chunk-DJW2W7VA.js";
323
322
  import {
324
323
  basename,
@@ -124848,13 +124847,13 @@ var require_dist9 = __commonJS({
124848
124847
  }
124849
124848
  });
124850
124849
 
124851
- // ../../node_modules/.pnpm/liquidjs@10.25.0/node_modules/liquidjs/dist/liquid.node.js
124850
+ // ../../node_modules/.pnpm/liquidjs@10.26.0/node_modules/liquidjs/dist/liquid.node.js
124852
124851
  var require_liquid_node = __commonJS({
124853
- "../../node_modules/.pnpm/liquidjs@10.25.0/node_modules/liquidjs/dist/liquid.node.js"(exports) {
124852
+ "../../node_modules/.pnpm/liquidjs@10.26.0/node_modules/liquidjs/dist/liquid.node.js"(exports) {
124854
124853
  "use strict";
124855
124854
  init_cjs_shims();
124856
124855
  Object.defineProperty(exports, "__esModule", { value: !0 });
124857
- var stream2 = __require("stream"), path = __require("path"), fs$1 = __require("fs"), Token = class {
124856
+ var stream2 = __require("stream"), path = __require("path"), fs$1 = __require("fs"), crypto = __require("crypto"), Token = class {
124858
124857
  constructor(kind, input, begin, end, file) {
124859
124858
  this.kind = kind, this.input = input, this.begin = begin, this.end = end, this.file = file;
124860
124859
  }
@@ -124887,9 +124886,6 @@ var require_liquid_node = __commonJS({
124887
124886
  function isIterator(val) {
124888
124887
  return val && isFunction(val.next) && isFunction(val.throw) && isFunction(val.return);
124889
124888
  }
124890
- function escapeRegex(str) {
124891
- return str.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
124892
- }
124893
124889
  function promisify2(fn) {
124894
124890
  return function(...args) {
124895
124891
  return new Promise((resolve2, reject2) => {
@@ -124964,9 +124960,7 @@ var require_liquid_node = __commonJS({
124964
124960
  function pad(str, length, ch, add) {
124965
124961
  str = String(str);
124966
124962
  let n = length - str.length;
124967
- for (; n-- > 0; )
124968
- str = add(str, ch);
124969
- return str;
124963
+ return n <= 0 ? str : add(str, ch.repeat(n));
124970
124964
  }
124971
124965
  function identify(val) {
124972
124966
  return val;
@@ -124977,8 +124971,11 @@ var require_liquid_node = __commonJS({
124977
124971
  function ellipsis(str, N) {
124978
124972
  return str.length > N ? str.slice(0, N - 3) + "..." : str;
124979
124973
  }
124974
+ function orderedCompare(a2, b) {
124975
+ return isNil(a2) && isNil(b) ? 0 : isNil(a2) ? 1 : isNil(b) || a2 < b ? -1 : a2 > b ? 1 : 0;
124976
+ }
124980
124977
  function caseInsensitiveCompare(a2, b) {
124981
- return a2 == null && b == null ? 0 : a2 == null ? 1 : b == null || (a2 = toLowerCase.call(a2), b = toLowerCase.call(b), a2 < b) ? -1 : a2 > b ? 1 : 0;
124978
+ return isNil(a2) && isNil(b) ? 0 : isNil(a2) ? 1 : isNil(b) || (a2 = toLowerCase.call(a2), b = toLowerCase.call(b), a2 < b) ? -1 : a2 > b ? 1 : 0;
124982
124979
  }
124983
124980
  function argumentsToValue(fn) {
124984
124981
  return function(...args) {
@@ -124990,9 +124987,6 @@ var require_liquid_node = __commonJS({
124990
124987
  return fn.call(this, ...args.map(toNumber));
124991
124988
  };
124992
124989
  }
124993
- function escapeRegExp(text) {
124994
- return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
124995
- }
124996
124990
  function* strictUniq(array) {
124997
124991
  let seen = /* @__PURE__ */ new Set();
124998
124992
  for (let element of array) {
@@ -125220,6 +125214,10 @@ From ` + this.originalError.stack);
125220
125214
  }
125221
125215
  return trie;
125222
125216
  }
125217
+ function toLiquidAsync(asyncFn, syncFn) {
125218
+ let syncImpl = syncFn || asyncFn;
125219
+ return (sync, ...args) => sync ? syncImpl(...args) : asyncFn(...args);
125220
+ }
125223
125221
  async function toPromise(val) {
125224
125222
  if (!isIterator(val))
125225
125223
  return val;
@@ -125324,7 +125322,7 @@ From ` + this.originalError.stack);
125324
125322
  M: (d) => d.getMinutes(),
125325
125323
  N: (d, opts) => {
125326
125324
  let width = Number(opts.width) || 9, str = String(d.getMilliseconds()).slice(0, width);
125327
- return padEnd(str, width, "0");
125325
+ return opts.memoryLimit?.use(width - str.length), padEnd(str, width, "0");
125328
125326
  },
125329
125327
  p: (d) => d.getHours() < 12 ? "AM" : "PM",
125330
125328
  P: (d) => d.getHours() < 12 ? "am" : "pm",
@@ -125347,21 +125345,21 @@ From ` + this.originalError.stack);
125347
125345
  "%": () => "%"
125348
125346
  };
125349
125347
  formatCodes.h = formatCodes.b;
125350
- function strftime(d, formatStr) {
125348
+ function strftime(d, formatStr, memoryLimit) {
125351
125349
  let output = "", remaining = formatStr, match2;
125352
125350
  for (; match2 = rFormat.exec(remaining); )
125353
- output += remaining.slice(0, match2.index), remaining = remaining.slice(match2.index + match2[0].length), output += format5(d, match2);
125351
+ output += remaining.slice(0, match2.index), remaining = remaining.slice(match2.index + match2[0].length), output += format5(d, match2, memoryLimit);
125354
125352
  return output + remaining;
125355
125353
  }
125356
- function format5(d, match2) {
125354
+ function format5(d, match2, memoryLimit) {
125357
125355
  let [input, flagStr = "", width, modifier, conversion] = match2, convert = formatCodes[conversion];
125358
125356
  if (!convert)
125359
125357
  return input;
125360
125358
  let flags = {};
125361
125359
  for (let flag of flagStr)
125362
125360
  flags[flag] = !0;
125363
- let ret = String(convert(d, { flags, width, modifier })), padChar = padSpaceChars.has(conversion) ? " " : "0", padWidth = width || padWidths[conversion] || 0;
125364
- return flags["^"] ? ret = ret.toUpperCase() : flags["#"] && (ret = changeCase(ret)), flags._ ? padChar = " " : flags[0] && (padChar = "0"), flags["-"] && (padWidth = 0), padStart(ret, padWidth, padChar);
125361
+ let ret = String(convert(d, { flags, width, modifier, memoryLimit })), padChar = padSpaceChars.has(conversion) ? " " : "0", padWidth = width || padWidths[conversion] || 0;
125362
+ return flags["^"] ? ret = ret.toUpperCase() : flags["#"] && (ret = changeCase(ret)), flags._ ? padChar = " " : flags[0] && (padChar = "0"), flags["-"] && (padWidth = 0), memoryLimit?.use(Number(padWidth) - ret.length), padStart(ret, padWidth, padChar);
125365
125363
  }
125366
125364
  function getDateTimeFormat() {
125367
125365
  return typeof Intl < "u" ? Intl.DateTimeFormat : void 0;
@@ -125488,10 +125486,10 @@ From ` + this.originalError.stack);
125488
125486
  this.base = 0, this.message = `${resource} limit exceeded`, this.limit = limit2;
125489
125487
  }
125490
125488
  use(count) {
125491
- count = +count || 0, assert(this.base + count <= this.limit, this.message), this.base += count;
125489
+ +count > 0 && (assert(this.base + +count <= this.limit, this.message), this.base += +count);
125492
125490
  }
125493
125491
  check(count) {
125494
- count = +count || 0, assert(count <= this.limit, this.message);
125492
+ +count > 0 && assert(+count <= this.limit, this.message);
125495
125493
  }
125496
125494
  }, DelimitedToken = class extends Token {
125497
125495
  constructor(kind, [contentBegin, contentEnd], input, begin, end, trimLeft3, trimRight2, file) {
@@ -125647,7 +125645,7 @@ From ` + this.originalError.stack);
125647
125645
  return Promise.resolve().then(() => toPromise(this.renderTemplates(templates2, ctx, emitter))).then(() => emitter.end(), (err2) => emitter.error(err2)), emitter.stream;
125648
125646
  }
125649
125647
  *renderTemplates(templates2, ctx, emitter) {
125650
- emitter || (emitter = ctx.opts.keepOutputType ? new KeepingTypeEmitter() : new SimpleEmitter());
125648
+ emitter || (emitter = ctx.opts.keepOutputType ? new KeepingTypeEmitter() : new SimpleEmitter()), ctx.renderLimit.check(getPerformance().now());
125651
125649
  let errors = [];
125652
125650
  for (let tpl of templates2) {
125653
125651
  ctx.renderLimit.check(getPerformance().now());
@@ -125829,8 +125827,22 @@ From ` + this.originalError.stack);
125829
125827
  function dirname3(filepath) {
125830
125828
  return path.dirname(filepath);
125831
125829
  }
125832
- function contains3(root, file) {
125833
- return root = path.resolve(root), root = root.endsWith(path.sep) ? root : root + path.sep, file.startsWith(root);
125830
+ var realpathAsync = promisify2(fs$1.realpath);
125831
+ async function contains3(root, file) {
125832
+ try {
125833
+ let realRoot = await realpathAsync(root), realFile = await realpathAsync(file), prefix = realRoot.endsWith(path.sep) ? realRoot : realRoot + path.sep;
125834
+ return realFile.startsWith(prefix);
125835
+ } catch {
125836
+ return !1;
125837
+ }
125838
+ }
125839
+ function containsSync(root, file) {
125840
+ try {
125841
+ let realRoot = fs$1.realpathSync(root), realFile = fs$1.realpathSync(file), prefix = realRoot.endsWith(path.sep) ? realRoot : realRoot + path.sep;
125842
+ return realFile.startsWith(prefix);
125843
+ } catch {
125844
+ return !1;
125845
+ }
125834
125846
  }
125835
125847
  var fs4 = /* @__PURE__ */ Object.freeze({
125836
125848
  __proto__: null,
@@ -125842,6 +125854,7 @@ From ` + this.originalError.stack);
125842
125854
  fallback,
125843
125855
  dirname: dirname3,
125844
125856
  contains: contains3,
125857
+ containsSync,
125845
125858
  sep: path.sep
125846
125859
  });
125847
125860
  function defaultFilter(value, defaultValue, ...args) {
@@ -125905,7 +125918,27 @@ From ` + this.originalError.stack);
125905
125918
  }
125906
125919
  function strip_html(v) {
125907
125920
  let str = stringify(v);
125908
- return this.context.memoryLimit.use(str.length), str.replace(/<script[\s\S]*?<\/script>|<style[\s\S]*?<\/style>|<.*?>|<!--[\s\S]*?-->/g, "");
125921
+ this.context.memoryLimit.use(str.length);
125922
+ let blocks2 = /* @__PURE__ */ new Map([["<script", "</script>"], ["<style", "</style>"], ["<!--", "-->"], ["<", ">"]]), out = "", i = 0;
125923
+ for (; i < str.length; ) {
125924
+ let lt = str.indexOf("<", i);
125925
+ if (lt < 0)
125926
+ return out + str.slice(i);
125927
+ out += str.slice(i, lt);
125928
+ for (let [opener, closer] of blocks2) {
125929
+ if (!str.startsWith(opener, lt))
125930
+ continue;
125931
+ let e = str.indexOf(closer, lt + opener.length);
125932
+ if (e >= 0) {
125933
+ i = e + closer.length;
125934
+ break;
125935
+ }
125936
+ blocks2.delete(opener);
125937
+ }
125938
+ if (i === lt)
125939
+ return out + str.slice(lt);
125940
+ }
125941
+ return out;
125909
125942
  }
125910
125943
  var htmlFilters = /* @__PURE__ */ Object.freeze({
125911
125944
  __proto__: null,
@@ -126666,39 +126699,35 @@ From ` + this.originalError.stack);
126666
126699
  if (this.options = options, options.relativeReference) {
126667
126700
  let sep = options.fs.sep;
126668
126701
  assert(sep, "`fs.sep` is required for relative reference");
126669
- let rRelativePath = new RegExp(["." + sep, ".." + sep, "./", "../"].map((prefix) => escapeRegex(prefix)).join("|"));
126670
- this.shouldLoadRelative = (referencedFile) => rRelativePath.test(referencedFile);
126702
+ let prefixes = ["." + sep, ".." + sep, "./", "../"];
126703
+ this.shouldLoadRelative = (referencedFile) => prefixes.some((prefix) => referencedFile.startsWith(prefix));
126671
126704
  } else
126672
126705
  this.shouldLoadRelative = (_referencedFile) => !1;
126673
- this.contains = this.options.fs.contains || (() => !0);
126706
+ let fs5 = options.fs;
126707
+ this.contains = toLiquidAsync(fs5.contains?.bind(fs5) || (async () => !0), fs5.containsSync?.bind(fs5) || (() => !0)), this.exists = toLiquidAsync(fs5.exists?.bind(fs5) || (async () => !1), fs5.existsSync?.bind(fs5));
126674
126708
  }
126675
126709
  *lookup(file, type, sync, currentFile) {
126676
- let { fs: fs5 } = this.options, dirs = this.options[type];
126677
- for (let filepath of this.candidates(file, dirs, currentFile, type !== exports.LookupType.Root))
126678
- if (sync ? fs5.existsSync(filepath) : yield fs5.exists(filepath))
126710
+ let dirs = this.options[type];
126711
+ for (let filepath of this.candidates(file, dirs, currentFile)) {
126712
+ let allowed = !1;
126713
+ for (let dir of dirs)
126714
+ if (yield this.contains(!!sync, dir, filepath)) {
126715
+ allowed = !0;
126716
+ break;
126717
+ }
126718
+ if (allowed && (yield this.exists(!!sync, filepath)))
126679
126719
  return filepath;
126720
+ }
126680
126721
  throw this.lookupError(file, dirs);
126681
126722
  }
126682
- *candidates(file, dirs, currentFile, enforceRoot) {
126683
- let { fs: fs5, extname: extname2 } = this.options, isAllowed = (filepath) => {
126684
- if (!enforceRoot)
126685
- return !0;
126686
- for (let dir of dirs)
126687
- if (this.contains(dir, filepath))
126688
- return !0;
126689
- return !1;
126690
- };
126691
- if (this.shouldLoadRelative(file) && currentFile) {
126692
- let referenced = fs5.resolve(this.dirname(currentFile), file, extname2);
126693
- isAllowed(referenced) && (yield referenced);
126694
- }
126695
- for (let dir of dirs) {
126696
- let referenced = fs5.resolve(dir, file, extname2);
126697
- isAllowed(referenced) && (yield referenced);
126698
- }
126723
+ *candidates(file, dirs, currentFile) {
126724
+ let { fs: fs5, extname: extname2 } = this.options;
126725
+ this.shouldLoadRelative(file) && currentFile && (yield fs5.resolve(this.dirname(currentFile), file, extname2));
126726
+ for (let dir of dirs)
126727
+ yield fs5.resolve(dir, file, extname2);
126699
126728
  if (fs5.fallback !== void 0) {
126700
126729
  let filepath = fs5.fallback(file);
126701
- filepath !== void 0 && isAllowed(filepath) && (yield filepath);
126730
+ filepath !== void 0 && (yield filepath);
126702
126731
  }
126703
126732
  }
126704
126733
  dirname(path2) {
@@ -126711,7 +126740,9 @@ From ` + this.originalError.stack);
126711
126740
  }
126712
126741
  }, Parser2 = class {
126713
126742
  constructor(liquid) {
126714
- this.liquid = liquid, this.cache = this.liquid.options.cache, this.fs = this.liquid.options.fs, this.parseFile = this.cache ? this._parseFileCached : this._parseFile, this.loader = new Loader(this.liquid.options), this.parseLimit = new Limiter("parse length", liquid.options.parseLimit);
126743
+ this.liquid = liquid, this.cache = this.liquid.options.cache, this.fs = this.liquid.options.fs, this.parseFile = this.cache ? this._parseFileCached : this._parseFile, this.loader = new Loader(this.liquid.options), this.parseLimit = new Limiter("parse length", liquid.options.parseLimit), this.readFile = toLiquidAsync(this.fs.readFile?.bind(this.fs) || (async () => {
126744
+ throw new Error("readFile not implemented");
126745
+ }), this.fs.readFileSync?.bind(this.fs));
126715
126746
  }
126716
126747
  parse(html, filepath) {
126717
126748
  html = String(html), this.parseLimit.use(html.length);
@@ -126761,7 +126792,7 @@ From ` + this.originalError.stack);
126761
126792
  }
126762
126793
  *_parseFile(file, sync, type = exports.LookupType.Root, currentFile) {
126763
126794
  let filepath = yield this.loader.lookup(file, type, sync, currentFile);
126764
- return this.parse(sync ? this.fs.readFileSync(filepath) : yield this.fs.readFile(filepath), filepath);
126795
+ return this.parse(yield this.readFile(!!sync, filepath), filepath);
126765
126796
  }
126766
126797
  };
126767
126798
  (function(TokenKind) {
@@ -126832,8 +126863,8 @@ From ` + this.originalError.stack);
126832
126863
  constructor(env = {}, opts = defaultOptions, renderOptions = {}, { memoryLimit, renderLimit } = {}) {
126833
126864
  this.scopes = [{}], this.registers = {}, this.breakCalled = !1, this.continueCalled = !1, this.sync = !!renderOptions.sync, this.opts = opts, this.globals = renderOptions.globals ?? opts.globals, this.environments = isObject2(env) ? env : Object(env), this.strictVariables = renderOptions.strictVariables ?? this.opts.strictVariables, this.ownPropertyOnly = renderOptions.ownPropertyOnly ?? opts.ownPropertyOnly, this.memoryLimit = memoryLimit ?? new Limiter("memory alloc", renderOptions.memoryLimit ?? opts.memoryLimit), this.renderLimit = renderLimit ?? new Limiter("template render", getPerformance().now() + (renderOptions.renderLimit ?? opts.renderLimit));
126834
126865
  }
126835
- getRegister(key) {
126836
- return this.registers[key] = this.registers[key] || {};
126866
+ getRegister(key, defaultValue = void 0) {
126867
+ return this.registers[key] = this.registers[key] || defaultValue;
126837
126868
  }
126838
126869
  setRegister(key, value) {
126839
126870
  return this.registers[key] = value;
@@ -126886,7 +126917,8 @@ From ` + this.originalError.stack);
126886
126917
  return new _Context(scope, this.opts, {
126887
126918
  sync: this.sync,
126888
126919
  globals: this.globals,
126889
- strictVariables: this.strictVariables
126920
+ strictVariables: this.strictVariables,
126921
+ ownPropertyOnly: this.ownPropertyOnly
126890
126922
  }, {
126891
126923
  renderLimit: this.renderLimit,
126892
126924
  memoryLimit: this.memoryLimit
@@ -126934,8 +126966,8 @@ From ` + this.originalError.stack);
126934
126966
  var abs = argumentsToNumber(Math.abs), at_least = argumentsToNumber(Math.max), at_most = argumentsToNumber(Math.min), ceil = argumentsToNumber(Math.ceil), divided_by = argumentsToNumber((dividend, divisor, integerArithmetic = !1) => integerArithmetic ? Math.floor(dividend / divisor) : dividend / divisor), floor = argumentsToNumber(Math.floor), minus = argumentsToNumber((v, arg) => v - arg), plus = argumentsToNumber((lhs, rhs) => lhs + rhs), modulo = argumentsToNumber((v, arg) => v % arg), times = argumentsToNumber((v, arg) => v * arg);
126935
126967
  function round(v, arg = 0) {
126936
126968
  v = toNumber(v), arg = toNumber(arg);
126937
- let amp = Math.pow(10, arg);
126938
- return Math.round(v * amp) / amp;
126969
+ let amp = Math.pow(10, arg), scaled = v * amp;
126970
+ return Math.sign(v) * Math.round(Math.abs(scaled)) / amp;
126939
126971
  }
126940
126972
  var mathFilters = /* @__PURE__ */ Object.freeze({
126941
126973
  __proto__: null,
@@ -126980,7 +127012,7 @@ From ` + this.originalError.stack);
126980
127012
  let array = toArray(v);
126981
127013
  return this.context.memoryLimit.use(array.length), [...array].reverse();
126982
127014
  });
126983
- function* sort2(arr, property) {
127015
+ function* sortBy(arr, property, comparator) {
126984
127016
  let values2 = [], array = toArray(arr);
126985
127017
  this.context.memoryLimit.use(array.length);
126986
127018
  for (let item of array)
@@ -126988,14 +127020,13 @@ From ` + this.originalError.stack);
126988
127020
  item,
126989
127021
  property ? yield this.context._getFromScope(item, stringify(property).split("."), !1) : item
126990
127022
  ]);
126991
- return values2.sort((lhs, rhs) => {
126992
- let lvalue = lhs[1], rvalue = rhs[1];
126993
- return lvalue < rvalue ? -1 : lvalue > rvalue ? 1 : 0;
126994
- }).map((tuple) => tuple[0]);
127023
+ return values2.sort((lhs, rhs) => comparator(lhs[1], rhs[1])).map((tuple) => tuple[0]);
126995
127024
  }
126996
- function sort_natural(input, property) {
126997
- let propertyString = stringify(property), compare = property === void 0 ? caseInsensitiveCompare : (lhs, rhs) => caseInsensitiveCompare(lhs[propertyString], rhs[propertyString]), array = toArray(input);
126998
- return this.context.memoryLimit.use(array.length), [...array].sort(compare);
127025
+ function* sort2(arr, property) {
127026
+ return yield* sortBy.call(this, arr, property, orderedCompare);
127027
+ }
127028
+ function* sort_natural(arr, property) {
127029
+ return yield* sortBy.call(this, arr, property, caseInsensitiveCompare);
126999
127030
  }
127000
127031
  var size = (v) => v && v.length || 0;
127001
127032
  function* map(arr, property) {
@@ -127181,10 +127212,10 @@ From ` + this.originalError.stack);
127181
127212
  sample
127182
127213
  });
127183
127214
  function date(v, format6, timezoneOffset) {
127184
- let size2 = (v?.length ?? 0) + (format6?.length ?? 0) + (timezoneOffset?.length ?? 0);
127215
+ let size2 = (v?.length ?? 0) + (timezoneOffset?.length ?? 0);
127185
127216
  this.context.memoryLimit.use(size2);
127186
127217
  let date2 = parseDate(v, this.context.opts, timezoneOffset);
127187
- return date2 ? (format6 = toValue(format6), format6 = isNil(format6) ? this.context.opts.dateFormat : stringify(format6), strftime(date2, format6)) : v;
127218
+ return date2 ? (format6 = toValue(format6), format6 = isNil(format6) ? this.context.opts.dateFormat : stringify(format6), this.context.memoryLimit.use(format6.length), strftime(date2, format6, this.context.memoryLimit)) : v;
127188
127219
  }
127189
127220
  function date_to_xmlschema(v) {
127190
127221
  return date.call(this, v, "%Y-%m-%dT%H:%M:%S%:z");
@@ -127202,15 +127233,17 @@ From ` + this.originalError.stack);
127202
127233
  let date2 = parseDate(v, this.context.opts);
127203
127234
  if (!date2)
127204
127235
  return v;
127236
+ let ml = this.context.memoryLimit;
127205
127237
  if (type === "ordinal") {
127206
127238
  let d = date2.getDate();
127207
- return style === "US" ? strftime(date2, `${month_type} ${d}%q, %Y`) : strftime(date2, `${d}%q ${month_type} %Y`);
127239
+ return style === "US" ? strftime(date2, `${month_type} ${d}%q, %Y`, ml) : strftime(date2, `${d}%q ${month_type} %Y`, ml);
127208
127240
  }
127209
- return strftime(date2, `%d ${month_type} %Y`);
127241
+ return strftime(date2, `%d ${month_type} %Y`, ml);
127210
127242
  }
127211
127243
  function parseDate(v, opts, timezoneOffset) {
127212
127244
  let date2, defaultTimezoneOffset = timezoneOffset ?? opts.timezoneOffset, locale = opts.locale;
127213
- return v = toValue(v), v === "now" || v === "today" ? date2 = new LiquidDate(Date.now(), locale, defaultTimezoneOffset) : isNumber2(v) ? date2 = new LiquidDate(v * 1e3, locale, defaultTimezoneOffset) : isString2(v) ? /^\d+$/.test(v) ? date2 = new LiquidDate(+v * 1e3, locale, defaultTimezoneOffset) : opts.preserveTimezones && timezoneOffset === void 0 ? date2 = LiquidDate.createDateFixedToTimezone(v, locale) : date2 = new LiquidDate(v, locale, defaultTimezoneOffset) : date2 = new LiquidDate(v, locale, defaultTimezoneOffset), date2.valid() ? date2 : void 0;
127245
+ if (v = toValue(v), !isNil(v))
127246
+ return v === "now" || v === "today" ? date2 = new LiquidDate(Date.now(), locale, defaultTimezoneOffset) : isNumber2(v) ? date2 = new LiquidDate(v * 1e3, locale, defaultTimezoneOffset) : isString2(v) ? /^\d+$/.test(v) ? date2 = new LiquidDate(+v * 1e3, locale, defaultTimezoneOffset) : opts.preserveTimezones && timezoneOffset === void 0 ? date2 = LiquidDate.createDateFixedToTimezone(v, locale) : date2 = new LiquidDate(v, locale, defaultTimezoneOffset) : date2 = new LiquidDate(v, locale, defaultTimezoneOffset), date2.valid() ? date2 : void 0;
127214
127247
  }
127215
127248
  var dateFilters = /* @__PURE__ */ Object.freeze({
127216
127249
  __proto__: null,
@@ -127232,7 +127265,14 @@ From ` + this.originalError.stack);
127232
127265
  }
127233
127266
  function lstrip(v, chars) {
127234
127267
  let str = stringify(v);
127235
- return this.context.memoryLimit.use(str.length), chars ? (chars = escapeRegExp(stringify(chars)), str.replace(new RegExp(`^[${chars}]+`, "g"), "")) : str.replace(/^\s+/, "");
127268
+ if (this.context.memoryLimit.use(str.length), chars) {
127269
+ chars = stringify(chars), this.context.memoryLimit.use(chars.length);
127270
+ for (let i = 0, set = new Set(chars); i < str.length; i++)
127271
+ if (!set.has(str[i]))
127272
+ return str.slice(i);
127273
+ return "";
127274
+ }
127275
+ return str.trimStart();
127236
127276
  }
127237
127277
  function downcase(v) {
127238
127278
  let str = stringify(v);
@@ -127244,20 +127284,27 @@ From ` + this.originalError.stack);
127244
127284
  }
127245
127285
  function remove2(v, arg) {
127246
127286
  let str = stringify(v);
127247
- return this.context.memoryLimit.use(str.length), str.split(stringify(arg)).join("");
127287
+ return arg = stringify(arg), this.context.memoryLimit.use(str.length + arg.length), str.split(arg).join("");
127248
127288
  }
127249
127289
  function remove_first(v, l) {
127250
127290
  let str = stringify(v);
127251
- return this.context.memoryLimit.use(str.length), str.replace(stringify(l), "");
127291
+ return l = stringify(l), this.context.memoryLimit.use(str.length + l.length), str.replace(l, "");
127252
127292
  }
127253
127293
  function remove_last(v, l) {
127254
- let str = stringify(v);
127255
- this.context.memoryLimit.use(str.length);
127256
- let pattern = stringify(l), index = str.lastIndexOf(pattern);
127294
+ let str = stringify(v), pattern = stringify(l);
127295
+ this.context.memoryLimit.use(str.length + pattern.length);
127296
+ let index = str.lastIndexOf(pattern);
127257
127297
  return index === -1 ? str : str.substring(0, index) + str.substring(index + pattern.length);
127258
127298
  }
127259
127299
  function rstrip(str, chars) {
127260
- return str = stringify(str), this.context.memoryLimit.use(str.length), chars ? (chars = escapeRegExp(stringify(chars)), str.replace(new RegExp(`[${chars}]+$`, "g"), "")) : str.replace(/\s+$/, "");
127300
+ if (str = stringify(str), this.context.memoryLimit.use(str.length), chars) {
127301
+ chars = stringify(chars), this.context.memoryLimit.use(chars.length);
127302
+ for (let i = str.length - 1, set = new Set(chars); i >= 0; i--)
127303
+ if (!set.has(str[i]))
127304
+ return str.slice(0, i + 1);
127305
+ return "";
127306
+ }
127307
+ return str.trimEnd();
127261
127308
  }
127262
127309
  function split(v, arg) {
127263
127310
  let str = stringify(v);
@@ -127269,7 +127316,17 @@ From ` + this.originalError.stack);
127269
127316
  }
127270
127317
  function strip(v, chars) {
127271
127318
  let str = stringify(v);
127272
- return this.context.memoryLimit.use(str.length), chars ? (chars = escapeRegExp(stringify(chars)), str.replace(new RegExp(`^[${chars}]+`, "g"), "").replace(new RegExp(`[${chars}]+$`, "g"), "")) : str.trim();
127319
+ if (this.context.memoryLimit.use(str.length), chars) {
127320
+ let set = new Set(stringify(chars));
127321
+ this.context.memoryLimit.use(set.size);
127322
+ let i = 0, j = str.length - 1;
127323
+ for (; set.has(str[i]); )
127324
+ i++;
127325
+ for (; j >= i && set.has(str[j]); )
127326
+ j--;
127327
+ return str.slice(i, j + 1);
127328
+ }
127329
+ return str.trim();
127273
127330
  }
127274
127331
  function strip_newlines(v) {
127275
127332
  let str = stringify(v);
@@ -127280,28 +127337,27 @@ From ` + this.originalError.stack);
127280
127337
  }
127281
127338
  function replace(v, pattern, replacement) {
127282
127339
  let str = stringify(v);
127283
- return this.context.memoryLimit.use(str.length), str.split(stringify(pattern)).join(replacement);
127340
+ pattern = stringify(pattern), replacement = stringify(replacement);
127341
+ let parts = str.split(pattern), outputSize = str.length + (parts.length - 1) * (replacement.length - pattern.length);
127342
+ return this.context.memoryLimit.use(outputSize), parts.join(replacement);
127284
127343
  }
127285
127344
  function replace_first(v, arg1, arg2) {
127286
127345
  let str = stringify(v);
127287
- return this.context.memoryLimit.use(str.length), str.replace(stringify(arg1), arg2);
127346
+ return arg1 = stringify(arg1), arg2 = stringify(arg2), this.context.memoryLimit.use(str.length + arg1.length + arg2.length), str.replace(arg1, () => arg2);
127288
127347
  }
127289
127348
  function replace_last(v, arg1, arg2) {
127290
- let str = stringify(v);
127291
- this.context.memoryLimit.use(str.length);
127292
- let pattern = stringify(arg1), index = str.lastIndexOf(pattern);
127293
- if (index === -1)
127294
- return str;
127295
- let replacement = stringify(arg2);
127296
- return str.substring(0, index) + replacement + str.substring(index + pattern.length);
127349
+ let str = stringify(v), pattern = stringify(arg1), replacement = stringify(arg2);
127350
+ this.context.memoryLimit.use(str.length + pattern.length + replacement.length);
127351
+ let index = str.lastIndexOf(pattern);
127352
+ return index === -1 ? str : str.substring(0, index) + replacement + str.substring(index + pattern.length);
127297
127353
  }
127298
127354
  function truncate(v, l = 50, o = "...") {
127299
127355
  let str = stringify(v);
127300
- return this.context.memoryLimit.use(str.length), str.length <= l ? v : str.substring(0, l - o.length) + o;
127356
+ return o = stringify(o), this.context.memoryLimit.use(str.length + o.length), str.length <= l ? v : str.substring(0, l - o.length) + o;
127301
127357
  }
127302
127358
  function truncatewords(v, words = 15, o = "...") {
127303
127359
  let str = stringify(v);
127304
- this.context.memoryLimit.use(str.length);
127360
+ o = stringify(o), this.context.memoryLimit.use(str.length + o.length);
127305
127361
  let arr = str.split(/\s+/);
127306
127362
  words <= 0 && (words = 1);
127307
127363
  let ret = arr.slice(0, words).join(" ");
@@ -127325,7 +127381,7 @@ From ` + this.originalError.stack);
127325
127381
  }
127326
127382
  }
127327
127383
  function array_to_sentence_string(array, connector = "and") {
127328
- switch (this.context.memoryLimit.use(array.length), array.length) {
127384
+ switch (connector = stringify(connector), this.context.memoryLimit.use(array.length + connector.length), array.length) {
127329
127385
  case 0:
127330
127386
  return "";
127331
127387
  case 1:
@@ -127367,6 +127423,8 @@ From ` + this.originalError.stack);
127367
127423
  return Buffer.from(str, "base64").toString("utf8");
127368
127424
  }
127369
127425
  function base64_encode(value) {
127426
+ if (typeof Buffer < "u" && Buffer.isBuffer(value))
127427
+ return this.context.memoryLimit.use(value.byteLength), value.toString("base64");
127370
127428
  let str = stringify(value);
127371
127429
  return this.context.memoryLimit.use(str.length), base64Encode(str);
127372
127430
  }
@@ -127378,6 +127436,25 @@ From ` + this.originalError.stack);
127378
127436
  __proto__: null,
127379
127437
  base64_encode,
127380
127438
  base64_decode
127439
+ });
127440
+ function sha256(str) {
127441
+ return crypto.createHash("sha256").update(str, "utf8").digest("hex");
127442
+ }
127443
+ function hmacSha256(str, key) {
127444
+ return crypto.createHmac("sha256", key).update(str, "utf8").digest("hex");
127445
+ }
127446
+ function sha256$1(value) {
127447
+ let str = stringify(value);
127448
+ return this.context.memoryLimit.use(str.length), sha256(str);
127449
+ }
127450
+ function hmac_sha256(value, key) {
127451
+ let str = stringify(value), keyStr = stringify(key);
127452
+ return this.context.memoryLimit.use(str.length + keyStr.length), hmacSha256(str, keyStr);
127453
+ }
127454
+ var cryptoFilters = /* @__PURE__ */ Object.freeze({
127455
+ __proto__: null,
127456
+ sha256: sha256$1,
127457
+ hmac_sha256
127381
127458
  }), filters = {
127382
127459
  ...htmlFilters,
127383
127460
  ...mathFilters,
@@ -127386,6 +127463,7 @@ From ` + this.originalError.stack);
127386
127463
  ...dateFilters,
127387
127464
  ...stringFilters,
127388
127465
  ...base64Filters,
127466
+ ...cryptoFilters,
127389
127467
  ...misc
127390
127468
  }, AssignTag = class extends Tag {
127391
127469
  constructor(token, remainTokens, liquid) {
@@ -127423,7 +127501,7 @@ From ` + this.originalError.stack);
127423
127501
  return;
127424
127502
  }
127425
127503
  let continueKey = "continue-" + this.variable + "-" + this.collection.getText();
127426
- ctx.push({ continue: ctx.getRegister(continueKey) });
127504
+ ctx.push({ continue: ctx.getRegister(continueKey, {}) });
127427
127505
  let hash = yield this.hash.render(ctx);
127428
127506
  ctx.pop(), collection = (this.liquid.options.orderedFilterParameters ? Object.keys(hash).filter((x) => MODIFIERS.includes(x)) : MODIFIERS.filter((x) => hash[x] !== void 0)).reduce((collection2, modifier) => modifier === "offset" ? offset(collection2, hash.offset) : modifier === "limit" ? limit(collection2, hash.limit) : reversed(collection2), collection), ctx.setRegister(continueKey, (hash.offset || 0) + collection.length);
127429
127507
  let scope = { forloop: new ForloopDrop(collection.length, this.collection.getText(), this.variable) };
@@ -127679,7 +127757,7 @@ From ` + this.originalError.stack);
127679
127757
  this.tokenizer.assert(this.candidates.length, () => `empty candidates: "${token.getText()}"`);
127680
127758
  }
127681
127759
  *render(ctx, emitter) {
127682
- let fingerprint = `cycle:${yield evalToken(this.group, ctx)}:` + this.candidates.join(","), groups = ctx.getRegister("cycle"), idx = groups[fingerprint];
127760
+ let fingerprint = `cycle:${yield evalToken(this.group, ctx)}:` + this.candidates.join(","), groups = ctx.getRegister("cycle", {}), idx = groups[fingerprint];
127683
127761
  idx === void 0 && (idx = groups[fingerprint] = 0);
127684
127762
  let candidate = this.candidates[idx];
127685
127763
  return idx = (idx + 1) % this.candidates.length, groups[fingerprint] = idx, yield evalToken(candidate, ctx);
@@ -127752,7 +127830,7 @@ From ` + this.originalError.stack);
127752
127830
  assert(filepath, () => `illegal file path "${filepath}"`);
127753
127831
  let templates2 = yield liquid._parseLayoutFile(filepath, ctx.sync, this.currentFile);
127754
127832
  ctx.setRegister("blockMode", BlockMode.STORE);
127755
- let html = yield renderer.renderTemplates(this.templates, ctx), blocks2 = ctx.getRegister("blocks");
127833
+ let html = yield renderer.renderTemplates(this.templates, ctx), blocks2 = ctx.getRegister("blocks", {});
127756
127834
  blocks2[""] === void 0 && (blocks2[""] = (parent, emitter2) => emitter2.write(html)), ctx.setRegister("blockMode", BlockMode.OUTPUT), ctx.push(yield args.render(ctx)), yield renderer.renderTemplates(templates2, ctx, emitter), ctx.pop();
127757
127835
  }
127758
127836
  *children(partials) {
@@ -127783,11 +127861,14 @@ From ` + this.originalError.stack);
127783
127861
  }
127784
127862
  *render(ctx, emitter) {
127785
127863
  let blockRender = this.getBlockRender(ctx);
127786
- ctx.getRegister("blockMode") === BlockMode.STORE ? ctx.getRegister("blocks")[this.block] = blockRender : yield blockRender(new BlockDrop(), emitter);
127864
+ ctx.getRegister("blockMode") === BlockMode.STORE ? ctx.getRegister("blocks", {})[this.block] = blockRender : yield blockRender(new BlockDrop(), emitter);
127787
127865
  }
127788
127866
  getBlockRender(ctx) {
127789
- let { liquid, templates: templates2 } = this, renderChild = ctx.getRegister("blocks")[this.block], renderCurrent = function* (superBlock, emitter) {
127790
- ctx.push({ block: superBlock }), yield liquid.renderer.renderTemplates(templates2, ctx, emitter), ctx.pop();
127867
+ let self2 = this, { liquid, templates: templates2 } = this, renderChild = ctx.getRegister("blocks", {})[this.block], renderCurrent = function* (superBlock, emitter) {
127868
+ let stack = ctx.getRegister("blockStack", []);
127869
+ if (stack.includes(self2))
127870
+ throw new Error("block tag cannot be nested");
127871
+ stack.push(self2), ctx.push({ block: superBlock }), yield liquid.renderer.renderTemplates(templates2, ctx, emitter), ctx.pop(), stack.pop();
127791
127872
  };
127792
127873
  return renderChild ? (superBlock, emitter) => renderChild(new BlockDrop((emitter2) => renderCurrent(superBlock, emitter2)), emitter) : renderCurrent;
127793
127874
  }
@@ -127973,7 +128054,7 @@ From ` + this.originalError.stack);
127973
128054
  "#": InlineCommentTag
127974
128055
  }, Liquid2 = class _Liquid {
127975
128056
  constructor(opts = {}) {
127976
- this.renderer = new Render(), this.filters = {}, this.tags = {}, this.options = normalize(opts), this.parser = new Parser2(this), forOwn(tags, (conf, name) => this.registerTag(name, conf)), forOwn(filters, (handler, name) => this.registerFilter(name, handler));
128057
+ this.renderer = new Render(), this.filters = /* @__PURE__ */ Object.create(null), this.tags = /* @__PURE__ */ Object.create(null), this.options = normalize(opts), this.parser = new Parser2(this), forOwn(tags, (conf, name) => this.registerTag(name, conf)), forOwn(filters, (handler, name) => this.registerFilter(name, handler));
127977
128058
  }
127978
128059
  parse(html, filepath) {
127979
128060
  return new Parser2(this).parse(html, filepath);
@@ -128133,7 +128214,7 @@ From ` + this.originalError.stack);
128133
128214
  let analysis = analyzeSync(isString2(template) ? this.parse(template) : template, options);
128134
128215
  return Array.from(strictUniq(Object.values(analysis.globals).flatMap((a2) => a2.map((v) => v.toArray()))));
128135
128216
  }
128136
- }, version = "10.25.0";
128217
+ }, version = "10.26.0";
128137
128218
  exports.AssertionError = AssertionError;
128138
128219
  exports.AssignTag = AssignTag;
128139
128220
  exports.BlockTag = BlockTag;
@@ -193053,7 +193134,7 @@ function extractImportPathsRecursively(filePath, visited = /* @__PURE__ */ new S
193053
193134
  continue;
193054
193135
  throw error;
193055
193136
  }
193056
- return [...new Set(allImports)];
193137
+ return uniq(allImports);
193057
193138
  }
193058
193139
  function getImportScanningCacheStats() {
193059
193140
  return {
@@ -193088,7 +193169,7 @@ function extractJSLikeImports(content, filePath) {
193088
193169
  }
193089
193170
  }
193090
193171
  }
193091
- return [...new Set(imports)];
193172
+ return uniq(imports);
193092
193173
  }
193093
193174
  function extractRustImports(content, filePath) {
193094
193175
  let imports = [], modPattern = /^\s*(?:pub\s+)?mod\s+([a-z_][a-z0-9_]*)\s*;/gm, match2;
@@ -193107,7 +193188,7 @@ function extractRustImports(content, filePath) {
193107
193188
  cachedFileExists(resolvedPath) && imports.push(resolvedPath);
193108
193189
  }
193109
193190
  }
193110
- return [...new Set(imports)];
193191
+ return uniq(imports);
193111
193192
  }
193112
193193
  function resolveJSImport(importPath, fromFile) {
193113
193194
  let basePath = cachedFileExists(fromFile) && cachedIsDir(fromFile) ? fromFile : dirname(fromFile), resolvedPath = joinPath(basePath, importPath);
@@ -200334,7 +200415,7 @@ var rewriteConfiguration = (schema, config2) => {
200334
200415
  }
200335
200416
  });
200336
200417
  let blockedKeys = ["scopes"];
200337
- return Object.entries(confObj).filter(([key]) => !blockedKeys.includes(key)).sort(([key, _value]) => key.localeCompare(key)).forEach(([key, value]) => {
200418
+ return Object.entries(confObj).filter(([key]) => !blockedKeys.includes(key)).sort(([keyA], [keyB]) => keyA.localeCompare(keyB)).forEach(([key, value]) => {
200338
200419
  entries.map(([key2]) => key2).includes(key) || (result = { ...result, [key]: value });
200339
200420
  }), result;
200340
200421
  }
@@ -203731,16 +203812,16 @@ var import_core2 = __toESM(require_lib()), BaseCommand = class extends import_co
203731
203812
  }
203732
203813
  async catch(error) {
203733
203814
  error.skipOclifErrorHandling = !0;
203734
- let { errorHandler } = await import("./error-handler-KHJE653Z.js");
203815
+ let { errorHandler } = await import("./error-handler-YXGIUGKI.js");
203735
203816
  return await errorHandler(error, this.config), import_core2.Errors.handle(error);
203736
203817
  }
203737
203818
  async init() {
203738
203819
  if (this.exitWithTimestampWhenEnvVariablePresent(), setCurrentCommandId(this.id ?? ""), !isDevelopment()) {
203739
- let { registerCleanBugsnagErrorsFromWithinPlugins } = await import("./error-handler-KHJE653Z.js");
203820
+ let { registerCleanBugsnagErrorsFromWithinPlugins } = await import("./error-handler-YXGIUGKI.js");
203740
203821
  await registerCleanBugsnagErrorsFromWithinPlugins(this.config);
203741
203822
  }
203742
203823
  await removeDuplicatedPlugins(this.config), this.showNpmFlagWarning();
203743
- let { showNotificationsIfNeeded: showNotificationsIfNeeded2 } = await import("./notifications-system-7QMDSL5Y.js");
203824
+ let { showNotificationsIfNeeded: showNotificationsIfNeeded2 } = await import("./notifications-system-2HPAOE4P.js");
203744
203825
  return await showNotificationsIfNeeded2(), super.init();
203745
203826
  }
203746
203827
  // NPM creates an environment variable for every flag passed to a script.
@@ -203748,7 +203829,7 @@ var import_core2 = __toESM(require_lib()), BaseCommand = class extends import_co
203748
203829
  // and warns the user to use the `--` separator.
203749
203830
  showNpmFlagWarning() {
203750
203831
  let commandVariables = this.constructor;
203751
- Object.keys(commandVariables.flags || {}).map((key) => `npm_config_${underscore(key).replace(/^no_/, "")}`).some((flag) => process.env[flag] !== void 0) && import("./ui-2FROV2IT.js").then(({ renderWarning: renderWarning2 }) => {
203832
+ Object.keys(commandVariables.flags || {}).map((key) => `npm_config_${underscore(key).replace(/^no_/, "")}`).some((flag) => process.env[flag] !== void 0) && import("./ui-AYUE37Z3.js").then(({ renderWarning: renderWarning2 }) => {
203752
203833
  renderWarning2({
203753
203834
  body: [
203754
203835
  "NPM scripts require an extra",
@@ -203786,7 +203867,7 @@ This flag is required in non-interactive terminal environments, such as a CI env
203786
203867
  let flags = originalResult.flags, environmentsFileName = this.environmentsFilename();
203787
203868
  if (!environmentsFileName)
203788
203869
  return originalResult;
203789
- let { environmentFilePath } = await import("./environments-LTWWRWCC.js"), environmentFileExists = await environmentFilePath(environmentsFileName, { from: flags.path }), environments = [];
203870
+ let { environmentFilePath } = await import("./environments-VKYG7DMX.js"), environmentFileExists = await environmentFilePath(environmentsFileName, { from: flags.path }), environments = [];
203790
203871
  flags.environment && (environments = Array.isArray(flags.environment) ? flags.environment : [flags.environment]);
203791
203872
  let environmentSpecified = environments.length > 0;
203792
203873
  if (!environmentFileExists && !environmentSpecified || environmentSpecified && environments.length > 1)
@@ -203807,7 +203888,7 @@ This flag is required in non-interactive terminal environments, such as a CI env
203807
203888
  * is specified it will try to load a default environment.
203808
203889
  */
203809
203890
  async loadEnvironmentForCommand(path, environmentsFileName, specifiedEnvironment) {
203810
- let { loadEnvironment: loadEnvironment2 } = await import("./environments-LTWWRWCC.js");
203891
+ let { loadEnvironment: loadEnvironment2 } = await import("./environments-VKYG7DMX.js");
203811
203892
  return specifiedEnvironment ? { environment: await loadEnvironment2(specifiedEnvironment, environmentsFileName, { from: path }), isDefaultEnvironment: !1 } : { environment: await loadEnvironment2("default", environmentsFileName, { from: path, silent: !0 }), isDefaultEnvironment: !0 };
203812
203893
  }
203813
203894
  };
@@ -203831,7 +203912,7 @@ function reportEnvironmentApplication(noDefaultsFlags, flagsWithEnvironments, en
203831
203912
  if (Object.keys(changes).length === 0)
203832
203913
  return;
203833
203914
  let items = Object.entries(changes).map(([name, value]) => `${name}: ${value}`);
203834
- import("./ui-2FROV2IT.js").then(({ renderInfo: renderInfo2 }) => {
203915
+ import("./ui-AYUE37Z3.js").then(({ renderInfo: renderInfo2 }) => {
203835
203916
  renderInfo2({
203836
203917
  headline: ["Using applicable flags from", { userInput: environmentName }, "environment:"],
203837
203918
  body: [{ list: { items } }]
@@ -203868,7 +203949,7 @@ async function removeDuplicatedPlugins(config2) {
203868
203949
  let plugins = Array.from(config2.plugins.values()), bundlePlugins = ["@shopify/app", "@shopify/plugin-cloudflare"], pluginsToRemove = plugins.filter((plugin) => bundlePlugins.includes(plugin.name));
203869
203950
  if (pluginsToRemove.length > 0) {
203870
203951
  let commandsToRun = pluginsToRemove.map((plugin) => ` - shopify plugins remove ${plugin.name}`).join(`
203871
- `), { renderWarning: renderWarning2 } = await import("./ui-2FROV2IT.js");
203952
+ `), { renderWarning: renderWarning2 } = await import("./ui-AYUE37Z3.js");
203872
203953
  renderWarning2({
203873
203954
  headline: `Unsupported plugins detected: ${pluginsToRemove.map((plugin) => plugin.name).join(", ")}`,
203874
203955
  body: [
@@ -203904,13 +203985,13 @@ init_cjs_shims();
203904
203985
  init_cjs_shims();
203905
203986
  import { fileURLToPath as fileURLToPath2 } from "node:url";
203906
203987
  async function launchCLI(options) {
203907
- let { isDevelopment: isDevelopment2 } = await import("./local-NQALOHJX.js"), { ShopifyConfig } = await import("./custom-oclif-loader-354VAVF4.js"), oclifModule = await import("./lib-HWIFANCM.js"), { run, flush, Errors: Errors2, settings } = oclifModule.default ?? oclifModule;
203988
+ let { isDevelopment: isDevelopment2 } = await import("./local-6ARTMTVE.js"), { ShopifyConfig } = await import("./custom-oclif-loader-354VAVF4.js"), oclifModule = await import("./lib-HWIFANCM.js"), { run, flush, Errors: Errors2, settings } = oclifModule.default ?? oclifModule;
203908
203989
  isDevelopment2() && (settings.debug = !0);
203909
203990
  try {
203910
203991
  let config2 = new ShopifyConfig({ root: fileURLToPath2(options.moduleURL) });
203911
203992
  await config2.load(), options.lazyCommandLoader && config2.setLazyCommandLoader(options.lazyCommandLoader), await run(options.argv, config2), await flush();
203912
203993
  } catch (error) {
203913
- let { errorHandler } = await import("./error-handler-KHJE653Z.js");
203994
+ let { errorHandler } = await import("./error-handler-YXGIUGKI.js");
203914
203995
  return await errorHandler(error), Errors2.handle(error);
203915
203996
  }
203916
203997
  }
@@ -203920,7 +204001,7 @@ var import_core3 = __toESM(require_lib());
203920
204001
  async function exitIfOldNodeVersion(versions2 = process.versions) {
203921
204002
  let nodeVersion = versions2.node, nodeMajorVersion = Number(nodeVersion.split(".")[0]);
203922
204003
  if (nodeMajorVersion < 18) {
203923
- let { renderError: renderError2 } = await import("./ui-2FROV2IT.js");
204004
+ let { renderError: renderError2 } = await import("./ui-AYUE37Z3.js");
203924
204005
  renderError2({
203925
204006
  headline: "Upgrade to a supported Node version now.",
203926
204007
  body: [
@@ -203947,7 +204028,7 @@ async function runCLI(options, launchCLI2 = launchCLI, argv = process.argv, env
203947
204028
  return setupEnvironmentVariables(options, argv, env), options.runInCreateMode && await addInitToArgvWhenRunningCreateCLI(options, argv), forceNoColor(argv, env), await exitIfOldNodeVersion(versions2), launchCLI2({ moduleURL: options.moduleURL, lazyCommandLoader: options.lazyCommandLoader });
203948
204029
  }
203949
204030
  async function addInitToArgvWhenRunningCreateCLI(options, argv = process.argv) {
203950
- let { findUpAndReadPackageJson: findUpAndReadPackageJson2 } = await import("./node-package-manager-7R7HDW4R.js"), { moduleDirectory: moduleDirectory2 } = await import("./path-EOPO7QNL.js"), name = (await findUpAndReadPackageJson2(moduleDirectory2(options.moduleURL))).content.name.replace("@shopify/create-", "");
204031
+ let { findUpAndReadPackageJson: findUpAndReadPackageJson2 } = await import("./node-package-manager-Q3Y2FSRM.js"), { moduleDirectory: moduleDirectory2 } = await import("./path-EOPO7QNL.js"), name = (await findUpAndReadPackageJson2(moduleDirectory2(options.moduleURL))).content.name.replace("@shopify/create-", "");
203951
204032
  if (argv.findIndex((arg) => arg.includes("init")) === -1) {
203952
204033
  let initIndex2 = argv.findIndex((arg) => arg.match(new RegExp(`bin(\\/|\\\\)+(create-${name}|dev|run)`))) + 1;
203953
204034
  argv.splice(initIndex2, 0, "init");
@@ -213973,6 +214054,9 @@ async function ensureGitIsPresentOrAbort() {
213973
214054
  throw new AbortError("Git is necessary in the environment to continue", outputContent`Install ${outputToken.link("git", "https://git-scm.com/book/en/v2/Getting-Started-Installing-Git")}`);
213974
214055
  }
213975
214056
  async function insideGitDirectory(directory) {
214057
+ return await hasGit() ? checkIfInsideGitDirectory(directory) : !1;
214058
+ }
214059
+ async function checkIfInsideGitDirectory(directory) {
213976
214060
  try {
213977
214061
  return await execa("git", ["rev-parse", "--git-dir"], { cwd: directory }), !0;
213978
214062
  } catch (error) {
@@ -222100,13 +222184,6 @@ init_cjs_shims();
222100
222184
 
222101
222185
  // ../app/dist/cli/prompts/init/init.js
222102
222186
  init_cjs_shims();
222103
- function buildNoneTemplate() {
222104
- return {
222105
- url: isHostedAppsMode() ? "https://github.com/Shopify/shopify-app-template-extension-only" : "https://github.com/Shopify/shopify-app-template-none",
222106
- label: "Build an extension-only app",
222107
- visible: !0
222108
- };
222109
- }
222110
222187
  var templates = {
222111
222188
  reactRouter: {
222112
222189
  url: "https://github.com/Shopify/shopify-app-template-react-router",
@@ -222134,7 +222211,11 @@ var templates = {
222134
222211
  }
222135
222212
  }
222136
222213
  },
222137
- none: buildNoneTemplate(),
222214
+ none: {
222215
+ url: "https://github.com/Shopify/shopify-app-template-extension-only",
222216
+ label: "Build an extension-only app",
222217
+ visible: !0
222218
+ },
222138
222219
  node: {
222139
222220
  url: "https://github.com/Shopify/shopify-app-template-node",
222140
222221
  visible: !1
@@ -222312,22 +222393,35 @@ Use the`,
222312
222393
  await appendFile(npmrcPath, `@shopify:registry=https://registry.npmjs.org
222313
222394
  `);
222314
222395
  }
222396
+ });
222397
+ let outputDirectoryCreated = !1;
222398
+ tasks.push({
222399
+ title: "Preparing project directory",
222400
+ task: async () => {
222401
+ await ensureAppDirectoryIsAvailable(outputDirectory, hyphenizedName), outputDirectoryCreated = !0, await moveFile(templateScaffoldDir, outputDirectory);
222402
+ }
222315
222403
  }), tasks.push({
222316
222404
  title: `Installing dependencies with ${packageManager}`,
222317
222405
  task: async () => {
222318
- await getDeepInstallNPMTasks({ from: templateScaffoldDir, packageManager });
222406
+ await getDeepInstallNPMTasks({ from: outputDirectory, packageManager });
222319
222407
  }
222320
222408
  }, {
222321
222409
  title: "Cleaning up",
222322
222410
  task: async () => {
222323
- await cleanup(templateScaffoldDir, packageManager);
222411
+ await cleanup(outputDirectory, packageManager);
222324
222412
  }
222325
222413
  }, {
222326
222414
  title: "Initializing a Git repository...",
222327
222415
  task: async () => {
222328
- await initializeGitRepository(templateScaffoldDir);
222416
+ await initializeGitRepository(outputDirectory);
222329
222417
  }
222330
- }), await renderTasks(tasks), await ensureAppDirectoryIsAvailable(outputDirectory, hyphenizedName), await moveFile(templateScaffoldDir, outputDirectory);
222418
+ });
222419
+ try {
222420
+ await renderTasks(tasks);
222421
+ } catch (error) {
222422
+ throw outputDirectoryCreated && await rmdir(outputDirectory).catch(() => {
222423
+ }), error;
222424
+ }
222331
222425
  });
222332
222426
  let app;
222333
222427
  if (options.selectedAppOrNameResult.result === "new") {