@shopify/cli 3.67.3 → 3.68.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/dist/{chunk-QK4M5NLW.js → chunk-3M35CLHM.js} +2 -2
  2. package/dist/{chunk-FPTBJGSU.js → chunk-3Q52FLVU.js} +3 -3
  3. package/dist/{chunk-FMTK2DLI.js → chunk-43SYBNY3.js} +4 -4
  4. package/dist/{chunk-ADIIAXPI.js → chunk-6H3CV7RL.js} +3 -3
  5. package/dist/{chunk-NV2K2JNI.js → chunk-6MAEOVS3.js} +15 -3
  6. package/dist/{chunk-SK3QXUXV.js → chunk-6RT7XCLB.js} +4 -4
  7. package/dist/{chunk-67E32Z72.js → chunk-6ZDQFSSJ.js} +5528 -17168
  8. package/dist/{chunk-QQWDDZPJ.js → chunk-72AFLINH.js} +4 -4
  9. package/dist/{chunk-OVBHC7XZ.js → chunk-7MDO7W7X.js} +3 -3
  10. package/dist/{chunk-ESCACI7K.js → chunk-7S76TS4X.js} +5 -5
  11. package/dist/{chunk-IVO3C5LM.js → chunk-BZ2F2UZZ.js} +3 -3
  12. package/dist/chunk-EPBXQ43B.js +15959 -0
  13. package/dist/{chunk-XHO4O3WD.js → chunk-GKSNOFYA.js} +2 -2
  14. package/dist/{chunk-MP5JBUFB.js → chunk-GLV27A4V.js} +2 -2
  15. package/dist/{chunk-J44K26AK.js → chunk-HWFFJANJ.js} +3 -3
  16. package/dist/{chunk-GBZFBWCM.js → chunk-JEUAVIWO.js} +14 -12
  17. package/dist/{chunk-UE5ILNA5.js → chunk-JF3XJON5.js} +4 -4
  18. package/dist/{chunk-Y6XYGV3K.js → chunk-M7RWRKXK.js} +3 -3
  19. package/dist/{chunk-YZHXAE4H.js → chunk-MS2XBA2O.js} +4 -4
  20. package/dist/{chunk-UOH7XDLM.js → chunk-N2B5M33U.js} +3 -3
  21. package/dist/{chunk-F2FF5RRS.js → chunk-NOB736ZC.js} +3 -3
  22. package/dist/{chunk-NBY455BA.js → chunk-NPVFC3AI.js} +4 -4
  23. package/dist/chunk-O2TXYCMU.js +103 -0
  24. package/dist/{chunk-SERYSNVE.js → chunk-QAP5YFY6.js} +2 -2
  25. package/dist/{chunk-UTJGWPED.js → chunk-QNE3KDXA.js} +2 -2
  26. package/dist/{chunk-VVCAHOHL.js → chunk-RUY5HVC5.js} +2 -2
  27. package/dist/{chunk-EMUNMNK7.js → chunk-S3KCQ67R.js} +6 -6
  28. package/dist/{chunk-X2LIPDBQ.js → chunk-SARPUMOJ.js} +4 -4
  29. package/dist/{chunk-SAKJRSNZ.js → chunk-SFSTMK3J.js} +3 -3
  30. package/dist/{chunk-7BK74JM2.js → chunk-V54N7BU5.js} +3 -3
  31. package/dist/{chunk-AYJMV2UJ.js → chunk-X4VIZNM7.js} +2 -2
  32. package/dist/{chunk-UI7DIACQ.js → chunk-XPDRDFSD.js} +2 -2
  33. package/dist/{chunk-5GMBDXCT.js → chunk-YESRKQ2L.js} +2 -2
  34. package/dist/{chunk-CL6KB3RG.js → chunk-YGWIVVUL.js} +7 -3
  35. package/dist/cli/commands/auth/logout.js +11 -12
  36. package/dist/cli/commands/auth/logout.test.js +12 -13
  37. package/dist/cli/commands/debug/command-flags.js +10 -9
  38. package/dist/cli/commands/demo/catalog.js +11 -11
  39. package/dist/cli/commands/demo/generate-file.js +11 -11
  40. package/dist/cli/commands/demo/index.js +11 -11
  41. package/dist/cli/commands/demo/print-ai-prompt.js +11 -11
  42. package/dist/cli/commands/docs/generate.js +10 -9
  43. package/dist/cli/commands/docs/generate.test.js +10 -9
  44. package/dist/cli/commands/help.js +10 -9
  45. package/dist/cli/commands/kitchen-sink/async.js +11 -10
  46. package/dist/cli/commands/kitchen-sink/async.test.js +11 -10
  47. package/dist/cli/commands/kitchen-sink/index.js +13 -12
  48. package/dist/cli/commands/kitchen-sink/index.test.js +13 -12
  49. package/dist/cli/commands/kitchen-sink/prompts.js +11 -10
  50. package/dist/cli/commands/kitchen-sink/prompts.test.js +11 -10
  51. package/dist/cli/commands/kitchen-sink/static.js +11 -10
  52. package/dist/cli/commands/kitchen-sink/static.test.js +11 -10
  53. package/dist/cli/commands/search.js +11 -10
  54. package/dist/cli/commands/upgrade.js +11 -10
  55. package/dist/cli/commands/version.js +11 -10
  56. package/dist/cli/commands/version.test.js +11 -10
  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/demo.js +2 -2
  62. package/dist/cli/services/demo.test.js +3 -3
  63. package/dist/cli/services/kitchen-sink/async.js +2 -2
  64. package/dist/cli/services/kitchen-sink/prompts.js +2 -2
  65. package/dist/cli/services/kitchen-sink/static.js +2 -2
  66. package/dist/cli/services/upgrade.js +3 -3
  67. package/dist/cli/services/upgrade.test.js +5 -5
  68. package/dist/{custom-oclif-loader-ROCHTOS5.js → custom-oclif-loader-KLQXTO4F.js} +2 -2
  69. package/dist/{error-handler-GT7C27BQ.js → error-handler-5FD7IHCB.js} +9 -8
  70. package/dist/hooks/postrun.js +9 -9
  71. package/dist/hooks/prerun.js +8 -6
  72. package/dist/index.d.ts +1 -0
  73. package/dist/index.js +593 -692
  74. package/dist/{local-T3UMODTX.js → local-LNHYBD2A.js} +4 -2
  75. package/dist/{node-V2ZJPWY5.js → node-Y6VIULWD.js} +12 -13
  76. package/dist/{node-package-manager-PYU7QL5O.js → node-package-manager-6CQ6226U.js} +5 -3
  77. package/dist/{system-CEM4NSPG.js → system-LDMV4BPS.js} +2 -2
  78. package/dist/tsconfig.tsbuildinfo +1 -1
  79. package/dist/{ui-KGCQLCOJ.js → ui-PA5ER7II.js} +2 -2
  80. package/dist/{workerd-TOCBV52P.js → workerd-APENUASI.js} +12 -13
  81. package/oclif.manifest.json +15 -52
  82. package/package.json +6 -6
  83. package/dist/chunk-3E44DPAU.js +0 -118
  84. package/dist/chunk-EMJI2MUZ.js +0 -4244
  85. package/dist/chunk-LCWH3FW5.js +0 -33
package/dist/index.js CHANGED
@@ -123,7 +123,7 @@ import {
123
123
  unsetStorefront,
124
124
  waitForJob,
125
125
  writeDotEnv
126
- } from "./chunk-GBZFBWCM.js";
126
+ } from "./chunk-JEUAVIWO.js";
127
127
  import {
128
128
  require_lib as require_lib4
129
129
  } from "./chunk-NUP5TATA.js";
@@ -141,93 +141,72 @@ import {
141
141
  } from "./chunk-OXKHBIW7.js";
142
142
  import {
143
143
  KitchenSinkStatic
144
- } from "./chunk-FPTBJGSU.js";
144
+ } from "./chunk-3Q52FLVU.js";
145
145
  import {
146
146
  Search
147
- } from "./chunk-Y6XYGV3K.js";
147
+ } from "./chunk-M7RWRKXK.js";
148
148
  import {
149
149
  Upgrade
150
- } from "./chunk-QQWDDZPJ.js";
150
+ } from "./chunk-72AFLINH.js";
151
151
  import {
152
152
  getOutputUpdateCLIReminder
153
- } from "./chunk-ADIIAXPI.js";
153
+ } from "./chunk-6H3CV7RL.js";
154
154
  import {
155
155
  Version
156
- } from "./chunk-SAKJRSNZ.js";
157
- import "./chunk-F2FF5RRS.js";
158
- import "./chunk-5GMBDXCT.js";
156
+ } from "./chunk-SFSTMK3J.js";
157
+ import "./chunk-NOB736ZC.js";
158
+ import "./chunk-YESRKQ2L.js";
159
159
  import {
160
160
  HelpCommand
161
- } from "./chunk-UI7DIACQ.js";
161
+ } from "./chunk-XPDRDFSD.js";
162
162
  import {
163
163
  KitchenSinkAsync
164
- } from "./chunk-UOH7XDLM.js";
164
+ } from "./chunk-N2B5M33U.js";
165
165
  import {
166
166
  KitchenSinkAll
167
- } from "./chunk-ESCACI7K.js";
168
- import "./chunk-UTJGWPED.js";
169
- import "./chunk-VVCAHOHL.js";
167
+ } from "./chunk-7S76TS4X.js";
168
+ import "./chunk-QNE3KDXA.js";
169
+ import "./chunk-RUY5HVC5.js";
170
170
  import {
171
171
  KitchenSinkPrompts
172
- } from "./chunk-7BK74JM2.js";
173
- import "./chunk-MP5JBUFB.js";
172
+ } from "./chunk-V54N7BU5.js";
173
+ import "./chunk-GLV27A4V.js";
174
174
  import {
175
175
  Logout
176
- } from "./chunk-X2LIPDBQ.js";
176
+ } from "./chunk-SARPUMOJ.js";
177
177
  import {
178
- appManagementFqdn,
179
- checkPort,
180
- developerDashboardFqdn,
181
178
  ensureAuthenticatedAdmin,
182
179
  ensureAuthenticatedAppManagement,
183
180
  ensureAuthenticatedBusinessPlatform,
184
181
  ensureAuthenticatedPartners,
185
182
  ensureAuthenticatedStorefront,
186
- ensureAuthenticatedThemes,
187
- err,
188
- getRandomPort,
189
- graphqlRequest,
190
- graphqlRequestDoc,
191
- normalizeStoreFqdn,
192
- ok,
193
- partnersFqdn,
194
- partnersRequest,
195
- partnersRequestDoc,
196
- require_lib as require_lib3
197
- } from "./chunk-EMJI2MUZ.js";
198
- import {
199
- setNextDeprecationDate
200
- } from "./chunk-LCWH3FW5.js";
183
+ ensureAuthenticatedThemes
184
+ } from "./chunk-O2TXYCMU.js";
201
185
  import {
202
186
  CommandFlags
203
- } from "./chunk-IVO3C5LM.js";
187
+ } from "./chunk-BZ2F2UZZ.js";
204
188
  import {
205
189
  Catalog
206
- } from "./chunk-NBY455BA.js";
190
+ } from "./chunk-NPVFC3AI.js";
207
191
  import {
208
192
  GenerateFile
209
- } from "./chunk-SK3QXUXV.js";
193
+ } from "./chunk-6RT7XCLB.js";
210
194
  import {
211
195
  Demo
212
- } from "./chunk-UE5ILNA5.js";
196
+ } from "./chunk-JF3XJON5.js";
213
197
  import {
214
198
  PrintAIPrompt
215
- } from "./chunk-FMTK2DLI.js";
199
+ } from "./chunk-43SYBNY3.js";
216
200
  import "./chunk-QSUS3GJF.js";
217
- import "./chunk-AYJMV2UJ.js";
218
- import {
219
- deepStrict,
220
- errorsToString,
221
- z
222
- } from "./chunk-NLUGD7PZ.js";
201
+ import "./chunk-X4VIZNM7.js";
223
202
  import {
224
203
  DocsGenerate
225
- } from "./chunk-OVBHC7XZ.js";
204
+ } from "./chunk-7MDO7W7X.js";
226
205
  import {
227
206
  base_command_default,
228
207
  decodeToml,
229
208
  encodeToml
230
- } from "./chunk-YZHXAE4H.js";
209
+ } from "./chunk-MS2XBA2O.js";
231
210
  import {
232
211
  require_byline,
233
212
  require_end_of_stream,
@@ -235,36 +214,52 @@ import {
235
214
  require_iserror,
236
215
  require_pump,
237
216
  require_stack_generator
238
- } from "./chunk-EMUNMNK7.js";
217
+ } from "./chunk-S3KCQ67R.js";
239
218
  import {
240
- ClientError,
241
- FetchError,
242
- buildHeaders,
243
219
  execCLI2,
244
220
  fanoutHooks,
221
+ getListOfTunnelPlugins,
222
+ reportAnalyticsEvent,
223
+ version
224
+ } from "./chunk-EPBXQ43B.js";
225
+ import {
226
+ ClientError,
227
+ FetchError,
228
+ appManagementFqdn,
229
+ checkPort,
230
+ developerDashboardFqdn,
231
+ err,
245
232
  fetch as fetch2,
233
+ fileHash,
246
234
  formData,
247
235
  getBackendPort,
248
236
  getEnvironmentVariables,
249
- getListOfTunnelPlugins,
250
237
  getOrganization,
238
+ getRandomPort,
251
239
  gql,
252
- reportAnalyticsEvent,
240
+ graphqlRequest,
241
+ graphqlRequestDoc,
242
+ hashString,
243
+ normalizeStoreFqdn,
244
+ ok,
245
+ partnersFqdn,
246
+ partnersRequest,
247
+ partnersRequestDoc,
248
+ randomUUID,
253
249
  require_graphql,
254
250
  require_lib as require_lib2,
251
+ require_lib2 as require_lib3,
255
252
  require_mime_types,
256
- version
257
- } from "./chunk-67E32Z72.js";
253
+ restRequestBody,
254
+ restRequestHeaders,
255
+ restRequestUrl,
256
+ setNextDeprecationDate
257
+ } from "./chunk-6ZDQFSSJ.js";
258
258
  import "./chunk-VSLR7ET4.js";
259
- import {
260
- fileHash,
261
- hashString,
262
- randomUUID
263
- } from "./chunk-3E44DPAU.js";
264
259
  import {
265
260
  platformAndArch,
266
261
  username
267
- } from "./chunk-SERYSNVE.js";
262
+ } from "./chunk-QAP5YFY6.js";
268
263
  import {
269
264
  LocalStorage,
270
265
  UnknownPackageManagerError,
@@ -276,17 +271,17 @@ import {
276
271
  getPackageManager,
277
272
  getPackageName,
278
273
  getPackageVersion,
274
+ inferPackageManager,
279
275
  installNPMDependenciesRecursively,
280
276
  installNodeModules,
281
277
  lockfiles,
282
- packageManager,
283
278
  packageManagerFromUserAgent,
284
279
  readAndParsePackageJson,
285
280
  require_ajv,
286
281
  usesWorkspaces,
287
282
  versionSatisfies,
288
283
  writePackageJSON
289
- } from "./chunk-NV2K2JNI.js";
284
+ } from "./chunk-6MAEOVS3.js";
290
285
  import {
291
286
  require_semver
292
287
  } from "./chunk-BYPQXSAL.js";
@@ -295,7 +290,12 @@ import {
295
290
  } from "./chunk-O5K4AU7Q.js";
296
291
  import {
297
292
  CLI_KIT_VERSION
298
- } from "./chunk-XHO4O3WD.js";
293
+ } from "./chunk-GKSNOFYA.js";
294
+ import {
295
+ deepStrict,
296
+ errorsToString,
297
+ z
298
+ } from "./chunk-NLUGD7PZ.js";
299
299
  import {
300
300
  AbortController as AbortController2,
301
301
  AbortError,
@@ -472,13 +472,11 @@ import {
472
472
  use_stdin_default,
473
473
  writeFile,
474
474
  writeFileSync
475
- } from "./chunk-CL6KB3RG.js";
475
+ } from "./chunk-YGWIVVUL.js";
476
476
  import {
477
477
  require_signal_exit
478
478
  } from "./chunk-QETDXAFX.js";
479
479
  import {
480
- defaultThemeKitAccessDomain,
481
- environmentVariables,
482
480
  logsFolder
483
481
  } from "./chunk-NZDBLGNM.js";
