@shopify/cli 4.4.0 → 4.5.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 (278) hide show
  1. package/dist/{analytics-DWUYMFHO.js → analytics-CIKTYXZ6.js} +1 -1
  2. package/dist/{analytics-SOXP4UBD.js → analytics-DM7CBV2M.js} +1 -1
  3. package/dist/assets/hydrogen/starter/CHANGELOG.md +8 -0
  4. package/dist/assets/hydrogen/starter/README.md +4 -4
  5. package/dist/assets/hydrogen/starter/package.json +1 -1
  6. package/dist/assets/hydrogen/starter/vite.config.ts +6 -0
  7. package/dist/bootstrap.js +1 -1
  8. package/dist/{chunk-DLNBTHKL.js → chunk-2FIDORHT.js} +1 -1
  9. package/dist/{chunk-HA6NISOZ.js → chunk-2GDACKZF.js} +1 -1
  10. package/dist/{chunk-5W443CKL.js → chunk-2HZMOK4U.js} +2 -2
  11. package/dist/{chunk-7UOPCYMV.js → chunk-2MNOWKMI.js} +1 -1
  12. package/dist/{chunk-J3HXFQ2L.js → chunk-2WDKXDFM.js} +1 -1
  13. package/dist/{chunk-ZEENHLSC.js → chunk-3GMW7IEC.js} +2 -2
  14. package/dist/{chunk-WRRUFK4Y.js → chunk-3QVXHF6I.js} +1 -1
  15. package/dist/{chunk-POAICASX.js → chunk-3SJHCEQR.js} +1 -1
  16. package/dist/{chunk-7LATYPLU.js → chunk-3YCTWCHH.js} +1 -1
  17. package/dist/{chunk-2EROVVCL.js → chunk-4E354M4H.js} +1 -1
  18. package/dist/{chunk-47MGPVED.js → chunk-4TC4M4RC.js} +1 -1
  19. package/dist/{chunk-J5TNYNR5.js → chunk-5JCREGSD.js} +1 -1
  20. package/dist/{chunk-QPN2M26G.js → chunk-5K4DONQJ.js} +1 -1
  21. package/dist/{chunk-2NWWMNU5.js → chunk-5NY4HKJF.js} +1 -1
  22. package/dist/{chunk-BIMOHK2P.js → chunk-5PLLJPEW.js} +1 -1
  23. package/dist/{chunk-PJYNAUQB.js → chunk-5T3OVTF5.js} +1 -1
  24. package/dist/{chunk-73W5BGAZ.js → chunk-5U6MXSNY.js} +1 -1
  25. package/dist/{chunk-AY4GIVME.js → chunk-5UXPTCSD.js} +1 -1
  26. package/dist/{chunk-G2I2ZUBV.js → chunk-6XLVKD6Q.js} +1 -1
  27. package/dist/{chunk-DZLA2RJP.js → chunk-6Y3QXASG.js} +1 -1
  28. package/dist/{chunk-DHBYYHBT.js → chunk-6ZMNEURG.js} +1 -1
  29. package/dist/chunk-6ZRHK4ON.js +1 -0
  30. package/dist/{chunk-GTUKM3ZW.js → chunk-72K36DID.js} +1 -1
  31. package/dist/{chunk-FPLUMESQ.js → chunk-7USHLXEN.js} +1 -1
  32. package/dist/{chunk-ZAMDXIVC.js → chunk-7XQDZF73.js} +1 -1
  33. package/dist/{chunk-OORCODNK.js → chunk-7ZLKT2TB.js} +1 -1
  34. package/dist/{chunk-HCN6HXA5.js → chunk-AH2ZJ73H.js} +1 -1
  35. package/dist/{chunk-SP2WUATO.js → chunk-AI756VJI.js} +1 -1
  36. package/dist/{chunk-UYK6CXAU.js → chunk-ALQKJAHP.js} +1 -1
  37. package/dist/{chunk-PMXCJIBP.js → chunk-APYASWBA.js} +1 -1
  38. package/dist/{chunk-J2WCMQZZ.js → chunk-ASOT7VNB.js} +1 -1
  39. package/dist/{chunk-MFLQRQQT.js → chunk-AVMNXIXF.js} +1 -1
  40. package/dist/{chunk-7SVMAJTR.js → chunk-BEXQB4RT.js} +1 -1
  41. package/dist/{chunk-Y3WIZSRU.js → chunk-BVFIJSD7.js} +1 -1
  42. package/dist/{chunk-45MEVWH5.js → chunk-BZAZMLII.js} +1 -1
  43. package/dist/{chunk-HZYRCG4R.js → chunk-C5U4NLNU.js} +1 -1
  44. package/dist/{chunk-PETINPMX.js → chunk-CGULQAB5.js} +1 -1
  45. package/dist/{chunk-HZSAUZBX.js → chunk-CNOL26GA.js} +1 -1
  46. package/dist/{chunk-V3RZ3DTW.js → chunk-COTYR5RC.js} +1 -1
  47. package/dist/{chunk-NADNFSKS.js → chunk-DA4LHFJQ.js} +1 -1
  48. package/dist/{chunk-Y66GQ6V2.js → chunk-DCUAVLTM.js} +1 -1
  49. package/dist/{chunk-FA4K3JRN.js → chunk-DDVT2K7E.js} +1 -1
  50. package/dist/{chunk-OQORDQLH.js → chunk-DE3WCNP6.js} +1 -1
  51. package/dist/{chunk-V6ZSIUO3.js → chunk-DKKBJ4H5.js} +1 -1
  52. package/dist/{chunk-ZZFZBFVM.js → chunk-DQE7XRCK.js} +1 -1
  53. package/dist/{chunk-PZYP3MCL.js → chunk-DU5LZYQX.js} +1 -1
  54. package/dist/{chunk-6EZ7JWBK.js → chunk-E24W34C4.js} +4 -4
  55. package/dist/{chunk-TKG42KLM.js → chunk-E7OLCSAL.js} +1 -1
  56. package/dist/{chunk-5QWYIBE6.js → chunk-EAXEV45I.js} +1 -1
  57. package/dist/{chunk-I73E3BD5.js → chunk-EDSKA6UB.js} +1 -1
  58. package/dist/{chunk-WKBVT5WG.js → chunk-ELIH6GCC.js} +1 -1
  59. package/dist/{chunk-QJ7TI6CK.js → chunk-EXQXGSGY.js} +1 -1
  60. package/dist/{chunk-DONEJHDG.js → chunk-EYDNSYYE.js} +2 -2
  61. package/dist/{chunk-SKLUHLS2.js → chunk-FO6FNY6P.js} +1 -1
  62. package/dist/{chunk-UUC5YKAS.js → chunk-FOPGI6GO.js} +1 -1
  63. package/dist/{chunk-H6WN7GP4.js → chunk-FPCPFECH.js} +1 -1
  64. package/dist/{chunk-YGKQCEVG.js → chunk-G7QLHXVA.js} +1 -1
  65. package/dist/{chunk-3OZ6ZZ4T.js → chunk-GAYQKMOM.js} +1 -1
  66. package/dist/{chunk-SWI3LCPE.js → chunk-GKQ6CSJZ.js} +1 -1
  67. package/dist/{chunk-IPQH2RHD.js → chunk-GQG6WELZ.js} +1 -1
  68. package/dist/{chunk-YQH2JHFA.js → chunk-GXUZ3V7S.js} +1 -1
  69. package/dist/{chunk-TJGUNVRI.js → chunk-H3QZN45D.js} +1 -1
  70. package/dist/{chunk-X4DIJTIK.js → chunk-H7DDRARV.js} +1 -1
  71. package/dist/{chunk-G24L7MB3.js → chunk-H7PNMMDO.js} +1 -1
  72. package/dist/{chunk-733R5OKQ.js → chunk-HHSUBF73.js} +1 -1
  73. package/dist/{chunk-IX4KP6E3.js → chunk-HXYWEKMS.js} +1 -1
  74. package/dist/{chunk-GKRCTMWY.js → chunk-IBBFRL3Y.js} +1 -1
  75. package/dist/{chunk-5GVXMNC4.js → chunk-ICFFBMFB.js} +1 -1
  76. package/dist/{chunk-UKK5P74A.js → chunk-IDKUJQIG.js} +3 -3
  77. package/dist/{chunk-EKHWL542.js → chunk-IHUCBI6L.js} +47 -47
  78. package/dist/{chunk-G2S346IS.js → chunk-IIHPONSQ.js} +1 -1
  79. package/dist/{chunk-JAW32T6G.js → chunk-IOU6EKTT.js} +1 -1
  80. package/dist/{chunk-3CYHS4W2.js → chunk-IQYZAALJ.js} +1 -1
  81. package/dist/{chunk-442S5SDM.js → chunk-IRH6IGFT.js} +1 -1
  82. package/dist/{chunk-WNWQSHEC.js → chunk-IRTCLR3F.js} +1 -1
  83. package/dist/chunk-J3KRY2SD.js +1 -0
  84. package/dist/{chunk-KKUDXLK2.js → chunk-JCNRQYRP.js} +1 -1
  85. package/dist/{chunk-F5QG42MA.js → chunk-JNEGEJH6.js} +1 -1
  86. package/dist/{chunk-J7UQBC45.js → chunk-JO4ZHVOD.js} +1 -1
  87. package/dist/{chunk-JOZXRV5K.js → chunk-JOYM7AEQ.js} +1 -1
  88. package/dist/{chunk-ZULTG2D2.js → chunk-JVMYTC3J.js} +1 -1
  89. package/dist/{chunk-PUAMSBXS.js → chunk-KC2TN7AR.js} +1 -1
  90. package/dist/{chunk-CD5O2BIT.js → chunk-KHXDP3SF.js} +1 -1
  91. package/dist/{chunk-6YPEONHB.js → chunk-KOB6T6NK.js} +1 -1
  92. package/dist/{chunk-YLGSM42I.js → chunk-KOUKBXOZ.js} +1 -1
  93. package/dist/{chunk-KN3FTJDU.js → chunk-LUG2BZJP.js} +1 -1
  94. package/dist/{chunk-AT2GDXN7.js → chunk-M2AS5BWX.js} +1 -1
  95. package/dist/{chunk-67KMRBSZ.js → chunk-MCATVWHC.js} +1 -1
  96. package/dist/{chunk-DQ4HA72R.js → chunk-MKCXLBQ4.js} +1 -1
  97. package/dist/{chunk-C3CVLSLS.js → chunk-MMKBIMMC.js} +1 -1
  98. package/dist/{chunk-2MMGFZDP.js → chunk-MOCD7GFI.js} +1 -1
  99. package/dist/{chunk-XH6ZP7M5.js → chunk-MQXSMZQZ.js} +1 -1
  100. package/dist/{chunk-VQW35HIQ.js → chunk-MYQQOOGA.js} +1 -1
  101. package/dist/{chunk-75LJTY7F.js → chunk-N5HGT3TE.js} +1 -1
  102. package/dist/{chunk-VFWWZMOQ.js → chunk-NGPJXONG.js} +1 -1
  103. package/dist/{chunk-U73TPLFE.js → chunk-NV5IDANV.js} +1 -1
  104. package/dist/{chunk-GFCLUGAG.js → chunk-O2PI2PYG.js} +1 -1
  105. package/dist/{chunk-KSZ5K6LJ.js → chunk-O7MONSF7.js} +1 -1
  106. package/dist/{chunk-VOJWKGCW.js → chunk-OASPW2P2.js} +1 -1
  107. package/dist/{chunk-Z4LC3WE5.js → chunk-OCYPWE2O.js} +1 -1
  108. package/dist/{chunk-SXTDVUT3.js → chunk-ODH2U44N.js} +1 -1
  109. package/dist/{chunk-4N6YTHFD.js → chunk-OHASEW7T.js} +1 -1
  110. package/dist/{chunk-IIOIDMG3.js → chunk-OVLTFTZW.js} +1 -1
  111. package/dist/{chunk-Z74QYLNC.js → chunk-P6S5YLOP.js} +1 -1
  112. package/dist/{chunk-GUO7S4NW.js → chunk-PGKP7W5T.js} +1 -1
  113. package/dist/{chunk-LOHUNOQ7.js → chunk-PGN5EZTI.js} +1 -1
  114. package/dist/chunk-PGODIZ64.js +1 -0
  115. package/dist/{chunk-D6YDSGR4.js → chunk-PTIJDS6I.js} +1 -1
  116. package/dist/{chunk-3FBSBMSQ.js → chunk-Q2UHGP2Z.js} +1 -1
  117. package/dist/{chunk-RF6NUGCU.js → chunk-Q2X7IXPQ.js} +1 -1
  118. package/dist/{chunk-H5C3QTOO.js → chunk-Q6LCSRIW.js} +1 -1
  119. package/dist/{chunk-ZIREP3EZ.js → chunk-QDYDB7DY.js} +1 -1
  120. package/dist/{chunk-WLO5H255.js → chunk-QMSYJIAU.js} +1 -1
  121. package/dist/{chunk-T5GSCWN5.js → chunk-QPJQ67GU.js} +1 -1
  122. package/dist/{chunk-QS3FMN67.js → chunk-QPY6WJTT.js} +1 -1
  123. package/dist/{chunk-WAGAC3YI.js → chunk-QVYZZNAS.js} +1 -1
  124. package/dist/{chunk-CZXGQ53M.js → chunk-RFDT525K.js} +1 -1
  125. package/dist/{chunk-NY5OGHM5.js → chunk-RIRSTGFU.js} +1 -1
  126. package/dist/{chunk-APN3VWN4.js → chunk-SFMXFH33.js} +1 -1
  127. package/dist/{chunk-NWDP5IZ2.js → chunk-SKM44SK5.js} +1 -1
  128. package/dist/{chunk-O6KTFMCD.js → chunk-SRAHMYWJ.js} +1 -1
  129. package/dist/{chunk-OAI7VSLW.js → chunk-T3AJL2M5.js} +1 -1
  130. package/dist/{chunk-B7S23DLF.js → chunk-T5DF2GGD.js} +1 -1
  131. package/dist/{chunk-6DIHOMCB.js → chunk-TDCY3BRI.js} +1 -1
  132. package/dist/{chunk-5JNEWYD5.js → chunk-TDSR2X7X.js} +1 -1
  133. package/dist/{chunk-IG6LPVS4.js → chunk-TVU4YD2H.js} +1 -1
  134. package/dist/{chunk-FZKKKGUJ.js → chunk-TXJEP4FB.js} +1 -1
  135. package/dist/{chunk-LOQIRLTD.js → chunk-U2LQBJJL.js} +1 -1
  136. package/dist/{chunk-WZVQHMGI.js → chunk-U7ZRDNZU.js} +1 -1
  137. package/dist/{chunk-RYGZCBO4.js → chunk-UB5BVO76.js} +1 -1
  138. package/dist/{chunk-LCPD2BYX.js → chunk-UHJ65YFN.js} +1 -1
  139. package/dist/{chunk-5QQN3SKH.js → chunk-UYNCJGMC.js} +1 -1
  140. package/dist/{chunk-ATXODH6C.js → chunk-UZ7U322K.js} +1 -1
  141. package/dist/{chunk-HZMP62GK.js → chunk-VHAZBDFE.js} +1 -1
  142. package/dist/{chunk-GW3VY3FZ.js → chunk-VRRDIXFQ.js} +2 -2
  143. package/dist/{chunk-MZMYBFZQ.js → chunk-VSZS3FAJ.js} +1 -1
  144. package/dist/{chunk-B7BUEEBR.js → chunk-WIXW233Y.js} +1 -1
  145. package/dist/{chunk-CPE7XCC6.js → chunk-WMDYHUPS.js} +1 -1
  146. package/dist/{chunk-DO2SHYFU.js → chunk-WO5YOBQ7.js} +1 -1
  147. package/dist/{chunk-4TST2MNC.js → chunk-XDEAZP2I.js} +1 -1
  148. package/dist/{chunk-GBZL4TTY.js → chunk-XH5FCMS5.js} +1 -1
  149. package/dist/chunk-XU6CCL4P.js +278 -0
  150. package/dist/{chunk-XV3I45NA.js → chunk-XWQ72WTQ.js} +1 -1
  151. package/dist/chunk-YB3SGPFF.js +1 -0
  152. package/dist/{chunk-QMXKGSFH.js → chunk-YBFCDINU.js} +1 -1
  153. package/dist/{chunk-BCD4KTLJ.js → chunk-YJCJDCVP.js} +1 -1
  154. package/dist/{chunk-TQUSREKP.js → chunk-YYHCPLBX.js} +1 -1
  155. package/dist/{chunk-6RL7FUPD.js → chunk-YZY4M6IH.js} +1 -1
  156. package/dist/{chunk-WVHB2HCQ.js → chunk-ZDQNCYRH.js} +1 -1
  157. package/dist/{chunk-7EJ4UVYI.js → chunk-ZHPXJRHR.js} +1 -1
  158. package/dist/{chunk-YYL356OX.js → chunk-ZNWFTUFV.js} +1 -1
  159. package/dist/{chunk-ZQ5JVD5X.js → chunk-ZVQBSXE4.js} +1 -1
  160. package/dist/cli/commands/app/app-logs/sources.js +1 -1
  161. package/dist/cli/commands/app/build.js +1 -1
  162. package/dist/cli/commands/app/bulk/cancel.js +1 -1
  163. package/dist/cli/commands/app/bulk/execute.js +1 -1
  164. package/dist/cli/commands/app/bulk/status.js +1 -1
  165. package/dist/cli/commands/app/config/link.js +1 -1
  166. package/dist/cli/commands/app/config/pull.js +1 -1
  167. package/dist/cli/commands/app/config/use.js +1 -1
  168. package/dist/cli/commands/app/config/validate.js +1 -1
  169. package/dist/cli/commands/app/demo/watcher.js +1 -1
  170. package/dist/cli/commands/app/deploy.js +1 -1
  171. package/dist/cli/commands/app/dev/clean.js +1 -1
  172. package/dist/cli/commands/app/dev.js +1 -1
  173. package/dist/cli/commands/app/env/pull.js +1 -1
  174. package/dist/cli/commands/app/env/show.js +1 -1
  175. package/dist/cli/commands/app/execute.js +1 -1
  176. package/dist/cli/commands/app/function/build.js +1 -1
  177. package/dist/cli/commands/app/function/info.js +1 -1
  178. package/dist/cli/commands/app/function/replay.js +1 -1
  179. package/dist/cli/commands/app/function/run.js +1 -1
  180. package/dist/cli/commands/app/function/schema.js +1 -1
  181. package/dist/cli/commands/app/function/typegen.js +1 -1
  182. package/dist/cli/commands/app/generate/extension.js +1 -1
  183. package/dist/cli/commands/app/graphiql.js +1 -1
  184. package/dist/cli/commands/app/import-custom-data-definitions.js +1 -1
  185. package/dist/cli/commands/app/import-extensions.js +1 -1
  186. package/dist/cli/commands/app/info.js +1 -1
  187. package/dist/cli/commands/app/init.js +1 -1
  188. package/dist/cli/commands/app/logs.js +1 -1
  189. package/dist/cli/commands/app/release.js +1 -1
  190. package/dist/cli/commands/app/versions/list.js +1 -1
  191. package/dist/cli/commands/app/webhook/trigger.js +1 -1
  192. package/dist/cli/commands/auth/login.js +1 -1
  193. package/dist/cli/commands/auth/logout.js +1 -1
  194. package/dist/cli/commands/cache/clear.js +1 -1
  195. package/dist/cli/commands/config/autoupgrade/off.js +1 -1
  196. package/dist/cli/commands/config/autoupgrade/on.js +1 -1
  197. package/dist/cli/commands/config/autoupgrade/status.js +1 -1
  198. package/dist/cli/commands/debug/command-flags.js +1 -1
  199. package/dist/cli/commands/doc/fetch.js +1 -1
  200. package/dist/cli/commands/doc/search.js +1 -1
  201. package/dist/cli/commands/docs/generate.js +1 -1
  202. package/dist/cli/commands/doctor-release/doctor-release.js +1 -1
  203. package/dist/cli/commands/doctor-release/theme/index.js +1 -1
  204. package/dist/cli/commands/help.js +1 -1
  205. package/dist/cli/commands/kitchen-sink/async.js +1 -1
  206. package/dist/cli/commands/kitchen-sink/index.js +1 -1
  207. package/dist/cli/commands/kitchen-sink/prompts.js +1 -1
  208. package/dist/cli/commands/kitchen-sink/static.js +1 -1
  209. package/dist/cli/commands/notifications/generate.js +1 -1
  210. package/dist/cli/commands/notifications/list.js +1 -1
  211. package/dist/cli/commands/organization/list.js +1 -1
  212. package/dist/cli/commands/search.js +1 -1
  213. package/dist/cli/commands/theme/check.js +1 -1
  214. package/dist/cli/commands/theme/console.js +1 -1
  215. package/dist/cli/commands/theme/delete.js +1 -1
  216. package/dist/cli/commands/theme/dev.js +1 -1
  217. package/dist/cli/commands/theme/duplicate.js +1 -1
  218. package/dist/cli/commands/theme/info.js +1 -1
  219. package/dist/cli/commands/theme/init.js +1 -1
  220. package/dist/cli/commands/theme/language-server.js +1 -1
  221. package/dist/cli/commands/theme/list.js +1 -1
  222. package/dist/cli/commands/theme/metafields/pull.js +1 -1
  223. package/dist/cli/commands/theme/open.js +1 -1
  224. package/dist/cli/commands/theme/package.js +1 -1
  225. package/dist/cli/commands/theme/preview.js +1 -1
  226. package/dist/cli/commands/theme/profile.js +1 -1
  227. package/dist/cli/commands/theme/publish.js +1 -1
  228. package/dist/cli/commands/theme/pull.js +1 -1
  229. package/dist/cli/commands/theme/push.js +1 -1
  230. package/dist/cli/commands/theme/rename.js +1 -1
  231. package/dist/cli/commands/theme/share.js +1 -1
  232. package/dist/cli/commands/upgrade.js +1 -1
  233. package/dist/cli/commands/version.js +1 -1
  234. package/dist/command-registry.js +1 -1
  235. package/dist/{conf-store-C2LOYIOU.js → conf-store-OC4XCP45.js} +1 -1
  236. package/dist/{deprecations-QOHE6JG6.js → deprecations-M5JGGK47.js} +1 -1
  237. package/dist/dist-3SP7TISC.js +1 -0
  238. package/dist/{dist-FF6C4ZHS.js → dist-Z4H2OM7V.js} +1 -1
  239. package/dist/{environments-EGD263DV.js → environments-ZLSO534C.js} +1 -1
  240. package/dist/{error-66U2HJ37.js → error-ZBG2MA5U.js} +1 -1
  241. package/dist/{error-handler-SW2ALZ5Z.js → error-handler-MCUV4RZV.js} +1 -1
  242. package/dist/{fs-JPQRUGZI.js → fs-7LCRIUF3.js} +1 -1
  243. package/dist/hooks/app-init.js +1 -1
  244. package/dist/hooks/did-you-mean.js +1 -1
  245. package/dist/hooks/hydrogen-init.js +1 -1
  246. package/dist/hooks/postrun.js +1 -1
  247. package/dist/hooks/prerun.js +1 -1
  248. package/dist/hooks/public-metadata.js +1 -1
  249. package/dist/hooks/sensitive-metadata.js +1 -1
  250. package/dist/hooks/tunnel-provider.js +1 -1
  251. package/dist/hooks/tunnel-start.js +1 -1
  252. package/dist/index.js +14 -14
  253. package/dist/{is-global-QWTDUPNR.js → is-global-RURDJZDU.js} +1 -1
  254. package/dist/{local-FRYN3NWL.js → local-5AKD7T5X.js} +1 -1
  255. package/dist/{local-storage-DFH3LT5G.js → local-storage-TJU77VRQ.js} +1 -1
  256. package/dist/{metadata-KZVLHQII.js → metadata-D5GLZOLV.js} +1 -1
  257. package/dist/{node-package-manager-LVFBY4LY.js → node-package-manager-FA3Y6DPG.js} +1 -1
  258. package/dist/notifications-system-76GJJAJP.js +1 -0
  259. package/dist/{output-NH4I5Y3C.js → output-FYS764MJ.js} +1 -1
  260. package/dist/{system-GNOF6HMI.js → system-KDM2BB7R.js} +1 -1
  261. package/dist/tsconfig.tsbuildinfo +1 -1
  262. package/dist/{ui-QOGKADWB.js → ui-QIHGXICT.js} +1 -1
  263. package/dist/upgrade-DY4L43H4.js +1 -0
  264. package/dist/{version-FJFTTOZU.js → version-LULWCT5R.js} +1 -1
  265. package/dist/version-WIERCO5R.js +1 -0
  266. package/dist/{workerd-U6WWWY73.js → workerd-N25GY5MX.js} +1 -1
  267. package/oclif.manifest.json +21 -7
  268. package/package.json +8 -8
  269. package/dist/chunk-FU232KQ7.js +0 -1
  270. package/dist/chunk-HM5H7WBE.js +0 -1
  271. package/dist/chunk-MQICT2LR.js +0 -1
  272. package/dist/chunk-UMT7DWR4.js +0 -1
  273. package/dist/chunk-ZIXWWU2N.js +0 -275
  274. package/dist/dist-Q676YGVI.js +0 -1
  275. package/dist/notifications-system-DP443VTE.js +0 -1
  276. package/dist/upgrade-K4S6JW64.js +0 -1
  277. package/dist/version-ZI4GZX72.js +0 -1
  278. /package/dist/{morph-CG6HEMCQ.js → morph-QZGREMO2.js} +0 -0
