@shopify/cli 3.85.1 → 3.85.2

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 (81) hide show
  1. package/dist/{chunk-KJT4XRJY.js → chunk-3GLPAOWG.js} +2 -2
  2. package/dist/{chunk-GGNBWCCE.js → chunk-3HB45LNC.js} +7 -7
  3. package/dist/{chunk-R7QUG5YH.js → chunk-3KWF52OH.js} +2 -2
  4. package/dist/{chunk-VCGC2OW6.js → chunk-5RQSFT35.js} +2 -2
  5. package/dist/{chunk-XNKJ52IR.js → chunk-63DVTKIC.js} +3 -3
  6. package/dist/{chunk-W54BTT4L.js → chunk-AQBAXHB6.js} +2 -2
  7. package/dist/{chunk-UYWDOH6Y.js → chunk-B2IMQTAS.js} +7 -7
  8. package/dist/{chunk-LOJKECKW.js → chunk-BBD57WPK.js} +2 -2
  9. package/dist/{chunk-CKYPRLQQ.js → chunk-BNANL2RF.js} +8 -8
  10. package/dist/{chunk-TVWMGUCW.js → chunk-CO5XRUNB.js} +3 -3
  11. package/dist/{chunk-CNY4KRKG.js → chunk-DHC7FUNN.js} +2 -2
  12. package/dist/{chunk-Y2JP6WFP.js → chunk-EG6MBBEN.js} +2 -2
  13. package/dist/{chunk-J3DHMVKN.js → chunk-ETGIQIBS.js} +2 -2
  14. package/dist/{chunk-Q64LTCDT.js → chunk-EUJBLPMW.js} +3 -3
  15. package/dist/{chunk-7N5JGLLX.js → chunk-FZGEJWCA.js} +5 -5
  16. package/dist/{chunk-TRKSH2XY.js → chunk-G6VSMPDS.js} +3 -3
  17. package/dist/{chunk-PYZUPEOA.js → chunk-GWSQTZJI.js} +3 -3
  18. package/dist/{chunk-62H2KYOJ.js → chunk-HJUBFP6H.js} +4 -4
  19. package/dist/{chunk-MHFD5A4P.js → chunk-IIFNATCS.js} +3 -3
  20. package/dist/{chunk-7LEPNDDJ.js → chunk-J3GJSEAX.js} +5 -5
  21. package/dist/{chunk-YJZEHV2H.js → chunk-JJTURC36.js} +6 -6
  22. package/dist/{chunk-S3MBABAK.js → chunk-K4MF722S.js} +6 -6
  23. package/dist/{chunk-FLHWGFGH.js → chunk-LYLEKYI6.js} +3 -3
  24. package/dist/{chunk-OXVB7GS3.js → chunk-MI76AMGA.js} +4 -4
  25. package/dist/{chunk-YIQ4GHA2.js → chunk-MU6B24WQ.js} +4 -4
  26. package/dist/{chunk-KIC7OBUL.js → chunk-NONJKAAK.js} +6 -6
  27. package/dist/{chunk-6YB46YWH.js → chunk-PCO7BTB2.js} +4 -4
  28. package/dist/{chunk-VMPHJR5V.js → chunk-PK2ZJN2D.js} +4 -4
  29. package/dist/{chunk-OXCV2R7K.js → chunk-QGFQPDQE.js} +4 -4
  30. package/dist/{chunk-7JE3EHN3.js → chunk-SJI2AT4E.js} +5 -5
  31. package/dist/{chunk-G6OERDCU.js → chunk-TPK3IOCE.js} +4 -4
  32. package/dist/{chunk-O47I6ERR.js → chunk-UWYW5CE4.js} +6 -6
  33. package/dist/{chunk-ZZACM6JY.js → chunk-YCRRJE3E.js} +3 -3
  34. package/dist/{chunk-JDI5KJ6D.js → chunk-YTHR7DHB.js} +3 -3
  35. package/dist/{chunk-XKHE52EY.js → chunk-YTNLVKDJ.js} +3 -3
  36. package/dist/cli/commands/auth/login.js +11 -11
  37. package/dist/cli/commands/auth/login.test.js +12 -12
  38. package/dist/cli/commands/auth/logout.js +11 -11
  39. package/dist/cli/commands/auth/logout.test.js +12 -12
  40. package/dist/cli/commands/cache/clear.js +11 -11
  41. package/dist/cli/commands/debug/command-flags.js +11 -11
  42. package/dist/cli/commands/docs/generate.js +11 -11
  43. package/dist/cli/commands/docs/generate.test.js +11 -11
  44. package/dist/cli/commands/help.js +11 -11
  45. package/dist/cli/commands/kitchen-sink/async.js +12 -12
  46. package/dist/cli/commands/kitchen-sink/async.test.js +12 -12
  47. package/dist/cli/commands/kitchen-sink/index.js +14 -14
  48. package/dist/cli/commands/kitchen-sink/index.test.js +14 -14
  49. package/dist/cli/commands/kitchen-sink/prompts.js +12 -12
  50. package/dist/cli/commands/kitchen-sink/prompts.test.js +12 -12
  51. package/dist/cli/commands/kitchen-sink/static.js +12 -12
  52. package/dist/cli/commands/kitchen-sink/static.test.js +12 -12
  53. package/dist/cli/commands/notifications/generate.js +12 -12
  54. package/dist/cli/commands/notifications/list.js +12 -12
  55. package/dist/cli/commands/search.js +12 -12
  56. package/dist/cli/commands/upgrade.js +12 -12
  57. package/dist/cli/commands/version.js +12 -12
  58. package/dist/cli/commands/version.test.js +12 -12
  59. package/dist/cli/services/commands/notifications.js +7 -7
  60. package/dist/cli/services/commands/search.js +3 -3
  61. package/dist/cli/services/commands/search.test.js +3 -3
  62. package/dist/cli/services/commands/version.js +4 -4
  63. package/dist/cli/services/commands/version.test.js +5 -5
  64. package/dist/cli/services/kitchen-sink/async.js +3 -3
  65. package/dist/cli/services/kitchen-sink/prompts.js +3 -3
  66. package/dist/cli/services/kitchen-sink/static.js +3 -3
  67. package/dist/cli/services/upgrade.js +4 -4
  68. package/dist/cli/services/upgrade.test.js +5 -5
  69. package/dist/{custom-oclif-loader-MVTJFCUD.js → custom-oclif-loader-MIHTOE44.js} +3 -3
  70. package/dist/{error-handler-OEZ5DBZB.js → error-handler-NTBLUSJY.js} +9 -9
  71. package/dist/hooks/postrun.js +7 -7
  72. package/dist/hooks/prerun.js +8 -8
  73. package/dist/index.js +228 -99
  74. package/dist/{local-72XWEFWL.js → local-JNP36HLV.js} +3 -3
  75. package/dist/{node-package-manager-TTBSTZXN.js → node-package-manager-EHYWEIML.js} +4 -4
  76. package/dist/{path-COZT77T2.js → path-GB4VIEM6.js} +2 -2
  77. package/dist/tsconfig.tsbuildinfo +1 -1
  78. package/dist/{ui-XUA267UA.js → ui-XVYQT3H5.js} +3 -3
  79. package/dist/{workerd-KJQYQH4A.js → workerd-X2PCOICQ.js} +12 -12
  80. package/oclif.manifest.json +1 -1
  81. package/package.json +7 -7