484
482
  import {
@@ -144612,7 +144610,7 @@ import { fileURLToPath } from "url";
144612
144610
  async function warnIfOldNodeVersion() {
144613
144611
  let nodeVersion = process.versions.node, nodeMajorVersion = Number(nodeVersion.split(".")[0]);
144614
144612
  if (nodeMajorVersion < 18) {
144615
- let { renderWarning: renderWarning2 } = await import("./ui-KGCQLCOJ.js");
144613
+ let { renderWarning: renderWarning2 } = await import("./ui-PA5ER7II.js");
144616
144614
  renderWarning2({
144617
144615
  headline: "Upgrade to a supported Node version now.",
144618
144616
  body: [
@@ -144637,7 +144635,7 @@ function forceNoColor() {
144637
144635
  }
144638
144636
  async function runCLI(options) {
144639
144637
  setupEnvironmentVariables(options), forceNoColor(), await warnIfOldNodeVersion();
144640
- let { errorHandler: errorHandler2 } = await import("./error-handler-GT7C27BQ.js"), { isDevelopment } = await import("./local-T3UMODTX.js"), oclif = await import("./lib-4WCTNKJK.js"), { ShopifyConfig } = await import("./custom-oclif-loader-ROCHTOS5.js");
144638
+ let { errorHandler: errorHandler2 } = await import("./error-handler-5FD7IHCB.js"), { isDevelopment } = await import("./local-LNHYBD2A.js"), oclif = await import("./lib-4WCTNKJK.js"), { ShopifyConfig } = await import("./custom-oclif-loader-KLQXTO4F.js");
144641
144639
  isDevelopment() && (oclif.default.settings.debug = !0);
144642
144640
  try {
144643
144641
  let config2 = new ShopifyConfig({ root: fileURLToPath(options.moduleURL) });
@@ -144647,8 +144645,8 @@ async function runCLI(options) {
144647
144645
  }
144648
144646
  }
144649
144647
  async function useLocalCLIIfDetected(filepath) {
144650
- let { environmentVariables: environmentVariables2 } = await import("./constants-TR6ABVLJ.js"), { joinPath: join6 } = await import("./path-T2RCZTRE.js"), { exec: exec2 } = await import("./system-CEM4NSPG.js");
144651
- if (!isTruthy(process.env[environmentVariables2.enableCliRedirect]) || isTruthy(process.env[environmentVariables2.skipCliRedirect]) || process.env.npm_config_user_agent)
144648
+ let { environmentVariables } = await import("./constants-TR6ABVLJ.js"), { joinPath: join6 } = await import("./path-T2RCZTRE.js"), { exec: exec2 } = await import("./system-LDMV4BPS.js");
144649
+ if (!isTruthy(process.env[environmentVariables.enableCliRedirect]) || isTruthy(process.env[environmentVariables.skipCliRedirect]) || process.env.npm_config_user_agent)
144652
144650
  return !1;
144653
144651
  let cliPackage = await localCliPackage();
144654
144652
  if (!cliPackage)
@@ -144659,7 +144657,7 @@ async function useLocalCLIIfDetected(filepath) {
144659
144657
  try {
144660
144658
  await exec2(correctExecutablePath, process.argv.slice(2, process.argv.length), {
144661
144659
  stdio: "inherit",
144662
- env: { [environmentVariables2.skipCliRedirect]: "1" }
144660
+ env: { [environmentVariables.skipCliRedirect]: "1" }
144663
144661
  });
144664
144662
  } catch (processError) {
144665
144663
  process.exit(processError.exitCode);
@@ -144667,7 +144665,7 @@ async function useLocalCLIIfDetected(filepath) {
144667
144665
  return !0;
144668
144666
  }
144669
144667
  async function localCliPackage() {
144670
- let { captureOutput } = await import("./system-CEM4NSPG.js"), npmListOutput = "", localShopifyCLI = {};
144668
+ let { captureOutput } = await import("./system-LDMV4BPS.js"), npmListOutput = "", localShopifyCLI = {};
144671
144669
  try {
144672
144670
  npmListOutput = await captureOutput("npm", ["list", "@shopify/cli", "--json", "-l"]), localShopifyCLI = JSON.parse(npmListOutput);
144673
144671
  } catch {
@@ -144826,35 +144824,45 @@ function setThemeStore(store) {
144826
144824
  themeLocalStorage().set("themeStore", store);
144827
144825
  }
144828
144826
  function getDevelopmentTheme() {
144829
- return outputDebug(outputContent`Getting development theme...`), developmentThemeLocalStorage().get(getThemeStore());
144827
+ return outputDebug(outputContent`Getting development theme...`), developmentThemeLocalStorage().get(requireThemeStore());
144830
144828
  }
144831
144829
  function setDevelopmentTheme(theme) {
144832
- outputDebug(outputContent`Setting development theme...`), developmentThemeLocalStorage().set(getThemeStore(), theme);
144830
+ outputDebug(outputContent`Setting development theme...`), developmentThemeLocalStorage().set(requireThemeStore(), theme);
144833
144831
  }
144834
144832
  function removeDevelopmentTheme() {
144835
- outputDebug(outputContent`Removing development theme...`), developmentThemeLocalStorage().delete(getThemeStore());
144833
+ outputDebug(outputContent`Removing development theme...`), developmentThemeLocalStorage().delete(requireThemeStore());
144836
144834
  }
144837
144835
  function getREPLTheme() {
144838
- return outputDebug(outputContent`Getting REPL theme...`), replThemeLocalStorage().get(getThemeStore());
144836
+ return outputDebug(outputContent`Getting REPL theme...`), replThemeLocalStorage().get(requireThemeStore());
144839
144837
  }
144840
144838
  function setREPLTheme(theme) {
144841
- outputDebug(outputContent`Setting REPL theme to ${theme}...`), replThemeLocalStorage().set(getThemeStore(), theme);
144839
+ outputDebug(outputContent`Setting REPL theme to ${theme}...`), replThemeLocalStorage().set(requireThemeStore(), theme);
144842
144840
  }
144843
144841
  function removeREPLTheme() {
144844
- outputDebug(outputContent`Removing REPL theme...`), replThemeLocalStorage().delete(getThemeStore());
144842
+ outputDebug(outputContent`Removing REPL theme...`), replThemeLocalStorage().delete(requireThemeStore());
144845
144843
  }
144846
144844
  function getStorefrontPassword() {
144847
- let themeStore = getThemeStore();
144848
- return outputDebug(outputContent`Getting storefront password for shop ${themeStore}...`), themeStorePasswordStorage().get(getThemeStore());
144845
+ let themeStore = requireThemeStore();
144846
+ return outputDebug(outputContent`Getting storefront password for shop ${themeStore}...`), themeStorePasswordStorage().get(themeStore);
144849
144847
  }
144850
144848
  function setStorefrontPassword(password) {
144851
- let themeStore = getThemeStore();
144849
+ let themeStore = requireThemeStore();
144852
144850
  outputDebug(outputContent`Setting storefront password for shop ${themeStore}...`), themeStorePasswordStorage().set(themeStore, password);
144853
144851
  }
144854
144852
  function removeStorefrontPassword() {
144855
- let themeStore = getThemeStore();
144853
+ let themeStore = requireThemeStore();
144856
144854
  outputDebug(outputContent`Removing storefront password for ${themeStore}...`), themeStorePasswordStorage().delete(themeStore);
144857
144855
  }
144856
+ function requireThemeStore() {
144857
+ let themeStore = getThemeStore();
144858
+ if (!themeStore)
144859
+ throw new BugError("Theme store is not set. This indicates an unexpected issue with the CLI. Please report this to the Shopify CLI team.", [
144860
+ "It may be possible to recover by running",
144861
+ { command: "shopify theme list --store <store>" },
144862
+ "(setting the store flag to the store you wish to use) and then running the command again."
144863
+ ]);
144864
+ return themeStore;
144865
+ }
144858
144866
 
144859
144867
  // ../theme/dist/cli/utilities/theme-store.js
144860
144868
  function ensureThemeStore(flags) {
@@ -145061,26 +145069,6 @@ function header(response, name) {
145061
145069
 
145062
145070
  // ../cli-kit/dist/public/node/api/admin.js
145063
145071
  init_cjs_shims();
145064
-
145065
- // ../cli-kit/dist/private/node/api/rest.js
145066
- init_cjs_shims();
145067
- function restRequestBody(requestBody) {
145068
- if (requestBody)
145069
- return JSON.stringify(requestBody);
145070
- }
145071
- function restRequestUrl(session, apiVersion, path3, searchParams = {}, env = process.env) {
145072
- let themeKitAccessDomain = env[environmentVariables.themeKitAccessDomain] || defaultThemeKitAccessDomain, url = new URL(isThemeAccessSession(session) ? `https://${themeKitAccessDomain}/cli/admin/api/${apiVersion}${path3}.json` : `https://${session.storeFqdn}/admin/api/${apiVersion}${path3}.json`);
145073
- return Object.entries(searchParams).forEach(([name, value]) => url.searchParams.set(name, value)), url.toString();
145074
- }
145075
- function restRequestHeaders(session) {
145076
- let store = session.storeFqdn, token = session.token, headers = buildHeaders(session.token);
145077
- return isThemeAccessSession(session) && (headers["X-Shopify-Shop"] = store, headers["X-Shopify-Access-Token"] = token), headers;
145078
- }
145079
- function isThemeAccessSession(session) {
145080
- return session.token.startsWith("shptka_");
145081
- }
145082
-
145083
- // ../cli-kit/dist/public/node/api/admin.js
145084
145072
  async function adminRequest2(query, session, variables) {
145085
145073
  let api = "Admin", version2 = await fetchLatestSupportedApiVersion(session), url = adminUrl(session.storeFqdn, version2);
145086
145074
  return graphqlRequest({ query, api, url, token: session.token, variables });
@@ -146454,7 +146442,7 @@ function toNodeListener(app) {
146454
146442
  async function render2(session, context) {
146455
146443
  let url = buildStorefrontUrl(session, context), replaceTemplates = Object.keys({ ...context.replaceTemplates, ...context.replaceExtensionTemplates });
146456
146444
  outputDebug(`\u2192 Rendering ${url} (with ${replaceTemplates})...`);
146457
- let bodyParams = storefrontReplaceTemplatesParams(context), headers = await buildHeaders2(session, context), response = await fetch2(url, {
146445
+ let bodyParams = storefrontReplaceTemplatesParams(context), headers = await buildHeaders(session, context), response = await fetch2(url, {
146458
146446
  method: "POST",
146459
146447
  body: bodyParams,
146460
146448
  headers: {
@@ -146471,8 +146459,8 @@ async function render2(session, context) {
146471
146459
  }), requestId = response.headers.get("x-request-id");
146472
146460
  return outputDebug(`\u2190 ${response.status} (request_id: ${requestId})`), response.headers.delete("Content-Type"), response;
146473
146461
  }
146474
- async function buildHeaders2(session, context) {
146475
- return isThemeAccessSession2(session) ? buildThemeAccessHeaders(session, context) : buildStandardHeaders(session, context);
146462
+ async function buildHeaders(session, context) {
146463
+ return isThemeAccessSession(session) ? buildThemeAccessHeaders(session, context) : buildStandardHeaders(session, context);
146476
146464
  }
146477
146465
  async function buildStandardHeaders(session, context) {
146478
146466
  let cookies = await buildCookies(session, context), storefrontToken = session.storefrontToken;
@@ -146510,9 +146498,9 @@ function buildStorefrontUrl(session, { path: path3, sectionId, appBlockId, query
146510
146498
  return sectionId ? params.append("section_id", sectionId) : appBlockId && params.append("app_block_id", appBlockId), `${url}?${params}`;
146511
146499
  }
146512
146500
  function buildBaseStorefrontUrl(session) {
146513
- return isThemeAccessSession2(session) ? "https://theme-kit-access.shopifyapps.com/cli/sfr" : `https://${session.storeFqdn}`;
146501
+ return isThemeAccessSession(session) ? "https://theme-kit-access.shopifyapps.com/cli/sfr" : `https://${session.storeFqdn}`;
146514
146502
  }
146515
- function isThemeAccessSession2(session) {
146503
+ function isThemeAccessSession(session) {
146516
146504
  return session.token.startsWith("shptka_");
146517
146505
  }
146518
146506
  function themeAccessHeaders(session) {
@@ -146813,6 +146801,10 @@ init_cjs_shims();
146813
146801
  // ../theme/dist/cli/utilities/theme-selector/fetch.js
146814
146802
  init_cjs_shims();
146815
146803
  var ALLOWED_ROLES = ["live", "unpublished", "development"];
146804
+ async function publicFetchStoreThemes(store, password) {
146805
+ let adminSession = await ensureAuthenticatedThemes(store, password);
146806
+ return fetchStoreThemes(adminSession);
146807
+ }
146816
146808
  async function fetchStoreThemes(session) {
146817
146809
  let store = session.storeFqdn, themes = (await fetchThemes(session)).filter(isRoleAllowed);
146818
146810
  if (themes.length === 0)
@@ -147092,7 +147084,11 @@ async function getPatternsFromShopifyIgnore(root) {
147092
147084
  return await fileExists(shopifyIgnorePath) ? (await readFile(shopifyIgnorePath, { encoding: "utf8" })).split(/(\r\n|\r|\n)/).map((line) => line.trim()).filter((line) => line && !line.startsWith("#")) : [];
147093
147085
  }
147094
147086
  function matchGlob2(key, pattern) {
147095
- return matchGlob(key, pattern) ? !0 : shouldReplaceGlobPattern(pattern) ? matchGlob(key, pattern.replace("/*.", "/**/*.")) : !1;
147087
+ let matchOpts = {
147088
+ matchBase: !0,
147089
+ noglobstar: !0
147090
+ };
147091
+ return matchGlob(key, pattern, matchOpts) ? !0 : shouldReplaceGlobPattern(pattern) ? matchGlob(key, pattern.replace("/*.", "/**/*."), matchOpts) : !1;
147096
147092
  }
147097
147093
  function raiseWarningForNonExplicitGlobPatterns(patterns) {
147098
147094
  new Set(patterns).forEach((pattern) => {
@@ -147682,10 +147678,10 @@ ${result.errors.asset.map((error) => `- ${error}`).join(`
147682
147678
  }, handleFileDelete = (themeId, adminSession, fileKey) => {
147683
147679
  isFileIgnored(fileKey) || (files.delete(fileKey), unsyncedFileKeys.add(fileKey), emitEvent("unlink", { fileKey }), deleteThemeAsset(Number(themeId), fileKey, adminSession).then(async (success) => {
147684
147680
  if (!success)
147685
- throw new Error("Unknown issue.");
147681
+ throw new Error(`Failed to delete file "${fileKey}" from remote theme.`);
147686
147682
  unsyncedFileKeys.delete(fileKey), outputSyncResult("delete", fileKey);
147687
147683
  }).catch((error) => {
147688
- renderWarning({ headline: `Failed to delete file "${fileKey}".`, body: error.message });
147684
+ outputDebug(error.message);
147689
147685
  }));
147690
147686
  }, directoriesToWatch = new Set(THEME_DIRECTORY_PATTERNS.map((pattern) => joinPath(root, pattern.split("/").shift() ?? "")));
147691
147687
  return {
@@ -147697,7 +147693,12 @@ ${result.errors.asset.map((error) => `- ${error}`).join(`
147697
147693
  files.delete(fileKey), await removeThemeFile(root, fileKey);
147698
147694
  },
147699
147695
  write: async (asset) => {
147700
- files.set(asset.key, asset), await writeThemeFile(root, asset);
147696
+ files.set(asset.key, buildThemeAsset({
147697
+ key: asset.key,
147698
+ checksum: asset.checksum,
147699
+ value: asset.value ?? "",
147700
+ attachment: asset.attachment ?? ""
147701
+ })), await writeThemeFile(root, asset);
147701
147702
  },
147702
147703
  read,
147703
147704
  applyIgnoreFilters: (files2) => applyIgnoreFilters(files2, filterPatterns),
@@ -147765,7 +147766,8 @@ function isTextFile(path3) {
147765
147766
  "application/liquid",
147766
147767
  "text/css",
147767
147768
  "text/x-sass",
147768
- "text/x-scss"
147769
+ "text/x-scss",
147770
+ "image/svg+xml"
147769
147771
  ].includes(lookupMimeType(path3));
147770
147772
  }
147771
147773
  async function hasRequiredThemeDirectories(path3) {
@@ -147874,7 +147876,7 @@ function hotReloadScript() {
147874
147876
 
147875
147877
  // ../theme/dist/cli/utilities/theme-environment/proxy.js
147876
147878
  init_cjs_shims();
147877
- var VANITY_CDN_PREFIX = "/cdn/", EXTENSION_CDN_PREFIX = "/ext/cdn/", IGNORED_ENDPOINTS = [
147879
+ var CART_PREFIX = "/cart/", VANITY_CDN_PREFIX = "/cdn/", EXTENSION_CDN_PREFIX = "/ext/cdn/", IGNORED_ENDPOINTS = [
147878
147880
  "/.well-known",
147879
147881
  "/shopify/monorail",
147880
147882
  "/mini-profiler-resources",
@@ -147891,7 +147893,7 @@ function getProxyHandler(_theme, ctx) {
147891
147893
  });
147892
147894
  }
147893
147895
  function canProxyRequest(event) {
147894
- if (event.method !== "GET" || event.path.startsWith(VANITY_CDN_PREFIX) || event.path.startsWith(EXTENSION_CDN_PREFIX))
147896
+ if (event.method !== "GET" || event.path.startsWith(CART_PREFIX) || event.path.startsWith(VANITY_CDN_PREFIX) || event.path.startsWith(EXTENSION_CDN_PREFIX))
147895
147897
  return !0;
147896
147898
  let [pathname] = event.path.split("?"), extension = extname(pathname), acceptsType = event.headers.get("accept") ?? "*/*";
147897
147899
  return extension === ".html" || acceptsType.includes("text/html") ? !1 : !!extension || acceptsType !== "*/*";
@@ -147902,7 +147904,7 @@ function getStoreFqdnForRegEx(ctx) {
147902
147904
  function injectCdnProxy(originalContent, ctx) {
147903
147905
  let content = originalContent, vanityCdnRE = new RegExp(`(https?:)?//${getStoreFqdnForRegEx(ctx)}${VANITY_CDN_PREFIX}`, "g");
147904
147906
  content = content.replace(vanityCdnRE, VANITY_CDN_PREFIX);
147905
- let mainCdnRE = /(?:https?:)?\/\/cdn\.shopify\.com\/(.*?\/(assets\/[^?">]+)(?:\?|"|>|$))/g, filterAssets = (key) => key.startsWith("assets"), existingAssets = new Set([...ctx.localThemeFileSystem.files.keys()].filter(filterAssets)), existingExtAssets = new Set([...ctx.localThemeExtensionFileSystem.files.keys()].filter(filterAssets));
147907
+ let mainCdnRE = /(?:https?:)?\/\/cdn\.shopify\.com\/(.*?\/(assets\/[^?#"'`>\s]+))/g, filterAssets = (key) => key.startsWith("assets/"), existingAssets = new Set([...ctx.localThemeFileSystem.files.keys()].filter(filterAssets)), existingExtAssets = new Set([...ctx.localThemeExtensionFileSystem.files.keys()].filter(filterAssets));
147906
147908
  return content = content.replace(mainCdnRE, (matchedUrl, pathname, matchedAsset) => {
147907
147909
  let isLocalAsset = matchedAsset && existingAssets.has(matchedAsset), isLocalExtAsset = matchedAsset && existingExtAssets.has(matchedAsset) && pathname.startsWith("extensions/");
147908
147910
  return lookupMimeType(matchedAsset).startsWith("image/") ? matchedUrl : isLocalExtAsset ? `${EXTENSION_CDN_PREFIX}${pathname}` : isLocalAsset ? `${VANITY_CDN_PREFIX}${pathname}` : matchedUrl;
@@ -147919,7 +147921,7 @@ function patchCookieDomains(cookieHeader, ctx) {
147919
147921
  async function patchRenderingResponse(ctx, event, response) {
147920
147922
  setResponseStatus(event, response.status, response.statusText), setResponseHeaders(event, Object.fromEntries(response.headers.entries())), patchProxiedResponseHeaders(ctx, event, response);
147921
147923
  let html = await response.text();
147922
- return removeResponseHeader(event, "content-encoding"), html = injectCdnProxy(html, ctx), html = patchBaseUrlAttributes(html, ctx), html;
147924
+ return removeResponseHeader(event, "content-encoding"), setResponseHeader(event, "content-type", "text/html; charset=utf-8"), html = injectCdnProxy(html, ctx), html = patchBaseUrlAttributes(html, ctx), html;
147923
147925
  }
147924
147926
  var HOP_BY_HOP_HEADERS = [
147925
147927
  "connection",
@@ -147930,7 +147932,9 @@ var HOP_BY_HOP_HEADERS = [
147930
147932
  "trailer",
147931
147933
  "transfer-encoding",
147932
147934
  "upgrade",
147933
- "content-security-policy"
147935
+ "expect",
147936
+ "content-security-policy",
147937
+ "host"
147934
147938
  ];
147935
147939
  function patchProxiedResponseHeaders(ctx, event, response) {
147936
147940
  clearResponseHeaders(event, HOP_BY_HOP_HEADERS);
@@ -147949,7 +147953,7 @@ function patchProxiedResponseHeaders(ctx, event, response) {
147949
147953
  }
147950
147954
  }
147951
147955
  function getProxyStorefrontHeaders(event) {
147952
- let proxyRequestHeaders = getProxyRequestHeaders(event);
147956
+ let proxyRequestHeaders = getRequestHeaders(event);
147953
147957
  for (let headerKey of HOP_BY_HOP_HEADERS)
147954
147958
  delete proxyRequestHeaders[headerKey];
147955
147959
  delete proxyRequestHeaders["upgrade-insecure-requests"];
@@ -147976,7 +147980,14 @@ function proxyStorefrontRequest(event, ctx) {
147976
147980
  // Important to return 3xx responses to the client
147977
147981
  redirect: "manual"
147978
147982
  },
147979
- onResponse: patchProxiedResponseHeaders.bind(null, ctx)
147983
+ async onResponse(event2, response) {
147984
+ patchProxiedResponseHeaders(ctx, event2, response);
147985
+ let fileName = url.pathname.split("/").at(-1);
147986
+ if (ctx.localThemeFileSystem.files.has(`assets/${fileName}.liquid`)) {
147987
+ let body2 = await response.text();
147988
+ await send(event2, injectCdnProxy(body2, ctx));
147989
+ }
147990
+ }
147980
147991
  }).catch(async (error) => {
147981
147992
  let pathname = event.path.split("?")[0];
147982
147993
  if (error.statusCode >= 500 && !pathname.endsWith(".js.map")) {
@@ -147990,9 +148001,6 @@ function proxyStorefrontRequest(event, ctx) {
147990
148001
  });
147991
148002
  }
147992
148003
 
147993
- // ../theme/dist/cli/utilities/theme-environment/html.js
147994
- init_cjs_shims();
147995
-
147996
148004
  // ../theme/dist/cli/utilities/theme-ext-environment/theme-ext-server.js
147997
148005
  init_cjs_shims();
147998
148006
 
@@ -148067,6 +148075,67 @@ function mountThemeExtensionFileSystem(root) {
148067
148075
  };
148068
148076
  }
148069
148077
 
148078
+ // ../theme/dist/cli/utilities/theme-environment/html.js
148079
+ init_cjs_shims();
148080
+ function getHtmlHandler(theme, ctx) {
148081
+ return defineEventHandler((event) => {
148082
+ outputInfo(`${event.method} ${event.path}`);
148083
+ let [browserPathname = "/", browserSearch = ""] = event.path.split("?");
148084
+ return render2(ctx.session, {
148085
+ method: event.method,
148086
+ path: browserPathname,
148087
+ query: [...new URLSearchParams(browserSearch)],
148088
+ themeId: String(theme.id),
148089
+ sectionId: "",
148090
+ headers: getProxyStorefrontHeaders(event),
148091
+ replaceExtensionTemplates: getExtensionInMemoryTemplates(ctx),
148092
+ replaceTemplates: getInMemoryTemplates(ctx, browserPathname, getCookie2(event, "localization")?.toLowerCase())
148093
+ }).then(async (response) => {
148094
+ let html = await patchRenderingResponse(ctx, event, response);
148095
+ return assertThemeId(response, html, String(theme.id)), ctx.options.liveReload !== "off" && (html = injectHotReloadScript(html)), html;
148096
+ }).catch(async (error) => {
148097
+ let headline = `Failed to render storefront with status ${error.statusCode} (${error.statusMessage}).`;
148098
+ error.data?.requestId && (headline += `
148099
+ Request ID: ${error.data.requestId}`), error.data?.url && (headline += `
148100
+ URL: ${error.data.url}`);
148101
+ let cause = error.cause;
148102
+ renderError({ headline, body: cause?.stack ?? error.stack ?? error.message }), setResponseStatus(event, error.statusCode ?? 502, error.statusMessage), setResponseHeader(event, "Content-Type", "text/html");
148103
+ let [title, ...rest] = headline.split(`
148104
+ `), errorPageHtml = getErrorPage({
148105
+ title,
148106
+ header: title,
148107
+ message: [...rest, cause?.message ?? error.message].join("<br>"),
148108
+ code: error.stack?.replace(`${error.message}
148109
+ `, "") ?? ""
148110
+ });
148111
+ return ctx.options.liveReload !== "off" && (errorPageHtml = injectHotReloadScript(errorPageHtml)), errorPageHtml;
148112
+ });
148113
+ });
148114
+ }
148115
+ function getErrorPage(options) {
148116
+ return (0, String.raw)`<html>
148117
+ <head>
148118
+ <title>${options.title ?? "Unknown error"}</title>
148119
+ </head>
148120
+ <body
148121
+ id="full-error-page"
148122
+ style="display: flex; flex-direction: column; align-items: center; padding-top: 20px; font-family: Arial"
148123
+ >
148124
+ <h2>${options.header}</h2>
148125
+ <p>${options.message}</p>
148126
+ <pre>${options.code}</pre>
148127
+ </body>
148128
+ </html>`;
148129
+ }
148130
+ function assertThemeId(response, html, expectedThemeId) {
148131
+ let obtainedThemeId = html.match(/Shopify\.theme\s*=\s*{[^}]+?"id":\s*"?(\d+)"?(}|,)/)?.[1];
148132
+ obtainedThemeId && obtainedThemeId !== expectedThemeId && (renderFatalError(new AbortError(`Theme ID mismatch: expected ${expectedThemeId} but got ${obtainedThemeId}.
148133
+ Request ID: ${response.headers.get("x-request-id")}
148134
+ URL: ${response.url}`, `This is likely related to an issue in upstream Shopify APIs.
148135
+ Please try again in a few minutes and report this issue:
148136
+ https://github.com/Shopify/cli/issues/new?template=bug-report.yml`)), process.exit(1));
148137
+ }
148138
+
148070
148139
  // ../theme/dist/cli/utilities/theme-environment/local-assets.js
148071
148140
  init_cjs_shims();
148072
148141
  function getAssetsHandler(_theme, ctx) {
@@ -148083,7 +148152,7 @@ function getAssetsHandler(_theme, ctx) {
148083
148152
  isUnsynced && sendError(event, createError({ statusCode: 404, statusMessage: "Not found" }));
148084
148153
  return;
148085
148154
  }
148086
- let fileContent = file.value ? injectCdnProxy(file.value, ctx) : Buffer.from(file.attachment ?? "", "base64");
148155
+ let fileContent = file.value ? Buffer.from(injectCdnProxy(file.value, ctx)) : Buffer.from(file.attachment ?? "", "base64");
148087
148156
  return serveStatic(event, {
148088
148157
  getContents: () => fileContent,
148089
148158
  // Note: stats.size is the length of the base64 string for attachments,
@@ -148101,7 +148170,7 @@ function findLocalFile(event, ctx) {
148101
148170
  return { file, isUnsynced, fileKey };
148102
148171
  }
148103
148172
  };
148104
- return tryGetFile(/^\/cdn\/.*?\/assets\/([^?]+)(\?|$)/, ctx.localThemeFileSystem) ?? tryGetFile(/^\/ext\/cdn\/extensions\/.*?\/.*?\/assets\/([^?]+)(\?|$)/, ctx.localThemeExtensionFileSystem) ?? {
148173
+ return tryGetFile(/^\/cdn\/.*?\/assets\/([^?]+)/, ctx.localThemeFileSystem) ?? tryGetFile(/^\/ext\/cdn\/extensions\/.*?\/assets\/([^?]+)/, ctx.localThemeExtensionFileSystem) ?? {
148105
148174
  isUnsynced: !1,
148106
148175
  fileKey: void 0,
148107
148176
  file: void 0
@@ -148199,72 +148268,6 @@ function getExtensionInMemoryTemplates(ctx) {
148199
148268
  return replaceExtTemplates;
148200
148269
  }
148201
148270
 
148202
- // ../theme/dist/cli/utilities/theme-environment/html.js
148203
- function getHtmlHandler(theme, ctx) {
148204
- return defineEventHandler((event) => {
148205
- outputInfo(`${event.method} ${event.path}`);
148206
- let [browserPathname = "/", browserSearch = ""] = event.path.split("?");
148207
- return render2(ctx.session, {
148208
- method: event.method,
148209
- path: browserPathname,
148210
- query: [...new URLSearchParams(browserSearch)],
148211
- themeId: String(theme.id),
148212
- sectionId: "",
148213
- headers: getProxyStorefrontHeaders(event),
148214
- replaceExtensionTemplates: getExtensionInMemoryTemplates(ctx),
148215
- replaceTemplates: getInMemoryTemplates(ctx, browserPathname, getCookie2(event, "localization")?.toLowerCase())
148216
- }).then(async (response) => {
148217
- let html = await patchRenderingResponse(ctx, event, response);
148218
- return html = prettifySyntaxErrors(html), ctx.options.liveReload !== "off" && (html = injectHotReloadScript(html)), html;
148219
- }).catch(async (error) => {
148220
- let headline = `Failed to render storefront with status ${error.statusCode} (${error.statusMessage}).`;
148221
- error.data?.requestId && (headline += `
148222
- Request ID: ${error.data.requestId}`), error.data?.url && (headline += `
148223
- URL: ${error.data.url}`);
148224
- let cause = error.cause;
148225
- renderError({ headline, body: cause?.stack ?? error.stack ?? error.message }), setResponseStatus(event, error.statusCode ?? 502, error.statusMessage), setResponseHeader(event, "Content-Type", "text/html");
148226
- let [title, ...rest] = headline.split(`
148227
- `), errorPageHtml = getErrorPage({
148228
- title,
148229
- header: title,
148230
- message: [...rest, error.message].join("<br>"),
148231
- code: error.stack?.replace(`${error.message}
148232
- `, "") ?? ""
148233
- });
148234
- return ctx.options.liveReload !== "off" && (errorPageHtml = injectHotReloadScript(errorPageHtml)), errorPageHtml;
148235
- });
148236
- });
148237
- }
148238
- function prettifySyntaxErrors(html) {
148239
- return html.replace(/Liquid(?: syntax)? error \([^\n]+(?:\n|<)/g, getErrorSection);
148240
- }
148241
- function getErrorSection(error) {
148242
- let html = String.raw, color = "orangered";
148243
- return html`
148244
- <div
148245
- id="section-error"
148246
- style="border: solid thick ${color}; background: color(from ${color} srgb r g b / 0.2); padding: 20px;"
148247
- >
148248
- <pre>${error}</pre>
148249
- </div>
148250
- `;
148251
- }
148252
- function getErrorPage(options) {
148253
- return (0, String.raw)`<html>
148254
- <head>
148255
- <title>${options.title ?? "Unknown error"}</title>
148256
- </head>
148257
- <body
148258
- id="full-error-page"
148259
- style="display: flex; flex-direction: column; align-items: center; padding-top: 20px; font-family: Arial"
148260
- >
148261
- <h2>${options.header}</h2>
148262
- <p>${options.message}</p>
148263
- <pre>${options.code}</pre>
148264
- </body>
148265
- </html>`;
148266
- }
148267
-
148268
148271
  // ../theme/dist/cli/utilities/theme-environment/hot-reload/server.js
148269
148272
  var import_theme_check_node3 = __toESM(require_dist5(), 1);
148270
148273
  import EventEmitter3 from "node:events";
@@ -148297,7 +148300,7 @@ function getInMemoryTemplates(ctx, currentRoute, locale) {
148297
148300
  }
148298
148301
  return inMemoryTemplates;
148299
148302
  }
148300
- function setupInMemoryTemplateWatcher2(theme, ctx) {
148303
+ function setupInMemoryTemplateWatcher2(ctx) {
148301
148304
  let handleFileUpdate = ({ fileKey, onContent, onSync }) => {
148302
148305
  let extension = extname(fileKey);
148303
148306
  fileKey.startsWith("assets/") ? extension === ".liquid" ? onSync(() => triggerHotReload(fileKey, ctx)) : triggerHotReload(fileKey, ctx) : needsTemplateUpdate(fileKey) ? onContent((content) => {
@@ -148307,7 +148310,6 @@ function setupInMemoryTemplateWatcher2(theme, ctx) {
148307
148310
  return ctx.localThemeFileSystem.addEventListener("add", handleFileUpdate), ctx.localThemeFileSystem.addEventListener("change", handleFileUpdate), ctx.localThemeFileSystem.addEventListener("unlink", ({ fileKey }) => {
148308
148311
  sectionNamesByFile.delete(fileKey), triggerHotReload(fileKey, ctx);
148309
148312
  }), ctx.localThemeFileSystem.ready().then(async () => {
148310
- await ctx.localThemeFileSystem.startWatcher(theme.id.toString(), ctx.session);
148311
148313
  let files = [...ctx.localThemeFileSystem.files];
148312
148314
  return Promise.allSettled(files.map(async ([fileKey, file]) => {
148313
148315
  if (fileKey.endsWith(".json")) {
@@ -148373,8 +148375,7 @@ function getHotReloadHandler(theme, ctx) {
148373
148375
  statusText: response.statusText,
148374
148376
  data: { requestId: response.headers.get("x-request-id"), url: response.url }
148375
148377
  });
148376
- let html = await patchRenderingResponse(ctx, event, response);
148377
- return prettifySyntaxErrors(html);
148378
+ return patchRenderingResponse(ctx, event, response);
148378
148379
  }).catch(async (error) => {
148379
148380
  let headline = `Failed to render section on Hot Reload with status ${error.statusCode} (${error.statusMessage}).`;
148380
148381
  error.data?.requestId && (headline += `
@@ -148410,7 +148411,7 @@ function hotReloadSections(key, ctx) {
148410
148411
  for (let [type, name] of sections)
148411
148412
  type === sectionId && sectionsToUpdate.add(name);
148412
148413
  }
148413
- sectionsToUpdate.size > 0 && emitHotReloadEvent({ type: "section", key, names: [...sectionsToUpdate] });
148414
+ sectionsToUpdate.size > 0 ? emitHotReloadEvent({ type: "section", key, names: [...sectionsToUpdate] }) : emitHotReloadEvent({ type: "full", key });
148414
148415
  }
148415
148416
  function injectHotReloadScript(html) {
148416
148417
  return html.replace(/<\/head>/, `${getClientScripts()}</head>`);
@@ -148641,7 +148642,9 @@ function createIntervalTask({ promise, titleGetter, timeout }) {
148641
148642
  function buildDeleteJob(remoteChecksums, themeFileSystem, theme, session, options) {
148642
148643
  if (options.nodelete)
148643
148644
  return { progress: { current: 0, total: 0 }, promise: Promise.resolve() };
148644
- let remoteFilesToBeDeleted = getRemoteFilesToBeDeleted(remoteChecksums, themeFileSystem), orderedFiles = orderFilesToBeDeleted(remoteFilesToBeDeleted), progress = { current: 0, total: orderedFiles.length }, promise = Promise.all(orderedFiles.map((file) => deleteThemeAsset(theme.id, file.key, session).then(() => {
148645
+ let remoteFilesToBeDeleted = getRemoteFilesToBeDeleted(remoteChecksums, themeFileSystem), orderedFiles = orderFilesToBeDeleted(remoteFilesToBeDeleted), progress = { current: 0, total: orderedFiles.length }, promise = Promise.all(orderedFiles.map((file) => deleteThemeAsset(theme.id, file.key, session).catch((error) => {
148646
+ renderError({ headline: `Failed to delete file "${file.key}" from remote theme.`, body: error.message });
148647
+ }).finally(() => {
148645
148648
  progress.current++;
148646
148649
  }))).then(() => {
148647
148650
  progress.current = progress.total;
@@ -148783,8 +148786,7 @@ function reportFailedUploads(uploadResults) {
148783
148786
  // ../theme/dist/cli/utilities/theme-environment/theme-environment.js
148784
148787
  import { createServer as createServer2 } from "node:http";
148785
148788
  function setupDevServer(theme, ctx) {
148786
- let watcherPromise = setupInMemoryTemplateWatcher2(theme, ctx), envSetup = ensureThemeEnvironmentSetup(theme, ctx), workPromise = Promise.all([watcherPromise, envSetup.workPromise]).then(() => {
148787
- }), server = createDevelopmentServer(theme, ctx, workPromise);
148789
+ let watcherPromise = setupInMemoryTemplateWatcher2(ctx), envSetup = ensureThemeEnvironmentSetup(theme, ctx), workPromise = Promise.all([watcherPromise, envSetup.workPromise]).then(() => ctx.localThemeFileSystem.startWatcher(theme.id.toString(), ctx.session)), server = createDevelopmentServer(theme, ctx, workPromise);
148788
148790
  return {
148789
148791
  workPromise,
148790
148792
  serverStart: server.start,
@@ -149707,7 +149709,7 @@ function buildDeleteTasks(remoteChecksums, themeFileSystem, options) {
149707
149709
  if (options.nodelete)
149708
149710
  return [];
149709
149711
  let remoteKeys = new Set(remoteChecksums.map((checksum) => checksum.key));
149710
- return Array.from(themeFileSystem.files.keys()).filter((key) => !remoteKeys.has(key)).map((key) => ({
149712
+ return themeFileSystem.applyIgnoreFilters([...themeFileSystem.files.values()]).map(({ key }) => key).filter((key) => !remoteKeys.has(key)).map((key) => ({
149711
149713
  title: `Cleaning your local directory (removing ${key})`,
149712
149714
  task: async () => themeFileSystem.delete(key)
149713
149715
  }));
@@ -149737,7 +149739,24 @@ function notNull(value) {
149737
149739
  }
149738
149740
 
149739
149741
  // ../theme/dist/cli/services/pull.js
149740
- async function pull(theme, session, options) {
149742
+ async function pull(flags) {
149743
+ showEmbeddedCLIWarning();
149744
+ let store = ensureThemeStore({ store: flags.store }), adminSession = await ensureAuthenticatedThemes(store, flags.password), developmentThemeManager = new DevelopmentThemeManager(adminSession), developmentTheme = await (flags.development ? developmentThemeManager.find() : developmentThemeManager.fetch()), { path: path3, nodelete, live, development, only, ignore, force } = flags, theme = await findOrSelectTheme(adminSession, {
149745
+ header: "Select a theme to open",
149746
+ filter: {
149747
+ live,
149748
+ theme: development ? `${developmentTheme?.id}` : flags.theme
149749
+ }
149750
+ });
149751
+ await executePull(theme, adminSession, {
149752
+ path: path3 || cwd(),
149753
+ nodelete: nodelete || !1,
149754
+ only: only || [],
149755
+ ignore: ignore || [],
149756
+ force: force || !1
149757
+ });
149758
+ }
149759
+ async function executePull(theme, session, options) {
149741
149760
  let path3 = options.path, force = options.force;
149742
149761
  if (!await isEmptyDir(path3) && !await hasRequiredThemeDirectories(path3) && !await currentDirectoryConfirmed(force))
149743
149762
  return;
@@ -149777,21 +149796,25 @@ var import_core12 = __toESM(require_lib(), 1);
149777
149796
  var _a10, Pull = class extends ThemeCommand {
149778
149797
  async run() {
149779
149798
  showEmbeddedCLIWarning();
149780
- let { flags } = await this.parse(_a10), store = ensureThemeStore(flags), adminSession = await ensureAuthenticatedThemes(store, flags.password), developmentThemeManager = new DevelopmentThemeManager(adminSession), developmentTheme = await (flags.development ? developmentThemeManager.find() : developmentThemeManager.fetch());
149781
- if (!flags.legacy) {
149782
- let { path: path3, nodelete, live, development, only, ignore, force } = flags, theme = await findOrSelectTheme(adminSession, {
149783
- header: "Select a theme to open",
149784
- filter: {
149785
- live,
149786
- theme: development ? `${developmentTheme?.id}` : flags.theme
149787
- }
149788
- });
149789
- await pull(theme, adminSession, { path: path3, nodelete, only, ignore, force });
149790
- return;
149791
- }
149792
- let flagsForCli2 = flags;
149799
+ let { flags } = await this.parse(_a10), pullFlags = {
149800
+ path: flags.path,
149801
+ password: flags.password,
149802
+ environment: flags.environment,
149803
+ store: flags.store,
149804
+ theme: flags.theme,
149805
+ development: flags.development,
149806
+ live: flags.live,
149807
+ nodelete: flags.nodelete,
149808
+ only: flags.only,
149809
+ ignore: flags.ignore,
149810
+ force: flags.force
149811
+ };
149812
+ flags.legacy ? await this.execLegacy() : await pull(pullFlags);
149813
+ }
149814
+ async execLegacy() {
149815
+ let { flags } = await this.parse(_a10), store = ensureThemeStore({ store: flags.store }), adminSession = await ensureAuthenticatedThemes(store, flags.password), developmentThemeManager = new DevelopmentThemeManager(adminSession), developmentTheme = await (flags.development ? developmentThemeManager.find() : developmentThemeManager.fetch()), flagsForCli2 = flags;
149793
149816
  developmentTheme && (flagsForCli2.development && (flagsForCli2.theme = `${developmentTheme.id}`, flagsForCli2.development = !1), useEmbeddedThemeCLI() && (flagsForCli2["development-theme-id"] = developmentTheme.id));
149794
- let flagsToPass = this.passThroughFlags(flagsForCli2, { allowedFlags: _a10.cli2Flags }), command = ["theme", "pull", flagsForCli2.path, ...flagsToPass];
149817
+ let flagsToPass = this.passThroughFlags(flagsForCli2, { allowedFlags: _a10.cli2Flags }), command = ["theme", "pull", flagsForCli2.path, ...flagsToPass].filter((arg) => arg !== void 0);
149795
149818
  await execCLI2(command, { store, adminToken: adminSession.token });
149796
149819
  }
149797
149820
  };
@@ -149856,7 +149879,22 @@ init_cjs_shims();
149856
149879
 
149857
149880
  // ../theme/dist/cli/services/push.js
149858
149881
  init_cjs_shims();
149859
- async function push(theme, session, options) {
149882
+ async function push(flags) {
149883
+ let { path: path3 } = flags, force = flags.force ?? !1, store = ensureThemeStore({ store: flags.store }), adminSession = await ensureAuthenticatedThemes(store, flags.password), workingDirectory = path3 ? resolvePath(path3) : cwd();
149884
+ if (!await hasRequiredThemeDirectories(workingDirectory) && !await currentDirectoryConfirmed(force))
149885
+ return;
149886
+ let selectedTheme = await createOrSelectTheme(adminSession, flags);
149887
+ selectedTheme && await executePush(selectedTheme, adminSession, {
149888
+ path: workingDirectory,
149889
+ nodelete: flags.nodelete || !1,
149890
+ publish: flags.publish || !1,
149891
+ json: flags.json || !1,
149892
+ force,
149893
+ ignore: flags.ignore || [],
149894
+ only: flags.only || []
149895
+ });
149896
+ }
149897
+ async function executePush(theme, session, options) {
149860
149898
  let themeChecksums = await fetchChecksums(theme.id, session), themeFileSystem = mountThemeFileSystem(options.path, { filters: options }), { uploadResults, renderThemeSyncProgress } = await uploadTheme(theme, session, themeChecksums, themeFileSystem, options);
149861
149899
  await renderThemeSyncProgress(), options.publish && await publishTheme(theme.id, session), await handlePushOutput(uploadResults, theme, session, options);
149862
149900
  }
@@ -149917,29 +149955,76 @@ function handleOutput(theme, hasErrors, session) {
149917
149955
  nextSteps
149918
149956
  });
149919
149957
  }
149958
+ async function createOrSelectTheme(adminSession, flags) {
149959
+ let { live, development, unpublished, theme } = flags;
149960
+ if (development)
149961
+ return new DevelopmentThemeManager(adminSession).findOrCreate();
149962
+ if (unpublished) {
149963
+ let themeName = theme || await promptThemeName("Name of the new theme");
149964
+ return createTheme({
149965
+ name: themeName,
149966
+ role: UNPUBLISHED_THEME_ROLE
149967
+ }, adminSession);
149968
+ } else {
149969
+ let selectedTheme = await findOrSelectTheme(adminSession, {
149970
+ header: "Select a theme to push to:",
149971
+ filter: {
149972
+ live,
149973
+ theme
149974
+ }
149975
+ });
149976
+ if (await confirmPushToTheme(selectedTheme.role, flags["allow-live"], adminSession.storeFqdn))
149977
+ return selectedTheme;
149978
+ }
149979
+ }
149980
+ async function confirmPushToTheme(themeRole, allowLive, storeFqdn) {
149981
+ if (themeRole === LIVE_THEME_ROLE) {
149982
+ if (allowLive)
149983
+ return !0;
149984
+ let options = {
149985
+ message: `Push theme files to the ${themeRole} theme on ${storeFqdn}?`,
149986
+ confirmationMessage: "Yes, confirm changes",
149987
+ cancellationMessage: "Cancel"
149988
+ };
149989
+ return renderConfirmationPrompt(options);
149990
+ }
149991
+ return !0;
149992
+ }
149920
149993
 
149921
149994
  // ../theme/dist/cli/commands/theme/push.js
149922
149995
  var import_core13 = __toESM(require_lib(), 1);
149923
149996
  var _a11, Push = class extends ThemeCommand {
149924
149997
  async run() {
149925
- let { flags } = await this.parse(_a11), { path: path3, force } = flags, store = ensureThemeStore(flags), adminSession = await ensureAuthenticatedThemes(store, flags.password), workingDirectory = path3 ? resolvePath(path3) : cwd();
149926
- if (!await hasRequiredThemeDirectories(workingDirectory) && !await currentDirectoryConfirmed(force))
149927
- return;
149928
- if (!flags.legacy && !flags.password) {
149929
- let { path: path4, nodelete, publish: publish2, json, force: force2, ignore, only } = flags, selectedTheme = await createOrSelectTheme(adminSession, flags);
149930
- if (!selectedTheme)
149931
- return;
149932
- await push(selectedTheme, adminSession, {
149933
- path: path4,
149934
- nodelete,
149935
- publish: publish2,
149936
- json,
149937
- force: force2,
149938
- ignore,
149939
- only
149940
- });
149998
+ let { flags } = await this.parse(_a11);
149999
+ if (flags.password || flags.legacy) {
150000
+ await this.execLegacyPush();
149941
150001
  return;
149942
150002
  }
150003
+ let pushFlags = {
150004
+ path: flags.path,
150005
+ password: flags.password,
150006
+ store: flags.store,
150007
+ environment: flags.environment,
150008
+ theme: flags.theme,
150009
+ development: flags.development,
150010
+ live: flags.live,
150011
+ unpublished: flags.unpublished,
150012
+ nodelete: flags.nodelete,
150013
+ only: flags.only,
150014
+ ignore: flags.ignore,
150015
+ json: flags.json,
150016
+ allowLive: flags["allow-live"],
150017
+ publish: flags.publish,
150018
+ force: flags.force,
150019
+ noColor: flags["no-color"],
150020
+ verbose: flags.verbose
150021
+ };
150022
+ await push(pushFlags);
150023
+ }
150024
+ async execLegacyPush() {
150025
+ let { flags } = await this.parse(_a11), path3 = flags.path || cwd(), force = flags.force || !1, store = ensureThemeStore({ store: flags.store }), adminSession = await ensureAuthenticatedThemes(store, flags.password), workingDirectory = path3 ? resolvePath(path3) : cwd();
150026
+ if (!await hasRequiredThemeDirectories(workingDirectory) && !await currentDirectoryConfirmed(force))
150027
+ return;
149943
150028
  let flagsForCli2 = flags;
149944
150029
  showEmbeddedCLIWarning();
149945
150030
  let developmentThemeManager = new DevelopmentThemeManager(adminSession), targetTheme = await (flagsForCli2.development ? developmentThemeManager.findOrCreate() : developmentThemeManager.fetch());
@@ -150064,41 +150149,6 @@ Push.cli2Flags = [
150064
150149
  "development-theme-id"
150065
150150
  ];
150066
150151
  var push_default = Push;
150067
- async function createOrSelectTheme(adminSession, flags) {
150068
- let { live, development, unpublished, theme } = flags;
150069
- if (development)
150070
- return new DevelopmentThemeManager(adminSession).findOrCreate();
150071
- if (unpublished) {
150072
- let themeName = theme || await promptThemeName("Name of the new theme");
150073
- return createTheme({
150074
- name: themeName,
150075
- role: UNPUBLISHED_THEME_ROLE
150076
- }, adminSession);
150077
- } else {
150078
- let selectedTheme = await findOrSelectTheme(adminSession, {
150079
- header: "Select a theme to push to:",
150080
- filter: {
150081
- live,
150082
- theme
150083
- }
150084
- });
150085
- if (await confirmPushToTheme(selectedTheme.role, flags["allow-live"], adminSession.storeFqdn))
150086
- return selectedTheme;
150087
- }
150088
- }
150089
- async function confirmPushToTheme(themeRole, allowLive, storeFqdn) {
150090
- if (themeRole === LIVE_THEME_ROLE) {
150091
- if (allowLive)
150092
- return !0;
150093
- let options = {
150094
- message: `Push theme files to the ${themeRole} theme on ${storeFqdn}?`,
150095
- confirmationMessage: "Yes, confirm changes",
150096
- cancellationMessage: "Cancel"
150097
- };
150098
- return renderConfirmationPrompt(options);
150099
- }
150100
- return !0;
150101
- }
150102
150152
 
150103
150153
  // ../theme/dist/cli/commands/theme/rename.js
150104
150154
  init_cjs_shims();
@@ -150479,8 +150529,8 @@ async function checkLockfileStatus(directory, shouldExit = !1) {
150479
150529
  if (isHydrogenMonorepo && !process.env.SHOPIFY_UNIT_TEST)
150480
150530
  return;
150481
150531
  let foundPackageManagers = [];
150482
- for (let packageManager2 of packageManagers)
150483
- await fileExists(resolvePath(directory, packageManager2.lockfile)) && foundPackageManagers.push(packageManager2);
150532
+ for (let packageManager of packageManagers)
150533
+ await fileExists(resolvePath(directory, packageManager.lockfile)) && foundPackageManagers.push(packageManager);
150484
150534
  if (foundPackageManagers.length === 0)
150485
150535
  return missingLockfileWarning(shouldExit);
150486
150536
  if (foundPackageManagers.length > 1)
@@ -150956,7 +151006,7 @@ async function runClassicCompilerBuild({
150956
151006
  if (!disableRouteWarning) {
150957
151007
  let missingRoutes = findMissingRoutes(remixConfig);
150958
151008
  if (missingRoutes.length) {
150959
- let packageManager2 = await getPackageManager(root), exec2 = packageManager2 === "npm" ? "npx" : packageManager2;
151009
+ let packageManager = await getPackageManager(root), exec2 = packageManager === "npm" ? "npx" : packageManager;
150960
151010
  outputWarn(
150961
151011
  `Heads up: Shopify stores have a number of standard routes that aren\u2019t set up yet.
150962
151012
  Some functionality and backlinks might not work as expected until these are created or redirects are set up.
@@ -151301,7 +151351,7 @@ async function runBuild({
151301
151351
  if (!watch && !disableRouteWarning) {
151302
151352
  let missingRoutes = findMissingRoutes(remixConfig);
151303
151353
  if (missingRoutes.length) {
151304
- let packageManager2 = await getPackageManager(root), exec2 = packageManager2 === "npm" ? "npx" : packageManager2;
151354
+ let packageManager = await getPackageManager(root), exec2 = packageManager === "npm" ? "npx" : packageManager;
151305
151355
  outputWarn(
151306
151356
  `Heads up: Shopify stores have a number of standard routes that aren\u2019t set up yet.
151307
151357
  Some functionality and backlinks might not work as expected until these are created or redirects are set up.
@@ -153615,7 +153665,7 @@ file://${instrunctionsFilePath}`;
153615
153665
  let releaseNotesUrl = `https://hydrogen.shopify.dev/releases/${selectedRelease.version}`;
153616
153666
  nextSteps.push(`Release notes:
153617
153667
  ${releaseNotesUrl}`);
153618
- let currentPinnedVersion = getAbsoluteVersion(currentVersion), selectedPinnedVersion = getAbsoluteVersion(selectedRelease.version), upgradedDependenciesOnly = currentPinnedVersion === selectedPinnedVersion, fromToMsg = `${currentPinnedVersion} \u2192 ${selectedPinnedVersion}`, headline = upgradedDependenciesOnly ? `You've have upgraded Hydrogen ${selectedPinnedVersion} dependencies` : `You've have upgraded from ${fromToMsg}`, packageManager2 = await getPackageManager(appPath);
153668
+ let currentPinnedVersion = getAbsoluteVersion(currentVersion), selectedPinnedVersion = getAbsoluteVersion(selectedRelease.version), upgradedDependenciesOnly = currentPinnedVersion === selectedPinnedVersion, fromToMsg = `${currentPinnedVersion} \u2192 ${selectedPinnedVersion}`, headline = upgradedDependenciesOnly ? `You've have upgraded Hydrogen ${selectedPinnedVersion} dependencies` : `You've have upgraded from ${fromToMsg}`, packageManager = await getPackageManager(appPath);
153619
153669
  return renderSuccess({
153620
153670
  headline,
153621
153671
  // @ts-ignore we know that filter(Boolean) will always return an array
@@ -153646,7 +153696,7 @@ ${releaseNotesUrl}`);
153646
153696
  {
153647
153697
  list: {
153648
153698
  items: [
153649
- `Run \`git restore . && git clean -df && ${packageManager2} i\``
153699
+ `Run \`git restore . && git clean -df && ${packageManager} i\``
153650
153700
  ]
153651
153701
  }
153652
153702
  }
@@ -153836,10 +153886,10 @@ async function buildAssetsUrl(port, root) {
153836
153886
  async function startMiniOxygen(options, useNodeRuntime = !1) {
153837
153887
  if (useNodeRuntime) {
153838
153888
  process.env.MINIFLARE_SUBREQUEST_LIMIT = 100;
153839
- let { startNodeServer } = await import("./node-V2ZJPWY5.js");
153889
+ let { startNodeServer } = await import("./node-Y6VIULWD.js");
153840
153890
  return startNodeServer(options);
153841
153891
  }
153842
- let { startWorkerdServer } = await import("./workerd-TOCBV52P.js");
153892
+ let { startWorkerdServer } = await import("./workerd-APENUASI.js");
153843
153893
  return startWorkerdServer(options);
153844
153894
  }
153845
153895
 
@@ -154939,27 +154989,27 @@ async function runEnvPush({
154939
154989
  ({ id }) => id === pushToBranchSelection
154940
154990
  );
154941
154991
  }
154942
- let { environmentVariables: environmentVariables2 = [] } = await getStorefrontEnvVariables(
154992
+ let { environmentVariables = [] } = await getStorefrontEnvVariables(
154943
154993
  session,
154944
154994
  config2.storefront.id,
154945
154995
  validatedEnvironment.handle
154946
- ) ?? {}, comparableRemoteVars = environmentVariables2.filter(
154996
+ ) ?? {}, comparableRemoteVars = environmentVariables.filter(
154947
154997
  ({ isSecret, readOnly }) => !isSecret && !readOnly
154948
154998
  ).sort((a, b) => a.key.localeCompare(b.key)).map(({ key, value }) => createDotEnvFileLine(key, value)).join(`
154949
154999
  `) + `
154950
155000
  `, compareableLocalVars = Object.keys(localVariables).sort((a, b) => a.localeCompare(b)).reduce((acc, key) => {
154951
- let { isSecret, readOnly } = environmentVariables2.find((variable) => variable.key === key) ?? {};
155001
+ let { isSecret, readOnly } = environmentVariables.find((variable) => variable.key === key) ?? {};
154952
155002
  return isSecret || readOnly ? acc : [...acc, createDotEnvFileLine(key, localVariables[key])];
154953
155003
  }, []).join(`
154954
155004
  `) + `
154955
155005
  `;
154956
155006
  if (!validatedEnvironment.name)
154957
155007
  throw new AbortError("Missing environment name");
154958
- let remoteReadOnlyOrSecrets = environmentVariables2.reduce(
155008
+ let remoteReadOnlyOrSecrets = environmentVariables.reduce(
154959
155009
  (acc, { isSecret, readOnly, key }) => {
154960
155010
  if (!isSecret && !readOnly)
154961
155011
  return acc;
154962
- let localVar = localVariables[key], remoteVar = environmentVariables2.find(
155012
+ let localVar = localVariables[key], remoteVar = environmentVariables.find(
154963
155013
  (variable) => variable.key === key
154964
155014
  );
154965
155015
  return localVar === remoteVar?.value ? acc : [...acc, key];
@@ -155140,9 +155190,9 @@ async function checkCurrentCLIVersion() {
155140
155190
  label: "Global CLI reference",
155141
155191
  url: "https://shopify.dev/docs/api/shopify-cli/"
155142
155192
  }
155143
- }), (packageManager2) => {
155144
- packageManager2 ??= packageManagerFromUserAgent(), (packageManager2 === "unknown" || !packageManager2) && (packageManager2 = inferPackageManagerForGlobalCLI()), packageManager2 === "unknown" && (packageManager2 = "npm");
155145
- let installMessage = pkgName === UPGRADABLE_CLI_NAMES.cli ? `Please install the latest Shopify CLI version with \`${packageManager2 === "yarn" ? `yarn global add ${UPGRADABLE_CLI_NAMES.cli}` : `${packageManager2} install -g ${UPGRADABLE_CLI_NAMES.cli}`}\` and try again.` : `Please use the latest version with \`${packageManager2} create @shopify/hydrogen@latest\``;
155193
+ }), (packageManager) => {
155194
+ packageManager ??= packageManagerFromUserAgent(), (packageManager === "unknown" || !packageManager) && (packageManager = inferPackageManagerForGlobalCLI()), packageManager === "unknown" && (packageManager = "npm");
155195
+ let installMessage = pkgName === UPGRADABLE_CLI_NAMES.cli ? `Please install the latest Shopify CLI version with \`${packageManager === "yarn" ? `yarn global add ${UPGRADABLE_CLI_NAMES.cli}` : `${packageManager} install -g ${UPGRADABLE_CLI_NAMES.cli}`}\` and try again.` : `Please use the latest version with \`${packageManager} create @shopify/hydrogen@latest\``;
155146
155196
  return renderInfo({
155147
155197
  headline: "Upgrade available",
155148
155198
  body: `Version ${newVersionAvailable} of ${pkgName} is now available.
@@ -155274,17 +155324,17 @@ async function setupLocalStarterTemplate(options, controller) {
155274
155324
  "Setup " + CSS_STRATEGY_NAME_MAP[cssStrategy]
155275
155325
  ) : void 0
155276
155326
  ));
155277
- let { packageManager: packageManager2, shouldInstallDeps, installDeps } = await handleDependencies(
155327
+ let { packageManager, shouldInstallDeps, installDeps } = await handleDependencies(
155278
155328
  project.directory,
155279
155329
  controller,
155280
155330
  options.packageManager,
155281
155331
  options.installDeps
155282
155332
  ), setupSummary = {
155283
155333
  language,
155284
- packageManager: packageManager2,
155334
+ packageManager,
155285
155335
  cssStrategy,
155286
155336
  depsInstalled: !1,
155287
- cliCommand: await getCliCommand("", packageManager2)
155337
+ cliCommand: await getCliCommand("", packageManager)
155288
155338
  };
155289
155339
  if (shouldInstallDeps) {
155290
155340
  let installingDepsPromise = backgroundWorkPromise.then(async () => {
@@ -155519,16 +155569,16 @@ async function setupRemoteTemplate(options, controller) {
155519
155569
  backgroundWorkPromise = backgroundWorkPromise.then(() => transpileProject().catch(abort2)).then(
155520
155570
  () => options.git ? createInitialCommit(project.directory) : void 0
155521
155571
  );
155522
- let { packageManager: packageManager2, shouldInstallDeps, installDeps } = await handleDependencies(
155572
+ let { packageManager, shouldInstallDeps, installDeps } = await handleDependencies(
155523
155573
  project.directory,
155524
155574
  controller,
155525
155575
  options.packageManager,
155526
155576
  options.installDeps
155527
155577
  ), setupSummary = {
155528
155578
  language,
155529
- packageManager: packageManager2,
155579
+ packageManager,
155530
155580
  depsInstalled: !1,
155531
- cliCommand: await getCliCommand("", packageManager2)
155581
+ cliCommand: await getCliCommand("", packageManager)
155532
155582
  }, tasks = [
155533
155583
  {
155534
155584
  title: "Downloading template",
@@ -156087,10 +156137,10 @@ ${CSS_STRATEGY_HELP_URL_MAP[strategy]}`
156087
156137
  tasks.push({
156088
156138
  title: "Installing new dependencies",
156089
156139
  task: async () => {
156090
- let packageManager2 = await gettingPkgManagerPromise;
156091
- isNpm = packageManager2 === "npm" || packageManager2 === "unknown", await installNodeModules({
156140
+ let packageManager = await gettingPkgManagerPromise;
156141
+ isNpm = packageManager === "npm" || packageManager === "unknown", await installNodeModules({
156092
156142
  directory: remixConfig.rootDirectory,
156093
- packageManager: packageManager2,
156143
+ packageManager,
156094
156144
  args: []
156095
156145
  });
156096
156146
  }
@@ -158277,7 +158327,7 @@ init_cjs_shims();
158277
158327
 
158278
158328
  // ../app/dist/cli/models/extensions/schemas.js
158279
158329
  init_cjs_shims();
158280
- var MAX_EXTENSION_HANDLE_LENGTH = 30, MetafieldSchema = z.object({
158330
+ var MAX_EXTENSION_HANDLE_LENGTH = 50, MetafieldSchema = z.object({
158281
158331
  namespace: z.string(),
158282
158332
  key: z.string()
158283
158333
  }), CollectBuyerConsentCapabilitySchema = z.object({
@@ -158466,6 +158516,17 @@ function createContractBasedConfigModuleSpecification(identifier, ...topLevelKey
158466
158516
  }
158467
158517
  });
158468
158518
  }
158519
+ function createContractBasedModuleSpecification(identifier, appModuleFeatures) {
158520
+ return createExtensionSpecification({
158521
+ identifier,
158522
+ schema: z.any({}),
158523
+ appModuleFeatures: () => appModuleFeatures ?? [],
158524
+ deployConfig: async (config2, _2) => {
158525
+ let { type, handle, uid, ...configWithoutFirstClassFields } = config2;
158526
+ return configWithoutFirstClassFields;
158527
+ }
158528
+ });
158529
+ }
158469
158530
  function resolveAppConfigTransform(transformConfig) {
158470
158531
  return transformConfig ? Object.keys(transformConfig).includes("forward") ? transformConfig.forward : (content) => appConfigTransform(content, transformConfig) : (content) => defaultAppConfigTransform(content);
158471
158532
  }
@@ -159591,9 +159652,9 @@ async function handlePartnersErrors(request2) {
159591
159652
  return await request2();
159592
159653
  } catch (error) {
159593
159654
  if (error.errors?.[0]?.extensions?.type === "unsupported_client_version") {
159594
- let packageManager2 = await getPackageManager(cwd());
159655
+ let packageManager = await getPackageManager(cwd());
159595
159656
  throw new AbortError(["Upgrade your CLI version to run the", { command: "deploy" }, "command."], null, [
159596
- ["Run", { command: formatPackageManagerCommand(packageManager2, "shopify upgrade") }]
159657
+ ["Run", { command: formatPackageManagerCommand(packageManager, "shopify upgrade") }]
159597
159658
  ]);
159598
159659
  }
159599
159660
  throw error;
@@ -159796,7 +159857,7 @@ var CONFIG_EXTENSION_IDS = [
159796
159857
  return this.configuration.handle ?? slugify(this.configuration.name ?? "");
159797
159858
  case "dynamic":
159798
159859
  let subscription = this.configuration, handle = `${subscription.topic}${subscription.uri}${subscription.filter}`;
159799
- return hashString(handle).substring(0, 30);
159860
+ return hashString(handle).substring(0, MAX_EXTENSION_HANDLE_LENGTH);
159800
159861
  }
159801
159862
  }
159802
159863
  };
@@ -160907,8 +160968,8 @@ var WebConfigurationAuthCallbackPathSchema = z.preprocess(ensurePathStartsWithSl
160907
160968
  baseWebConfigurationSchema.extend({ roles: z.array(webTypes) }),
160908
160969
  baseWebConfigurationSchema.extend({ type: webTypes })
160909
160970
  ]), ProcessedWebConfigurationSchema = baseWebConfigurationSchema.extend({ roles: z.array(webTypes) }), App = class {
160910
- constructor({ name, directory, packageManager: packageManager2, configuration, nodeDependencies, webs, modules, usesWorkspaces: usesWorkspaces2, dotenv, errors: errors2, specifications, configSchema, remoteFlags }) {
160911
- this.idEnvironmentVariableName = "SHOPIFY_API_KEY", this.name = name, this.directory = directory, this.packageManager = packageManager2, this.configuration = configuration, this.nodeDependencies = nodeDependencies, this.webs = webs, this.dotenv = dotenv, this.realExtensions = modules, this.errors = errors2, this.usesWorkspaces = usesWorkspaces2, this.specifications = specifications, this.configSchema = configSchema ?? AppSchema, this.remoteFlags = remoteFlags ?? [];
160971
+ constructor({ name, directory, packageManager, configuration, nodeDependencies, webs, modules, usesWorkspaces: usesWorkspaces2, dotenv, errors: errors2, specifications, configSchema, remoteFlags }) {
160972
+ this.idEnvironmentVariableName = "SHOPIFY_API_KEY", this.name = name, this.directory = directory, this.packageManager = packageManager, this.configuration = configuration, this.nodeDependencies = nodeDependencies, this.webs = webs, this.dotenv = dotenv, this.realExtensions = modules, this.errors = errors2, this.usesWorkspaces = usesWorkspaces2, this.specifications = specifications, this.configSchema = configSchema ?? AppSchema, this.remoteFlags = remoteFlags ?? [];
160912
160973
  }
160913
160974
  get allExtensions() {
160914
160975
  return this.remoteFlags.includes(Flag.DeclarativeWebhooks) || this.filterDeclarativeWebhooksConfig(), this.includeConfigOnDeploy ? this.realExtensions : this.realExtensions.filter((ext) => !ext.isAppConfigExtension);
@@ -161055,7 +161116,7 @@ function setCachedAppInfo(options, config2 = appLocalStorage()) {
161055
161116
  }
161056
161117
  function clearCurrentConfigFile(directory, config2 = appLocalStorage()) {
161057
161118
  let normalized = normalizePath(directory), savedApp = config2.get(normalized);
161058
- config2.set(normalized, {
161119
+ savedApp && config2.set(normalized, {
161059
161120
  ...savedApp,
161060
161121
  configFile: void 0
161061
161122
  });
@@ -161269,9 +161330,7 @@ function updateURLsPrompt(currentAppUrl, currentRedirectUrls) {
161269
161330
  // ../app/dist/cli/services/dev/select-app.js
161270
161331
  async function selectOrCreateApp(localAppName, apps, hasMorePages, org, developerPlatformClient, options) {
161271
161332
  let createNewApp = apps.length === 0;
161272
- if (createNewApp || (outputInfo(`
161273
- Before proceeding, your project needs to be associated with an app.
161274
- `), createNewApp = await createAsNewAppPrompt()), createNewApp) {
161333
+ if (createNewApp || (createNewApp = await createAsNewAppPrompt()), createNewApp) {
161275
161334
  let name = await appNamePrompt(localAppName);
161276
161335
  return developerPlatformClient.createApp(org, name, options);
161277
161336
  } else {
@@ -163055,170 +163114,7 @@ var TaxCalculationsSchema = BaseSchema.extend({
163055
163114
 
163056
163115
  // ../app/dist/cli/models/extensions/specifications/marketing_activity.js
163057
163116
  init_cjs_shims();
163058
-
163059
- // ../app/dist/cli/models/extensions/specifications/marketing_activity_schemas/marketing_activity_schema.js
163060
- init_cjs_shims();
163061
- var BaseFieldSchema = z.object({
163062
- ui_type: z.string()
163063
- }), CommonFieldSchema = BaseFieldSchema.extend({
163064
- name: z.string(),
163065
- label: z.string(),
163066
- help_text: z.string().optional(),
163067
- required: z.boolean()
163068
- }), BudgetScheduleFieldSchema = CommonFieldSchema.extend({
163069
- ui_type: z.literal("budget-schedule"),
163070
- use_scheduling: z.boolean(),
163071
- use_end_date: z.boolean(),
163072
- use_daily_budget: z.boolean(),
163073
- use_lifetime_budget: z.boolean()
163074
- }), DiscountPickerFieldSchema = CommonFieldSchema.extend({
163075
- ui_type: z.literal("discount-picker"),
163076
- min_resources: z.number().nullable(),
163077
- max_resources: z.number().nullable()
163078
- }), ScheduleFieldSchema = CommonFieldSchema.extend({
163079
- ui_type: z.literal("schedule"),
163080
- use_end_date: z.boolean()
163081
- }), ProductPickerFieldSchema = CommonFieldSchema.extend({
163082
- ui_type: z.literal("product-picker"),
163083
- allow_product_image_selection: z.boolean(),
163084
- allow_uploaded_image_as_product_image: z.boolean(),
163085
- allow_free_image_as_product_image: z.boolean(),
163086
- min_resources: z.number().optional(),
163087
- max_resources: z.number().optional(),
163088
- min_image_select_per_product: z.number().optional(),
163089
- max_image_select_per_product: z.number().optional()
163090
- }), SingleLineTextFieldSchema = CommonFieldSchema.extend({
163091
- ui_type: z.enum(["text-single-line", "text-email", "text-tel", "text-url"]),
163092
- placeholder: z.string().optional(),
163093
- min_length: z.number(),
163094
- max_length: z.number()
163095
- }), TextMultiLineFieldSchema = CommonFieldSchema.extend({
163096
- ui_type: z.literal("text-multi-line"),
163097
- placeholder: z.string(),
163098
- min_length: z.number(),
163099
- max_length: z.number()
163100
- }), DividerFieldSchema = BaseFieldSchema.extend({
163101
- ui_type: z.literal("divider"),
163102
- title: z.string(),
163103
- name: z.string()
163104
- }), SelectFieldSchema = CommonFieldSchema.extend({
163105
- ui_type: z.enum(["select-single", "select-multiple"]),
163106
- choices: z.array(z.object({
163107
- label: z.string(),
163108
- value: z.string()
163109
- }))
163110
- }), ParagraphFieldSchema = BaseFieldSchema.extend({
163111
- ui_type: z.literal("paragraph"),
163112
- heading: z.string().optional(),
163113
- body: z.string().optional()
163114
- }), TypeAheadFieldSchema = CommonFieldSchema.extend({
163115
- ui_type: z.literal("type-ahead"),
163116
- placeholder: z.string()
163117
- }), NumberFieldSchema = CommonFieldSchema.extend({
163118
- ui_type: z.enum(["number-float", "number-integer"]),
163119
- min: z.number(),
163120
- max: z.number(),
163121
- step: z.number()
163122
- }), ImagePickerFieldSchema = CommonFieldSchema.extend({
163123
- ui_type: z.literal("image-picker"),
163124
- min_resources: z.number(),
163125
- max_resources: z.number(),
163126
- allow_free_images: z.boolean(),
163127
- alt_text_required: z.boolean()
163128
- }), UISchemaMapping = {
163129
- "budget-schedule": BudgetScheduleFieldSchema,
163130
- "discount-picker": DiscountPickerFieldSchema,
163131
- schedule: ScheduleFieldSchema,
163132
- "product-picker": ProductPickerFieldSchema,
163133
- "text-single-line": SingleLineTextFieldSchema,
163134
- "text-email": SingleLineTextFieldSchema,
163135
- "text-tel": SingleLineTextFieldSchema,
163136
- "text-url": SingleLineTextFieldSchema,
163137
- "text-multi-line": TextMultiLineFieldSchema,
163138
- "select-single": SelectFieldSchema,
163139
- "select-multiple": SelectFieldSchema,
163140
- paragraph: ParagraphFieldSchema,
163141
- "type-ahead": TypeAheadFieldSchema,
163142
- "number-float": NumberFieldSchema,
163143
- "number-integer": NumberFieldSchema,
163144
- "image-picker": ImagePickerFieldSchema,
163145
- divider: DividerFieldSchema
163146
- }, MarketingActivityExtensionSchema = BaseSchema.extend({
163147
- title: z.string().min(1),
163148
- description: z.string().min(1),
163149
- api_path: z.string(),
163150
- tactic: z.enum([
163151
- "ad",
163152
- "retargeting",
163153
- "post",
163154
- "message",
163155
- "transactional",
163156
- "newsletter",
163157
- "abandoned_cart",
163158
- "affililate",
163159
- "loyalty",
163160
- "link",
163161
- "storefront_app"
163162
- ]),
163163
- marketing_channel: z.enum(["social", "search", "email", "sms", "display", "marketplace"]),
163164
- referring_domain: z.string().optional(),
163165
- is_automation: z.boolean().optional(),
163166
- use_external_editor: z.boolean().optional(),
163167
- preview_data: z.object({
163168
- types: z.array(z.object({
163169
- label: z.string(),
163170
- value: z.string()
163171
- })).max(3).min(1)
163172
- }),
163173
- fields: z.array(z.any().superRefine((val, ctx) => {
163174
- if (typeof val != "object")
163175
- return ctx.addIssue({
163176
- message: "Field must be an object",
163177
- code: z.ZodIssueCode.custom
163178
- });
163179
- if (val.ui_type === void 0)
163180
- return ctx.addIssue({
163181
- message: "Field must have a ui_type",
163182
- code: z.ZodIssueCode.custom
163183
- });
163184
- let schema = UISchemaMapping[val.ui_type];
163185
- if (schema === void 0)
163186
- return ctx.addIssue({
163187
- message: `Unknown ui_type for Field: ${val.ui_type}`,
163188
- code: z.ZodIssueCode.custom
163189
- });
163190
- let result = schema.safeParse(val);
163191
- if (!result.success)
163192
- return ctx.addIssue({
163193
- message: `Error found on Field "${val.name}": ${result.error.message}`,
163194
- code: z.ZodIssueCode.custom
163195
- });
163196
- })).min(1)
163197
- });
163198
-
163199
- // ../app/dist/cli/models/extensions/specifications/marketing_activity.js
163200
- var spec2 = createExtensionSpecification({
163201
- identifier: "marketing_activity",
163202
- schema: MarketingActivityExtensionSchema,
163203
- appModuleFeatures: (_2) => ["bundling"],
163204
- deployConfig: async (config2, _2) => ({
163205
- title: config2.title,
163206
- description: config2.description,
163207
- api_path: config2.api_path,
163208
- tactic: config2.tactic,
163209
- marketing_channel: config2.marketing_channel,
163210
- referring_domain: config2.referring_domain,
163211
- is_automation: config2.is_automation,
163212
- use_external_editor: config2.use_external_editor,
163213
- preview_data: config2.preview_data,
163214
- fields: config2.fields.map((field) => ({
163215
- ...field,
163216
- // NOTE: we're not using this id anywhere, generating it to satisfy the schema
163217
- // decided not to remove it from the schema for now to minimize the risk of breaking changes
163218
- id: randomUUID()
163219
- }))
163220
- })
163221
- }), marketing_activity_default = spec2;
163117
+ var spec2 = createContractBasedModuleSpecification("marketing_activity"), marketing_activity_default = spec2;
163222
163118
 
163223
163119
  // ../app/dist/cli/models/extensions/specifications/theme.js
163224
163120
  init_cjs_shims();
@@ -163631,7 +163527,7 @@ async function unifiedConfigurationParserFactory(merged) {
163631
163527
  return merged.parseConfigurationObject;
163632
163528
  let contract = await normaliseJsonSchema(contractJsonSchema);
163633
163529
  return (config2) => {
163634
- let zodParse = merged.parseConfigurationObject(config2), zodValidatedData = zodParse.state === "ok" ? zodParse.data : void 0, jsonSchemaParse = jsonSchemaValidate(zodValidatedData ?? config2, contract), errors2 = zodParse.errors || [];
163530
+ let zodParse = merged.parseConfigurationObject(config2), zodValidatedData = zodParse.state === "ok" ? zodParse.data : void 0, subjectForAjv = zodValidatedData ?? config2, { type, handle, uid, ...subjectForAjvWithoutFirstClassFields } = subjectForAjv, jsonSchemaParse = jsonSchemaValidate(subjectForAjvWithoutFirstClassFields, contract), errors2 = zodParse.errors || [];
163635
163531
  jsonSchemaParse.state === "error" && (errors2 = errors2.concat(jsonSchemaParse.errors));
163636
163532
  let errorSet = /* @__PURE__ */ new Set();
163637
163533
  return errors2 = errors2.filter((error) => {
@@ -163697,7 +163593,12 @@ async function link(options, shouldRenderSuccess = !0) {
163697
163593
  async function selectOrCreateRemoteAppToLinkTo(options) {
163698
163594
  let developerPlatformClient = await sniffServiceOptionsAndAppConfigToSelectPlatformClient(options), { creationOptions, appDirectory: possibleAppDirectory } = await getAppCreationDefaultsFromLocalApp(options), appDirectory = possibleAppDirectory || options.directory;
163699
163595
  if (options.apiKey) {
163700
- let remoteApp2 = await appFromId({ apiKey: options.apiKey, developerPlatformClient });
163596
+ let remoteApp2 = await appFromId({
163597
+ apiKey: options.apiKey,
163598
+ id: options.appId,
163599
+ developerPlatformClient,
163600
+ organizationId: options.organizationId
163601
+ });
163701
163602
  if (!remoteApp2) {
163702
163603
  let errorMessage2 = InvalidApiKeyErrorMessage(options.apiKey);
163703
163604
  throw new AbortError(errorMessage2.message, errorMessage2.tryMessage);
@@ -163835,7 +163736,7 @@ function buildOptionsForGeneratedConfigFile(options) {
163835
163736
  if (!isEmpty(buildOptions))
163836
163737
  return buildOptions;
163837
163738
  }
163838
- function renderSuccessMessage(configFileName, appName, packageManager2) {
163739
+ function renderSuccessMessage(configFileName, appName, packageManager) {
163839
163740
  renderSuccess({
163840
163741
  headline: `${configFileName} is now linked to "${appName}" on Shopify`,
163841
163742
  body: `Using ${configFileName} as your default config.`,
@@ -163844,7 +163745,7 @@ function renderSuccessMessage(configFileName, appName, packageManager2) {
163844
163745
  [
163845
163746
  "To upload your config, run",
163846
163747
  {
163847
- command: formatPackageManagerCommand(packageManager2, "shopify app deploy")
163748
+ command: formatPackageManagerCommand(packageManager, "shopify app deploy")
163848
163749
  }
163849
163750
  ]
163850
163751
  ],
@@ -164318,12 +164219,12 @@ async function fetchDevDataFromOptions(options, orgId, developerPlatformClient)
164318
164219
  ]), selectedStore;
164319
164220
  return options.storeFqdn && (selectedStore = orgWithStore.store, await convertToTransferDisabledStoreIfNeeded(selectedStore, orgWithStore.organization.id, developerPlatformClient, "never")), { app: selectedApp, store: selectedStore };
164320
164221
  }
164321
- async function getAppContext({ reset, directory, developerPlatformClient, configName, enableLinkingPrompt = !0 }) {
164222
+ async function getAppContext({ reset, directory, configName, enableLinkingPrompt = !0 }) {
164322
164223
  await linkIfNecessary(directory, reset, enableLinkingPrompt);
164323
164224
  let cachedInfo = getCachedAppInfo(directory), { configuration } = await loadAppConfiguration({
164324
164225
  directory,
164325
164226
  userProvidedConfigName: configName
164326
- }), remoteApp;
164227
+ }), developerPlatformClient = selectDeveloperPlatformClient({ configuration }), remoteApp;
164327
164228
  return isCurrentAppSchema(configuration) && (remoteApp = await appFromId({
164328
164229
  apiKey: configuration.client_id,
164329
164230
  id: configuration.app_id,
@@ -164428,12 +164329,12 @@ async function developerPreviewUpdate({ apiKey, developerPlatformClient, enabled
164428
164329
  async function use2({ directory, configName, warningContent, shouldRenderSuccess = !0, reset = !1 }) {
164429
164330
  if (reset) {
164430
164331
  clearCurrentConfigFile(directory);
164431
- let packageManager2 = await getPackageManager(directory);
164332
+ let packageManager = await getPackageManager(directory);
164432
164333
  renderSuccess({
164433
164334
  headline: "Cleared current configuration.",
164434
164335
  body: [
164435
164336
  "In order to set a new current configuration, please run",
164436
- { command: formatPackageManagerCommand(packageManager2, "shopify app config use CONFIG_NAME") },
164337
+ { command: formatPackageManagerCommand(packageManager, "shopify app config use CONFIG_NAME") },
164437
164338
  { char: "." }
164438
164339
  ]
164439
164340
  });
@@ -164676,12 +164577,12 @@ var alreadyShownCLIWarning = !1, AppLoader = class {
164676
164577
  async loaded() {
164677
164578
  let { configuration, directory, configurationLoadResultMetadata, configSchema } = this.loadedConfiguration;
164678
164579
  await logMetadataFromAppLoadingProcess(configurationLoadResultMetadata);
164679
- let dotenv = await loadDotEnv(directory, configuration.path), extensions = await this.loadExtensions(directory, configuration), packageJSONPath = joinPath(directory, "package.json"), name = await loadAppName(directory), nodeDependencies = await getDependencies(packageJSONPath), packageManager2 = await getPackageManager(directory);
164680
- this.showGlobalCLIWarningIfNeeded(nodeDependencies, packageManager2);
164580
+ let dotenv = await loadDotEnv(directory, configuration.path), extensions = await this.loadExtensions(directory, configuration), packageJSONPath = joinPath(directory, "package.json"), name = await loadAppName(directory), nodeDependencies = await getDependencies(packageJSONPath), packageManager = await getPackageManager(directory);
164581
+ this.showGlobalCLIWarningIfNeeded(nodeDependencies, packageManager);
164681
164582
  let { webs, usedCustomLayout: usedCustomLayoutForWeb } = await this.loadWebs(directory, configuration.web_directories), usesWorkspaces2 = await usesWorkspaces(directory), appClass = new App({
164682
164583
  name,
164683
164584
  directory,
164684
- packageManager: packageManager2,
164585
+ packageManager,
164685
164586
  configuration,
164686
164587
  nodeDependencies,
164687
164588
  webs,
@@ -164703,13 +164604,13 @@ var alreadyShownCLIWarning = !1, AppLoader = class {
164703
164604
  parseConfigurationFile(schema, filepath, decode3 = decodeToml) {
164704
164605
  return parseConfigurationFile(schema, filepath, this.abortOrReport.bind(this), decode3);
164705
164606
  }
164706
- showGlobalCLIWarningIfNeeded(nodeDependencies, packageManager2) {
164607
+ showGlobalCLIWarningIfNeeded(nodeDependencies, packageManager) {
164707
164608
  let hasLocalCLI = nodeDependencies["@shopify/cli"] !== void 0;
164708
164609
  if (currentProcessIsGlobal() && hasLocalCLI && !sniffForJson() && !alreadyShownCLIWarning) {
164709
164610
  let warningContent = {
164710
164611
  headline: "You are running a global installation of Shopify CLI",
164711
164612
  body: [
164712
- `This project has Shopify CLI as a local dependency in package.json. If you prefer to use that version, run the command with your package manager (e.g. ${packageManager2} run shopify).`
164613
+ `This project has Shopify CLI as a local dependency in package.json. If you prefer to use that version, run the command with your package manager (e.g. ${packageManager} run shopify).`
164713
164614
  ],
164714
164615
  link: {
164715
164616
  label: "For more information, see Shopify CLI documentation",
@@ -164782,7 +164683,7 @@ var alreadyShownCLIWarning = !1, AppLoader = class {
164782
164683
  let directory = dirname(configurationPath), obj = await loadConfigurationFileContent(configurationPath), { extensions, type } = ExtensionsArraySchema.parse(obj);
164783
164684
  if (extensions) {
164784
164685
  let configuration = await this.parseConfigurationFile(UnifiedSchema, configurationPath), extensionsInstancesPromises = configuration.extensions.map(async (extensionConfig) => {
164785
- let mergedConfig = { ...configuration, ...extensionConfig }, { extensions: extensions2, ...restConfig } = mergedConfig;
164686
+ let mergedConfig = { ...configuration, ...extensionConfig }, { extensions: extensions2, path: path3, ...restConfig } = mergedConfig;
164786
164687
  return restConfig.handle || (this.abortOrReport(outputContent`Missing handle for extension "${restConfig.name}" at ${relativePath(appDirectory, configurationPath)}`, void 0, configurationPath), restConfig.handle = "unknown-handle"), this.createExtensionInstance(mergedConfig.type, restConfig, configurationPath, directory);
164787
164688
  });
164788
164689
  return Promise.all(extensionsInstancesPromises);
@@ -165122,14 +165023,6 @@ async function build(options) {
165122
165023
  }
165123
165024
  var build_default = build;
165124
165025
 
165125
- // ../app/dist/cli/utilities/app-command.js
165126
- init_cjs_shims();
165127
- var AppCommand = class extends base_command_default {
165128
- environmentsFilename() {
165129
- return configurationFileNames.appEnvironments;
165130
- }
165131
- };
165132
-
165133
165026
  // ../app/dist/cli/prompts/deprecation-warnings.js
165134
165027
  init_cjs_shims();
165135
165028
  async function showApiKeyDeprecationWarning() {
@@ -165140,6 +165033,14 @@ async function showApiKeyDeprecationWarning() {
165140
165033
  });
165141
165034
  }
165142
165035
 
165036
+ // ../app/dist/cli/utilities/app-command.js
165037
+ init_cjs_shims();
165038
+ var AppCommand = class extends base_command_default {
165039
+ environmentsFilename() {
165040
+ return configurationFileNames.appEnvironments;
165041
+ }
165042
+ };
165043
+
165143
165044
  // ../app/dist/cli/commands/app/build.js
165144
165045
  var import_core29 = __toESM(require_lib(), 1);
165145
165046
  var _a14, Build2 = class extends AppCommand {
@@ -165155,7 +165056,7 @@ var _a14, Build2 = class extends AppCommand {
165155
165056
  directory: flags.path,
165156
165057
  userProvidedConfigName: flags.config
165157
165058
  });
165158
- await build_default({ app, skipDependenciesInstallation: flags["skip-dependencies-installation"], apiKey });
165059
+ return await build_default({ app, skipDependenciesInstallation: flags["skip-dependencies-installation"], apiKey }), { app };
165159
165060
  }
165160
165061
  };
165161
165062
  _a14 = Build2;
@@ -165196,6 +165097,12 @@ var _a15, ConfigLink = class extends AppCommand {
165196
165097
  apiKey: flags["client-id"]
165197
165098
  };
165198
165099
  await link(options);
165100
+ let specifications = await loadLocalExtensionsSpecifications();
165101
+ return { app: await loadApp({
165102
+ specifications,
165103
+ directory: flags.path,
165104
+ userProvidedConfigName: void 0
165105
+ }) };
165199
165106
  }
165200
165107
  };
165201
165108
  _a15 = ConfigLink;
@@ -165223,6 +165130,12 @@ var _a16, { config, ...appFlagsWithoutConfig } = appFlags, ConfigUse = class ext
165223
165130
  async run() {
165224
165131
  let { flags, args } = await this.parse(_a16);
165225
165132
  await checkFolderIsValidApp(flags.path), await use2({ directory: flags.path, configName: args.config, reset: flags.reset });
165133
+ let specifications = await loadLocalExtensionsSpecifications();
165134
+ return { app: await loadApp({
165135
+ specifications,
165136
+ directory: flags.path,
165137
+ userProvidedConfigName: void 0
165138
+ }) };
165226
165139
  }
165227
165140
  };
165228
165141
  _a16 = ConfigUse;
@@ -165413,7 +165326,7 @@ var DemoWatcher = class _DemoWatcher extends AppCommand {
165413
165326
  userProvidedConfigName: flags.config,
165414
165327
  mode: "report"
165415
165328
  }), watcher = new AppEventWatcher(app);
165416
- await watcher.start(), outputInfo(`Watching for changes in ${app.name}...`), watcher.onEvent(async ({ app: _newApp, extensionEvents, startTime, path: path3 }) => {
165329
+ return await watcher.start(), outputInfo(`Watching for changes in ${app.name}...`), watcher.onEvent(async ({ app: _newApp, extensionEvents, startTime, path: path3 }) => {
165417
165330
  outputInfo(`\u{1F195} Event [${endHRTimeInMs(startTime)}ms]`), outputInfo(` \u{1F4C2} ${path3}`), extensionEvents.forEach((event) => {
165418
165331
  switch (event.type) {
165419
165332
  case EventType.Created:
@@ -165431,7 +165344,7 @@ var DemoWatcher = class _DemoWatcher extends AppCommand {
165431
165344
  }
165432
165345
  });
165433
165346
  }), setInterval(() => {
165434
- }, 1 << 30);
165347
+ }, 1 << 30), { app };
165435
165348
  }
165436
165349
  };
165437
165350
  DemoWatcher.summary = "Watch and prints out changes to an app.";
@@ -165479,7 +165392,7 @@ async function deploy(options) {
165479
165392
  let apiKey = identifiers?.app ?? remoteApp.apiKey;
165480
165393
  outputNewline(), release2 ? outputInfo(`Releasing a new app version as part of ${remoteApp.title}`) : outputInfo(`Creating a new app version as part of ${remoteApp.title}`), outputNewline();
165481
165394
  let uploadExtensionsBundleResult;
165482
- await inTemporaryDirectory(async (tmpDir) => {
165395
+ return await inTemporaryDirectory(async (tmpDir) => {
165483
165396
  try {
165484
165397
  let bundle = app.allExtensions.some((ext) => ext.features.includes("bundling")), bundlePath;
165485
165398
  bundle && (bundlePath = joinPath(tmpDir, "bundle.zip"), await mkdir(dirname(bundlePath))), await bundleAndBuildExtensions({ app, bundlePath, identifiers });
@@ -165523,7 +165436,7 @@ async function deploy(options) {
165523
165436
  } catch (error) {
165524
165437
  throw await updateAppIdentifiers({ app, identifiers, command: "deploy", developerPlatformClient }), error;
165525
165438
  }
165526
- });
165439
+ }), { app };
165527
165440
  }
165528
165441
  async function outputCompletionMessage({ app, release: release2, uploadExtensionsBundleResult }) {
165529
165442
  let linkAndMessage = [
@@ -165601,7 +165514,7 @@ var _a17, Deploy2 = class extends AppCommand {
165601
165514
  userProvidedConfigName: flags.config,
165602
165515
  specifications: await loadLocalExtensionsSpecifications()
165603
165516
  }), requiredNonTTYFlags = ["force"];
165604
- !apiKey && !app.configuration.client_id && requiredNonTTYFlags.push("client-id"), this.failMissingNonTTYFlags(flags, requiredNonTTYFlags), await deploy({
165517
+ return !apiKey && !app.configuration.client_id && requiredNonTTYFlags.push("client-id"), this.failMissingNonTTYFlags(flags, requiredNonTTYFlags), { app: (await deploy({
165605
165518
  app,
165606
165519
  apiKey,
165607
165520
  reset: flags.reset,
@@ -165610,7 +165523,7 @@ var _a17, Deploy2 = class extends AppCommand {
165610
165523
  message: flags.message,
165611
165524
  version: flags.version,
165612
165525
  commitReference: flags["source-control-url"]
165613
- });
165526
+ })).app };
165614
165527
  }
165615
165528
  };
165616
165529
  _a17 = Deploy2;
@@ -165685,6 +165598,13 @@ init_cjs_shims();
165685
165598
 
165686
165599
  // ../cli-kit/dist/public/common/url.js
165687
165600
  init_cjs_shims();
165601
+ function safeParseURL(url) {
165602
+ try {
165603
+ return new URL(url);
165604
+ } catch {
165605
+ return;
165606
+ }
165607
+ }
165688
165608
 
165689
165609
  // ../app/dist/cli/services/dev/urls.js
165690
165610
  async function generateFrontendURL(options) {
@@ -166436,7 +166356,9 @@ async function reloadExtensionConfig({ extension }) {
166436
166356
  extensionConfig || abort2(`ERROR: Invalid handle
166437
166357
  - Expected handle: "${extension.handle}"
166438
166358
  - Configuration file path: ${relativizePath(extension.configurationPath)}.
166439
- - Handles are immutable, you can't change them once they are set.`), configObject = { ...configuration, ...extensionConfig };
166359
+ - Handles are immutable, you can't change them once they are set.`);
166360
+ let mergedConfig = { ...configuration, ...extensionConfig }, { extensions: extensions2, path: path3, ...restConfig } = mergedConfig;
166361
+ configObject = restConfig;
166440
166362
  }
166441
166363
  let newConfig = await parseConfigurationObjectAgainstSpecification(extension.specification, extension.configurationPath, configObject, abort2), previousConfig = extension.configuration;
166442
166364
  return extension.configuration = newConfig, {
@@ -169282,7 +169204,7 @@ async function dev2(commandOptions) {
169282
169204
  let config2 = await prepareForDev(commandOptions);
169283
169205
  await actionsBeforeSettingUpDevProcesses(config2);
169284
169206
  let { processes, graphiqlUrl, previewUrl } = await setupDevProcesses(config2);
169285
- await actionsBeforeLaunchingDevProcesses(config2), await launchDevProcesses({ processes, previewUrl, graphiqlUrl, config: config2 });
169207
+ return await actionsBeforeLaunchingDevProcesses(config2), await launchDevProcesses({ processes, previewUrl, graphiqlUrl, config: config2 }), { app: config2.localApp };
169286
169208
  }
169287
169209
  async function prepareForDev(commandOptions) {
169288
169210
  let tunnelPort = await getAvailableTCPPort(), tunnelClient;
@@ -169531,13 +169453,15 @@ var _a18, Dev4 = class extends AppCommand {
169531
169453
  graphiqlKey: flags["graphiql-key"],
169532
169454
  devPreview: !flags.legacy
169533
169455
  };
169534
- await dev2(devOptions);
169456
+ return { app: (await dev2(devOptions)).app };
169535
169457
  }
169536
169458
  };
169537
169459
  _a18 = Dev4;
169538
169460
  Dev4.summary = "Run the app.";
169539
169461
  Dev4.descriptionWithMarkdown = `[Builds the app](https://shopify.dev/docs/api/shopify-cli/app/app-build) and lets you preview it on a [development store](https://shopify.dev/docs/apps/tools/development-stores) or [Plus sandbox store](https://help.shopify.com/partners/dashboard/managing-stores/plus-sandbox-store).
169540
169462
 
169463
+ > Note: Development store preview of extension drafts is not supported for Plus sandbox stores. You must \`deploy\` your app.
169464
+
169541
169465
  To preview your app on a development store or Plus sandbox store, Shopify CLI walks you through the following steps. If you've run \`dev\` before, then your settings are saved and some of these steps are skipped. You can reset these configurations using \`dev --reset\` to go through all of them again:
169542
169466
 
169543
169467
  - Associating your project with an app associated with your Partner account or organization, or creating a new app.
@@ -170000,7 +169924,7 @@ async function logs(commandOptions) {
170000
169924
  jwtToken,
170001
169925
  filters
170002
169926
  };
170003
- commandOptions.format === "json" ? (consoleLog(JSON.stringify({ subscribedToStores: commandOptions.storeFqdns })), consoleLog(JSON.stringify({ message: "Waiting for app logs..." })), await renderJsonLogs({
169927
+ return commandOptions.format === "json" ? (consoleLog(JSON.stringify({ subscribedToStores: commandOptions.storeFqdns })), consoleLog(JSON.stringify({ message: "Waiting for app logs..." })), await renderJsonLogs({
170004
169928
  options: {
170005
169929
  variables,
170006
169930
  developerPlatformClient: logsConfig.developerPlatformClient
@@ -170015,7 +169939,7 @@ async function logs(commandOptions) {
170015
169939
  },
170016
169940
  pollOptions,
170017
169941
  storeNameById: logsConfig.storeNameById
170018
- }));
169942
+ })), logsConfig.localApp;
170019
169943
  }
170020
169944
  async function prepareForLogs(commandOptions) {
170021
169945
  let { configuration } = await loadAppConfiguration({
@@ -170055,19 +169979,19 @@ function renderAppLogsConfigInfo(appName, storeFqdn, storeFqdns, configFile, org
170055
169979
  var import_core34 = __toESM(require_lib(), 1);
170056
169980
  var _a19, Logs2 = class extends AppCommand {
170057
169981
  async run() {
170058
- let { flags } = await this.parse(_a19), apiKey = flags["client-id"] || flags["api-key"], sources2 = flags.source;
169982
+ let { flags } = await this.parse(_a19), apiKey = flags["client-id"] || flags["api-key"];
170059
169983
  await checkFolderIsValidApp(flags.path);
170060
169984
  let logOptions = {
170061
169985
  apiKey,
170062
169986
  directory: flags.path,
170063
169987
  storeFqdns: flags.store,
170064
- sources: sources2,
169988
+ sources: flags.source,
170065
169989
  status: flags.status,
170066
169990
  configName: flags.config,
170067
169991
  reset: flags.reset,
170068
169992
  format: flags.json ? "json" : "text"
170069
169993
  };
170070
- await logs(logOptions);
169994
+ return { app: await logs(logOptions) };
170071
169995
  }
170072
169996
  };
170073
169997
  _a19 = Logs2;
@@ -170087,10 +170011,6 @@ Logs2.flags = {
170087
170011
  parse: async (input) => normalizeStoreFqdn(input)
170088
170012
  }),
170089
170013
  reset: dev_default2.flags.reset,
170090
- "no-tunnel": dev_default2.flags["no-tunnel"],
170091
- "graphiql-port": dev_default2.flags["graphiql-port"],
170092
- "graphiql-key": dev_default2.flags["graphiql-key"],
170093
- stable: dev_default2.flags.legacy,
170094
170014
  source: import_core34.Flags.string({
170095
170015
  description: "Filters output to the specified log source.",
170096
170016
  env: "SHOPIFY_FLAG_SOURCE",
@@ -170137,7 +170057,7 @@ var _a20, Sources = class extends AppCommand {
170137
170057
  userProvidedConfigName: flags.config,
170138
170058
  mode: "report"
170139
170059
  });
170140
- app.errors ? process.exit(2) : sources(app);
170060
+ return app.errors ? process.exit(2) : sources(app), { app };
170141
170061
  }
170142
170062
  };
170143
170063
  _a20 = Sources;
@@ -170222,7 +170142,7 @@ var _a21, EnvPull2 = class extends AppCommand {
170222
170142
  userProvidedConfigName: flags.config,
170223
170143
  mode: "report"
170224
170144
  }), envFile = joinPath(app.directory, flags["env-file"] ?? getDotEnvFileName(app.configuration.path));
170225
- outputInfo(await pullEnv(app, { envFile }));
170145
+ return outputInfo(await pullEnv(app, { envFile })), { app };
170226
170146
  }
170227
170147
  };
170228
170148
  _a21 = EnvPull2;
@@ -170270,7 +170190,7 @@ var _a22, EnvShow = class extends AppCommand {
170270
170190
  userProvidedConfigName: flags.config,
170271
170191
  mode: "report"
170272
170192
  });
170273
- outputInfo(await showEnv(app));
170193
+ return outputInfo(await showEnv(app)), { app };
170274
170194
  }
170275
170195
  };
170276
170196
  _a22 = EnvShow;
@@ -170378,22 +170298,20 @@ async function getOrGenerateSchemaPath(extension, app) {
170378
170298
  }
170379
170299
 
170380
170300
  // ../app/dist/cli/commands/app/function/build.js
170381
- var _a23, FunctionBuild = class extends base_command_default {
170301
+ var _a23, FunctionBuild = class extends AppCommand {
170382
170302
  async run() {
170383
170303
  let { flags } = await this.parse(_a23);
170384
- await inFunctionContext({
170304
+ return { app: await inFunctionContext({
170385
170305
  path: flags.path,
170386
170306
  userProvidedConfigName: flags.config,
170387
- callback: async (app, ourFunction) => {
170388
- await buildFunctionExtension(ourFunction, {
170389
- app,
170390
- stdout: process.stdout,
170391
- stderr: process.stderr,
170392
- useTasks: !0,
170393
- environment: "production"
170394
- }), renderSuccess({ headline: "Function built successfully." });
170395
- }
170396
- });
170307
+ callback: async (app2, ourFunction) => (await buildFunctionExtension(ourFunction, {
170308
+ app: app2,
170309
+ stdout: process.stdout,
170310
+ stderr: process.stderr,
170311
+ useTasks: !0,
170312
+ environment: "production"
170313
+ }), renderSuccess({ headline: "Function built successfully." }), app2)
170314
+ }) };
170397
170315
  }
170398
170316
  };
170399
170317
  _a23 = FunctionBuild;
@@ -170762,26 +170680,24 @@ function getIdentifierFromFilename(fileName) {
170762
170680
  }
170763
170681
 
170764
170682
  // ../app/dist/cli/commands/app/function/replay.js
170765
- var import_core37 = __toESM(require_lib(), 1), _a24, FunctionReplay = class extends base_command_default {
170683
+ var import_core37 = __toESM(require_lib(), 1), _a24, FunctionReplay = class extends AppCommand {
170766
170684
  async run() {
170767
170685
  let { flags } = await this.parse(_a24);
170768
170686
  flags["api-key"] && await showApiKeyDeprecationWarning();
170769
170687
  let apiKey = flags["client-id"] || flags["api-key"];
170770
- await inFunctionContext({
170688
+ return { app: await inFunctionContext({
170771
170689
  path: flags.path,
170772
170690
  userProvidedConfigName: flags.config,
170773
- callback: async (app, ourFunction) => {
170774
- await replay({
170775
- app,
170776
- extension: ourFunction,
170777
- apiKey,
170778
- path: flags.path,
170779
- log: flags.log,
170780
- json: flags.json,
170781
- watch: flags.watch
170782
- });
170783
- }
170784
- });
170691
+ callback: async (app2, ourFunction) => (await replay({
170692
+ app: app2,
170693
+ extension: ourFunction,
170694
+ apiKey,
170695
+ path: flags.path,
170696
+ log: flags.log,
170697
+ json: flags.json,
170698
+ watch: flags.watch
170699
+ }), app2)
170700
+ }) };
170785
170701
  }
170786
170702
  };
170787
170703
  _a24 = FunctionReplay;
@@ -170829,13 +170745,13 @@ var replay_default = FunctionReplay;
170829
170745
  // ../app/dist/cli/commands/app/function/run.js
170830
170746
  init_cjs_shims();
170831
170747
  var import_core38 = __toESM(require_lib(), 1);
170832
- var _a25, DEFAULT_FUNCTION_EXPORT = "_start", FunctionRun = class extends base_command_default {
170748
+ var _a25, DEFAULT_FUNCTION_EXPORT = "_start", FunctionRun = class extends AppCommand {
170833
170749
  async run() {
170834
170750
  let { flags } = await this.parse(_a25);
170835
- await inFunctionContext({
170751
+ return { app: await inFunctionContext({
170836
170752
  path: flags.path,
170837
170753
  userProvidedConfigName: flags.config,
170838
- callback: async (app, ourFunction) => {
170754
+ callback: async (app2, ourFunction) => {
170839
170755
  let functionExport = DEFAULT_FUNCTION_EXPORT;
170840
170756
  if (flags.export !== void 0)
170841
170757
  outputDebug(`Using export ${flags.export} from the --export flag.`), functionExport = flags.export;
@@ -170854,8 +170770,8 @@ var _a25, DEFAULT_FUNCTION_EXPORT = "_start", FunctionRun = class extends base_c
170854
170770
  functionExport = targeting?.[0]?.export || DEFAULT_FUNCTION_EXPORT, outputDebug(`Using export '${functionExport}'. Use the --export flag or an interactive terminal to select a different export.`);
170855
170771
  } else
170856
170772
  outputDebug(`No targeting information found. Using the default export '${functionExport}'. Use the --export flag or an interactive terminal to select a different export.`);
170857
- let inputQueryPath = ourFunction?.configuration.targeting?.[0]?.input_query, queryPath = inputQueryPath && `${ourFunction?.directory}/${inputQueryPath}`, schemaPath = await getOrGenerateSchemaPath(ourFunction, app);
170858
- await runFunction({
170773
+ let inputQueryPath = ourFunction?.configuration.targeting?.[0]?.input_query, queryPath = inputQueryPath && `${ourFunction?.directory}/${inputQueryPath}`, schemaPath = await getOrGenerateSchemaPath(ourFunction, app2);
170774
+ return await runFunction({
170859
170775
  functionExtension: ourFunction,
170860
170776
  json: flags.json,
170861
170777
  inputPath: flags.input,
@@ -170863,9 +170779,9 @@ var _a25, DEFAULT_FUNCTION_EXPORT = "_start", FunctionRun = class extends base_c
170863
170779
  stdin: "inherit",
170864
170780
  schemaPath,
170865
170781
  queryPath
170866
- });
170782
+ }), app2;
170867
170783
  }
170868
- });
170784
+ }) };
170869
170785
  }
170870
170786
  };
170871
170787
  _a25 = FunctionRun;
@@ -170899,24 +170815,22 @@ var run_default = FunctionRun;
170899
170815
  // ../app/dist/cli/commands/app/function/schema.js
170900
170816
  init_cjs_shims();
170901
170817
  var import_core39 = __toESM(require_lib(), 1);
170902
- var _a26, FetchSchema = class extends base_command_default {
170818
+ var _a26, FetchSchema = class extends AppCommand {
170903
170819
  async run() {
170904
170820
  let { flags } = await this.parse(_a26);
170905
170821
  flags["api-key"] && await showApiKeyDeprecationWarning();
170906
170822
  let apiKey = flags["client-id"] || flags["api-key"];
170907
- await inFunctionContext({
170823
+ return { app: await inFunctionContext({
170908
170824
  path: flags.path,
170909
170825
  userProvidedConfigName: flags.config,
170910
- callback: async (app, ourFunction) => {
170911
- await generateSchemaService({
170912
- app,
170913
- extension: ourFunction,
170914
- apiKey,
170915
- stdout: flags.stdout,
170916
- path: flags.path
170917
- });
170918
- }
170919
- });
170826
+ callback: async (app2, ourFunction) => (await generateSchemaService({
170827
+ app: app2,
170828
+ extension: ourFunction,
170829
+ apiKey,
170830
+ stdout: flags.stdout,
170831
+ path: flags.path
170832
+ }), app2)
170833
+ }) };
170920
170834
  }
170921
170835
  };
170922
170836
  _a26 = FetchSchema;
@@ -170951,16 +170865,14 @@ var schema_default = FetchSchema;
170951
170865
 
170952
170866
  // ../app/dist/cli/commands/app/function/typegen.js
170953
170867
  init_cjs_shims();
170954
- var _a27, FunctionTypegen = class extends base_command_default {
170868
+ var _a27, FunctionTypegen = class extends AppCommand {
170955
170869
  async run() {
170956
170870
  let { flags } = await this.parse(_a27);
170957
- await inFunctionContext({
170871
+ return { app: await inFunctionContext({
170958
170872
  path: flags.path,
170959
170873
  userProvidedConfigName: flags.config,
170960
- callback: async (app, ourFunction) => {
170961
- await buildGraphqlTypes(ourFunction, { stdout: process.stdout, stderr: process.stderr, app }), renderSuccess({ headline: "GraphQL types generated successfully." });
170962
- }
170963
- });
170874
+ callback: async (app2, ourFunction) => (await buildGraphqlTypes(ourFunction, { stdout: process.stdout, stderr: process.stderr, app: app2 }), renderSuccess({ headline: "GraphQL types generated successfully." }), app2)
170875
+ }) };
170964
170876
  }
170965
170877
  };
170966
170878
  _a27 = FunctionTypegen;
@@ -171150,17 +171062,17 @@ async function uiExtensionInit({ directory, url, app, name, extensionFlavor, uid
171150
171062
  {
171151
171063
  title: "Installing dependencies",
171152
171064
  task: async () => {
171153
- let packageManager2 = app.packageManager;
171065
+ let packageManager = app.packageManager;
171154
171066
  if (app.usesWorkspaces)
171155
171067
  getTemplateLanguage(extensionFlavor?.value) === "javascript" && await installNodeModules({
171156
- packageManager: packageManager2,
171068
+ packageManager,
171157
171069
  directory: app.directory
171158
171070
  });
171159
171071
  else {
171160
171072
  await addResolutionOrOverrideIfNeeded(app.directory, extensionFlavor?.value);
171161
171073
  let extensionPackageJsonPath = joinPath(directory, "package.json"), requiredDependencies = await getProdDependencies(extensionPackageJsonPath);
171162
171074
  await addNPMDependenciesIfNeeded(requiredDependencies, {
171163
- packageManager: packageManager2,
171075
+ packageManager,
171164
171076
  type: "prod",
171165
171077
  directory: app.directory
171166
171078
  }), await removeFile(extensionPackageJsonPath);
@@ -171227,7 +171139,7 @@ async function generate(options) {
171227
171139
  }), availableSpecifications = specifications.map((spec3) => spec3.identifier), extensionTemplates = await fetchExtensionTemplates(developerPlatformClient, remoteApp, availableSpecifications), promptOptions = await buildPromptOptions(extensionTemplates, specifications, app, options), promptAnswers = await extension_default(promptOptions);
171228
171140
  await saveAnalyticsMetadata(promptAnswers, options.template);
171229
171141
  let generateExtensionOptions = buildGenerateOptions(promptAnswers, app, options, developerPlatformClient), generatedExtension = await generateExtensionTemplate(generateExtensionOptions);
171230
- renderSuccessMessage2(generatedExtension, app.packageManager);
171142
+ return renderSuccessMessage2(generatedExtension, app.packageManager), { app };
171231
171143
  }
171232
171144
  async function buildPromptOptions(extensionTemplates, specifications, app, options) {
171233
171145
  let extensionTemplate = await handleTypeParameter(options.template, app, extensionTemplates, specifications);
@@ -171268,8 +171180,8 @@ function buildGenerateOptions(promptAnswers, app, options, developerPlatformClie
171268
171180
  developerPlatformClient
171269
171181
  };
171270
171182
  }
171271
- function renderSuccessMessage2(extension, packageManager2) {
171272
- let formattedSuccessfulMessage = formatSuccessfulRunMessage(extension.extensionTemplate, extension.directory, packageManager2);
171183
+ function renderSuccessMessage2(extension, packageManager) {
171184
+ let formattedSuccessfulMessage = formatSuccessfulRunMessage(extension.extensionTemplate, extension.directory, packageManager);
171273
171185
  renderSuccess(formattedSuccessfulMessage);
171274
171186
  }
171275
171187
  function validateExtensionFlavor(extensionTemplate, flavor) {
@@ -171318,18 +171230,14 @@ var _a28, AppGenerateExtension = class extends AppCommand {
171318
171230
  let { flags } = await this.parse(_a28);
171319
171231
  flags["api-key"] && await showApiKeyDeprecationWarning();
171320
171232
  let apiKey = flags["client-id"] || flags["api-key"];
171321
- if (await metadata_default.addPublicMetadata(() => ({
171233
+ return await metadata_default.addPublicMetadata(() => ({
171322
171234
  cmd_scaffold_required_auth: !0,
171323
171235
  cmd_scaffold_template_custom: flags["clone-url"] !== void 0,
171324
171236
  cmd_scaffold_type_owner: "@shopify/app"
171325
- })), flags.type) {
171326
- renderWarning({
171327
- headline: ["The flag --type has been deprecated in favor of --template."],
171328
- body: ["Please use --template instead."]
171329
- });
171330
- return;
171331
- }
171332
- await checkFolderIsValidApp(flags.path), await generate_default({
171237
+ })), flags.type && (renderWarning({
171238
+ headline: ["The flag --type has been deprecated in favor of --template."],
171239
+ body: ["Please use --template instead."]
171240
+ }), process.exit(2)), await checkFolderIsValidApp(flags.path), { app: (await generate_default({
171333
171241
  directory: flags.path,
171334
171242
  reset: flags.reset,
171335
171243
  apiKey,
@@ -171338,7 +171246,7 @@ var _a28, AppGenerateExtension = class extends AppCommand {
171338
171246
  template: flags.template,
171339
171247
  flavor: flags.flavor,
171340
171248
  configName: flags.config
171341
- });
171249
+ })).app };
171342
171250
  }
171343
171251
  };
171344
171252
  _a28 = AppGenerateExtension;
@@ -171684,16 +171592,12 @@ var getMigrationChoices = (isShopifolk) => [
171684
171592
  directory: flags.path,
171685
171593
  userProvidedConfigName: flags.config
171686
171594
  }), isShopifolk = await isShopify(), migrationChoices = getMigrationChoices(isShopifolk), choices = migrationChoices.map((choice) => ({ label: choice.label, value: choice.value })), promptAnswer = await renderSelectPrompt({ message: "Extension type to migrate", choices }), migrationChoice = migrationChoices.find((choice) => choice.value === promptAnswer);
171687
- if (migrationChoice === void 0) {
171688
- renderFatalError(new AbortError("Invalid migration choice"));
171689
- return;
171690
- }
171691
- await importExtensions({
171595
+ return migrationChoice === void 0 ? (renderFatalError(new AbortError("Invalid migration choice")), { app }) : (await importExtensions({
171692
171596
  app,
171693
171597
  apiKey: flags["client-id"],
171694
171598
  extensionTypes: migrationChoice.extensionTypes,
171695
171599
  buildTomlObject: migrationChoice.buildTomlObject
171696
- });
171600
+ }), { app });
171697
171601
  }
171698
171602
  };
171699
171603
  ImportExtensions.description = "Import dashboard-managed extensions into your app.";
@@ -171764,15 +171668,12 @@ var UNKNOWN_TEXT = outputContent`${outputToken.italic("unknown")}`.value, NOT_CO
171764
171668
  `);
171765
171669
  }
171766
171670
  async devConfigsSection() {
171767
- let title = "Current app configuration", developerPlatformClient = this.options.developerPlatformClient, { cachedInfo, remoteApp } = await getAppContext({
171768
- developerPlatformClient,
171671
+ let title = "Current app configuration", { cachedInfo, remoteApp } = await getAppContext({
171769
171672
  directory: this.app.directory,
171770
171673
  reset: !1,
171771
171674
  configName: this.options.configName,
171772
171675
  enableLinkingPrompt: !1
171773
- });
171774
- developerPlatformClient = remoteApp?.developerPlatformClient ?? developerPlatformClient;
171775
- let postscript = outputContent`💡 To change these, run ${outputToken.packagejsonScript(this.app.packageManager, "dev", "--reset")}`.value, updateUrls;
171676
+ }), developerPlatformClient = remoteApp?.developerPlatformClient ?? this.options.developerPlatformClient, postscript = outputContent`💡 To change these, run ${outputToken.packagejsonScript(this.app.packageManager, "dev", "--reset")}`.value, updateUrls;
171776
171677
  cachedInfo?.updateURLs === void 0 ? updateUrls = NOT_CONFIGURED_TEXT : updateUrls = cachedInfo.updateURLs ? "Yes" : "No";
171777
171678
  let partnersAccountInfo = ["Partners account", "unknown"], retrievedAccountInfo = await developerPlatformClient.accountInfo();
171778
171679
  isServiceAccount(retrievedAccountInfo) ? partnersAccountInfo = ["Service account", retrievedAccountInfo.orgName] : isUserAccount(retrievedAccountInfo) && (partnersAccountInfo = ["Partners account", retrievedAccountInfo.email]);
@@ -171884,11 +171785,11 @@ var _a30, AppInfo2 = class extends AppCommand {
171884
171785
  userProvidedConfigName: flags.config,
171885
171786
  mode: "report"
171886
171787
  });
171887
- outputInfo(await info(app, {
171788
+ return outputInfo(await info(app, {
171888
171789
  format: flags.json ? "json" : "text",
171889
171790
  webEnv: flags["web-env"],
171890
171791
  configName: flags.config
171891
- })), app.errors && process.exit(2);
171792
+ })), app.errors && process.exit(2), { app };
171892
171793
  }
171893
171794
  };
171894
171795
  _a30 = AppInfo2;
@@ -171920,10 +171821,7 @@ var info_default2 = AppInfo2;
171920
171821
  // ../app/dist/cli/commands/app/init.js
171921
171822
  init_cjs_shims();
171922
171823
 
171923
- // ../create-app/dist/commands/init.js
171924
- init_cjs_shims();
171925
-
171926
- // ../create-app/dist/prompts/init.js
171824
+ // ../app/dist/cli/prompts/init/init.js
171927
171825
  init_cjs_shims();
171928
171826
  var templates = {
171929
171827
  remix: {
@@ -171956,24 +171854,10 @@ var templates = {
171956
171854
  visible: !1
171957
171855
  }
171958
171856
  }, allTemplates = Object.keys(templates), visibleTemplates = allTemplates.filter((key) => templates[key].visible), templateOptionsInOrder = ["remix", "none"], init = async (options) => {
171959
- let name = options.name, template2 = options.template, flavor = options.flavor, defaults = {
171960
- name: await generateRandomNameForSubdirectory({ suffix: "app", directory: options.directory }),
171857
+ let template2 = options.template, flavor = options.flavor, defaults = {
171961
171858
  template: templates.remix.url
171962
- }, welcomed = !1;
171963
- name || (renderText({ text: `
171964
- Welcome. Let\u2019s get started by naming your app project. You can change it later.` }), welcomed = !0, name = await renderTextPrompt({
171965
- message: "Your project name?",
171966
- defaultValue: defaults.name,
171967
- validate: (value) => {
171968
- if (value.length === 0)
171969
- return "App name can't be empty";
171970
- if (value.length > 30)
171971
- return "Enter a shorter name (30 character max.)";
171972
- if (value.toLowerCase().includes("shopify"))
171973
- return "App name can't include the word 'shopify'";
171974
- }
171975
- })), template2 || (welcomed || (renderText({ text: `
171976
- Welcome. Let\u2019s get started by choosing a template for your app project.` }), welcomed = !0), template2 = await renderSelectPrompt({
171859
+ };
171860
+ template2 || (template2 = await renderSelectPrompt({
171977
171861
  choices: templateOptionsInOrder.map((key) => ({
171978
171862
  label: templates[key].label || key,
171979
171863
  value: key
@@ -171983,7 +171867,6 @@ Welcome. Let\u2019s get started by choosing a template for your app project.` })
171983
171867
  }));
171984
171868
  let answers = {
171985
171869
  ...options,
171986
- name,
171987
171870
  template: template2,
171988
171871
  templateType: isPredefinedTemplate(template2) ? template2 : "custom",
171989
171872
  globalCLIResult: { install: !1, alreadyInstalled: !1 }
@@ -172004,10 +171887,10 @@ function isPredefinedTemplate(template2) {
172004
171887
  return allTemplates.includes(template2);
172005
171888
  }
172006
171889
 
172007
- // ../create-app/dist/services/init.js
171890
+ // ../app/dist/cli/services/init/init.js
172008
171891
  init_cjs_shims();
172009
171892
 
172010
- // ../create-app/dist/utils/template/npm.js
171893
+ // ../app/dist/cli/services/init/template/npm.js
172011
171894
  init_cjs_shims();
172012
171895
  import { platform } from "os";
172013
171896
  async function updateCLIDependencies({ packageJSON, local, useGlobalCLI }) {
@@ -172027,12 +171910,12 @@ async function packagePath(packageName) {
172027
171910
  cwd: moduleDirectory(import.meta.url)
172028
171911
  })}`;
172029
171912
  }
172030
- async function getDeepInstallNPMTasks({ from, packageManager: packageManager2 }) {
172031
- let args = platform() === "win32" && packageManager2 === "yarn" ? ["--network-concurrency", "1"] : [];
172032
- return installNodeModules({ directory: normalizePath(from), packageManager: packageManager2, args });
171913
+ async function getDeepInstallNPMTasks({ from, packageManager }) {
171914
+ let args = platform() === "win32" && packageManager === "yarn" ? ["--network-concurrency", "1"] : [];
171915
+ return installNodeModules({ directory: normalizePath(from), packageManager, args });
172033
171916
  }
172034
171917
 
172035
- // ../create-app/dist/utils/template/cleanup.js
171918
+ // ../app/dist/cli/services/init/template/cleanup.js
172036
171919
  init_cjs_shims();
172037
171920
  async function cleanup(webOutputDirectory) {
172038
171921
  let gitPaths = await glob([
@@ -172052,13 +171935,13 @@ async function cleanup(webOutputDirectory) {
172052
171935
  });
172053
171936
  }
172054
171937
 
172055
- // ../create-app/dist/services/init.js
171938
+ // ../app/dist/cli/services/init/init.js
172056
171939
  async function init2(options) {
172057
- let packageManager2 = options.packageManager, hyphenizedName = hyphenate(options.name), outputDirectory = joinPath(options.directory, hyphenizedName), githubRepo = parseGitHubRepositoryReference(options.template);
172058
- await ensureAppDirectoryIsAvailable(outputDirectory, hyphenizedName), await clearCache(outputDirectory), renderInfo({
171940
+ let packageManager = options.packageManager, hyphenizedName = hyphenate(options.name), outputDirectory = joinPath(options.directory, hyphenizedName), githubRepo = parseGitHubRepositoryReference(options.template);
171941
+ return await ensureAppDirectoryIsAvailable(outputDirectory, hyphenizedName), await clearCache(outputDirectory), renderInfo({
172059
171942
  body: [
172060
171943
  "Initializing project with",
172061
- { command: packageManager2 },
171944
+ { command: packageManager },
172062
171945
  `
172063
171946
  Use the`,
172064
171947
  { command: "--package-manager" },
@@ -172083,7 +171966,7 @@ Use the`,
172083
171966
  title: "Parsing liquid",
172084
171967
  task: async () => {
172085
171968
  await recursiveLiquidTemplateCopy(templatePathDir, templateScaffoldDir, {
172086
- dependency_manager: packageManager2,
171969
+ dependency_manager: packageManager,
172087
171970
  app_name: options.name
172088
171971
  });
172089
171972
  }
@@ -172093,7 +171976,7 @@ Use the`,
172093
171976
  let packageJSON = (await findUpAndReadPackageJson(templateScaffoldDir)).content;
172094
171977
  packageJSON.name = hyphenizedName, packageJSON.author = await username() ?? "", packageJSON.private = !0;
172095
171978
  let workspacesFolders = ["extensions/*"].concat(detectAdditionalWorkspacesFolders(templateScaffoldDir));
172096
- switch (packageManager2) {
171979
+ switch (packageManager) {
172097
171980
  case "npm":
172098
171981
  case "yarn":
172099
171982
  case "bun":
@@ -172137,9 +172020,9 @@ ${workspacesContent}`), await appendFile(joinPath(templateScaffoldDir, ".npmrc")
172137
172020
  `);
172138
172021
  }
172139
172022
  }), tasks.push({
172140
- title: `Installing dependencies with ${packageManager2}`,
172023
+ title: `Installing dependencies with ${packageManager}`,
172141
172024
  task: async () => {
172142
- await getDeepInstallNPMTasks({ from: templateScaffoldDir, packageManager: packageManager2 });
172025
+ await getDeepInstallNPMTasks({ from: templateScaffoldDir, packageManager });
172143
172026
  }
172144
172027
  }, {
172145
172028
  title: "Cleaning up",
@@ -172152,21 +172035,28 @@ ${workspacesContent}`), await appendFile(joinPath(templateScaffoldDir, ".npmrc")
172152
172035
  await initializeGitRepository(templateScaffoldDir);
172153
172036
  }
172154
172037
  }), await renderTasks(tasks), await moveFile(templateScaffoldDir, outputDirectory);
172155
- }), renderSuccess({
172038
+ }), await link({
172039
+ directory: outputDirectory,
172040
+ apiKey: options.app.apiKey,
172041
+ appId: options.app.id,
172042
+ organizationId: options.app.organizationId,
172043
+ configName: "shopify.app.toml",
172044
+ developerPlatformClient: options.developerPlatformClient
172045
+ }, !1), renderSuccess({
172156
172046
  headline: [{ userInput: hyphenizedName }, "is ready for you to build!"],
172157
172047
  nextSteps: [
172158
172048
  ["Run", { command: `cd ${hyphenizedName}` }],
172159
- ["For extensions, run", { command: formatPackageManagerCommand(packageManager2, "shopify app generate extension") }],
172160
- ["To see your app, run", { command: formatPackageManagerCommand(packageManager2, "shopify app dev") }]
172049
+ ["For extensions, run", { command: formatPackageManagerCommand(packageManager, "shopify app generate extension") }],
172050
+ ["To see your app, run", { command: formatPackageManagerCommand(packageManager, "shopify app dev") }]
172161
172051
  ],
172162
172052
  reference: [
172163
172053
  { link: { label: "Shopify docs", url: "https://shopify.dev" } },
172164
172054
  [
172165
172055
  "For an overview of commands, run",
172166
- { command: `${formatPackageManagerCommand(packageManager2, "shopify app", "--help")}` }
172056
+ { command: `${formatPackageManagerCommand(packageManager, "shopify app", "--help")}` }
172167
172057
  ]
172168
172058
  ]
172169
- });
172059
+ }), { outputDirectory };
172170
172060
  }
172171
172061
  async function ensureAppDirectoryIsAvailable(directory, name) {
172172
172062
  if (await fileExists(directory))
@@ -172183,73 +172073,75 @@ function detectAdditionalWorkspacesFolders(directory) {
172183
172073
  }
172184
172074
  var init_default4 = init2;
172185
172075
 
172186
- // ../create-app/dist/commands/init.js
172076
+ // ../app/dist/cli/services/init/validate.js
172077
+ init_cjs_shims();
172078
+ function validateTemplateValue(template2) {
172079
+ if (!template2)
172080
+ return;
172081
+ let url = safeParseURL(template2);
172082
+ if (url && url.origin !== "https://github.com")
172083
+ throw new AbortError("Only GitHub repository references are supported, e.g., https://github.com/Shopify/<repository>/[subpath]#[branch]");
172084
+ if (!url && !isPredefinedTemplate(template2))
172085
+ throw new AbortError(outputContent`Only ${visibleTemplates.map((alias) => outputContent`${outputToken.yellow(alias)}`.value).join(", ")} template aliases are supported, please provide a valid URL`);
172086
+ }
172087
+ function validateFlavorValue(template2, flavor) {
172088
+ if (!template2) {
172089
+ if (flavor)
172090
+ throw new AbortError(outputContent`The ${outputToken.yellow("--flavor")} flag requires the ${outputToken.yellow("--template")} flag to be set`);
172091
+ return;
172092
+ }
172093
+ if (!flavor)
172094
+ return;
172095
+ if (!isPredefinedTemplate(template2))
172096
+ throw new AbortError(outputContent`The ${outputToken.yellow("--flavor")} flag is not supported for custom templates`);
172097
+ let templateConfig = templates[template2];
172098
+ if (!templateConfig.branches)
172099
+ throw new AbortError(outputContent`The ${outputToken.yellow(template2)} template does not support flavors`);
172100
+ if (!templateConfig.branches.options[flavor])
172101
+ throw new AbortError(outputContent`Invalid option for ${outputToken.yellow("--flavor")}\nThe ${outputToken.yellow("--flavor")} flag for ${outputToken.yellow(template2)} accepts only ${Object.keys(templateConfig.branches.options).map((alias) => outputContent`${outputToken.yellow(alias)}`.value).join(", ")}`);
172102
+ }
172103
+
172104
+ // ../app/dist/cli/commands/app/init.js
172187
172105
  var import_core43 = __toESM(require_lib(), 1);
172188
- var _a31, Init3 = class extends base_command_default {
172106
+ var _a31, Init3 = class extends AppCommand {
172189
172107
  async run() {
172190
172108
  let { flags } = await this.parse(_a31);
172191
- this.validateTemplateValue(flags.template), this.validateFlavorValue(flags.template, flags.flavor);
172192
- let inferredPackageManager = this.inferPackageManager(flags["package-manager"]), promptAnswers = await init_default3({
172193
- name: flags.name,
172109
+ validateTemplateValue(flags.template), validateFlavorValue(flags.template, flags.flavor);
172110
+ let inferredPackageManager = inferPackageManager(flags["package-manager"]), name = flags.name ?? await generateRandomNameForSubdirectory({ suffix: "app", directory: flags.path }), developerPlatformClient = selectDeveloperPlatformClient(), selectedApp;
172111
+ if (flags["client-id"])
172112
+ selectedApp = await appFromId({ apiKey: flags["client-id"], developerPlatformClient });
172113
+ else {
172114
+ renderText({ text: `
172115
+ Welcome. Let's get started by linking this new project to an app in your organization.` });
172116
+ let org = await selectOrg(), { organization, apps, hasMorePages } = await developerPlatformClient.orgAndApps(org.id);
172117
+ selectedApp = await selectOrCreateApp(name, apps, hasMorePages, organization, developerPlatformClient);
172118
+ }
172119
+ let promptAnswers = await init_default3({
172194
172120
  template: flags.template,
172195
- flavor: flags.flavor,
172196
- directory: flags.path
172121
+ flavor: flags.flavor
172197
172122
  });
172198
172123
  promptAnswers.globalCLIResult.install && await installGlobalShopifyCLI(inferredPackageManager), await addPublicMetadata(() => ({
172199
172124
  cmd_create_app_template: promptAnswers.templateType,
172200
172125
  cmd_create_app_template_url: promptAnswers.template
172201
- })), await init_default4({
172202
- name: promptAnswers.name,
172126
+ }));
172127
+ let platformClient = selectedApp.developerPlatformClient ?? developerPlatformClient, result = await init_default4({
172128
+ name: selectedApp.title,
172129
+ app: selectedApp,
172203
172130
  packageManager: inferredPackageManager,
172204
172131
  template: promptAnswers.template,
172205
172132
  local: flags.local,
172206
172133
  directory: flags.path,
172207
172134
  useGlobalCLI: promptAnswers.globalCLIResult.alreadyInstalled || promptAnswers.globalCLIResult.install,
172135
+ developerPlatformClient: platformClient,
172208
172136
  postCloneActions: {
172209
172137
  removeLockfilesFromGitignore: promptAnswers.templateType !== "custom"
172210
172138
  }
172211
- });
172212
- }
172213
- validateTemplateValue(template2) {
172214
- if (!template2)
172215
- return;
172216
- let url = this.parseURL(template2);
172217
- if (url && url.origin !== "https://github.com")
172218
- throw new AbortError("Only GitHub repository references are supported, e.g., https://github.com/Shopify/<repository>/[subpath]#[branch]");
172219
- if (!url && !isPredefinedTemplate(template2))
172220
- throw new AbortError(outputContent`Only ${visibleTemplates.map((alias) => outputContent`${outputToken.yellow(alias)}`.value).join(", ")} template aliases are supported, please provide a valid URL`);
172221
- }
172222
- validateFlavorValue(template2, flavor) {
172223
- if (!template2) {
172224
- if (flavor)
172225
- throw new AbortError(outputContent`The ${outputToken.yellow("--flavor")} flag requires the ${outputToken.yellow("--template")} flag to be set`);
172226
- return;
172227
- }
172228
- if (!flavor)
172229
- return;
172230
- if (!isPredefinedTemplate(template2))
172231
- throw new AbortError(outputContent`The ${outputToken.yellow("--flavor")} flag is not supported for custom templates`);
172232
- let templateConfig = templates[template2];
172233
- if (!templateConfig.branches)
172234
- throw new AbortError(outputContent`The ${outputToken.yellow(template2)} template does not support flavors`);
172235
- if (!templateConfig.branches.options[flavor])
172236
- throw new AbortError(outputContent`Invalid option for ${outputToken.yellow("--flavor")}\nThe ${outputToken.yellow("--flavor")} flag for ${outputToken.yellow(template2)} accepts only ${Object.keys(templateConfig.branches.options).map((alias) => outputContent`${outputToken.yellow(alias)}`.value).join(", ")}`);
172237
- }
172238
- parseURL(url) {
172239
- try {
172240
- return new URL(url);
172241
- } catch {
172242
- return;
172243
- }
172244
- }
172245
- inferPackageManager(optionsPackageManager) {
172246
- if (optionsPackageManager && packageManager.includes(optionsPackageManager))
172247
- return optionsPackageManager;
172248
- let usedPackageManager = packageManagerFromUserAgent();
172249
- if (usedPackageManager !== "unknown")
172250
- return usedPackageManager;
172251
- let globalPackageManager = inferPackageManagerForGlobalCLI();
172252
- return globalPackageManager !== "unknown" ? globalPackageManager : "npm";
172139
+ }), specifications = await loadLocalExtensionsSpecifications();
172140
+ return { app: await loadApp({
172141
+ specifications,
172142
+ directory: result.outputDirectory,
172143
+ userProvidedConfigName: void 0
172144
+ }) };
172253
172145
  }
172254
172146
  };
172255
172147
  _a31 = Init3;
@@ -172289,6 +172181,12 @@ Init3.flags = {
172289
172181
  env: "SHOPIFY_FLAG_LOCAL",
172290
172182
  default: !1,
172291
172183
  hidden: !0
172184
+ }),
172185
+ "client-id": import_core43.Flags.string({
172186
+ hidden: !1,
172187
+ description: "The Client ID of your app. Use this to automatically link your new project to an existing app. Using this flag avoids the app selection prompt.",
172188
+ env: "SHOPIFY_FLAG_CLIENT_ID",
172189
+ exclusive: ["config"]
172292
172190
  })
172293
172191
  };
172294
172192
  var init_default5 = Init3;
@@ -172365,13 +172263,13 @@ var _a32, Release = class extends AppCommand {
172365
172263
  directory: flags.path,
172366
172264
  userProvidedConfigName: flags.config
172367
172265
  }), requiredNonTTYFlags = ["force"];
172368
- !apiKey && !app.configuration.client_id && requiredNonTTYFlags.push("client-id"), this.failMissingNonTTYFlags(flags, requiredNonTTYFlags), await release({
172266
+ return !apiKey && !app.configuration.client_id && requiredNonTTYFlags.push("client-id"), this.failMissingNonTTYFlags(flags, requiredNonTTYFlags), await release({
172369
172267
  app,
172370
172268
  apiKey,
172371
172269
  reset: flags.reset,
172372
172270
  force: flags.force,
172373
172271
  version: flags.version
172374
- });
172272
+ }), { app };
172375
172273
  }
172376
172274
  };
172377
172275
  _a32 = Release;
@@ -172489,12 +172387,12 @@ var import_core45 = __toESM(require_lib(), 1), _a33, VersionsList = class extend
172489
172387
  directory: flags.path,
172490
172388
  userProvidedConfigName: flags.config
172491
172389
  });
172492
- await versionList({
172390
+ return await versionList({
172493
172391
  app,
172494
172392
  apiKey,
172495
172393
  reset: !1,
172496
172394
  json: flags.json
172497
- });
172395
+ }), { app };
172498
172396
  }
172499
172397
  };
172500
172398
  _a33 = VersionsList;
@@ -172622,7 +172520,7 @@ async function webhookTriggerService(flags) {
172622
172520
  userProvidedConfigName: flags.config,
172623
172521
  specifications: await loadLocalExtensionsSpecifications()
172624
172522
  }), developerPlatformClient = flags.developerPlatformClient ?? selectDeveloperPlatformClient({ configuration: app.configuration }), options = await validateAndCollectFlags(flags, developerPlatformClient, app);
172625
- await sendSample(options);
172523
+ return await sendSample(options), { app };
172626
172524
  }
172627
172525
  async function validateAndCollectFlags(flags, developerPlatformClient, app) {
172628
172526
  let apiVersion = await collectApiVersion(developerPlatformClient, flags.apiVersion), topic = await collectTopic(developerPlatformClient, apiVersion, flags.topic), [address, deliveryMethod] = await collectAddressAndMethod(flags.deliveryMethod, flags.address), clientCredentials = await collectCredentials(flags.clientId, flags.clientSecret, app, deliveryMethod);
@@ -172672,7 +172570,7 @@ function formatErrors(errors2) {
172672
172570
 
172673
172571
  // ../app/dist/cli/commands/app/webhook/trigger.js
172674
172572
  var import_core46 = __toESM(require_lib(), 1);
172675
- var _a34, WebhookTrigger = class extends base_command_default {
172573
+ var _a34, WebhookTrigger = class extends AppCommand {
172676
172574
  async run() {
172677
172575
  let { flags } = await this.parse(_a34), usedFlags = {
172678
172576
  topic: flags.topic,
@@ -172684,12 +172582,12 @@ var _a34, WebhookTrigger = class extends base_command_default {
172684
172582
  path: flags.path,
172685
172583
  config: flags.config
172686
172584
  };
172687
- flags["shared-secret"] && renderWarning({
172585
+ return flags["shared-secret"] && renderWarning({
172688
172586
  headline: [
172689
172587
  "The flag shared-secret has been deprecated in favor of client-secret and will eventually be deleted."
172690
172588
  ],
172691
172589
  body: ["Please use --client-secret instead."]
172692
- }), await webhookTriggerService(usedFlags);
172590
+ }), { app: (await webhookTriggerService(usedFlags)).app };
172693
172591
  }
172694
172592
  };
172695
172593
  _a34 = WebhookTrigger;
@@ -173881,7 +173779,7 @@ init_cjs_shims();
173881
173779
  // ../plugin-did-you-mean/dist/services/conf.js
173882
173780
  init_cjs_shims();
173883
173781
  function isAutocorrectEnabled(conf = getConfig2()) {
173884
- return conf.get("autocorrectEnabled");
173782
+ return !!conf.get("autocorrectEnabled");
173885
173783
  }
173886
173784
  function setAutocorrect(value, conf = getConfig2()) {
173887
173785
  conf.set("autocorrectEnabled", value);
@@ -174331,7 +174229,10 @@ export {
174331
174229
  hooks as PluginHook,
174332
174230
  provider_default as TunnelProviderHook,
174333
174231
  tunnel_default as TunnelStartHook,
174334
- src_default as default
174232
+ src_default as default,
174233
+ publicFetchStoreThemes as fetchStoreThemes,
174234
+ pull,
174235
+ push
174335
174236
  };
174336
174237
  /*! Bundled license information:
174337
174238