@shopify/cli 3.80.0 → 3.80.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/dist/{chunk-AZ6Y4YZT.js → chunk-2SENSD2I.js} +4 -4
  2. package/dist/{chunk-PCSYEXIP.js → chunk-4N62VJCW.js} +6 -6
  3. package/dist/{chunk-YPF3IQMR.js → chunk-4O7JN5N7.js} +2 -2
  4. package/dist/{chunk-TC3YYLZY.js → chunk-5EUF2EDL.js} +3 -3
  5. package/dist/{chunk-BUJJ6TMB.js → chunk-6SM3SPO2.js} +3 -3
  6. package/dist/{chunk-REH3UHFP.js → chunk-6ZDFI7RQ.js} +2 -2
  7. package/dist/{chunk-IDQNIJ3J.js → chunk-7ABG3SAU.js} +4 -4
  8. package/dist/{chunk-NWFRDDT5.js → chunk-7RVTZY4V.js} +17 -5
  9. package/dist/{chunk-NRK4JPTC.js → chunk-AA6YHL4H.js} +4 -4
  10. package/dist/{chunk-VR4MPAR3.js → chunk-BJKFVTUU.js} +4 -4
  11. package/dist/{chunk-JSVOLQ6E.js → chunk-CC5JTJRC.js} +6 -6
  12. package/dist/{chunk-R3CVGGX7.js → chunk-CIGCMM7Y.js} +2 -2
  13. package/dist/{chunk-GFHULNRP.js → chunk-GXYYUJCZ.js} +7 -7
  14. package/dist/{chunk-H352PF4V.js → chunk-JEZFZHJT.js} +19 -50
  15. package/dist/{chunk-JH7IS4YF.js → chunk-JTTPS2WH.js} +2 -2
  16. package/dist/{chunk-2YZW7TJK.js → chunk-MGQUMYJJ.js} +3 -3
  17. package/dist/{chunk-37WBE3RC.js → chunk-MK43HXRP.js} +3 -3
  18. package/dist/{chunk-OGBA25HE.js → chunk-MRSGUMFQ.js} +3 -3
  19. package/dist/{chunk-AO63XITX.js → chunk-MUBX4Z7T.js} +2 -2
  20. package/dist/{chunk-GTREEQHM.js → chunk-O47Y2LR2.js} +5 -5
  21. package/dist/{chunk-SUFYMVTC.js → chunk-OEN366HT.js} +2 -2
  22. package/dist/{chunk-3MQT2ETC.js → chunk-OV2WT25T.js} +4 -4
  23. package/dist/{chunk-G4BLVBQD.js → chunk-PLPRXDTH.js} +4 -4
  24. package/dist/{chunk-MWIL24VU.js → chunk-RA6X53DS.js} +3 -3
  25. package/dist/{chunk-6LR4FWOA.js → chunk-SA6W52ZM.js} +4 -4
  26. package/dist/{chunk-GD4RPFTP.js → chunk-TV7RQJQS.js} +4 -4
  27. package/dist/{chunk-F43GEFQ6.js → chunk-TZT6MG73.js} +3 -3
  28. package/dist/{chunk-7H74TBA2.js → chunk-UNLDWBJ7.js} +3 -3
  29. package/dist/{chunk-PAKKG4IK.js → chunk-UWQ5RHX4.js} +7 -7
  30. package/dist/{chunk-S5NF3A56.js → chunk-WGIJUWK3.js} +3 -3
  31. package/dist/{chunk-XZ7LRLSW.js → chunk-WUIY4ZKO.js} +6 -6
  32. package/dist/{chunk-MMX2XAE3.js → chunk-YWMIXHIW.js} +5 -5
  33. package/dist/{chunk-XYKT7ZUU.js → chunk-Z4MGMNXM.js} +2 -2
  34. package/dist/{chunk-57Q6OQG4.js → chunk-ZUCWDIGE.js} +2 -2
  35. package/dist/{chunk-EDUZEBZD.js → chunk-ZXBYB5U7.js} +4 -4
  36. package/dist/cli/commands/auth/logout.js +12 -12
  37. package/dist/cli/commands/auth/logout.test.js +13 -13
  38. package/dist/cli/commands/cache/clear.js +11 -11
  39. package/dist/cli/commands/debug/command-flags.js +11 -11
  40. package/dist/cli/commands/docs/generate.js +11 -11
  41. package/dist/cli/commands/docs/generate.test.js +11 -11
  42. package/dist/cli/commands/help.js +11 -11
  43. package/dist/cli/commands/kitchen-sink/async.js +12 -12
  44. package/dist/cli/commands/kitchen-sink/async.test.js +12 -12
  45. package/dist/cli/commands/kitchen-sink/index.js +14 -14
  46. package/dist/cli/commands/kitchen-sink/index.test.js +14 -14
  47. package/dist/cli/commands/kitchen-sink/prompts.js +12 -12
  48. package/dist/cli/commands/kitchen-sink/prompts.test.js +12 -12
  49. package/dist/cli/commands/kitchen-sink/static.js +12 -12
  50. package/dist/cli/commands/kitchen-sink/static.test.js +12 -12
  51. package/dist/cli/commands/notifications/generate.js +12 -12
  52. package/dist/cli/commands/notifications/list.js +12 -12
  53. package/dist/cli/commands/search.js +12 -12
  54. package/dist/cli/commands/upgrade.js +12 -12
  55. package/dist/cli/commands/version.js +12 -12
  56. package/dist/cli/commands/version.test.js +12 -12
  57. package/dist/cli/services/commands/notifications.js +7 -7
  58. package/dist/cli/services/commands/search.js +3 -3
  59. package/dist/cli/services/commands/search.test.js +3 -3
  60. package/dist/cli/services/commands/version.js +4 -4
  61. package/dist/cli/services/commands/version.test.js +5 -5
  62. package/dist/cli/services/kitchen-sink/async.js +3 -3
  63. package/dist/cli/services/kitchen-sink/prompts.js +3 -3
  64. package/dist/cli/services/kitchen-sink/static.js +3 -3
  65. package/dist/cli/services/upgrade.js +4 -4
  66. package/dist/cli/services/upgrade.test.js +5 -5
  67. package/dist/{custom-oclif-loader-HQIYD7VA.js → custom-oclif-loader-FXIJAWX7.js} +3 -3
  68. package/dist/{error-handler-BQ3ZQYX7.js → error-handler-EDZQQPRP.js} +9 -9
  69. package/dist/hooks/postrun.js +7 -7
  70. package/dist/hooks/prerun.js +8 -8
  71. package/dist/index.js +117 -106
  72. package/dist/{local-F5VFMUS5.js → local-7RAANNJV.js} +3 -3
  73. package/dist/{node-NS4BEHX4.js → node-UQTVOAV2.js} +13 -13
  74. package/dist/{node-package-manager-XTTAGATX.js → node-package-manager-EM4XDXO6.js} +4 -4
  75. package/dist/{path-2K5HIMHZ.js → path-GWAZZN2N.js} +2 -2
  76. package/dist/tsconfig.tsbuildinfo +1 -1
  77. package/dist/{ui-A4PGXQX4.js → ui-OHY6IY4A.js} +3 -3
  78. package/dist/{workerd-WQC6GRYP.js → workerd-UWTQ4ECK.js} +13 -13
  79. package/oclif.manifest.json +1 -1
  80. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -136,7 +136,7 @@ import {
136
136
  supressNodeExperimentalWarnings,
137
137
  unsetStorefront,
138
138
  waitForJob
139
- } from "./chunk-H352PF4V.js";
139
+ } from "./chunk-JEZFZHJT.js";
140
140
  import {
141
141
  require_ms,
142
142
  require_src
@@ -155,69 +155,69 @@ import {
155
155
  } from "./chunk-3GXB4ZRP.js";
156
156
  import {
157
157
  List
158
- } from "./chunk-IDQNIJ3J.js";
158
+ } from "./chunk-7ABG3SAU.js";
159
159
  import {
160
160
  Search
161
- } from "./chunk-BUJJ6TMB.js";
161
+ } from "./chunk-6SM3SPO2.js";
162
162
  import {
163
163
  Upgrade
164
- } from "./chunk-GD4RPFTP.js";
165
- import "./chunk-2YZW7TJK.js";
164
+ } from "./chunk-TV7RQJQS.js";
165
+ import "./chunk-MGQUMYJJ.js";
166
166
  import {
167
167
  Version
168
- } from "./chunk-MWIL24VU.js";
169
- import "./chunk-7H74TBA2.js";
170
- import "./chunk-R3CVGGX7.js";
168
+ } from "./chunk-RA6X53DS.js";
169
+ import "./chunk-UNLDWBJ7.js";
170
+ import "./chunk-CIGCMM7Y.js";
171
171
  import {
172
172
  KitchenSinkAll
173
- } from "./chunk-GTREEQHM.js";
173
+ } from "./chunk-O47Y2LR2.js";
174
174
  import {
175
175
  KitchenSinkPrompts
176
- } from "./chunk-37WBE3RC.js";
177
- import "./chunk-REH3UHFP.js";
176
+ } from "./chunk-MK43HXRP.js";
177
+ import "./chunk-6ZDFI7RQ.js";
178
178
  import {
179
179
  KitchenSinkStatic
180
- } from "./chunk-F43GEFQ6.js";
181
- import "./chunk-YPF3IQMR.js";
180
+ } from "./chunk-TZT6MG73.js";
181
+ import "./chunk-4O7JN5N7.js";
182
182
  import {
183
183
  Generate
184
- } from "./chunk-S5NF3A56.js";
185
- import "./chunk-MMX2XAE3.js";
184
+ } from "./chunk-WGIJUWK3.js";
185
+ import "./chunk-YWMIXHIW.js";
186
186
  import {
187
187
  Logout
188
- } from "./chunk-EDUZEBZD.js";
188
+ } from "./chunk-ZXBYB5U7.js";
189
189
  import {
190
190
  ensureAuthenticatedAdmin,
191
191
  ensureAuthenticatedAppManagementAndBusinessPlatform,
192
192
  ensureAuthenticatedPartners,
193
193
  ensureAuthenticatedStorefront,
194
194
  ensureAuthenticatedThemes
195
- } from "./chunk-3MQT2ETC.js";
195
+ } from "./chunk-OV2WT25T.js";
196
196
  import {
197
197
  ClearCache,
198
198
  globalFlags,
199
199
  jsonFlag,
200
200
  runCLI
201
- } from "./chunk-GFHULNRP.js";
201
+ } from "./chunk-GXYYUJCZ.js";
202
202
  import {
203
203
  CommandFlags
204
- } from "./chunk-TC3YYLZY.js";
204
+ } from "./chunk-5EUF2EDL.js";
205
205
  import {
206
206
  DocsGenerate
207
- } from "./chunk-VR4MPAR3.js";
207
+ } from "./chunk-BJKFVTUU.js";
208
208
  import {
209
209
  HelpCommand
210
- } from "./chunk-AO63XITX.js";
210
+ } from "./chunk-MUBX4Z7T.js";
211
211
  import {
212
212
  KitchenSinkAsync
213
- } from "./chunk-OGBA25HE.js";
214
- import "./chunk-JH7IS4YF.js";
213
+ } from "./chunk-MRSGUMFQ.js";
214
+ import "./chunk-JTTPS2WH.js";
215
215
  import {
216
216
  base_command_default,
217
217
  decodeToml,
218
218
  encodeToml,
219
219
  loadEnvironment
220
- } from "./chunk-XZ7LRLSW.js";
220
+ } from "./chunk-WUIY4ZKO.js";
221
221
  import {
222
222
  require_byline,
223
223
  require_end_of_stream,
@@ -225,7 +225,7 @@ import {
225
225
  require_iserror,
226
226
  require_pump,
227
227
  require_stack_generator
228
- } from "./chunk-PAKKG4IK.js";
228
+ } from "./chunk-UWQ5RHX4.js";
229
229
  import {
230
230
  require_once
231
231
  } from "./chunk-SHWOPMLQ.js";
