@shopify/cli 3.81.2 → 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-SYSFH5UI.js → chunk-25WAB7NJ.js} +2 -2
  2. package/dist/{chunk-2KWYWUB3.js → chunk-3Q5VPXT5.js} +17 -10
  3. package/dist/{chunk-JSV7CLE5.js → chunk-6AJRDC5C.js} +3 -3
  4. package/dist/{chunk-X2IUQUGP.js → chunk-6C6ZDQRA.js} +2 -2
  5. package/dist/{chunk-V2VRGD2W.js → chunk-74CFIJBV.js} +3 -3
  6. package/dist/{chunk-Y4DTNOTB.js → chunk-7MYG46RI.js} +6 -6
  7. package/dist/{chunk-NQ5I6XQM.js → chunk-7ZNBHIYT.js} +5 -5
  8. package/dist/{chunk-KBRGOZ4R.js → chunk-AJDONTSK.js} +3 -3
  9. package/dist/{chunk-QWR45GZB.js → chunk-BSTZYPZU.js} +19 -9
  10. package/dist/{chunk-GNIHBXG6.js → chunk-CFNCXOAV.js} +2 -2
  11. package/dist/{chunk-TYFNEBTF.js → chunk-EEYW5FSA.js} +3 -3
  12. package/dist/{chunk-MKTTOK7P.js → chunk-FYDURVQO.js} +4 -4
  13. package/dist/{chunk-ST2557ZT.js → chunk-HOYO6JKN.js} +3 -3
  14. package/dist/{chunk-UZOXTQRI.js → chunk-JLJTVUDK.js} +11 -6
  15. package/dist/{chunk-I5GZNFE5.js → chunk-JLKSXSVY.js} +3 -3
  16. package/dist/{chunk-Q3L5AS4S.js → chunk-KB5GMUHY.js} +6 -6
  17. package/dist/{chunk-JZDA5RDA.js → chunk-KUAANQ7T.js} +4 -4
  18. package/dist/{chunk-VMOW3UFB.js → chunk-MFC6MLP7.js} +3 -3
  19. package/dist/{chunk-SQ5I7L4B.js → chunk-MSSZWK63.js} +4 -4
  20. package/dist/{chunk-WNAOEU7P.js → chunk-MWVORSD7.js} +6 -6
  21. package/dist/{chunk-MUE6EAKT.js → chunk-PRSTYBLZ.js} +3 -3
  22. package/dist/{chunk-6AIVUZDO.js → chunk-QEIHQ2YM.js} +2 -2
  23. package/dist/{chunk-V7M7AO2M.js → chunk-QIECGUO5.js} +3 -3
  24. package/dist/{chunk-ICOQSJ5W.js → chunk-R2LEUYIF.js} +3 -3
  25. package/dist/{chunk-MKRZYHOX.js → chunk-RLS2ONCK.js} +2 -2
  26. package/dist/{chunk-JEEL2VDS.js → chunk-TCCRXQUU.js} +3 -3
  27. package/dist/{chunk-UD2LINKV.js → chunk-UQXK6QDK.js} +3 -3
  28. package/dist/{chunk-RBIBCG2T.js → chunk-VWOOMRYF.js} +4 -4
  29. package/dist/{chunk-UA6V476X.js → chunk-WDBIXJF6.js} +2 -2
  30. package/dist/{chunk-3T3ACEB6.js → chunk-XYELYAVC.js} +5 -5
  31. package/dist/{chunk-VHVSXYDG.js → chunk-YPSBMB7C.js} +2 -2
  32. package/dist/{chunk-3LZI32WD.js → chunk-YUBYB2KK.js} +10 -8
  33. package/dist/{chunk-VLKHGWXM.js → chunk-YUXFQXPK.js} +7 -7
  34. package/dist/{chunk-Y4QJSFVY.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-AGJRZGNY.js → custom-oclif-loader-BEAC6M5I.js} +2 -2
  67. package/dist/{error-handler-FV7IMU3S.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 +275 -177
  71. package/dist/{local-LOH6WNIE.js → local-ZIKS25AW.js} +2 -2
  72. package/dist/{node-7R7VKIC3.js → node-GHBQEWAW.js} +12 -12
  73. package/dist/{node-package-manager-4APHMQLC.js → node-package-manager-T3RQZ6EF.js} +3 -3
  74. package/dist/tsconfig.tsbuildinfo +1 -1
  75. package/dist/{ui-IROK54OF.js → ui-NKEN4MZY.js} +2 -2
  76. package/dist/{workerd-HIXCYQNX.js → workerd-BCMLUCF7.js} +12 -12
  77. package/oclif.manifest.json +84 -12
  78. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -119,6 +119,7 @@ import {
119
119
  partnersRequestDoc,
120
120
  patchEnvFile,
121
121
  readAndParseDotEnv,
122
+ removeGitRemote,
122
123
  renderCssPrompt,
123
124
  renderI18nPrompt,
124
125
  renderLoginSuccess,
@@ -135,7 +136,7 @@ import {
135
136
  supressNodeExperimentalWarnings,
136
137
  unsetStorefront,
137
138
  waitForJob
138
- } from "./chunk-QWR45GZB.js";
139
+ } from "./chunk-BSTZYPZU.js";
139
140
  import {
140
141
  require_fs,
141
142
  require_glob,
@@ -150,69 +151,69 @@ import {
150
151
  } from "./chunk-3GXB4ZRP.js";
151
152
  import {
152
153
  List
153
- } from "./chunk-MKTTOK7P.js";
154
+ } from "./chunk-FYDURVQO.js";
154
155
  import {
155
156
  Search
156
- } from "./chunk-TYFNEBTF.js";
157
+ } from "./chunk-EEYW5FSA.js";
157
158
  import {
158
159
  Upgrade
159
- } from "./chunk-RBIBCG2T.js";
160
- import "./chunk-KBRGOZ4R.js";
160
+ } from "./chunk-VWOOMRYF.js";
161
+ import "./chunk-AJDONTSK.js";
161
162
  import {
162
163
  Version
163
- } from "./chunk-VMOW3UFB.js";
164
- import "./chunk-UD2LINKV.js";
165
- import "./chunk-UA6V476X.js";
164
+ } from "./chunk-MFC6MLP7.js";
165
+ import "./chunk-UQXK6QDK.js";
166
+ import "./chunk-WDBIXJF6.js";
166
167
  import {
167
168
  KitchenSinkAll
168
- } from "./chunk-NQ5I6XQM.js";
169
+ } from "./chunk-7ZNBHIYT.js";
169
170
  import {
170
171
  KitchenSinkPrompts
171
- } from "./chunk-MUE6EAKT.js";
172
- import "./chunk-SYSFH5UI.js";
172
+ } from "./chunk-PRSTYBLZ.js";
173
+ import "./chunk-25WAB7NJ.js";
173
174
  import {
174
175
  KitchenSinkStatic
175
- } from "./chunk-ST2557ZT.js";
176
- import "./chunk-MKRZYHOX.js";
176
+ } from "./chunk-HOYO6JKN.js";
177
+ import "./chunk-RLS2ONCK.js";
177
178
  import {
178
179
  Generate
179
- } from "./chunk-JEEL2VDS.js";
180
- import "./chunk-3T3ACEB6.js";
180
+ } from "./chunk-TCCRXQUU.js";
181
+ import "./chunk-XYELYAVC.js";
181
182
  import {
182
183
  Logout
183
- } from "./chunk-JZDA5RDA.js";
184
+ } from "./chunk-KUAANQ7T.js";
184
185
  import {
185
186
  ensureAuthenticatedAdmin,
186
187
  ensureAuthenticatedAppManagementAndBusinessPlatform,
187
188
  ensureAuthenticatedPartners,
188
189
  ensureAuthenticatedStorefront,
189
190
  ensureAuthenticatedThemes
190
- } from "./chunk-SQ5I7L4B.js";
191
+ } from "./chunk-MSSZWK63.js";
191
192
  import {
192
193
  ClearCache,
193
194
  globalFlags,
194
195
  jsonFlag,
195
196
  runCLI
196
- } from "./chunk-VLKHGWXM.js";
197
+ } from "./chunk-YUXFQXPK.js";
197
198
  import {
198
199
  CommandFlags
199
- } from "./chunk-ICOQSJ5W.js";
200
+ } from "./chunk-R2LEUYIF.js";
200
201
  import {
201
202
  DocsGenerate
202
- } from "./chunk-I5GZNFE5.js";
203
+ } from "./chunk-JLKSXSVY.js";
203
204
  import {
204
205
  HelpCommand
205
- } from "./chunk-X2IUQUGP.js";
206
+ } from "./chunk-6C6ZDQRA.js";
206
207
  import {
207
208
  KitchenSinkAsync
208
- } from "./chunk-V2VRGD2W.js";
209
- import "./chunk-6AIVUZDO.js";
209
+ } from "./chunk-74CFIJBV.js";
210
+ import "./chunk-QEIHQ2YM.js";
210
211
  import {
211
212
  base_command_default,
212
213
  decodeToml,
213
214
  encodeToml,
214
215
  loadEnvironment
215
- } from "./chunk-3LZI32WD.js";
216
+ } from "./chunk-YUBYB2KK.js";
216
217
  import {
217
218
  require_byline,
218
219
  require_end_of_stream,
@@ -220,7 +221,7 @@ import {
220
221
  require_iserror,
221
222
  require_pump,
222
223
  require_stack_generator
223
- } from "./chunk-WNAOEU7P.js";
224
+ } from "./chunk-MWVORSD7.js";
224
225
  import {
225
226
  require_once
226
227
  } from "./chunk-SHWOPMLQ.js";