@@ -0,0 +1,278 @@
1
+ import{$ as ni,A as Wn,Aa as hi,B as k,Ba as gi,C as U,Ca as yi,D as zn,E as ve,F as Zt,G as qe,H as rt,I as xe,Ia as To,J as Jn,Ja as wi,K as Ne,Ka as mr,L as Pe,La as ze,M as Qn,Ma as at,N as er,Na as Pt,O as he,Oa as pr,P as Do,Pa as lt,Q as Kn,Qa as hr,R as ot,Ra as bi,S as nt,Sa as ki,T as Xn,Ta as Ei,U as tr,Ua as gr,V as Zn,Va as Si,W as ei,Wa as xi,X as ti,Xa as Pi,Y as ri,Z as oi,_ as Ye,a as ue,aa as z,b as Et,ba as it,c as Hn,ca as ii,d as Ie,da as si,e as Se,ea as rr,f as Ge,fa as or,g as Mn,ga as ai,h as Un,ha as ge,i as Bn,ia as li,j as ko,ja as ci,k as et,ka as Co,l as St,la as di,m as je,ma as ui,n as Vn,na as fi,o as Qt,oa as nr,p as Eo,pa as ir,q as xt,qa as sr,r as So,ra as mi,s as Gn,sa as ar,t as qn,ta as lr,u as xo,ua as pi,v as Yn,va as cr,w as Po,wa as dr,x as Kt,xa as We,y as Xt,ya as st,z as tt,za as ur}from"./chunk-IHUCBI6L.js";import{b as vi}from"./chunk-XWPPBOGF.js";import{a as yr}from"./chunk-FKIVKNOV.js";import{a as _n}from"./chunk-KRZABRYT.js";import{a as Di}from"./chunk-6XLVKD6Q.js";import{b as Rn,c as $n,d as Jt,g as An,i as Fn,j as jn,k as Nn}from"./chunk-VSZS3FAJ.js";import{a as pl,b as Ln,d as hl}from"./chunk-JVMYTC3J.js";import{a as fr,b as Io,c as Oo}from"./chunk-MQXSMZQZ.js";import{c as On}from"./chunk-F3TMLDLC.js";import{Aa as ul,Ba as Dn,Ca as fl,Da as ml,fa as pe,m as vn,n as ae}from"./chunk-2HZMOK4U.js";import{B as Pn,l as kn,m as Ee,p as Yt,s as En,u as Sn,x as xn}from"./chunk-VRRDIXFQ.js";import{b as O}from"./chunk-IDKUJQIG.js";import{b as wn}from"./chunk-5C7HDTHJ.js";import{A as Te,D as ee,O as bo,a as qt,u as B,v as N,w as Y,x as Cn,y as Re,z as $e}from"./chunk-E24W34C4.js";import{d as E,g as Wt}from"./chunk-ELIH6GCC.js";import{$ as pn,Bb as bn,Ca as yo,Ea as Vt,Fb as we,Ga as gn,Ha as yn,Hb as W,Jb as Ae,Ka as wo,Mb as F,Nb as Tn,Oa as vo,Ob as Fe,Pb as In,Qb as V,Rb as te,Ta as G,V as Ut,Wa as kt,ma as de,na as hn,pa as Bt,qa as go,qb as Gt,ua as K,wa as bt,ya as ke}from"./chunk-EYDNSYYE.js";import{u as H}from"./chunk-A4SBXDZB.js";import{s as zt}from"./chunk-JCNRQYRP.js";import{d as x,f as T,g as se,i as ho,j as Ze,k as fn,q as mn}from"./chunk-773TIA5M.js";import{a as cl}from"./chunk-CX5CC6P5.js";import{b as dl}from"./chunk-TOLPNBZK.js";import{a as be,c as ce,e as Q,g as l}from"./chunk-VKWPEFWQ.js";var Ys=ce((Xw,qs)=>{l();qs.exports=Jc;function Jc(e){var t=e._readableState;return t?t.objectMode||typeof e._duplexState=="number"?e.read():e.read(Qc(t)):null}function Qc(e){if(e.buffer.length){var t=e.bufferIndex||0;if(e.buffer.head)return e.buffer.head.data.length;if(e.buffer.length-t>0&&e.buffer[t])return e.buffer[t].length}return e.length}});var qo=ce((ev,Qs)=>{l();var Yr=Ln(),Ws=Dn(),Kc=On(),Xc=Ys(),zs=Buffer.from&&Buffer.from!==Uint8Array.from?Buffer.from([0]):new Buffer([0]),Go=function(e,t){e._corked?e.once("uncork",t):t()},Zc=function(e,t){e._autoDestroy&&e.destroy(t)},Js=function(e,t){return function(r){r?Zc(e,r.message==="premature close"?null:r):t&&!e._ended&&e.end()}},ed=function(e,t){if(!e||e._writableState&&e._writableState.finished)return t();if(e._writableState)return e.end(t);e.end(),t()},td=function(e){return new Yr.Readable({objectMode:!0,highWaterMark:16}).wrap(e)},X=function(e,t,r){if(!(this instanceof X))return new X(e,t,r);Yr.Duplex.call(this,r),this._writable=null,this._readable=null,this._readable2=null,this._autoDestroy=!r||r.autoDestroy!==!1,this._forwardDestroy=!r||r.destroy!==!1,this._forwardEnd=!r||r.end!==!1,this._corked=1,this._ondrain=null,this._drained=!1,this._forwarding=!1,this._unwrite=null,this._unread=null,this._ended=!1,this.destroyed=!1,e&&this.setWritable(e),t&&this.setReadable(t)};Kc(X,Yr.Duplex);X.obj=function(e,t,r){return r||(r={}),r.objectMode=!0,r.highWaterMark=16,new X(e,t,r)};X.prototype.cork=function(){++this._corked===1&&this.emit("cork")};X.prototype.uncork=function(){this._corked&&--this._corked===0&&this.emit("uncork")};X.prototype.setWritable=function(e){if(this._unwrite&&this._unwrite(),this.destroyed){e&&e.destroy&&e.destroy();return}if(e===null||e===!1){this.end();return}var t=this,r=Ws(e,{writable:!0,readable:!1},Js(this,this._forwardEnd)),o=function(){var i=t._ondrain;t._ondrain=null,i&&i()},n=function(){t._writable.removeListener("drain",o),r()};this._unwrite&&process.nextTick(o),this._writable=e,this._writable.on("drain",o),this._unwrite=n,this.uncork()};X.prototype.setReadable=function(e){if(this._unread&&this._unread(),this.destroyed){e&&e.destroy&&e.destroy();return}if(e===null||e===!1){this.push(null),this.resume();return}var t=this,r=Ws(e,{writable:!1,readable:!0},Js(this)),o=function(){t._forward()},n=function(){t.push(null)},i=function(){t._readable2.removeListener("readable",o),t._readable2.removeListener("end",n),r()};this._drained=!0,this._readable=e,this._readable2=e._readableState?e:td(e),this._readable2.on("readable",o),this._readable2.on("end",n),this._unread=i,this._forward()};X.prototype._read=function(){this._drained=!0,this._forward()};X.prototype._forward=function(){if(!(this._forwarding||!this._readable2||!this._drained)){this._forwarding=!0;for(var e;this._drained&&(e=Xc(this._readable2))!==null;)this.destroyed||(this._drained=this.push(e));this._forwarding=!1}};X.prototype.destroy=function(e){if(!this.destroyed){this.destroyed=!0;var t=this;process.nextTick(function(){t._destroy(e)})}};X.prototype._destroy=function(e){if(e){var t=this._ondrain;this._ondrain=null,t?t(e):this.emit("error",e)}this._forwardDestroy&&(this._readable&&this._readable.destroy&&this._readable.destroy(),this._writable&&this._writable.destroy&&this._writable.destroy()),this.emit("close")};X.prototype._write=function(e,t,r){if(this.destroyed)return r();if(this._corked)return Go(this,this._write.bind(this,e,t,r));if(e===zs)return this._finish(r);if(!this._writable)return r();this._writable.write(e)===!1?this._ondrain=r:r()};X.prototype._finish=function(e){var t=this;this.emit("preend"),Go(this,function(){ed(t._forwardEnd&&t._writable,function(){t._writableState.prefinished===!1&&(t._writableState.prefinished=!0),t.emit("prefinish"),Go(t,e)})})};X.prototype.end=function(e,t,r){return typeof e=="function"?this.end(null,null,e):typeof t=="function"?this.end(e,null,t):(this._ended=!0,e&&this.write(e),this._writableState.ending||this.write(zs),Yr.Writable.prototype.end.call(this,r))};Qs.exports=X});var Xs=ce((rv,Ks)=>{l();Ks.exports=od;var rd=Object.prototype.hasOwnProperty;function od(){for(var e={},t=0;t<arguments.length;t++){var r=arguments[t];for(var o in r)rd.call(r,o)&&(e[o]=r[o])}return e}});var Wo=ce((nv,Wr)=>{l();var Zs=Ln().Transform,ea=be("util").inherits,ta=Xs();function gt(e){Zs.call(this,e),this._destroyed=!1}ea(gt,Zs);gt.prototype.destroy=function(e){if(!this._destroyed){this._destroyed=!0;var t=this;process.nextTick(function(){e&&t.emit("error",e),t.emit("close")})}};function nd(e,t,r){r(null,e)}function Yo(e){return function(t,r,o){return typeof t=="function"&&(o=r,r=t,t={}),typeof r!="function"&&(r=nd),typeof o!="function"&&(o=null),e(t,r,o)}}Wr.exports=Yo(function(e,t,r){var o=new gt(e);return o._transform=t,r&&(o._flush=r),o});Wr.exports.ctor=Yo(function(e,t,r){function o(n){if(!(this instanceof o))return new o(n);this.options=ta(e,n),gt.call(this,this.options)}return ea(o,gt),o.prototype._transform=t,r&&(o.prototype._flush=r),o});Wr.exports.obj=Yo(function(e,t,r){var o=new gt(ta({objectMode:!0,highWaterMark:16},e));return o._transform=t,r&&(o._flush=r),o})});var na=ce((sv,oa)=>{l();var id=qo(),sd=Wo(),ad=dl(),ld=function(e){return!Buffer.isBuffer(e)&&typeof e!="string"},ra=function(e,t){if(typeof e=="number"&&(e={maxBuffer:e}),typeof e=="function")return ra(null,e);e||(e={});var r=typeof e.maxBuffer=="number"?e.maxBuffer:65535,o=e.strict,n=e.newline!==!1,i=[],s=0,a=id.obj(),c=sd.obj({highWaterMark:1},function(f,m,p){if(ld(f))return u(f,null,p);if(Buffer.isBuffer(f)||(f=ad(f)),n){var h=Array.prototype.indexOf.call(f,10);if(h>0&&f[h-1]===13&&h--,h>-1)return i.push(f.slice(0,h)),u(Buffer.concat(i),f.slice(h),p)}if(i.push(f),s+=f.length,s<r)return p();if(o)return p(new Error("No newline found"));u(Buffer.concat(i),null,p)}),d=function(){if(o)return a.destroy(new Error("No newline found"));a.cork(),u(Buffer.concat(i),null,function(f){if(f)return a.destroy(f);a.uncork()})},u=function(f,m,p){a.removeListener("preend",d),t(f,function(h,y){if(h)return p(h);a.setWritable(y),a.setReadable(y),f&&y.write(f),m&&y.write(m),m=i=c=null,p()})};return a.on("preend",d),a.setWritable(c),a};oa.exports=ra});var aa=ce((lv,sa)=>{l();var cd=ul(),dd=Dn(),zo=be("fs"),Ft=function(){},ud=/^v?\.0/.test(process.version),zr=function(e){return typeof e=="function"},fd=function(e){return!ud||!zo?!1:(e instanceof(zo.ReadStream||Ft)||e instanceof(zo.WriteStream||Ft))&&zr(e.close)},md=function(e){return e.setHeader&&zr(e.abort)},pd=function(e,t,r,o){o=cd(o);var n=!1;e.on("close",function(){n=!0}),dd(e,{readable:t,writable:r},function(s){if(s)return o(s);n=!0,o()});var i=!1;return function(s){if(!n&&!i){if(i=!0,fd(e))return e.close(Ft);if(md(e))return e.abort();if(zr(e.destroy))return e.destroy();o(s||new Error("stream was destroyed"))}}},ia=function(e){e()},hd=function(e,t){return e.pipe(t)},gd=function(){var e=Array.prototype.slice.call(arguments),t=zr(e[e.length-1]||Ft)&&e.pop()||Ft;if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new Error("pump requires two streams per minimum");var r,o=e.map(function(n,i){var s=i<e.length-1,a=i>0;return pd(n,s,a,function(c){r||(r=c),c&&o.forEach(ia),!s&&(o.forEach(ia),t(r))})});e.reduce(hd)};sa.exports=gd});var da=ce((dv,Jr)=>{l();var yd=aa(),wd=On(),la=qo(),ca=function(e){return e.length?Array.isArray(e[0])?e[0]:Array.prototype.slice.call(e):[]},Jo=function(e){var t=function(){var r=ca(arguments);if(!(this instanceof t))return new t(r);la.call(this,null,null,e),r.length&&this.setPipeline(r)};return wd(t,la),t.prototype.setPipeline=function(){var r=ca(arguments),o=this,n=!1,i=r[0],s=r[r.length-1];s=s.readable?s:null,i=i.writable?i:null;var a=function(){r[0].emit("error",new Error("stream was destroyed"))};if(this.on("close",a),this.on("prefinish",function(){n||o.cork()}),yd(r,function(c){if(o.removeListener("close",a),c)return o.destroy(c.message==="premature close"?null:c);n=!0,o._autoDestroy===!1&&(o._autoDestroy=!0),o.uncork()}),this.destroyed)return a();this.setWritable(i),this.setReadable(s)},t};Jr.exports=Jo({autoDestroy:!1,destroy:!1});Jr.exports.obj=Jo({autoDestroy:!1,destroy:!1,objectMode:!0,highWaterMark:16});Jr.exports.ctor=Jo});var fa=ce((fv,ua)=>{"use strict";l();ua.exports=function(e){return!e||e.length<3?!1:e[0]===31&&e[1]===139&&e[2]===8}});var pa=ce((pv,ma)=>{"use strict";l();ma.exports=function(e){return!e||e.length<2?!1:e[0]===120&&(e[1]===1||e[1]===156||e[1]===218)}});var wa=ce((gv,ya)=>{l();var ha=be("zlib"),vd=na(),bd=Wo(),ga=da(),kd=fa(),Ed=pa(),Sd=function(e){return kd(e)?1:Ed(e)?2:0},Qo=function(e){return e===void 0&&(e=3),vd({newline:!1,maxBuffer:10},function(t,r){if(e<0)return r(new Error("Maximum recursion reached"));switch(Sd(t)){case 1:r(null,ga(ha.createGunzip(),Qo(e-1)));break;case 2:r(null,ga(ha.createInflate(),Qo(e-1)));break;default:r(null,bd())}})};ya.exports=Qo});var Pa=ce((wv,xa)=>{"use strict";l();var ye=be("fs"),Ke=be("path"),xd=ye.lchown?"lchown":"chown",Pd=ye.lchownSync?"lchownSync":"chownSync",ba=ye.lchown&&!process.version.match(/v1[1-9]+\./)&&!process.version.match(/v10\.[6-9]/),va=(e,t,r)=>{try{return ye[Pd](e,t,r)}catch(o){if(o.code!=="ENOENT")throw o}},Dd=(e,t,r)=>{try{return ye.chownSync(e,t,r)}catch(o){if(o.code!=="ENOENT")throw o}},Cd=ba?(e,t,r,o)=>n=>{!n||n.code!=="EISDIR"?o(n):ye.chown(e,t,r,o)}:(e,t,r,o)=>o,Ko=ba?(e,t,r)=>{try{return va(e,t,r)}catch(o){if(o.code!=="EISDIR")throw o;Dd(e,t,r)}}:(e,t,r)=>va(e,t,r),Td=process.version,ka=(e,t,r)=>ye.readdir(e,t,r),Id=(e,t)=>ye.readdirSync(e,t);/^v4\./.test(Td)&&(ka=(e,t,r)=>ye.readdir(e,r));var Qr=(e,t,r,o)=>{ye[xd](e,t,r,Cd(e,t,r,n=>{o(n&&n.code!=="ENOENT"?n:null)}))},Ea=(e,t,r,o,n)=>{if(typeof t=="string")return ye.lstat(Ke.resolve(e,t),(i,s)=>{if(i)return n(i.code!=="ENOENT"?i:null);s.name=t,Ea(e,s,r,o,n)});if(t.isDirectory())Xo(Ke.resolve(e,t.name),r,o,i=>{if(i)return n(i);let s=Ke.resolve(e,t.name);Qr(s,r,o,n)});else{let i=Ke.resolve(e,t.name);Qr(i,r,o,n)}},Xo=(e,t,r,o)=>{ka(e,{withFileTypes:!0},(n,i)=>{if(n){if(n.code==="ENOENT")return o();if(n.code!=="ENOTDIR"&&n.code!=="ENOTSUP")return o(n)}if(n||!i.length)return Qr(e,t,r,o);let s=i.length,a=null,c=d=>{if(!a){if(d)return o(a=d);if(--s===0)return Qr(e,t,r,o)}};i.forEach(d=>Ea(e,d,t,r,c))})},Od=(e,t,r,o)=>{if(typeof t=="string")try{let n=ye.lstatSync(Ke.resolve(e,t));n.name=t,t=n}catch(n){if(n.code==="ENOENT")return;throw n}t.isDirectory()&&Sa(Ke.resolve(e,t.name),r,o),Ko(Ke.resolve(e,t.name),r,o)},Sa=(e,t,r)=>{let o;try{o=Id(e,{withFileTypes:!0})}catch(n){if(n.code==="ENOENT")return;if(n.code==="ENOTDIR"||n.code==="ENOTSUP")return Ko(e,t,r);throw n}return o&&o.length&&o.forEach(n=>Od(e,n,t,r)),Ko(e,t,r)};xa.exports=Xo;Xo.sync=Sa});var Ia=ce((bv,Ta)=>{l();var Kr=be("path"),Da=be("fs"),Ca=parseInt("0777",8);Ta.exports=yt.mkdirp=yt.mkdirP=yt;function yt(e,t,r,o){typeof t=="function"?(r=t,t={}):(!t||typeof t!="object")&&(t={mode:t});var n=t.mode,i=t.fs||Da;n===void 0&&(n=Ca&~process.umask()),o||(o=null);var s=r||function(){};e=Kr.resolve(e),i.mkdir(e,n,function(a){if(!a)return o=o||e,s(null,o);a.code==="ENOENT"?yt(Kr.dirname(e),t,function(c,d){c?s(c,d):yt(e,t,s,d)}):i.stat(e,function(c,d){c||!d.isDirectory()?s(a,o):s(null,o)})})}yt.sync=function e(t,r,o){(!r||typeof r!="object")&&(r={mode:r});var n=r.mode,i=r.fs||Da;n===void 0&&(n=Ca&~process.umask()),o||(o=null),t=Kr.resolve(t);try{i.mkdirSync(t,n),o=o||t}catch(a){switch(a.code){case"ENOENT":o=e(Kr.dirname(t),r,o),e(t,r,o);break;default:var s;try{s=i.statSync(t)}catch{throw a}if(!s.isDirectory())throw a;break}}return o}});var La=ce(tn=>{l();var _d=Pa(),Ra=hl(),$a=fl(),Rd=Ia(),Aa=be("fs"),Z=be("path"),$d=be("os"),jt=$d.platform()==="win32",Nt=function(){},en=function(e){return e},Zo=jt?function(e){return e.replace(/\\/g,"/").replace(/[:?<>|]/g,"_")}:en,Ad=function(e,t,r,o,n,i){var s=n||["."];return function(c){if(!s.length)return c();var d=s.shift(),u=Z.join(r,d);t.call(e,u,function(f,m){if(f)return c(f);if(!m.isDirectory())return c(null,d,m);e.readdir(u,function(p,h){if(p)return c(p);i&&h.sort();for(var y=0;y<h.length;y++)o(Z.join(r,d,h[y]))||s.push(Z.join(d,h[y]));c(null,d,m)})})}},Fa=function(e,t){return function(r){r.name=r.name.split("/").slice(t).join("/");var o=r.linkname;return o&&(r.type==="link"||Z.isAbsolute(o))&&(r.linkname=o.split("/").slice(t).join("/")),e(r)}};tn.pack=function(e,t){e||(e="."),t||(t={});var r=t.fs||Aa,o=t.ignore||t.filter||Nt,n=t.map||Nt,i=t.mapStream||en,s=Ad(r,t.dereference?r.stat:r.lstat,e,o,t.entries,t.sort),a=t.strict!==!1,c=typeof t.umask=="number"?~t.umask:~ja(),d=typeof t.dmode=="number"?t.dmode:0,u=typeof t.fmode=="number"?t.fmode:0,f=t.pack||Ra.pack(),m=t.finish||Nt;t.strip&&(n=Fa(n,t.strip)),t.readable&&(d|=parseInt(555,8),u|=parseInt(444,8)),t.writable&&(d|=parseInt(333,8),u|=parseInt(222,8));var p=function(b,w){r.readlink(Z.join(e,b),function(g,v){if(g)return f.destroy(g);w.linkname=Zo(v),f.entry(w,y)})},h=function(b,w,g){if(b)return f.destroy(b);if(!w)return t.finalize!==!1&&f.finalize(),m(f);if(g.isSocket())return y();var v={name:Zo(w),mode:(g.mode|(g.isDirectory()?d:u))&c,mtime:g.mtime,size:g.size,type:"file",uid:g.uid,gid:g.gid};if(g.isDirectory())return v.size=0,v.type="directory",v=n(v)||v,f.entry(v,y);if(g.isSymbolicLink())return v.size=0,v.type="symlink",v=n(v)||v,p(w,v);if(v=n(v)||v,!g.isFile())return a?f.destroy(new Error("unsupported type for "+w)):y();var S=f.entry(v,y);if(S){var P=i(r.createReadStream(Z.join(e,w),{start:0,end:v.size>0?v.size-1:v.size}),v);P.on("error",function(C){S.destroy(C)}),$a(P,S)}},y=function(b){if(b)return f.destroy(b);s(h)};return y(),f};var Fd=function(e){return e.length?e[e.length-1]:null},jd=function(){return process.getuid?process.getuid():-1},ja=function(){return process.umask?process.umask():0};tn.extract=function(e,t){e||(e="."),t||(t={});var r=t.fs||Aa,o=t.ignore||t.filter||Nt,n=t.map||Nt,i=t.mapStream||en,s=t.chown!==!1&&!jt&&jd()===0,a=t.extract||Ra.extract(),c=[],d=new Date,u=typeof t.umask=="number"?~t.umask:~ja(),f=typeof t.dmode=="number"?t.dmode:0,m=typeof t.fmode=="number"?t.fmode:0,p=t.strict!==!1;t.strip&&(n=Fa(n,t.strip)),t.readable&&(f|=parseInt(555,8),m|=parseInt(444,8)),t.writable&&(f|=parseInt(333,8),m|=parseInt(222,8));var h=function(w,g){for(var v;(v=Fd(c))&&w.slice(0,v[0].length)!==v[0];)c.pop();if(!v)return g();r.utimes(v[0],d,v[1],g)},y=function(w,g,v){if(t.utimes===!1)return v();if(g.type==="directory")return r.utimes(w,d,g.mtime,v);if(g.type==="symlink")return h(w,v);r.utimes(w,d,g.mtime,function(S){if(S)return v(S);h(w,v)})},b=function(w,g,v){var S=g.type==="symlink",P=S?r.lchmod:r.chmod,C=S?r.lchown:r.chown;if(!P)return v();var D=(g.mode|(g.type==="directory"?f:m))&u;C&&s?C.call(r,w,g.uid,g.gid,R):R(null);function R($){if($)return v($);if(!P)return v();P.call(r,w,D,v)}};return a.on("entry",function(w,g,v){w=n(w)||w,w.name=Zo(w.name);var S=Z.join(e,Z.join("/",w.name));if(o(S,w))return g.resume(),v();var P=function(I){if(I)return v(I);y(S,w,function(_){if(_)return v(_);if(jt)return v();b(S,w,v)})},C=function(){if(jt)return v();r.unlink(S,function(){var I=Z.resolve(Z.dirname(S),w.linkname);if(!_a(I,e))return v(new Error(S+" is not a valid symlink"));r.symlink(w.linkname,S,P)})},D=function(){if(jt)return v();r.unlink(S,function(){var I=Z.join(e,Z.join("/",w.linkname));r.realpath(I,function(_,L){if(_||!_a(L,e))return v(new Error(S+" is not a valid hardlink"));r.link(L,S,function(j){if(j&&j.code==="EPERM"&&t.hardlinkAsFilesFallback)return g=r.createReadStream(I),R();P(j)})})})},R=function(){var I=r.createWriteStream(S),_=i(g,w);I.on("error",function(L){_.destroy(L)}),$a(_,I,function(L){if(L)return v(L);I.on("close",P)})};if(w.type==="directory")return c.push([S,w.mtime]),Oa(S,{fs:r,own:s,uid:w.uid,gid:w.gid},P);var $=Z.dirname(S);Na(r,$,Z.join(e,"."),function(I,_){if(I)return v(I);if(!_)return v(new Error($+" is not a valid path"));Oa($,{fs:r,own:s,uid:w.uid,gid:w.gid},function(L){if(L)return v(L);switch(w.type){case"file":return R();case"link":return D();case"symlink":return C()}if(p)return v(new Error("unsupported type for "+S+" ("+w.type+")"));g.resume(),v()})})}),t.finish&&a.on("finish",t.finish),a};function Na(e,t,r,o){if(t===r)return o(null,!0);e.lstat(t,function(n,i){if(n&&n.code!=="ENOENT")return o(n);if(n||i.isDirectory())return Na(e,Z.join(t,".."),r,o);o(null,!1)})}function Oa(e,t,r){Rd(e,{fs:t.fs},function(o,n){!o&&n&&t.own?_d(n,t.uid,t.gid,r):r(o)})}function _a(e,t){return t=Z.resolve(t),t===e||e.startsWith(t+Z.sep)}});l();l();var xr=Q(ue(),1);l();l();var wr=[{name:"npm",lockfile:"package-lock.json",alternativeLockfiles:["npm-shrinkwrap.json"],installCommand:"npm ci"},{name:"yarn",lockfile:"yarn.lock",installCommand:"yarn install --frozen-lockfile"},{name:"pnpm",lockfile:"pnpm-lock.yaml",installCommand:"pnpm install --frozen-lockfile"},{name:"bun",lockfile:"bun.lockb",alternativeLockfiles:["bun.lock"],installCommand:"bun install --frozen-lockfile"}];function gl(e){let t="No lockfile found",r="If you don\u2019t commit a lockfile, then your app might install the wrong package versions when deploying. To avoid versioning issues, generate a new lockfile and commit it to your repository.",o=[["Generate a lockfile. Run",{command:"npm|yarn|pnpm install"}],"Commit the new file to your repository"];if(e)throw new E(t,r,o);Y({headline:t,body:r,nextSteps:o})}function yl(e,t){let r=e.map(({packageManager:s,foundLockfile:a})=>`${a} (created by ${s.name})`),o="Multiple lockfiles found",n=[`Your project contains more than one lockfile. This can cause version conflicts when installing and deploying your app. The following lockfiles were detected:
2
+ `,{list:{items:r}}],i=["Delete any unneeded lockfiles","Commit the change to your repository"];if(t)throw new E(o,n,i);Y({headline:o,body:n,nextSteps:i})}function wl(e){let t="Lockfile ignored by Git",r="Your project\u2019s lockfile isn\u2019t being tracked by Git. If you don\u2019t commit a lockfile, then your app might install the wrong package versions when deploying.",o=[`In your project\u2019s .gitignore file, delete any references to ${e}`,"Commit the change to your repository"];Y({headline:t,body:r,nextSteps:o})}async function Ci(e,t=!1){if(Ie&&!process.env.SHOPIFY_UNIT_TEST)return;let r=[];for(let i of wr){let s=[i.lockfile,...i.alternativeLockfiles||[]];for(let a of s)if(await G(T(e,a))){r.push({packageManager:i,foundLockfile:a});break}}if(r.length===0)return gl(t);if(r.length>1)return yl(r,t);let o=r[0].foundLockfile;(await Rn(e,[o]).catch(()=>[])).length>0&&wl(o)}l();var vl=["^cdn/","^_t/"];function vr(e){let t=new Set;return Object.values(e.routes).filter(r=>vl.some(o=>new RegExp(o).test(r.path??""))).forEach(r=>{r.path&&t.add(r.path)}),[...t]}var bl=["","cart","products/:productHandle","collections","collections/:collectionHandle","sitemap.xml","robots.txt","pages/:pageHandle","policies/:policyHandle","search","account","account/login","account/orders/:orderId","account/authorize"];function br(e,t=bl){let r=Object.values(e.routes),o=new Set(t);for(let n of t)for(let i of r)if(!n&&!i.path)o.delete(n);else if(n&&i.path){let s={path:i.path,parentId:i.parentId};for(;s.parentId&&s.parentId!=="root";){let d=r.find(u=>u.id===s.parentId);if(!d)break;s.path=d.path==null?s.path:`${d.path}/${s.path}`,s.parentId=d.parentId}let a=":?[^\\/\\?]+\\?",c=`^(${a}\\/)?`+n.replaceAll(".","\\.").replace(/\//g,`\\/(${a}\\/)?`).replace(/:[^/)?]+/g,"(:[^\\/]+|\\*)")+`(\\/${a})?$`;new RegExp(c).test(s.path)&&o.delete(n)}return[...o]}var Le=100;function Ti(e){e.length?Y({headline:"Standard Shopify routes missing",body:`Your Hydrogen project is missing ${e.length} standard Shopify route${e.length>1?"s":""}.
3
+ Including these routes improves compatibility with Shopify\u2019s platform:
4
+
5
+ `+e.slice(0,Le-(e.length<=Le?0:1)).map(t=>`\u2022 /${t}`).join(`
6
+ `)+(e.length>Le?`
7
+ \u2022 ...and ${e.length-Le+1} more`:"")}):N({headline:"All standard Shopify routes present"})}function kr(e){e.length&&Y({headline:"Reserved routes present",body:`Your Hydrogen project is using ${e.length} reserved route${e.length>1?"s":""}.
8
+ These routes are reserved by Shopify and may cause issues with your storefront:
9
+
10
+ `+e.slice(0,Le-(e.length<=Le?0:1)).map(t=>`\u2022 /${t}`).join(`
11
+ `)+(e.length>Le?`
12
+ \u2022 ...and ${e.length-Le+1} more`:"")})}l();l();var _o="metafile.server.json",Er="server-bundle-analyzer.html";async function Ii(){return de(await Ge("bundle","analyzer.html"))}function Oi(e,t){return e.replace("globalThis.METAFILE = '';",`globalThis.METAFILE = '${Buffer.from(t,"utf-8").toString("base64")}';`)}async function _i(e){try{return` \u2502
13
+ `+(await(await import("esbuild")).analyzeMetafile(await de(x(e,_o)),{color:!0})).split(`
14
+ `).filter(o=>!o.match(/(.*)(node_modules\/|server-assets-manifest:|server-entry-module:)(react-dom|@remix-run|@shopify\/hydrogen|react-router|react-router-dom)\/(.*)/g)).slice(2,12).join(`
15
+ `).replace(/dist\/worker\/_assets\/.*$/ms,`
16
+ `).replace(/\n/g,`
17
+ `).replace(/(\.\.\/)+node_modules\//g,o=>H.dim(o))}catch(t){console.warn("Could not generate bundle analysis summary:",t.message)}}function $i(e){let t;return{name:"hydrogen:bundle-analyzer",configResolved(r){t=r},async generateBundle(r,o){if(!t.build.ssr)return;let{root:n}=t,i=Object.values(o).find(h=>h.type==="chunk");if(!i||i.type!=="chunk"||!i.facadeModuleId||!r.dir)return;let s=await Ii().catch(()=>null);if(!s){console.warn("Bundle analyzer template not found");return}let a=new Set(Object.keys(i.modules)),c=[];for(let h of a){if(Ro(h)||$o(h))continue;let y=this.getModuleInfo(h);if(y?.id){c.push(y);for(let b of[...y.importedIds,...y.dynamicallyImportedIds])!Ro(b)&&!$o(b)&&a.add(b)}}let d=new Map,u=new Map,f=await Promise.all(c.map(async h=>{let y=se(n,h.id),b=i.modules[h.id],w=typeof b?.originalLength=="number"?b.originalLength:h.code?.length??0,g=b?.renderedLength??0;if(e?.minify&&b?.code){let R=await e.minify(b.code,h.id).catch(()=>null);R&&(g=R.length)}u.set(y,g);let v=R=>this.resolve(R,h.id),S=!h.code||/(^\s*export\s+[\w\{]|^\s*import\s+[\w\{'"]|\bimport\()|\bcreateRequire\(/ms.test(h.code)||!/((^|\b)exports\b|\brequire\()/.test(h.code),P=Ri(h.importedIds,"import-statement",n,v,h.code),C=Ri(h.dynamicallyImportedIds,"dynamic-import",n,v,h.code),D=(await Promise.all([...P,...C])).reduce((R,{importedId:$,...I})=>(Ro($)?S=!1:$o($)||R.push(I),R),[]);d.set(y,{bytes:w,format:S?"esm":"cjs",imports:D})})).then(()=>null).catch(h=>h);if(f){console.warn("Bundle analyzer failed to analyze the bundle:",f);return}let m=Object.fromEntries(d.entries()),p={inputs:m,outputs:{[se(n,x(r.dir,i.fileName))]:{imports:i.imports,exports:i.exports,entryPoint:se(n,i.facadeModuleId),bytes:i.code.length??0,inputs:Object.entries(m).reduce((h,[y,b])=>(h[y]={bytesInOutput:u.get(y)??b.bytes??0},h),{})}}};this.emitFile({type:"asset",fileName:_o,source:JSON.stringify(p,null,2)}),this.emitFile({type:"asset",fileName:Er,source:Oi(s,JSON.stringify(p))})}}}function Ro(e){return/(commonjsHelpers\.js$|\?commonjs\-)/.test(e)}function $o(e){return e.endsWith("?transform-only")}async function kl(e,t,r){let o=t.matchAll(/import\s[^'"]*?['"]([^'"]+)['"]/g)??[];for(let[,n]of o)if(n&&(await r(n))?.id===e)return n;return e}function Ri(e,t,r,o,n){return e.map(async i=>({importedId:i,path:se(r,i),kind:t,original:n?await kl(i,n,o):i}))}l();import{spawn as El}from"node:child_process";import{fileURLToPath as Fi}from"node:url";var Sl=process.argv[1],xl=Fi(import.meta.url),Pl=Sl===xl;Pl&&Dt({rootDirectory:process.argv[2],appDirectory:process.argv[3],configFilePath:process.argv[4],watch:!0});function ji(e,t){if(e.includes("AbortError: ")){let s=e.split("AbortError: ")[1]??"",a=s.split(`
18
+ `)[0],c=s.match(/tryMessage: '(.*)',$/m)?.[1];if(a)return{message:a,details:c}}let[r="",...o]=e.replaceAll("[FAILED]","").replace(/\s{2,}/g,`
19
+ `).replace(/\n,\n/,`
20
+ `).trim().split(`
21
+ `),n="[Codegen] "+r,i=o.join(`
22
+ `);if(t){let s=t.replaceAll("\\","/")+"/";i=i.replaceAll(s,"")}return{message:n,details:i}}function Sr({rootDirectory:e,appDirectory:t,configFilePath:r}){let o,n,i=process.argv.findIndex(a=>a==="hydrogen");i>=1?(o=process.argv[0],n=[...process.argv.slice(1,i+1),"codegen","--watch","--path",e],r&&n.push("--codegen-config-path",r)):(o="node",n=[Fi(import.meta.url),e,t??T("app"),r??""]);let s=El(o,n,{stdio:["inherit","ignore","pipe"]});return s.stderr.on("data",a=>{let c=typeof a=="string"?a:a?.toString?.("utf8")??"";if(!c)return;let{message:d,details:u}=ji(c,e);/`punycode`/.test(d)||/\.body\[\d\]/.test(d)||/console\.time(End)?\(\)/.test(d)||/─ (warning|info|success) ───/.test(d)||(B({body:""}),Y({headline:d,body:u}))}),s.on("close",a=>{a&&a>0&&Y({headline:"Codegen process exited with code "+a,body:"There should be more logs above."})}),s}async function Dt(e){return await Dl(e),Cl(e).catch(t=>{if(t instanceof E)throw t;let{message:r,details:o}=ji(t.message,e.rootDirectory);throw new E(r,o)})}async function Dl(e){let{execSync:t,exec:r}=await import("child_process");try{t("npx react-router --version",{cwd:e.rootDirectory,stdio:"ignore"})}catch{B({body:"React Router not found, skipping typegen"});return}e.watch?r("npx react-router typegen --watch",{cwd:e.rootDirectory}):t("npx react-router typegen",{cwd:e.rootDirectory,stdio:"inherit"})}async function Cl({watch:e,configFilePath:t,forceSfapiVersion:r,...o}){let{generate:n,loadCodegenConfig:i,CodegenContext:s}=await qe("@graphql-codegen/cli",o.rootDirectory).catch(()=>{throw new E("Could not load GraphQL Codegen CLI.","Please make sure you have `@graphql-codegen/cli` installed as a dev dependency.")}),{config:a}=await i({configFilePath:t??o.rootDirectory})||await Tl(o,r);await Il(a,o);let c=new s({config:{...a,watch:e,silent:!e,cwd:o.rootDirectory},filepath:"not-used-but-must-be-set"});return c.cwd=o.rootDirectory,await n(c,!0),Object.entries(a.generates).reduce((d,[u,f])=>("documents"in f&&(d[u]=(Array.isArray(f.documents)?f.documents:[f.documents]).filter(m=>typeof m=="string")),d),{})}async function Tl({rootDirectory:e,appDirectory:t=T(e,"app")},r){let{getSchema:o,preset:n,pluckConfig:i}=await qe("@shopify/hydrogen-codegen",e).catch(()=>{throw new E("Could not load Hydrogen Codegen.","Please make sure you have `@shopify/hydrogen-codegen` installed as a dev dependency.")}),{loadConfig:s}=await qe("graphql-config",e).catch(()=>{throw new E("Could not load GraphQL Config.","Please make sure you have `graphql-config` installed as a dev dependency.")}),a=await s({rootDir:e,throwOnEmpty:!1,throwOnMissing:!1,legacy:!1}).catch(()=>{}),c=o("storefront"),d=Ai(c,a),u=o("customer-account",{throwIfMissing:!1}),f=u?Ai(u,a):void 0,m="*!(*.d).{ts,tsx,js,jsx}",p=se(e,t),h=b=>{let w=Ze(c),g=u&&Ze(u);return!!(b.endsWith(w)||g&&b.endsWith(g))},y=Object.values(a?.projects??{}).filter(b=>b.hasExtension("codegen")&&(typeof b.schema!="string"||!h(b.schema)));return{filepath:"virtual:codegen",config:{overwrite:!0,pluckConfig:i,generates:{...Ao(d)??{"storefrontapi.generated.d.ts":{preset:n,schema:c,documents:d?.documents??[m,x(p,"**",m)],...!!r&&{presetConfig:{importTypes:!1},schema:{[`https://hydrogen-preview.myshopify.com/api/${r.split(":")[0]}/graphql.json`]:{headers:{"content-type":"application/json","X-Shopify-Storefront-Access-Token":r.split(":")[1]??"3b580e70970c4528da70c98e097c2fa0"}}},config:{defaultScalarType:"string",scalars:{JSON:"unknown"}}}}},...Ao(f)??(f?.documents?{"customer-accountapi.generated.d.ts":{preset:n,schema:u,documents:f.documents}}:{}),...y.reduce((b,w)=>({...b,...Ao(w)}),{})}}}}function Ao(e){if(e?.extensions?.codegen?.generates)return Object.entries(e.extensions.codegen.generates).reduce((t,[r,o])=>(t[r]={...e,...Array.isArray(o)?o[0]:o},t),{})}function Ai(e,t){if(!t)return;let r=Ze(e);return Object.values(t.projects||{}).find(o=>typeof o.schema=="string"&&o.schema.endsWith(r))}async function Il(e,{rootDirectory:t}){let r=Symbol.for("name"),o=Object.values(e.generates).filter(n=>{let i=(Array.isArray(n)?n[0]:n)?.preset;if(typeof i=="object"&&r in i)return i[r]==="hydrogen"||i[r]==="@shopify/graphql-codegen"});for(let n of o){let i=Array.isArray(n)?n[0]:n;if(i){let s=await et(t);i.hooks={beforeOneFileWrite:(a,c)=>St(c,s,a),...i.hooks}}}}l();function Ct(){let{env:e}=process;return e.CI==="false"?!1:!!(e.CI||e.CI_NAME||e.BUILD_NUMBER||e.TF_BUILD)}l();function Tt(){let e={state:"pending"};return e.promise=new Promise((t,r)=>{e.resolve=o=>(e.state==="pending"&&(e.state="resolved"),t(o)),e.reject=o=>(e.state==="pending"&&(e.state="rejected"),r(o))}),e}l();function He(e){let t,r=process.exit;process.exit=async o=>{t??=e();let n=setTimeout(()=>r(o),5e3);return await t,clearTimeout(n),r(o)}}var Pr=class e extends O{static descriptionWithMarkdown="Builds a Hydrogen storefront for production. The client and app worker files are compiled to a `/dist` folder in your Hydrogen project directory.";static description="Builds a Hydrogen storefront for production.";static flags={...k.path,...k.entry,...k.sourcemap,...k.lockfileCheck,...k.disableRouteWarning,...k.codegen,watch:xr.Flags.boolean({description:"Watches for changes and rebuilds the project writing output to disk.",env:"SHOPIFY_HYDROGEN_FLAG_WATCH"}),"bundle-stats":xr.Flags.boolean({description:"Show a bundle size summary after building. Defaults to true, use `--no-bundle-stats` to disable.",allowNo:!0}),"force-client-sourcemap":xr.Flags.boolean({description:"Client sourcemapping is avoided by default because it makes backend code visible in the browser. Use this flag to force enabling it.",env:"SHOPIFY_HYDROGEN_FLAG_FORCE_CLIENT_SOURCEMAP"})};async run(){let{flags:t}=await this.parse(e),r=t.path?T(t.path):process.cwd(),o={...U(t),useCodegen:t.codegen,directory:r};if(!await er(r))throw new E(Pe);let i=await Je(o);o.watch?i?.close&&He(async()=>{await i?.close()}):process.exit(0)}},Ol=5;async function Je({entry:e,directory:t,useCodegen:r=!1,codegenConfigPath:o,sourcemap:n=!0,forceClientSourcemap:i,disableRouteWarning:s=!1,lockfileCheck:a=!0,assetPath:c,bundleStats:d=!Ct(),watch:u=!1,onServerBuildStart:f,onServerBuildFinish:m}){process.env.NODE_ENV||(process.env.NODE_ENV="production"),c=c??process.env.HYDROGEN_ASSET_BASE_URL??"/";let p=t??process.cwd();a&&await Ci(p,Ct());let[h,{userViteConfig:y,remixConfig:b,clientOutDir:w,serverOutDir:g,serverOutFile:v}]=await Promise.all([Zt(p),he(p,e)]),S=h.createLogger(u?"warn":void 0);process.env.SHOPIFY_UNIT_TEST&&(S.info=j=>Ae("info",j),S.warn=j=>Ae("warn",j),S.error=j=>Ae("error",j));let P=y.build?.minify??!0,C={root:p,mode:process.env.NODE_ENV,base:c,customLogger:S},D,R=await h.build({...C,build:{emptyOutDir:!0,copyPublicDir:!0,sourcemap:i??(process.env.NODE_ENV!=="production"&&n),watch:u?{}:null},server:{watch:u?{}:null},plugins:[{name:"hydrogen:cli:client",buildStart(){D?.resolve(),D=Tt()},buildEnd(j){j&&D.reject(j)},writeBundle(){D.resolve()},closeWatcher(){this.error(new Error("Process exited before client build finished."))}}]});console.log("");let $,I=await h.build({...C,build:{sourcemap:n,ssr:e??!0,emptyOutDir:!1,copyPublicDir:!1,minify:P,watch:u?{buildDelay:100}:null},server:{watch:u?{}:null},plugins:[{name:"hydrogen:cli:server",async buildStart(){await D.promise,$?.resolve(),$=Tt(),await f?.()},async writeBundle(){$?.state!=="rejected"&&await m?.(),$.resolve()},closeWatcher(){this.error(new Error("Process exited before server build finished."))}},...d?[$i({minify:P?(j,ne)=>h.transformWithEsbuild(j,ne,{minify:!0,minifyWhitespace:!0,minifySyntax:!0,minifyIdentifiers:!0,sourcemap:!1,treeShaking:!1,legalComments:"none",target:"esnext"}).then(le=>le.code):void 0})]:[]]});u||await Promise.all([ke(x(w,".vite")),ke(x(g,".vite")),ke(x(g,"assets"))]);let _={rootDirectory:p,appDirectory:b.appDirectory,configFilePath:o},L=r?u?Sr(_):await Dt(_).then(()=>{}):void 0;if(!u&&process.env.NODE_ENV!=="development"){if(d){let ne="file://"+x(g,Er);F(W`${await _i(g)||`
23
+ `}\n │\n └─── ${we.link("Complete analysis: "+ne,ne)}\n\n`)}await gn(v)/(1024*1024)>=Ol&&V(`\u{1F6A8} Smaller worker bundles are faster to deploy and run.${P?"":"\n Minify your bundle by adding `build.minify: true` to vite.config.js."}
24
+ Learn more about optimizing your worker bundle file: https://h2o.fyi/debugging/bundle-size
25
+ `)}if(!u&&!s){let j=br(b);if(j.length){let ne=await Ee(p),le=ne==="npm"?"npx":ne;V(`Heads up: Shopify stores have a number of standard routes that aren\u2019t set up yet.
26
+ Some functionality and backlinks might not work as expected until these are created or redirects are set up.
27
+ This build is missing ${j.length} route${j.length>1?"s":""}. For more details, run \`${le} shopify hydrogen check routes\`.
28
+ `)}}return!u&&!s&&kr(vr(b)),{async close(){L?.removeAllListeners("close"),L?.kill("SIGINT");let j=[];"close"in R&&j.push(R.close()),"close"in I&&j.push(I.close()),await Promise.allSettled(j),(D?.state==="pending"||$?.state==="pending")&&(D?.promise.catch(()=>{}),D?.reject(),$?.promise.catch(()=>{}),$?.reject(),await new Promise(ne=>setTimeout(ne,500)))}}}l();var Ni=Q(ue(),1),Dr=class e extends O{static descriptionWithMarkdown="Checks whether your Hydrogen app includes a set of standard Shopify routes.";static description="Returns diagnostic information about a Hydrogen storefront.";static flags={...k.path};static args={resource:Ni.Args.string({name:"resource",description:"The resource to check. Currently only 'routes' is supported.",required:!0,options:["routes"]})};async run(){let{flags:t,args:r}=await this.parse(e),o=t.path?T(t.path):process.cwd();if(r.resource==="routes")await _l({directory:o});else throw new Error("Invalid command argument.")}};async function _l({directory:e}){let t=await Ne(e);Ti(br(t)),kr(vr(t))}l();var Cr=Q(ue(),1);var Tr=class e extends O{static descriptionWithMarkdown="Automatically generates GraphQL types for your project\u2019s Storefront API queries.";static description="Generate types for the Storefront API queries found in your project.";static flags={...k.path,"codegen-config-path":Cr.Flags.string({description:"Specify a path to a codegen configuration file. Defaults to `<root>/codegen.ts` if it exists.",required:!1}),"force-sfapi-version":Cr.Flags.string({description:"Force generating Storefront API types for a specific version instead of using the one provided in Hydrogen. A token can also be provided with this format: `<version>:<token>`.",hidden:!0}),watch:Cr.Flags.boolean({description:"Watch the project for changes to update types on file save.",required:!1,default:!1})};async run(){let{flags:t}=await this.parse(e),r=t.path?T(t.path):process.cwd();await Rl({...U(t),directory:r})}};async function Rl({directory:e,codegenConfigPath:t,forceSfapiVersion:r,watch:o}){let{root:n}=xe(e),i=await Ne(n);console.log("");let s=await Dt({...i,configFilePath:t,forceSfapiVersion:r,watch:o});o||N({headline:"Generated types for GraphQL:",body:{list:{items:Object.entries(s).map(([a,c])=>a+`
29
+ `+c.map(d=>H.dim(`- ${d}`)).join(`
30
+ `))}}})}l();var Mi=Q(ue(),1);l();import{Session as $l}from"node:inspector";async function Li(e){let{createMiniOxygen:t}=await qe("@shopify/mini-oxygen/node",e).catch(To),r=t({script:"export default {}",modules:!0,log:()=>{}});return{async run(o,n){let[i]=await Promise.all([de(o),r.ready()]),s=await Al();await r.reload({script:i});let a=await s();return Fl(a,o+".map",n)},async close(){await r.dispose()}}}function Al(){let e=new $l;return e.connect(),new Promise(t=>{e.post("Profiler.enable",()=>{e.post("Profiler.start",()=>{t(()=>new Promise((r,o)=>{e.post("Profiler.stop",(n,{profile:i})=>{if(e.disconnect(),n)return o(n);r(i)})}))})})})}async function Fl(e,t,r){let{SourceMapConsumer:o}=await import("./source-map-E7FCCJL7.js"),n=JSON.parse(await de(t)),i=await new o(n,"file://"+t),s=new Set,a=0,c=e.endTime-e.startTime,d=e.samples?.length?c/e.samples.length:0;for(let u of e.nodes)(u.callFrame.url==="<script>"||s.has(u.id))&&(s.add(u.id),u.children?.forEach(f=>s.add(f))),s.has(u.id)?(jl(u,i),u.callFrame.url==="<script>"&&!u.callFrame.functionName&&!u.callFrame.lineNumber&&!u.callFrame.columnNumber&&(u.callFrame.url=r??"",u.callFrame.functionName="(top-level app code)"),a+=Math.round((u.hitCount??0)*d*1e3)/1e3):Nl(u);return i.destroy(),{profile:e,totalTimeMs:c/1e3,totalScriptTimeMs:a/1e3}}function jl(e,t){let r=t.originalPositionFor({line:e.callFrame.lineNumber+1,column:e.callFrame.columnNumber+1});e.callFrame.url=r.source||e.callFrame.url,e.callFrame.functionName=r.name||e.callFrame.functionName,e.callFrame.lineNumber=r.line?r.line-1:e.callFrame.lineNumber,e.callFrame.columnNumber=r.column??e.callFrame.columnNumber}function Nl(e){Object.assign(e,{children:[],callFrame:{functionName:"(profiler)",scriptId:"0",url:"",lineNumber:-1,columnNumber:-1}})}var Hi="startup.cpuprofile",Ir=class e extends O{static descriptionWithMarkdown="Builds the app and runs the resulting code to profile the server startup time, watching for changes. This command can be used to [debug slow app startup times](https://shopify.dev/docs/custom-storefronts/hydrogen/debugging/cpu-startup) that cause failed deployments in Oxygen.\n\n The profiling results are written to a `.cpuprofile` file that can be viewed with certain tools such as [Flame Chart Visualizer for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-js-profile-flame).";static description="Builds and profiles the server startup time the app.";static flags={...k.path,...k.entry,output:Mi.Flags.string({description:`Specify a path to generate the profile file. Defaults to "${Hi}".`,default:Hi,required:!1})};async run(){let{flags:t}=await this.parse(e),r=t.path?T(t.path):process.cwd(),{close:o}=await Ll({...U(t),directory:r,output:T(r,t.output)});He(async()=>{await o()})}};async function Ll({directory:e,entry:t,output:r}){process.env.NODE_ENV||(process.env.NODE_ENV="production"),it({workerReload:!1});let{buildPath:o,buildPathWorkerFile:n}=xe(e);F(`\u23F3\uFE0F Starting profiler for CPU startup... Profile will be written to:
31
+ `+H.dim(r));let i=0,s,a=await Li(e),c={onServerBuildStart(){i>0&&process.stdout.write(Gt.eraseLines(4)),F(`
32
+ #${++i} Building and profiling...`)},async onServerBuildFinish(){let{profile:m,totalScriptTimeMs:p}=await a.run(n,s);process.stdout.write(Gt.eraseLines(2)),F(`#${i} Total time: ${p.toLocaleString()} ms
33
+ ${H.dim(r)}`),await K(r,JSON.stringify(m,null,2)),F(`
34
+ Waiting for changes...`)}};if(await rt(e))throw new E(Pe);let u=await he(e).catch(()=>null);n=u?.serverOutFile??x(o,"server","index.js"),s=u?.remixConfig.serverEntryPoint??"";let f=await Je({entry:t,directory:e,watch:!0,sourcemap:!0,disableRouteWarning:!0,lockfileCheck:!1,bundleStats:!1,...c,onServerBuildStart(){return i===0&&process.stdout.write(Gt.eraseLines(1)),c.onServerBuildStart()}});return{async close(){await Promise.allSettled([f.close(),a.close()])}}}l();var re=Q(ue(),1);l();l();import Ui from"fs";import Bi,{dirname as Hl}from"path";import{fileURLToPath as Ml}from"url";var Or={assetsDirDefault:"dist/client/",buildCommandDefault:"npm build",verificationDurationDefault:180,maxUploadAttempts:3,maxResumabeUploadAttempts:9,workerDirDefault:"dist/worker/"};function De(e){if(Ul(e)){if(e.statusCode===401)throw new E("You are not authorized to perform this action. Please check your deployment token.");if(e.statusCode===429)throw new E("You've made too many requests. Please try again later")}if(e instanceof E&&e.message.includes("503"))throw new E("The server is currently unavailable. Please try again later.")}var fe=(e=>(e.OxygenNamespaceHandle="X-Oxygen-Namespace-Handle",e))(fe||{});function Ul(e){return typeof e=="object"&&e!==null&&"statusCode"in e}function It(e){let t;if(e)t=Bi.join(e,"package.json");else{let o=Ml(import.meta.url),n=Hl(o);t=Bi.join(n,"../../package.json")}if(!Ui.existsSync(t))return{};let r=Ui.readFileSync(t,"utf8");return JSON.parse(r)}function Fo(e){process.stderr.write(`${e}
35
+ `)}var ct=375;function jo(e){try{let t=Buffer.from(e,"base64").toString("utf-8"),r=JSON.parse(t);return qi(r)}catch{throw new Error("Error processing deployment token. Please check your token and try again.")}}function Vi(e){if(!e)return;let t=Number(e);if(isNaN(t))throw new E("Invalid duration format. Please specify the duration in hours (e.g., '10').");if(t>12||t<1)throw new E("Invalid duration length. Please specify the duration (in hours) between 1 to 12 hours.");return t}async function Gi({config:e,performedBuild:t=!1}){let{rootPath:r,workerDir:o,assetsDir:n,skipBuild:i,workerOnly:s}=e,a={root:r};(i||t)&&(a.worker=x(r,o),s||(a.assets=x(r,n)));for(let d of Object.keys(a))await Bl(a[d],d);if(!/^https:\/\/(?:[\w-]+\.)*[\w-]+|^https:\/\/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/.test(e.deploymentUrl))throw new Error(`Invalid deployment service URL: ${e.deploymentUrl}`)}async function Bl(e,t){if(!await G(e))throw t==="assets"&&V('Use the "workerOnly" flag to perform a worker-only deployment.',Fo),new Error(`Path not found: ${e}`)}function qi(e){return typeof e=="object"?Object.keys(e).reduce((t,r)=>{let o=r.replace(/([-_][a-z])/gi,n=>n.toUpperCase().replace("-","").replace("_",""));if(e[r]===void 0)throw new Error(`Invalid token: ${r} is undefined`);return t[o]=qi(e[r]),t},{}):e}l();var _r=Q(ml(),1);var Yi;function Vl(e){if(e)return;if(_r.default._client)return _r.default;let r={apiKey:"21fd37fe87ead4b9c5a8eed90752b455",autoDetectErrors:!0,appVersion:It().version,endpoints:{notify:"https://error-analytics-production.shopifysvc.com",sessions:"https://error-analytics-sessions-production.shopifysvc.com"},logger:null};return _r.default.start(r)}function Wi(e){Yi=Vl(e)}function dt(){return Yi}function zi(e,t){if(!t)return e;let r=o=>o.replace(new RegExp(t,"g"),"***");if(e instanceof Error){let o=Object.create(Object.getPrototypeOf(e));return Object.assign(o,e,{message:r(e.message),stack:e.stack?r(e.stack):void 0}),o}return r(e)}l();var ie=(e=>(e.BuildTime="build_time",e.NumFilesRequested="num_files_requested",e.NumFilesUploaded="num_files_uploaded",e.TotalSizeUploaded="total_size_uploaded",e.TotalSizeRequested="total_size_requested",e.TotalTime="total_time",e.UploadTime="upload_time",e.DeploymentCompletedTime="deployment_completed_time",e.DeploymentRoutableTime="deployment_routable_time",e))(ie||{}),Rr=class{metrics={};metricPrefix="oxygen.cli";defaultTags;exportUrl;constructor(t){let{version:r}=It(),{version:o}=It(`${t.rootPath}/node_modules/@shopify/hydrogen`);this.defaultTags={ci_provider:t.ciProvider,cli_version:`oxygen-cli@${r||"unknown"}`,hydrogen_version:o||"unknown"},this.exportUrl="https://metrics.myshopify.dev"}add(t,r,o={}){let n={value:r,tags:o};this.metrics[t]?this.metrics[t].push(n):this.metrics[t]=[n]}formatTags(t){return Object.entries(t).map(([r,o])=>`${r}:${o}`)}async export(){let t=Object.entries(this.metrics).map(([r,o])=>{let n=`${this.metricPrefix}.${r}`;return o.map(({value:i,tags:s})=>({name:n,type:"gauge",value:i,tags:this.formatTags({...s,...this.defaultTags})}))}).flat();try{await ae(this.exportUrl,{method:"POST",body:JSON.stringify({events:t})})}catch(r){let o=dt();o&&(r instanceof Error||typeof r=="string")&&o.notify(r)}}};l();l();var Ji=`
36
+ mutation BuildInitiate($environment: EnvironmentSelectorInput, $labels: [String!]) {
37
+ buildInitiate(environment: $environment, labels: $labels) {
38
+ build {
39
+ id
40
+ assetPath
41
+ }
42
+ userErrors {
43
+ message
44
+ }
45
+ }
46
+ }
47
+ `;async function Qi(e){let{config:t,logger:r,environment:o,labels:n=[]}=e,i={environment:o,labels:n};try{let s=await pe({query:Ji,api:"Oxygen",url:`${t.deploymentUrl}/api/v2/admin/graphql`,token:t.deploymentToken.accessToken,variables:i,addedHeaders:{[fe.OxygenNamespaceHandle]:t.deploymentToken.namespace}});if(s.buildInitiate.userErrors.length>=1)throw new E(`Failed to create build. ${s.buildInitiate.userErrors[0]?.message}`);return Fe(`Build initiated successfully with id ${s.buildInitiate.build.id}.`,r),s.buildInitiate}catch(s){throw De(s),s}}l();l();var Ki=`
48
+ mutation BuildCancel($buildId: ID!, $reason: String!) {
49
+ buildCancel(id: $buildId, reason: $reason) {
50
+ build {
51
+ id
52
+ }
53
+ userErrors {
54
+ message
55
+ }
56
+ }
57
+ }
58
+ `;async function Xi(e){let{config:t,buildId:r,reason:o,logger:n}=e,i={buildId:r,reason:o};try{let s=await pe({query:Ki,api:"Oxygen",url:`${t.deploymentUrl}/api/v2/admin/graphql`,token:t.deploymentToken.accessToken,addedHeaders:{[fe.OxygenNamespaceHandle]:t.deploymentToken.namespace},variables:i});if(s.buildCancel.userErrors.length>=1)throw new E(`Failed to cancel build: ${s.buildCancel.userErrors[0]?.message}`);return F(`Build with id ${r} cancelled.`,n),s.buildCancel}catch(s){throw De(s),s}}l();l();var $r=(e=>(e.Worker="WORKER",e.Asset="ASSET",e))($r||{}),ut=class extends Error{},Qe=class extends Error{};async function es(e,t){let r=x(e.rootPath,e.workerDir),o=await kt(`${r}/**`),n=Zi({files:o,basePath:r,type:$r.Worker,filter:ql});if(!e.workerOnly){let s=x(e.rootPath,e.assetsDir),a=await kt(`${s}/**`);n=[...n,...Zi({files:a,basePath:s,type:$r.Asset,filter:Yl})]}t?.add(ie.NumFilesRequested,n.length);let i=n.reduce((s,a)=>s+a.fileSize,0)/1024;return t?.add(ie.TotalSizeRequested,i),n}function Gl(e){let t=hn(e);return wn(t)}function Zi(e){let{files:t,basePath:r,type:o,filter:n}=e,i=[];return t.forEach(s=>{let a=se(r,s);n&&!n(a)||i.push({filePath:a,fileSize:yn(s),mimeType:_n(s),fileType:o,fileHash:Gl(s)})}),i}function ql(e){let t=["oxygen.json"],r=[".js.map",".mjs.map",".map",".js",".mjs"],n=`^(${["index"].join("|")})(${r.join("|")})$`;return new RegExp(n).test(e.toLowerCase())||t.includes(e)}function Yl(e){let r=`(${[".map"].join("|")})$`;return!new RegExp(r).test(e.toLowerCase())}l();l();var ts=`
59
+ mutation DeploymentInitiate($buildId: ID, $environment: EnvironmentSelectorInput, $labels: [String!], $files: [FileInput!]!) {
60
+ deploymentInitiate(buildId: $buildId, environment: $environment, labels: $labels, files: $files) {
61
+ deployment {
62
+ id
63
+ }
64
+ deploymentTargets {
65
+ filePath
66
+ fileSize
67
+ uploadUrl
68
+ fileType
69
+ parameters {
70
+ name
71
+ value
72
+ }
73
+ }
74
+ deploymentConfiguration {
75
+ timeoutInSeconds
76
+ }
77
+ userErrors {
78
+ message
79
+ }
80
+ }
81
+ }
82
+ `;async function rs(e){let{config:t,input:r,logger:o}=e,n={buildId:r.buildId,environment:r.environment,files:r.manifest,labels:r.labels};try{let i=await pe({query:ts,api:"Oxygen",url:`${t.deploymentUrl}/api/v2/admin/graphql`,token:t.deploymentToken.accessToken,variables:n,addedHeaders:{[fe.OxygenNamespaceHandle]:t.deploymentToken.namespace}});if(i.deploymentInitiate.userErrors.length>=1)throw new E(`Failed to create deployment. ${i.deploymentInitiate.userErrors[0]?.message}`);return Fe(`Deployment initiated, ${i.deploymentInitiate.deploymentTargets.length} files to upload.`,o),i.deploymentInitiate}catch(i){throw De(i),i}}l();l();var os=`
83
+ mutation DeploymentComplete($deploymentId: ID!, $generateAuthBypassToken: Boolean, $authBypassTokenDuration: Int, $environmentVariables: [EnvironmentVariableInput!]) {
84
+ deploymentComplete(id: $deploymentId, generateAuthBypassToken: $generateAuthBypassToken, authBypassTokenDuration: $authBypassTokenDuration, environmentVariables: $environmentVariables) {
85
+ deployment {
86
+ id
87
+ url
88
+ }
89
+ authBypassToken
90
+ userErrors {
91
+ message
92
+ }
93
+ }
94
+ }
95
+ `;async function ns(e,t){let r={deploymentId:t,generateAuthBypassToken:e.generateAuthBypassToken};if(e.generateAuthBypassToken)r.authBypassTokenDuration=Vi(e.authBypassTokenDuration);else if(e.authBypassTokenDuration)throw new E("authBypassTokenDuration is set but generateAuthBypassToken is not enabled");e.overriddenEnvironmentVariables&&(r.environmentVariables=e.overriddenEnvironmentVariables);try{let o=await pe({query:os,api:"Oxygen",url:`${e.deploymentUrl}/api/v2/admin/graphql`,token:e.deploymentToken.accessToken,variables:r,addedHeaders:{[fe.OxygenNamespaceHandle]:e.deploymentToken.namespace}});if(o.deploymentComplete.userErrors.length>=1)throw new E(`Failed to complete deployment: ${o.deploymentComplete.userErrors[0]?.message}`);return o.deploymentComplete}catch(o){throw De(o),o}}l();async function is(e){let{config:t,url:r,logger:o,hooks:n}=e;n?.onVerificationStart?.(),F("Verifying worker deployment is routable...",o);let i=0,s=0,a=!1,c=Date.now(),d=async()=>{if(i<10?s=500:i%5===0&&(s+=5e3),(Date.now()-c)/1e3+s/1e3>t.verificationMaxDuration){let m=new ut("Unable to verify that the worker is accessible.");throw a||(a=!0,n?.onVerificationError?.(m)),m}i++,await new Promise(m=>setTimeout(m,s)),await u()},u=async()=>{try{if((await ae(`${r}/.oxygen/deployment`,{method:"HEAD"})).status===200)return F("Deployment verification check passed",o),n?.onVerificationComplete?.(),Promise.resolve();await d()}catch{await d()}};await u()}l();l();var ss=`
96
+ mutation DeploymentCancel($deploymentId: ID!, $reason: String!) {
97
+ deploymentCancel(id: $deploymentId, reason: $reason) {
98
+ deployment {
99
+ id
100
+ }
101
+ userErrors {
102
+ message
103
+ }
104
+ }
105
+ }
106
+ `;async function as(e){let{config:t,deploymentId:r,reason:o,logger:n}=e,i={deploymentId:r,reason:o};try{let s=await pe({query:ss,api:"Oxygen",url:`${t.deploymentUrl}/api/v2/admin/graphql`,token:t.deploymentToken.accessToken,variables:i,addedHeaders:{[fe.OxygenNamespaceHandle]:t.deploymentToken.namespace}});if(s.deploymentCancel.userErrors.length>=1)throw new E(s.deploymentCancel.userErrors[0]?.message||"");return F(`Deployment with id ${r} cancelled.`,n),s.deploymentCancel}catch(s){throw De(s),s}}l();import{Agent as Wl}from"https";var ls=Q(pl(),1);async function cs(e){let{config:t,logger:r,targets:o,hooks:n}=e;F(`Uploading ${o.length} files...`,r);let i=o.reduce((c,d)=>c+d.fileSize,0)/1024;e.metricsExporter?.add(ie.TotalSizeUploaded,i),e.metricsExporter?.add(ie.NumFilesUploaded,o.length);let s=new Wl({keepAlive:!0});n?.onUploadFilesStart?.();let a=performance.now();return(0,ls.mapLimit)(o,6,async c=>{await zl(t,c,s)}).then(()=>{let c=performance.now();n?.onUploadFilesComplete?.(),e.metricsExporter?.add(ie.UploadTime,c-a),Fe("Files uploaded successfully",r)}).catch(c=>{throw n?.onUploadFilesError?.(c),c}).finally(()=>{s.destroy()})}async function zl(e,t,r){let o=t.fileType==="WORKER"?x(e.rootPath,e.workerDir):x(e.rootPath,e.assetsDir);if(t.parameters!==null&&t.parameters.length>0){let n=vn();t.parameters.forEach(i=>{n.append(i.name,i.value)}),n.append("file",wo(x(o,t.filePath))),await ds(n,t,r)}else{let n=await Jl(t,r);await us(x(o,t.filePath),n,r)}}async function ds(e,t,r,o=0){try{let i=new AbortController,s=setTimeout(()=>{i.abort()},12e4),a=await ae(t.uploadUrl,{method:"POST",body:e,signal:i.signal,headers:{Connection:"keep-alive"},agent:r});if(clearTimeout(s),!a.ok)throw new Error(`${a.status}`)}catch(n){if(fs(n,"ENOENT"))throw new Error(`File not found: ${t.filePath}`);if(o<Number(Or.maxUploadAttempts))await ds(e,t,r,o+1);else throw n instanceof Error&&n.name==="AbortError"?new Error(`Request timeout whilst uploading ${t.filePath}`):new Error(`Failed to upload file ${t.filePath}`)}}async function Jl(e,t){return ae(e.uploadUrl,{method:"POST",headers:{"x-goog-resumable":"start","X-Goog-Content-Length-Range":`0,${e.fileSize}`,"User-Agent":"oxygen-cli"},agent:t}).then(r=>({sessionUri:r.headers.get("x-guploader-uploadid"),location:r.headers.get("location"),target:e})).catch(r=>{throw new Error(`Failed to initiate resumable upload for file ${e.filePath} (status code ${r.statusCode})`)})}async function us(e,t,r,o=0,n=0){await Ql(t.location,e,o,r).catch(async i=>{if(fs(i,"ENOENT"))throw new Error(`File not found: ${t.target.filePath}`);if(i&&n>=Number(Or.maxResumabeUploadAttempts))throw new Error(`Failed to upload file ${t.target.filePath} after ${Or.maxResumabeUploadAttempts} attempts`);let s=await Kl(t.location,t.target.fileSize,r);if(!s.complete){let a=s.lastReceivedByte,c=n+1;await us(e,t,r,a,c)}})}async function Ql(e,t,r,o){let n=wo(t,{start:r});return ae(e,{method:"PUT",body:n,agent:o}).then(i=>i.status)}async function Kl(e,t,r){let o=n=>{if(!n||n.split("-").length!==2)return 0;let i=n.split("-");return parseInt(i[1],10)};return ae(e,{method:"PUT",headers:{"Content-Length":"0","Content-Range":`bytes */${t}`},agent:r}).then(n=>({complete:n.status===200,lastReceivedByte:o(n.headers.get("range"))})).catch(n=>(console.error(n),{complete:!1,lastReceivedByte:0}))}function fs(e,t){return e instanceof Error&&"code"in e&&e.code===t}l();l();var ms=`
107
+ query DeploymentVerificationDetails($deploymentId: ID!) {
108
+ deploymentVerificationDetails(id: $deploymentId) {
109
+ url
110
+ status
111
+ error
112
+ startupTime
113
+ }
114
+ }
115
+ `,Ot=(e=>(e.Pending="PENDING",e.Deployed="DEPLOYED",e.Failed="FAILED",e.Cancelled="CANCELLED",e))(Ot||{});async function ps(e,t){let{config:r,logger:o,timeoutInSeconds:n,hooks:i}=e,s={deploymentId:t};i?.onDeploymentCompletedVerificationStart?.(),F("Verifying deployment completed...",o);let a=Date.now(),c=async()=>{if((Date.now()-a)/1e3+3e3/1e3>n)throw i?.onDeploymentCompletedVerificationError?.(),new Error(`Deployment not completed after ${n} seconds.`);return await new Promise(m=>setTimeout(m,3e3)),d()},d=async()=>{let f=(await pe({query:ms,api:"Oxygen",url:`${r.deploymentUrl}/api/v2/admin/graphql`,token:r.deploymentToken.accessToken,variables:s,addedHeaders:{[fe.OxygenNamespaceHandle]:r.deploymentToken.namespace}})).deploymentVerificationDetails;if(f==null)throw i?.onDeploymentCompletedVerificationError?.(),new Qe("Deployment not found");if(f.status===Ot.Deployed)return Fe("Deployment to Oxygen completed successfully",o),i?.onDeploymentCompleted?.(),f;if(f.status===Ot.Failed||f.status===Ot.Cancelled)throw i?.onDeploymentFailed?.(f),new Qe(f.error?`Deployment ${f.status.toLocaleLowerCase()}, error: ${f.error}${f.startupTime&&f.error.includes("exceeded CPU time limit")?` (Startup time: ${f.startupTime}ms exceeded CPU time limit)`:""}`:`Deployment ${f.status.toLocaleLowerCase()}`);return c()};return d()}l();import{spawn as Xl}from"child_process";import{PassThrough as Zl}from"stream";async function hs(e){let{config:t,assetPath:r,hooks:o}=e,n=dt();if(o?.buildFunction){let s=performance.now();return o.buildFunction(r).then(()=>{e.metricsExporter?.add(ie.BuildTime,performance.now()-s)}).catch(a=>{throw new Error(`Build function failed with error: ${a}`)})}let i=r?{HYDROGEN_ASSET_BASE_URL:r}:{};try{await new Promise((s,a)=>{let c="",d=new Zl;d.on("data",m=>{c+=m,process.stderr.write(m)});let u=performance.now(),f=Xl(t.buildCommand,[],{stdio:["inherit","pipe","pipe"],env:{...process.env,...i},cwd:t.rootPath,shell:!0});f.stderr?.pipe(d),f.stdout?.pipe(d),f.on("close",m=>{if(m===0&&e.metricsExporter?.add(ie.BuildTime,performance.now()-u),n?.addMetadata("buildCommand",{command:t.buildCommand,stderr:c,code:m}),m!==0){a(m);return}s(m)})})}catch(s){throw new Error(`Build failed with error code: ${s}`)}}l();async function gs(e,t){let r=zt(),o=r.metadata??{};try{let n=await ec(e.rootPath);o.actor||(o.actor=n.author_name),o.commitDate||(o.commitDate=n.date),o.commitMessage||(o.commitMessage=n.message),n.branch&&(o.branch=n.branch),n.hash&&(o.commitSha=n.hash)}catch{V("Could not retrieve Git history, commit message will be unavailable.",t)}return{name:r.isCI?r.name:"none",...o,actor:e.metadata.user??o.actor,commitMessage:tc(e.metadata.description??o.commitMessage),commitSha:e.metadata.version??o.commitSha,hydrogenVersion:e.metadata.hydrogenVersion,url:e.metadata.url??o.url}}async function ec(e){let t=await Jt(e),r=(/HEAD -> ([^,]*)/.exec(t.refs)||[])[1],o=process.env.GITHUB_HEAD_REF;if(!o)return{...t,branch:r};let n=/Merge ([\w\d]+) into [\w\d]+/.exec(t.message);return{...t,branch:o,hash:n?n[1]:t.hash}}function tc(e){if(!e)return;let t=e.split(/\r?\n/)[0]?.trim()||"",r=JSON.stringify(t),o=!1;for(;r.length>ct;){let n=t.lastIndexOf(" ",ct-3);t=`${t.substring(0,n>-1?n:ct-3)}`.trimEnd(),o=!0,r=JSON.stringify(t)}return o?`${t}...`:t}function ys(e,t){if(e.defaultEnvironment)return;let r=e.environmentTag||t.branch;return r?{tag:r}:void 0}function ws(e){let t=[],r=(n,i)=>{let s=JSON.stringify(i);if(s.length>ct)throw new Error(`Provided ${n} metadata exceeds maximum length (max ${ct} characters).`);let a=`${n}=${s}`;t.push(a)};if(e.name!=="none"&&t.push(`ci-platform=${JSON.stringify(e.name)}`),e.name!=="unknown"){let n={attempt:"attempt",run:"runId"};for(let[i,s]of Object.entries(n)){let a=i;e[a]&&t.push(`${e.name}-${s}=${JSON.stringify(e[a])}`)}}let o={actor:"user",branch:"branch",commitDate:"commit-date",commitMessage:"description",commitSha:"version",hydrogenVersion:"hydrogen-version",url:"url"};for(let[n,i]of Object.entries(o)){let s=n;e[s]&&r(i,e[s])}return t}async function vs(e){let t=performance.now();Wi(!e.config.bugsnag);let r=dt();r?.addMetadata("config",{...e.config,deploymentToken:{...e.config.deploymentToken,accessToken:"***"},rootPath:"***"});let{config:o,hooks:n}=e,i=e.logger??Fo,s={},a,c,d;try{let u=await gs(o,i),f=ws(u),m=ys(o,u);if(r?.addMetadata("metadata",{environment:m,labels:f,metadata:u}),d=new Rr({ciProvider:u.name||"unknown",rootPath:o.rootPath}),!o.workerOnly&&!o.skipBuild){let v=await Qi({config:o,environment:m,labels:f,logger:i});s.id=v.build.id,s.assetPath=v.build.assetPath}o.skipBuild||(await hs({config:o,assetPath:s.assetPath,hooks:n,metricsExporter:d}),await Gi({config:o,performedBuild:!0})),a=!0;let p=await es(o,d);r?.addMetadata("manifest",p);let h=s.id?{buildId:s.id,manifest:p}:{environment:m,manifest:p,labels:f};c=await rs({config:o,input:h,logger:i}),await cs({config:o,targets:c.deploymentTargets,hooks:n,logger:i,metricsExporter:d});let y=performance.now(),b=await ns(o,c.deployment.id);d.add(ie.TotalTime,performance.now()-t),await ps({config:o,hooks:n,logger:i,timeoutInSeconds:c.deploymentConfiguration.timeoutInSeconds},c.deployment.id),d.add(ie.DeploymentCompletedTime,performance.now()-y),o.skipVerification||(await is({config:o,url:b.deployment.url,logger:i,hooks:n}),d.add(ie.DeploymentRoutableTime,performance.now()-y));let w={url:b.deployment.url},g=`
116
+ The deployment can be reached at the ${w.url} preview URL`;return b.authBypassToken&&(w.authBypassToken=b.authBypassToken,g+=`. The auth bypass token for the deployment is ${w.authBypassToken}`),Tn(g,i),w}catch(u){return o.bugsnag&&r&&(u instanceof Error||typeof u=="string")&&r.notify(zi(u,o.rootPath)),u instanceof Error?(u instanceof ut||u instanceof Qe?V(u.message,i):s.id&&!a?(V(`Build failed with: ${u.message}, cancelling build.`,i),await Xi({config:o,buildId:s.id,reason:u.message,logger:i}).catch(f=>{f instanceof Error&&V(`Failed to cancel build: ${f.message}`,i)})):c?.deployment.id&&(V(`Deployment failed with: ${u.message}, cancelling deployment.`,i),await as({config:o,deploymentId:c.deployment.id,reason:u.message,logger:i}).catch(f=>{f instanceof Error&&V(`Failed to cancel deployment: ${f.message}`,i)})),Promise.reject(u)):(console.error("Unknown error",u),Promise.reject(new Error("Unknown error")))}finally{d?.export()}}import{createRequire as oc}from"node:module";l();l();l();function bs(e){let{storeFqdn:t}=e;return`https://${t}/admin/custom_storefronts/new`}function ks(e){let{storeFqdn:t}=e;return`https://${t}/admin/custom_storefronts`}function ft({session:e,storefront:t,cliCommand:r}){Re({name:"NoStorefrontError",type:0,message:W`${we.errorText("Couldn\u2019t find Hydrogen storefront.")}`.value,skipOclifErrorHandling:!0,tryMessage:W`Couldn’t find ${t.title} (ID: ${nt(t.id)}) on ${e.storeFqdn}. Check that the storefront exists and run ${we.genericShellCommand(`${r} link`)} to link this project to it.\n\n${we.link("Hydrogen Storefronts Admin",ks(e))}`.value})}function Es({noStorefronts:e=!1}){B({headline:e?"You don't have a Hydrogen storefront to link to":"You haven't linked your project to a storefront yet",body:["Link your local environment to a Hydrogen storefront. Enable automatic environment variable injection and access to",{command:"env list"},",",{command:"env pull"},",",{command:"env push"},", and",{command:"deploy"},"commands. Use",{command:"unlink"},"to disconnect from the storefront."]})}l();var rc=`#graphql
117
+ query GetDeploymentToken($id: ID!) {
118
+ hydrogenStorefront(id: $id) {
119
+ oxygenDeploymentToken
120
+ environments {
121
+ name
122
+ handle
123
+ branch
124
+ type
125
+ }
126
+ }
127
+ }
128
+ `;async function Ss(e,t){let{hydrogenStorefront:r}=await ot(rc,e,{id:t});return{storefront:r}}l();async function Me({root:e,session:t,config:r,cliCommand:o}){let n=await Xn(t),i=r.storefront?.id?n.find(({id:s})=>s===r.storefront.id):void 0;return i||(Es({noStorefronts:!n.length}),await gi(e,t,r,{force:!0,cliCommand:o,storefronts:n}))}async function xs({root:e}){let[{session:t,config:r},o]=await Promise.all([ge(e),z()]),n=await Me({root:e,session:t,config:r,cliCommand:o});if(!n)return;r.storefront=n;let{storefront:i}=await Ss(t,r.storefront.id);if(!i){ft({session:t,storefront:r.storefront,cliCommand:o});return}if(!i.oxygenDeploymentToken){V("Could not retrieve a deployment token.");return}return i}var Ps="h2_deploy_log.json",nc="node --run build",ic=(e,t="info")=>{(t==="error"||t==="warn")&&V(e)},Ar=class e extends O{static descriptionWithMarkdown="Builds and deploys your Hydrogen storefront to Oxygen. Requires an Oxygen deployment token to be set with the `--token` flag or an environment variable (`SHOPIFY_HYDROGEN_DEPLOYMENT_TOKEN`). If the storefront is [linked](https://shopify.dev/docs/api/shopify-cli/hydrogen/hydrogen-link) then the Oxygen deployment token for the linked storefront will be used automatically.";static description="Builds and deploys a Hydrogen storefront to Oxygen.";static flags={...k.entry,...k.env,...k.envBranch,...ve(k.envFile,{"env-file":{description:"Path to an environment file to override existing environment variables for the deployment.",default:void 0}}),preview:re.Flags.boolean({description:"Deploys to the Preview environment.",required:!1,default:!1}),force:re.Flags.boolean({char:"f",description:"Forces a deployment to proceed if there are uncommitted changes in its Git repository, and skips confirmation prompts for non-preview environments.",default:!1,env:"SHOPIFY_HYDROGEN_FLAG_FORCE",required:!1}),"no-verify":re.Flags.boolean({description:"Skip the routability verification step after deployment.",default:!1,required:!1}),"auth-bypass-token":re.Flags.boolean({description:"Generate an authentication bypass token, which can be used to perform end-to-end tests against the deployment.",required:!1,default:!1,env:"AUTH_BYPASS_TOKEN"}),"auth-bypass-token-duration":re.Flags.string({description:"Specify the duration (in hours) up to 12 hours for the authentication bypass token. Defaults to `2`",required:!1,env:"AUTH_BYPASS_TOKEN_DURATION",dependsOn:["auth-bypass-token"]}),"build-command":re.Flags.string({description:"Specify a build command to run before deploying. If not specified, the Hydrogen build pipeline will be used. When custom output directories are configured, defaults to `node --run build`.",required:!1}),"assets-dir":re.Flags.string({description:"Directory containing the client assets to deploy, relative to the project root. Defaults to the detected Vite client output directory, then falls back to `dist/client`.",env:"SHOPIFY_HYDROGEN_FLAG_ASSETS_DIR",required:!1}),"worker-dir":re.Flags.string({description:"Directory containing the Oxygen worker entry point (`index.js` or `index.mjs`), relative to the project root. Defaults to the detected Vite server output directory, then falls back to `dist/server`.",env:"SHOPIFY_HYDROGEN_FLAG_WORKER_DIR",required:!1}),...k.lockfileCheck,...k.path,...k.shop,"json-output":re.Flags.boolean({allowNo:!0,description:"Create a JSON file containing the deployment details in CI environments. Defaults to true, use `--no-json-output` to disable.",required:!1,default:!0}),token:re.Flags.string({char:"t",description:"Oxygen deployment token. Defaults to the linked storefront's token if available.",env:"SHOPIFY_HYDROGEN_DEPLOYMENT_TOKEN",required:!1}),"metadata-description":re.Flags.string({description:"Description of the changes in the deployment. Defaults to the commit message of the latest commit if there are no uncommitted changes.",required:!1,env:"SHOPIFY_HYDROGEN_FLAG_METADATA_DESCRIPTION"}),"metadata-url":re.Flags.string({required:!1,env:"SHOPIFY_HYDROGEN_FLAG_METADATA_URL",hidden:!0}),"metadata-user":re.Flags.string({description:"User that initiated the deployment. Will be saved and displayed in the Shopify admin",required:!1,env:"SHOPIFY_HYDROGEN_FLAG_METADATA_USER"}),"metadata-version":re.Flags.string({required:!1,env:"SHOPIFY_HYDROGEN_FLAG_METADATA_VERSION",hidden:!0}),"force-client-sourcemap":re.Flags.boolean({description:"Client sourcemapping is avoided by default because it makes backend code visible in the browser. Use this flag to force enabling it.",env:"SHOPIFY_HYDROGEN_FLAG_FORCE_CLIENT_SOURCEMAP"})};async run(){let{flags:t}=await this.parse(e),r=this.flagsToOxygenDeploymentOptions(t);await sc(r),process.exit(0)}flagsToOxygenDeploymentOptions(t){return{...U(t),defaultEnvironment:t.preview,environmentFile:t["env-file"],path:t.path?T(t.path):process.cwd()}}};function Ds(e){return new E(e||"The deployment failed due to an unexpected error.","Retrying the deployment may succeed.",[["If the issue persists, please check the",{link:{label:"Shopify status page",url:"https://status.shopify.com/"}},"for any known issues."]])}async function sc(e){let{authBypassTokenDuration:t,authBypassToken:r,buildCommand:o,defaultEnvironment:n,env:i,envBranch:s,environmentFile:a,force:c,forceClientSourcemap:d=!1,noVerify:u,lockfileCheck:f,jsonOutput:m,path:p,shop:h,assetsDir:y,metadataUrl:b,metadataUser:w,metadataVersion:g,entry:v,workerDir:S}=e,{metadataDescription:P}=e,C=!0;try{await jn(p)}catch(A){if(A instanceof Fn&&(C=!1),!c&&!C){let q="Uncommitted changes detected",Ce,vt=[["Commit your changes before deploying or use the",{command:"--force"},"flag to deploy with uncommitted changes."]];try{Ce=(await Et("git status -s",{cwd:p})).stdout}catch{}throw Ce&&(q+=`:
129
+
130
+ ${Ce.trimEnd()}`,wr.forEach(({name:mo,lockfile:po,alternativeLockfiles:sl,installCommand:al})=>{let un=[po,...sl||[]].find(ll=>Ce.includes(ll));un&&vt.push([`If you are using ${mo}, try running`,{command:al},`to avoid changes to ${un}.`])})),new E(q,null,vt)}}let D=zt().isCI,R=e.token,$,I,_,L,j;try{j=await Jt(p),$=(/HEAD -> ([^,]*)/.exec(j.refs)||[])[1],I=j.hash}catch{V("Could not retrieve Git history."),$=void 0}!P&&!C&&(Y({headline:"No deployment description provided",body:["Deploying uncommitted changes, but no description has been provided. Use the ",{command:"--metadata-description"},"flag to provide a description. If no description is provided, the description defaults to ",{userInput:"<sha> with additional changes"}," using the SHA of the last commit."]}),P=`${I} with additional changes`);let ne;if(a){let{variables:A}=await fr(a);ne=Object.entries(A).map(([q,Ce])=>({isSecret:!0,key:q,value:Ce}))}let le=null,_e=!1;if(D&&i)throw new E("Can't specify an environment handle in CI","Environments are automatically picked up by the current Git branch.");if(D&&s&&(le=s),!D){if(_=await xs({root:p,flagShop:h}),!_)return;R=R||_.oxygenDeploymentToken,i?(le=at(_.environments||[],i).branch,le===null&&(_e=!0)):s&&(le=Pt(_.environments||[],s).branch)}if(!R){let A=D?["No deployment token provided. Use the ",{command:"--token"}," flag to provide a token."]:"Could not obtain an Oxygen deployment token, please try again or contact Shopify support.";throw new E(A)}if(!D&&!n&&!i&&!s&&_?.environments)if(_.environments.length>1){let q=mr(_.environments).map(({name:Ce,branch:vt,handle:mo,type:po})=>({label:ze(Ce,mo,vt),value:po==="PREVIEW"?"shopify-preview-environment.":vt}));L=await $e({message:"Select an environment to deploy to",choices:q,defaultValue:$})}else F(`Using current checked out branch ${$} as environment tag`);let Lt="https://oxygen.shopifyapps.com";process.env.UNSAFE_SHOPIFY_HYDROGEN_DEPLOYMENT_URL&&(Lt=process.env.UNSAFE_SHOPIFY_HYDROGEN_DEPLOYMENT_URL,V("Using a custom deployment service. Don't do this in production!"));let Ht=$;L==="shopify-preview-environment."&&(Ht=void 0,L=void 0,_e=!0);let Be="dist/client",J="dist/worker",me=await rt(p),Mt=cc({appPath:p}),uo=!o&&!me&&(y||S||lc(Mt));if(me)Be=y??Be,J=S??J;else{let A=await he(p,v).catch(()=>null),q=ac({root:p,viteOutputDirs:A,assetsDirFlag:y,workerDirFlag:S});Be=q.assetsDir,J=q.workerDir}let Ve={assetsDir:Be,bugsnag:!0,deploymentUrl:Lt,defaultEnvironment:n||_e,deploymentToken:jo(R),environmentTag:le||L||Ht,generateAuthBypassToken:r,authBypassTokenDuration:t,verificationMaxDuration:180,metadata:{...P?{description:P}:{},...b?{url:b}:{},...w?{user:w}:{},...g?{version:g}:{},...Mt?{hydrogenVersion:Mt}:{}},skipVerification:u,rootPath:p,skipBuild:!1,workerOnly:!1,workerDir:J,overriddenEnvironmentVariables:ne};if(!D&&!Ve.defaultEnvironment&&(le||L)&&!c){let A=Pt(_.environments,Ve.environmentTag),q=`Creating a deployment against ${ze(A.name,A.handle,A.branch)}`;if(!await Te({confirmationMessage:"Yes, confirm deploy",cancellationMessage:"No, cancel deploy",message:W`${q}
131
+
132
+ Continue?`.value}))return}let nn,tl=new Promise(A=>{nn=A}),sn,rl=new Promise(A=>{sn=A}),an,ol=new Promise(A=>{an=A}),wt=null,ln=null,cn,fo,nl=new Promise((A,q)=>{cn=A,fo=q}),dn={onDeploymentCompleted:()=>an(),onVerificationComplete:()=>sn(),onDeploymentCompletedVerificationError(){wt=new E("Unable to verify the deployment was completed successfully","Please verify the deployment status in the Shopify Admin and retry deploying if necessary.")},onDeploymentFailed:A=>{wt=Ds(A.error||A.status)},onUploadFilesStart:()=>il(),onUploadFilesComplete:()=>nn(),onVerificationError:A=>{wt=new E(A.message,"Please verify the deployment status in the Shopify Admin and retry deploying if necessary.")},onUploadFilesError:A=>{wt=new E(A.message,"Check your connection and try again. If the problem persists, try again later or contact support.")}};o||uo?(d&&(console.log(""),B({headline:"The `--force-client-sourcemap` flag is not supported with a custom build command",body:"Client sourcemaps will not be generated."})),Ve.buildCommand=o??nc):dn.buildFunction=async A=>{try{if(F(W`${H.whiteBright("Building project...")}`.value),me)throw new E(Pe);await Je({directory:p,assetPath:A,lockfileCheck:f,sourcemap:!0,forceClientSourcemap:d,useCodegen:!1,entry:v})}catch(q){throw ln=q,q}};let il=async()=>{F(W`${H.whiteBright(`Deploying to Oxygen..
133
+ `)}`.value),await ee([{title:"Uploading files",task:async()=>await tl},{title:"Verifying deployment has been completed",task:async()=>await ol},{title:"Verifying deployment is routable",task:async()=>await rl,skip:()=>u}])};return await vs({config:Ve,hooks:dn,logger:ic}).then(async A=>{if(!A){fo(Ds());return}let q=[];D?m&&q.push(["View the deployment information in",{subdued:Ps}]):(q.push(["Open",{link:{url:A.url}},"in your browser to view your deployment."]),A?.authBypassToken&&q.push(["Use the",{subdued:A.authBypassToken},"token to perform end-to-end tests against the deployment."])),N({body:["Successfully deployed to Oxygen"],nextSteps:q}),D&&m&&await K(Ps,JSON.stringify(A)),cn()}).catch(A=>{fo(wt||ln||A)}),nl}function ac({root:e,viteOutputDirs:t,assetsDirFlag:r,workerDirFlag:o}){let n=t&&se(e,t.clientOutDir),i=t&&se(e,t.serverOutDir);return{assetsDir:r??n??"dist/client",workerDir:o??i??"dist/server"}}function lc(e){return e?.startsWith("0.0.0-preview-")??!1}function cc({appPath:e}){let{root:t}=xe(e);try{let r=oc(import.meta.url),o=r(r.resolve("@shopify/hydrogen/package.json",{paths:[t]}));return typeof o.version=="string"?o.version:void 0}catch{return}}l();var $t=Q(ue(),1);l();var oe=Q(cl(),1);import{createRequire as dc}from"node:module";var Lo=Q(ue(),1);function Os(e){return[...e.removeDependencies,...e.removeDevDependencies]}var Cs=".hydrogen",Fr=class e extends O{static descriptionWithMarkdown="Upgrade Hydrogen project dependencies, preview features, fixes and breaking changes. The command also generates an instruction file for each upgrade.";static description="Upgrade Remix and Hydrogen npm dependencies.";static flags={...k.path,version:Lo.Flags.string({description:"A target hydrogen version to update to",required:!1,char:"v"}),force:Lo.Flags.boolean({description:"Ignore warnings and force the upgrade to the target version",env:"SHOPIFY_HYDROGEN_FLAG_FORCE",char:"f"})};async run(){let{flags:t}=await this.parse(e);await uc({...U(t),appPath:t.path?T(t.path):process.cwd()})}},_t=null;async function uc({appPath:e,version:t,force:r}){if(t==="next"){let p=process.env.SHOPIFY_UNIT_TEST==="1",h=Ct();if(!await fc()&&!p&&!h)throw new E("--version=next is only available when running from the Hydrogen monorepo","This feature is designed for internal development and testing of unreleased versions")}r||(await pc(e),await hc(e));let{currentVersion:o,currentDependencies:n}=await _s({appPath:e});if(t==="next"){let p=n["@shopify/hydrogen"]==="next",h=n["@shopify/mini-oxygen"]==="next";if(p||h)throw new E("Project already uses next versions",'Cannot upgrade to --version=next when @shopify/hydrogen or @shopify/mini-oxygen are already using "next" versions')}if(oe.default.prerelease(o))throw new E("The upgrade command cannot be run over a prerelease Hydrogen version");let s=await Rs(),{availableUpgrades:a}=As({releases:s.releases,currentVersion:o,currentDependencies:n});if(!a?.length){N({headline:`You are on the latest Hydrogen version: ${M(o)}`});return}let c=!1,d,u;do d=await yc({currentVersion:o,targetVersion:t,availableUpgrades:a,currentDependencies:n}),u=wc({availableUpgrades:a,currentVersion:o,currentDependencies:n,selectedRelease:d}),c=await vc({cumulativeRelease:u,selectedRelease:d,targetVersion:t});while(!c);let f=Tc({appPath:e,cumulativeRelease:u,currentVersion:o,selectedRelease:d});await kc({appPath:e,selectedRelease:d,currentDependencies:n,targetVersion:t,cumulativeRemoveDependencies:u.removeDependencies,cumulativeRemoveDevDependencies:u.removeDevDependencies,cumulativeDependencies:u.dependencies,cumulativeDevDependencies:u.devDependencies}),await Cc({appPath:e,selectedRelease:d,targetVersion:t});let m=await f;await Dc({appPath:e,currentVersion:o,instrunctionsFilePath:m,selectedRelease:d})}async function fc(){try{let e=process.cwd(),t=[e,x(e,"../"),x(e,"../../")];for(let r of t)try{let o=x(r,"templates/skeleton"),n=x(r,"packages/cli"),i=await Vt(o),s=await Vt(n);if(i&&s)return!0}catch{continue}return!1}catch{return!1}}function mc(e){let t={...e.dependencies},r={...e.devDependencies??{}};return t["@shopify/hydrogen"]&&(t["@shopify/hydrogen"]="next"),r["@shopify/mini-oxygen"]&&(r["@shopify/mini-oxygen"]="next"),{...e,title:`${e.title} (next versions)`,dependencies:t,devDependencies:r}}function pc(e){return An(e).catch(()=>{throw new E("The upgrade command can only be run on a git repository","Please run the command inside a git repository or run 'git init' to create one")})}async function hc(e){if(!await Nn(e))throw new E("The upgrade command can only be run on a clean git branch","Please commit your changes or re-run the command on a clean branch")}async function _s({appPath:e}){let{root:t}=xe(e),r=x(t,"package.json"),o;try{o=JSON.parse(await de(r))}catch{throw new E("Could not find a valid package.json","Please make sure you are running the command in a npm project")}let n={...o?.dependencies,...o?.devDependencies},i=n["@shopify/hydrogen"];if(!i)throw new E("Could not find a valid Hydrogen version in package.json","Please make sure you are running the command in a Hydrogen project");return{currentVersion:i,currentDependencies:n}}async function Rs(){if(_t)return _t;if(process.env.FORCE_CHANGELOG_SOURCE==="local"||Ie&&Se&&process.env.FORCE_CHANGELOG_SOURCE!=="remote"){let e=dc(import.meta.url),t=Ie&&Se?x(ho(Se),"docs","changelog.json"):x(process.cwd(),"docs","changelog.json");try{let r=e(t);return _t=r,r}catch(r){if(console.warn(`Failed to load local changelog from ${t}:`,r.message),process.env.FORCE_CHANGELOG_SOURCE==="local")throw new E("Failed to load local changelog",`Could not read changelog from ${t}`)}}try{let e=await ae("https://hydrogen.shopify.dev/changelog.json");if(!e.ok)throw new Error("Failed to fetch changelog.json");let t=await e.json();if("releases"in t&&"url"in t)return _t=t,_t}catch{}throw new E("Failed to fetch Hydrogen changelog","Ensure you have internet connection and try again")}function $s({release:e,currentDependencies:t}){return Object.entries({...e.dependencies,...e.devDependencies??{}}).some(([r,o])=>{if(r==="@shopify/cli")return!1;let n=t?.[r];return n?oe.default.gt(M(o),M(n)):!1})}function gc({currentDependencies:e,currentPinnedVersion:t,release:r}){return oe.default.gt(r.version,t)?!0:M(r.version)===t?$s({release:r,currentDependencies:e}):!1}function As({releases:e,currentVersion:t,currentDependencies:r}){let o=M(t),n="",i=e.filter(a=>gc({release:a,currentPinnedVersion:o,currentDependencies:r})&&n!==a.version?(n=a.version,!0):!1),s=i.reduce((a,c)=>(a[c.version]||(a[c.version]=c),a),{});return{availableUpgrades:i,uniqueAvailableUpgrades:s}}async function yc({targetVersion:e,availableUpgrades:t,currentVersion:r,currentDependencies:o}){return(e?e==="next"?mc(t[0]):t.find(i=>M(i.version)===M(e)):void 0)??Pc(r,t)}function wc({availableUpgrades:e,selectedRelease:t,currentVersion:r,currentDependencies:o}){let n=M(r),i={features:[],fixes:[],removeDependencies:[],removeDevDependencies:[],dependencies:{},devDependencies:{}};if(!e?.length)return i;if(t.dependencies?.["@shopify/hydrogen"]==="next")return{...i,features:t.features||[],fixes:t.fixes||[],removeDependencies:t.removeDependencies??[],removeDevDependencies:t.removeDevDependencies??[],dependencies:t.dependencies??{},devDependencies:t.devDependencies??{}};let s=e.filter(g=>oe.default.gt(g.version,n)&&oe.default.lte(g.version,t.version)?!0:!(M(g.version)===n)||!o?!1:$s({release:g,currentDependencies:o})),a=s.flatMap(g=>g.features),c=s.flatMap(g=>g.fixes),d=[...s].sort((g,v)=>oe.default.compare(g.version,v.version)),u=new Map,f=new Map;d.forEach((g,v)=>{g.removeDependencies?.forEach(S=>{u.set(S,v)}),g.removeDevDependencies?.forEach(S=>{f.set(S,v)})});let m=new Set,p=new Set;for(let g=0;g<d.length;g++){let v=d[g];if(!v)continue;let S=v.dependencies??{},P=v.devDependencies??{};Object.keys(S).forEach(C=>{let D=u.get(C);D!==void 0&&g>=D&&m.add(C)}),Object.keys(P).forEach(C=>{let D=f.get(C);D!==void 0&&g>=D&&p.add(C)})}let h=[...new Set(d.flatMap(g=>g.removeDependencies??[]).filter(g=>!m.has(g)))],y=[...new Set(d.flatMap(g=>g.removeDevDependencies??[]).filter(g=>!p.has(g)))],b={},w={};for(let g of d)Object.assign(b,g.dependencies??{}),Object.assign(w,g.devDependencies??{});return{features:a,fixes:c,removeDependencies:h,removeDevDependencies:y,dependencies:b,devDependencies:w}}function vc({cumulativeRelease:e,selectedRelease:t,targetVersion:r}){let{features:o,fixes:n}=e,i=Os(e);return(o.length||n.length||i.length)&&B({headline:"Included in this upgrade:",customSections:[o.length&&{title:"Features",body:[{list:{items:o.map(s=>s.title)}}]},n.length&&{title:"Fixes",body:[{list:{items:n.map(s=>s.title)}}]},i.length&&{title:"Removed packages",body:[{list:{items:i}}]}].filter(Boolean)}),r==="next"?!0:Te({message:`Are you sure you want to upgrade to ${t.version}?`,cancellationMessage:"No, choose another version",defaultValue:!0})}function jr([e]){return!!e.includes("@remix-run")}function Ho([e]){return!!e.includes("react-router")}function Ts(e,t,r){return r==="next"&&(e==="@shopify/hydrogen"||e==="@shopify/mini-oxygen")?"next":M(t)}function Is({currentDependencies:e,dependency:[t,r],selectedRelease:o,targetVersion:n}){let i=e[t];return jr([t,r])||Ho([t,r])||i==="next"&&!(n==="next")?!1:o.dependenciesMeta?.[t]?!o.dependenciesMeta?.[t]?.required?!1:!!(!i||n==="next"&&(t==="@shopify/hydrogen"||t==="@shopify/mini-oxygen")||oe.default.lt(M(i),M(r))):!0}function bc({selectedRelease:e,currentDependencies:t,targetVersion:r,cumulativeDependencies:o,cumulativeDevDependencies:n}){let i=[],s={...o??{},...e.dependencies},a={...n??{},...e.devDependencies??{}};for(let m of Object.entries(s))Is({currentDependencies:t,dependency:m,selectedRelease:e,targetVersion:r})&&i.push(`${m[0]}@${Ts(m[0],m[1],r)}`);for(let m of Object.entries(a))Is({currentDependencies:t,dependency:m,selectedRelease:e,targetVersion:r})&&i.push(`${m[0]}@${Ts(m[0],m[1],r)}`);let c=Object.entries(t).find(jr),d=Object.entries(s).find(jr);c&&d&&oe.default.lt(M(c[1]),M(d[1]))&&i.push(...Sc({currentDependencies:t,selectedRemix:d}));let u=Object.entries(t).find(Ho),f=Object.entries(s).find(Ho);return f&&(!u||oe.default.lt(M(u[1]),M(f[1])))&&i.push(...xc({currentDependencies:t,selectedReactRouter:f})),i}async function kc({appPath:e,selectedRelease:t,currentDependencies:r,targetVersion:o,cumulativeRemoveDependencies:n,cumulativeRemoveDevDependencies:i,cumulativeDependencies:s,cumulativeDevDependencies:a}){let c=[],d=[...n,...i].filter(f=>f in r);d.length>0&&c.push({title:"Removing deprecated dependencies",task:async()=>{await Ec({directory:e,packageManager:await Ee(e),args:d})}});let u=bc({selectedRelease:t,currentDependencies:r,targetVersion:o,cumulativeDependencies:s,cumulativeDevDependencies:a});u.length>0&&c.push({title:"Upgrading dependencies",task:async()=>{let f=await Ee(e),m=f==="npm"?"install":f==="yarn"||f==="pnpm"?"add":"install",p=f==="npm"||f==="unknown"?["--legacy-peer-deps"]:[];await bo(Fs(f),[m,...p,...u],{cwd:e})}}),c.length>0&&await ee(c,{})}function Fs(e){return e==="unknown"?"npm":e}async function Ec({directory:e,packageManager:t,args:r}){if(r.length===0)return;let o=t==="npm"?"uninstall":t==="yarn"||t==="pnpm"||t==="bun"?"remove":"uninstall",n=t==="npm"||t==="unknown"?["--legacy-peer-deps"]:[];await bo(Fs(t),[o,...n,...r],{cwd:e})}function Sc({currentDependencies:e,selectedRemix:t}){let r=[];for(let[o,n]of Object.entries(e))jr([o,n])&&r.push(`${o}@${M(t[1])}`);return r}function xc({currentDependencies:e,selectedReactRouter:t}){let r=[],o=M(t[1]),n=["react-router","react-router-dom","@react-router/dev","@react-router/fs-routes"];for(let i of n)r.push(`${i}@${o}`);return r}function M(e){if(e==="next")return"next";if(e.match(/^[\^~]?0\.0\.0-next-([a-f0-9]+)-(\d+)$/))return e.replace(/^[\^~]?/,"");let r=oe.default.minVersion(e);if(!r)throw new E(`Invalid version: ${e}`);return r.version}async function Pc(e,t){if(!t?.length)throw new E("No upgrade options available");let r=t.map((o,n)=>{let{version:i,title:s}=o,a=n===0?"(latest)":oe.default.patch(i)===0?"(major)":M(e)===M(i)?"(outdated)":"";return`${oe.default.major(i)}${oe.default.minor(i)}`,{label:`${i} ${a} - ${vi(s,54)}`,value:o}});return $e({message:`Available Hydrogen versions (current: ${e})`,choices:r,defaultValue:r[0]?.value})}async function Dc({appPath:e,currentVersion:t,selectedRelease:r,instrunctionsFilePath:o}){let n=[...Object.entries(r.dependencies||{}).map(([p,h])=>`${p}@${h}`),...Object.entries(r.devDependencies||{}).map(([p,h])=>`${p}@${h}`)],i=[];if(typeof o=="string"){let p=`Upgrade instructions created at:
134
+ file://${o}`;i.push(p)}let s=`https://hydrogen.shopify.dev/releases/${r.version}`;i.push(`Release notes:
135
+ ${s}`);let a=M(t),c=M(r.version),d=a===c,u=`${a} \u2192 ${c}`,f=d?`You've upgraded Hydrogen ${c} dependencies`:`You've upgraded from ${u}`,m=await Ee(e);return N({headline:f,customSections:[{title:"Updated dependencies",body:[{list:{items:n}}]},{title:"What\u2019s next?",body:[{list:{items:i}}]},{title:"Undo these upgrades?",body:[{list:{items:[`Run \`git restore . && git clean -df && ${m} i\``]}}]}].filter(Boolean)})}async function Cc({appPath:e,selectedRelease:t,targetVersion:r}){let n=(await En(x(e,"package.json")))["@shopify/hydrogen"];if(!n)throw new E("Hydrogen version not found in package.json");let i=M(n);i.match(/^0\.0\.0-next-[a-f0-9]+-\d+$/);let s=t.dependencies?.["@shopify/hydrogen"]==="next";if(!(r==="next"&&s)&&i!==t.version)throw new E(`Failed to upgrade to Hydrogen version ${t.version}`,`You are still on version ${i}`)}function No(e){let{steps:t}=e,r=`### ${e.title} [#${e.id}](${e.pr})
136
+ `,o=t?.map((n,i)=>{let s=e.pr?`[#${e.id}](${e.pr})
137
+ `:"",c=t.length>1?`#### Step: ${i+1}. ${n.title} ${s}
138
+ `:`#### ${n.title.trim()}
139
+ `,d=n.info?`> ${n.info}
140
+ `:"",u=n.code?`${Buffer.from(n.code,"base64")}
141
+ `:"",f=e.docs?`[docs](${e.docs})
142
+ `:"";return`${c}${d}${f}${s}${u}`}).join(`
143
+ `);return`${r}
144
+ ${o}`}async function Tc({appPath:e,cumulativeRelease:t,currentVersion:r,selectedRelease:o}){let n="",{featuresMd:i,breakingChangesMd:s}=t.features.filter(y=>y.steps).reduce((y,b)=>(b.breaking?y.breakingChangesMd.push(No(b)):y.featuresMd.push(No(b)),y),{featuresMd:[],breakingChangesMd:[]}),a=t.fixes.filter(y=>y.steps).map(No),c=Os(t);if(!i.length&&!a.length&&!s.length&&!c.length){B({headline:"No upgrade instructions generated",body:"There are no additional upgrade instructions for this version."});return}let d=M(r),u=M(o.version);n=`upgrade-${d}-to-${u}.md`;let f=x(e,Cs),p=`${`# Hydrogen upgrade guide: ${d} to ${u}`}
145
+
146
+ ----
147
+ `;s.length&&(p+=`
148
+ ## Breaking changes
149
+
150
+ ${s.join(`
151
+ `)}
152
+ ----
153
+ `),i.length&&(p+=`
154
+ ## Features
155
+
156
+ ${i.join(`
157
+ `)}
158
+ ----
159
+ `),a.length&&(p+=`
160
+ ${i.length?`----
161
+
162
+ `:""}## Fixes
163
+
164
+ ${a.join(`
165
+ `)}`),c.length&&(p+=a.length?`
166
+
167
+ ----
168
+
169
+ `:`
170
+ `,p+=`## Removed packages
171
+
172
+ The following packages have been removed as part of this upgrade:
173
+
174
+ `,p+=c.map(y=>`- \`${y}\``).join(`
175
+ `),p+=`
176
+ `);let h=x(f,n);try{await Vt(f)}catch{await bt(f)}if(!await G(h))await go(h);else{if(await Te({message:`A previous upgrade instructions file already exists for this version.
177
+ Do you want to overwrite it?`,defaultValue:!1}))await ke(`${h}.old`);else return;await go(h)}return await K(h,p),`${Cs}/${n}`}async function js({targetPath:e}){try{let t=e?T(e):process.cwd(),{currentVersion:r,currentDependencies:o}=await _s({appPath:t});if(r.startsWith("workspace:")){B({headline:"Using monorepo @shopify/hydrogen dependency",body:"This project uses the workspace protocol for @shopify/hydrogen, so upgrade notices are skipped during local monorepo development."});return}if(oe.default.prerelease(r)||/^[a-z]+$/i.test(r))return;let i=await Rs(),{availableUpgrades:s,uniqueAvailableUpgrades:a}=As({releases:i.releases,currentVersion:r,currentDependencies:o});if(s.length===0||!s[0]?.version)return;let c=M(s[0].version),d=M(r),u=d===c,f=u?i.releases.findIndex(b=>M(b.version)!==d):i.releases.findIndex(b=>M(b.version)===d),m;if(f===-1){let b=i.releases.findIndex(w=>oe.default.lte(M(w.version),d));m=b===-1?i.releases:i.releases.slice(0,b)}else m=i.releases.slice(0,f);let p=Object.values([...m].reverse().reduce((b,w)=>(b[w.version]??=`${w.version} - ${w.title}`,b),{})).reverse().slice(0,5),h=Object.keys(a).length>1?`There are ${Object.keys(a).length} new @shopify/hydrogen versions available.`:"There's a new @shopify/hydrogen version available.",y=await z();B({headline:h,body:[`Current: ${r} | Latest: ${c}`+(u?" with updated dependencies":"")],customSections:[...p.length>0?[{title:`The next ${p.length} version(s) include`,body:[{list:{items:[...p,s.length>5?"...more":""].flat().filter(Boolean)}}].filter(Boolean)}]:[],{title:"Next steps",body:[{list:{items:[`Run \`${y} upgrade\` or \`${y} upgrade --version ${m[0]?.version??"<version>"}\``,"Read release notes at https://hydrogen.shopify.dev/releases"]}}]}]})}catch(t){let r=t;Y({headline:r.message,body:r.tryMessage??void 0})}}l();l();import Ic from"node:net";import Oc from"node:os";var Hr=class extends Error{constructor(t){super(`${t} is locked`)}},mt={old:new Set,young:new Set},_c=1e3*15,Nr=1024,Lr=65535,Rt,Rc=()=>{let e=Oc.networkInterfaces(),t=new Set([void 0,"0.0.0.0"]);for(let r of Object.values(e))for(let o of r)t.add(o.address);return t},Ns=e=>new Promise((t,r)=>{let o=Ic.createServer();o.unref(),o.on("error",r),o.listen(e,()=>{let{port:n}=o.address();o.close(()=>{t(n)})})}),Ls=async(e,t)=>{if(e.host||e.port===0)return Ns(e);for(let r of t)try{await Ns({port:e.port,host:r})}catch(o){if(!["EADDRNOTAVAIL","EINVAL"].includes(o.code))throw o}return e.port},$c=function*(e){e&&(yield*e),yield 0};async function Mo(e){let t,r=new Set;if(e&&(e.port&&(t=typeof e.port=="number"?[e.port]:e.port),e.exclude)){let n=e.exclude;if(typeof n[Symbol.iterator]!="function")throw new TypeError("The `exclude` option must be an iterable.");for(let i of n){if(typeof i!="number")throw new TypeError("Each item in the `exclude` option must be a number corresponding to the port you want excluded.");if(!Number.isSafeInteger(i))throw new TypeError(`Number ${i} in the exclude option is not a safe integer and can't be used`)}r=new Set(n)}Rt===void 0&&(Rt=setTimeout(()=>{Rt=void 0,mt.old=mt.young,mt.young=new Set},_c),Rt.unref&&Rt.unref());let o=Rc();for(let n of $c(t))try{if(r.has(n))continue;let i=await Ls({...e,port:n},o);for(;mt.old.has(i)||mt.young.has(i);){if(n!==0)throw new Hr(n);i=await Ls({...e,port:n},o)}return mt.young.add(i),i}catch(i){if(!["EADDRINUSE","EACCES"].includes(i.code)&&!(i instanceof Hr))throw i}throw new Error("No available ports found")}function Hs(e,t){if(!Number.isInteger(e)||!Number.isInteger(t))throw new TypeError("`from` and `to` must be integer numbers");if(e<Nr||e>Lr)throw new RangeError(`'from' must be between ${Nr} and ${Lr}`);if(t<Nr||t>Lr)throw new RangeError(`'to' must be between ${Nr} and ${Lr}`);if(e>t)throw new RangeError("`to` must be greater than or equal to `from`");return function*(o,n){for(let i=o;i<=n;i++)yield i}(e,t)}function pt(e,t=100){return Mo({port:Hs(e,e+t)})}l();var Uo=new Set,Bo;function Ms({disableDepsOptimizer:e,showSuccessBanner:t,configFile:r,formatOptionsPromise:o}){return async function({optimizableDependency:i,stack:s}){let a=s.split(`
178
+ `)[0]??s,c=s.split(`
179
+ `).filter(u=>!u.includes("virtual:remix")).join(`
180
+ `),d="MiniOxygen encountered an error while running your app's entry point";if(i)if(e||!r){let u=new Wt(`${d}:
181
+
182
+ ${H.dim(a)}`,`Try adding '${H.yellow(i)}' to your Vite config in ssr.optimizeDeps.include`);u.stack=c,Re(u)}else Uo.has(i)||(Uo.add(i),setTimeout(()=>Uo.delete(i),2e3),Fc(i,r,await o,c).then(()=>{setTimeout(()=>{F(`
183
+ Added '${H.yellow(i)}' to your Vite config in ssr.optimizeDeps.include
184
+ `)},200),clearTimeout(Bo),Bo=setTimeout(t,2e3)}).catch(u=>{clearTimeout(Bo),Re(u)}));else{let u=new Wt(d+`:
185
+
186
+ `+H.dim(a));u.stack=c,Re(u)}}}var Ac={rule:{pattern:"[$$$]",inside:{kind:"pair",stopBy:"end",has:{field:"key",regex:"include",stopBy:"end"},inside:{kind:"pair",stopBy:"end",has:{field:"key",regex:"optimizeDeps",stopBy:"end"},inside:{kind:"pair",stopBy:"end",has:{field:"key",regex:"ssr",stopBy:"end"}}}}}};async function Fc(e,t,r,o){let n=fn(t).replace(/^\.m?/,""),i=await Qt(n);await je(t,r,s=>{let c=i.parse(s).root().find(Ac);if(!c)throw new E(`The dependency '${H.yellow(e)}' needs to be optimized by Vite, but couldn't be added to the Vite config.`,`Add the following code manually to your Vite config:
187
+
188
+ `+H.yellow(`ssr: {optimizeDeps: {include: ['${e}']}}`));if(!!c.find({rule:{kind:"string_fragment",regex:`^${e}$`}})){let f=new Wt(`A dependency related to '${H.yellow(e)}' might need to be optimized by Vite but couldn't be configured automatically:
189
+
190
+ ${H.dim(o.split(`
191
+ `)[0])}`,"If your app doesn't load, check the following stack trace and try fixing the problem by adding the imported dependency to the `ssr.optimizeDeps.include` array in your Vite config file.");throw f.stack=o,f}let{start:u}=c.range();return s.slice(0,u.index+1)+`'${e}',`+s.slice(u.index+1)})}var Mr=class e extends O{static descriptionWithMarkdown=`Runs a Hydrogen storefront in a local runtime that emulates an Oxygen worker for development.
192
+
193
+ If your project is [linked](https://shopify.dev/docs/api/shopify-cli/hydrogen/hydrogen-link) to a Hydrogen storefront, then its environment variables will be loaded with the runtime.`;static description="Runs Hydrogen storefront in an Oxygen worker for development.";static flags={...k.path,...k.entry,...ve(k.port,{port:{default:void 0,required:!1}}),...k.codegen,"disable-virtual-routes":$t.Flags.boolean({description:"Disable rendering fallback routes when a route file doesn't exist.",env:"SHOPIFY_HYDROGEN_FLAG_DISABLE_VIRTUAL_ROUTES",default:!1}),...k.debug,...k.inspectorPort,...k.env,...k.envBranch,...k.envFile,"disable-version-check":$t.Flags.boolean({description:"Skip the version check when running `hydrogen dev`",default:!1,required:!1}),...k.customerAccountPush,...k.verbose,host:$t.Flags.boolean({description:"Expose the server to the local network",default:!1,required:!1}),"disable-deps-optimizer":$t.Flags.boolean({description:"Disable adding dependencies to Vite's `ssr.optimizeDeps.include` automatically",env:"SHOPIFY_HYDROGEN_FLAG_DISABLE_DEPS_OPTIMIZER",default:!1})};async run(){let{flags:t}=await this.parse(e),r=t.path?T(t.path):process.cwd(),o={...U(t),customerAccountPush:t["customer-account-push"],path:r,cliConfig:this.config};if(!await er(r))throw new E(Pe);let{close:i}=await jc(o);He(async()=>{await i()})}};async function jc({entry:e,port:t,path:r,host:o,codegen:n=!1,codegenConfigPath:i,disableVirtualRoutes:s,disableDepsOptimizer:a=!1,envBranch:c,env:d,debug:u=!1,disableVersionCheck:f=!1,inspectorPort:m,customerAccountPush:p=!1,envFile:h,cliConfig:y,verbose:b}){process.env.NODE_ENV||(process.env.NODE_ENV="development"),b&&rr(),or()||it(),t===0&&(t=await pt(tt));let w=r??process.cwd(),g=z(w),v=Ei(w,p,h),S=v.then(({fetchRemote:J,localVariables:me})=>hr({root:w,envBranch:c,envHandle:d,fetchRemote:J,localVariables:me,envFile:h}));u&&!m&&(m=await pt(Wn));let P=await Zt(w);Se&&await ke(x(w,"node_modules/.vite"));let C=Promise.resolve().then(()=>et(w)),D=await P.createServer({root:w,clearScreen:!1,cacheDir:process.env.SHOPIFY_UNIT_TEST?x(w,".vite"):void 0,customLogger:process.env.SHOPIFY_UNIT_TEST?Object.assign(P.createLogger(),{info:J=>Ae("info",J),warn:J=>Ae("warn",J),error:J=>Ae("error",J)}):void 0,server:{port:t??tt,host:o?!0:void 0,fs:Se?{allow:[w,Se]}:void 0},plugins:[{name:"hydrogen:cli",configResolved(J){Do(J)?.api?.registerPluginOptions({disableVirtualRoutes:s}),Kn(J)?.api?.registerPluginOptions({debug:u,entry:e,envPromise:S.then(({allVariables:me})=>me),inspectorPort:m,logRequestLine:wi,entryPointErrorHandler:Ms({disableDepsOptimizer:a,configFile:J.configFile,formatOptionsPromise:C,showSuccessBanner:()=>Us({disableVirtualRoutes:s,debug:u,inspectorPort:m,finalHost:_e,storefrontTitle:Be})})})},configureServer:J=>{p&&J.middlewares.use((me,Mt,uo)=>{let Ve=me.headers.host;Ve?.includes(gr.ORIGINAL)&&(me.headers.host=Ve.replace(gr.ORIGINAL,gr.REBRANDED)),uo()})}}]});if(!Do(D.config))throw await D.close(),new E("Hydrogen plugin not found.","Add `hydrogen()` plugin to your Vite config.");let $=(await he(w)).remixConfig,I,_=n?()=>{I?.kill(0),I=Sr({rootDirectory:w,configFilePath:i,appDirectory:$?.appDirectory})}:void 0;_?.(),Se&&Nc(D,Se,_);let L=t??D.config.server.port??tt,[j,ne]=await Promise.all([v.then(({customerAccountPush:J,storefrontId:me})=>J?Si(w,y,L,me):void 0),g,D.listen(L)]),le=new URL(D.resolvedUrls.local[0]??D.resolvedUrls.network[0]),_e=j?.host||le.toString()||le.origin;si({rootDirectory:w,host:_e,cliCommand:ne});let{logInjectedVariables:Lt,allVariables:Ht}=await S;Lt(),console.log(""),D.printUrls(),D.bindCLIShortcuts({print:!0}),console.log(`
194
+ `);let Be=(await v).storefrontTitle;return Us({disableVirtualRoutes:s,debug:u,inspectorPort:m,finalHost:_e,storefrontTitle:Be}),f||js({targetPath:w}),p&&bi(Ht)&&ki(ne),{getUrl:()=>_e,async close(){I?.removeAllListeners("close"),I?.kill("SIGINT"),await Promise.allSettled([D.close(),j?.cleanup?.()]),D.watcher.close()}}}function Us({disableVirtualRoutes:e,debug:t,inspectorPort:r,finalHost:o,storefrontTitle:n}){let i=[];e||i.push({body:Pi(o)}),t&&r&&i.push({body:{warn:xi(r)}}),N({body:[`View ${n?H.cyan(n):"Hydrogen"} app:`,{link:{url:o}}],customSections:i})}function Nc(e,t,r){e.httpServer?.once("listening",()=>{e.watcher.add(t+"hydrogen/dist/vite/plugin.js"),e.watcher.add(t+"mini-oxygen/dist/vite/plugin.js"),e.watcher.add(t+"mini-oxygen/dist/vite/worker-entry.js"),e.watcher.add(t+"hydrogen-codegen/dist/esm/index.js");let o;e.watcher.on("change",async n=>{n.includes(t)&&(n.includes("/packages/hydrogen-codegen/")?r&&(r(),B({headline:"The Hydrogen Codegen source has been modified.",body:"The codegen process has been restarted."})):(await e.restart(!0),clearTimeout(o),o=setTimeout(()=>{console.log(""),B({headline:"The H2O Vite plugins have been modified.",body:"The Vite server has been restarted to reflect the changes."})},100)))})})}l();var Ur=class e extends O{static descriptionWithMarkdown="Lists all environments available on the linked Hydrogen storefront.";static description="List the environments on your linked Hydrogen storefront.";static flags={...k.path};async run(){let{flags:t}=await this.parse(e);await Lc(t)}};async function Lc({path:e=process.cwd()}){let[{session:t,config:r},o]=await Promise.all([ge(e),z()]),n=await Me({root:e,session:t,config:r,cliCommand:o});if(!n)return;r.storefront=n;let i=await lt(t,r.storefront.id);if(!i){ft({session:t,storefront:r.storefront,cliCommand:o});return}let s=i.environments.findIndex(c=>c.type==="PREVIEW"),a=i.environments.splice(s,1);i.environments.push(a[0]),F(Hc({environments:i.environments,storefrontTitle:r.storefront.title}).toString()),i.environments.forEach(({name:c,handle:d,branch:u,type:f,url:m})=>{te();let p=f==="PRODUCTION"?i.productionUrl:m;F(W`${ze(c,d,u)}`.value),p&&F(W` ${p}`.value)}),te()}var Hc=({environments:e,storefrontTitle:t})=>Ut(e,r=>`Showing ${r.length} environments for the Hydrogen storefront ${t}`,r=>`Showing 1 environment for the Hydrogen storefront ${t}`,()=>`There are no environments for the Hydrogen storefront ${t}`);l();function Mc(e){return/[{}@#\s"'\\$`|;&<>()!?*\[\]]/.test(e)||/[\x00-\x1F\x7F]/.test(e)}function Uc(e){return Mc(e)?`"${e.replaceAll("\\","\\\\").replaceAll('"','\\"').replaceAll(`
195
+ `,"\\n").replaceAll("\r","\\r").replaceAll(" ","\\t")}"`:e}var Br=class e extends O{static descriptionWithMarkdown="Pulls environment variables from the linked Hydrogen storefront and writes them to an `.env` file.";static description="Populate your .env with variables from your Hydrogen storefront.";static flags={...k.env,...k.envBranch,...k.envFile,...k.path,...k.force};async run(){let{flags:t}=await this.parse(e);await Bc({...U(t)})}};async function Bc({env:e,envBranch:t,path:r=process.cwd(),envFile:o,force:n}){let[{session:i,config:s},a]=await Promise.all([ge(r),z()]),c=await Me({root:r,session:i,config:s,cliCommand:a});if(!c)return;if(s.storefront=c,e||t){let y=(await lt(i,s.storefront.id))?.environments||[];e?at(y,e):t&&(e=Pt(y,t).handle)}let d=await pr(i,s.storefront.id,e);if(!d){ft({session:i,storefront:s.storefront,cliCommand:a});return}if(!d.environmentVariables.length){F("No environment variables found.");return}let u=d.environmentVariables;if(!u.length)return;let f=H.whiteBright(o),m=T(r,o),p={};if(u.forEach(({isSecret:y,key:b,value:w})=>{p[b]=y?'""':Uc(w)}),await G(m)&&!n){let y=await de(m),b=Io(y,p);if(y===b){B({body:`No changes to your ${f} file`});return}let w=yr(y,b);if(!await Te({confirmationMessage:"Yes, confirm changes",cancellationMessage:"No, make changes later",message:W`We'll make the following changes to your ${f} file:
196
+
197
+ ${we.linesDiff(w)}
198
+ Continue?`.value}))return;await K(m,b)}else{let y=Io(null,p);await K(m,y)}u.some(({isSecret:y})=>y)&&Y({body:`${s.storefront.title} contains environment variables marked as secret, so their values weren\u2019t pulled.`}),N({body:["Changes have been made to your",{filePath:f},"file"]})}l();var Vo=Q(ue(),1);l();var Vc=`#graphql
199
+ mutation PushVariables(
200
+ $storefrontId: ID!,
201
+ $environmentId: ID!,
202
+ $environmentVariablesInput: [HydrogenStorefrontEnvironmentVariableInput!]!,
203
+ ) {
204
+ hydrogenStorefrontEnvironmentVariableBulkReplace(
205
+ storefrontId: $storefrontId,
206
+ environmentId: $environmentId,
207
+ environmentVariablesInput: $environmentVariablesInput,
208
+ ) {
209
+ userErrors {
210
+ code
211
+ message
212
+ }
213
+ }
214
+ }
215
+ `;async function Bs(e,t,r,o){let{hydrogenStorefrontEnvironmentVariableBulkReplace:n}=await ot(Vc,e,{storefrontId:t,environmentId:r,environmentVariablesInput:o}),{userErrors:i}=n;return{userErrors:i}}var Vr=class e extends O{static description="Push environment variables from the local .env file to your linked Hydrogen storefront.";static flags={...k.env,...k.envFile,...k.path,force:Vo.Flags.boolean({char:"f",description:"Push environment variable changes without confirmation.",env:"SHOPIFY_HYDROGEN_FLAG_FORCE"}),"dry-run":Vo.Flags.boolean({description:"Preview environment variable changes without pushing them.",env:"SHOPIFY_HYDROGEN_FLAG_DRY_RUN",exclusive:["force"]})};async run(){let{flags:t}=await this.parse(e);await Gc({...U(t)})}};async function Gc({dryRun:e=!1,env:t,envFile:r,force:o=!1,path:n=process.cwd()}){let i,s=T(n,r),{variables:a}=await fr(s),[{session:c,config:d},u]=await Promise.all([ge(n),z()]),f=await Me({root:n,session:c,config:d,cliCommand:u});if(!f)return;d.storefront=f;let{environments:m}=await lt(c,d.storefront.id)??{};if(!m)throw new E("Failed to fetch environments");let p=mr(m);if(p.length===0)throw new E("No environments found");if(t)i=at(p,t);else{let P=[...p.map(({id:D,name:R,branch:$,handle:I})=>({label:ze(R,I,$),value:D}))],C=await $e({message:"Select an environment to overwrite its environment variables:",choices:P});i=p.find(({id:D})=>D===C)}let{environmentVariables:h=[]}=await pr(c,d.storefront.id,i.handle)??{},b=h.filter(({isSecret:P,readOnly:C})=>!P&&!C).sort((P,C)=>P.key.localeCompare(C.key)).map(({key:P,value:C})=>Oo(P,C)).join(`
216
+ `)+`
217
+ `,w=Object.keys(a).sort((P,C)=>P.localeCompare(C)).reduce((P,C)=>{let{isSecret:D,readOnly:R}=h.find($=>$.key===C)??{};return D||R?P:[...P,Oo(C,a[C])]},[]).join(`
218
+ `)+`
219
+ `;if(!i.name)throw new E("Missing environment name");let g=h.reduce((P,{isSecret:C,readOnly:D,key:R})=>{if(!C&&!D)return P;let $=a[R],I=h.find(_=>_.key===R);return $===I?.value?P:[...P,R]},[]);if(g.length&&V(`Variables that are read only or contain secret values cannot be pushed from the CLI: ${g.join(", ")}.
220
+ `),w===b){B({body:"No changes to your environment variables."});return}let v=yr(b,w);if(e){B({body:W`The following changes would be made to your environment variables for ${i.name}:
221
+
222
+ ${we.linesDiff(v)}
223
+ No changes were pushed because --dry-run was used.`.value});return}if(!o&&!await Te({confirmationMessage:"Yes, confirm changes",cancellationMessage:"No, make changes later",message:W`We'll make the following changes to your environment variables for ${i.name}:
224
+
225
+ ${we.linesDiff(v)}
226
+ Continue?`.value}))return;if(!i.id)throw new E("Missing environment ID");let{userErrors:S}=await Bs(c,d.storefront.id,i.id,Object.entries(a).map(([P,C])=>({key:P,value:C})));if(S.length)throw new E("Failed to upload and save environment variables.",S[0]?.message);N({body:`Environment variables push to ${i.name??"Preview"} was successful.`})}l();l();var ht=Q(ue(),1);var Oe=class e extends O{static descriptionWithMarkdown="Generates a set of default routes from the starter template.";static description="Generates a standard Shopify route.";static flags={adapter:ht.Flags.string({description:"React Router adapter used in the route. The default is `react-router`.",env:"SHOPIFY_HYDROGEN_FLAG_ADAPTER"}),typescript:ht.Flags.boolean({description:"Generate TypeScript files",env:"SHOPIFY_HYDROGEN_FLAG_TYPESCRIPT"}),"locale-param":ht.Flags.string({description:"The param name in Remix routes for the i18n locale, if any. Example: `locale` becomes ($locale).",env:"SHOPIFY_HYDROGEN_FLAG_ADAPTER"}),...k.force,...k.path};static hidden;static args={routeName:ht.Args.string({name:"routeName",description:`The route to generate. One of ${Co.join()}.`,required:!0,options:Co,env:"SHOPIFY_HYDROGEN_ARG_ROUTE"})};async run(){let{flags:t,args:{routeName:r}}=await this.parse(e),o=t.path?T(t.path):process.cwd();await qc({...t,directory:o,routeName:r,localePrefix:t["locale-param"]})}};async function qc(e){let{routes:t}=await di({...e,v1RouteConvention:ci()}),r=3+t.reduce((n,i)=>Math.max(n,i.destinationRoute.length),0),o=t.filter(({operation:n})=>n!=="skipped").length;N({headline:`${o} of ${t.length} route${t.length>1?"s":""} generated`,body:{list:{items:t.map(({operation:n,destinationRoute:i})=>i.padEnd(r)+H.dim(`[${n}]`))}}})}var Gr=class extends O{static description="Shortcut for `hydrogen generate`. See `hydrogen generate --help` for more information.";static strict=!1;static hidden=!0;async run(){let[t,...r]=this.argv;if(t==="r"||t==="route")return new Oe(r,this.config).run();throw new Error(`Invalid command argument "${t}".`)}};l();var qr=class e extends O{static description="Generates all supported standard shopify routes.";static hidden;static flags=Oe.flags;async run(){let{flags:t}=await this.parse(e);await Oe.run(["all",...Object.entries(t).map(([r,o])=>o===!0?`--${r}`:`--${r}=${o}`)])}};l();var Ue=Q(ue(),1);l();import{fileURLToPath as Yc}from"node:url";var At={cli:"@shopify/cli",cliHydrogen:"@shopify/cli-hydrogen",createApp:"@shopify/create-hydrogen"};async function Vs(){if(Ie&&!process.env.SHOPIFY_UNIT_TEST)return;let{content:e}=await Pn(Yc(import.meta.url)).catch(()=>({content:void 0})),t=e?.name,r=e?.version;if(!t||!r||!Object.values(At).some(i=>i===t)||r.includes("next")||r.includes("experimental")||r.includes("snapshot"))return;let o=await Sn(t,r);if(!o)return;let n=[{link:{label:"Hydrogen releases",url:"https://github.com/Shopify/hydrogen/releases"}}];return t===At.cli&&n.push({link:{label:"Global CLI reference",url:"https://shopify.dev/docs/api/shopify-cli/"}}),i=>{i??=kn(),(i==="unknown"||!i)&&(i=bn()),i==="unknown"&&(i="npm");let s=t===At.cli?`Please install the latest Shopify CLI version with \`${i==="yarn"?`yarn global add ${At.cli}`:`${i} install -g ${At.cli}`}\` and try again.`:`Please use the latest version with \`${i} create @shopify/hydrogen@latest\``;return B({headline:"Upgrade available",body:`Version ${o} of ${t} is now available.
227
+ You are currently running v${r}.
228
+
229
+ `+s,reference:n}),{currentVersion:r,newVersion:o}}}l();l();import{cp as Wc}from"node:fs/promises";async function Gs(e,t){let r=e.mockShop?"mock":await $e({message:"Connect to Shopify",choices:[{label:"Use sample data from mock.shop (You can connect a Shopify account later)",value:"mock"},{label:"Link your Shopify account",value:"link"}],defaultValue:"mock",abortSignal:t.signal}),o=r==="link"?await mi(t):void 0,n=await ar({...e,storefrontInfo:o,controller:t});if(!n)return;r==="mock"&&(n.storefrontTitle="Mock.shop");let i=ur(t,n),s=o&&!o.id&&ri(o.session,o.title).then(async({storefront:I,jobId:_})=>(_&&await oi(o.session,_),I)).catch(i),a=await Un(),c=Wc(a,n.directory,{force:!0,recursive:!0,filter:I=>!/^(app(\/|$)|dist(\/|$)|node_modules(\/|$)|server\.ts$|\.shopify(\/|$))/i.test(se(a,I))}).then(()=>ir({rootDirectory:n.directory,appDirectory:x(n.directory,"app"),typescript:!0})).catch(i),d={create:"Creating storefront",setup:`Setting up ${e.quickstart?"Quickstart ":""}project`,install:"Installing dependencies. This could take a few minutes"},u=[{title:d.create,task:async()=>{await s}},{title:d.setup,task:async()=>{await c}}],f=await z(),m=`# The variables added in this file are only available locally in MiniOxygen.
230
+ # Run \`${f} link\` to also inject environment variables from your storefront,
231
+ # or \`${f} env pull\` to populate this file.`;c=c.then(()=>{let I=[je(x(n.directory,"package.json"),!1,L=>(L=zc(L),L.replace(/"name": "[^"]+"/,`"name": "${pn(o?.title??n.name)}"`)))],_;return o?(I.push(Zn(n.directory,o),K(x(n.directory,".env"),m)),o.id?_={id:o.id,title:o.title}:s&&I.push(s.then(L=>{_=L}))):r==="mock"&&I.push(K(x(n.directory,".env"),m+`
232
+ `+[["SESSION_SECRET","foobar"]].map(([L,j])=>`${L}="${j}"`).join(`
233
+ `)+`
234
+ `)),Promise.all(I).then(()=>{if(_)return ei(n.directory,_)}).catch(i)});let{language:p,transpileProject:h}=await lr(n.directory,t,e.language);c=c.then(()=>h().catch(i)).then(()=>e.git?dr(n.directory):void 0);let{setupCss:y,cssStrategy:b}=await pi(n.directory,t,e.styling);b&&(c=c.then(()=>y().catch(i)).then(()=>e.git?We(n.directory,"Setup "+xt[b]):void 0));let{packageManager:w,shouldInstallDeps:g,installDeps:v}=await cr(n.directory,t,e.packageManager,e.installDeps),S={language:p,packageManager:w,cssStrategy:b,depsInstalled:!1,cliCommand:await z("",w)};if(g){let I=c.then(async()=>{try{if(await v(),S.depsInstalled=!0,p==="ts")try{await Et("npx react-router typegen",{cwd:n.directory})}catch{V("Failed to generate React Router types. You may need to run `npx react-router typegen` manually.")}}catch(_){S.depsError=_}});u.push({title:d.install,task:async()=>{await I}})}let{createShortcut:P,showShortcutBanner:C}=await sr(t,S.cliCommand,e.shortcut);P&&(c=c.then(async()=>{await P()&&(S.cliCommand=Ye)}),C()),e.quickstart?console.log(`
235
+ `):N({headline:[{userInput:o?.title??n.name},"is ready to build."]});let{i18nStrategy:D,setupI18n:R}=await fi(t,S.cliCommand,e.i18n),{setupRoutes:$}=nr(t);return S.i18n=D,c=c.then(async()=>{await R({rootDirectory:n.directory,contextCreate:p==="ts"?"app/lib/context.ts":"app/lib/context.js"}).then(()=>e.git?We(n.directory,`Setup markets support using ${D}`):void 0).catch(I=>{S.i18nError=I}),await $(n.directory,p,{i18nStrategy:D,overwriteFileDeps:!1}).then(async I=>{if(S.routes=I,p==="ts"&&S.depsInstalled)try{await Et("npx react-router typegen",{cwd:n.directory})}catch{V("Failed to generate React Router types after route generation. You may need to run `npx react-router typegen` manually.")}if(e.git&&I)return We(n.directory,"Generate routes for core functionality")}).catch(I=>{S.routesError=I})}),await ee(u),e.git&&await We(n.directory,"Lockfile"),await st(n,S),{...n,...S}}function zc(e){let t=e.match(/^\s+"@shopify\/hydrogen":\s+"[^"]+",\n/m)?.[0];if(t&&/"0\.0\.0-\w+-/.test(t)){let r=t.replace("hydrogen","cli-hydrogen");e=e.replace(t,r+t)}return e}l();import{readdir as Ga}from"node:fs/promises";l();var Ha=Q(wa(),1),Ma=Q(La(),1);import Xe from"node:path";import{pipeline as Nd}from"stream/promises";var Ld="https://api.github.com/repos/shopify/hydrogen/releases/latest",Ua=e=>e===403?"If you are using a VPN, WARP, or similar service, consider disabling it momentarily.":void 0;async function Hd(e){let t=await ae(Ld,{signal:e});if(!t.ok||t.status>=400)throw new E(`Failed to fetch the latest release information. Status ${t.status} ${t.statusText.replace(/\.$/,"")}.`,Ua(t.status));let r=await t.json();return{version:r.name.split("/").pop()??r.name,url:r.tarball_url}}async function Md(e,t,r){let o=await ae(e,{signal:r});if(!o.ok||o.status>=400)throw new E(`Failed to download the latest release files. Status ${o.status} ${o.statusText}}`,Ua(o.status));await Nd(o.body,(0,Ha.default)(),(0,Ma.extract)(t,{strip:1,filter:n=>(n=n.replace(t,""),!n.startsWith(Xe.normalize("/templates/"))&&!n.startsWith(Xe.normalize("/examples/")))}))}async function Ba({signal:e}={}){if(Ie&&process.env.FORCE_TEMPLATES_SOURCE!=="remote"){let t=Xe.dirname(Bn());return{version:"local",templatesDir:t,examplesDir:Xe.resolve(t,"..","examples")}}try{let{version:t,url:r}=await Hd(e),o=await Ge("internal-templates");await G(o)||await bt(o);let n=Xe.join(o,t);return await G(n)||await Md(r,n,e),{version:t,templatesDir:Xe.join(n,"templates"),examplesDir:Xe.join(n,"examples")}}catch(t){let r=t;throw new E(`Could not download Hydrogen templates from GitHub.
236
+ Please check your internet connection and the following error:
237
+
238
+ `+r.message,r.tryMessage)}}async function Va(e,t){let r=Di(e);if(r.isErr())throw new E(r.error.message);let o=await Ge("external-templates");await G(o)||await bt(o);let n=r.value,i=x(o,n.full.replace(/^https?:\/\//,"").replace(/[^\w]+/,"_"));return await G(i)&&await yo(i,{force:!0}),await $n({repoUrl:n.full,destination:i,shallow:!0}),await yo(x(i,".git"),{force:!0}),{templateDir:i}}var qa="shopify/hydrogen-demo-store";async function Ya(e,t){let r=e.template==="demo-store"?qa:e.template,o=await ar({...e,controller:t});if(!o)return;let n=ur(t,o),i=r.includes("/")?Ud(r,t.signal).catch(n):Bd(r,t.signal).catch(n),s=await i;if(t.signal.aborted)return;let a=Promise.resolve().then(async()=>{if(t.signal.aborted)return;let{sourcePath:b}=s;await Bt(b,o.directory)}).catch(n),c=await G(x(s.sourcePath,"tsconfig.json")),{language:d,transpileProject:u}=c?await lr(o.directory,t,e.language):{language:"js",transpileProject:()=>Promise.resolve()};a=a.then(()=>u().catch(n)).then(()=>e.git?dr(o.directory):void 0);let{packageManager:f,shouldInstallDeps:m,installDeps:p}=await cr(o.directory,t,e.packageManager,e.installDeps),h={language:d,packageManager:f,depsInstalled:!1,cliCommand:await z("",f)},y=[{title:"Downloading template",task:async()=>{await i}},{title:"Setting up project",task:async()=>{await a}}];if(m&&y.push({title:"Installing dependencies. This could take a few minutes",task:async()=>{try{await p(),h.depsInstalled=!0}catch(b){h.depsError=b}}}),!t.signal.aborted)return await ee(y),e.git&&await We(o.directory,"Lockfile"),await st(o,h),B({headline:`Your project will display inventory from ${e.template.endsWith(qa)?"the Hydrogen Demo Store":"Mock.shop"}.`,body:`To connect this project to your Shopify store\u2019s inventory, update \`${o.name}/.env\` with your store ID and Storefront API key.`}),{...o,...h}}async function Ud(e,t){let{templateDir:r}=await Va(e,t);return{sourcePath:r}}async function Bd(e,t){let{templatesDir:r,examplesDir:o}=await Ba({signal:t}),n=x(r,"skeleton"),i=x(r,e),s=x(o,e);if(await G(i))return{skeletonPath:n,sourcePath:i};if(await G(s))return{skeletonPath:n,sourcePath:s};let a=(await Promise.all([Ga(o),Ga(r)]).catch(()=>[])).flat().filter(c=>c!=="skeleton"&&!c.endsWith(".md")).concat("demo-store").sort();throw new E(`Unknown value in \`--template\` flag "${e}".
239
+ Skip the flag or provide the name of a template or example in the Hydrogen repository or a URL to a git repository.`,a.length===0?"":{list:{title:"Available templates:",items:a}})}async function Wa(e){let t=new qt;try{let r=e.template;return r?await Ya({...e,template:r},t):await Gs(e,t)}catch(r){throw t.abort(),r}}var Vd={f:"force"},Xr=class e extends O{static descriptionWithMarkdown="Creates a new Hydrogen storefront.";static description="Creates a new Hydrogen storefront.";static flags={...k.force,path:Ue.Flags.string({description:"The path to the directory of the new Hydrogen storefront.",env:"SHOPIFY_HYDROGEN_FLAG_PATH"}),language:Ue.Flags.string({description:"Sets the template language to use. One of `js` or `ts`.",choices:Object.keys(ui),env:"SHOPIFY_HYDROGEN_FLAG_LANGUAGE"}),template:Ue.Flags.string({description:"Scaffolds project based on an existing template or example from the Hydrogen repository.",env:"SHOPIFY_HYDROGEN_FLAG_TEMPLATE"}),...k.installDeps,"mock-shop":Ue.Flags.boolean({description:"Use mock.shop as the data source for the storefront.",env:"SHOPIFY_HYDROGEN_FLAG_MOCK_DATA"}),...k.styling,...k.markets,...k.shortcut,git:Ue.Flags.boolean({description:"Init Git and create initial commits.",env:"SHOPIFY_HYDROGEN_FLAG_GIT",default:!0,allowNo:!0}),quickstart:Ue.Flags.boolean({description:"Scaffolds a new Hydrogen project with a set of sensible defaults. Equivalent to `shopify hydrogen init --path hydrogen-quickstart --mock-shop --language js --shortcut --markets none`",env:"SHOPIFY_HYDROGEN_FLAG_QUICKSTART",default:!1}),"package-manager":Ue.Flags.string({env:"SHOPIFY_HYDROGEN_FLAG_PACKAGE_MANAGER",hidden:!0,options:["npm","yarn","pnpm","unknown"]})};async run(){let{flags:t}=await this.parse(e);await Gd(U(t))}};async function Gd({markets:e,...t}=zn(process.argv,Vd)){if(Hn(),!t.i18n&&e&&(t.i18n=e),t.i18n&&!Po.includes(t.i18n))throw new E(`Invalid URL structure strategy: ${t.i18n}. Must be one of ${Po.join(", ")}`);if(t.styling&&!Eo.includes(t.styling))throw new E(`Invalid styling strategy: ${t.styling}. Must be one of ${Eo.join(", ")}`);t.git??=!0,t.quickstart&&(t.i18n??="none",t.installDeps??=!0,t.language??="js",t.mockShop??=!0,t.path??="./hydrogen-quickstart",t.shortcut??=!0,t.styling??="none");let r=await Vs();return r&&r(t.packageManager),Wa(t)}l();l();var qd=`#graphql
240
+ query ListStorefronts {
241
+ hydrogenStorefronts {
242
+ id
243
+ title
244
+ productionUrl
245
+ currentProductionDeployment {
246
+ id
247
+ createdAt
248
+ commitMessage
249
+ }
250
+ }
251
+ }
252
+ `;async function za(e){let{hydrogenStorefronts:t}=await ot(qd,e);return t.map(r=>({...r,parsedId:nt(r.id)}))}var Zr=class e extends O{static descriptionWithMarkdown="Lists all remote Hydrogen storefronts available to link to your local development environment.";static description="Returns a list of Hydrogen storefronts available on a given shop.";static flags={...k.path};async run(){let{flags:t}=await this.parse(e);await Yd(t)}};async function Yd({path:e=process.cwd()}){let{session:t}=await ge(e),r=await za(t);r.length>0?(te(),F(Jd({storefronts:r,shop:t.storeFqdn}).toString()),r.forEach(({currentProductionDeployment:o,id:n,productionUrl:i,title:s})=>{te(),F(W`${H.whiteBright(s)} ${H.dim(`(id: ${nt(n)})`)}`.value),i&&F(W` ${H.whiteBright(i)}`.value),o&&F(W` ${H.dim(zd(o))}`.value)})):B({headline:"Hydrogen storefronts",body:"There are no Hydrogen storefronts on your Shop.",nextSteps:[`Ensure you are logged in to the correct shop (currently: ${t.storeFqdn})`,`Create a new Hydrogen storefront: Run \`${await z(e)} link\` or visit ${bs(t)}`]})}var Wd=new Intl.DateTimeFormat("default",{year:"numeric",month:"numeric",day:"numeric"});function zd(e){let t="";if(!e)return t;if(t+=Wd.format(new Date(e.createdAt)),e.commitMessage){let r=e.commitMessage.split(/\n/)[0];t+=`, ${r}`}return t}var Jd=({storefronts:e,shop:t})=>Ut(e,r=>`Showing ${r.length} Hydrogen storefronts for the store ${t}`,r=>`Showing 1 Hydrogen storefront for the store ${t}`);l();var eo=class e extends O{static descriptionWithMarkdown="Logs in to the specified shop and saves the shop domain to the project.";static description="Login to your Shopify account.";static flags={...k.path,...k.shop};async run(){let{flags:t}=await this.parse(e);await Qd(t)}};async function Qd({path:e=process.cwd(),shop:t}){te(),ii(!0);let{config:r}=await ge(e,t??!0);li(r)}l();var to=class e extends O{static descriptionWithMarkdown="Log out from the current shop.";static description="Logout of your local session.";static flags={...k.path};async run(){let{flags:t}=await this.parse(e);await Kd(t)}};async function Kd({path:e=process.cwd()}){te(),await ai(e),N({body:"You are logged out from Shopify."})}l();var rn=Q(ue(),1);l();async function Ja(e){let{startWorkerdServer:t}=await import("./workerd-N25GY5MX.js");return t(e)}var ro=class e extends O{static descriptionWithMarkdown="Runs a server in your local development environment that serves your Hydrogen app's production build. Requires running the [build](https://shopify.dev/docs/api/shopify-cli/hydrogen/hydrogen-build) command first.";static description="Runs a Hydrogen storefront in an Oxygen worker for production.";static flags={...k.path,...k.port,...k.env,...k.envBranch,...k.envFile,...k.inspectorPort,...k.debug,...k.verbose,build:rn.Flags.boolean({description:"Builds the app before starting the preview server."}),watch:rn.Flags.boolean({description:"Watches for changes and rebuilds the project.",dependsOn:["build"]}),...ve(k.entry,{entry:{dependsOn:["build"]}}),...ve(k.codegen,{codegen:{dependsOn:["build"]}})};async run(){let{flags:t}=await this.parse(e),r=t.path?T(t.path):process.cwd(),{close:o}=await Xd({...U(t),directory:r});He(async()=>{await o()})}};async function Xd({port:e,directory:t,env:r,envBranch:o,inspectorPort:n,debug:i,verbose:s,build:a=!1,watch:c=!1,codegen:d=!1,codegenConfigPath:u,entry:f,envFile:m}){process.env.NODE_ENV||(process.env.NODE_ENV=c?"development":"production"),s&&rr(),or()||it();let{root:p,buildPath:h,buildPathWorkerFile:y,buildPathClient:b}=xe(t),w=await rt(p);if(w)throw new E(Pe);let g,v=Tt(),P=a?await Je({...{directory:p,entry:f,disableRouteWarning:!1,lockfileCheck:!1,sourcemap:!0,bundleStats:!1,useCodegen:d,codegenConfigPath:u},watch:c,async onServerBuildFinish(){v.state==="pending"?v.resolve():F("\u{1F3D7}\uFE0F Project rebuilt. Reloading server..."),await g?.reload()}}):v.resolve();w||(y=(await he(p).catch(()=>null))?.serverOutFile??x(h,"server","index.js"));let{shop:C,storefront:D}=await tr(p),R=!!C&&!!D?.id,{allVariables:$,logInjectedVariables:I}=await hr({root:p,fetchRemote:R,envBranch:o,envHandle:r,envFile:m});e||(e=await pt(tt));let _=await pt(e+100);return await v.promise,I(),g=await Ja({root:p,appPort:e,assetsPort:_,env:$,buildPathClient:b,buildPathWorkerFile:y,inspectorPort:n,debug:i,watch:c}),g.showBanner({mode:"preview",headlinePrefix:c?"Watching for changes. ":""}),{async close(){await Promise.allSettled([g.close(),P?.close()])}}}l();var oo=class e extends O{static description="Scaffold routes and core functionality.";static flags={...k.path,...k.force,...k.markets,...k.shortcut,...ve(k.installDeps,{"install-deps":{default:!0}})};async run(){let{flags:t}=await this.parse(e),r=t.path?T(t.path):process.cwd();await Zd({...U(t),directory:r})}};async function Zd(e){let t=new qt,{rootDirectory:r,appDirectory:o}=await Ne(e.directory),n=Ze(r),i=z(),s=Promise.resolve(),a=[{title:"Setting up project",task:async()=>{await s}}],c=e.markets?e.markets:await Xt({abortSignal:t.signal,extraChoices:{none:"Set up later"}}),d=c==="none"?void 0:c,{setupRoutes:u}=nr(t),f,m=await Mn(".."),[p,h]=await Promise.all([G(x(r,"tsconfig.json")),kt("*.d.ts",{cwd:m})]);s=s.then(()=>Promise.all([...h.map(g=>Bt(x(m,g),T(r,g))),ir({rootDirectory:r,appDirectory:o,typescript:p})])).then(async()=>{f=await u(r,p?"ts":"js",{i18nStrategy:d,overwriteFileDeps:!0})}),d&&(s=s.then(()=>Kt(d,{rootDirectory:r})));let y=await Promise.resolve(i),{createShortcut:b,showShortcutBanner:w}=await sr(t,y,e.shortcut);!d&&!b||(b&&(s=s.then(async()=>{await b()&&(y=Ye)}),w()),await ee(a),await st({location:n,name:n,directory:r},{cliCommand:y,depsInstalled:!0,packageManager:"npm",i18n:d,routes:f}))}l();var Qa=Q(ue(),1);var no=class e extends O{static descriptionWithMarkdown="Adds support for certain CSS strategies to your project.";static description="Setup CSS strategies for your project.";static flags={...k.path,...k.force,...ve(k.installDeps,{"install-deps":{default:!0}})};static args={strategy:Qa.Args.string({name:"strategy",description:`The CSS strategy to setup. One of ${ko.join()}`,options:ko})};async run(){let{flags:t,args:r}=await this.parse(e),o=t.path?T(t.path):process.cwd();await eu({...U(t),strategy:r.strategy,directory:o})}};async function eu({strategy:e,directory:t,force:r=!1,installDeps:o=!0}){let n=await he(t).catch(()=>null);if(!n)throw new E("No Vite config found. This command is only supported in Vite projects.");let{remixConfig:i}=n,s=e||await qn();if(s==="css-modules"||s==="postcss"){N({headline:`Vite works out of the box with ${xt[s]}.`,body:`See the Vite documentation for more information:
253
+ ${So[s]}`});return}let a=await Gn(s,i,r);if(!a)return;let{workPromise:c,generatedAssets:d,needsInstallDeps:u}=a,f=[{title:"Updating files",task:async()=>{await c}}],m=!1;if(o&&u){let p=Ee(i.rootDirectory);f.push({title:"Installing new dependencies",task:async()=>{let h=await p;m=h==="npm"||h==="unknown",await Yt({directory:i.rootDirectory,packageManager:h,args:[]})}})}await ee(f),N({headline:`${xt[s]} setup complete.`,body:(d.length>0?`You can now modify CSS configuration in the following files:
254
+ `+d.map(p=>` - ${p}`).join(`
255
+ `)+`
256
+ `:"")+`
257
+ For more information, visit ${So[s]}`}),u&&m&&s==="tailwind"&&Y({body:[`Due to a bug in NPM, you might need to reinstall dependencies again.
258
+ Run`,{command:"npm install"}]})}l();var Ka=Q(ue(),1);var io=class e extends O{static descriptionWithMarkdown="Adds support for multiple [markets](https://shopify.dev/docs/custom-storefronts/hydrogen/markets) to your project by using the URL structure.";static description="Setup support for multiple markets in your project.";static flags={...k.path};static args={strategy:Ka.Args.string({name:"strategy",description:`The URL structure strategy to setup multiple markets. One of ${xo.join()}`,options:xo})};async run(){let{flags:t,args:r}=await this.parse(e),o=t.path?T(t.path):process.cwd();await tu({...U(t),strategy:r.strategy,directory:o})}};async function tu({strategy:e,directory:t}){let r=Ne(t),o=e||await Xt(),n=await r;await ee([{title:"Updating files",task:async()=>{await Kt(o,n)}}]),N({headline:`Markets support setup complete with strategy ${Yn[o].toLowerCase()}.`,body:`You can now modify the supported locales in ${n.serverEntryPoint??"your server entry file."}
259
+ `})}l();var so=class e extends O{static description="EXPERIMENTAL: Upgrades the project to use Vite.";static flags={...k.path};async run(){let{flags:t}=await this.parse(e),r=t.path?T(t.path):process.cwd();await ou({...U(t),directory:r})}},ru=`export default {
260
+ plugins: {
261
+ tailwindcss: {},
262
+ autoprefixer: {},
263
+ },
264
+ };
265
+ `;async function ou({directory:e}){if(te(),await Qn(e))throw new E("This project already has a Vite config file.");let[t,r,o]=await Promise.all([Jn(e),xn(x(e,"package.json")),et(e)]),n=t.server||"server.js",i=n.endsWith(".ts"),s=i?"tsx":"jsx",a=await Ge("vite"),c=!!t.tailwind,d=T(e,"postcss.config.js"),u=()=>{},f=Promise.all([ke(T(e,"remix.config.js")).catch(u),vo(T(e,"remix.env.d.ts"),T(e,"env.d.ts")).then(()=>je(T(e,"env.d.ts"),!1,m=>m.replace('types="@remix-run/dev"','types="vite/client"'))).catch(u),vo(T(e,".eslintrc.js"),T(e,".eslintrc.cjs")).catch(u),de(T(e,"postcss.config.js")).then(async m=>{let p=m.includes("tailwindcss"),y=m.includes("module.exports")||m.includes("exports.")||m.includes("require(")?d.replace(".js",".cjs"):d;return!p&&c&&(m=await St(m.replace(/(plugins:\s+{)/,`$1
266
+ tailwindcss: {},`),o,y)),K(y,m)}).catch(async()=>{if(c&&!await G(d)&&!await G(d.replace(".js",".cjs")))return K(d,ru)}).catch(u),Vn(a,e,{onResult(m){return m.dependencies&&delete m.dependencies["@remix-run/css-bundle"],m.devDependencies&&m.devDependencies["@vanilla-extract/css"]&&(m.devDependencies["@vanilla-extract/vite-plugin"]="^4.0.0",m.devDependencies=Object.keys(m.devDependencies).sort().reduce((p,h)=>(p[h]=m.devDependencies?.[h],p),{})),m}}),de(T(a,"vite.config.js")).then(async m=>{r.devDependencies?.["@vanilla-extract/css"]&&(m=m.replace(/\n\n/g,`
267
+ import {vanillaExtractPlugin} from '@vanilla-extract/vite-plugin';
268
+
269
+ `).replace(/^(\s+)\],/m,`$1 vanillaExtractPlugin(),
270
+ $1],`));let{future:h,appDirectory:y,ignoredRouteFiles:b,routes:w}=t;for(let v of["v3_fetcherPersist","v3_throwAbortReason","v3_relativeSplatPath"])h?.[v]||(m=m.replace(`${v}: true`,`${v}: false`));y&&y!=="app"&&(m=m.replace(/^(\s+)(future:)/m,`$1appDirectory: '${y}',
271
+ $1$2`)),b&&(m=m.replace(/^(\s+)(future:)/m,`$1ignoredRouteFiles: ${JSON.stringify(b)},
272
+ $1$2`)),w&&(m=m.replace(/^(\s+)(future:)/m,`$1routes: ${w.toString()},
273
+ $1$2`));let g=T(e,"vite.config."+s.slice(0,2));return m=await St(m,o,g),K(g,m)}),je(T(e,n),!1,m=>(i?`// @ts-ignore
274
+ `:"")+m.replace("@remix-run/dev/server-build","virtual:remix/server-build")),Qt(s).then(async m=>{let p=T(e,t.appDirectory??"app"),h=x(p,"root."+s);await new Promise(async(y,b)=>{await m.findInFiles({paths:[h,x(p,"routes")],matcher:{rule:{kind:"string_fragment",regex:"\\.css$",inside:{kind:"import_statement",stopBy:"end"}}}},async(g,v)=>{g&&b(g);let S={};v.forEach(P=>{if(P.text().endsWith(".module.css"))return;let C=P.getRoot().filename(),D=P.getRoot().root().text(),R=P.range().end.index,$=S[C]||{content:D,positions:[]};$.positions.push(R),S[C]=$}),await Promise.all(Object.entries(S).flatMap(([P,{content:C,positions:D}])=>{D.reverse();for(let R of D)C=C.slice(0,R)+"?url"+C.slice(R);return K(P,C)})),y(null)})===0&&y(null)}),await je(h,o,y=>{let b=m.parse(y).root(),w="LiveReload",g={kind:"identifier",regex:w},v=b.find({rule:{kind:"import_specifier",regex:w,inside:{kind:"import_statement",stopBy:"end"}}}),S=b.findAll({rule:{any:[{kind:"jsx_self_closing_element",has:g},{kind:"jsx_element",has:{kind:"jsx_opening_element",has:g}}]}});for(let P of[...S.reverse(),v]){if(!P)continue;let{start:C,end:D}=P.range();y=y.slice(0,C.index)+y.slice(D.index)}return y.replace(/,\s*,/g,",").replace(/import\s+{\s+cssBundleHref\s+}\s+from\s+['"]@remix-run\/css-bundle['"];?\n/,"").replace(/\.\.\.\(\s*cssBundleHref[^)]+\),?/,"")})})]);await ee([{title:"Updating files",task:async()=>{await f}},{title:"Installing new dependencies",task:async()=>{await Yt({directory:e,packageManager:await Ee(e),args:[]})}}]),N({headline:"Your Vite project is ready!",body:`We've modified your project to use Vite.
275
+ Please use Git to review the changes.`,nextSteps:[t.mdx?"Setup MDX support in Vite: https://remix.run/docs/en/main/future/vite#add-mdx-plugin":"","See more information about Vite in Remix at https://remix.run/docs/en/main/future/vite"].filter(Boolean)})}l();var ao=class extends O{static descriptionWithMarkdown="Creates a global h2 shortcut for Shopify CLI using shell aliases.\n\n The following shells are supported:\n\n - Bash (using `~/.bashrc`)\n - ZSH (using `~/.zshrc`)\n - Fish (using `~/.config/fish/functions`)\n - PowerShell (added to `$PROFILE`)\n\n After the alias is created, you can call Shopify CLI from anywhere in your project using `h2 <command>`.";static description=`Creates a global \`${Ye}\` shortcut for the Hydrogen CLI`;async run(){await nu()}};async function nu(){let e=await ni();e.length>0?N({headline:`Shortcut ready for the following shells: ${e.join(", ")}.
276
+ Restart your terminal session and run \`${Ye}\` from your local project.`}):Re({name:"error",type:0,message:"No supported shell found.",skipOclifErrorHandling:!0,tryMessage:"Please create a shortcut manually."})}l();var lo=class e extends O{static descriptionWithMarkdown="Unlinks your local development environment from a remote Hydrogen storefront.";static description="Unlink a local project from a Hydrogen storefront.";static flags={...k.path};async run(){let{flags:t}=await this.parse(e);await iu(t)}};async function iu({path:e}){let t=e??process.cwd(),{storefront:r}=await tr(t);if(!r){V("This project isn't linked to a Hydrogen storefront.");return}let o=r.title;await ti(t),N({body:["You are no longer linked to",{bold:o}]})}l();import{spawnSync as au}from"node:child_process";l();import{createRequire as Xa}from"node:module";function Za({id:e,projectPath:t}){return!e||!on(t)||!su(t,e)?!1:(te(),Cn({headline:`\`shopify ${e.replace(/:/g," ")}\` is not supported by this version of Hydrogen`,body:"The installed version of @shopify/hydrogen disables this command.",nextSteps:["Use your framework or package tooling instead."]}),!0)}function su(e,t){try{let n=Xa(x(e,"package.json"))("@shopify/hydrogen/package.json")?.shopify?.cli?.disabledCommands;return Array.isArray(n)&&n.includes(t)}catch{return!1}}function on(e){try{let r=Xa(import.meta.url)(x(e,"package.json"));return[r?.dependencies,r?.devDependencies,r?.peerDependencies].some(o=>!!o?.["@shopify/hydrogen"])}catch{return!1}}var lu=async function(e){if(!e.id?.startsWith("hydrogen:")||e.id==="hydrogen:init")return;let t=mn(),r=/^--path($|=)/,o=e.argv.findIndex(n=>r.test(n));if(o!==-1){let n=e.argv[o]?.split("=")[1]??e.argv[o+1];n&&!n.startsWith("--")&&(t=T(t,n))}if(on(t)||(te(),Y({headline:"Looks like you're trying to run a Hydrogen command outside of a Hydrogen project.",body:["Run",{command:"shopify hydrogen init"},"to create a new Hydrogen project or use the",{command:"--path"},`flag to specify an existing Hydrogen project.
277
+
278
+ `,{subdued:t}],reference:["Getting started: https://shopify.dev/docs/storefronts/headless/hydrogen","CLI commands: https://shopify.dev/docs/api/shopify-cli/hydrogen"]}),process.exit(1)),Za({id:e.id,projectPath:t})&&process.exit(1),cu(e.id,e.argv)&&!process.execArgv.includes(co)&&!(process.env.NODE_OPTIONS??"").includes(co)){In(`Restarting CLI process with ${co} flag.`);let[n,...i]=process.argv;i.unshift(co);let s=au(n,i,{stdio:"inherit"});process.exit(s.status??1)}},co="--experimental-vm-modules";function cu(e="",t=[]){return e==="hydrogen:debug:cpu"}var el=lu;var XE={"hydrogen:dev":Mr,"hydrogen:build":Pr,"hydrogen:check":Dr,"hydrogen:codegen":Tr,"hydrogen:deploy":Ar,"hydrogen:g":Gr,"hydrogen:init":Xr,"hydrogen:link":hi,"hydrogen:list":Zr,"hydrogen:login":eo,"hydrogen:logout":to,"hydrogen:preview":ro,"hydrogen:setup":oo,"hydrogen:shortcut":ao,"hydrogen:unlink":lo,"hydrogen:upgrade":Fr,"hydrogen:customer-account-push":yi,"hydrogen:debug:cpu":Ir,"hydrogen:env:list":Ur,"hydrogen:env:pull":Br,"hydrogen:env:push":Vr,"hydrogen:generate:route":Oe,"hydrogen:generate:routes":qr,"hydrogen:setup:css":no,"hydrogen:setup:markets":io,"hydrogen:setup:vite":so},ZE={init:el};export{XE as a,ZE as b};
@@ -1 +1 @@
1
- import{a as o}from"./chunk-ZQ5JVD5X.js";import{b as a}from"./chunk-UKK5P74A.js";import{g as s}from"./chunk-VKWPEFWQ.js";s();var t=class extends a{static{this.description="View the UI kit components that process async tasks"}static{this.hidden=!0}async run(){await o()}};export{t as a};
1
+ import{a as o}from"./chunk-ZVQBSXE4.js";import{b as a}from"./chunk-IDKUJQIG.js";import{g as s}from"./chunk-VKWPEFWQ.js";s();var t=class extends a{static{this.description="View the UI kit components that process async tasks"}static{this.hidden=!0}async run(){await o()}};export{t as a};
@@ -0,0 +1 @@
1
+ import{a as o}from"./chunk-PGODIZ64.js";import{g as e}from"./chunk-VKWPEFWQ.js";e();var t=class extends o{};export{t as a};
@@ -1 +1 @@
1
- import{c as d}from"./chunk-PJYNAUQB.js";import{xa as i}from"./chunk-5W443CKL.js";import{A as s,D as a,w as m,x as u}from"./chunk-6EZ7JWBK.js";import{g as c}from"./chunk-VKWPEFWQ.js";c();function f(e){return[`'${e.name}'`,{subdued:`(#${e.id})`}]}function y(e){return{list:{items:e.map(f)}}}async function T(e,r="It doesn't seem like you're running this command in a theme directory.",o,n){if(e)return!0;if(n)return u({headline:o?`Environment: ${o}`:"",body:r}),!1;if(m({body:r}),!process.stdout.isTTY)return!0;let t=await s({message:"Do you want to proceed?"});return i(`theme-service:confirm-directory:${t}`),t}async function v(e,r,o){if(e.role!==d||!process.stdout.isTTY||o)return!0;let n=`You're about to ${r} on your live theme "${e.name}". This will make changes visible to customers. Are you sure you want to proceed?`,t=await s({message:n,confirmationMessage:"Yes, proceed with live theme",cancellationMessage:"No, cancel"});return i(`theme-service:confirm-live-theme:${t}`),t}async function E(e,r,o=!1){e.length>0&&await a(e,{renderOptions:{stdout:r??process.stderr},noProgressBar:o})}export{f as a,y as b,T as c,v as d,E as e};
1
+ import{c as d}from"./chunk-5T3OVTF5.js";import{xa as i}from"./chunk-2HZMOK4U.js";import{A as s,D as a,w as m,x as u}from"./chunk-E24W34C4.js";import{g as c}from"./chunk-VKWPEFWQ.js";c();function f(e){return[`'${e.name}'`,{subdued:`(#${e.id})`}]}function y(e){return{list:{items:e.map(f)}}}async function T(e,r="It doesn't seem like you're running this command in a theme directory.",o,n){if(e)return!0;if(n)return u({headline:o?`Environment: ${o}`:"",body:r}),!1;if(m({body:r}),!process.stdout.isTTY)return!0;let t=await s({message:"Do you want to proceed?"});return i(`theme-service:confirm-directory:${t}`),t}async function v(e,r,o){if(e.role!==d||!process.stdout.isTTY||o)return!0;let n=`You're about to ${r} on your live theme "${e.name}". This will make changes visible to customers. Are you sure you want to proceed?`,t=await s({message:n,confirmationMessage:"Yes, proceed with live theme",cancellationMessage:"No, cancel"});return i(`theme-service:confirm-live-theme:${t}`),t}async function E(e,r,o=!1){e.length>0&&await a(e,{renderOptions:{stdout:r??process.stderr},noProgressBar:o})}export{f as a,y as b,T as c,v as d,E as e};
@@ -1 +1 @@
1
- import{a as s}from"./chunk-CZXGQ53M.js";import{g as r,h,i as n}from"./chunk-D6YDSGR4.js";import{d as m}from"./chunk-WKBVT5WG.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();var c=t=>`Development theme #${t} could not be found. Please create a new development theme.`,i="No development theme ID has been set. Please create a development theme first.",p=class extends s{constructor(e){super(e),this.context="Development",this.themeId=r()}async find(){let e=await this.fetch();if(!e)throw new m(this.themeId?c(this.themeId):i);return e}setTheme(e){h(e)}removeTheme(){n()}};export{p as a};
1
+ import{a as s}from"./chunk-RFDT525K.js";import{g as r,h,i as n}from"./chunk-PTIJDS6I.js";import{d as m}from"./chunk-ELIH6GCC.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();var c=t=>`Development theme #${t} could not be found. Please create a new development theme.`,i="No development theme ID has been set. Please create a development theme first.",p=class extends s{constructor(e){super(e),this.context="Development",this.themeId=r()}async find(){let e=await this.fetch();if(!e)throw new m(this.themeId?c(this.themeId):i);return e}setTheme(e){h(e)}removeTheme(){n()}};export{p as a};