@@ -233,8 +233,9 @@ import {
233
233
  fanoutHooks,
234
234
  getListOfTunnelPlugins,
235
235
  reportAnalyticsEvent
236
- } from "./chunk-PCSYEXIP.js";
236
+ } from "./chunk-4N62VJCW.js";
237
237
  import {
238
+ adminFqdn,
238
239
  appDevFqdn,
239
240
  appManagementFqdn,
240
241
  developerDashboardFqdn,
@@ -243,10 +244,10 @@ import {
243
244
  normalizeStoreFqdn,
244
245
  ok,
245
246
  partnersFqdn
246
- } from "./chunk-NWFRDDT5.js";
247
+ } from "./chunk-7RVTZY4V.js";
247
248
  import {
248
249
  showNotificationsIfNeeded
249
- } from "./chunk-JSVOLQ6E.js";
250
+ } from "./chunk-CC5JTJRC.js";
250
251
  import {
251
252
  ClientError,
252
253
  FetchError,
@@ -268,11 +269,11 @@ import {
268
269
  require_mime_types,
269
270
  shopifyFetch,
270
271
  z as z2
271
- } from "./chunk-NRK4JPTC.js";
272
+ } from "./chunk-AA6YHL4H.js";
272
273
  import "./chunk-25IMI7TH.js";