package/dist/index.js CHANGED
@@ -114,7 +114,7 @@ import {
114
114
  supressNodeExperimentalWarnings,
115
115
  unsetStorefront,
116
116
  waitForJob
117
- } from "./chunk-GGNBWCCE.js";
117
+ } from "./chunk-3HB45LNC.js";
118
118
  import {
119
119
  require_lib as require_lib6,
120
120
  require_semver as require_semver2
@@ -139,66 +139,66 @@ import {
139
139
  } from "./chunk-3GXB4ZRP.js";
140
140
  import {
141
141
  Generate
142
- } from "./chunk-TVWMGUCW.js";
142
+ } from "./chunk-CO5XRUNB.js";
143
143
  import {
144
144
  List
145
- } from "./chunk-OXVB7GS3.js";
146
- import "./chunk-7N5JGLLX.js";
145
+ } from "./chunk-MI76AMGA.js";
146
+ import "./chunk-FZGEJWCA.js";
147
147
  import {
148
148
  Search
149
- } from "./chunk-XKHE52EY.js";
150
- import "./chunk-LOJKECKW.js";
149
+ } from "./chunk-YTNLVKDJ.js";
150
+ import "./chunk-BBD57WPK.js";
151
151
  import {
152
152
  Upgrade
153
- } from "./chunk-6YB46YWH.js";
154
- import "./chunk-FLHWGFGH.js";
153
+ } from "./chunk-PCO7BTB2.js";
154
+ import "./chunk-LYLEKYI6.js";
155
155
  import {
156
156
  Version
157
- } from "./chunk-PYZUPEOA.js";
158
- import "./chunk-ZZACM6JY.js";
157
+ } from "./chunk-GWSQTZJI.js";
158
+ import "./chunk-YCRRJE3E.js";
159
159
  import {
160
160
  HelpCommand
161
- } from "./chunk-R7QUG5YH.js";
161
+ } from "./chunk-3KWF52OH.js";
162
162
  import {
163
163
  KitchenSinkAsync
164
- } from "./chunk-XNKJ52IR.js";
164
+ } from "./chunk-63DVTKIC.js";
165
165
  import {
166
166
  KitchenSinkAll
167
- } from "./chunk-7JE3EHN3.js";
168
- import "./chunk-W54BTT4L.js";
167
+ } from "./chunk-SJI2AT4E.js";
168
+ import "./chunk-AQBAXHB6.js";
169
169
  import {
170
170
  KitchenSinkPrompts
171
- } from "./chunk-JDI5KJ6D.js";
172
- import "./chunk-J3DHMVKN.js";
171
+ } from "./chunk-YTHR7DHB.js";
172
+ import "./chunk-ETGIQIBS.js";
173
173
  import {
174
174
  KitchenSinkStatic
175
- } from "./chunk-Q64LTCDT.js";
176
- import "./chunk-VCGC2OW6.js";
175
+ } from "./chunk-EUJBLPMW.js";
176
+ import "./chunk-5RQSFT35.js";
177
177
  import {
178
178
  Login
179
- } from "./chunk-7LEPNDDJ.js";
179
+ } from "./chunk-J3GJSEAX.js";
180
180
  import {
181
181
  Logout
182
- } from "./chunk-G6OERDCU.js";
182
+ } from "./chunk-TPK3IOCE.js";
183
183
  import {
184
184
  ClearCache,
185
185
  globalFlags,
186
186
  jsonFlag,
187
187
  runCLI
188
- } from "./chunk-UYWDOH6Y.js";
188
+ } from "./chunk-B2IMQTAS.js";
189
189
  import {
190
190
  CommandFlags
191
- } from "./chunk-TRKSH2XY.js";
191
+ } from "./chunk-G6VSMPDS.js";
192
192
  import {
193
193
  DocsGenerate
194
- } from "./chunk-YIQ4GHA2.js";
194
+ } from "./chunk-MU6B24WQ.js";
195
195
  import {
196
196
  base_command_default,
197
197
  decodeToml,
198
198
  encodeToml,
199
199
  loadEnvironment,
200
200
  noDefaultsOptions
201
- } from "./chunk-O47I6ERR.js";
201
+ } from "./chunk-UWYW5CE4.js";
202
202
  import {
203
203
  require_byline,
204
204
  require_end_of_stream,
@@ -206,7 +206,7 @@ import {
206
206
  require_iserror,
207
207
  require_pump,
208
208
  require_stack_generator
209
- } from "./chunk-CKYPRLQQ.js";
209
+ } from "./chunk-BNANL2RF.js";
210
210
  import {
211
211
  require_once
212
212
  } from "./chunk-SHWOPMLQ.js";
