@shopify/cli 3.81.1 → 3.82.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 (78) hide show
  1. package/dist/{chunk-O66CPW2Z.js → chunk-25WAB7NJ.js} +2 -2
  2. package/dist/{chunk-2Y3UFXD6.js → chunk-3Q5VPXT5.js} +16 -9
  3. package/dist/{chunk-ZARNHYRC.js → chunk-6AJRDC5C.js} +3 -3
  4. package/dist/{chunk-JKKYVUPT.js → chunk-6C6ZDQRA.js} +2 -2
  5. package/dist/{chunk-GMFX4XJF.js → chunk-74CFIJBV.js} +3 -3
  6. package/dist/{chunk-5RPSJUXQ.js → chunk-7MYG46RI.js} +6 -6
  7. package/dist/{chunk-E6T6HFSE.js → chunk-7ZNBHIYT.js} +5 -5
  8. package/dist/{chunk-H37YPI3Y.js → chunk-AJDONTSK.js} +3 -3
  9. package/dist/{chunk-5LMBCQDG.js → chunk-BSTZYPZU.js} +10 -10
  10. package/dist/{chunk-DDYH6337.js → chunk-CFNCXOAV.js} +2 -2
  11. package/dist/{chunk-B44H2P6E.js → chunk-EEYW5FSA.js} +3 -3
  12. package/dist/{chunk-JV3N43QW.js → chunk-FYDURVQO.js} +4 -4
  13. package/dist/{chunk-WSP4T6BG.js → chunk-HOYO6JKN.js} +3 -3
  14. package/dist/{chunk-6GAIDVJR.js → chunk-JLJTVUDK.js} +11 -6
  15. package/dist/{chunk-X2GG47RT.js → chunk-JLKSXSVY.js} +3 -3
  16. package/dist/{chunk-PINTEIWG.js → chunk-KB5GMUHY.js} +6 -6
  17. package/dist/{chunk-CN7P6XXP.js → chunk-KUAANQ7T.js} +4 -4
  18. package/dist/{chunk-NZVDI2PG.js → chunk-MFC6MLP7.js} +3 -3
  19. package/dist/{chunk-R7PQLQRT.js → chunk-MSSZWK63.js} +4 -4
  20. package/dist/{chunk-OU2VE5NL.js → chunk-MWVORSD7.js} +6 -6
  21. package/dist/{chunk-5NWUTFCV.js → chunk-PRSTYBLZ.js} +3 -3
  22. package/dist/{chunk-5OBLOY7U.js → chunk-QEIHQ2YM.js} +2 -2
  23. package/dist/{chunk-27MYZBXV.js → chunk-QIECGUO5.js} +3 -3
  24. package/dist/{chunk-6CJ6BGWA.js → chunk-R2LEUYIF.js} +3 -3
  25. package/dist/{chunk-5CZUSVND.js → chunk-RLS2ONCK.js} +2 -2
  26. package/dist/{chunk-B5JZHKPR.js → chunk-TCCRXQUU.js} +3 -3
  27. package/dist/{chunk-6NGGBF47.js → chunk-UQXK6QDK.js} +3 -3
  28. package/dist/{chunk-PLXKIAXS.js → chunk-VWOOMRYF.js} +4 -4
  29. package/dist/{chunk-VANXFY34.js → chunk-WDBIXJF6.js} +2 -2
  30. package/dist/{chunk-ALHM5GST.js → chunk-XYELYAVC.js} +5 -5
  31. package/dist/{chunk-SOZ33QZX.js → chunk-YPSBMB7C.js} +2 -2
  32. package/dist/{chunk-KJXXNUND.js → chunk-YUBYB2KK.js} +10 -8
  33. package/dist/{chunk-NEQJPNB5.js → chunk-YUXFQXPK.js} +7 -7
  34. package/dist/{chunk-I2M5KL5Z.js → chunk-ZBSES4JU.js} +3 -3
  35. package/dist/cli/commands/auth/logout.js +11 -11
  36. package/dist/cli/commands/auth/logout.test.js +12 -12
  37. package/dist/cli/commands/cache/clear.js +10 -10
  38. package/dist/cli/commands/debug/command-flags.js +10 -10
  39. package/dist/cli/commands/docs/generate.js +10 -10
  40. package/dist/cli/commands/docs/generate.test.js +10 -10
  41. package/dist/cli/commands/help.js +10 -10
  42. package/dist/cli/commands/kitchen-sink/async.js +11 -11
  43. package/dist/cli/commands/kitchen-sink/async.test.js +11 -11
  44. package/dist/cli/commands/kitchen-sink/index.js +13 -13
  45. package/dist/cli/commands/kitchen-sink/index.test.js +13 -13
  46. package/dist/cli/commands/kitchen-sink/prompts.js +11 -11
  47. package/dist/cli/commands/kitchen-sink/prompts.test.js +11 -11
  48. package/dist/cli/commands/kitchen-sink/static.js +11 -11
  49. package/dist/cli/commands/kitchen-sink/static.test.js +11 -11
  50. package/dist/cli/commands/notifications/generate.js +11 -11
  51. package/dist/cli/commands/notifications/list.js +11 -11
  52. package/dist/cli/commands/search.js +11 -11
  53. package/dist/cli/commands/upgrade.js +11 -11
  54. package/dist/cli/commands/version.js +11 -11
  55. package/dist/cli/commands/version.test.js +11 -11
  56. package/dist/cli/services/commands/notifications.js +6 -6
  57. package/dist/cli/services/commands/search.js +2 -2
  58. package/dist/cli/services/commands/search.test.js +2 -2
  59. package/dist/cli/services/commands/version.js +3 -3
  60. package/dist/cli/services/commands/version.test.js +4 -4
  61. package/dist/cli/services/kitchen-sink/async.js +2 -2
  62. package/dist/cli/services/kitchen-sink/prompts.js +2 -2
  63. package/dist/cli/services/kitchen-sink/static.js +2 -2
  64. package/dist/cli/services/upgrade.js +3 -3
  65. package/dist/cli/services/upgrade.test.js +4 -4
  66. package/dist/{custom-oclif-loader-7E5Z2M56.js → custom-oclif-loader-BEAC6M5I.js} +2 -2
  67. package/dist/{error-handler-GHVJK7OK.js → error-handler-AW3QCINN.js} +8 -8
  68. package/dist/hooks/postrun.js +6 -6
  69. package/dist/hooks/prerun.js +7 -7
  70. package/dist/index.js +271 -175
  71. package/dist/{local-GLHD5LYH.js → local-ZIKS25AW.js} +2 -2
  72. package/dist/{node-OFSPLONP.js → node-GHBQEWAW.js} +12 -12
  73. package/dist/{node-package-manager-K7DEALW5.js → node-package-manager-T3RQZ6EF.js} +3 -3
  74. package/dist/tsconfig.tsbuildinfo +1 -1
  75. package/dist/{ui-G7IYCY5T.js → ui-NKEN4MZY.js} +2 -2
  76. package/dist/{workerd-IDTCFUND.js → workerd-BCMLUCF7.js} +12 -12
  77. package/oclif.manifest.json +84 -12
  78. 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-5LMBCQDG.js";