273
274
  import {
274
275
  CLI_KIT_VERSION
275
- } from "./chunk-SUFYMVTC.js";
276
+ } from "./chunk-OEN366HT.js";
276
277
  import {
277
278
  LocalStorage,
278
279
  UnknownPackageManagerError,
@@ -296,7 +297,7 @@ import {
296
297
  usesWorkspaces,
297
298
  versionSatisfies,
298
299
  writePackageJSON
299
- } from "./chunk-6LR4FWOA.js";
300
+ } from "./chunk-SA6W52ZM.js";
300
301
  import {
301
302
  AbortController as AbortController2,
302
303
  AbortError,
@@ -510,7 +511,7 @@ import {
510
511
  username,
511
512
  writeFile,
512
513
  writeFileSync
513
- } from "./chunk-AZ6Y4YZT.js";
514
+ } from "./chunk-2SENSD2I.js";
514
515
  import {
515
516
  require_semver
516
517
  } from "./chunk-HMDWNGIV.js";
@@ -533,7 +534,7 @@ import {
533
534
  relativizePath,
534
535
  resolvePath,
535
536
  sniffForJson
536
- } from "./chunk-57Q6OQG4.js";
537
+ } from "./chunk-ZUCWDIGE.js";
537
538
  import {
538
539
  require_escape_string_regexp,
539
540
  require_lib
@@ -341925,7 +341926,7 @@ async function adminRequestDoc(options) {
341925
341926
  token: session.token,
341926
341927
  addedHeaders
341927
341928
  }, unauthorizedHandler;
341928
- return "refresh" in session && (unauthorizedHandler = { type: "simple", handler: session.refresh }), graphqlRequestDoc({
341929
+ return "refresh" in session && (unauthorizedHandler = session.refresh), graphqlRequestDoc({
341929
341930
  ...opts,
341930
341931
  query,
341931
341932
  variables,
@@ -345158,7 +345159,8 @@ function parseServerEvent(event) {
345158
345159
  }
345159
345160
 
345160
345161
  // ../theme/dist/cli/utilities/theme-environment/local-assets.js
345161
- var import_liquid_html_parser = __toESM(require_dist2(), 1), tagContentCache = {
345162
+ var import_liquid_html_parser = __toESM(require_dist2(), 1);
345163
+ var tagContentCache = {
345162
345164
  stylesheet: /* @__PURE__ */ new Map(),
345163
345165
  javascript: /* @__PURE__ */ new Map()
345164
345166
  };
@@ -345280,9 +345282,17 @@ function getTagContent(file, tag) {
345280
345282
  if (cache4.delete(file.key), !file.value)
345281
345283
  return;
345282
345284
  let contents = [`/* ${file.key} */`];
345283
- if ((0, import_liquid_html_parser.walk)((0, import_liquid_html_parser.toLiquidHtmlAST)(file.value), (node) => {
345284
- node.type === import_liquid_html_parser.NodeTypes.LiquidRawTag && node.name === tag && contents.push(node.body.value);
345285
- }), contents.length > 1) {
345285
+ try {
345286
+ (0, import_liquid_html_parser.walk)((0, import_liquid_html_parser.toLiquidHtmlAST)(file.value), (node) => {
345287
+ node.type === import_liquid_html_parser.NodeTypes.LiquidRawTag && node.name === tag && contents.push(node.body.value);
345288
+ });
345289
+ } catch (err2) {
345290
+ let error = err2;
345291
+ outputDebug(`Error parsing Liquid file "${file.key}" to extract ${tag} tag. ${error.stack ?? error.message}`);
345292
+ let tagRE = new RegExp(`{%\\s*${tag}\\s*%}([^%]*){%\\s*end${tag}\\s*%}`), tagContent = file.value?.match(tagRE)?.[1];
345293
+ tagContent && contents.push(tagContent);
345294
+ }
345295
+ if (contents.length > 1) {
345286
345296
  let content = contents.join(`
345287
345297
  `);
345288
345298
  return cache4.set(file.key, { checksum: file.checksum, content }), content;
@@ -345381,7 +345391,7 @@ function getExtensionInMemoryTemplates(ctx) {
345381
345391
  var import_theme_check_node3 = __toESM(require_dist6(), 1);
345382
345392
  var import_liquid_html_parser2 = __toESM(require_dist2(), 1);
345383
345393
  import EventEmitter2 from "node:events";
345384
- var tagContentCache2 = /* @__PURE__ */ new Map(), sectionNamesByFile = /* @__PURE__ */ new Map();
345394
+ var fileDetailsCache = /* @__PURE__ */ new Map(), sectionNamesByFile = /* @__PURE__ */ new Map();
345385
345395
  function saveSectionsFromJson(fileKey, content) {
345386
345396
  let maybeJson = (0, import_theme_check_node3.parseJSON)(content, null, !0);
345387
345397
  if (!maybeJson)
@@ -345429,7 +345439,7 @@ function setupInMemoryTemplateWatcher2(theme, ctx) {
345429
345439
  if (fileKey.endsWith(".json")) {
345430
345440
  let content = file.value ?? await ctx.localThemeFileSystem.read(fileKey);
345431
345441
  content && typeof content == "string" && saveSectionsFromJson(fileKey, content);
345432
- }
345442
+ } else fileKey.endsWith(".liquid") && getUpdatedFileParts(file);
345433
345443
  }));
345434
345444
  });
345435
345445
  }
@@ -345536,11 +345546,11 @@ function findSectionNamesToReload(key, ctx) {
345536
345546
  return [...sectionsToUpdate];
345537
345547
  }
345538
345548
  function collectReloadInfoForFile(key, ctx) {
345539
- let [type] = key.split("/");
345549
+ let [type] = key.split("/"), file = ctx.localThemeFileSystem.files.get(key);
345540
345550
  return {
345541
345551
  sectionNames: type === "sections" ? findSectionNamesToReload(key, ctx) : [],
345542
345552
  replaceTemplates: needsTemplateUpdate(key) ? getInMemoryTemplates(ctx) : {},
345543
- updatedFileParts: getUpdatedFileParts(key, ctx)
345553
+ updatedFileParts: file && getUpdatedFileParts(file)
345544
345554
  };
345545
345555
  }
345546
345556
  var hotReloadScriptId = "hot-reload-client", hotReloadScriptUrl = "/cdn/shopifycloud/theme-hot-reload/theme-hot-reload.js", hotReloadScriptRE = new RegExp(`<script id="${hotReloadScriptId}"[^>]*>[^<]*</script>`), localHotReloadScriptEndpoint = "/@shopify/theme-hot-reload";
@@ -345550,28 +345560,44 @@ function handleHotReloadScriptInjection(html, ctx) {
345550
345560
  function isAsset(key) {
345551
345561
  return key.startsWith("assets/");
345552
345562
  }
345553
- function getUpdatedFileParts(key, ctx) {
345554
- let file = ctx.localThemeFileSystem.files.get(key), isValidFileType = ["sections/", "snippets/", "blocks/"].some((prefix) => key.startsWith(prefix)) && key.endsWith(".liquid");
345555
- if (!file || !isValidFileType)
345556
- return { stylesheetTag: !1, javascriptTag: !1 };
345557
- let tagContents = getTagContents(file);
345558
- return {
345559
- stylesheetTag: tagContents.stylesheet.changed,
345560
- javascriptTag: tagContents.javascript.changed
345561
- };
345562
- }
345563
- function getTagContents(file) {
345564
- let cached = tagContentCache2.get(file.key), cacheEntry = {
345563
+ function getUpdatedFileParts(file) {
345564
+ if (!(["sections/", "snippets/", "blocks/"].some((prefix) => file.key.startsWith(prefix)) && file.key.endsWith(".liquid")))
345565
+ return;
345566
+ let result = {
345567
+ stylesheetTag: !1,
345568
+ javascriptTag: !1,
345569
+ schemaTag: !1,
345570
+ liquid: !1
345571
+ }, cacheEntry = {
345565
345572
  checksum: file.checksum,
345566
- stylesheet: { content: "", changed: !1 },
345567
- javascript: { content: "", changed: !1 }
345573
+ liquid: "",
345574
+ stylesheetTag: "",
345575
+ javascriptTag: "",
345576
+ schemaTag: ""
345577
+ }, cached = fileDetailsCache.get(file.key);
345578
+ if (cached?.checksum === file.checksum || (fileDetailsCache.delete(file.key), !file.value))
345579
+ return result;
345580
+ let liquidTags = ["stylesheet", "javascript", "schema"], normalizeContent = (content) => content?.replace(/\s+/g, " ").trim(), otherContent = file.value, handleTagMatch = (tag, value) => {
345581
+ otherContent = otherContent.replace(value, "");
345582
+ let content = normalizeContent(value), tagName = `${tag}Tag`;
345583
+ result[tagName] = !cached || content !== cached[tagName], cacheEntry[tagName] = content;
345568
345584
  };
345569
- return cached?.checksum === file.checksum ? cached : (tagContentCache2.delete(file.key), file.value && ((0, import_liquid_html_parser2.walk)((0, import_liquid_html_parser2.toLiquidHtmlAST)(file.value), (node) => {
345570
- if (node.type === import_liquid_html_parser2.NodeTypes.LiquidRawTag && (node.name === "stylesheet" || node.name === "javascript")) {
345571
- let content = node.body.value, changed = !cached || content !== cached[node.name].content;
345572
- cacheEntry[node.name] = { content, changed };
345585
+ try {
345586
+ (0, import_liquid_html_parser2.walk)((0, import_liquid_html_parser2.toLiquidHtmlAST)(file.value), (node) => {
345587
+ if (node.type !== import_liquid_html_parser2.NodeTypes.LiquidRawTag)
345588
+ return;
345589
+ let nodeName = node.name;
345590
+ liquidTags.includes(nodeName) && handleTagMatch(nodeName, node.body.value);
345591
+ });
345592
+ } catch (err2) {
345593
+ let error = err2;
345594
+ outputDebug(`Error parsing Liquid file "${file.key}" to detect updated file parts. ${error.stack ?? error.message}`);
345595
+ for (let tag of liquidTags) {
345596
+ let tagRE = new RegExp(`{%\\s*${tag}\\s*%}([^%]*){%\\s*end${tag}\\s*%}`), match2 = otherContent.match(tagRE)?.[1];
345597
+ match2 && handleTagMatch(tag, match2);
345573
345598
  }
345574
- }), tagContentCache2.set(file.key, cacheEntry)), cacheEntry);
345599
+ }
345600
+ return otherContent = normalizeContent(otherContent.replace(/<!--[\s\S]*?-->/g, "").replace(/{%\s*comment\s*%}[\s\S]*?{%\s*endcomment\s*%}/g, "").replace(/{%\s*doc\s*%}[\s\S]*?{%\s*enddoc\s*%}/g, "")), cacheEntry.liquid = otherContent, result.liquid = !cached || otherContent !== cached.liquid, fileDetailsCache.set(file.key, cacheEntry), result;
345575
345601
  }
345576
345602
 
345577
345603
  // ../theme/dist/cli/utilities/theme-fs.js
@@ -351886,10 +351912,10 @@ async function buildAssetsUrl(port, root) {
351886
351912
  async function startMiniOxygen(options, useNodeRuntime = !1) {
351887
351913
  if (useNodeRuntime) {
351888
351914
  process.env.MINIFLARE_SUBREQUEST_LIMIT = 100;
351889
- let { startNodeServer } = await import("./node-NS4BEHX4.js");
351915
+ let { startNodeServer } = await import("./node-UQTVOAV2.js");
351890
351916
  return startNodeServer(options);
351891
351917
  }
351892
- let { startWorkerdServer } = await import("./workerd-WQC6GRYP.js");
351918
+ let { startWorkerdServer } = await import("./workerd-UWTQ4ECK.js");
351893
351919
  return startWorkerdServer(options);
351894
351920
  }
351895
351921
 
@@ -354700,7 +354726,7 @@ import { pipeline as pipeline3 } from "stream/promises";
354700
354726
  import stream2 from "node:stream/promises";
354701
354727
  import * as gzip from "node:zlib";
354702
354728
  import { fileURLToPath as fileURLToPath6 } from "node:url";
354703
- var PREFERRED_FUNCTION_RUNNER_VERSION = "v8.0.1", PREFERRED_JAVY_VERSION = "v5.0.3", PREFERRED_JAVY_PLUGIN_VERSION = "v2", BINARYEN_VERSION = "123.0.0", TRAMPOLINE_VERSION = "v1.0.0";
354729
+ var PREFERRED_FUNCTION_RUNNER_VERSION = "v9.0.0", PREFERRED_JAVY_VERSION = "v5.0.3", PREFERRED_JAVY_PLUGIN_VERSION = "v2", BINARYEN_VERSION = "123.0.0", TRAMPOLINE_VERSION = "v1.0.0";
354704
354730
  function deriveJavaScriptBinaryDependencies(version) {
354705
354731
  return version === "0" || version === "1" ? {
354706
354732
  functionRunner: "v7.0.1",
@@ -358971,7 +358997,7 @@ function generateCertificatePrompt() {
358971
358997
  return renderConfirmationPrompt({
358972
358998
  message: "--use-localhost requires a certificate for `localhost`. Generate it now?",
358973
358999
  confirmationMessage: "Yes, use mkcert to generate it",
358974
- cancellationMessage: "No, I'll provide it manually"
359000
+ cancellationMessage: "No, I'll run `app dev` again without `--use-localhost`"
358975
359001
  });
358976
359002
  }
358977
359003
 
@@ -360030,7 +360056,10 @@ var PartnersClient = class {
360030
360056
  if (!this._session) {
360031
360057
  if (isUnitTest())
360032
360058
  throw new Error("PartnersClient.session() should not be invoked dynamically in a unit test");
360033
- let { token, userId } = await ensureAuthenticatedPartners();
360059
+ let { token, userId } = await ensureAuthenticatedPartners([], process.env, {
360060
+ noPrompt: !1,
360061
+ forceRefresh: !0
360062
+ });
360034
360063
  this._session = {
360035
360064
  token,
360036
360065
  businessPlatformToken: "",
@@ -360043,10 +360072,10 @@ var PartnersClient = class {
360043
360072
  return this._session;
360044
360073
  }
360045
360074
  async request(query, variables = void 0, cacheOptions, preferredBehaviour) {
360046
- return partnersRequest(query, await this.token(), variables, cacheOptions, preferredBehaviour, this.createUnauthorizedHandler());
360075
+ return partnersRequest(query, await this.token(), variables, cacheOptions, preferredBehaviour);
360047
360076
  }
360048
360077
  async requestDoc(document2, variables) {
360049
- return partnersRequestDoc(document2, await this.token(), variables, void 0, this.createUnauthorizedHandler());
360078
+ return partnersRequestDoc(document2, await this.token(), variables);
360050
360079
  }
360051
360080
  async token() {
360052
360081
  return (await this.session()).token;
@@ -360301,9 +360330,6 @@ ${`https://${await partnersFqdn()}/${orgId}/stores`}
360301
360330
  let parsedOrg = { id: org.id, businessName: org.businessName, source: this.organizationSource }, appsWithOrg = org.apps.nodes.map((app) => ({ ...app, organizationId: org.id }));
360302
360331
  return { organization: parsedOrg, apps: { ...org.apps, nodes: appsWithOrg }, stores: [] };
360303
360332
  }
360304
- createUnauthorizedHandler() {
360305
- return createUnauthorizedHandler(this);
360306
- }
360307
360333
  }, fetchAppLogs = async ({ jwtToken, cursor, filters }) => {
360308
360334
  let url = await generateFetchAppLogUrl(cursor, filters), userAgent = `Shopify CLI; v=${CLI_KIT_VERSION}`, headers = {
360309
360335
  Authorization: `Bearer ${jwtToken}`,
@@ -362339,15 +362365,14 @@ var appManagementHeaders = (token) => buildHeaders(token), appManagementAppLogsU
362339
362365
  let url = `https://${await appManagementFqdn()}/app_management/unstable/organizations/${organizationId}/app_logs/poll`;
362340
362366
  return addCursorAndFiltersToAppLogsUrl(url, cursor, filters);
362341
362367
  };
362342
- async function appManagementRequestDoc(orgId, query, token, variables, cacheOptions, requestOptions, unauthorizedHandler) {
362368
+ async function appManagementRequestDoc(orgId, query, token, variables, cacheOptions, requestOptions) {
362343
362369
  let cacheExtraKey = (cacheOptions?.cacheExtraKey ?? "") + orgId, newCacheOptions = cacheOptions ? { ...cacheOptions, cacheExtraKey } : void 0;
362344
362370
  return limiter.schedule(async () => graphqlRequestDoc({
362345
362371
  ...await setupRequest(orgId, token),
362346
362372
  query,
362347
362373
  variables,
362348
362374
  cacheOptions: newCacheOptions,
362349
- preferredBehaviour: requestOptions?.requestMode,
362350
- unauthorizedHandler
362375
+ preferredBehaviour: requestOptions?.requestMode
362351
362376
  }));
362352
362377
  }
362353
362378
  function handleDeprecations(response) {
@@ -362549,7 +362574,7 @@ var TEMPLATE_JSON_URL = "https://cdn.shopify.com/static/cli/extensions/templates
362549
362574
  async appsForOrg(organizationId, term = "") {
362550
362575
  let query = ListApps, variables = {
362551
362576
  query: term.split(" ").filter((word) => word).map((word) => `title:${word}`).join(" ")
362552
- }, result = await appManagementRequestDoc(organizationId, query, await this.token(), variables, void 0, void 0, createUnauthorizedHandler(this));
362577
+ }, result = await appManagementRequestDoc(organizationId, query, await this.token(), variables);
362553
362578
  if (!result.appsConnection)
362554
362579
  throw new BugError("Server failed to retrieve apps");
362555
362580
  return {
@@ -362566,7 +362591,7 @@ var TEMPLATE_JSON_URL = "https://cdn.shopify.com/static/cli/extensions/templates
362566
362591
  };
362567
362592
  }
362568
362593
  async specifications({ organizationId }) {
362569
- return (await appManagementRequestDoc(organizationId, FetchSpecifications, await this.token(), void 0, void 0, void 0, createUnauthorizedHandler(this))).specifications.map((spec2) => ({
362594
+ return (await appManagementRequestDoc(organizationId, FetchSpecifications, await this.token())).specifications.map((spec2) => ({
362570
362595
  name: spec2.name,
362571
362596
  externalName: spec2.name,
362572
362597
  identifier: spec2.identifier,
@@ -362603,7 +362628,7 @@ var TEMPLATE_JSON_URL = "https://cdn.shopify.com/static/cli/extensions/templates
362603
362628
  return (await allowedTemplates(templates2, async (betaFlags) => this.organizationBetaFlags(organizationId, betaFlags))).map((template) => ({ ...template, sortPriority: counter++ }));
362604
362629
  }
362605
362630
  async createApp(org, options) {
362606
- let apiVersion = (await this.apiVersions(org.id)).publicApiVersions.filter((version) => version !== "unstable").sort().at(-1) ?? "unstable", variables = createAppVars(options, apiVersion), mutation = CreateApp, result = await appManagementRequestDoc(org.id, mutation, await this.token(), variables, void 0, void 0, createUnauthorizedHandler(this));
362631
+ let apiVersion = (await this.apiVersions(org.id)).publicApiVersions.filter((version) => version !== "unstable").sort().at(-1) ?? "unstable", variables = createAppVars(options, apiVersion), mutation = CreateApp, result = await appManagementRequestDoc(org.id, mutation, await this.token(), variables);
362607
362632
  if (!result.appCreate.app || result.appCreate.userErrors?.length > 0) {
362608
362633
  let errors = result.appCreate.userErrors.map((error) => error.message).join(", ");
362609
362634
  throw new AbortError(errors);
@@ -362653,7 +362678,7 @@ var TEMPLATE_JSON_URL = "https://cdn.shopify.com/static/cli/extensions/templates
362653
362678
  };
362654
362679
  }
362655
362680
  async appVersions({ id, organizationId, title }) {
362656
- let query = AppVersions, variables = { appId: id }, result = await appManagementRequestDoc(organizationId, query, await this.token(), variables, void 0, void 0, createUnauthorizedHandler(this));
362681
+ let query = AppVersions, variables = { appId: id }, result = await appManagementRequestDoc(organizationId, query, await this.token(), variables);
362657
362682
  return {
362658
362683
  app: {
362659
362684
  id: result.app.id,
@@ -362681,7 +362706,7 @@ var TEMPLATE_JSON_URL = "https://cdn.shopify.com/static/cli/extensions/templates
362681
362706
  };
362682
362707
  }
362683
362708
  async appVersionByTag({ id: appId, organizationId }, versionTag) {
362684
- let query = AppVersionByTag, variables = { versionTag }, version = (await appManagementRequestDoc(organizationId, query, await this.token(), variables, void 0, void 0, createUnauthorizedHandler(this))).versionByTag;
362709
+ let query = AppVersionByTag, variables = { versionTag }, version = (await appManagementRequestDoc(organizationId, query, await this.token(), variables)).versionByTag;
362685
362710
  if (!version)
362686
362711
  throw new AbortError(`Version not found for tag: ${versionTag}`);
362687
362712
  return {
@@ -362729,7 +362754,9 @@ var TEMPLATE_JSON_URL = "https://cdn.shopify.com/static/cli/extensions/templates
362729
362754
  };
362730
362755
  }
362731
362756
  async generateSignedUploadUrl({ organizationId }) {
362732
- let variables = { sourceExtension: "BR" }, result = await appManagementRequestDoc(organizationId, CreateAssetUrl, await this.token(), variables, { cacheTTL: { minutes: 59 } }, void 0, createUnauthorizedHandler(this));
362757
+ let variables = { sourceExtension: "BR" }, result = await appManagementRequestDoc(organizationId, CreateAssetUrl, await this.token(), variables, {
362758
+ cacheTTL: { minutes: 59 }
362759
+ });
362733
362760
  return {
362734
362761
  assetUrl: result.appRequestSourceUploadUrl.sourceUploadUrl,
362735
362762
  userErrors: result.appRequestSourceUploadUrl.userErrors
@@ -362756,7 +362783,7 @@ var TEMPLATE_JSON_URL = "https://cdn.shopify.com/static/cli/extensions/templates
362756
362783
  appId,
362757
362784
  version: queryVersion,
362758
362785
  metadata: metadata2
362759
- }, result = await appManagementRequestDoc(organizationId, CreateAppVersion, await this.token(), variables, void 0, { requestMode: "slow-request" }, createUnauthorizedHandler(this)), { version } = result.appVersionCreate, userErrors = result.appVersionCreate.userErrors.map(toUserError) ?? [];
362786
+ }, result = await appManagementRequestDoc(organizationId, CreateAppVersion, await this.token(), variables, void 0, { requestMode: "slow-request" }), { version } = result.appVersionCreate, userErrors = result.appVersionCreate.userErrors.map(toUserError) ?? [];
362760
362787
  if (!version)
362761
362788
  return { appDeploy: { userErrors } };
362762
362789
  let versionResult = {
@@ -362779,11 +362806,11 @@ var TEMPLATE_JSON_URL = "https://cdn.shopify.com/static/cli/extensions/templates
362779
362806
  };
362780
362807
  if (noRelease)
362781
362808
  return versionResult;
362782
- let releaseVariables = { appId, versionId: version.id }, releaseResult = await appManagementRequestDoc(organizationId, ReleaseVersion, await this.token(), releaseVariables, void 0, void 0, createUnauthorizedHandler(this));
362809
+ let releaseVariables = { appId, versionId: version.id }, releaseResult = await appManagementRequestDoc(organizationId, ReleaseVersion, await this.token(), releaseVariables);
362783
362810
  return releaseResult.appReleaseCreate.userErrors && (versionResult.appDeploy.userErrors = (versionResult.appDeploy.userErrors ?? []).concat(releaseResult.appReleaseCreate.userErrors.map(toUserError))), versionResult;
362784
362811
  }
362785
362812
  async release({ app: { id: appId, organizationId }, version: { versionId } }) {
362786
- let releaseVariables = { appId, versionId }, releaseResult = await appManagementRequestDoc(organizationId, ReleaseVersion, await this.token(), releaseVariables, void 0, void 0, createUnauthorizedHandler(this));
362813
+ let releaseVariables = { appId, versionId }, releaseResult = await appManagementRequestDoc(organizationId, ReleaseVersion, await this.token(), releaseVariables);
362787
362814
  return releaseResult.appReleaseCreate.release ? {
362788
362815
  appRelease: {
362789
362816
  appVersion: {
@@ -362932,9 +362959,6 @@ var TEMPLATE_JSON_URL = "https://cdn.shopify.com/static/cli/extensions/templates
362932
362959
  ${`https://${await developerDashboardFqdn()}/dashboard/${orgId}/stores`}
362933
362960
  `;
362934
362961
  }
362935
- createUnauthorizedHandler() {
362936
- return createUnauthorizedHandler(this);
362937
- }
362938
362962
  async activeAppVersionRawResult({ organizationId, apiKey }) {
362939
362963
  return appManagementRequestDoc(organizationId, ActiveAppReleaseFromApiKey, await this.token(), { apiKey });
362940
362964
  }
@@ -362948,7 +362972,7 @@ ${`https://${await developerDashboardFqdn()}/dashboard/${orgId}/stores`}
362948
362972
  }
362949
362973
  }, MAGIC_URL2 = "https://shopify.dev/apps/default-app-home", MAGIC_REDIRECT_URL2 = "https://shopify.dev/apps/default-app-home/api/auth";
362950
362974
  function createAppVars(options, apiVersion) {
362951
- let { isLaunchable, scopesArray, name, isEmbedded } = options;
362975
+ let { isLaunchable, scopesArray, name } = options;
362952
362976
  return { initialVersion: { source: {
362953
362977
  source: {
362954
362978
  name,
@@ -362957,7 +362981,10 @@ function createAppVars(options, apiVersion) {
362957
362981
  type: AppHomeSpecIdentifier,
362958
362982
  config: {
362959
362983
  app_url: isLaunchable ? "https://example.com" : MAGIC_URL2,
362960
- embedded: isEmbedded
362984
+ // Ext-only apps should be embedded = false, however we are hardcoding this to
362985
+ // match Partners behaviour for now
362986
+ // https://github.com/Shopify/develop-app-inner-loop/issues/2789
362987
+ embedded: !0
362961
362988
  }
362962
362989
  },
362963
362990
  {
@@ -363088,22 +363115,6 @@ function filterDisabledFlags(disabledFlags = []) {
363088
363115
  let defaultActiveFlags = [], remoteDisabledFlags = disabledFlags.map((flag) => FlagMap[flag]);
363089
363116
  return defaultActiveFlags.filter((flag) => !remoteDisabledFlags.includes(flag));
363090
363117
  }
363091
- var inProgressRefreshes = /* @__PURE__ */ new WeakMap();
363092
- function createUnauthorizedHandler(client) {
363093
- return {
363094
- type: "token_refresh",
363095
- handler: async () => {
363096
- let tokenRefresher = inProgressRefreshes.get(client);
363097
- if (tokenRefresher)
363098
- return { token: await tokenRefresher };
363099
- try {
363100
- return tokenRefresher = client.refreshToken(), inProgressRefreshes.set(client, tokenRefresher), { token: await tokenRefresher };
363101
- } finally {
363102
- inProgressRefreshes.delete(client);
363103
- }
363104
- }
363105
- };
363106
- }
363107
363118
 
363108
363119
  // ../app/dist/cli/services/dev/fetch.js
363109
363120
  var NoOrgError = class extends AbortError {
@@ -365836,7 +365847,7 @@ async function findOrCreateHostTheme(adminSession, theme) {
365836
365847
  return hostTheme;
365837
365848
  }
365838
365849
  async function buildAppUrl(remoteApp) {
365839
- return `https://${await partnersFqdn()}/${remoteApp.organizationId}/apps/${remoteApp.id}/test`;
365850
+ return remoteApp.id.startsWith("gid://") ? `https://${await adminFqdn()}/?organization_id=${remoteApp.organizationId}&no_redirect=true&redirect=/oauth/redirect_from_developer_dashboard?client_id%3D${remoteApp.apiKey}` : `https://${await partnersFqdn()}/${remoteApp.organizationId}/apps/${remoteApp.id}/test`;
365840
365851
  }
365841
365852
 
365842
365853
  // ../app/dist/cli/services/dev/processes/previewable-extension.js
@@ -368175,7 +368186,7 @@ var DevSession = class _DevSession {
368175
368186
  * @returns The signed URL if we uploaded any assets, otherwise undefined
368176
368187
  */
368177
368188
  async uploadAssetsIfNeeded(assets, bundleController, includeManifest) {
368178
- if (!assets.length)
368189
+ if (!assets.length && !includeManifest)
368179
368190
  return;
368180
368191
  let compressedBundlePath = joinPath(dirname(this.bundlePath), `dev-bundle.${this.options.developerPlatformClient.bundleFormat}`);
368181
368192
  if (bundleController.signal.aborted)
@@ -22,11 +22,11 @@ import {
22
22
  themeToken,
23
23
  useEmbeddedThemeCLI,
24
24
  useThemebundling
25
- } from "./chunk-AZ6Y4YZT.js";
25
+ } from "./chunk-2SENSD2I.js";
26
26
  import "./chunk-HMDWNGIV.js";
27
27
  import "./chunk-B5EXYCV3.js";
28
28
  import "./chunk-75LV6AQS.js";
29
- import "./chunk-57Q6OQG4.js";
29
+ import "./chunk-ZUCWDIGE.js";
30
30
  import "./chunk-5AFYDRV4.js";
31
31
  import "./chunk-3I3GQNEW.js";
32
32
  import "./chunk-G5R6YD27.js";
@@ -62,4 +62,4 @@ export {
62
62
  useEmbeddedThemeCLI,
63
63
  useThemebundling
64
64
  };
65
- //# sourceMappingURL=local-F5VFMUS5.js.map
65
+ //# sourceMappingURL=local-7RAANNJV.js.map
@@ -12,31 +12,31 @@ import {
12
12
  importLocal,
13
13
  logRequestLine,
14
14
  setConstructors
15
- } from "./chunk-H352PF4V.js";
15
+ } from "./chunk-JEZFZHJT.js";
16
16
  import "./chunk-LQ2ZKVR6.js";
17
17
  import "./chunk-CP3BRHWK.js";
18
- import "./chunk-3MQT2ETC.js";
19
- import "./chunk-XZ7LRLSW.js";
20
- import "./chunk-PAKKG4IK.js";
18
+ import "./chunk-OV2WT25T.js";
19
+ import "./chunk-WUIY4ZKO.js";
20
+ import "./chunk-UWQ5RHX4.js";
21
21
  import "./chunk-SHWOPMLQ.js";
22
- import "./chunk-PCSYEXIP.js";
23
- import "./chunk-NWFRDDT5.js";
24
- import "./chunk-JSVOLQ6E.js";
25
- import "./chunk-NRK4JPTC.js";
22
+ import "./chunk-4N62VJCW.js";
23
+ import "./chunk-7RVTZY4V.js";
24
+ import "./chunk-CC5JTJRC.js";
25
+ import "./chunk-AA6YHL4H.js";
26
26
  import "./chunk-25IMI7TH.js";
27
- import "./chunk-SUFYMVTC.js";
28
- import "./chunk-6LR4FWOA.js";
27
+ import "./chunk-OEN366HT.js";
28
+ import "./chunk-SA6W52ZM.js";
29
29
  import {
30
30
  AbortError,
31
31
  outputNewline,
32
32
  readFile,
33
33
  renderSuccess,
34
34
  source_default
35
- } from "./chunk-AZ6Y4YZT.js";
35
+ } from "./chunk-2SENSD2I.js";
36
36
  import "./chunk-HMDWNGIV.js";
37
37
  import "./chunk-B5EXYCV3.js";
38
38
  import "./chunk-75LV6AQS.js";
39
- import "./chunk-57Q6OQG4.js";
39
+ import "./chunk-ZUCWDIGE.js";
40
40
  import "./chunk-5AFYDRV4.js";
41
41
  import "./chunk-3I3GQNEW.js";
42
42
  import "./chunk-G5R6YD27.js";
@@ -163,4 +163,4 @@ async function startNodeServer({
163
163
  export {
164
164
  startNodeServer
165
165
  };
166
- //# sourceMappingURL=node-NS4BEHX4.js.map
166
+ //# sourceMappingURL=node-UQTVOAV2.js.map
@@ -29,12 +29,12 @@ import {
29
29
  versionSatisfies,
30
30
  writePackageJSON,
31
31
  yarnLockfile
32
- } from "./chunk-6LR4FWOA.js";
33
- import "./chunk-AZ6Y4YZT.js";
32
+ } from "./chunk-SA6W52ZM.js";
33
+ import "./chunk-2SENSD2I.js";
34
34
  import "./chunk-HMDWNGIV.js";
35
35
  import "./chunk-B5EXYCV3.js";
36
36
  import "./chunk-75LV6AQS.js";
37
- import "./chunk-57Q6OQG4.js";
37
+ import "./chunk-ZUCWDIGE.js";
38
38
  import "./chunk-5AFYDRV4.js";
39
39
  import "./chunk-3I3GQNEW.js";
40
40
  import "./chunk-G5R6YD27.js";
@@ -77,4 +77,4 @@ export {
77
77
  writePackageJSON,
78
78
  yarnLockfile
79
79
  };
80
- //# sourceMappingURL=node-package-manager-XTTAGATX.js.map
80
+ //# sourceMappingURL=node-package-manager-EM4XDXO6.js.map
@@ -13,7 +13,7 @@ import {
13
13
  resolvePath,
14
14
  sniffForJson,
15
15
  sniffForPath
16
- } from "./chunk-57Q6OQG4.js";
16
+ } from "./chunk-ZUCWDIGE.js";
17
17
  import "./chunk-CDBXAE2F.js";
18
18
  import "./chunk-PKR7KJ6P.js";
19
19
  export {
@@ -32,4 +32,4 @@ export {
32
32
  sniffForJson,
33
33
  sniffForPath
34
34
  };
35
- //# sourceMappingURL=path-2K5HIMHZ.js.map
35
+ //# sourceMappingURL=path-GWAZZN2N.js.map