@@ -218,7 +218,7 @@ import {
218
218
  recordEvent,
219
219
  recordTiming,
220
220
  reportAnalyticsEvent
221
- } from "./chunk-S3MBABAK.js";
221
+ } from "./chunk-K4MF722S.js";
222
222
  import {
223
223
  DevServerCore,
224
224
  addCursorAndFiltersToAppLogsUrl,
@@ -264,10 +264,10 @@ import {
264
264
  serviceEnvironment,
265
265
  setNextDeprecationDate,
266
266
  setPathValue
267
- } from "./chunk-KIC7OBUL.js";
267
+ } from "./chunk-NONJKAAK.js";
268
268
  import {
269
269
  showNotificationsIfNeeded
270
- } from "./chunk-YJZEHV2H.js";
270
+ } from "./chunk-JJTURC36.js";
271
271
  import {
272
272
  ClientError,
273
273
  FetchError,
@@ -295,7 +295,7 @@ import {
295
295
  require_type,
296
296
  shopifyFetch,
297
297
  z
298
- } from "./chunk-62H2KYOJ.js";
298
+ } from "./chunk-HJUBFP6H.js";
299
299
  import "./chunk-25IMI7TH.js";
300
300
  import {
301
301
  LocalStorage,
@@ -320,10 +320,10 @@ import {
320
320
  usesWorkspaces,
321
321
  versionSatisfies,
322
322
  writePackageJSON
323
- } from "./chunk-OXCV2R7K.js";
323
+ } from "./chunk-QGFQPDQE.js";
324
324
  import {
325
325
  CLI_KIT_VERSION
326
- } from "./chunk-KJT4XRJY.js";
326
+ } from "./chunk-3GLPAOWG.js";
327
327
  import {
328
328
  AbortController as AbortController2,
329
329
  AbortError,
@@ -509,13 +509,14 @@ import {
509
509
  username,
510
510
  writeFile,
511
511
  writeFileSync
512
- } from "./chunk-MHFD5A4P.js";
512
+ } from "./chunk-IIFNATCS.js";
513
513
  import {
514
514
  require_ansis,
515
515
  require_commonjs,
516
516
  require_escape_string_regexp,
517
517
  require_lib,
518
- require_semver
518
+ require_semver,
519
+ require_typescript
519
520
  } from "./chunk-F7F4BQYW.js";