139
+ } from "./chunk-BSTZYPZU.js";
140
140
  import {
141
141
  require_fs,
142
142
  require_glob,
@@ -151,69 +151,69 @@ import {
151
151
  } from "./chunk-3GXB4ZRP.js";
152
152
  import {
153
153
  List
154
- } from "./chunk-JV3N43QW.js";
154
+ } from "./chunk-FYDURVQO.js";
155
155
  import {
156
156
  Search
157
- } from "./chunk-B44H2P6E.js";
157
+ } from "./chunk-EEYW5FSA.js";
158
158
  import {
159
159
  Upgrade
160
- } from "./chunk-PLXKIAXS.js";
161
- import "./chunk-H37YPI3Y.js";
160
+ } from "./chunk-VWOOMRYF.js";
161
+ import "./chunk-AJDONTSK.js";
162
162
  import {
163
163
  Version
164
- } from "./chunk-NZVDI2PG.js";
165
- import "./chunk-6NGGBF47.js";
166
- import "./chunk-VANXFY34.js";
164
+ } from "./chunk-MFC6MLP7.js";
165
+ import "./chunk-UQXK6QDK.js";
166
+ import "./chunk-WDBIXJF6.js";
167
167
  import {
168
168
  KitchenSinkAll
169
- } from "./chunk-E6T6HFSE.js";
169
+ } from "./chunk-7ZNBHIYT.js";
170
170
  import {
171
171
  KitchenSinkPrompts
172
- } from "./chunk-5NWUTFCV.js";
173
- import "./chunk-O66CPW2Z.js";
172
+ } from "./chunk-PRSTYBLZ.js";
173
+ import "./chunk-25WAB7NJ.js";
174
174
  import {
175
175
  KitchenSinkStatic
176
- } from "./chunk-WSP4T6BG.js";
177
- import "./chunk-5CZUSVND.js";
176
+ } from "./chunk-HOYO6JKN.js";
177
+ import "./chunk-RLS2ONCK.js";
178
178
  import {
179
179
  Generate
180
- } from "./chunk-B5JZHKPR.js";
181
- import "./chunk-ALHM5GST.js";
180
+ } from "./chunk-TCCRXQUU.js";
181
+ import "./chunk-XYELYAVC.js";
182
182
  import {
183
183
  Logout
184
- } from "./chunk-CN7P6XXP.js";
184
+ } from "./chunk-KUAANQ7T.js";
185
185
  import {
186
186
  ensureAuthenticatedAdmin,
187
187
  ensureAuthenticatedAppManagementAndBusinessPlatform,
188
188
  ensureAuthenticatedPartners,
189
189
  ensureAuthenticatedStorefront,
190
190
  ensureAuthenticatedThemes
191
- } from "./chunk-R7PQLQRT.js";
191
+ } from "./chunk-MSSZWK63.js";
192
192
  import {
193
193
  ClearCache,
194
194
  globalFlags,
195
195
  jsonFlag,
196
196
  runCLI
197
- } from "./chunk-NEQJPNB5.js";
197
+ } from "./chunk-YUXFQXPK.js";
198
198
  import {
199
199
  CommandFlags
200
- } from "./chunk-6CJ6BGWA.js";
200
+ } from "./chunk-R2LEUYIF.js";
201
201
  import {
202
202
  DocsGenerate
203
- } from "./chunk-X2GG47RT.js";
203
+ } from "./chunk-JLKSXSVY.js";
204
204
  import {
205
205
  HelpCommand
206
- } from "./chunk-JKKYVUPT.js";
206
+ } from "./chunk-6C6ZDQRA.js";
207
207
  import {
208
208
  KitchenSinkAsync
209
- } from "./chunk-GMFX4XJF.js";
210
- import "./chunk-5OBLOY7U.js";
209
+ } from "./chunk-74CFIJBV.js";
210
+ import "./chunk-QEIHQ2YM.js";
211
211
  import {
212
212
  base_command_default,
213
213
  decodeToml,
214
214
  encodeToml,
215
215
  loadEnvironment
216
- } from "./chunk-KJXXNUND.js";
216
+ } from "./chunk-YUBYB2KK.js";
217
217
  import {
218
218
  require_byline,
219
219
  require_end_of_stream,
@@ -221,7 +221,7 @@ import {
221
221
  require_iserror,
222
222
  require_pump,
223
223
  require_stack_generator
224
- } from "./chunk-OU2VE5NL.js";
224
+ } from "./chunk-MWVORSD7.js";
225
225
  import {
226
226
  require_once
227
227
  } from "./chunk-SHWOPMLQ.js";
@@ -229,7 +229,7 @@ import {
229
229
  fanoutHooks,
230
230
  getListOfTunnelPlugins,
231
231
  reportAnalyticsEvent
232
- } from "./chunk-5RPSJUXQ.js";
232
+ } from "./chunk-7MYG46RI.js";
233
233
  import {
234
234
  adminFqdn,
235
235
  appDevFqdn,
@@ -240,10 +240,10 @@ import {
240
240
  normalizeStoreFqdn,
241
241
  ok,
242
242
  partnersFqdn
243
- } from "./chunk-6GAIDVJR.js";
243
+ } from "./chunk-JLJTVUDK.js";
244
244
  import {
245
245
  showNotificationsIfNeeded
246
- } from "./chunk-PINTEIWG.js";
246
+ } from "./chunk-KB5GMUHY.js";
247
247
  import {
248
248
  ClientError,
249
249
  FetchError,
@@ -265,11 +265,11 @@ import {
265
265
  require_mime_types,
266
266
  shopifyFetch,
267
267
  z
268
- } from "./chunk-27MYZBXV.js";
268
+ } from "./chunk-QIECGUO5.js";
269
269
  import "./chunk-25IMI7TH.js";
270
270
  import {
271
271
  CLI_KIT_VERSION
272
- } from "./chunk-DDYH6337.js";
272
+ } from "./chunk-CFNCXOAV.js";
273
273
  import {
274
274
  LocalStorage,
275
275
  UnknownPackageManagerError,
@@ -293,7 +293,7 @@ import {
293
293
  usesWorkspaces,
294
294
  versionSatisfies,
295
295
  writePackageJSON
296
- } from "./chunk-ZARNHYRC.js";
296
+ } from "./chunk-6AJRDC5C.js";
297
297
  import {
298
298
  AbortController as AbortController2,
299
299
  AbortError,
@@ -507,7 +507,7 @@ import {
507
507
  username,
508
508
  writeFile,
509
509
  writeFileSync
510
- } from "./chunk-2Y3UFXD6.js";
510
+ } from "./chunk-3Q5VPXT5.js";
511
511
  import {
512
512
  require_semver
513
513
  } from "./chunk-HMDWNGIV.js";
@@ -193626,7 +193626,7 @@ init_cjs_shims();
193626
193626
  var import_core = __toESM(require_lib(), 1);