@@ -228,7 +229,7 @@ import {
228
229
  fanoutHooks,
229
230
  getListOfTunnelPlugins,
230
231
  reportAnalyticsEvent
231
- } from "./chunk-Y4DTNOTB.js";
232
+ } from "./chunk-7MYG46RI.js";
232
233
  import {
233
234
  adminFqdn,
234
235
  appDevFqdn,
@@ -239,10 +240,10 @@ import {
239
240
  normalizeStoreFqdn,
240
241
  ok,
241
242
  partnersFqdn
242
- } from "./chunk-UZOXTQRI.js";
243
+ } from "./chunk-JLJTVUDK.js";
243
244
  import {
244
245
  showNotificationsIfNeeded
245
- } from "./chunk-Q3L5AS4S.js";
246
+ } from "./chunk-KB5GMUHY.js";
246
247
  import {
247
248
  ClientError,
248
249
  FetchError,
@@ -264,11 +265,11 @@ import {
264
265
  require_mime_types,
265
266
  shopifyFetch,
266
267
  z
267
- } from "./chunk-V7M7AO2M.js";
268
+ } from "./chunk-QIECGUO5.js";
268
269
  import "./chunk-25IMI7TH.js";
269
270
  import {
270
271
  CLI_KIT_VERSION
271
- } from "./chunk-GNIHBXG6.js";
272
+ } from "./chunk-CFNCXOAV.js";
272
273
  import {
273
274
  LocalStorage,
274
275
  UnknownPackageManagerError,
@@ -292,7 +293,7 @@ import {
292
293
  usesWorkspaces,
293
294
  versionSatisfies,
294
295
  writePackageJSON
295
- } from "./chunk-JSV7CLE5.js";
296
+ } from "./chunk-6AJRDC5C.js";
296
297
  import {
297
298
  AbortController as AbortController2,
298
299
  AbortError,
@@ -506,7 +507,7 @@ import {
506
507
  username,
507
508
  writeFile,
508
509
  writeFileSync
509
- } from "./chunk-2KWYWUB3.js";
510
+ } from "./chunk-3Q5VPXT5.js";
510
511
  import {
511
512
  require_semver
512
513
  } from "./chunk-HMDWNGIV.js";
@@ -193625,7 +193626,7 @@ init_cjs_shims();
193625
193626
  var import_core = __toESM(require_lib(), 1);