520
521
  import {
521
522
  require_ms,
@@ -546,7 +547,7 @@ import {
546
547
  relativizePath,
547
548
  resolvePath,
548
549
  sniffForJson
549
- } from "./chunk-Y2JP6WFP.js";
550
+ } from "./chunk-EG6MBBEN.js";
550
551
  import {
551
552
  __commonJS,
552
553
  __esm,
@@ -5054,7 +5055,7 @@ var require_main = __commonJS({
5054
5055
  t: () => t18
5055
5056
  });
5056
5057
  module.exports = __toCommonJS2(main_exports4);
5057
- var import_fs105 = __require("fs"), import_promises14 = __require("fs/promises");
5058
+ var import_fs106 = __require("fs"), import_promises14 = __require("fs/promises");
5058
5059
  async function readFileFromUri(uri) {
5059
5060
  if (uri.protocol === "file:")
5060
5061
  return await (0, import_promises14.readFile)(uri, "utf8");
@@ -5079,7 +5080,7 @@ var require_main = __commonJS({
5079
5080
  throw new Error("Unsupported protocol");
5080
5081
  }
5081
5082
  function readFileFromFsPath(fsPath) {
5082
- return (0, import_fs105.readFileSync)(fsPath, "utf8");
5083
+ return (0, import_fs106.readFileSync)(fsPath, "utf8");
5083
5084
  }
5084
5085
  var bundle;
5085
5086
  function config2(config22) {
@@ -35120,8 +35121,8 @@ var require_resolve_block_scalar = __commonJS({
35120
35121
  default: {
35121
35122
  let message = `Unexpected token in block scalar header: ${token.type}`;
35122
35123
  onError(token, "UNEXPECTED_TOKEN", message);
35123
- let ts = token.source;
35124
- ts && typeof ts == "string" && (length += ts.length);
35124
+ let ts2 = token.source;
35125
+ ts2 && typeof ts2 == "string" && (length += ts2.length);
35125
35126
  }
35126
35127
  }
35127
35128
  }
@@ -35358,7 +35359,7 @@ var require_compose_scalar = __commonJS({
35358
35359
  if (schema.compat) {
35359
35360
  let compat = schema.compat.find((tag2) => tag2.default && tag2.test?.test(value)) ?? schema[identity.SCALAR];
35360
35361
  if (tag.tag !== compat.tag) {
35361
- let ts = directives.tagString(tag.tag), cs = directives.tagString(compat.tag), msg = `Value may be parsed as either ${ts} or ${cs}`;
35362
+ let ts2 = directives.tagString(tag.tag), cs = directives.tagString(compat.tag), msg = `Value may be parsed as either ${ts2} or ${cs}`;
35362
35363
  onError(token, "TAG_RESOLVE_FAILED", msg, !0);
35363
35364
  }
35364
35365
  }
@@ -99341,12 +99342,12 @@ var require_stream_transform = __commonJS({
99341
99342
  util2.inherits = require_inherits();
99342
99343
  util2.inherits(Transform2, Duplex);
99343
99344
  function afterTransform(er, data) {
99344
- var ts = this._transformState;
99345
- ts.transforming = !1;
99346
- var cb = ts.writecb;
99345
+ var ts2 = this._transformState;
99346
+ ts2.transforming = !1;
99347
+ var cb = ts2.writecb;
99347
99348
  if (!cb)
99348
99349
  return this.emit("error", new Error("write callback called multiple times"));
99349
- ts.writechunk = null, ts.writecb = null, data != null && this.push(data), cb(er);
99350
+ ts2.writechunk = null, ts2.writecb = null, data != null && this.push(data), cb(er);
99350
99351
  var rs = this._readableState;
99351
99352
  rs.reading = !1, (rs.needReadable || rs.length < rs.highWaterMark) && this._read(rs.highWaterMark);
99352
99353
  }
@@ -99374,15 +99375,15 @@ var require_stream_transform = __commonJS({
99374
99375
  throw new Error("_transform() is not implemented");
99375
99376
  };
99376
99377
  Transform2.prototype._write = function(chunk, encoding, cb) {
99377
- var ts = this._transformState;
99378
- if (ts.writecb = cb, ts.writechunk = chunk, ts.writeencoding = encoding, !ts.transforming) {
99378
+ var ts2 = this._transformState;
99379
+ if (ts2.writecb = cb, ts2.writechunk = chunk, ts2.writeencoding = encoding, !ts2.transforming) {
99379
99380
  var rs = this._readableState;
99380
- (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) && this._read(rs.highWaterMark);
99381
+ (ts2.needTransform || rs.needReadable || rs.length < rs.highWaterMark) && this._read(rs.highWaterMark);
99381
99382
  }
99382
99383
  };
99383
99384
  Transform2.prototype._read = function(n) {
99384
- var ts = this._transformState;
99385
- ts.writechunk !== null && ts.writecb && !ts.transforming ? (ts.transforming = !0, this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform)) : ts.needTransform = !0;
99385
+ var ts2 = this._transformState;
99386
+ ts2.writechunk !== null && ts2.writecb && !ts2.transforming ? (ts2.transforming = !0, this._transform(ts2.writechunk, ts2.writeencoding, ts2.afterTransform)) : ts2.needTransform = !0;
99386
99387
  };
99387
99388
  Transform2.prototype._destroy = function(err2, cb) {
99388
99389
  var _this2 = this;
@@ -101958,12 +101959,12 @@ var require_stream_transform2 = __commonJS({
101958
101959
  var _require$codes = require_errors4().codes, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING, ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0, Duplex = require_stream_duplex2();
101959
101960
  require_inherits()(Transform2, Duplex);
101960
101961
  function afterTransform(er, data) {
101961
- var ts = this._transformState;
101962
- ts.transforming = !1;
101963
- var cb = ts.writecb;
101962
+ var ts2 = this._transformState;
101963
+ ts2.transforming = !1;
101964
+ var cb = ts2.writecb;
101964
101965
  if (cb === null)
101965
101966
  return this.emit("error", new ERR_MULTIPLE_CALLBACK());
101966
- ts.writechunk = null, ts.writecb = null, data != null && this.push(data), cb(er);
101967
+ ts2.writechunk = null, ts2.writecb = null, data != null && this.push(data), cb(er);
101967
101968
  var rs = this._readableState;
101968
101969
  rs.reading = !1, (rs.needReadable || rs.length < rs.highWaterMark) && this._read(rs.highWaterMark);
101969
101970
  }
@@ -101991,15 +101992,15 @@ var require_stream_transform2 = __commonJS({
101991
101992
  cb(new ERR_METHOD_NOT_IMPLEMENTED("_transform()"));
101992
101993
  };
101993
101994
  Transform2.prototype._write = function(chunk, encoding, cb) {
101994
- var ts = this._transformState;
101995
- if (ts.writecb = cb, ts.writechunk = chunk, ts.writeencoding = encoding, !ts.transforming) {
101995
+ var ts2 = this._transformState;
101996
+ if (ts2.writecb = cb, ts2.writechunk = chunk, ts2.writeencoding = encoding, !ts2.transforming) {
101996
101997
  var rs = this._readableState;
101997
- (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) && this._read(rs.highWaterMark);
101998
+ (ts2.needTransform || rs.needReadable || rs.length < rs.highWaterMark) && this._read(rs.highWaterMark);
101998
101999
  }
101999
102000
  };
102000
102001
  Transform2.prototype._read = function(n) {
102001
- var ts = this._transformState;
102002
- ts.writechunk !== null && !ts.transforming ? (ts.transforming = !0, this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform)) : ts.needTransform = !0;
102002
+ var ts2 = this._transformState;
102003
+ ts2.writechunk !== null && !ts2.transforming ? (ts2.transforming = !0, this._transform(ts2.writechunk, ts2.writeencoding, ts2.afterTransform)) : ts2.needTransform = !0;
102003
102004
  };
102004
102005
  Transform2.prototype._destroy = function(err2, cb) {
102005
102006
  Duplex.prototype._destroy.call(this, err2, function(err22) {
@@ -208609,7 +208610,7 @@ var import_core29 = __toESM(require_lib5(), 1);
208609
208610
  // ../../node_modules/.pnpm/@shopify+cli-hydrogen@11.1.3_@graphql-codegen+cli@5.0.4_@parcel+watcher@2.5.1_@types+no_c5825d46f8c022877c16d44d9004dd56/node_modules/@shopify/cli-hydrogen/dist/lib/mini-oxygen/index.js
208610
208611
  init_cjs_shims();
208611
208612
  async function startMiniOxygen(options) {
208612
- let { startWorkerdServer } = await import("./workerd-KJQYQH4A.js");
208613
+ let { startWorkerdServer } = await import("./workerd-X2PCOICQ.js");
208613
208614
  return startWorkerdServer(options);
208614
208615
  }
208615
208616
 
@@ -212593,6 +212594,129 @@ function arraySum(array) {
212593
212594
  // ../app/dist/cli/models/extensions/specifications/ui_extension.js
212594
212595
  init_cjs_shims();
212595
212596
 
212597
+ // ../app/dist/cli/models/extensions/specifications/type-generation.js
212598
+ init_cjs_shims();
212599
+ var import_typescript = __toESM(require_typescript(), 1);
212600
+ import { createRequire as createRequire4 } from "module";
212601
+ var require2 = createRequire4(import.meta.url);
212602
+ function parseApiVersion(apiVersion) {
212603
+ let [year, month] = apiVersion.split("-");
212604
+ return !year || !month ? null : { year: parseInt(year, 10), month: parseInt(month, 10) };
212605
+ }
212606
+ function loadTsConfig(startPath) {
212607
+ let configPath = import_typescript.default.findConfigFile(startPath, import_typescript.default.sys.fileExists.bind(import_typescript.default.sys), "tsconfig.json");
212608
+ if (!configPath)
212609
+ return { compilerOptions: {}, configPath: void 0 };
212610
+ let configFile = import_typescript.default.readConfigFile(configPath, import_typescript.default.sys.readFile.bind(import_typescript.default.sys));
212611
+ return configFile.error ? { compilerOptions: {}, configPath } : { compilerOptions: import_typescript.default.parseJsonConfigFileContent(configFile.config, import_typescript.default.sys, dirname(configPath)).options, configPath };
212612
+ }
212613
+ async function fallbackResolve(importPath, baseDir) {
212614
+ if (!importPath.startsWith("./") && !importPath.startsWith("../"))
212615
+ return null;
212616
+ let resolvedPath = resolvePath(baseDir, importPath), extensions = ["", ".js", ".jsx", ".ts", ".tsx"];
212617
+ for (let ext of extensions) {
212618
+ let pathWithExt = resolvedPath + ext;
212619
+ if (await fileExists(pathWithExt) && !pathWithExt.includes("node_modules"))
212620
+ return pathWithExt;
212621
+ }
212622
+ for (let ext of [".js", ".jsx", ".ts", ".tsx"]) {
212623
+ let indexPath = joinPath(resolvedPath, `index${ext}`);
212624
+ if (await fileExists(indexPath) && !indexPath.includes("node_modules"))
212625
+ return indexPath;
212626
+ }
212627
+ return null;
212628
+ }
212629
+ async function parseAndResolveImports(filePath) {
212630
+ try {
212631
+ let content = readFileSync(filePath).toString(), resolvedPaths = [], { compilerOptions } = loadTsConfig(filePath), scriptKind = import_typescript.default.ScriptKind.JSX;
212632
+ filePath.endsWith(".ts") ? scriptKind = import_typescript.default.ScriptKind.TS : filePath.endsWith(".tsx") && (scriptKind = import_typescript.default.ScriptKind.TSX);
212633
+ let sourceFile = import_typescript.default.createSourceFile(filePath, content, import_typescript.default.ScriptTarget.Latest, !0, scriptKind), processedImports = /* @__PURE__ */ new Set(), importPaths = [], visit3 = (node) => {
212634
+ if (import_typescript.default.isImportDeclaration(node) && node.moduleSpecifier && import_typescript.default.isStringLiteral(node.moduleSpecifier))
212635
+ importPaths.push(node.moduleSpecifier.text);
212636
+ else if (import_typescript.default.isCallExpression(node) && node.expression.kind === import_typescript.default.SyntaxKind.ImportKeyword) {
212637
+ let firstArg = node.arguments[0];
212638
+ firstArg && import_typescript.default.isStringLiteral(firstArg) && importPaths.push(firstArg.text);
212639
+ } else import_typescript.default.isExportDeclaration(node) && node.moduleSpecifier && import_typescript.default.isStringLiteral(node.moduleSpecifier) && importPaths.push(node.moduleSpecifier.text);
212640
+ import_typescript.default.forEachChild(node, visit3);
212641
+ };
212642
+ visit3(sourceFile);
212643
+ for (let importPath of importPaths) {
212644
+ if (!importPath || processedImports.has(importPath))
212645
+ continue;
212646
+ processedImports.add(importPath);
212647
+ let resolvedModule = import_typescript.default.resolveModuleName(importPath, filePath, compilerOptions, import_typescript.default.sys);
212648
+ if (resolvedModule.resolvedModule?.resolvedFileName) {
212649
+ let resolvedPath = resolvedModule.resolvedModule.resolvedFileName;
212650
+ resolvedPath.includes("node_modules") || resolvedPaths.push(resolvedPath);
212651
+ } else {
212652
+ let fallbackPath = await fallbackResolve(importPath, dirname(filePath));
212653
+ fallbackPath && resolvedPaths.push(fallbackPath);
212654
+ }
212655
+ }
212656
+ return resolvedPaths;
212657
+ } catch (error) {
212658
+ if (error instanceof AbortError)
212659
+ throw error;
212660
+ return [];
212661
+ }
212662
+ }
212663
+ async function findAllImportedFiles(filePath, visited = /* @__PURE__ */ new Set()) {
212664
+ if (visited.has(filePath))
212665
+ return [];
212666
+ visited.add(filePath);
212667
+ let resolvedPaths = await parseAndResolveImports(filePath), allFiles = [...resolvedPaths];
212668
+ for (let resolvedPath of resolvedPaths) {
212669
+ let nestedImports = await findAllImportedFiles(resolvedPath, visited);
212670
+ allFiles.push(...nestedImports);
212671
+ }
212672
+ return [...new Set(allFiles)];
212673
+ }
212674
+ function createTypeDefinition(fullPath, typeFilePath, targets, apiVersion) {
212675
+ try {
212676
+ for (let target of targets)
212677
+ try {
212678
+ require2.resolve(`@shopify/ui-extensions/${target}`, { paths: [fullPath, typeFilePath] });
212679
+ } catch {
212680
+ let { year, month } = parseApiVersion(apiVersion) ?? { year: 2025, month: 10 };
212681
+ throw new AbortError(`Type reference for ${target} could not be found. You might be using the wrong @shopify/ui-extensions version.`, `Fix the error by ensuring you have the correct version of @shopify/ui-extensions, for example ~${year}.${month}.0, in your dependencies.`);
212682
+ }
212683
+ let relativePath2 = relativizePath(fullPath, dirname(typeFilePath));
212684
+ if (targets.length === 1) {
212685
+ let target = targets[0] ?? "";
212686
+ return `//@ts-ignore
212687
+ declare module './${relativePath2}' {
212688
+ const shopify: import('@shopify/ui-extensions/${target}').Api;
212689
+ const globalThis: { shopify: typeof shopify };
212690
+ }
212691
+ `;
212692
+ } else if (targets.length > 1) {
212693
+ let unionType = targets.map((target) => ` import('@shopify/ui-extensions/${target}').Api`).join(` |
212694
+ `);
212695
+ return `//@ts-ignore
212696
+ declare module './${relativePath2}' {
212697
+ const shopify:
212698
+ ${unionType};
212699
+ const globalThis: { shopify: typeof shopify };
212700
+ }
212701
+ `;
212702
+ }
212703
+ return null;
212704
+ } catch (error) {
212705
+ if (error instanceof AbortError)
212706
+ throw error;
212707
+ let { year, month } = parseApiVersion(apiVersion) ?? { year: 2025, month: 10 };
212708
+ throw new AbortError("Type reference could not be found. You might be using the wrong @shopify/ui-extensions version.", `Fix the error by ensuring you have the correct version of @shopify/ui-extensions, for example ~${year}.${month}.0, in your dependencies.`);
212709
+ }
212710
+ }
212711
+ async function findNearestTsConfigDir(fromFile, extensionDirectory) {
212712
+ let fromDirectory = dirname(fromFile), tsconfigPath = await findPathUp("tsconfig.json", { cwd: fromDirectory, type: "file" });
212713
+ if (tsconfigPath) {
212714
+ let normalizedTsconfigPath = resolvePath(tsconfigPath), normalizedExtensionDirectory = resolvePath(extensionDirectory);
212715
+ if (normalizedTsconfigPath.startsWith(normalizedExtensionDirectory))
212716
+ return dirname(tsconfigPath);
212717
+ }
212718
+ }
212719
+
212596
212720
  // ../app/dist/cli/services/dev/extension/utilities.js
212597
212721
  init_cjs_shims();
212598
212722
 
@@ -212654,8 +212778,7 @@ function getExtensionPointTargetSurface(extensionPointTarget) {
212654
212778
  }
212655
212779
 
212656
212780
  // ../app/dist/cli/models/extensions/specifications/ui_extension.js
212657
- import { createRequire as createRequire4 } from "module";
212658
- var require2 = createRequire4(import.meta.url), dependency5 = "@shopify/checkout-ui-extensions", validatePoints = (config2) => config2.extension_points !== void 0 || config2.targeting !== void 0, missingExtensionPointsMessage = "No extension targets defined, add a `targeting` field to your configuration", UIExtensionSchema = BaseSchema.extend({
212781
+ var dependency5 = "@shopify/checkout-ui-extensions", validatePoints = (config2) => config2.extension_points !== void 0 || config2.targeting !== void 0, missingExtensionPointsMessage = "No extension targets defined, add a `targeting` field to your configuration", UIExtensionSchema = BaseSchema.extend({
212659
212782
  name: z.string(),
212660
212783
  type: z.literal("ui_extension"),
212661
212784
  extension_points: NewExtensionPointsSchema.optional(),
@@ -212733,30 +212856,56 @@ var require2 = createRequire4(import.meta.url), dependency5 = "@shopify/checkout
212733
212856
  contributeToSharedTypeFile: async (extension, typeDefinitionsByFile) => {
212734
212857
  if (!isRemoteDomExtension(extension.configuration))
212735
212858
  return;
212736
- let { configuration } = extension;
212859
+ let { configuration } = extension, fileToTargetsMap = /* @__PURE__ */ new Map();
212737
212860
  for await (let extensionPoint of configuration.extension_points) {
212738
212861
  let fullPath = joinPath(extension.directory, extensionPoint.module);
212739
212862
  if (!await fileExists(fullPath))
212740
212863
  continue;
212741
- let mainTsConfigDir = await findNearestTsConfigDir(fullPath, extension.directory);
212742
- if (!mainTsConfigDir)
212864
+ let currentTargets = fileToTargetsMap.get(fullPath) ?? [];
212865
+ if (currentTargets.push(extensionPoint.target), fileToTargetsMap.set(fullPath, currentTargets), extensionPoint.build_manifest.assets[AssetIdentifier.ShouldRender]?.module) {
212866
+ let shouldRenderPath = joinPath(extension.directory, extensionPoint.build_manifest.assets[AssetIdentifier.ShouldRender].module);
212867
+ if (await fileExists(shouldRenderPath)) {
212868
+ let shouldRenderTargets = fileToTargetsMap.get(shouldRenderPath) ?? [];
212869
+ shouldRenderTargets.push(getShouldRenderTarget(extensionPoint.target)), fileToTargetsMap.set(shouldRenderPath, shouldRenderTargets);
212870
+ }
212871
+ }
212872
+ }
212873
+ for await (let extensionPoint of configuration.extension_points) {
212874
+ let fullPath = joinPath(extension.directory, extensionPoint.module);
212875
+ if (!await fileExists(fullPath))
212743
212876
  continue;
212744
- let mainTypeFilePath = joinPath(mainTsConfigDir, "shopify.d.ts"), mainTypes = getSharedTypeDefinition(fullPath, mainTypeFilePath, extensionPoint.target, configuration.api_version);
212745
- if (mainTypes) {
212746
- let currentTypes = typeDefinitionsByFile.get(mainTypeFilePath) ?? /* @__PURE__ */ new Set();
212747
- currentTypes.add(mainTypes), typeDefinitionsByFile.set(mainTypeFilePath, currentTypes);
212877
+ let importedFiles = await findAllImportedFiles(fullPath);
212878
+ for (let importedFile of importedFiles) {
212879
+ let currentTargets = fileToTargetsMap.get(importedFile) ?? [];
212880
+ currentTargets.push(extensionPoint.target), fileToTargetsMap.set(importedFile, currentTargets);
212748
212881
  }
212749
212882
  if (extensionPoint.build_manifest.assets[AssetIdentifier.ShouldRender]?.module) {
212750
- let shouldRenderTsConfigDir = await findNearestTsConfigDir(joinPath(extension.directory, extensionPoint.build_manifest.assets[AssetIdentifier.ShouldRender].module), extension.directory);
212751
- if (!shouldRenderTsConfigDir)
212752
- continue;
212753
- let shouldRenderTypeFilePath = joinPath(shouldRenderTsConfigDir, "shopify.d.ts"), shouldRenderTypes = getSharedTypeDefinition(joinPath(extension.directory, extensionPoint.build_manifest.assets[AssetIdentifier.ShouldRender].module), shouldRenderTypeFilePath, getShouldRenderTarget(extensionPoint.target), configuration.api_version);
212754
- if (shouldRenderTypes) {
212755
- let currentTypes = typeDefinitionsByFile.get(shouldRenderTypeFilePath) ?? /* @__PURE__ */ new Set();
212756
- currentTypes.add(shouldRenderTypes), typeDefinitionsByFile.set(shouldRenderTypeFilePath, currentTypes);
212883
+ let shouldRenderPath = joinPath(extension.directory, extensionPoint.build_manifest.assets[AssetIdentifier.ShouldRender].module);
212884
+ if (await fileExists(shouldRenderPath)) {
212885
+ let shouldRenderImports = await findAllImportedFiles(shouldRenderPath);
212886
+ for (let importedFile of shouldRenderImports) {
212887
+ let currentTargets = fileToTargetsMap.get(importedFile) ?? [];
212888
+ currentTargets.push(getShouldRenderTarget(extensionPoint.target)), fileToTargetsMap.set(importedFile, currentTargets);
212889
+ }
212757
212890
  }
212758
212891
  }
212759
212892
  }
212893
+ for await (let [filePath, targets] of fileToTargetsMap.entries()) {
212894
+ let tsConfigDir = await findNearestTsConfigDir(filePath, extension.directory);
212895
+ if (!tsConfigDir)
212896
+ continue;
212897
+ let typeFilePath = joinPath(tsConfigDir, "shopify.d.ts"), uniqueTargets = [...new Set(targets)];
212898
+ try {
212899
+ let typeDefinition = createTypeDefinition(filePath, typeFilePath, uniqueTargets, configuration.api_version);
212900
+ if (typeDefinition) {
212901
+ let currentTypes = typeDefinitionsByFile.get(typeFilePath) ?? /* @__PURE__ */ new Set();
212902
+ currentTypes.add(typeDefinition), typeDefinitionsByFile.set(typeFilePath, currentTypes);
212903
+ }
212904
+ } catch (error) {
212905
+ if (configuration.extension_points.some((ep) => joinPath(extension.directory, ep.module) === filePath || ep.build_manifest.assets[AssetIdentifier.ShouldRender]?.module && joinPath(extension.directory, ep.build_manifest.assets[AssetIdentifier.ShouldRender].module) === filePath))
212906
+ throw error;
212907
+ }
212908
+ }
212760
212909
  }
212761
212910
  });
212762
212911
  function addDistPathToAssets(extP) {
@@ -212793,35 +212942,15 @@ Extension point targets must be unique`), errors.length ? (errors.push(`Please c
212793
212942
  `))) : ok({});
212794
212943
  }
212795
212944
  function isRemoteDomExtension(config2) {
212796
- let apiVersion = config2.api_version, [year, month] = apiVersion?.split("-").map((part) => parseInt(part, 10)) ?? [];
212797
- return !year || !month ? !1 : year > 2025 || year === 2025 && month >= 10;
212945
+ let apiVersion = config2.api_version;
212946
+ if (!apiVersion)
212947
+ return !1;
212948
+ let { year, month } = parseApiVersion(apiVersion) ?? { year: 0, month: 0 };
212949
+ return year > 2025 || year === 2025 && month >= 10;
212798
212950
  }
212799
212951
  function getShouldRenderTarget(target) {
212800
212952
  return target.replace(/\.render$/, ".should-render");
212801
212953
  }
212802
- function convertApiVersionToSemver(apiVersion) {
212803
- let [year, month] = apiVersion.split("-");
212804
- if (!year || !month)
212805
- throw new AbortError("Invalid API version format. Expected format: YYYY-MM");
212806
- return `${year}.${month}.0`;
212807
- }
212808
- function getSharedTypeDefinition(fullPath, typeFilePath, target, apiVersion) {
212809
- try {
212810
- return require2.resolve(`@shopify/ui-extensions/${target}`, { paths: [fullPath, typeFilePath] }), `//@ts-ignore
212811
- declare module './${relativizePath(fullPath, dirname(typeFilePath))}' {
212812
- const shopify: import('@shopify/ui-extensions/${target}').Api;
212813
- const globalThis: { shopify: typeof shopify };
212814
- }
212815
- `;
212816
- } catch {
212817
- throw new AbortError(`Type reference for ${target} could not be found. You might be using the wrong @shopify/ui-extensions version.`, `Fix the error by ensuring you have the correct version of @shopify/ui-extensions, for example ${convertApiVersionToSemver(apiVersion)}, in your dependencies.`);
212818
- }
212819
- }
212820
- async function findNearestTsConfigDir(fromFile, extensionDirectory) {
212821
- let fromDirectory = dirname(fromFile), tsconfigPath = await findPathUp("tsconfig.json", { cwd: fromDirectory, type: "file", stopAt: extensionDirectory });
212822
- if (tsconfigPath)
212823
- return dirname(tsconfigPath);
212824
- }
212825
212954
  var ui_extension_default = uiExtensionSpec;
212826
212955
 
212827
212956
  // ../app/dist/cli/models/extensions/specifications/web_pixel_extension.js
@@ -20,7 +20,7 @@ import {
20
20
  macAddress,
21
21
  opentelemetryDomain,
22
22
  themeToken
23
- } from "./chunk-MHFD5A4P.js";
23
+ } from "./chunk-IIFNATCS.js";
24
24
  import "./chunk-F7F4BQYW.js";
25
25
  import "./chunk-UMUTXITN.js";
26
26
  import "./chunk-UATXMR5F.js";
@@ -29,7 +29,7 @@ import "./chunk-G2ZZKGSV.js";
29
29
  import "./chunk-75LV6AQS.js";
30
30
  import "./chunk-UV5N2VL7.js";
31
31
  import "./chunk-XE5EOEBL.js";
32
- import "./chunk-Y2JP6WFP.js";
32
+ import "./chunk-EG6MBBEN.js";
33
33
  import "./chunk-PKR7KJ6P.js";
34
34
  export {
35
35
  alwaysLogAnalytics,
@@ -54,4 +54,4 @@ export {
54
54
  opentelemetryDomain,
55
55
  themeToken
56
56
  };
57
- //# sourceMappingURL=local-72XWEFWL.js.map
57
+ //# sourceMappingURL=local-JNP36HLV.js.map
@@ -29,8 +29,8 @@ import {
29
29
  versionSatisfies,
30
30
  writePackageJSON,
31
31
  yarnLockfile
32
- } from "./chunk-OXCV2R7K.js";
33
- import "./chunk-MHFD5A4P.js";
32
+ } from "./chunk-QGFQPDQE.js";
33
+ import "./chunk-IIFNATCS.js";
34
34
  import "./chunk-F7F4BQYW.js";
35
35
  import "./chunk-UMUTXITN.js";
36
36
  import "./chunk-UATXMR5F.js";
@@ -39,7 +39,7 @@ import "./chunk-G2ZZKGSV.js";
39
39
  import "./chunk-75LV6AQS.js";
40
40
  import "./chunk-UV5N2VL7.js";
41
41
  import "./chunk-XE5EOEBL.js";
42
- import "./chunk-Y2JP6WFP.js";
42
+ import "./chunk-EG6MBBEN.js";
43
43
  import "./chunk-PKR7KJ6P.js";
44
44
  export {
45
45
  FindUpAndReadPackageJsonNotFoundError,
@@ -73,4 +73,4 @@ export {
73
73
  writePackageJSON,
74
74
  yarnLockfile
75
75
  };
76
- //# sourceMappingURL=node-package-manager-TTBSTZXN.js.map
76
+ //# sourceMappingURL=node-package-manager-EHYWEIML.js.map
@@ -13,7 +13,7 @@ import {
13
13
  resolvePath,
14
14
  sniffForJson,
15
15
  sniffForPath
16
- } from "./chunk-Y2JP6WFP.js";
16
+ } from "./chunk-EG6MBBEN.js";
17
17
  import "./chunk-PKR7KJ6P.js";
18
18
  export {
19
19
  basename,
@@ -31,4 +31,4 @@ export {
31
31
  sniffForJson,
32
32
  sniffForPath
33
33
  };
34
- //# sourceMappingURL=path-COZT77T2.js.map
34
+ //# sourceMappingURL=path-GB4VIEM6.js.map