193627
193627
  var themeFlags = {
193628
193628
  path: import_core.Flags.string({
193629
- description: "The path to your theme directory.",
193629
+ description: "The path where you want to run the command. Defaults to the current working directory.",
193630
193630
  env: "SHOPIFY_FLAG_PATH",
193631
193631
  parse: async (input) => resolvePath(input),
193632
193632
  default: async () => cwd(),
@@ -193904,7 +193904,7 @@ function assertThemeStoreExists(storage = themeLocalStorage()) {
193904
193904
  function ensureThemeStore(flags) {
193905
193905
  let store = flags.store || getThemeStore();
193906
193906
  if (!store)
193907
- throw new AbortError("A store is required", `Specify the store passing ${outputContent`${outputToken.genericShellCommand(`--${themeFlags.store.name}={your_store_url}`)}`.value} or set the ${outputContent`${outputToken.genericShellCommand(themeFlags.store.env)}`.value} environment variable.`);
193907
+ throw new AbortError("A store is required", `Specify the store passing ${outputContent`${outputToken.genericShellCommand(`--${themeFlags.store.name}=example.myshopify.com`)}`.value} or set the ${outputContent`${outputToken.genericShellCommand(themeFlags.store.env)}`.value} environment variable.`);
193908
193908
  return setThemeStore(store), store;
193909
193909
  }
193910
193910
 
@@ -193946,33 +193946,53 @@ var ThemeCommand = class extends base_command_default {
193946
193946
  environmentsFilename() {
193947
193947
  return configurationFileName;
193948
193948
  }
193949
- async command(_flags, _session) {
193949
+ async command(_flags, _session, _context) {
193950
193950
  }
193951
193951
  async run(_opts) {
193952
193952
  let klass = this.constructor, requiredFlags = klass.multiEnvironmentsFlags, { flags } = await this.parse(klass);
193953
- if (!flags.environment) {
193953
+ if (!flags.environment?.length) {
193954
193954
  let session = await this.ensureAuthenticated(flags);
193955
193955
  await this.command(flags, session);
193956
193956
  return;
193957
193957
  }
193958
- let sessions = {}, environments = Array.isArray(flags.environment) ? flags.environment : [flags.environment];
193958
+ let environments = Array.isArray(flags.environment) ? flags.environment : [flags.environment];
193959
+ if (environments.length === 1) {
193960
+ let session = await this.ensureAuthenticated(flags);
193961
+ await this.command(flags, session);
193962
+ return;
193963
+ }
193964
+ let sessions = {};
193959
193965
  for (let environmentName of environments) {
193960
- let environmentConfig = await loadEnvironment(environmentName, "shopify.theme.toml", { from: flags.path });
193966
+ let environmentConfig = await loadEnvironment(environmentName, "shopify.theme.toml", {
193967
+ from: flags.path,
193968
+ silent: !0
193969
+ });
193961
193970
  sessions[environmentName] = await this.ensureAuthenticated(environmentConfig);
193962
193971
  }
193963
- await Promise.all(environments.map(async (environment) => {
193964
- let environmentConfig = await loadEnvironment(environment, "shopify.theme.toml", { from: flags.path }), environmentFlags = {
193965
- ...flags,
193966
- ...environmentConfig,
193967
- environment: [environment]
193968
- };
193969
- if (!this.validConfig(environmentConfig, requiredFlags, environment))
193970
- return;
193971
- let session = sessions[environment];
193972
- if (!session)
193973
- throw new AbortError(`No session found for environment ${environment}`);
193974
- return this.command(environmentFlags, session);
193975
- }));
193972
+ let abortController = new AbortController2();
193973
+ await renderConcurrent({
193974
+ processes: environments.map((environment) => ({
193975
+ prefix: environment,
193976
+ action: async (stdout, stderr, _signal) => {
193977
+ let environmentConfig = await loadEnvironment(environment, "shopify.theme.toml", {
193978
+ from: flags.path,
193979
+ silent: !0
193980
+ }), environmentFlags = {
193981
+ ...flags,
193982
+ ...environmentConfig,
193983
+ environment: [environment]
193984
+ };
193985
+ if (!this.validConfig(environmentConfig, requiredFlags, environment))
193986
+ return;
193987
+ let session = sessions[environment];
193988
+ if (!session)
193989
+ throw new AbortError(`No session found for environment ${environment}`);
193990
+ await this.command(environmentFlags, session, { stdout, stderr });
193991
+ }
193992
+ })),
193993
+ abortSignal: abortController.signal,
193994
+ showTimestamps: !0
193995
+ });
193976
193996
  }
193977
193997
  async ensureAuthenticated(flags) {
193978
193998
  let store = flags.store, password = flags.password;
@@ -195570,7 +195590,7 @@ async function getStorefrontSessionCookies(storeUrl, themeId, password, headers
195570
195590
  let storefrontDigest = await enrichSessionWithStorefrontPassword(shopifyEssential, storeUrl, password, headers);
195571
195591
  return cookieRecord.storefront_digest = storefrontDigest, cookieRecord;
195572
195592
  }
195573
- async function sessionEssentialCookie(storeUrl, themeId, headers) {
195593
+ async function sessionEssentialCookie(storeUrl, themeId, headers, retries = 1) {
195574
195594
  let params = new URLSearchParams({
195575
195595
  preview_theme_id: themeId,
195576
195596
  _fd: "0",
@@ -195583,12 +195603,18 @@ async function sessionEssentialCookie(storeUrl, themeId, headers) {
195583
195603
  ...defaultHeaders()
195584
195604
  }
195585
195605
  }), setCookies = response.headers.raw()["set-cookie"] ?? [], shopifyEssential = getCookie(setCookies, "_shopify_essential");
195586
- if (!shopifyEssential)
195587
- throw outputDebug(`Failed to obtain _shopify_essential cookie.
195606
+ if (!shopifyEssential) {
195607
+ if (outputDebug(`Failed to obtain _shopify_essential cookie.
195588
195608
 
195589
195609
  -Request ID: ${response.headers.get("x-request-id") ?? "unknown"}
195590
195610
 
195591
- -Body: ${await response.text()}`), new ShopifyEssentialError('Your development session could not be created because the "_shopify_essential" could not be defined. Please, check your internet connection.');
195611
+ -Body: ${await response.text()}
195612
+
195613
+ -Status: ${response.status}
195614
+ `), retries > 3)
195615
+ throw new ShopifyEssentialError('Your development session could not be created because the "_shopify_essential" could not be defined. Please, check your internet connection.');
195616
+ return outputDebug("Retrying to obtain the _shopify_essential cookie..."), await sleep(retries), sessionEssentialCookie(storeUrl, themeId, headers, retries + 1);
195617
+ }
195592
195618
  return shopifyEssential;
195593
195619
  }
195594
195620
  async function enrichSessionWithStorefrontPassword(shopifyEssential, storeUrl, password, headers) {
@@ -197146,9 +197172,7 @@ Console.descriptionWithMarkdown = `Starts the Shopify Liquid REPL (read-eval-pri
197146
197172
  Console.description = _a2.descriptionWithoutMarkdown();
197147
197173
  Console.flags = {
197148
197174
  ...globalFlags,
197149
- store: themeFlags.store,
197150
- password: themeFlags.password,
197151
- environment: themeFlags.environment,
197175
+ ...themeFlags,
197152
197176
  url: import_core3.Flags.string({
197153
197177
  description: "The url to be used as context",
197154
197178
  env: "SHOPIFY_FLAG_URL",
@@ -197379,7 +197403,7 @@ Delete.description = _a3.descriptionWithoutMarkdown();
197379
197403
  Delete.strict = !1;
197380
197404
  Delete.flags = {
197381
197405
  ...globalFlags,
197382
- password: themeFlags.password,
197406
+ ...themeFlags,
197383
197407
  development: import_core4.Flags.boolean({
197384
197408
  char: "d",
197385
197409
  description: "Delete your development theme.",
@@ -197400,9 +197424,7 @@ Delete.flags = {
197400
197424
  description: "Theme ID or name of the remote theme.",
197401
197425
  env: "SHOPIFY_FLAG_THEME_ID",
197402
197426
  multiple: !0
197403
- }),
197404
- store: themeFlags.store,
197405
- environment: themeFlags.environment
197427
+ })
197406
197428
  };
197407
197429
  var delete_default = Delete;
197408
197430
 
@@ -200083,7 +200105,7 @@ You can run this command only in a directory that matches the [default Shopify t
200083
200105
  Dev.description = _a4.descriptionWithoutMarkdown();
200084
200106
  Dev.flags = {
200085
200107
  ...globalFlags,
200086
- path: themeFlags.path,
200108
+ ...themeFlags,
200087
200109
  host: import_core5.Flags.string({
200088
200110
  description: "Set which network interface the web server listens on. The default value is 127.0.0.1.",
200089
200111
  env: "SHOPIFY_FLAG_HOST"
@@ -200119,7 +200141,6 @@ Dev.flags = {
200119
200141
  description: "Local port to serve theme preview from.",
200120
200142
  env: "SHOPIFY_FLAG_PORT"
200121
200143
  }),
200122
- store: themeFlags.store,
200123
200144
  theme: import_core5.Flags.string({
200124
200145
  char: "t",
200125
200146
  description: "Theme ID or name of the remote theme.",
@@ -200148,8 +200169,6 @@ Dev.flags = {
200148
200169
  description: "Proceed without confirmation, if current directory does not seem to be theme directory.",
200149
200170
  env: "SHOPIFY_FLAG_FORCE"
200150
200171
  }),
200151
- password: themeFlags.password,
200152
- environment: themeFlags.environment,
200153
200172
  notify: import_core5.Flags.string({
200154
200173
  description: "The file path or URL. The file path is to a file that you want updated on idle. The URL path is where you want a webhook posted to report on file changes.",
200155
200174
  env: "SHOPIFY_FLAG_NOTIFY"
@@ -200266,9 +200285,7 @@ Info.description = "Displays information about your theme environment, including
200266
200285
  Info.flags = {
200267
200286
  ...globalFlags,
200268
200287
  ...jsonFlag,
200269
- store: themeFlags.store,
200270
- password: themeFlags.password,
200271
- environment: themeFlags.environment,
200288
+ ...themeFlags,
200272
200289
  development: import_core6.Flags.boolean({
200273
200290
  char: "d",
200274
200291
  description: "Retrieve info from your development theme.",
@@ -200474,8 +200491,7 @@ List2.description = "Lists the themes in your store, along with their IDs and st
200474
200491
  List2.flags = {
200475
200492
  ...globalFlags,
200476
200493
  ...jsonFlag,
200477
- password: themeFlags.password,
200478
- store: themeFlags.store,
200494
+ ...themeFlags,
200479
200495
  role: import_core8.Flags.custom({
200480
200496
  description: "Only list themes with the given role.",
200481
200497
  options: ALLOWED_ROLES,
@@ -200488,8 +200504,7 @@ List2.flags = {
200488
200504
  id: import_core8.Flags.integer({
200489
200505
  description: "Only list theme with the given ID.",
200490
200506
  env: "SHOPIFY_FLAG_ID"
200491
- }),
200492
- environment: themeFlags.environment
200507
+ })
200493
200508
  };
200494
200509
  List2.multiEnvironmentsFlags = ["store", "password"];
200495
200510
  var list_default = List2;
@@ -200545,7 +200560,7 @@ Open.descriptionWithMarkdown = `Returns links that let you preview the specified
200545
200560
  Open.description = _a8.descriptionWithoutMarkdown();
200546
200561
  Open.flags = {
200547
200562
  ...globalFlags,
200548
- password: themeFlags.password,
200563
+ ...themeFlags,
200549
200564
  development: import_core9.Flags.boolean({
200550
200565
  char: "d",
200551
200566
  description: "Open your development theme.",
@@ -200565,9 +200580,7 @@ Open.flags = {
200565
200580
  char: "t",
200566
200581
  description: "Theme ID or name of the remote theme.",
200567
200582
  env: "SHOPIFY_FLAG_THEME_ID"
200568
- }),
200569
- store: themeFlags.store,
200570
- environment: themeFlags.environment
200583
+ })
200571
200584
  };
200572
200585
  var open_default = Open;
200573
200586
 
@@ -200646,6 +200659,7 @@ var import_theme_check_node4 = __toESM(require_dist6(), 1), themeFilesPattern =
200646
200659
  "blocks/**",
200647
200660
  "config/**",
200648
200661
  "layout/**",
200662
+ "listings/**/*",
200649
200663
  "locales/**",
200650
200664
  "sections/**",
200651
200665
  "snippets/**",
@@ -200693,6 +200707,8 @@ Package.descriptionWithMarkdown = `Packages your local theme files into a ZIP fi
200693
200707
 
200694
200708
  Only folders that match the [default Shopify theme folder structure](https://shopify.dev/docs/storefronts/themes/tools/cli#directory-structure) are included in the package.
200695
200709
 
200710
+ The package includes the \`listings\` directory if present (required for multi-preset themes per [Theme Store requirements](https://shopify.dev/docs/storefronts/themes/store/requirements#adding-presets-to-your-theme-zip-submission)).
200711
+
200696
200712
  The ZIP file uses the name \`theme_name-theme_version.zip\`, based on parameters in your [settings_schema.json](https://shopify.dev/docs/storefronts/themes/architecture/config/settings-schema-json) file.`;
200697
200713
  Package.description = _a9.descriptionWithoutMarkdown();
200698
200714
  Package.flags = {
@@ -200775,8 +200791,7 @@ Profile.descriptionWithMarkdown = `Profile the Shopify Liquid on a given page.
200775
200791
  Profile.description = _a10.descriptionWithoutMarkdown();
200776
200792
  Profile.flags = {
200777
200793
  ...globalFlags,
200778
- store: themeFlags.store,
200779
- password: themeFlags.password,
200794
+ ...themeFlags,
200780
200795
  theme: import_core10.Flags.string({
200781
200796
  char: "t",
200782
200797
  description: "Theme ID or name of the remote theme.",
@@ -200791,7 +200806,6 @@ Profile.flags = {
200791
200806
  description: "The password for storefronts with password protection.",
200792
200807
  env: "SHOPIFY_FLAG_STORE_PASSWORD"
200793
200808
  }),
200794
- environment: themeFlags.environment,
200795
200809
  ...jsonFlag
200796
200810
  };
200797
200811
  var profile_default = Profile;
@@ -200864,7 +200878,7 @@ Publish.description = _a11.descriptionWithoutMarkdown();
200864
200878
  Publish.strict = !1;
200865
200879
  Publish.flags = {
200866
200880
  ...globalFlags,
200867
- password: themeFlags.password,
200881
+ ...themeFlags,
200868
200882
  force: import_core11.Flags.boolean({
200869
200883
  char: "f",
200870
200884
  description: "Skip confirmation.",
@@ -200874,9 +200888,7 @@ Publish.flags = {
200874
200888
  char: "t",
200875
200889
  description: "Theme ID or name of the remote theme.",
200876
200890
  env: "SHOPIFY_FLAG_THEME_ID"
200877
- }),
200878
- store: themeFlags.store,
200879
- environment: themeFlags.environment
200891
+ })
200880
200892
  };
200881
200893
  var publish_default = Publish;
200882
200894
 
@@ -201377,9 +201389,7 @@ Rename.descriptionWithMarkdown = `Renames a theme in your store.
201377
201389
  Rename.description = _a15.descriptionWithoutMarkdown();
201378
201390
  Rename.flags = {
201379
201391
  ...globalFlags,
201380
- store: themeFlags.store,
201381
- password: themeFlags.password,
201382
- environment: themeFlags.environment,
201392
+ ...themeFlags,
201383
201393
  name: import_core15.Flags.string({
201384
201394
  char: "n",
201385
201395
  description: "The new name for the theme.",
@@ -205153,10 +205163,10 @@ async function buildAssetsUrl(port, root) {
205153
205163
  async function startMiniOxygen(options, useNodeRuntime = !1) {
205154
205164
  if (useNodeRuntime) {
205155
205165
  process.env.MINIFLARE_SUBREQUEST_LIMIT = 100;
205156
- let { startNodeServer } = await import("./node-OFSPLONP.js");
205166
+ let { startNodeServer } = await import("./node-GHBQEWAW.js");
205157
205167
  return startNodeServer(options);
205158
205168
  }
205159
- let { startWorkerdServer } = await import("./workerd-IDTCFUND.js");
205169
+ let { startWorkerdServer } = await import("./workerd-BCMLUCF7.js");
205160
205170
  return startWorkerdServer(options);
205161
205171
  }
205162
205172
 
@@ -208092,7 +208102,6 @@ var environmentVariableNames = {
208092
208102
  enableAppLogPolling: "SHOPIFY_CLI_ENABLE_APP_LOG_POLLING",
208093
208103
  templatesJsonPath: "SHOPIFY_CLI_APP_TEMPLATES_JSON_PATH",
208094
208104
  mkcertBinaryPath: "SHOPIFY_CLI_MKCERT_BINARY",
208095
- enableUnsupportedConfigPropertyChecks: "SHOPIFY_CLI_ENABLE_UNSUPPORTED_CONFIG_PROPERTY_CHECKS",
208096
208105
  disableUnsupportedConfigPropertyChecks: "SHOPIFY_CLI_DISABLE_UNSUPPORTED_CONFIG_PROPERTY_CHECKS",
208097
208106
  disableMinificationOnDev: "SHOPIFY_CLI_DISABLE_MINIFICATION_ON_DEV",
208098
208107
  disableWasmTomlPatch: "SHOPIFY_CLI_DISABLE_WASM_TOML_PATCH"
@@ -208441,14 +208450,6 @@ async function showApiKeyDeprecationWarning() {
208441
208450
  });
208442
208451
  }
208443
208452
 
208444
- // ../app/dist/cli/utilities/app-command.js
208445
- init_cjs_shims();
208446
- var AppCommand = class extends base_command_default {
208447
- environmentsFilename() {
208448
- return configurationFileNames.appEnvironments;
208449
- }
208450
- };
208451
-
208452
208453
  // ../app/dist/cli/services/app-context.js
208453
208454
  init_cjs_shims();
208454
208455
 
@@ -209070,6 +209071,7 @@ var WebConfigurationAuthCallbackPathSchema = z.preprocess(ensurePathStartsWithSl
209070
209071
  await patchAppHiddenConfigFile(path4, String(this.configuration.client_id), this.hiddenConfig);
209071
209072
  }
209072
209073
  async preDeployValidation() {
209074
+ this.validateWebhookLegacyFlowCompatibility();
209073
209075
  let functionExtensionsWithUiHandle = this.allExtensions.filter((ext) => ext.isFunctionExtension && ext.configuration.ui?.handle);
209074
209076
  if (functionExtensionsWithUiHandle.length > 0) {
209075
209077
  let errors = validateFunctionExtensionsWithUiHandle(functionExtensionsWithUiHandle, this.allExtensions);
@@ -209138,6 +209140,25 @@ var WebConfigurationAuthCallbackPathSchema = z.preprocess(ensurePathStartsWithSl
209138
209140
  prefix: devApplicationURLs.appProxy.proxySubPathPrefix
209139
209141
  }), this.configuration.auth?.redirect_urls && (this.configuration.auth.redirect_urls = devApplicationURLs.redirectUrlWhitelist));
209140
209142
  }
209143
+ /**
209144
+ * Validates that app-specific webhooks are not used with legacy install flow.
209145
+ * This incompatibility exists because app-specific webhooks require declarative
209146
+ * scopes in the Partner Dashboard, which aren't synced when using legacy flow.
209147
+ * @throws When app-specific webhooks are used with legacy install flow
209148
+ */
209149
+ validateWebhookLegacyFlowCompatibility() {
209150
+ if (!isCurrentAppSchema(this.configuration))
209151
+ return;
209152
+ let hasAppSpecificWebhooks = (this.configuration.webhooks?.subscriptions?.length ?? 0) > 0, usesLegacyInstallFlow = this.configuration.access_scopes?.use_legacy_install_flow === !0;
209153
+ if (hasAppSpecificWebhooks && usesLegacyInstallFlow)
209154
+ throw new AbortError("App-specific webhook subscriptions are not supported when use_legacy_install_flow is enabled.", `To use app-specific webhooks, you need to:
209155
+ 1. Remove 'use_legacy_install_flow = true' from your configuration
209156
+ 2. Run 'shopify app deploy' to sync your scopes with the Partner Dashboard
209157
+
209158
+ Alternatively, continue using shop-specific webhooks with the legacy install flow.
209159
+
209160
+ Learn more: https://shopify.dev/docs/apps/build/authentication-authorization/app-installation`);
209161
+ }
209141
209162
  };
209142
209163
  function validateFunctionExtensionsWithUiHandle(functionExtensionsWithUiHandle, allExtensions) {
209143
209164
  let errors = [];
@@ -210826,7 +210847,7 @@ var CUSTOM_CREDIT_CARD_TARGET = "payments.custom-credit-card.render", MAX_CHECKO
210826
210847
  multiple_capture: z.boolean(),
210827
210848
  checkout_hosted_fields: z.array(z.string()).optional(),
210828
210849
  ui_extension_handle: z.string().optional(),
210829
- encryption_certificate_fingerprint: z.string().min(1, { message: "Encryption certificate fingerprint can't be blank" }),
210850
+ encryption_certificate_fingerprint: z.string(),
210830
210851
  checkout_payment_method_fields: z.array(z.object({
210831
210852
  type: z.union([z.literal("string"), z.literal("number"), z.literal("boolean")]),
210832
210853
  required: z.boolean(),
@@ -210895,7 +210916,7 @@ var CREDIT_CARD_TARGET = "payments.credit-card.render", MAX_CHECKOUT_PAYMENT_MET
210895
210916
  required_error: "supports_moto is required",
210896
210917
  invalid_type_error: "Value must be Boolean"
210897
210918
  }),
210898
- encryption_certificate_fingerprint: z.string().min(1, { message: "Encryption certificate fingerprint can't be blank" }),
210919
+ encryption_certificate_fingerprint: z.string(),
210899
210920
  checkout_payment_method_fields: z.array(z.object({
210900
210921
  type: z.union([z.literal("string"), z.literal("number"), z.literal("boolean")]),
210901
210922
  required: z.boolean(),
@@ -211692,12 +211713,7 @@ function parseConfigurationObjectAgainstSpecification(spec2, filepath, configura
211692
211713
  }
211693
211714
  }
211694
211715
  async function shouldFailIfUnsupportedConfigProperty() {
211695
- let env4 = getEnvironmentVariables(), enableUnsupportedConfigPropertyChecks = env4[environmentVariableNames.enableUnsupportedConfigPropertyChecks];
211696
- if (isTruthy(enableUnsupportedConfigPropertyChecks))
211697
- return !0;
211698
- if (!await isShopify())
211699
- return !1;
211700
- let disableUnsupportedConfigPropertyChecks = env4[environmentVariableNames.disableUnsupportedConfigPropertyChecks];
211716
+ let disableUnsupportedConfigPropertyChecks = getEnvironmentVariables()[environmentVariableNames.disableUnsupportedConfigPropertyChecks];
211701
211717
  return !isTruthy(disableUnsupportedConfigPropertyChecks);
211702
211718
  }
211703
211719
  var AppErrors = class {
@@ -213453,13 +213469,16 @@ var PartnersClient = class {
213453
213469
  }
213454
213470
  async templateSpecifications({ apiKey }) {
213455
213471
  let variables = { apiKey };
213456
- return (await this.request(RemoteTemplateSpecificationsQuery, variables)).templateSpecifications.map((template) => {
213457
- let { types, ...rest } = template;
213458
- return {
213459
- ...rest,
213460
- ...types[0]
213461
- };
213462
- });
213472
+ return {
213473
+ templates: (await this.request(RemoteTemplateSpecificationsQuery, variables)).templateSpecifications.map((template) => {
213474
+ let { types, ...rest } = template;
213475
+ return {
213476
+ ...rest,
213477
+ ...types[0]
213478
+ };
213479
+ }),
213480
+ groupOrder: []
213481
+ };
213463
213482
  }
213464
213483
  async createApp(org, options) {
213465
213484
  let variables = getAppVars(org, options.name, options.isLaunchable, options.scopesArray), result = await this.request(CreateAppQuery, variables);
@@ -216038,8 +216057,13 @@ var TEMPLATE_JSON_URL = "https://cdn.shopify.com/static/cli/extensions/templates
216038
216057
  "This likely means a problem with your internet connection."
216039
216058
  ]);
216040
216059
  }
216041
- let counter = 0;
216042
- return (await allowedTemplates(templates2, async (betaFlags) => this.organizationBetaFlags(organizationId, betaFlags))).map((template) => ({ ...template, sortPriority: counter++ }));
216060
+ let counter = 0, filteredTemplates = (await allowedTemplates(templates2, async (betaFlags) => this.organizationBetaFlags(organizationId, betaFlags))).map((template) => ({ ...template, sortPriority: counter++ })), groupOrder = [];
216061
+ for (let template of templates2)
216062
+ template.group && !groupOrder.includes(template.group) && groupOrder.push(template.group);
216063
+ return {
216064
+ templates: filteredTemplates,
216065
+ groupOrder
216066
+ };
216043
216067
  }
216044
216068
  async createApp(org, options) {
216045
216069
  let apiVersion = (await this.apiVersions(org.id)).publicApiVersions.filter((version) => version !== "unstable").sort().at(-1) ?? "unstable", variables = createAppVars(options, apiVersion), mutation = CreateApp, result = await this.appManagementRequest({
@@ -218176,10 +218200,34 @@ async function logMetadata(app, organization, resetUsed) {
218176
218200
  cmd_app_reset_used: resetUsed
218177
218201
  }));
218178
218202
  }
218203
+ async function localAppContext({ directory, userProvidedConfigName, unsafeReportMode = !1 }) {
218204
+ let specifications = await loadLocalExtensionsSpecifications();
218205
+ return loadApp({
218206
+ directory,
218207
+ userProvidedConfigName,
218208
+ specifications,
218209
+ mode: unsafeReportMode ? "report" : "strict"
218210
+ });
218211
+ }
218212
+
218213
+ // ../app/dist/cli/utilities/app-unlinked-command.js
218214
+ init_cjs_shims();
218215
+
218216
+ // ../app/dist/cli/utilities/app-command.js
218217
+ init_cjs_shims();
218218
+ var AppCommand = class extends base_command_default {
218219
+ environmentsFilename() {
218220
+ return configurationFileNames.appEnvironments;
218221
+ }
218222
+ };
218223
+
218224
+ // ../app/dist/cli/utilities/app-unlinked-command.js
218225
+ var AppUnlinkedCommand = class extends AppCommand {
218226
+ };
218179
218227
 
218180
218228
  // ../app/dist/cli/commands/app/build.js
218181
218229
  var import_core30 = __toESM(require_lib(), 1);
218182
- var _a17, Build2 = class extends AppCommand {
218230
+ var _a17, Build2 = class extends AppUnlinkedCommand {
218183
218231
  async run() {
218184
218232
  let { flags } = await this.parse(_a17);
218185
218233
  flags["api-key"] && await showApiKeyDeprecationWarning();
@@ -218187,10 +218235,8 @@ var _a17, Build2 = class extends AppCommand {
218187
218235
  await addPublicMetadata(() => ({
218188
218236
  cmd_app_dependency_installation_skipped: flags["skip-dependencies-installation"]
218189
218237
  }));
218190
- let { app } = await linkedAppContext({
218238
+ let app = await localAppContext({
218191
218239
  directory: flags.path,
218192
- clientId: apiKey,
218193
- forceRelink: flags.reset,
218194
218240
  userProvidedConfigName: flags.config
218195
218241
  });
218196
218242
  return await build_default({ app, skipDependenciesInstallation: flags["skip-dependencies-installation"], apiKey }), { app };
@@ -218220,7 +218266,14 @@ var build_default2 = Build2;
218220
218266
 
218221
218267
  // ../app/dist/cli/commands/app/config/link.js
218222
218268
  init_cjs_shims();
218223
- var _a18, ConfigLink = class extends AppCommand {
218269
+
218270
+ // ../app/dist/cli/utilities/app-linked-command.js
218271
+ init_cjs_shims();
218272
+ var AppLinkedCommand = class extends AppCommand {
218273
+ };
218274
+
218275
+ // ../app/dist/cli/commands/app/config/link.js
218276
+ var _a18, ConfigLink = class extends AppLinkedCommand {
218224
218277
  async run() {
218225
218278
  let { flags } = await this.parse(_a18), options = {
218226
218279
  directory: flags.path,
@@ -218251,7 +218304,7 @@ var link_default = ConfigLink;
218251
218304
  // ../app/dist/cli/commands/app/config/use.js
218252
218305
  init_cjs_shims();
218253
218306
  var import_core31 = __toESM(require_lib(), 1);
218254
- var _a19, { config, ...appFlagsWithoutConfig } = appFlags, ConfigUse = class extends AppCommand {
218307
+ var _a19, { config, ...appFlagsWithoutConfig } = appFlags, ConfigUse = class extends AppLinkedCommand {
218255
218308
  async run() {
218256
218309
  let { flags, args } = await this.parse(_a19);
218257
218310
  await checkFolderIsValidApp(flags.path), await use2({ directory: flags.path, configName: args.config, reset: flags.reset });
@@ -218673,7 +218726,7 @@ var AppEventWatcher = class extends EventEmitter4 {
218673
218726
  };
218674
218727
 
218675
218728
  // ../app/dist/cli/commands/app/demo/watcher.js
218676
- var DemoWatcher = class _DemoWatcher extends AppCommand {
218729
+ var DemoWatcher = class _DemoWatcher extends AppLinkedCommand {
218677
218730
  async run() {
218678
218731
  let { flags } = await this.parse(_DemoWatcher), { app } = await linkedAppContext({
218679
218732
  directory: flags.path,
@@ -218975,7 +219028,7 @@ function validateMessage(message) {
218975
219028
 
218976
219029
  // ../app/dist/cli/commands/app/deploy.js
218977
219030
  var import_core32 = __toESM(require_lib(), 1);
218978
- var _a20, Deploy2 = class extends AppCommand {
219031
+ var _a20, Deploy2 = class extends AppLinkedCommand {
218979
219032
  async run() {
218980
219033
  let { flags } = await this.parse(_a20);
218981
219034
  await metadata_default.addPublicMetadata(() => ({
@@ -219634,7 +219687,7 @@ init_cjs_shims();
219634
219687
  init_cjs_shims();
219635
219688
  var EventType2;
219636
219689
  (function(EventType3) {
219637
- EventType3.Update = "update", EventType3.Dispatch = "dispatch";
219690
+ EventType3.Update = "update", EventType3.Dispatch = "dispatch", EventType3.Log = "log";
219638
219691
  })(EventType2 || (EventType2 = {}));
219639
219692
 
219640
219693
  // ../app/dist/cli/services/dev/extension/websocket/handlers.js
@@ -219654,12 +219707,49 @@ function getConnectionDoneHandler(wss, options) {
219654
219707
  outputDebug(outputContent`Sending connected payload: ${outputToken.json(connectedPayload)}`, options.stdout), ws.send(JSON.stringify(connectedPayload)), ws.on("message", getOnMessageHandler(wss, options));
219655
219708
  };
219656
219709
  }
219710
+ function parseLogMessage(message) {
219711
+ try {
219712
+ let parsed = JSON.parse(message);
219713
+ if (!Array.isArray(parsed))
219714
+ return message;
219715
+ let formatted = parsed.map((arg) => typeof arg == "object" && arg !== null ? outputToken.json(arg).output() : String(arg)).join(" ");
219716
+ return outputContent`${formatted}`.value;
219717
+ } catch (error) {
219718
+ if (error instanceof SyntaxError)
219719
+ return message;
219720
+ throw error;
219721
+ }
219722
+ }
219723
+ var consoleTypeColors = {
219724
+ debug: (text) => outputToken.gray(text),
219725
+ warn: (text) => outputToken.yellow(text),
219726
+ error: (text) => outputToken.errorText(text)
219727
+ };
219728
+ function getOutput({ type, message }) {
219729
+ let formattedMessage = parseLogMessage(message);
219730
+ switch (type) {
219731
+ case "debug":
219732
+ case "warn":
219733
+ case "error":
219734
+ return outputContent`${consoleTypeColors[type](type.toUpperCase())}: ${formattedMessage}`.value;
219735
+ case "log":
219736
+ case "info":
219737
+ return formattedMessage;
219738
+ default:
219739
+ return `${type.toUpperCase()}: ${formattedMessage}`;
219740
+ }
219741
+ }
219742
+ function handleLogEvent(eventData, options) {
219743
+ useConcurrentOutputContext({ outputPrefix: eventData.extensionName, stripAnsi: !1 }, () => {
219744
+ options.stdout.write(getOutput(eventData));
219745
+ });
219746
+ }
219657
219747
  function getOnMessageHandler(wss, options) {
219658
219748
  return (data) => {
219659
219749
  let jsonData = JSON.parse(data.toString()), { event: eventType, data: eventData } = jsonData;
219660
219750
  if (outputDebug(outputContent`Received websocket message with event type ${eventType} and data:
219661
219751
  ${outputToken.json(eventData)}
219662
- `, options.stdout), eventType === "update") {
219752
+ `, options.stdout), eventType === EventType2.Update) {
219663
219753
  let payloadStoreApiKey = options.payloadStore.getRawPayload().app.apiKey, eventAppApiKey = eventData.app?.apiKey;
219664
219754
  if (eventData.app) {
219665
219755
  if (payloadStoreApiKey !== eventAppApiKey)
@@ -219667,10 +219757,10 @@ ${outputToken.json(eventData)}
219667
219757
  options.payloadStore.updateApp(eventData.app);
219668
219758
  }
219669
219759
  eventData.extensions && options.payloadStore.updateExtensions(eventData.extensions);
219670
- } else if (eventType === "dispatch") {
219760
+ } else if (eventType === EventType2.Dispatch) {
219671
219761
  let outGoingMessage = getOutgoingDispatchMessage(jsonData, options);
219672
219762
  notifyClients(wss, outGoingMessage, options);
219673
- }
219763
+ } else eventType === EventType2.Log && handleLogEvent(eventData, options);
219674
219764
  };
219675
219765
  }
219676
219766
  function getPayloadUpdateHandler(wss, options) {
@@ -223448,7 +223538,7 @@ async function getTunnelMode({ useLocalhost, localhostPort, tunnelUrl }) {
223448
223538
 
223449
223539
  // ../app/dist/cli/commands/app/dev.js
223450
223540
  var import_core33 = __toESM(require_lib(), 1);
223451
- var _a21, Dev4 = class extends AppCommand {
223541
+ var _a21, Dev4 = class extends AppLinkedCommand {
223452
223542
  static analyticsStopCommand() {
223453
223543
  return "app dev stop";
223454
223544
  }
@@ -224058,7 +224148,7 @@ function renderAppLogsConfigInfo(appName, storeFqdn, storeFqdns, configFile, org
224058
224148
 
224059
224149
  // ../app/dist/cli/commands/app/logs.js
224060
224150
  var import_core34 = __toESM(require_lib(), 1);
224061
- var _a22, Logs2 = class extends AppCommand {
224151
+ var _a22, Logs2 = class extends AppLinkedCommand {
224062
224152
  async run() {
224063
224153
  let { flags } = await this.parse(_a22), apiKey = flags["client-id"] ?? flags["api-key"];
224064
224154
  await checkFolderIsValidApp(flags.path);
@@ -224131,7 +224221,7 @@ function sources(app) {
224131
224221
  }
224132
224222
 
224133
224223
  // ../app/dist/cli/commands/app/app-logs/sources.js
224134
- var _a23, Sources = class extends AppCommand {
224224
+ var _a23, Sources = class extends AppLinkedCommand {
224135
224225
  async run() {
224136
224226
  let { flags } = await this.parse(_a23), { app } = await linkedAppContext({
224137
224227
  directory: flags.path,
@@ -224191,7 +224281,7 @@ ${newEnvFileContent}
224191
224281
 
224192
224282
  // ../app/dist/cli/commands/app/env/pull.js
224193
224283
  var import_core35 = __toESM(require_lib(), 1);
224194
- var _a24, EnvPull2 = class extends AppCommand {
224284
+ var _a24, EnvPull2 = class extends AppLinkedCommand {
224195
224285
  async run() {
224196
224286
  let { flags } = await this.parse(_a24), { app, remoteApp, organization } = await linkedAppContext({
224197
224287
  directory: flags.path,
@@ -224238,7 +224328,7 @@ async function outputEnv(app, remoteApp, organization, format5) {
224238
224328
  }
224239
224329
 
224240
224330
  // ../app/dist/cli/commands/app/env/show.js
224241
- var _a25, EnvShow = class extends AppCommand {
224331
+ var _a25, EnvShow = class extends AppLinkedCommand {
224242
224332
  async run() {
224243
224333
  let { flags } = await this.parse(_a25), { app, remoteApp, organization } = await linkedAppContext({
224244
224334
  directory: flags.path,
@@ -224328,17 +224418,21 @@ async function inFunctionContext({ path: path4, userProvidedConfigName, apiKey,
224328
224418
  clientId: apiKey,
224329
224419
  forceRelink: reset2 ?? !1,
224330
224420
  userProvidedConfigName
224331
- }), allFunctions = app.allExtensions.filter((ext) => ext.isFunctionExtension), ourFunction = allFunctions.find((fun) => fun.directory === path4);
224421
+ }), ourFunction = await chooseFunction(app, path4);
224422
+ return callback(app, developerPlatformClient, ourFunction, organization.id);
224423
+ }
224424
+ async function chooseFunction(app, path4) {
224425
+ let allFunctions = app.allExtensions.filter((ext) => ext.isFunctionExtension), ourFunction = allFunctions.find((fun) => fun.directory === path4);
224332
224426
  if (ourFunction)
224333
- return callback(app, developerPlatformClient, ourFunction, organization.id);
224334
- if (isTerminalInteractive()) {
224335
- let selectedFunction = await renderAutocompletePrompt({
224427
+ return ourFunction;
224428
+ if (allFunctions.length === 1 && allFunctions[0])
224429
+ return allFunctions[0];
224430
+ if (isTerminalInteractive())
224431
+ return await renderAutocompletePrompt({
224336
224432
  message: "Which function?",
224337
224433
  choices: allFunctions.map((shopifyFunction) => ({ label: shopifyFunction.handle, value: shopifyFunction }))
224338
224434
  });
224339
- return callback(app, developerPlatformClient, selectedFunction, organization.id);
224340
- } else
224341
- throw new AbortError("Run this command from a function directory or use `--path` to specify a function directory.");
224435
+ throw new AbortError("Run this command from a function directory or use `--path` to specify a function directory.");
224342
224436
  }
224343
224437
  async function getOrGenerateSchemaPath(extension, app, developerPlatformClient, orgId) {
224344
224438
  let path4 = joinPath(extension.directory, "schema.graphql");
@@ -224353,22 +224447,19 @@ async function getOrGenerateSchemaPath(extension, app, developerPlatformClient,
224353
224447
  }
224354
224448
 
224355
224449
  // ../app/dist/cli/commands/app/function/build.js
224356
- var _a26, FunctionBuild = class extends AppCommand {
224450
+ var _a26, FunctionBuild = class extends AppUnlinkedCommand {
224357
224451
  async run() {
224358
- let { flags } = await this.parse(_a26);
224359
- return { app: await inFunctionContext({
224360
- path: flags.path,
224361
- userProvidedConfigName: flags.config,
224362
- apiKey: flags["client-id"],
224363
- reset: flags.reset,
224364
- callback: async (app2, _3, ourFunction) => (await buildFunctionExtension(ourFunction, {
224365
- app: app2,
224366
- stdout: process.stdout,
224367
- stderr: process.stderr,
224368
- useTasks: !0,
224369
- environment: "production"
224370
- }), renderSuccess({ headline: "Function built successfully." }), app2)
224371
- }) };
224452
+ let { flags } = await this.parse(_a26), app = await localAppContext({
224453
+ directory: flags.path,
224454
+ userProvidedConfigName: flags.config
224455
+ }), ourFunction = await chooseFunction(app, flags.path);
224456
+ return await buildFunctionExtension(ourFunction, {
224457
+ app,
224458
+ stdout: process.stdout,
224459
+ stderr: process.stderr,
224460
+ useTasks: !0,
224461
+ environment: "production"
224462
+ }), renderSuccess({ headline: "Function built successfully." }), { app };
224372
224463
  }
224373
224464
  };
224374
224465
  _a26 = FunctionBuild;
@@ -224746,7 +224837,7 @@ function getAllFunctionRunFileNames(functionRunsDir) {
224746
224837
  }
224747
224838
 
224748
224839
  // ../app/dist/cli/commands/app/function/replay.js
224749
- var import_core37 = __toESM(require_lib(), 1), _a27, FunctionReplay = class extends AppCommand {
224840
+ var import_core37 = __toESM(require_lib(), 1), _a27, FunctionReplay = class extends AppLinkedCommand {
224750
224841
  async run() {
224751
224842
  let { flags } = await this.parse(_a27);
224752
224843
  flags["api-key"] && await showApiKeyDeprecationWarning();
@@ -224801,7 +224892,7 @@ var replay_default = FunctionReplay;
224801
224892
  // ../app/dist/cli/commands/app/function/run.js
224802
224893
  init_cjs_shims();
224803
224894
  var import_core38 = __toESM(require_lib(), 1);
224804
- var _a28, DEFAULT_FUNCTION_EXPORT = "_start", FunctionRun = class extends AppCommand {
224895
+ var _a28, DEFAULT_FUNCTION_EXPORT = "_start", FunctionRun = class extends AppLinkedCommand {
224805
224896
  async run() {
224806
224897
  let { flags } = await this.parse(_a28);
224807
224898
  return { app: await inFunctionContext({
@@ -224868,7 +224959,7 @@ var run_default = FunctionRun;
224868
224959
  // ../app/dist/cli/commands/app/function/schema.js
224869
224960
  init_cjs_shims();
224870
224961
  var import_core39 = __toESM(require_lib(), 1);
224871
- var _a29, FetchSchema = class extends AppCommand {
224962
+ var _a29, FetchSchema = class extends AppLinkedCommand {
224872
224963
  async run() {
224873
224964
  let { flags } = await this.parse(_a29);
224874
224965
  flags["api-key"] && await showApiKeyDeprecationWarning();
@@ -224915,7 +225006,7 @@ var schema_default = FetchSchema;
224915
225006
 
224916
225007
  // ../app/dist/cli/commands/app/function/typegen.js
224917
225008
  init_cjs_shims();
224918
- var _a30, FunctionTypegen = class extends AppCommand {
225009
+ var _a30, FunctionTypegen = class extends AppLinkedCommand {
224919
225010
  async run() {
224920
225011
  let { flags } = await this.parse(_a30);
224921
225012
  return { app: await inFunctionContext({
@@ -224955,11 +225046,14 @@ function isPolarisUnifiedEnabled() {
224955
225046
 
224956
225047
  // ../app/dist/cli/services/generate/fetch-template-specifications.js
224957
225048
  async function fetchExtensionTemplates(developerPlatformClient, app, availableSpecifications) {
224958
- let remoteTemplates = await developerPlatformClient.templateSpecifications(app), polarisUnifiedEnabled = isPolarisUnifiedEnabled();
224959
- return remoteTemplates.filter((template) => availableSpecifications.includes(template.identifier) || availableSpecifications.includes(template.type)).map((template) => template.type === "ui_extension" ? {
224960
- ...template,
224961
- supportedFlavors: template.supportedFlavors.filter((flavor) => polarisUnifiedEnabled ? flavor.value === "preact" : flavor.value !== "preact")
224962
- } : template).filter((template) => template.supportedFlavors.length > 0);
225049
+ let { templates: remoteTemplates, groupOrder } = await developerPlatformClient.templateSpecifications(app), polarisUnifiedEnabled = isPolarisUnifiedEnabled();
225050
+ return {
225051
+ templates: remoteTemplates.filter((template) => availableSpecifications.includes(template.identifier) || availableSpecifications.includes(template.type)).map((template) => template.type === "ui_extension" ? {
225052
+ ...template,
225053
+ supportedFlavors: template.supportedFlavors.filter((flavor) => polarisUnifiedEnabled ? flavor.value === "preact" : flavor.value !== "preact")
225054
+ } : template).filter((template) => template.supportedFlavors.length > 0),
225055
+ groupOrder
225056
+ };
224963
225057
  }
224964
225058
 
224965
225059
  // ../app/dist/cli/prompts/generate/extension.js
@@ -224989,7 +225083,8 @@ var generateExtensionPrompts = async (options) => {
224989
225083
  throw new AbortError("You have reached the limit for the number of extensions you can create.");
224990
225084
  templateType = await renderAutocompletePrompt({
224991
225085
  message: "Type of extension?",
224992
- choices: buildChoices(extensionTemplates, options.unavailableExtensions)
225086
+ choices: buildChoices(extensionTemplates, options.unavailableExtensions),
225087
+ groupOrder: options.groupOrder
224993
225088
  });
224994
225089
  }
224995
225090
  let extensionTemplate = extensionTemplates.find((template) => template.identifier === templateType), name = options.name || await promptName(options.directory, extensionTemplate.defaultName), flavor = options.extensionFlavor ?? await promptFlavor(extensionTemplate);
@@ -225199,12 +225294,12 @@ async function downloadOrFindTemplateDirectory(url, extensionFlavor, tmpDir, onG
225199
225294
 
225200
225295
  // ../app/dist/cli/services/generate.js
225201
225296
  async function generate(options) {
225202
- let { app, developerPlatformClient, remoteApp, specifications, template } = options, availableSpecifications = specifications.map((spec2) => spec2.identifier), extensionTemplates = await fetchExtensionTemplates(developerPlatformClient, remoteApp, availableSpecifications), promptOptions = await buildPromptOptions(extensionTemplates, specifications, app, options), promptAnswers = await extension_default(promptOptions);
225297
+ let { app, developerPlatformClient, remoteApp, specifications, template } = options, availableSpecifications = specifications.map((spec2) => spec2.identifier), { templates: extensionTemplates, groupOrder } = await fetchExtensionTemplates(developerPlatformClient, remoteApp, availableSpecifications), promptOptions = await buildPromptOptions(extensionTemplates, groupOrder, specifications, app, options), promptAnswers = await extension_default(promptOptions);
225203
225298
  await saveAnalyticsMetadata(promptAnswers, template);
225204
225299
  let generateExtensionOptions = buildGenerateOptions(promptAnswers, app, options, developerPlatformClient), generatedExtension = await generateExtensionTemplate(generateExtensionOptions);
225205
225300
  renderSuccessMessage2(generatedExtension, app.packageManager);
225206
225301
  }
225207
- async function buildPromptOptions(extensionTemplates, specifications, app, options) {
225302
+ async function buildPromptOptions(extensionTemplates, groupOrder, specifications, app, options) {
225208
225303
  let extensionTemplate = await handleTypeParameter(options.template, app, extensionTemplates, specifications);
225209
225304
  validateExtensionFlavor(extensionTemplate, options.flavor);
225210
225305
  let { validTemplates, templatesOverlimit } = checkLimits(extensionTemplates, specifications, app);
@@ -225216,7 +225311,8 @@ async function buildPromptOptions(extensionTemplates, specifications, app, optio
225216
225311
  app,
225217
225312
  extensionTemplates: validTemplates ?? [],
225218
225313
  unavailableExtensions: templatesOverlimit ?? [],
225219
- reset: options.reset
225314
+ reset: options.reset,
225315
+ groupOrder
225220
225316
  };
225221
225317
  }
225222
225318
  function checkLimits(extensionTemplates, specifications, app) {
@@ -225285,7 +225381,7 @@ var generate_default = generate;
225285
225381
 
225286
225382
  // ../app/dist/cli/commands/app/generate/extension.js
225287
225383
  var import_core40 = __toESM(require_lib(), 1);
225288
- var _a31, AppGenerateExtension = class extends AppCommand {
225384
+ var _a31, AppGenerateExtension = class extends AppLinkedCommand {
225289
225385
  static analyticsNameOverride() {
225290
225386
  return "app scaffold extension";
225291
225387
  }
@@ -225754,7 +225850,7 @@ var getMigrationChoices = () => [
225754
225850
  extensionTypes: ["app_link", "bulk_action"],
225755
225851
  buildTomlObject: buildTomlObject3
225756
225852
  }
225757
- ], ImportExtensions = class _ImportExtensions extends AppCommand {
225853
+ ], ImportExtensions = class _ImportExtensions extends AppLinkedCommand {
225758
225854
  async run() {
225759
225855
  let { flags } = await this.parse(_ImportExtensions), appContext = await linkedAppContext({
225760
225856
  directory: flags.path,
@@ -225952,7 +226048,7 @@ Directory components`.toUpperCase(),
225952
226048
 
225953
226049
  // ../app/dist/cli/commands/app/info.js
225954
226050
  var import_core42 = __toESM(require_lib(), 1);
225955
- var _a33, AppInfo2 = class extends AppCommand {
226051
+ var _a33, AppInfo2 = class extends AppLinkedCommand {
225956
226052
  async run() {
225957
226053
  let { flags } = await this.parse(_a33), { app, remoteApp, organization, developerPlatformClient } = await linkedAppContext({
225958
226054
  directory: flags.path,
@@ -226302,7 +226398,7 @@ function validateFlavorValue(template, flavor) {
226302
226398
 
226303
226399
  // ../app/dist/cli/commands/app/init.js
226304
226400
  var import_core43 = __toESM(require_lib(), 1);
226305
- var _a34, Init3 = class extends AppCommand {
226401
+ var _a34, Init3 = class extends AppLinkedCommand {
226306
226402
  async run() {
226307
226403
  let { flags } = await this.parse(_a34);
226308
226404
  validateTemplateValue(flags.template), validateFlavorValue(flags.template, flags.flavor);
@@ -226466,7 +226562,7 @@ ${versionDetails.message}` : ""
226466
226562
 
226467
226563
  // ../app/dist/cli/commands/app/release.js
226468
226564
  var import_core44 = __toESM(require_lib(), 1);
226469
- var _a35, Release = class extends AppCommand {
226565
+ var _a35, Release = class extends AppLinkedCommand {
226470
226566
  async run() {
226471
226567
  let { flags } = await this.parse(_a35);
226472
226568
  flags["api-key"] && await showApiKeyDeprecationWarning();
@@ -226585,7 +226681,7 @@ async function versionList(options) {
226585
226681
  }
226586
226682
 
226587
226683
  // ../app/dist/cli/commands/app/versions/list.js
226588
- var import_core45 = __toESM(require_lib(), 1), _a36, VersionsList = class extends AppCommand {
226684
+ var import_core45 = __toESM(require_lib(), 1), _a36, VersionsList = class extends AppLinkedCommand {
226589
226685
  async run() {
226590
226686
  let { flags } = await this.parse(_a36);
226591
226687
  flags["api-key"] && await showApiKeyDeprecationWarning();
@@ -226757,7 +226853,7 @@ function formatErrors(errors) {
226757
226853
 
226758
226854
  // ../app/dist/cli/commands/app/webhook/trigger.js
226759
226855
  var import_core46 = __toESM(require_lib(), 1);
226760
- var _a37, WebhookTrigger = class extends AppCommand {
226856
+ var _a37, WebhookTrigger = class extends AppLinkedCommand {
226761
226857
  async run() {
226762
226858
  let { flags } = await this.parse(_a37);
226763
226859
  flags["shared-secret"] && renderWarning({
@@ -226916,7 +227012,7 @@ async function devClean(options) {
226916
227012
 
226917
227013
  // ../app/dist/cli/commands/app/dev/clean.js
226918
227014
  var import_core47 = __toESM(require_lib(), 1);
226919
- var _a38, DevClean = class extends AppCommand {
227015
+ var _a38, DevClean = class extends AppLinkedCommand {
226920
227016
  async run() {
226921
227017
  let { flags } = await this.parse(_a38), appContextResult = await linkedAppContext({
226922
227018
  directory: flags.path,