193626
193627
  var themeFlags = {
193627
193628
  path: import_core.Flags.string({
193628
- description: "The path to your theme directory.",
193629
+ description: "The path where you want to run the command. Defaults to the current working directory.",
193629
193630
  env: "SHOPIFY_FLAG_PATH",
193630
193631
  parse: async (input) => resolvePath(input),
193631
193632
  default: async () => cwd(),
@@ -193903,7 +193904,7 @@ function assertThemeStoreExists(storage = themeLocalStorage()) {
193903
193904
  function ensureThemeStore(flags) {
193904
193905
  let store = flags.store || getThemeStore();
193905
193906
  if (!store)
193906
- 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.`);
193907
193908
  return setThemeStore(store), store;
193908
193909
  }
193909
193910
 
@@ -193945,33 +193946,53 @@ var ThemeCommand = class extends base_command_default {
193945
193946
  environmentsFilename() {
193946
193947
  return configurationFileName;
193947
193948
  }
193948
- async command(_flags, _session) {
193949
+ async command(_flags, _session, _context) {
193949
193950
  }
193950
193951
  async run(_opts) {
193951
193952
  let klass = this.constructor, requiredFlags = klass.multiEnvironmentsFlags, { flags } = await this.parse(klass);
193952
- if (!flags.environment) {
193953
+ if (!flags.environment?.length) {
193953
193954
  let session = await this.ensureAuthenticated(flags);
193954
193955
  await this.command(flags, session);
193955
193956
  return;
193956
193957
  }
193957
- 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 = {};
193958
193965
  for (let environmentName of environments) {
193959
- 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
+ });
193960
193970
  sessions[environmentName] = await this.ensureAuthenticated(environmentConfig);
193961
193971
  }
193962
- await Promise.all(environments.map(async (environment) => {
193963
- let environmentConfig = await loadEnvironment(environment, "shopify.theme.toml", { from: flags.path }), environmentFlags = {
193964
- ...flags,
193965
- ...environmentConfig,
193966
- environment: [environment]
193967
- };
193968
- if (!this.validConfig(environmentConfig, requiredFlags, environment))
193969
- return;
193970
- let session = sessions[environment];
193971
- if (!session)
193972
- throw new AbortError(`No session found for environment ${environment}`);
193973
- return this.command(environmentFlags, session);
193974
- }));
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
+ });
193975
193996
  }
193976
193997
  async ensureAuthenticated(flags) {
193977
193998
  let store = flags.store, password = flags.password;
@@ -195569,7 +195590,7 @@ async function getStorefrontSessionCookies(storeUrl, themeId, password, headers
195569
195590
  let storefrontDigest = await enrichSessionWithStorefrontPassword(shopifyEssential, storeUrl, password, headers);
195570
195591
  return cookieRecord.storefront_digest = storefrontDigest, cookieRecord;
195571
195592
  }
195572
- async function sessionEssentialCookie(storeUrl, themeId, headers) {
195593
+ async function sessionEssentialCookie(storeUrl, themeId, headers, retries = 1) {
195573
195594
  let params = new URLSearchParams({
195574
195595
  preview_theme_id: themeId,
195575
195596
  _fd: "0",
@@ -195582,12 +195603,18 @@ async function sessionEssentialCookie(storeUrl, themeId, headers) {
195582
195603
  ...defaultHeaders()
195583
195604
  }
195584
195605
  }), setCookies = response.headers.raw()["set-cookie"] ?? [], shopifyEssential = getCookie(setCookies, "_shopify_essential");
195585
- if (!shopifyEssential)
195586
- throw outputDebug(`Failed to obtain _shopify_essential cookie.
195606
+ if (!shopifyEssential) {
195607
+ if (outputDebug(`Failed to obtain _shopify_essential cookie.
195587
195608
 
195588
195609
  -Request ID: ${response.headers.get("x-request-id") ?? "unknown"}
195589
195610
 
195590
- -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
+ }
195591
195618
  return shopifyEssential;
195592
195619
  }
195593
195620
  async function enrichSessionWithStorefrontPassword(shopifyEssential, storeUrl, password, headers) {
@@ -197145,9 +197172,7 @@ Console.descriptionWithMarkdown = `Starts the Shopify Liquid REPL (read-eval-pri
197145
197172
  Console.description = _a2.descriptionWithoutMarkdown();
197146
197173
  Console.flags = {
197147
197174
  ...globalFlags,
197148
- store: themeFlags.store,
197149
- password: themeFlags.password,
197150
- environment: themeFlags.environment,
197175
+ ...themeFlags,
197151
197176
  url: import_core3.Flags.string({
197152
197177
  description: "The url to be used as context",
197153
197178
  env: "SHOPIFY_FLAG_URL",
@@ -197378,7 +197403,7 @@ Delete.description = _a3.descriptionWithoutMarkdown();
197378
197403
  Delete.strict = !1;
197379
197404
  Delete.flags = {
197380
197405
  ...globalFlags,
197381
- password: themeFlags.password,
197406
+ ...themeFlags,
197382
197407
  development: import_core4.Flags.boolean({
197383
197408
  char: "d",
197384
197409
  description: "Delete your development theme.",
@@ -197399,9 +197424,7 @@ Delete.flags = {
197399
197424
  description: "Theme ID or name of the remote theme.",
197400
197425
  env: "SHOPIFY_FLAG_THEME_ID",
197401
197426
  multiple: !0
197402
- }),
197403
- store: themeFlags.store,
197404
- environment: themeFlags.environment
197427
+ })
197405
197428
  };
197406
197429
  var delete_default = Delete;
197407
197430
 
@@ -200082,7 +200105,7 @@ You can run this command only in a directory that matches the [default Shopify t
200082
200105
  Dev.description = _a4.descriptionWithoutMarkdown();
200083
200106
  Dev.flags = {
200084
200107
  ...globalFlags,
200085
- path: themeFlags.path,
200108
+ ...themeFlags,
200086
200109
  host: import_core5.Flags.string({
200087
200110
  description: "Set which network interface the web server listens on. The default value is 127.0.0.1.",
200088
200111
  env: "SHOPIFY_FLAG_HOST"
@@ -200118,7 +200141,6 @@ Dev.flags = {
200118
200141
  description: "Local port to serve theme preview from.",
200119
200142
  env: "SHOPIFY_FLAG_PORT"
200120
200143
  }),
200121
- store: themeFlags.store,
200122
200144
  theme: import_core5.Flags.string({
200123
200145
  char: "t",
200124
200146
  description: "Theme ID or name of the remote theme.",
@@ -200147,8 +200169,6 @@ Dev.flags = {
200147
200169
  description: "Proceed without confirmation, if current directory does not seem to be theme directory.",
200148
200170
  env: "SHOPIFY_FLAG_FORCE"
200149
200171
  }),
200150
- password: themeFlags.password,
200151
- environment: themeFlags.environment,
200152
200172
  notify: import_core5.Flags.string({
200153
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.",
200154
200174
  env: "SHOPIFY_FLAG_NOTIFY"
@@ -200265,9 +200285,7 @@ Info.description = "Displays information about your theme environment, including
200265
200285
  Info.flags = {
200266
200286
  ...globalFlags,
200267
200287
  ...jsonFlag,
200268
- store: themeFlags.store,
200269
- password: themeFlags.password,
200270
- environment: themeFlags.environment,
200288
+ ...themeFlags,
200271
200289
  development: import_core6.Flags.boolean({
200272
200290
  char: "d",
200273
200291
  description: "Retrieve info from your development theme.",
@@ -200301,8 +200319,9 @@ async function downloadRepository(repoUrl, destination, latestTag) {
200301
200319
  await downloadGitRepository({
200302
200320
  repoUrl,
200303
200321
  destination,
200304
- latestTag
200305
- });
200322
+ latestTag,
200323
+ shallow: !0
200324
+ }), await removeGitRemote(destination);
200306
200325
  }
200307
200326
  }
200308
200327
  ]);
@@ -200472,8 +200491,7 @@ List2.description = "Lists the themes in your store, along with their IDs and st
200472
200491
  List2.flags = {
200473
200492
  ...globalFlags,
200474
200493
  ...jsonFlag,
200475
- password: themeFlags.password,
200476
- store: themeFlags.store,
200494
+ ...themeFlags,
200477
200495
  role: import_core8.Flags.custom({
200478
200496
  description: "Only list themes with the given role.",
200479
200497
  options: ALLOWED_ROLES,
@@ -200486,8 +200504,7 @@ List2.flags = {
200486
200504
  id: import_core8.Flags.integer({
200487
200505
  description: "Only list theme with the given ID.",
200488
200506
  env: "SHOPIFY_FLAG_ID"
200489
- }),
200490
- environment: themeFlags.environment
200507
+ })
200491
200508
  };
200492
200509
  List2.multiEnvironmentsFlags = ["store", "password"];
200493
200510
  var list_default = List2;
@@ -200543,7 +200560,7 @@ Open.descriptionWithMarkdown = `Returns links that let you preview the specified
200543
200560
  Open.description = _a8.descriptionWithoutMarkdown();
200544
200561
  Open.flags = {
200545
200562
  ...globalFlags,
200546
- password: themeFlags.password,
200563
+ ...themeFlags,
200547
200564
  development: import_core9.Flags.boolean({
200548
200565
  char: "d",
200549
200566
  description: "Open your development theme.",
@@ -200563,9 +200580,7 @@ Open.flags = {
200563
200580
  char: "t",
200564
200581
  description: "Theme ID or name of the remote theme.",
200565
200582
  env: "SHOPIFY_FLAG_THEME_ID"
200566
- }),
200567
- store: themeFlags.store,
200568
- environment: themeFlags.environment
200583
+ })
200569
200584
  };
200570
200585
  var open_default = Open;
200571
200586
 
@@ -200644,6 +200659,7 @@ var import_theme_check_node4 = __toESM(require_dist6(), 1), themeFilesPattern =
200644
200659
  "blocks/**",
200645
200660
  "config/**",
200646
200661
  "layout/**",
200662
+ "listings/**/*",
200647
200663
  "locales/**",
200648
200664
  "sections/**",
200649
200665
  "snippets/**",
@@ -200691,6 +200707,8 @@ Package.descriptionWithMarkdown = `Packages your local theme files into a ZIP fi
200691
200707
 
200692
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.
200693
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
+
200694
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.`;
200695
200713
  Package.description = _a9.descriptionWithoutMarkdown();
200696
200714
  Package.flags = {
@@ -200773,8 +200791,7 @@ Profile.descriptionWithMarkdown = `Profile the Shopify Liquid on a given page.
200773
200791
  Profile.description = _a10.descriptionWithoutMarkdown();
200774
200792
  Profile.flags = {
200775
200793
  ...globalFlags,
200776
- store: themeFlags.store,
200777
- password: themeFlags.password,
200794
+ ...themeFlags,
200778
200795
  theme: import_core10.Flags.string({
200779
200796
  char: "t",
200780
200797
  description: "Theme ID or name of the remote theme.",
@@ -200789,7 +200806,6 @@ Profile.flags = {
200789
200806
  description: "The password for storefronts with password protection.",
200790
200807
  env: "SHOPIFY_FLAG_STORE_PASSWORD"
200791
200808
  }),
200792
- environment: themeFlags.environment,
200793
200809
  ...jsonFlag
200794
200810
  };
200795
200811
  var profile_default = Profile;
@@ -200862,7 +200878,7 @@ Publish.description = _a11.descriptionWithoutMarkdown();
200862
200878
  Publish.strict = !1;
200863
200879
  Publish.flags = {
200864
200880
  ...globalFlags,
200865
- password: themeFlags.password,
200881
+ ...themeFlags,
200866
200882
  force: import_core11.Flags.boolean({
200867
200883
  char: "f",
200868
200884
  description: "Skip confirmation.",
@@ -200872,9 +200888,7 @@ Publish.flags = {
200872
200888
  char: "t",
200873
200889
  description: "Theme ID or name of the remote theme.",
200874
200890
  env: "SHOPIFY_FLAG_THEME_ID"
200875
- }),
200876
- store: themeFlags.store,
200877
- environment: themeFlags.environment
200891
+ })
200878
200892
  };
200879
200893
  var publish_default = Publish;
200880
200894
 
@@ -201375,9 +201389,7 @@ Rename.descriptionWithMarkdown = `Renames a theme in your store.
201375
201389
  Rename.description = _a15.descriptionWithoutMarkdown();
201376
201390
  Rename.flags = {
201377
201391
  ...globalFlags,
201378
- store: themeFlags.store,
201379
- password: themeFlags.password,
201380
- environment: themeFlags.environment,
201392
+ ...themeFlags,
201381
201393
  name: import_core15.Flags.string({
201382
201394
  char: "n",
201383
201395
  description: "The new name for the theme.",
@@ -205151,10 +205163,10 @@ async function buildAssetsUrl(port, root) {
205151
205163
  async function startMiniOxygen(options, useNodeRuntime = !1) {
205152
205164
  if (useNodeRuntime) {
205153
205165
  process.env.MINIFLARE_SUBREQUEST_LIMIT = 100;
205154
- let { startNodeServer } = await import("./node-7R7VKIC3.js");
205166
+ let { startNodeServer } = await import("./node-GHBQEWAW.js");
205155
205167
  return startNodeServer(options);
205156
205168
  }
205157
- let { startWorkerdServer } = await import("./workerd-HIXCYQNX.js");
205169
+ let { startWorkerdServer } = await import("./workerd-BCMLUCF7.js");
205158
205170
  return startWorkerdServer(options);
205159
205171
  }
205160
205172
 
@@ -208090,7 +208102,6 @@ var environmentVariableNames = {
208090
208102
  enableAppLogPolling: "SHOPIFY_CLI_ENABLE_APP_LOG_POLLING",
208091
208103
  templatesJsonPath: "SHOPIFY_CLI_APP_TEMPLATES_JSON_PATH",
208092
208104
  mkcertBinaryPath: "SHOPIFY_CLI_MKCERT_BINARY",
208093
- enableUnsupportedConfigPropertyChecks: "SHOPIFY_CLI_ENABLE_UNSUPPORTED_CONFIG_PROPERTY_CHECKS",
208094
208105
  disableUnsupportedConfigPropertyChecks: "SHOPIFY_CLI_DISABLE_UNSUPPORTED_CONFIG_PROPERTY_CHECKS",
208095
208106
  disableMinificationOnDev: "SHOPIFY_CLI_DISABLE_MINIFICATION_ON_DEV",
208096
208107
  disableWasmTomlPatch: "SHOPIFY_CLI_DISABLE_WASM_TOML_PATCH"
@@ -208439,14 +208450,6 @@ async function showApiKeyDeprecationWarning() {
208439
208450
  });
208440
208451
  }
208441
208452
 
208442
- // ../app/dist/cli/utilities/app-command.js
208443
- init_cjs_shims();
208444
- var AppCommand = class extends base_command_default {
208445
- environmentsFilename() {
208446
- return configurationFileNames.appEnvironments;
208447
- }
208448
- };
208449
-
208450
208453
  // ../app/dist/cli/services/app-context.js
208451
208454
  init_cjs_shims();
208452
208455
 
@@ -209068,6 +209071,7 @@ var WebConfigurationAuthCallbackPathSchema = z.preprocess(ensurePathStartsWithSl
209068
209071
  await patchAppHiddenConfigFile(path4, String(this.configuration.client_id), this.hiddenConfig);
209069
209072
  }
209070
209073
  async preDeployValidation() {
209074
+ this.validateWebhookLegacyFlowCompatibility();
209071
209075
  let functionExtensionsWithUiHandle = this.allExtensions.filter((ext) => ext.isFunctionExtension && ext.configuration.ui?.handle);
209072
209076
  if (functionExtensionsWithUiHandle.length > 0) {
209073
209077
  let errors = validateFunctionExtensionsWithUiHandle(functionExtensionsWithUiHandle, this.allExtensions);
@@ -209136,6 +209140,25 @@ var WebConfigurationAuthCallbackPathSchema = z.preprocess(ensurePathStartsWithSl
209136
209140
  prefix: devApplicationURLs.appProxy.proxySubPathPrefix
209137
209141
  }), this.configuration.auth?.redirect_urls && (this.configuration.auth.redirect_urls = devApplicationURLs.redirectUrlWhitelist));
209138
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
+ }
209139
209162
  };
209140
209163
  function validateFunctionExtensionsWithUiHandle(functionExtensionsWithUiHandle, allExtensions) {
209141
209164
  let errors = [];
@@ -210824,7 +210847,7 @@ var CUSTOM_CREDIT_CARD_TARGET = "payments.custom-credit-card.render", MAX_CHECKO
210824
210847
  multiple_capture: z.boolean(),
210825
210848
  checkout_hosted_fields: z.array(z.string()).optional(),
210826
210849
  ui_extension_handle: z.string().optional(),
210827
- encryption_certificate_fingerprint: z.string().min(1, { message: "Encryption certificate fingerprint can't be blank" }),
210850
+ encryption_certificate_fingerprint: z.string(),
210828
210851
  checkout_payment_method_fields: z.array(z.object({
210829
210852
  type: z.union([z.literal("string"), z.literal("number"), z.literal("boolean")]),
210830
210853
  required: z.boolean(),
@@ -210893,7 +210916,7 @@ var CREDIT_CARD_TARGET = "payments.credit-card.render", MAX_CHECKOUT_PAYMENT_MET
210893
210916
  required_error: "supports_moto is required",
210894
210917
  invalid_type_error: "Value must be Boolean"
210895
210918
  }),
210896
- encryption_certificate_fingerprint: z.string().min(1, { message: "Encryption certificate fingerprint can't be blank" }),
210919
+ encryption_certificate_fingerprint: z.string(),
210897
210920
  checkout_payment_method_fields: z.array(z.object({
210898
210921
  type: z.union([z.literal("string"), z.literal("number"), z.literal("boolean")]),
210899
210922
  required: z.boolean(),
@@ -211690,12 +211713,7 @@ function parseConfigurationObjectAgainstSpecification(spec2, filepath, configura
211690
211713
  }
211691
211714
  }
211692
211715
  async function shouldFailIfUnsupportedConfigProperty() {
211693
- let env4 = getEnvironmentVariables(), enableUnsupportedConfigPropertyChecks = env4[environmentVariableNames.enableUnsupportedConfigPropertyChecks];
211694
- if (isTruthy(enableUnsupportedConfigPropertyChecks))
211695
- return !0;
211696
- if (!await isShopify())
211697
- return !1;
211698
- let disableUnsupportedConfigPropertyChecks = env4[environmentVariableNames.disableUnsupportedConfigPropertyChecks];
211716
+ let disableUnsupportedConfigPropertyChecks = getEnvironmentVariables()[environmentVariableNames.disableUnsupportedConfigPropertyChecks];
211699
211717
  return !isTruthy(disableUnsupportedConfigPropertyChecks);
211700
211718
  }
211701
211719
  var AppErrors = class {
@@ -213451,13 +213469,16 @@ var PartnersClient = class {
213451
213469
  }
213452
213470
  async templateSpecifications({ apiKey }) {
213453
213471
  let variables = { apiKey };
213454
- return (await this.request(RemoteTemplateSpecificationsQuery, variables)).templateSpecifications.map((template) => {
213455
- let { types, ...rest } = template;
213456
- return {
213457
- ...rest,
213458
- ...types[0]
213459
- };
213460
- });
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
+ };
213461
213482
  }
213462
213483
  async createApp(org, options) {
213463
213484
  let variables = getAppVars(org, options.name, options.isLaunchable, options.scopesArray), result = await this.request(CreateAppQuery, variables);
@@ -216036,8 +216057,13 @@ var TEMPLATE_JSON_URL = "https://cdn.shopify.com/static/cli/extensions/templates
216036
216057
  "This likely means a problem with your internet connection."
216037
216058
  ]);
216038
216059
  }
216039
- let counter = 0;
216040
- 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
+ };
216041
216067
  }
216042
216068
  async createApp(org, options) {
216043
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({
@@ -218174,10 +218200,34 @@ async function logMetadata(app, organization, resetUsed) {
218174
218200
  cmd_app_reset_used: resetUsed
218175
218201
  }));
218176
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
+ };
218177
218227
 
218178
218228
  // ../app/dist/cli/commands/app/build.js
218179
218229
  var import_core30 = __toESM(require_lib(), 1);
218180
- var _a17, Build2 = class extends AppCommand {
218230
+ var _a17, Build2 = class extends AppUnlinkedCommand {
218181
218231
  async run() {
218182
218232
  let { flags } = await this.parse(_a17);
218183
218233
  flags["api-key"] && await showApiKeyDeprecationWarning();
@@ -218185,10 +218235,8 @@ var _a17, Build2 = class extends AppCommand {
218185
218235
  await addPublicMetadata(() => ({
218186
218236
  cmd_app_dependency_installation_skipped: flags["skip-dependencies-installation"]
218187
218237
  }));
218188
- let { app } = await linkedAppContext({
218238
+ let app = await localAppContext({
218189
218239
  directory: flags.path,
218190
- clientId: apiKey,
218191
- forceRelink: flags.reset,
218192
218240
  userProvidedConfigName: flags.config
218193
218241
  });
218194
218242
  return await build_default({ app, skipDependenciesInstallation: flags["skip-dependencies-installation"], apiKey }), { app };
@@ -218218,7 +218266,14 @@ var build_default2 = Build2;
218218
218266
 
218219
218267
  // ../app/dist/cli/commands/app/config/link.js
218220
218268
  init_cjs_shims();
218221
- 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 {
218222
218277
  async run() {
218223
218278
  let { flags } = await this.parse(_a18), options = {
218224
218279
  directory: flags.path,
@@ -218249,7 +218304,7 @@ var link_default = ConfigLink;
218249
218304
  // ../app/dist/cli/commands/app/config/use.js
218250
218305
  init_cjs_shims();
218251
218306
  var import_core31 = __toESM(require_lib(), 1);
218252
- var _a19, { config, ...appFlagsWithoutConfig } = appFlags, ConfigUse = class extends AppCommand {
218307
+ var _a19, { config, ...appFlagsWithoutConfig } = appFlags, ConfigUse = class extends AppLinkedCommand {
218253
218308
  async run() {
218254
218309
  let { flags, args } = await this.parse(_a19);
218255
218310
  await checkFolderIsValidApp(flags.path), await use2({ directory: flags.path, configName: args.config, reset: flags.reset });
@@ -218671,7 +218726,7 @@ var AppEventWatcher = class extends EventEmitter4 {
218671
218726
  };
218672
218727
 
218673
218728
  // ../app/dist/cli/commands/app/demo/watcher.js
218674
- var DemoWatcher = class _DemoWatcher extends AppCommand {
218729
+ var DemoWatcher = class _DemoWatcher extends AppLinkedCommand {
218675
218730
  async run() {
218676
218731
  let { flags } = await this.parse(_DemoWatcher), { app } = await linkedAppContext({
218677
218732
  directory: flags.path,
@@ -218973,7 +219028,7 @@ function validateMessage(message) {
218973
219028
 
218974
219029
  // ../app/dist/cli/commands/app/deploy.js
218975
219030
  var import_core32 = __toESM(require_lib(), 1);
218976
- var _a20, Deploy2 = class extends AppCommand {
219031
+ var _a20, Deploy2 = class extends AppLinkedCommand {
218977
219032
  async run() {
218978
219033
  let { flags } = await this.parse(_a20);
218979
219034
  await metadata_default.addPublicMetadata(() => ({
@@ -219632,7 +219687,7 @@ init_cjs_shims();
219632
219687
  init_cjs_shims();
219633
219688
  var EventType2;
219634
219689
  (function(EventType3) {
219635
- EventType3.Update = "update", EventType3.Dispatch = "dispatch";
219690
+ EventType3.Update = "update", EventType3.Dispatch = "dispatch", EventType3.Log = "log";
219636
219691
  })(EventType2 || (EventType2 = {}));
219637
219692
 
219638
219693
  // ../app/dist/cli/services/dev/extension/websocket/handlers.js
@@ -219652,12 +219707,49 @@ function getConnectionDoneHandler(wss, options) {
219652
219707
  outputDebug(outputContent`Sending connected payload: ${outputToken.json(connectedPayload)}`, options.stdout), ws.send(JSON.stringify(connectedPayload)), ws.on("message", getOnMessageHandler(wss, options));
219653
219708
  };
219654
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
+ }
219655
219747
  function getOnMessageHandler(wss, options) {
219656
219748
  return (data) => {
219657
219749
  let jsonData = JSON.parse(data.toString()), { event: eventType, data: eventData } = jsonData;
219658
219750
  if (outputDebug(outputContent`Received websocket message with event type ${eventType} and data:
219659
219751
  ${outputToken.json(eventData)}
219660
- `, options.stdout), eventType === "update") {
219752
+ `, options.stdout), eventType === EventType2.Update) {
219661
219753
  let payloadStoreApiKey = options.payloadStore.getRawPayload().app.apiKey, eventAppApiKey = eventData.app?.apiKey;
219662
219754
  if (eventData.app) {
219663
219755
  if (payloadStoreApiKey !== eventAppApiKey)
@@ -219665,10 +219757,10 @@ ${outputToken.json(eventData)}
219665
219757
  options.payloadStore.updateApp(eventData.app);
219666
219758
  }
219667
219759
  eventData.extensions && options.payloadStore.updateExtensions(eventData.extensions);
219668
- } else if (eventType === "dispatch") {
219760
+ } else if (eventType === EventType2.Dispatch) {
219669
219761
  let outGoingMessage = getOutgoingDispatchMessage(jsonData, options);
219670
219762
  notifyClients(wss, outGoingMessage, options);
219671
- }
219763
+ } else eventType === EventType2.Log && handleLogEvent(eventData, options);
219672
219764
  };
219673
219765
  }
219674
219766
  function getPayloadUpdateHandler(wss, options) {
@@ -223446,7 +223538,7 @@ async function getTunnelMode({ useLocalhost, localhostPort, tunnelUrl }) {
223446
223538
 
223447
223539
  // ../app/dist/cli/commands/app/dev.js
223448
223540
  var import_core33 = __toESM(require_lib(), 1);
223449
- var _a21, Dev4 = class extends AppCommand {
223541
+ var _a21, Dev4 = class extends AppLinkedCommand {
223450
223542
  static analyticsStopCommand() {
223451
223543
  return "app dev stop";
223452
223544
  }
@@ -224056,7 +224148,7 @@ function renderAppLogsConfigInfo(appName, storeFqdn, storeFqdns, configFile, org
224056
224148
 
224057
224149
  // ../app/dist/cli/commands/app/logs.js
224058
224150
  var import_core34 = __toESM(require_lib(), 1);
224059
- var _a22, Logs2 = class extends AppCommand {
224151
+ var _a22, Logs2 = class extends AppLinkedCommand {
224060
224152
  async run() {
224061
224153
  let { flags } = await this.parse(_a22), apiKey = flags["client-id"] ?? flags["api-key"];
224062
224154
  await checkFolderIsValidApp(flags.path);
@@ -224129,7 +224221,7 @@ function sources(app) {
224129
224221
  }
224130
224222
 
224131
224223
  // ../app/dist/cli/commands/app/app-logs/sources.js
224132
- var _a23, Sources = class extends AppCommand {
224224
+ var _a23, Sources = class extends AppLinkedCommand {
224133
224225
  async run() {
224134
224226
  let { flags } = await this.parse(_a23), { app } = await linkedAppContext({
224135
224227
  directory: flags.path,
@@ -224189,7 +224281,7 @@ ${newEnvFileContent}
224189
224281
 
224190
224282
  // ../app/dist/cli/commands/app/env/pull.js
224191
224283
  var import_core35 = __toESM(require_lib(), 1);
224192
- var _a24, EnvPull2 = class extends AppCommand {
224284
+ var _a24, EnvPull2 = class extends AppLinkedCommand {
224193
224285
  async run() {
224194
224286
  let { flags } = await this.parse(_a24), { app, remoteApp, organization } = await linkedAppContext({
224195
224287
  directory: flags.path,
@@ -224236,7 +224328,7 @@ async function outputEnv(app, remoteApp, organization, format5) {
224236
224328
  }
224237
224329
 
224238
224330
  // ../app/dist/cli/commands/app/env/show.js
224239
- var _a25, EnvShow = class extends AppCommand {
224331
+ var _a25, EnvShow = class extends AppLinkedCommand {
224240
224332
  async run() {
224241
224333
  let { flags } = await this.parse(_a25), { app, remoteApp, organization } = await linkedAppContext({
224242
224334
  directory: flags.path,
@@ -224326,17 +224418,21 @@ async function inFunctionContext({ path: path4, userProvidedConfigName, apiKey,
224326
224418
  clientId: apiKey,
224327
224419
  forceRelink: reset2 ?? !1,
224328
224420
  userProvidedConfigName
224329
- }), 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);
224330
224426
  if (ourFunction)
224331
- return callback(app, developerPlatformClient, ourFunction, organization.id);
224332
- if (isTerminalInteractive()) {
224333
- 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({
224334
224432
  message: "Which function?",
224335
224433
  choices: allFunctions.map((shopifyFunction) => ({ label: shopifyFunction.handle, value: shopifyFunction }))
224336
224434
  });
224337
- return callback(app, developerPlatformClient, selectedFunction, organization.id);
224338
- } else
224339
- 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.");
224340
224436
  }
224341
224437
  async function getOrGenerateSchemaPath(extension, app, developerPlatformClient, orgId) {
224342
224438
  let path4 = joinPath(extension.directory, "schema.graphql");
@@ -224351,22 +224447,19 @@ async function getOrGenerateSchemaPath(extension, app, developerPlatformClient,
224351
224447
  }
224352
224448
 
224353
224449
  // ../app/dist/cli/commands/app/function/build.js
224354
- var _a26, FunctionBuild = class extends AppCommand {
224450
+ var _a26, FunctionBuild = class extends AppUnlinkedCommand {
224355
224451
  async run() {
224356
- let { flags } = await this.parse(_a26);
224357
- return { app: await inFunctionContext({
224358
- path: flags.path,
224359
- userProvidedConfigName: flags.config,
224360
- apiKey: flags["client-id"],
224361
- reset: flags.reset,
224362
- callback: async (app2, _3, ourFunction) => (await buildFunctionExtension(ourFunction, {
224363
- app: app2,
224364
- stdout: process.stdout,
224365
- stderr: process.stderr,
224366
- useTasks: !0,
224367
- environment: "production"
224368
- }), renderSuccess({ headline: "Function built successfully." }), app2)
224369
- }) };
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 };
224370
224463
  }
224371
224464
  };
224372
224465
  _a26 = FunctionBuild;
@@ -224744,7 +224837,7 @@ function getAllFunctionRunFileNames(functionRunsDir) {
224744
224837
  }
224745
224838
 
224746
224839
  // ../app/dist/cli/commands/app/function/replay.js
224747
- 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 {
224748
224841
  async run() {
224749
224842
  let { flags } = await this.parse(_a27);
224750
224843
  flags["api-key"] && await showApiKeyDeprecationWarning();
@@ -224799,7 +224892,7 @@ var replay_default = FunctionReplay;
224799
224892
  // ../app/dist/cli/commands/app/function/run.js
224800
224893
  init_cjs_shims();
224801
224894
  var import_core38 = __toESM(require_lib(), 1);
224802
- var _a28, DEFAULT_FUNCTION_EXPORT = "_start", FunctionRun = class extends AppCommand {
224895
+ var _a28, DEFAULT_FUNCTION_EXPORT = "_start", FunctionRun = class extends AppLinkedCommand {
224803
224896
  async run() {
224804
224897
  let { flags } = await this.parse(_a28);
224805
224898
  return { app: await inFunctionContext({
@@ -224866,7 +224959,7 @@ var run_default = FunctionRun;
224866
224959
  // ../app/dist/cli/commands/app/function/schema.js
224867
224960
  init_cjs_shims();
224868
224961
  var import_core39 = __toESM(require_lib(), 1);
224869
- var _a29, FetchSchema = class extends AppCommand {
224962
+ var _a29, FetchSchema = class extends AppLinkedCommand {
224870
224963
  async run() {
224871
224964
  let { flags } = await this.parse(_a29);
224872
224965
  flags["api-key"] && await showApiKeyDeprecationWarning();
@@ -224913,7 +225006,7 @@ var schema_default = FetchSchema;
224913
225006
 
224914
225007
  // ../app/dist/cli/commands/app/function/typegen.js
224915
225008
  init_cjs_shims();
224916
- var _a30, FunctionTypegen = class extends AppCommand {
225009
+ var _a30, FunctionTypegen = class extends AppLinkedCommand {
224917
225010
  async run() {
224918
225011
  let { flags } = await this.parse(_a30);
224919
225012
  return { app: await inFunctionContext({
@@ -224953,11 +225046,14 @@ function isPolarisUnifiedEnabled() {
224953
225046
 
224954
225047
  // ../app/dist/cli/services/generate/fetch-template-specifications.js
224955
225048
  async function fetchExtensionTemplates(developerPlatformClient, app, availableSpecifications) {
224956
- let remoteTemplates = await developerPlatformClient.templateSpecifications(app), polarisUnifiedEnabled = isPolarisUnifiedEnabled();
224957
- return remoteTemplates.filter((template) => availableSpecifications.includes(template.identifier) || availableSpecifications.includes(template.type)).map((template) => template.type === "ui_extension" ? {
224958
- ...template,
224959
- supportedFlavors: template.supportedFlavors.filter((flavor) => polarisUnifiedEnabled ? flavor.value === "preact" : flavor.value !== "preact")
224960
- } : 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
+ };
224961
225057
  }
224962
225058
 
224963
225059
  // ../app/dist/cli/prompts/generate/extension.js
@@ -224987,7 +225083,8 @@ var generateExtensionPrompts = async (options) => {
224987
225083
  throw new AbortError("You have reached the limit for the number of extensions you can create.");
224988
225084
  templateType = await renderAutocompletePrompt({
224989
225085
  message: "Type of extension?",
224990
- choices: buildChoices(extensionTemplates, options.unavailableExtensions)
225086
+ choices: buildChoices(extensionTemplates, options.unavailableExtensions),
225087
+ groupOrder: options.groupOrder
224991
225088
  });
224992
225089
  }
224993
225090
  let extensionTemplate = extensionTemplates.find((template) => template.identifier === templateType), name = options.name || await promptName(options.directory, extensionTemplate.defaultName), flavor = options.extensionFlavor ?? await promptFlavor(extensionTemplate);
@@ -225197,12 +225294,12 @@ async function downloadOrFindTemplateDirectory(url, extensionFlavor, tmpDir, onG
225197
225294
 
225198
225295
  // ../app/dist/cli/services/generate.js
225199
225296
  async function generate(options) {
225200
- 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);
225201
225298
  await saveAnalyticsMetadata(promptAnswers, template);
225202
225299
  let generateExtensionOptions = buildGenerateOptions(promptAnswers, app, options, developerPlatformClient), generatedExtension = await generateExtensionTemplate(generateExtensionOptions);
225203
225300
  renderSuccessMessage2(generatedExtension, app.packageManager);
225204
225301
  }
225205
- async function buildPromptOptions(extensionTemplates, specifications, app, options) {
225302
+ async function buildPromptOptions(extensionTemplates, groupOrder, specifications, app, options) {
225206
225303
  let extensionTemplate = await handleTypeParameter(options.template, app, extensionTemplates, specifications);
225207
225304
  validateExtensionFlavor(extensionTemplate, options.flavor);
225208
225305
  let { validTemplates, templatesOverlimit } = checkLimits(extensionTemplates, specifications, app);
@@ -225214,7 +225311,8 @@ async function buildPromptOptions(extensionTemplates, specifications, app, optio
225214
225311
  app,
225215
225312
  extensionTemplates: validTemplates ?? [],
225216
225313
  unavailableExtensions: templatesOverlimit ?? [],
225217
- reset: options.reset
225314
+ reset: options.reset,
225315
+ groupOrder
225218
225316
  };
225219
225317
  }
225220
225318
  function checkLimits(extensionTemplates, specifications, app) {
@@ -225283,7 +225381,7 @@ var generate_default = generate;
225283
225381
 
225284
225382
  // ../app/dist/cli/commands/app/generate/extension.js
225285
225383
  var import_core40 = __toESM(require_lib(), 1);
225286
- var _a31, AppGenerateExtension = class extends AppCommand {
225384
+ var _a31, AppGenerateExtension = class extends AppLinkedCommand {
225287
225385
  static analyticsNameOverride() {
225288
225386
  return "app scaffold extension";
225289
225387
  }
@@ -225752,7 +225850,7 @@ var getMigrationChoices = () => [
225752
225850
  extensionTypes: ["app_link", "bulk_action"],
225753
225851
  buildTomlObject: buildTomlObject3
225754
225852
  }
225755
- ], ImportExtensions = class _ImportExtensions extends AppCommand {
225853
+ ], ImportExtensions = class _ImportExtensions extends AppLinkedCommand {
225756
225854
  async run() {
225757
225855
  let { flags } = await this.parse(_ImportExtensions), appContext = await linkedAppContext({
225758
225856
  directory: flags.path,
@@ -225950,7 +226048,7 @@ Directory components`.toUpperCase(),
225950
226048
 
225951
226049
  // ../app/dist/cli/commands/app/info.js
225952
226050
  var import_core42 = __toESM(require_lib(), 1);
225953
- var _a33, AppInfo2 = class extends AppCommand {
226051
+ var _a33, AppInfo2 = class extends AppLinkedCommand {
225954
226052
  async run() {
225955
226053
  let { flags } = await this.parse(_a33), { app, remoteApp, organization, developerPlatformClient } = await linkedAppContext({
225956
226054
  directory: flags.path,
@@ -226300,7 +226398,7 @@ function validateFlavorValue(template, flavor) {
226300
226398
 
226301
226399
  // ../app/dist/cli/commands/app/init.js
226302
226400
  var import_core43 = __toESM(require_lib(), 1);
226303
- var _a34, Init3 = class extends AppCommand {
226401
+ var _a34, Init3 = class extends AppLinkedCommand {
226304
226402
  async run() {
226305
226403
  let { flags } = await this.parse(_a34);
226306
226404
  validateTemplateValue(flags.template), validateFlavorValue(flags.template, flags.flavor);
@@ -226464,7 +226562,7 @@ ${versionDetails.message}` : ""
226464
226562
 
226465
226563
  // ../app/dist/cli/commands/app/release.js
226466
226564
  var import_core44 = __toESM(require_lib(), 1);
226467
- var _a35, Release = class extends AppCommand {
226565
+ var _a35, Release = class extends AppLinkedCommand {
226468
226566
  async run() {
226469
226567
  let { flags } = await this.parse(_a35);
226470
226568
  flags["api-key"] && await showApiKeyDeprecationWarning();
@@ -226583,7 +226681,7 @@ async function versionList(options) {
226583
226681
  }
226584
226682
 
226585
226683
  // ../app/dist/cli/commands/app/versions/list.js
226586
- 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 {
226587
226685
  async run() {
226588
226686
  let { flags } = await this.parse(_a36);
226589
226687
  flags["api-key"] && await showApiKeyDeprecationWarning();
@@ -226755,7 +226853,7 @@ function formatErrors(errors) {
226755
226853
 
226756
226854
  // ../app/dist/cli/commands/app/webhook/trigger.js
226757
226855
  var import_core46 = __toESM(require_lib(), 1);
226758
- var _a37, WebhookTrigger = class extends AppCommand {
226856
+ var _a37, WebhookTrigger = class extends AppLinkedCommand {
226759
226857
  async run() {
226760
226858
  let { flags } = await this.parse(_a37);
226761
226859
  flags["shared-secret"] && renderWarning({
@@ -226914,7 +227012,7 @@ async function devClean(options) {
226914
227012
 
226915
227013
  // ../app/dist/cli/commands/app/dev/clean.js
226916
227014
  var import_core47 = __toESM(require_lib(), 1);
226917
- var _a38, DevClean = class extends AppCommand {
227015
+ var _a38, DevClean = class extends AppLinkedCommand {
226918
227016
  async run() {
226919
227017
  let { flags } = await this.parse(_a38), appContextResult = await linkedAppContext({
226920
227018
  directory: flags.path,