@shopify/cli 4.8.3 → 4.8.5

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 (308) hide show
  1. package/dist/analytics-4D5FCVMV.js +1 -0
  2. package/dist/{analytics-VCJLTHBI.js → analytics-XRYJEPWC.js} +1 -1
  3. package/dist/bootstrap.js +1 -1
  4. package/dist/{chunk-BR5CFKIN.js → chunk-2IZROVCY.js} +1 -1
  5. package/dist/{chunk-QIGFVVLB.js → chunk-2JM3XHTQ.js} +1 -1
  6. package/dist/{chunk-6NO44HAQ.js → chunk-2SOA4M4G.js} +1 -1
  7. package/dist/{chunk-ERMLZF2C.js → chunk-2WNF5BX4.js} +1 -1
  8. package/dist/{chunk-QCMGYBFD.js → chunk-2Z52XJQG.js} +1 -1
  9. package/dist/chunk-34PQ6LJC.js +1 -0
  10. package/dist/{chunk-LUSG2EHB.js → chunk-3CKUOG4B.js} +1 -1
  11. package/dist/{chunk-KLI5Z5RC.js → chunk-3NW372KT.js} +1 -1
  12. package/dist/{chunk-G52SCW6W.js → chunk-4DIR65KL.js} +1 -1
  13. package/dist/{chunk-QGYETVYA.js → chunk-4JLOCGTK.js} +1 -1
  14. package/dist/{chunk-RVEAQUUF.js → chunk-4JU7N2OF.js} +1 -1
  15. package/dist/{chunk-34YS3IUO.js → chunk-4NZ465W4.js} +1 -1
  16. package/dist/{chunk-DE3HBSUU.js → chunk-4SXHXMK6.js} +1 -1
  17. package/dist/{chunk-46ISGKTW.js → chunk-4UAJ6ULU.js} +1 -1
  18. package/dist/{chunk-HHWZV7CG.js → chunk-4UD2LW4O.js} +1 -1
  19. package/dist/{chunk-5YSO5HRH.js → chunk-4XE6E4DC.js} +1 -1
  20. package/dist/chunk-5EME57E6.js +7 -0
  21. package/dist/chunk-5GUXN2RU.js +6 -0
  22. package/dist/{chunk-C2AA5NVP.js → chunk-5N33O2RV.js} +1 -1
  23. package/dist/{chunk-2E3JUVRC.js → chunk-5PAPCPUM.js} +1 -1
  24. package/dist/{chunk-3D3IYIZ7.js → chunk-5U24BORP.js} +1 -1
  25. package/dist/{chunk-FYVFGKCJ.js → chunk-6ARAJULJ.js} +1 -1
  26. package/dist/{chunk-34EOYW4N.js → chunk-6ICRPFG4.js} +1 -1
  27. package/dist/{chunk-VCJ252CK.js → chunk-6IOVTFAH.js} +1 -1
  28. package/dist/{chunk-I44E5KLI.js → chunk-6LNTC6EK.js} +1 -1
  29. package/dist/{chunk-UU3VUYVX.js → chunk-6QU2BHVL.js} +1 -1
  30. package/dist/{chunk-HPGQGIPA.js → chunk-6QWLOSUQ.js} +1 -1
  31. package/dist/{chunk-ALDLKZJW.js → chunk-77KSMVIO.js} +1 -1
  32. package/dist/{chunk-N34YKDEK.js → chunk-7O2KMA4J.js} +1 -1
  33. package/dist/{chunk-HG63NM4M.js → chunk-7VJPQ52S.js} +1 -1
  34. package/dist/{chunk-ZRFOMQ2L.js → chunk-7ZEVVGCH.js} +1 -1
  35. package/dist/{chunk-M7YZJWY3.js → chunk-A2BZY6TE.js} +1 -1
  36. package/dist/{chunk-ETHKJFFN.js → chunk-A5FV7HOY.js} +1 -1
  37. package/dist/{chunk-5QCSJYJ4.js → chunk-ADS7BFDG.js} +1 -1
  38. package/dist/chunk-ADUMJRRY.js +1 -0
  39. package/dist/{chunk-SLZ6UMVV.js → chunk-AEPBX4GI.js} +1 -1
  40. package/dist/{chunk-6ZGCTTAD.js → chunk-AI4SPBPV.js} +1 -1
  41. package/dist/{chunk-AU2OGZBS.js → chunk-AKETXXYD.js} +1 -1
  42. package/dist/{chunk-HZASAGTU.js → chunk-ANOCIVJ3.js} +1 -1
  43. package/dist/{chunk-2AFQC53K.js → chunk-AOPEKBDL.js} +1 -1
  44. package/dist/{chunk-SZ2V5WT6.js → chunk-BMPCDXJR.js} +1 -1
  45. package/dist/{chunk-VTKZJ6MD.js → chunk-BPJRQOHO.js} +1 -1
  46. package/dist/{chunk-CRSAEF22.js → chunk-BU6LJZG7.js} +1 -1
  47. package/dist/{chunk-PYCGZSME.js → chunk-C4UCOQUP.js} +1 -1
  48. package/dist/{chunk-DGZCOTKZ.js → chunk-CAKGQWX4.js} +1 -1
  49. package/dist/{chunk-NKSLEPE2.js → chunk-CBGDD3ZG.js} +1 -1
  50. package/dist/chunk-CUGLV7UX.js +1 -0
  51. package/dist/{chunk-6QDI53VP.js → chunk-CWSQIPY5.js} +1 -1
  52. package/dist/{chunk-6TPUTSNR.js → chunk-D34ZSTCK.js} +1 -1
  53. package/dist/{chunk-4XZJKSDD.js → chunk-D6LV5CJL.js} +1 -1
  54. package/dist/{chunk-YKHDUKFK.js → chunk-DGMHUJV3.js} +1 -1
  55. package/dist/{chunk-BV4K7JX5.js → chunk-DKAWQBTI.js} +1 -1
  56. package/dist/{chunk-RM3XC2IX.js → chunk-DPMOLROM.js} +1 -1
  57. package/dist/{chunk-WE72MX7V.js → chunk-DV7FOLG4.js} +1 -1
  58. package/dist/{chunk-BO45JVQ3.js → chunk-EBBS7VG6.js} +1 -1
  59. package/dist/{chunk-E2IUEX5H.js → chunk-EJJPVVQ2.js} +1 -1
  60. package/dist/{chunk-7W7RGEII.js → chunk-ENUN2VSC.js} +1 -1
  61. package/dist/{chunk-TWTZLWO7.js → chunk-EX7Y3BEH.js} +1 -1
  62. package/dist/{chunk-AWTBC3MC.js → chunk-F33TYJM5.js} +3 -3
  63. package/dist/{chunk-ULIXS6H7.js → chunk-FDK3NDYQ.js} +1 -1
  64. package/dist/{chunk-UCP6UA7M.js → chunk-FLV6UQRA.js} +1 -1
  65. package/dist/{chunk-LOSBZZHU.js → chunk-FTC3BXSD.js} +1 -1
  66. package/dist/{chunk-B3GLHLAQ.js → chunk-FXBQKJTS.js} +1 -1
  67. package/dist/{chunk-YSOLGBU3.js → chunk-FXWNYGIW.js} +1 -1
  68. package/dist/{chunk-FKW62ZUV.js → chunk-G5272L77.js} +1 -1
  69. package/dist/{chunk-TNYPQ2UL.js → chunk-G5QSVBYP.js} +3 -3
  70. package/dist/{chunk-GKRGXRD4.js → chunk-G6SURO6V.js} +1 -1
  71. package/dist/{chunk-CM4QZI6V.js → chunk-G7C4LBG2.js} +1 -1
  72. package/dist/{chunk-CNDB4VEM.js → chunk-GBYDMHZ3.js} +1 -1
  73. package/dist/{chunk-RIWEYVNK.js → chunk-GCJAY2XJ.js} +1 -1
  74. package/dist/{chunk-2C27YWUC.js → chunk-GR6NR5QK.js} +1 -1
  75. package/dist/{chunk-6ECS5KDX.js → chunk-GUPUXFIP.js} +1 -1
  76. package/dist/{chunk-XCTRPBWM.js → chunk-GW7IEG4G.js} +1 -1
  77. package/dist/{chunk-SYJXM2RN.js → chunk-H5MENHJ2.js} +1 -1
  78. package/dist/{chunk-LZSDOB4O.js → chunk-H6TWXT6Q.js} +1 -1
  79. package/dist/chunk-HGFCNPSN.js +1 -0
  80. package/dist/{chunk-KIPKRAUB.js → chunk-HKHGJYRC.js} +1 -1
  81. package/dist/{chunk-CSNXCRPY.js → chunk-HS3VTFW3.js} +1 -1
  82. package/dist/{chunk-CYSB5AJJ.js → chunk-HSETBDXR.js} +1 -1
  83. package/dist/{chunk-U5APMZGT.js → chunk-I6DVGPJ7.js} +1 -1
  84. package/dist/{chunk-DDWJRJWW.js → chunk-IKNCFVVX.js} +1 -1
  85. package/dist/{chunk-BAUHOB76.js → chunk-IMIPD73V.js} +1 -1
  86. package/dist/{chunk-I7XKF22Z.js → chunk-IPN5OHBY.js} +1 -1
  87. package/dist/{chunk-T5I2LEDJ.js → chunk-IYFHBTJ2.js} +1 -1
  88. package/dist/{chunk-Z6MS5OET.js → chunk-J2HBEHCX.js} +1 -1
  89. package/dist/{chunk-3DXA7B3Y.js → chunk-J774336K.js} +1 -1
  90. package/dist/{chunk-VEXW766J.js → chunk-K3OI5VDE.js} +1 -1
  91. package/dist/{chunk-O4ZMMPEP.js → chunk-K5OTE6CX.js} +1 -1
  92. package/dist/{chunk-5QNB6464.js → chunk-KB43BSFM.js} +1 -1
  93. package/dist/{chunk-KSSPT7G5.js → chunk-KDMJ2BLO.js} +12 -12
  94. package/dist/{chunk-TBC5FH2W.js → chunk-KGRDHI2A.js} +1 -1
  95. package/dist/{chunk-NS7QRCJF.js → chunk-KHRZFJHM.js} +1 -1
  96. package/dist/{chunk-SUQF2LM7.js → chunk-KNCYAIJ2.js} +1 -1
  97. package/dist/{chunk-IAURXPUJ.js → chunk-KYNXMDFU.js} +5 -5
  98. package/dist/{chunk-AURREHRU.js → chunk-L7CQQML6.js} +1 -1
  99. package/dist/{chunk-JKWKFDP7.js → chunk-LCVDLQEZ.js} +1 -1
  100. package/dist/{chunk-F4S4ITHP.js → chunk-LZZAD3FW.js} +1 -1
  101. package/dist/{chunk-HLLMMIIM.js → chunk-M2M3I63K.js} +1 -1
  102. package/dist/chunk-MFP63IUM.js +272 -0
  103. package/dist/{chunk-AHJT2Z7G.js → chunk-MMHTYLTG.js} +1 -1
  104. package/dist/{chunk-3U7O3PMX.js → chunk-MNYKIPG7.js} +1 -1
  105. package/dist/{chunk-XSFF6KEB.js → chunk-MVJSQT7V.js} +1 -1
  106. package/dist/{chunk-E767ITG2.js → chunk-NAQ7KT6L.js} +1 -1
  107. package/dist/{chunk-O2YFSYDR.js → chunk-NDAUL4H4.js} +1 -1
  108. package/dist/{chunk-RAJX2CQP.js → chunk-NDFKLPHJ.js} +1 -1
  109. package/dist/{chunk-WKC5HDMY.js → chunk-NPATN7YS.js} +1 -1
  110. package/dist/{chunk-CF3PBTFV.js → chunk-NUKSSKYR.js} +1 -1
  111. package/dist/chunk-NVNDQQN6.js +8 -0
  112. package/dist/{chunk-3X7XO4LN.js → chunk-NZ3HLDJG.js} +1 -1
  113. package/dist/{chunk-OI3MNE72.js → chunk-NZE4C4OI.js} +1 -1
  114. package/dist/{chunk-777JJJYW.js → chunk-O452KNRL.js} +1 -1
  115. package/dist/{chunk-Z3JINOCM.js → chunk-OAEGTH4Q.js} +1 -1
  116. package/dist/{chunk-4CLJ6W23.js → chunk-OJSF3H2G.js} +20 -20
  117. package/dist/{chunk-OZJBUWZK.js → chunk-P5R6JZMT.js} +1 -1
  118. package/dist/{chunk-NG5FY45G.js → chunk-PDWJ2YH2.js} +1 -1
  119. package/dist/{chunk-PXAYMXQN.js → chunk-PIQI72DV.js} +1 -1
  120. package/dist/{chunk-RFORHGOR.js → chunk-PJ7L6NSD.js} +1 -1
  121. package/dist/{chunk-GO4KOSHA.js → chunk-PL7AJVTV.js} +1 -1
  122. package/dist/{chunk-PXM3ENVN.js → chunk-POOKYUTJ.js} +1 -1
  123. package/dist/{chunk-2NHLSPBM.js → chunk-PQDB3FUL.js} +1 -1
  124. package/dist/{chunk-T3IMDY72.js → chunk-PSSOCUUD.js} +3 -3
  125. package/dist/{chunk-MQM3PRVN.js → chunk-PU6KWWVK.js} +1 -1
  126. package/dist/{chunk-AQJEA33T.js → chunk-PWXGGZQB.js} +1 -1
  127. package/dist/{chunk-BU4EGAMH.js → chunk-QKUTVLRJ.js} +1 -1
  128. package/dist/{chunk-SVO2M3F5.js → chunk-QOOVB6RW.js} +1 -1
  129. package/dist/{chunk-4ZMWIIJV.js → chunk-R4TOHQH3.js} +98 -92
  130. package/dist/{chunk-UI75K6AX.js → chunk-RGJVJ22M.js} +1 -1
  131. package/dist/{chunk-TEHDOYO2.js → chunk-RSGIMVPN.js} +1 -1
  132. package/dist/{chunk-EIASA32Z.js → chunk-RU6J6QQF.js} +1 -1
  133. package/dist/{chunk-RPM2BFMN.js → chunk-RX63KGTK.js} +1 -1
  134. package/dist/{chunk-7YBBERPS.js → chunk-SOJHJ4QK.js} +1 -1
  135. package/dist/{chunk-NTV746FL.js → chunk-SYBKHTVU.js} +1 -1
  136. package/dist/{chunk-BIV3GWMB.js → chunk-T3B6KIPU.js} +1 -1
  137. package/dist/{chunk-F3FHSS7N.js → chunk-TIG7SSKB.js} +1 -1
  138. package/dist/{chunk-MF2PINFC.js → chunk-TTV2GWNE.js} +1 -1
  139. package/dist/{chunk-BR3GYG2H.js → chunk-TUWRPDTE.js} +1 -1
  140. package/dist/{chunk-PUGAY4JP.js → chunk-UBTHWHPB.js} +3 -3
  141. package/dist/chunk-UDWSRNKO.js +1 -0
  142. package/dist/{chunk-SASKWPDJ.js → chunk-UJSCQJLW.js} +1 -1
  143. package/dist/{chunk-XNMDPOYU.js → chunk-VE6BYYBP.js} +1 -1
  144. package/dist/{chunk-ZC7FWXYM.js → chunk-VIMFXQ3Q.js} +1 -1
  145. package/dist/{chunk-MPO2T5YQ.js → chunk-VPOAOUT4.js} +1 -1
  146. package/dist/{chunk-HEABWGTV.js → chunk-VVPIXC3W.js} +1 -1
  147. package/dist/chunk-W3BNL2Q5.js +1 -0
  148. package/dist/{chunk-YJCNZGPY.js → chunk-WAZL37JY.js} +1 -1
  149. package/dist/{chunk-MI5HPOXV.js → chunk-WDY5CK2T.js} +1 -1
  150. package/dist/{chunk-PZH4WAOO.js → chunk-WHXY372K.js} +1 -1
  151. package/dist/{chunk-XBL6HWDC.js → chunk-WHZKFG2B.js} +1 -1
  152. package/dist/{chunk-GK23CIPB.js → chunk-WKRX4FBZ.js} +1 -1
  153. package/dist/{chunk-PERAXNOY.js → chunk-WKTIQUQP.js} +2 -2
  154. package/dist/{chunk-T7BQYKKT.js → chunk-WLU7UG44.js} +1 -1
  155. package/dist/{chunk-EIEPBDNX.js → chunk-WM3GKSPE.js} +1 -1
  156. package/dist/{chunk-B52JFWYO.js → chunk-WNBRPWSB.js} +1 -1
  157. package/dist/{chunk-GSYVQPMP.js → chunk-WQOV3LQA.js} +1 -1
  158. package/dist/{chunk-J6BXYZRY.js → chunk-WWRLFLGM.js} +1 -1
  159. package/dist/{chunk-77QBDEU4.js → chunk-XOEBZR5C.js} +1 -1
  160. package/dist/{chunk-5VBEPL4S.js → chunk-XRWQ7AXY.js} +1 -1
  161. package/dist/{chunk-WXDINLQ6.js → chunk-YGSXN3YD.js} +1 -1
  162. package/dist/{chunk-EQ7HQXEK.js → chunk-YN5SVIOI.js} +1 -1
  163. package/dist/{chunk-56362WJR.js → chunk-YVB7ZPHR.js} +2 -2
  164. package/dist/{chunk-ASBTWQJO.js → chunk-Z4E2EXZV.js} +1 -1
  165. package/dist/{chunk-JGSHB34D.js → chunk-ZFA5DIJ3.js} +1 -1
  166. package/dist/{chunk-65DQFHSH.js → chunk-ZIAXZ5VG.js} +1 -1
  167. package/dist/{chunk-E6DIK7Z7.js → chunk-ZMD5TNU5.js} +1 -1
  168. package/dist/{chunk-ZBMPFLOH.js → chunk-ZMTTZXC4.js} +1 -1
  169. package/dist/{chunk-BQTD7UV2.js → chunk-ZZNGFCJ3.js} +1 -1
  170. package/dist/cli/commands/app/app-logs/sources.js +1 -1
  171. package/dist/cli/commands/app/build.js +1 -1
  172. package/dist/cli/commands/app/bulk/cancel.js +1 -1
  173. package/dist/cli/commands/app/bulk/execute.js +1 -1
  174. package/dist/cli/commands/app/bulk/status.js +1 -1
  175. package/dist/cli/commands/app/config/link.js +1 -1
  176. package/dist/cli/commands/app/config/pull.js +1 -1
  177. package/dist/cli/commands/app/config/use.js +1 -1
  178. package/dist/cli/commands/app/config/validate.js +1 -1
  179. package/dist/cli/commands/app/demo/watcher.js +1 -1
  180. package/dist/cli/commands/app/deploy.js +1 -1
  181. package/dist/cli/commands/app/dev/clean.js +1 -1
  182. package/dist/cli/commands/app/dev.js +1 -1
  183. package/dist/cli/commands/app/doctor/instructions.js +1 -1
  184. package/dist/cli/commands/app/doctor.js +1 -1
  185. package/dist/cli/commands/app/env/pull.js +1 -1
  186. package/dist/cli/commands/app/env/show.js +1 -1
  187. package/dist/cli/commands/app/execute.js +1 -1
  188. package/dist/cli/commands/app/function/build.js +1 -1
  189. package/dist/cli/commands/app/function/info.js +1 -1
  190. package/dist/cli/commands/app/function/replay.js +1 -1
  191. package/dist/cli/commands/app/function/run.js +1 -1
  192. package/dist/cli/commands/app/function/schema.js +1 -1
  193. package/dist/cli/commands/app/function/typegen.js +1 -1
  194. package/dist/cli/commands/app/generate/extension.js +1 -1
  195. package/dist/cli/commands/app/graphiql.js +1 -1
  196. package/dist/cli/commands/app/import-custom-data-definitions.js +1 -1
  197. package/dist/cli/commands/app/import-extensions.js +1 -1
  198. package/dist/cli/commands/app/info.js +1 -1
  199. package/dist/cli/commands/app/init.js +1 -1
  200. package/dist/cli/commands/app/logs.js +1 -1
  201. package/dist/cli/commands/app/release.js +1 -1
  202. package/dist/cli/commands/app/subscription-migrations/cancel.js +1 -1
  203. package/dist/cli/commands/app/subscription-migrations/list.js +1 -1
  204. package/dist/cli/commands/app/subscription-migrations/schedule.js +1 -1
  205. package/dist/cli/commands/app/subscription-migrations/status.js +1 -1
  206. package/dist/cli/commands/app/subscription-migrations/unschedule.js +1 -1
  207. package/dist/cli/commands/app/versions/list.js +1 -1
  208. package/dist/cli/commands/app/webhook/trigger.js +1 -1
  209. package/dist/cli/commands/auth/login.js +1 -1
  210. package/dist/cli/commands/auth/logout.js +1 -1
  211. package/dist/cli/commands/cache/clear.js +1 -1
  212. package/dist/cli/commands/config/autoupgrade/off.js +1 -1
  213. package/dist/cli/commands/config/autoupgrade/on.js +1 -1
  214. package/dist/cli/commands/config/autoupgrade/status.js +1 -1
  215. package/dist/cli/commands/debug/command-flags.js +1 -1
  216. package/dist/cli/commands/doc/fetch.js +1 -1
  217. package/dist/cli/commands/doc/search.js +1 -1
  218. package/dist/cli/commands/docs/generate.js +1 -1
  219. package/dist/cli/commands/doctor-release/doctor-release.js +1 -1
  220. package/dist/cli/commands/doctor-release/theme/index.js +1 -1
  221. package/dist/cli/commands/help.js +1 -1
  222. package/dist/cli/commands/kitchen-sink/async.js +1 -1
  223. package/dist/cli/commands/kitchen-sink/index.js +1 -1
  224. package/dist/cli/commands/kitchen-sink/prompts.js +1 -1
  225. package/dist/cli/commands/kitchen-sink/static.js +1 -1
  226. package/dist/cli/commands/notifications/generate.js +1 -1
  227. package/dist/cli/commands/notifications/list.js +1 -1
  228. package/dist/cli/commands/organization/list.js +1 -1
  229. package/dist/cli/commands/search.js +1 -1
  230. package/dist/cli/commands/send-analytics.js +1 -1
  231. package/dist/cli/commands/theme/check.js +1 -1
  232. package/dist/cli/commands/theme/console.js +1 -1
  233. package/dist/cli/commands/theme/delete.js +1 -1
  234. package/dist/cli/commands/theme/dev.js +1 -1
  235. package/dist/cli/commands/theme/duplicate.js +1 -1
  236. package/dist/cli/commands/theme/info.js +1 -1
  237. package/dist/cli/commands/theme/init.js +1 -1
  238. package/dist/cli/commands/theme/language-server.js +1 -1
  239. package/dist/cli/commands/theme/list.js +1 -1
  240. package/dist/cli/commands/theme/metafields/pull.js +1 -1
  241. package/dist/cli/commands/theme/open.js +1 -1
  242. package/dist/cli/commands/theme/package.js +1 -1
  243. package/dist/cli/commands/theme/preview.js +1 -1
  244. package/dist/cli/commands/theme/profile.js +1 -1
  245. package/dist/cli/commands/theme/publish.js +1 -1
  246. package/dist/cli/commands/theme/pull.js +1 -1
  247. package/dist/cli/commands/theme/push.js +1 -1
  248. package/dist/cli/commands/theme/rename.js +1 -1
  249. package/dist/cli/commands/theme/share.js +1 -1
  250. package/dist/cli/commands/upgrade.js +1 -1
  251. package/dist/cli/commands/version.js +1 -1
  252. package/dist/command-registry.js +1 -1
  253. package/dist/{conf-store-F4NCJPWK.js → conf-store-5UUKEHZV.js} +1 -1
  254. package/dist/configs/all.yml +8 -5
  255. package/dist/configs/recommended.yml +8 -5
  256. package/dist/data/objects.json +487 -75
  257. package/dist/data/shopify_system_translations.json +8 -7
  258. package/dist/data/tags.json +23 -0
  259. package/dist/{deprecations-PX5KIFDO.js → deprecations-DVGWC3RL.js} +1 -1
  260. package/dist/dist-CN7N5IOM.js +1 -0
  261. package/dist/dist-Q5U4WGYG.js +1 -0
  262. package/dist/{environments-TLO674UK.js → environments-M4CFP4XF.js} +1 -1
  263. package/dist/{error-YLDXWEC5.js → error-ZES2RSN7.js} +1 -1
  264. package/dist/error-handler-CRTU67VJ.js +1 -0
  265. package/dist/{fs-CDN2NZJC.js → fs-GELMKEWX.js} +1 -1
  266. package/dist/hooks/did-you-mean.js +1 -1
  267. package/dist/hooks/hydrogen-init.js +1 -1
  268. package/dist/hooks/postrun.js +1 -1
  269. package/dist/hooks/prerun.js +1 -1
  270. package/dist/hooks/public-metadata.js +1 -1
  271. package/dist/hooks/sensitive-metadata.js +1 -1
  272. package/dist/hooks/tunnel-provider.js +1 -1
  273. package/dist/hooks/tunnel-start.js +1 -1
  274. package/dist/index.js +1 -1
  275. package/dist/{is-global-KBYTYD3Y.js → is-global-X2QNCXXB.js} +1 -1
  276. package/dist/{local-IBYCFEVA.js → local-HMFFXIE3.js} +1 -1
  277. package/dist/{metadata-LOCKHSUF.js → metadata-SXJZZMCI.js} +1 -1
  278. package/dist/{node-package-manager-ESOHDRPJ.js → node-package-manager-2D2CIFTG.js} +1 -1
  279. package/dist/notifications-system-WH6MAXEN.js +1 -0
  280. package/dist/os-PY42WAOB.js +1 -0
  281. package/dist/{output-OAORC6TH.js → output-MSTNB7GI.js} +1 -1
  282. package/dist/{system-VNXEM5E7.js → system-7XRI63YJ.js} +1 -1
  283. package/dist/tsconfig.tsbuildinfo +1 -1
  284. package/dist/{ui-CIZHMGKK.js → ui-77QYNWJB.js} +1 -1
  285. package/dist/upgrade-UVPNOKKK.js +1 -0
  286. package/dist/version-DXGPL73I.js +1 -0
  287. package/dist/{version-JJYR4NOL.js → version-XMVQO6PD.js} +1 -1
  288. package/dist/{workerd-JWZNKSHU.js → workerd-SOWC66FA.js} +1 -1
  289. package/oclif.manifest.json +1 -1
  290. package/package.json +7 -7
  291. package/dist/analytics-AL5WLCEC.js +0 -1
  292. package/dist/chunk-3CFHLIBD.js +0 -7
  293. package/dist/chunk-4EHFK2OI.js +0 -1
  294. package/dist/chunk-7YDT5AOW.js +0 -8
  295. package/dist/chunk-BJ3JF35I.js +0 -6
  296. package/dist/chunk-ENEPD4BS.js +0 -1
  297. package/dist/chunk-EWKIFVW3.js +0 -273
  298. package/dist/chunk-NNCLTG6A.js +0 -1
  299. package/dist/chunk-OSMT4BVT.js +0 -1
  300. package/dist/chunk-PJH3JJEQ.js +0 -1
  301. package/dist/chunk-RV4UQZ2W.js +0 -1
  302. package/dist/dist-WO24PYXH.js +0 -1
  303. package/dist/dist-X7YIFLSP.js +0 -1
  304. package/dist/error-handler-SY45FR6A.js +0 -1
  305. package/dist/notifications-system-EMCOAF3T.js +0 -1
  306. package/dist/os-XLJNYIZF.js +0 -1
  307. package/dist/upgrade-AIZVY3E5.js +0 -1
  308. package/dist/version-CNIDTUMV.js +0 -1
@@ -1,4 +1,4 @@
1
- import{b as vi}from"./chunk-LQ7ENG4V.js";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-G52SCW6W.js";import{a as yr}from"./chunk-FKIVKNOV.js";import{a as _n}from"./chunk-JLGA3B7P.js";import{a as Di}from"./chunk-OSMT4BVT.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-XSFF6KEB.js";import{a as pl,b as Ln,d as hl}from"./chunk-CRSAEF22.js";import{a as fr,b as Io,c as Oo}from"./chunk-VTKZJ6MD.js";import{c as On}from"./chunk-F3TMLDLC.js";import{b as O}from"./chunk-PUGAY4JP.js";import{Da as ul,Ea as Dn,Fa as fl,Ga as ml,c as wn,ka as pe,q as vn,r as ae}from"./chunk-IAURXPUJ.js";import{B as Pn,l as kn,m as Ee,p as qt,s as En,u as Sn,x as xn}from"./chunk-BJ3JF35I.js";import{A as Y,B as Cn,C as Re,D as $e,E as Te,H as ee,S as bo,a as Gt,y as B,z as N}from"./chunk-T3IMDY72.js";import{h as E,k as Wt}from"./chunk-4EHFK2OI.js";import{a as cl}from"./chunk-CX5CC6P5.js";import{b as dl}from"./chunk-TOLPNBZK.js";import{Ab as In,Bb as V,Ca as yo,Cb as te,Ea as Vt,Ga as gn,Ha as yn,Ka as wo,Oa as vo,Ta as G,U as Ut,Wa as kt,_ as pn,jb as bn,ma as de,mb as Yt,na as hn,pa as Bt,qa as go,qb as we,sb as W,ua as K,ub as Ae,wa as bt,xb as F,ya as ke,yb as Tn,zb as Fe}from"./chunk-TNYPQ2UL.js";import{i as H}from"./chunk-B4OMIONW.js";import{r as zt}from"./chunk-QCMGYBFD.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 be,c as ce,e as Q,g as c}from"./chunk-VKWPEFWQ.js";var Ys=ce((Xw,qs)=>{c();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)=>{c();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)=>{c();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)=>{c();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)=>{c();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(),l=sd.obj({highWaterMark:1},function(m,f,p){if(ld(m))return u(m,null,p);if(Buffer.isBuffer(m)||(m=ad(m)),n){var h=Array.prototype.indexOf.call(m,10);if(h>0&&m[h-1]===13&&h--,h>-1)return i.push(m.slice(0,h)),u(Buffer.concat(i),m.slice(h),p)}if(i.push(m),s+=m.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(m){if(m)return a.destroy(m);a.uncork()})},u=function(m,f,p){a.removeListener("preend",d),t(m,function(h,b){if(h)return p(h);a.setWritable(b),a.setReadable(b),m&&b.write(m),f&&b.write(f),f=i=l=null,p()})};return a.on("preend",d),a.setWritable(l),a};oa.exports=ra});var aa=ce((lv,sa)=>{c();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(l){r||(r=l),l&&o.forEach(ia),!s&&(o.forEach(ia),t(r))})});e.reduce(hd)};sa.exports=gd});var da=ce((dv,Jr)=>{c();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(l){if(o.removeListener("close",a),l)return o.destroy(l.message==="premature close"?null:l);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";c();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";c();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)=>{c();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";c();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,l=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,l))})},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)=>{c();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(l,d){l?s(l,d):yt(e,t,s,d)}):i.stat(e,function(l,d){l||!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=>{c();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(l){if(!s.length)return l();var d=s.shift(),u=Z.join(r,d);t.call(e,u,function(m,f){if(m)return l(m);if(!f.isDirectory())return l(null,d,f);e.readdir(u,function(p,h){if(p)return l(p);i&&h.sort();for(var b=0;b<h.length;b++)o(Z.join(r,d,h[b]))||s.push(Z.join(d,h[b]));l(null,d,f)})})}},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,l=typeof t.umask=="number"?~t.umask:~ja(),d=typeof t.dmode=="number"?t.dmode:0,u=typeof t.fmode=="number"?t.fmode:0,m=t.pack||Ra.pack(),f=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(w,g){r.readlink(Z.join(e,w),function(y,v){if(y)return m.destroy(y);g.linkname=Zo(v),m.entry(g,b)})},h=function(w,g,y){if(w)return m.destroy(w);if(!g)return t.finalize!==!1&&m.finalize(),f(m);if(y.isSocket())return b();var v={name:Zo(g),mode:(y.mode|(y.isDirectory()?d:u))&l,mtime:y.mtime,size:y.size,type:"file",uid:y.uid,gid:y.gid};if(y.isDirectory())return v.size=0,v.type="directory",v=n(v)||v,m.entry(v,b);if(y.isSymbolicLink())return v.size=0,v.type="symlink",v=n(v)||v,p(g,v);if(v=n(v)||v,!y.isFile())return a?m.destroy(new Error("unsupported type for "+g)):b();var S=m.entry(v,b);if(S){var P=i(r.createReadStream(Z.join(e,g),{start:0,end:v.size>0?v.size-1:v.size}),v);P.on("error",function(C){S.destroy(C)}),$a(P,S)}},b=function(w){if(w)return m.destroy(w);s(h)};return b(),m};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(),l=[],d=new Date,u=typeof t.umask=="number"?~t.umask:~ja(),m=typeof t.dmode=="number"?t.dmode:0,f=typeof t.fmode=="number"?t.fmode:0,p=t.strict!==!1;t.strip&&(n=Fa(n,t.strip)),t.readable&&(m|=parseInt(555,8),f|=parseInt(444,8)),t.writable&&(m|=parseInt(333,8),f|=parseInt(222,8));var h=function(g,y){for(var v;(v=Fd(l))&&g.slice(0,v[0].length)!==v[0];)l.pop();if(!v)return y();r.utimes(v[0],d,v[1],y)},b=function(g,y,v){if(t.utimes===!1)return v();if(y.type==="directory")return r.utimes(g,d,y.mtime,v);if(y.type==="symlink")return h(g,v);r.utimes(g,d,y.mtime,function(S){if(S)return v(S);h(g,v)})},w=function(g,y,v){var S=y.type==="symlink",P=S?r.lchmod:r.chmod,C=S?r.lchown:r.chown;if(!P)return v();var D=(y.mode|(y.type==="directory"?m:f))&u;C&&s?C.call(r,g,y.uid,y.gid,R):R(null);function R($){if($)return v($);if(!P)return v();P.call(r,g,D,v)}};return a.on("entry",function(g,y,v){g=n(g)||g,g.name=Zo(g.name);var S=Z.join(e,Z.join("/",g.name));if(o(S,g))return y.resume(),v();var P=function(I){if(I)return v(I);b(S,g,function(_){if(_)return v(_);if(jt)return v();w(S,g,v)})},C=function(){if(jt)return v();r.unlink(S,function(){var I=Z.resolve(Z.dirname(S),g.linkname);if(!_a(I,e))return v(new Error(S+" is not a valid symlink"));r.symlink(g.linkname,S,P)})},D=function(){if(jt)return v();r.unlink(S,function(){var I=Z.join(e,Z.join("/",g.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 y=r.createReadStream(I),R();P(j)})})})},R=function(){var I=r.createWriteStream(S),_=i(y,g);I.on("error",function(L){_.destroy(L)}),$a(_,I,function(L){if(L)return v(L);I.on("close",P)})};if(g.type==="directory")return l.push([S,g.mtime]),Oa(S,{fs:r,own:s,uid:g.uid,gid:g.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:g.uid,gid:g.gid},function(L){if(L)return v(L);switch(g.type){case"file":return R();case"link":return D();case"symlink":return C()}if(p)return v(new Error("unsupported type for "+S+" ("+g.type+")"));y.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)}});c();c();var xr=Q(ue(),1);c();c();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:
1
+ import{b as bi}from"./chunk-LQ7ENG4V.js";import{$ as ii,A as zn,Aa as gi,B as k,Ba as yi,C as U,Ca as wi,D as Jn,E as ve,F as Zt,G as qe,H as rt,I as xe,Ia as To,J as Qn,Ja as vi,K as Ne,Ka as mr,L as Pe,La as ze,M as Kn,Ma as at,N as er,Na as Pt,O as he,Oa as pr,P as Do,Pa as lt,Q as Xn,Qa as hr,R as ot,Ra as ki,S as nt,Sa as Ei,T as Zn,Ta as Si,U as tr,Ua as gr,V as ei,Va as xi,W as ti,Wa as Pi,X as ri,Xa as Di,Y as oi,Z as ni,_ as Ye,a as ue,aa as z,b as Et,ba as it,c as Mn,ca as si,d as Ie,da as ai,e as Se,ea as rr,f as Ge,fa as or,g as Un,ga as li,h as Bn,ha as ge,i as Vn,ia as ci,j as ko,ja as di,k as et,ka as Co,l as St,la as ui,m as je,ma as fi,n as Gn,na as mi,o as Qt,oa as nr,p as Eo,pa as ir,q as xt,qa as sr,r as So,ra as pi,s as qn,sa as ar,t as Yn,ta as lr,u as xo,ua as hi,v as Wn,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-4DIR65KL.js";import{a as yr}from"./chunk-FKIVKNOV.js";import{a as _n}from"./chunk-JLGA3B7P.js";import{b as Ln}from"./chunk-HGFCNPSN.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-MVJSQT7V.js";import{a as pl,b as Hn,d as hl}from"./chunk-BU6LJZG7.js";import{a as fr,b as Io,c as Oo}from"./chunk-BPJRQOHO.js";import{c as On}from"./chunk-F3TMLDLC.js";import{b as O}from"./chunk-UBTHWHPB.js";import{Da as ul,Ea as Dn,Fa as fl,Ga as ml,c as wn,ka as pe,q as vn,r as ae}from"./chunk-KYNXMDFU.js";import{B as Pn,l as kn,m as Ee,p as qt,s as En,u as Sn,x as xn}from"./chunk-5GUXN2RU.js";import{A as Y,B as Cn,C as Re,D as $e,E as Te,H as ee,S as bo,a as Gt,y as B,z as N}from"./chunk-PSSOCUUD.js";import{h as E,k as Wt}from"./chunk-W3BNL2Q5.js";import{a as cl}from"./chunk-CX5CC6P5.js";import{b as dl}from"./chunk-TOLPNBZK.js";import{Ab as In,Bb as V,Ca as yo,Cb as te,Ea as Vt,Ga as gn,Ha as yn,Ka as wo,Oa as vo,Ta as G,U as Ut,Wa as kt,_ as pn,jb as bn,ma as de,mb as Yt,na as hn,pa as Bt,qa as go,qb as we,sb as W,ua as K,ub as Ae,wa as bt,xb as F,ya as ke,yb as Tn,zb as Fe}from"./chunk-G5QSVBYP.js";import{i as H}from"./chunk-B4OMIONW.js";import{r as zt}from"./chunk-2Z52XJQG.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 be,c as ce,e as Q,g as c}from"./chunk-VKWPEFWQ.js";var Ys=ce((Xw,qs)=>{c();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)=>{c();var Yr=Hn(),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)=>{c();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)=>{c();var Zs=Hn().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)=>{c();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(),l=sd.obj({highWaterMark:1},function(m,f,p){if(ld(m))return u(m,null,p);if(Buffer.isBuffer(m)||(m=ad(m)),n){var h=Array.prototype.indexOf.call(m,10);if(h>0&&m[h-1]===13&&h--,h>-1)return i.push(m.slice(0,h)),u(Buffer.concat(i),m.slice(h),p)}if(i.push(m),s+=m.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(m){if(m)return a.destroy(m);a.uncork()})},u=function(m,f,p){a.removeListener("preend",d),t(m,function(h,b){if(h)return p(h);a.setWritable(b),a.setReadable(b),m&&b.write(m),f&&b.write(f),f=i=l=null,p()})};return a.on("preend",d),a.setWritable(l),a};oa.exports=ra});var aa=ce((lv,sa)=>{c();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(l){r||(r=l),l&&o.forEach(ia),!s&&(o.forEach(ia),t(r))})});e.reduce(hd)};sa.exports=gd});var da=ce((dv,Jr)=>{c();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(l){if(o.removeListener("close",a),l)return o.destroy(l.message==="premature close"?null:l);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";c();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";c();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)=>{c();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";c();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,l=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,l))})},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)=>{c();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(l,d){l?s(l,d):yt(e,t,s,d)}):i.stat(e,function(l,d){l||!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=>{c();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(l){if(!s.length)return l();var d=s.shift(),u=Z.join(r,d);t.call(e,u,function(m,f){if(m)return l(m);if(!f.isDirectory())return l(null,d,f);e.readdir(u,function(p,h){if(p)return l(p);i&&h.sort();for(var b=0;b<h.length;b++)o(Z.join(r,d,h[b]))||s.push(Z.join(d,h[b]));l(null,d,f)})})}},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,l=typeof t.umask=="number"?~t.umask:~ja(),d=typeof t.dmode=="number"?t.dmode:0,u=typeof t.fmode=="number"?t.fmode:0,m=t.pack||Ra.pack(),f=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(w,g){r.readlink(Z.join(e,w),function(y,v){if(y)return m.destroy(y);g.linkname=Zo(v),m.entry(g,b)})},h=function(w,g,y){if(w)return m.destroy(w);if(!g)return t.finalize!==!1&&m.finalize(),f(m);if(y.isSocket())return b();var v={name:Zo(g),mode:(y.mode|(y.isDirectory()?d:u))&l,mtime:y.mtime,size:y.size,type:"file",uid:y.uid,gid:y.gid};if(y.isDirectory())return v.size=0,v.type="directory",v=n(v)||v,m.entry(v,b);if(y.isSymbolicLink())return v.size=0,v.type="symlink",v=n(v)||v,p(g,v);if(v=n(v)||v,!y.isFile())return a?m.destroy(new Error("unsupported type for "+g)):b();var S=m.entry(v,b);if(S){var P=i(r.createReadStream(Z.join(e,g),{start:0,end:v.size>0?v.size-1:v.size}),v);P.on("error",function(C){S.destroy(C)}),$a(P,S)}},b=function(w){if(w)return m.destroy(w);s(h)};return b(),m};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(),l=[],d=new Date,u=typeof t.umask=="number"?~t.umask:~ja(),m=typeof t.dmode=="number"?t.dmode:0,f=typeof t.fmode=="number"?t.fmode:0,p=t.strict!==!1;t.strip&&(n=Fa(n,t.strip)),t.readable&&(m|=parseInt(555,8),f|=parseInt(444,8)),t.writable&&(m|=parseInt(333,8),f|=parseInt(222,8));var h=function(g,y){for(var v;(v=Fd(l))&&g.slice(0,v[0].length)!==v[0];)l.pop();if(!v)return y();r.utimes(v[0],d,v[1],y)},b=function(g,y,v){if(t.utimes===!1)return v();if(y.type==="directory")return r.utimes(g,d,y.mtime,v);if(y.type==="symlink")return h(g,v);r.utimes(g,d,y.mtime,function(S){if(S)return v(S);h(g,v)})},w=function(g,y,v){var S=y.type==="symlink",P=S?r.lchmod:r.chmod,C=S?r.lchown:r.chown;if(!P)return v();var D=(y.mode|(y.type==="directory"?m:f))&u;C&&s?C.call(r,g,y.uid,y.gid,R):R(null);function R($){if($)return v($);if(!P)return v();P.call(r,g,D,v)}};return a.on("entry",function(g,y,v){g=n(g)||g,g.name=Zo(g.name);var S=Z.join(e,Z.join("/",g.name));if(o(S,g))return y.resume(),v();var P=function(I){if(I)return v(I);b(S,g,function(_){if(_)return v(_);if(jt)return v();w(S,g,v)})},C=function(){if(jt)return v();r.unlink(S,function(){var I=Z.resolve(Z.dirname(S),g.linkname);if(!_a(I,e))return v(new Error(S+" is not a valid symlink"));r.symlink(g.linkname,S,P)})},D=function(){if(jt)return v();r.unlink(S,function(){var I=Z.join(e,Z.join("/",g.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 y=r.createReadStream(I),R();P(j)})})})},R=function(){var I=r.createWriteStream(S),_=i(y,g);I.on("error",function(L){_.destroy(L)}),$a(_,I,function(L){if(L)return v(L);I.on("close",P)})};if(g.type==="directory")return l.push([S,g.mtime]),Oa(S,{fs:r,own:s,uid:g.uid,gid:g.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:g.uid,gid:g.gid},function(L){if(L)return v(L);switch(g.type){case"file":return R();case"link":return D();case"symlink":return C()}if(p)return v(new Error("unsupported type for "+S+" ("+g.type+")"));y.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)}});c();c();var xr=Q(ue(),1);c();c();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
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)}c();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=":?[^\\/\\?]+\\?",l=`^(${a}\\/)?`+n.replaceAll(".","\\.").replace(/\//g,`\\/(${a}\\/)?`).replace(/:[^/)?]+/g,"(:[^\\/]+|\\*)")+`(\\/${a})?$`;new RegExp(l).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
3
  Including these routes improves compatibility with Shopify\u2019s platform:
4
4
 
@@ -125,12 +125,12 @@ The deployment can be reached at the ${g.url} preview URL`;return w.authBypassTo
125
125
  }
126
126
  }
127
127
  }
128
- `;async function Ss(e,t){let{hydrogenStorefront:r}=await ot(rc,e,{id:t});return{storefront:r}}c();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:l,forceClientSourcemap:d=!1,noVerify:u,lockfileCheck:m,jsonOutput:f,path:p,shop:h,assetsDir:b,metadataUrl:w,metadataUser:g,metadataVersion:y,entry:v,workerDir:S}=e,{metadataDescription:P}=e,C=!0;try{await jn(p)}catch(A){if(A instanceof Fn&&(C=!1),!l&&!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+=`:
128
+ `;async function Ss(e,t){let{hydrogenStorefront:r}=await ot(rc,e,{id:t});return{storefront:r}}c();async function Me({root:e,session:t,config:r,cliCommand:o}){let n=await Zn(t),i=r.storefront?.id?n.find(({id:s})=>s===r.storefront.id):void 0;return i||(Es({noStorefronts:!n.length}),await yi(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:l,forceClientSourcemap:d=!1,noVerify:u,lockfileCheck:m,jsonOutput:f,path:p,shop:h,assetsDir:b,metadataUrl:w,metadataUser:g,metadataVersion:y,entry:v,workerDir:S}=e,{metadataDescription:P}=e,C=!0;try{await jn(p)}catch(A){if(A instanceof Fn&&(C=!1),!l&&!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
129
 
130
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&&(b||S||lc(Mt));if(me)Be=b??Be,J=S??J;else{let A=await he(p,v).catch(()=>null),q=ac({root:p,viteOutputDirs:A,assetsDirFlag:b,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}:{},...w?{url:w}:{},...g?{user:g}:{},...y?{version:y}:{},...Mt?{hydrogenVersion:Mt}:{}},skipVerification:u,rootPath:p,skipBuild:!1,workerOnly:!1,workerDir:J,overriddenEnvironmentVariables:ne};if(!D&&!Ve.defaultEnvironment&&(le||L)&&!l){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
131
 
132
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:m,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?f&&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&&f&&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}}c();var $t=Q(ue(),1);c();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=!1}){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 l=!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}),l=r||await vc({cumulativeRelease:u,selectedRelease:d,targetVersion:t});while(!l);let m=Tc({appPath:e,cumulativeRelease:u,currentVersion:o,selectedRelease:d,force:r});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 f=await m;await Dc({appPath:e,currentVersion:o,instrunctionsFilePath:f,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,l)=>(a[l.version]||(a[l.version]=l),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(y=>oe.default.gt(y.version,n)&&oe.default.lte(y.version,t.version)?!0:!(M(y.version)===n)||!o?!1:$s({release:y,currentDependencies:o})),a=s.flatMap(y=>y.features),l=s.flatMap(y=>y.fixes),d=[...s].sort((y,v)=>oe.default.compare(y.version,v.version)),u=new Map,m=new Map;d.forEach((y,v)=>{y.removeDependencies?.forEach(S=>{u.set(S,v)}),y.removeDevDependencies?.forEach(S=>{m.set(S,v)})});let f=new Set,p=new Set;for(let y=0;y<d.length;y++){let v=d[y];if(!v)continue;let S=v.dependencies??{},P=v.devDependencies??{};Object.keys(S).forEach(C=>{let D=u.get(C);D!==void 0&&y>=D&&f.add(C)}),Object.keys(P).forEach(C=>{let D=m.get(C);D!==void 0&&y>=D&&p.add(C)})}let h=[...new Set(d.flatMap(y=>y.removeDependencies??[]).filter(y=>!f.has(y)))],b=[...new Set(d.flatMap(y=>y.removeDevDependencies??[]).filter(y=>!p.has(y)))],w={},g={};for(let y of d)Object.assign(w,y.dependencies??{}),Object.assign(g,y.devDependencies??{});return{features:a,fixes:l,removeDependencies:h,removeDevDependencies:b,dependencies:w,devDependencies:g}}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 f of Object.entries(s))Is({currentDependencies:t,dependency:f,selectedRelease:e,targetVersion:r})&&i.push(`${f[0]}@${Ts(f[0],f[1],r)}`);for(let f of Object.entries(a))Is({currentDependencies:t,dependency:f,selectedRelease:e,targetVersion:r})&&i.push(`${f[0]}@${Ts(f[0],f[1],r)}`);let l=Object.entries(t).find(jr),d=Object.entries(s).find(jr);l&&d&&oe.default.lt(M(l[1]),M(d[1]))&&i.push(...Sc({currentDependencies:t,selectedRemix:d}));let u=Object.entries(t).find(Ho),m=Object.entries(s).find(Ho);return m&&(!u||oe.default.lt(M(u[1]),M(m[1])))&&i.push(...xc({currentDependencies:t,selectedReactRouter:m})),i}async function kc({appPath:e,selectedRelease:t,currentDependencies:r,targetVersion:o,cumulativeRemoveDependencies:n,cumulativeRemoveDevDependencies:i,cumulativeDependencies:s,cumulativeDevDependencies:a}){let l=[],d=[...n,...i].filter(m=>m in r);d.length>0&&l.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&&l.push({title:"Upgrading dependencies",task:async()=>{let m=await Ee(e),f=m==="npm"?"install":m==="yarn"||m==="pnpm"?"add":"install",p=m==="npm"||m==="unknown"?["--legacy-peer-deps"]:[];await bo(Fs(m),[f,...p,...u],{cwd:e})}}),l.length>0&&await ee(l,{})}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:
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?f&&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&&f&&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}}c();var $t=Q(ue(),1);c();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=!1}){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 l=!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}),l=r||await vc({cumulativeRelease:u,selectedRelease:d,targetVersion:t});while(!l);let m=Tc({appPath:e,cumulativeRelease:u,currentVersion:o,selectedRelease:d,force:r});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 f=await m;await Dc({appPath:e,currentVersion:o,instrunctionsFilePath:f,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,l)=>(a[l.version]||(a[l.version]=l),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(y=>oe.default.gt(y.version,n)&&oe.default.lte(y.version,t.version)?!0:!(M(y.version)===n)||!o?!1:$s({release:y,currentDependencies:o})),a=s.flatMap(y=>y.features),l=s.flatMap(y=>y.fixes),d=[...s].sort((y,v)=>oe.default.compare(y.version,v.version)),u=new Map,m=new Map;d.forEach((y,v)=>{y.removeDependencies?.forEach(S=>{u.set(S,v)}),y.removeDevDependencies?.forEach(S=>{m.set(S,v)})});let f=new Set,p=new Set;for(let y=0;y<d.length;y++){let v=d[y];if(!v)continue;let S=v.dependencies??{},P=v.devDependencies??{};Object.keys(S).forEach(C=>{let D=u.get(C);D!==void 0&&y>=D&&f.add(C)}),Object.keys(P).forEach(C=>{let D=m.get(C);D!==void 0&&y>=D&&p.add(C)})}let h=[...new Set(d.flatMap(y=>y.removeDependencies??[]).filter(y=>!f.has(y)))],b=[...new Set(d.flatMap(y=>y.removeDevDependencies??[]).filter(y=>!p.has(y)))],w={},g={};for(let y of d)Object.assign(w,y.dependencies??{}),Object.assign(g,y.devDependencies??{});return{features:a,fixes:l,removeDependencies:h,removeDevDependencies:b,dependencies:w,devDependencies:g}}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 f of Object.entries(s))Is({currentDependencies:t,dependency:f,selectedRelease:e,targetVersion:r})&&i.push(`${f[0]}@${Ts(f[0],f[1],r)}`);for(let f of Object.entries(a))Is({currentDependencies:t,dependency:f,selectedRelease:e,targetVersion:r})&&i.push(`${f[0]}@${Ts(f[0],f[1],r)}`);let l=Object.entries(t).find(jr),d=Object.entries(s).find(jr);l&&d&&oe.default.lt(M(l[1]),M(d[1]))&&i.push(...Sc({currentDependencies:t,selectedRemix:d}));let u=Object.entries(t).find(Ho),m=Object.entries(s).find(Ho);return m&&(!u||oe.default.lt(M(u[1]),M(m[1])))&&i.push(...xc({currentDependencies:t,selectedReactRouter:m})),i}async function kc({appPath:e,selectedRelease:t,currentDependencies:r,targetVersion:o,cumulativeRemoveDependencies:n,cumulativeRemoveDevDependencies:i,cumulativeDependencies:s,cumulativeDevDependencies:a}){let l=[],d=[...n,...i].filter(m=>m in r);d.length>0&&l.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&&l.push({title:"Upgrading dependencies",task:async()=>{let m=await Ee(e),f=m==="npm"?"install":m==="yarn"||m==="pnpm"?"add":"install",p=m==="npm"||m==="unknown"?["--legacy-peer-deps"]:[];await bo(Fs(m),[f,...p,...u],{cwd:e})}}),l.length>0&&await ee(l,{})}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} - ${bi(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
134
  file://${o}`;i.push(p)}let s=`https://hydrogen.shopify.dev/releases/${r.version}`;i.push(`Release notes:
135
135
  ${s}`);let a=M(t),l=M(r.version),d=a===l,u=`${a} \u2192 ${l}`,m=d?`You've upgraded Hydrogen ${l} dependencies`:`You've upgraded from ${u}`,f=await Ee(e);return N({headline:m,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 && ${f} 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
136
  `,o=t?.map((n,i)=>{let s=e.pr?`[#${e.id}](${e.pr})
@@ -190,8 +190,8 @@ Added '${H.yellow(i)}' to your Vite config in ssr.optimizeDeps.include
190
190
  ${H.dim(o.split(`
191
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 m.stack=o,m}let{start:u}=l.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
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:l,env:d,debug:u=!1,disableVersionCheck:m=!1,inspectorPort:f,customerAccountPush:p=!1,envFile:h,cliConfig:b,verbose:w}){process.env.NODE_ENV||(process.env.NODE_ENV="development"),w&&rr(),or()||it(),t===0&&(t=await pt(tt));let g=r??process.cwd(),y=z(g),v=Ei(g,p,h),S=v.then(({fetchRemote:J,localVariables:me})=>hr({root:g,envBranch:l,envHandle:d,fetchRemote:J,localVariables:me,envFile:h}));u&&!f&&(f=await pt(Wn));let P=await Zt(g);Se&&await ke(x(g,"node_modules/.vite"));let C=Promise.resolve().then(()=>et(g)),D=await P.createServer({root:g,clearScreen:!1,cacheDir:process.env.SHOPIFY_UNIT_TEST?x(g,".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:[g,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:f,logRequestLine:wi,entryPointErrorHandler:Ms({disableDepsOptimizer:a,configFile:J.configFile,formatOptionsPromise:C,showSuccessBanner:()=>Us({disableVirtualRoutes:s,debug:u,inspectorPort:f,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(g)).remixConfig,I,_=n?()=>{I?.kill(0),I=Sr({rootDirectory:g,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(g,b,L,me):void 0),y,D.listen(L)]),le=new URL(D.resolvedUrls.local[0]??D.resolvedUrls.network[0]),_e=j?.host||le.toString()||le.origin;si({rootDirectory:g,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:f,finalHost:_e,storefrontTitle:Be}),m||js({targetPath:g}),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)))})})}c();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(l=>l.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:l,handle:d,branch:u,type:m,url:f})=>{te();let p=m==="PRODUCTION"?i.productionUrl:f;F(W`${ze(l,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}`);c();function Mc(e){return/[{}@#\s"'\\$`|;&<>()!?*\[\]]/.test(e)||/[\x00-\x1F\x7F]/.test(e)}function Uc(e){return Mc(e)?`"${e.replaceAll("\\","\\\\").replaceAll('"','\\"').replaceAll(`
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:l,env:d,debug:u=!1,disableVersionCheck:m=!1,inspectorPort:f,customerAccountPush:p=!1,envFile:h,cliConfig:b,verbose:w}){process.env.NODE_ENV||(process.env.NODE_ENV="development"),w&&rr(),or()||it(),t===0&&(t=await pt(tt));let g=r??process.cwd(),y=z(g),v=Si(g,p,h),S=v.then(({fetchRemote:J,localVariables:me})=>hr({root:g,envBranch:l,envHandle:d,fetchRemote:J,localVariables:me,envFile:h}));u&&!f&&(f=await pt(zn));let P=await Zt(g);Se&&await ke(x(g,"node_modules/.vite"));let C=Promise.resolve().then(()=>et(g)),D=await P.createServer({root:g,clearScreen:!1,cacheDir:process.env.SHOPIFY_UNIT_TEST?x(g,".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:[g,Se]}:void 0},plugins:[{name:"hydrogen:cli",configResolved(J){Do(J)?.api?.registerPluginOptions({disableVirtualRoutes:s}),Xn(J)?.api?.registerPluginOptions({debug:u,entry:e,envPromise:S.then(({allVariables:me})=>me),inspectorPort:f,logRequestLine:vi,entryPointErrorHandler:Ms({disableDepsOptimizer:a,configFile:J.configFile,formatOptionsPromise:C,showSuccessBanner:()=>Us({disableVirtualRoutes:s,debug:u,inspectorPort:f,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(g)).remixConfig,I,_=n?()=>{I?.kill(0),I=Sr({rootDirectory:g,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?xi(g,b,L,me):void 0),y,D.listen(L)]),le=new URL(D.resolvedUrls.local[0]??D.resolvedUrls.network[0]),_e=j?.host||le.toString()||le.origin;ai({rootDirectory:g,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:f,finalHost:_e,storefrontTitle:Be}),m||js({targetPath:g}),p&&ki(Ht)&&Ei(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:Di(o)}),t&&r&&i.push({body:{warn:Pi(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)))})})}c();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(l=>l.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:l,handle:d,branch:u,type:m,url:f})=>{te();let p=m==="PRODUCTION"?i.productionUrl:f;F(W`${ze(l,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}`);c();function Mc(e){return/[{}@#\s"'\\$`|;&<>()!?*\[\]]/.test(e)||/[\x00-\x1F\x7F]/.test(e)}function Uc(e){return Mc(e)?`"${e.replaceAll("\\","\\\\").replaceAll('"','\\"').replaceAll(`
195
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()]),l=await Me({root:r,session:i,config:s,cliCommand:a});if(!l)return;if(s.storefront=l,e||t){let b=(await lt(i,s.storefront.id))?.environments||[];e?at(b,e):t&&(e=Pt(b,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 m=H.whiteBright(o),f=T(r,o),p={};if(u.forEach(({isSecret:b,key:w,value:g})=>{p[w]=b?'""':Uc(g)}),await G(f)&&!n){let b=await de(f),w=Io(b,p);if(b===w){B({body:`No changes to your ${m} file`});return}let g=yr(b,w);if(!await Te({confirmationMessage:"Yes, confirm changes",cancellationMessage:"No, make changes later",message:W`We'll make the following changes to your ${m} file:
196
196
 
197
197
  ${we.linesDiff(g)}
@@ -223,20 +223,20 @@ ${we.linesDiff(v)}
223
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
224
 
225
225
  ${we.linesDiff(v)}
226
- Continue?`.value}))return;if(!i.id)throw new E("Missing environment ID");let{userErrors:S}=await Bs(l,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.`})}c();c();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}".`)}};c();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}`)])}};c();var Ue=Q(ue(),1);c();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.
226
+ Continue?`.value}))return;if(!i.id)throw new E("Missing environment ID");let{userErrors:S}=await Bs(l,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.`})}c();c();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 ui({...e,v1RouteConvention:di()}),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}".`)}};c();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}`)])}};c();var Ue=Q(ue(),1);c();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
227
  You are currently running v${r}.
228
228
 
229
- `+s,reference:n}),{currentVersion:r,newVersion:o}}}c();c();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(),l=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 l}}],m=await z(),f=`# The variables added in this file are only available locally in MiniOxygen.
229
+ `+s,reference:n}),{currentVersion:r,newVersion:o}}}c();c();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 pi(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&&oi(o.session,o.title).then(async({storefront:I,jobId:_})=>(_&&await ni(o.session,_),I)).catch(i),a=await Bn(),l=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 l}}],m=await z(),f=`# The variables added in this file are only available locally in MiniOxygen.
230
230
  # Run \`${m} link\` to also inject environment variables from your storefront,
231
- # or \`${m} env pull\` to populate this file.`;l=l.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"),f)),o.id?_={id:o.id,title:o.title}:s&&I.push(s.then(L=>{_=L}))):r==="mock"&&I.push(K(x(n.directory,".env"),f+`
231
+ # or \`${m} env pull\` to populate this file.`;l=l.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(ei(n.directory,o),K(x(n.directory,".env"),f)),o.id?_={id:o.id,title:o.title}:s&&I.push(s.then(L=>{_=L}))):r==="mock"&&I.push(K(x(n.directory,".env"),f+`
232
232
  `+[["SESSION_SECRET","foobar"]].map(([L,j])=>`${L}="${j}"`).join(`
233
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);l=l.then(()=>h().catch(i)).then(()=>e.git?dr(n.directory):void 0);let{setupCss:b,cssStrategy:w}=await pi(n.directory,t,e.styling);w&&(l=l.then(()=>b().catch(i)).then(()=>e.git?We(n.directory,"Setup "+xt[w]):void 0));let{packageManager:g,shouldInstallDeps:y,installDeps:v}=await cr(n.directory,t,e.packageManager,e.installDeps),S={language:p,packageManager:g,cssStrategy:w,depsInstalled:!1,cliCommand:await z("",g)};if(y){let I=l.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&&(l=l.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,l=l.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}c();import{readdir as Ga}from"node:fs/promises";c();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.
234
+ `)),Promise.all(I).then(()=>{if(_)return ti(n.directory,_)}).catch(i)});let{language:p,transpileProject:h}=await lr(n.directory,t,e.language);l=l.then(()=>h().catch(i)).then(()=>e.git?dr(n.directory):void 0);let{setupCss:b,cssStrategy:w}=await hi(n.directory,t,e.styling);w&&(l=l.then(()=>b().catch(i)).then(()=>e.git?We(n.directory,"Setup "+xt[w]):void 0));let{packageManager:g,shouldInstallDeps:y,installDeps:v}=await cr(n.directory,t,e.packageManager,e.installDeps),S={language:p,packageManager:g,cssStrategy:w,depsInstalled:!1,cliCommand:await z("",g)};if(y){let I=l.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&&(l=l.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 mi(t,S.cliCommand,e.i18n),{setupRoutes:$}=nr(t);return S.i18n=D,l=l.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}c();import{readdir as Ga}from"node:fs/promises";c();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(Vn());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
236
  Please check your internet connection and the following error:
237
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:w}=s;await Bt(w,o.directory)}).catch(n),l=await G(x(s.sourcePath,"tsconfig.json")),{language:d,transpileProject:u}=l?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:m,shouldInstallDeps:f,installDeps:p}=await cr(o.directory,t,e.packageManager,e.installDeps),h={language:d,packageManager:m,depsInstalled:!1,cliCommand:await z("",m)},b=[{title:"Downloading template",task:async()=>{await i}},{title:"Setting up project",task:async()=>{await a}}];if(f&&b.push({title:"Installing dependencies. This could take a few minutes",task:async()=>{try{await p(),h.depsInstalled=!0}catch(w){h.depsError=w}}}),!t.signal.aborted)return await ee(b),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(l=>l!=="skeleton"&&!l.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 Gt;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)}c();c();var qd=`#graphql
238
+ `+r.message,r.tryMessage)}}async function Va(e,t){let r=Ln(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:w}=s;await Bt(w,o.directory)}).catch(n),l=await G(x(s.sourcePath,"tsconfig.json")),{language:d,transpileProject:u}=l?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:m,shouldInstallDeps:f,installDeps:p}=await cr(o.directory,t,e.packageManager,e.installDeps),h={language:d,packageManager:m,depsInstalled:!1,cliCommand:await z("",m)},b=[{title:"Downloading template",task:async()=>{await i}},{title:"Setting up project",task:async()=>{await a}}];if(f&&b.push({title:"Installing dependencies. This could take a few minutes",task:async()=>{try{await p(),h.depsInstalled=!0}catch(w){h.depsError=w}}}),!t.signal.aborted)return await ee(b),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(l=>l!=="skeleton"&&!l.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 Gt;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(fi),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}=Jn(process.argv,Vd)){if(Mn(),!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)}c();c();var qd=`#graphql
240
240
  query ListStorefronts {
241
241
  hydrogenStorefronts {
242
242
  id
@@ -249,21 +249,21 @@ Skip the flag or provide the name of a template or example in the Hydrogen repos
249
249
  }
250
250
  }
251
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}`);c();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)}c();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."})}c();var rn=Q(ue(),1);c();async function Ja(e){let{startWorkerdServer:t}=await import("./workerd-JWZNKSHU.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:l=!1,codegen:d=!1,codegenConfigPath:u,entry:m,envFile:f}){process.env.NODE_ENV||(process.env.NODE_ENV=l?"development":"production"),s&&rr(),or()||it();let{root:p,buildPath:h,buildPathWorkerFile:b,buildPathClient:w}=xe(t),g=await rt(p);if(g)throw new E(Pe);let y,v=Tt(),P=a?await Je({...{directory:p,entry:m,disableRouteWarning:!1,lockfileCheck:!1,sourcemap:!0,bundleStats:!1,useCodegen:d,codegenConfigPath:u},watch:l,async onServerBuildFinish(){v.state==="pending"?v.resolve():F("\u{1F3D7}\uFE0F Project rebuilt. Reloading server..."),await y?.reload()}}):v.resolve();g||(b=(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:f});e||(e=await pt(tt));let _=await pt(e+100);return await v.promise,I(),y=await Ja({root:p,appPort:e,assetsPort:_,env:$,buildPathClient:w,buildPathWorkerFile:b,inspectorPort:n,debug:i,watch:l}),y.showBanner({mode:"preview",headlinePrefix:l?"Watching for changes. ":""}),{async close(){await Promise.allSettled([y.close(),P?.close()])}}}c();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 Gt,{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}}],l=e.markets?e.markets:await Xt({abortSignal:t.signal,extraChoices:{none:"Set up later"}}),d=l==="none"?void 0:l,{setupRoutes:u}=nr(t),m,f=await Mn(".."),[p,h]=await Promise.all([G(x(r,"tsconfig.json")),kt("*.d.ts",{cwd:f})]);s=s.then(()=>Promise.all([...h.map(y=>Bt(x(f,y),T(r,y))),ir({rootDirectory:r,appDirectory:o,typescript:p})])).then(async()=>{m=await u(r,p?"ts":"js",{i18nStrategy:d,overwriteFileDeps:!0})}),d&&(s=s.then(()=>Kt(d,{rootDirectory:r})));let b=await Promise.resolve(i),{createShortcut:w,showShortcutBanner:g}=await sr(t,b,e.shortcut);!d&&!w||(w&&(s=s.then(async()=>{await w()&&(b=Ye)}),g()),await ee(a),await st({location:n,name:n,directory:r},{cliCommand:b,depsInstalled:!0,packageManager:"npm",i18n:d,routes:m}))}c();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:l,generatedAssets:d,needsInstallDeps:u}=a,m=[{title:"Updating files",task:async()=>{await l}}],f=!1;if(o&&u){let p=Ee(i.rootDirectory);m.push({title:"Installing new dependencies",task:async()=>{let h=await p;f=h==="npm"||h==="unknown",await qt({directory:i.rootDirectory,packageManager:h,args:[]})}})}await ee(m),N({headline:`${xt[s]} setup complete.`,body:(d.length>0?`You can now modify CSS configuration in the following files:
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}`);c();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(),si(!0);let{config:r}=await ge(e,t??!0);ci(r)}c();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 li(e),N({body:"You are logged out from Shopify."})}c();var rn=Q(ue(),1);c();async function Ja(e){let{startWorkerdServer:t}=await import("./workerd-SOWC66FA.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:l=!1,codegen:d=!1,codegenConfigPath:u,entry:m,envFile:f}){process.env.NODE_ENV||(process.env.NODE_ENV=l?"development":"production"),s&&rr(),or()||it();let{root:p,buildPath:h,buildPathWorkerFile:b,buildPathClient:w}=xe(t),g=await rt(p);if(g)throw new E(Pe);let y,v=Tt(),P=a?await Je({...{directory:p,entry:m,disableRouteWarning:!1,lockfileCheck:!1,sourcemap:!0,bundleStats:!1,useCodegen:d,codegenConfigPath:u},watch:l,async onServerBuildFinish(){v.state==="pending"?v.resolve():F("\u{1F3D7}\uFE0F Project rebuilt. Reloading server..."),await y?.reload()}}):v.resolve();g||(b=(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:f});e||(e=await pt(tt));let _=await pt(e+100);return await v.promise,I(),y=await Ja({root:p,appPort:e,assetsPort:_,env:$,buildPathClient:w,buildPathWorkerFile:b,inspectorPort:n,debug:i,watch:l}),y.showBanner({mode:"preview",headlinePrefix:l?"Watching for changes. ":""}),{async close(){await Promise.allSettled([y.close(),P?.close()])}}}c();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 Gt,{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}}],l=e.markets?e.markets:await Xt({abortSignal:t.signal,extraChoices:{none:"Set up later"}}),d=l==="none"?void 0:l,{setupRoutes:u}=nr(t),m,f=await Un(".."),[p,h]=await Promise.all([G(x(r,"tsconfig.json")),kt("*.d.ts",{cwd:f})]);s=s.then(()=>Promise.all([...h.map(y=>Bt(x(f,y),T(r,y))),ir({rootDirectory:r,appDirectory:o,typescript:p})])).then(async()=>{m=await u(r,p?"ts":"js",{i18nStrategy:d,overwriteFileDeps:!0})}),d&&(s=s.then(()=>Kt(d,{rootDirectory:r})));let b=await Promise.resolve(i),{createShortcut:w,showShortcutBanner:g}=await sr(t,b,e.shortcut);!d&&!w||(w&&(s=s.then(async()=>{await w()&&(b=Ye)}),g()),await ee(a),await st({location:n,name:n,directory:r},{cliCommand:b,depsInstalled:!0,packageManager:"npm",i18n:d,routes:m}))}c();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 Yn();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 qn(s,i,r);if(!a)return;let{workPromise:l,generatedAssets:d,needsInstallDeps:u}=a,m=[{title:"Updating files",task:async()=>{await l}}],f=!1;if(o&&u){let p=Ee(i.rootDirectory);m.push({title:"Installing new dependencies",task:async()=>{let h=await p;f=h==="npm"||h==="unknown",await qt({directory:i.rootDirectory,packageManager:h,args:[]})}})}await ee(m),N({headline:`${xt[s]} setup complete.`,body:(d.length>0?`You can now modify CSS configuration in the following files:
254
254
  `+d.map(p=>` - ${p}`).join(`
255
255
  `)+`
256
256
  `:"")+`
257
257
  For more information, visit ${So[s]}`}),u&&f&&s==="tailwind"&&Y({body:[`Due to a bug in NPM, you might need to reinstall dependencies again.
258
- Run`,{command:"npm install"}]})}c();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."}
258
+ Run`,{command:"npm install"}]})}c();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 ${Wn[o].toLowerCase()}.`,body:`You can now modify the supported locales in ${n.serverEntryPoint??"your server entry file."}
259
259
  `})}c();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
260
  plugins: {
261
261
  tailwindcss: {},
262
262
  autoprefixer: {},
263
263
  },
264
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"),l=!!t.tailwind,d=T(e,"postcss.config.js"),u=()=>{},m=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,f=>f.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 f=>{let p=f.includes("tailwindcss"),b=f.includes("module.exports")||f.includes("exports.")||f.includes("require(")?d.replace(".js",".cjs"):d;return!p&&l&&(f=await St(f.replace(/(plugins:\s+{)/,`$1
266
- tailwindcss: {},`),o,b)),K(b,f)}).catch(async()=>{if(l&&!await G(d)&&!await G(d.replace(".js",".cjs")))return K(d,ru)}).catch(u),Vn(a,e,{onResult(f){return f.dependencies&&delete f.dependencies["@remix-run/css-bundle"],f.devDependencies&&f.devDependencies["@vanilla-extract/css"]&&(f.devDependencies["@vanilla-extract/vite-plugin"]="^4.0.0",f.devDependencies=Object.keys(f.devDependencies).sort().reduce((p,h)=>(p[h]=f.devDependencies?.[h],p),{})),f}}),de(T(a,"vite.config.js")).then(async f=>{r.devDependencies?.["@vanilla-extract/css"]&&(f=f.replace(/\n\n/g,`
265
+ `;async function ou({directory:e}){if(te(),await Kn(e))throw new E("This project already has a Vite config file.");let[t,r,o]=await Promise.all([Qn(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"),l=!!t.tailwind,d=T(e,"postcss.config.js"),u=()=>{},m=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,f=>f.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 f=>{let p=f.includes("tailwindcss"),b=f.includes("module.exports")||f.includes("exports.")||f.includes("require(")?d.replace(".js",".cjs"):d;return!p&&l&&(f=await St(f.replace(/(plugins:\s+{)/,`$1
266
+ tailwindcss: {},`),o,b)),K(b,f)}).catch(async()=>{if(l&&!await G(d)&&!await G(d.replace(".js",".cjs")))return K(d,ru)}).catch(u),Gn(a,e,{onResult(f){return f.dependencies&&delete f.dependencies["@remix-run/css-bundle"],f.devDependencies&&f.devDependencies["@vanilla-extract/css"]&&(f.devDependencies["@vanilla-extract/vite-plugin"]="^4.0.0",f.devDependencies=Object.keys(f.devDependencies).sort().reduce((p,h)=>(p[h]=f.devDependencies?.[h],p),{})),f}}),de(T(a,"vite.config.js")).then(async f=>{r.devDependencies?.["@vanilla-extract/css"]&&(f=f.replace(/\n\n/g,`
267
267
  import {vanillaExtractPlugin} from '@vanilla-extract/vite-plugin';
268
268
 
269
269
  `).replace(/^(\s+)\],/m,`$1 vanillaExtractPlugin(),
@@ -272,7 +272,7 @@ $1$2`)),w&&(f=f.replace(/^(\s+)(future:)/m,`$1ignoredRouteFiles: ${JSON.stringif
272
272
  $1$2`)),g&&(f=f.replace(/^(\s+)(future:)/m,`$1routes: ${g.toString()},
273
273
  $1$2`));let y=T(e,"vite.config."+s.slice(0,2));return f=await St(f,o,y),K(y,f)}),je(T(e,n),!1,f=>(i?`// @ts-ignore
274
274
  `:"")+f.replace("@remix-run/dev/server-build","virtual:remix/server-build")),Qt(s).then(async f=>{let p=T(e,t.appDirectory??"app"),h=x(p,"root."+s);await new Promise(async(b,w)=>{await f.findInFiles({paths:[h,x(p,"routes")],matcher:{rule:{kind:"string_fragment",regex:"\\.css$",inside:{kind:"import_statement",stopBy:"end"}}}},async(y,v)=>{y&&w(y);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)})),b(null)})===0&&b(null)}),await je(h,o,b=>{let w=f.parse(b).root(),g="LiveReload",y={kind:"identifier",regex:g},v=w.find({rule:{kind:"import_specifier",regex:g,inside:{kind:"import_statement",stopBy:"end"}}}),S=w.findAll({rule:{any:[{kind:"jsx_self_closing_element",has:y},{kind:"jsx_element",has:{kind:"jsx_opening_element",has:y}}]}});for(let P of[...S.reverse(),v]){if(!P)continue;let{start:C,end:D}=P.range();b=b.slice(0,C.index)+b.slice(D.index)}return b.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 m}},{title:"Installing new dependencies",task:async()=>{await qt({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)})}c();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."})}c();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}]})}c();import{spawnSync as au}from"node:child_process";c();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.
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)})}c();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 ii();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."})}c();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 ri(t),N({body:["You are no longer linked to",{bold:o}]})}c();import{spawnSync as au}from"node:child_process";c();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
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};
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":gi,"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":wi,"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,4 +1,4 @@
1
- import{a as f}from"./chunk-5VBEPL4S.js";import{a as p}from"./chunk-VEXW766J.js";import{f as c,o as v}from"./chunk-BR3GYG2H.js";import{p as l,v as d}from"./chunk-CNDB4VEM.js";import{b as s,f as h}from"./chunk-BR5CFKIN.js";import{z as a}from"./chunk-T3IMDY72.js";import{a as w}from"./chunk-CTNBSUVU.js";import{e as F,g as r}from"./chunk-VKWPEFWQ.js";r();r();async function u(e,n){let m=e.name??await c("New name for the theme"),i=await f(n,{header:"Select a theme to rename",filter:{theme:e.theme,development:e.development,live:e.live}});await v(i.id,{name:m},n),a({body:[...e.environment?[{subdued:`Environment: ${e.environment}
1
+ import{a as f}from"./chunk-XRWQ7AXY.js";import{a as p}from"./chunk-K3OI5VDE.js";import{f as c,o as v}from"./chunk-TUWRPDTE.js";import{p as l,v as d}from"./chunk-GBYDMHZ3.js";import{b as s,f as h}from"./chunk-2IZROVCY.js";import{z as a}from"./chunk-PSSOCUUD.js";import{a as w}from"./chunk-CTNBSUVU.js";import{e as F,g as r}from"./chunk-VKWPEFWQ.js";r();r();async function u(e,n){let m=e.name??await c("New name for the theme"),i=await f(n,{header:"Select a theme to rename",filter:{theme:e.theme,development:e.development,live:e.live}});await v(i.id,{name:m},n),a({body:[...e.environment?[{subdued:`Environment: ${e.environment}
2
2
 
3
3
  `}]:[],"The theme",...p(i),"was renamed to",`'${m}'`]})}var t=F(w(),1);var o=class extends d{static summary="Renames an existing theme.";static descriptionWithMarkdown=`Renames a theme in your store.
4
4
 
@@ -1 +1 @@
1
- import{C as f,D as g,x as d}from"./chunk-5QCSJYJ4.js";import{b as c,c as l,d as u}from"./chunk-BR5CFKIN.js";import{b as m}from"./chunk-PUGAY4JP.js";import{G as e}from"./chunk-T3IMDY72.js";import{wb as n}from"./chunk-TNYPQ2UL.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();o();async function h(a){let t;try{t=await g()}catch(i){if(a.json&&i instanceof f){n(JSON.stringify({organizations:[]},null,2));return}throw i}if(a.json){let i={organizations:t.map(s=>({id:s.id,gid:d(s.id),name:s.businessName}))};n(JSON.stringify(i,null,2));return}p(t)}function p(a){let t=a.map(i=>({id:i.id,name:i.businessName}));e({rows:t,columns:{id:{header:"ID"},name:{header:"NAME"}}})}var r=class a extends m{static baseFlags=u;static summary="List Shopify organizations you have access to.";static descriptionWithMarkdown="Lists the Shopify organizations that you have access to, along with their organization IDs.";static description=this.descriptionWithoutMarkdown();static flags={...c,...l};async run(){let{flags:t}=await this.parse(a);await h({json:t.json})}};export{r as a};
1
+ import{C as f,D as g,x as d}from"./chunk-ADS7BFDG.js";import{b as c,c as l,d as u}from"./chunk-2IZROVCY.js";import{b as m}from"./chunk-UBTHWHPB.js";import{G as e}from"./chunk-PSSOCUUD.js";import{wb as n}from"./chunk-G5QSVBYP.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();o();async function h(a){let t;try{t=await g()}catch(i){if(a.json&&i instanceof f){n(JSON.stringify({organizations:[]},null,2));return}throw i}if(a.json){let i={organizations:t.map(s=>({id:s.id,gid:d(s.id),name:s.businessName}))};n(JSON.stringify(i,null,2));return}p(t)}function p(a){let t=a.map(i=>({id:i.id,name:i.businessName}));e({rows:t,columns:{id:{header:"ID"},name:{header:"NAME"}}})}var r=class a extends m{static baseFlags=u;static summary="List Shopify organizations you have access to.";static descriptionWithMarkdown="Lists the Shopify organizations that you have access to, along with their organization IDs.";static description=this.descriptionWithoutMarkdown();static flags={...c,...l};async run(){let{flags:t}=await this.parse(a);await h({json:t.json})}};export{r as a};
@@ -1,2 +1,2 @@
1
- import{Ab as d}from"./chunk-TNYPQ2UL.js";import{g as p}from"./chunk-VKWPEFWQ.js";p();import{spawn as m}from"child_process";function b(n=process.pid,s="SIGTERM",e=!0,i){$(n,s,e,i??(t=>{t&&d(`Failed to kill process ${n}: ${t}`)}))}function $(n,s,e,i){let o=typeof n=="number"?n.toString():n;if(!/^\d+$/.test(o)){i(new Error("pid must be a number"));return}let t={};t[o]=[];let r=new Set;switch(r.add(o),process.platform){case"win32":{m("taskkill",["/pid",o,"/T","/F"]).on("close",f=>{f===0?i():i(new Error(`taskkill exited with code ${f}`))});break}case"darwin":h(o,t,r,function(c){return m("pgrep",["-lfP",c])},function(){k(t,s,o,e,i)});break;default:h(o,t,r,function(c){return m("ps",["-o","pid command","--no-headers","--ppid",c])},function(){k(t,s,o,e,i)});break}}function k(n,s,e,i,o){let t=new Set;try{Object.keys(n).forEach(function(r){n[r].forEach(function(c){t.has(c)||(w(c,s),t.add(c))}),r===e&&i&&!t.has(r)&&(w(r,s),t.add(r))})}catch(r){o(r);return}o()}function w(n,s){try{process.kill(parseInt(n,10),s)}catch(e){if(e.code!=="ESRCH")throw e}}function h(n,s,e,i,o){let t=i(n),r="";t.stdout?.on("data",function(f){let a=f.toString("ascii");r+=a});let c=f=>{if(e.delete(n),f!==0){if(e.size===0){o();return}return}r.trim().split(`
1
+ import{Ab as d}from"./chunk-G5QSVBYP.js";import{g as p}from"./chunk-VKWPEFWQ.js";p();import{spawn as m}from"child_process";function b(n=process.pid,s="SIGTERM",e=!0,i){$(n,s,e,i??(t=>{t&&d(`Failed to kill process ${n}: ${t}`)}))}function $(n,s,e,i){let o=typeof n=="number"?n.toString():n;if(!/^\d+$/.test(o)){i(new Error("pid must be a number"));return}let t={};t[o]=[];let r=new Set;switch(r.add(o),process.platform){case"win32":{m("taskkill",["/pid",o,"/T","/F"]).on("close",f=>{f===0?i():i(new Error(`taskkill exited with code ${f}`))});break}case"darwin":h(o,t,r,function(c){return m("pgrep",["-lfP",c])},function(){k(t,s,o,e,i)});break;default:h(o,t,r,function(c){return m("ps",["-o","pid command","--no-headers","--ppid",c])},function(){k(t,s,o,e,i)});break}}function k(n,s,e,i,o){let t=new Set;try{Object.keys(n).forEach(function(r){n[r].forEach(function(c){t.has(c)||(w(c,s),t.add(c))}),r===e&&i&&!t.has(r)&&(w(r,s),t.add(r))})}catch(r){o(r);return}o()}function w(n,s){try{process.kill(parseInt(n,10),s)}catch(e){if(e.code!=="ESRCH")throw e}}function h(n,s,e,i,o){let t=i(n),r="";t.stdout?.on("data",function(f){let a=f.toString("ascii");r+=a});let c=f=>{if(e.delete(n),f!==0){if(e.size===0){o();return}return}r.trim().split(`
2
2
  `).forEach(function(a){let l=a.match(/^(\d+)\s(.*)$/);if(l){let u=l[1],E=l[2];s[n].push(u),s[u]=[],d(`Killing process ${u}: ${E}`),e.add(u),h(u,s,e,i,o)}})};t.on("close",c)}export{b as a};
@@ -1 +1 @@
1
- import{b as n}from"./chunk-PUGAY4JP.js";import{y as t}from"./chunk-T3IMDY72.js";import{j as r}from"./chunk-QCMGYBFD.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();var e=class extends n{static description="Run CLI doctor-release tests";static hidden=!0;async run(){r()&&t({headline:"Shopify CLI Doctor Release.",body:["Available doctor-release commands:",""," shopify doctor-release theme -e <environment> Run all theme command tests","","The -e/--environment flag is required to specify the store configuration.","Use --help with any command for more options."]})}};export{e as a};
1
+ import{b as n}from"./chunk-UBTHWHPB.js";import{y as t}from"./chunk-PSSOCUUD.js";import{j as r}from"./chunk-2Z52XJQG.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();var e=class extends n{static description="Run CLI doctor-release tests";static hidden=!0;async run(){r()&&t({headline:"Shopify CLI Doctor Release.",body:["Available doctor-release commands:",""," shopify doctor-release theme -e <environment> Run all theme command tests","","The -e/--environment flag is required to specify the store configuration.","Use --help with any command for more options."]})}};export{e as a};
@@ -1 +1 @@
1
- import{a as e}from"./chunk-HLLMMIIM.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();var t=e({cmd_app_warning_api_key_deprecation_displayed:!1}),i=t;export{i as a};
1
+ import{a as e}from"./chunk-M2M3I63K.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();var t=e({cmd_app_warning_api_key_deprecation_displayed:!1}),i=t;export{i as a};
@@ -1 +1 @@
1
- import{a as o}from"./chunk-Z3JINOCM.js";import{b as a}from"./chunk-PUGAY4JP.js";import{g as s}from"./chunk-VKWPEFWQ.js";s();var t=class extends a{static description="View the UI kit components that process async tasks";static hidden=!0;async run(){await o()}};export{t as a};
1
+ import{a as o}from"./chunk-OAEGTH4Q.js";import{b as a}from"./chunk-UBTHWHPB.js";import{g as s}from"./chunk-VKWPEFWQ.js";s();var t=class extends a{static description="View the UI kit components that process async tasks";static hidden=!0;async run(){await o()}};export{t as a};
@@ -1 +1 @@
1
- import{b as E}from"./chunk-BR5CFKIN.js";import{b}from"./chunk-PUGAY4JP.js";import{Q as F,R as N}from"./chunk-T3IMDY72.js";import{a as U}from"./chunk-CTNBSUVU.js";import{S as C,Ta as w,ma as O,xb as k}from"./chunk-TNYPQ2UL.js";import{i as n}from"./chunk-B4OMIONW.js";import{j as R}from"./chunk-QCMGYBFD.js";import{d as u,f as P,g as x,h as g,n as T,q as y}from"./chunk-773TIA5M.js";import{e as H,g as d}from"./chunk-VKWPEFWQ.js";d();d();d();d();var m=class{static description="Doctor test suite";context;assertions=[];registeredTests=[];async runSuite(t){this.context=t,this.registeredTests=[];let e=[];this.tests();for(let o of this.registeredTests){this.assertions=[];let s=Date.now();try{await o.fn(),e.push({name:o.name,status:this.hasFailures()?"failed":"passed",duration:Date.now()-s,assertions:[...this.assertions]})}catch(r){e.push({name:o.name,status:"failed",duration:Date.now()-s,assertions:[...this.assertions],error:r instanceof Error?r:new Error(String(r))})}}return e}test(t,e){this.registeredTests.push({name:t,fn:e})}tests(){}async run(t,e){let o=e?.cwd??this.context.workingDirectory,s=await F(t,{cwd:o,env:e?.env});return{command:t,exitCode:s.exitCode,stdout:s.stdout,stderr:s.stderr,output:String(s.stdout)+String(s.stderr),success:s.exitCode===0}}async runInteractive(t,e){let o=e?.cwd??this.context.workingDirectory,s=0;try{await N(t,{cwd:o,env:e?.env,stdin:"inherit"})}catch{s=1}return{command:t,exitCode:s,stdout:"",stderr:"",output:"",success:s===0}}assertSuccess(t,e){this.assertions.push({description:e??`Command succeeded: ${t.command}`,passed:t.success,expected:"exit code 0",actual:`exit code ${t.exitCode}`})}assertError(t,e,o){let s=!t.success;if(e){let h=(typeof e=="string"?new RegExp(e):e).test(t.output),c;s?h?c="matched":c=`output: ${t.output.slice(0,200)}`:c="command succeeded",this.assertions.push({description:o??`Command failed with expected error: ${e}`,passed:s&&h,expected:`failure with error matching ${e}`,actual:c})}else this.assertions.push({description:o??`Command failed: ${t.command}`,passed:s,expected:"non-zero exit code",actual:`exit code ${t.exitCode}`})}async assertFile(t,e,o){let s=g(t)?t:u(this.context.workingDirectory,t),r=x(this.context.workingDirectory,s);if(!await w(s)){this.assertions.push({description:o??`File exists: ${r}`,passed:!1,expected:"file exists",actual:"file not found"});return}if(e){let c=await O(s),D=(typeof e=="string"?new RegExp(e):e).test(c);this.assertions.push({description:o??`File ${r} matches ${e}`,passed:D,expected:`content matching ${e}`,actual:D?"matched":`content: ${c.slice(0,200)}...`})}else this.assertions.push({description:o??`File exists: ${r}`,passed:!0,expected:"file exists",actual:"file exists"})}async assertNoFile(t,e){let o=g(t)?t:u(this.context.workingDirectory,t),s=x(this.context.workingDirectory,o),r=await w(o);this.assertions.push({description:e??`File does not exist: ${s}`,passed:!r,expected:"file does not exist",actual:r?"file exists":"file does not exist"})}async assertDirectory(t,e){let o=g(t)?t:u(this.context.workingDirectory,t),s=x(this.context.workingDirectory,o),r=await w(o);this.assertions.push({description:e??`Directory exists: ${s}`,passed:r,expected:"directory exists",actual:r?"directory exists":"directory not found"})}assertOutput(t,e,o){let r=(typeof e=="string"?new RegExp(e):e).test(t.output);this.assertions.push({description:o??`Output matches ${e}`,passed:r,expected:`output matching ${e}`,actual:r?"matched":`output: ${t.output.slice(0,200)}`})}assertJson(t,e,o){try{let s=JSON.parse(t.stdout);if(e){let r=e(s);this.assertions.push({description:o??"Output is valid JSON matching validator",passed:r,expected:"valid JSON matching validator",actual:r?"matched":"validator returned false"})}else this.assertions.push({description:o??"Output is valid JSON",passed:!0,expected:"valid JSON",actual:"valid JSON"});return s}catch{this.assertions.push({description:o??"Output is valid JSON",passed:!1,expected:"valid JSON",actual:`invalid JSON: ${t.stdout.slice(0,100)}`});return}}assert(t,e){this.assertions.push({description:e,passed:t,expected:"true",actual:String(t)})}assertEqual(t,e,o){this.assertions.push({description:o,passed:t===e,expected:String(e),actual:String(t)})}hasFailures(){return this.assertions.some(t=>!t.passed)}};var p=class extends m{static description="Tests the theme init command creates a valid theme structure";themeName="";themePath="";tests(){this.test("init creates theme directory",async()=>{this.themeName=`doctor-theme-${C("creative")}`,this.themePath=u(this.context.workingDirectory,this.themeName);let t=await this.runInteractive(`shopify theme init ${this.themeName} --path ${this.context.workingDirectory}`);this.assertSuccess(t),this.context.themeName=this.themeName,this.context.themePath=this.themePath}),this.test("essential theme files exist",async()=>{let t=["layout/theme.liquid","config/settings_schema.json","templates/index.json"];await Promise.all(t.map(e=>this.assertFile(u(this.themePath,e))))}),this.test("theme directories exist",async()=>{let t=["sections","snippets","assets","locales"];await Promise.all(t.map(e=>this.assertDirectory(u(this.themePath,e))))}),this.test("layout/theme.liquid has valid content",async()=>{await this.assertFile(u(this.themePath,"layout/theme.liquid"),/<!doctype html>|<html|{{ content_for_header }}/i,"layout/theme.liquid contains expected Liquid markup")})}};d();var l=class extends m{static description="Tests pushing a theme to the store creates an unpublished theme";static requiresStore=!0;tests(){this.test("push creates unpublished theme",async()=>{if(!this.context.themePath){this.assert(!1,"Theme init did not complete successfully; themePath is missing in context");return}let t=this.context.themeName??"doctor-theme",e=`shopify theme push --unpublished --json --path ${this.context.themePath} -t ${t}`;this.context.environment&&(e+=` -e ${this.context.environment}`),this.context.store&&(e+=` -s ${this.context.store}`),this.context.password&&(e+=` --password ${this.context.password}`);let o=await this.run(e);this.assertSuccess(o);let s=this.assertJson(o,r=>typeof r.theme?.id=="number");s?.theme&&(this.assert(typeof s.theme.id=="number","Theme was created with a valid ID"),this.assertEqual(s.theme.role,"unpublished","Theme role is unpublished"),this.assert(s.theme.editor_url.includes("/admin/themes/"),"Editor URL is provided"),this.assert(s.theme.preview_url.includes("preview_theme_id="),"Preview URL is provided"),this.context.themeId=String(s.theme.id),this.context.data.editorUrl=s.theme.editor_url,this.context.data.previewUrl=s.theme.preview_url)})}};d();function _(i){return{workingDirectory:i.path??y(),environment:i.environment,store:i.store,password:i.password,data:{}}}d();var a=i=>k(i),v;function J(i){v=i}function G(i){if(!v)return i;let t=/\/[^\s,)]+/g;return i.replace(t,e=>T(e,v))}function A(i,t){a(""),a(n.bold(n.cyan(`Suite: ${i}`))),a(n.dim(t))}function j(i){a(n.bold(n.blue(`Running: ${i}`)))}function q(i){let t=`(${(i.duration/1e3).toFixed(2)}s)`;if(i.status==="passed"){a(n.bold(n.green(`PASSED: ${i.name} ${n.dim(t)}`)));for(let e of I(i.assertions))a(e)}else if(i.status==="failed"){a(n.red(`FAILED: ${i.name} ${n.dim(t)}`));for(let e of I(i.assertions))a(e);i.error&&a(n.red(` Error: ${G(i.error.message)}`))}else a(n.yellow(`SKIPPED: ${i.name}`))}function S(i){let t=i.filter(h=>h.status==="passed").length,e=i.filter(h=>h.status==="failed").length,o=i.filter(h=>h.status==="skipped").length,s=i.length,r=i.reduce((h,c)=>h+c.duration,0);a(""),a(n.bold("\u2500".repeat(40))),e>0?a(n.red(n.bold(`Doctor Complete: ${e}/${s} tests failed`))):a(n.green(n.bold(`Doctor Complete: ${t}/${s} tests passed`))),a(` Passed: ${n.green(String(t))}`),a(` Failed: ${n.red(String(e))}`),o>0&&a(` Skipped: ${n.yellow(String(o))}`),a(` Total time: ${n.dim(`${(r/1e3).toFixed(2)}s`)}`)}function I(i){return i.map(t=>{if(t.passed)return n.green(` [OK] ${t.description}`);{let e=` (expected: ${t.expected}, actual: ${t.actual})`;return n.red(` [FAIL] ${t.description}${e}`)}})}var Y=[p,l];async function L(i){let t=[],e=_(i);J(e.workingDirectory);for(let o of Y){let s=new o,r=o.description??"Test suite";A(o.name,r);let h=await s.runSuite(e);for(let c of h)if(j(c.name),q(c),t.push(c),c.status==="failed")return S(t),t}return S(t),t}var f=H(U(),1);var $=class i extends b{static description="Run all theme command doctor-release tests";static hidden=!0;static flags={...E,path:f.Flags.string({char:"p",description:"The path to run tests in. Defaults to current directory.",env:"SHOPIFY_FLAG_PATH",parse:async t=>P(t),default:async()=>y()}),environment:f.Flags.string({char:"e",description:"The environment to use from shopify.theme.toml (required for store-connected tests).",env:"SHOPIFY_FLAG_ENVIRONMENT",required:!0}),store:f.Flags.string({char:"s",description:"Store URL (overrides environment).",env:"SHOPIFY_FLAG_STORE"}),password:f.Flags.string({description:"Password from Theme Access app (overrides environment).",env:"SHOPIFY_FLAG_PASSWORD"})};async run(){if(!R())return;let{flags:t}=await this.parse(i);(await L({path:t.path,environment:t.environment,store:t.store,password:t.password})).some(s=>s.status==="failed")&&(process.exitCode=1)}};export{$ as a};
1
+ import{b as E}from"./chunk-2IZROVCY.js";import{b}from"./chunk-UBTHWHPB.js";import{Q as F,R as N}from"./chunk-PSSOCUUD.js";import{a as U}from"./chunk-CTNBSUVU.js";import{S as C,Ta as w,ma as O,xb as k}from"./chunk-G5QSVBYP.js";import{i as n}from"./chunk-B4OMIONW.js";import{j as R}from"./chunk-2Z52XJQG.js";import{d as u,f as P,g as x,h as g,n as T,q as y}from"./chunk-773TIA5M.js";import{e as H,g as d}from"./chunk-VKWPEFWQ.js";d();d();d();d();var m=class{static description="Doctor test suite";context;assertions=[];registeredTests=[];async runSuite(t){this.context=t,this.registeredTests=[];let e=[];this.tests();for(let o of this.registeredTests){this.assertions=[];let s=Date.now();try{await o.fn(),e.push({name:o.name,status:this.hasFailures()?"failed":"passed",duration:Date.now()-s,assertions:[...this.assertions]})}catch(r){e.push({name:o.name,status:"failed",duration:Date.now()-s,assertions:[...this.assertions],error:r instanceof Error?r:new Error(String(r))})}}return e}test(t,e){this.registeredTests.push({name:t,fn:e})}tests(){}async run(t,e){let o=e?.cwd??this.context.workingDirectory,s=await F(t,{cwd:o,env:e?.env});return{command:t,exitCode:s.exitCode,stdout:s.stdout,stderr:s.stderr,output:String(s.stdout)+String(s.stderr),success:s.exitCode===0}}async runInteractive(t,e){let o=e?.cwd??this.context.workingDirectory,s=0;try{await N(t,{cwd:o,env:e?.env,stdin:"inherit"})}catch{s=1}return{command:t,exitCode:s,stdout:"",stderr:"",output:"",success:s===0}}assertSuccess(t,e){this.assertions.push({description:e??`Command succeeded: ${t.command}`,passed:t.success,expected:"exit code 0",actual:`exit code ${t.exitCode}`})}assertError(t,e,o){let s=!t.success;if(e){let h=(typeof e=="string"?new RegExp(e):e).test(t.output),c;s?h?c="matched":c=`output: ${t.output.slice(0,200)}`:c="command succeeded",this.assertions.push({description:o??`Command failed with expected error: ${e}`,passed:s&&h,expected:`failure with error matching ${e}`,actual:c})}else this.assertions.push({description:o??`Command failed: ${t.command}`,passed:s,expected:"non-zero exit code",actual:`exit code ${t.exitCode}`})}async assertFile(t,e,o){let s=g(t)?t:u(this.context.workingDirectory,t),r=x(this.context.workingDirectory,s);if(!await w(s)){this.assertions.push({description:o??`File exists: ${r}`,passed:!1,expected:"file exists",actual:"file not found"});return}if(e){let c=await O(s),D=(typeof e=="string"?new RegExp(e):e).test(c);this.assertions.push({description:o??`File ${r} matches ${e}`,passed:D,expected:`content matching ${e}`,actual:D?"matched":`content: ${c.slice(0,200)}...`})}else this.assertions.push({description:o??`File exists: ${r}`,passed:!0,expected:"file exists",actual:"file exists"})}async assertNoFile(t,e){let o=g(t)?t:u(this.context.workingDirectory,t),s=x(this.context.workingDirectory,o),r=await w(o);this.assertions.push({description:e??`File does not exist: ${s}`,passed:!r,expected:"file does not exist",actual:r?"file exists":"file does not exist"})}async assertDirectory(t,e){let o=g(t)?t:u(this.context.workingDirectory,t),s=x(this.context.workingDirectory,o),r=await w(o);this.assertions.push({description:e??`Directory exists: ${s}`,passed:r,expected:"directory exists",actual:r?"directory exists":"directory not found"})}assertOutput(t,e,o){let r=(typeof e=="string"?new RegExp(e):e).test(t.output);this.assertions.push({description:o??`Output matches ${e}`,passed:r,expected:`output matching ${e}`,actual:r?"matched":`output: ${t.output.slice(0,200)}`})}assertJson(t,e,o){try{let s=JSON.parse(t.stdout);if(e){let r=e(s);this.assertions.push({description:o??"Output is valid JSON matching validator",passed:r,expected:"valid JSON matching validator",actual:r?"matched":"validator returned false"})}else this.assertions.push({description:o??"Output is valid JSON",passed:!0,expected:"valid JSON",actual:"valid JSON"});return s}catch{this.assertions.push({description:o??"Output is valid JSON",passed:!1,expected:"valid JSON",actual:`invalid JSON: ${t.stdout.slice(0,100)}`});return}}assert(t,e){this.assertions.push({description:e,passed:t,expected:"true",actual:String(t)})}assertEqual(t,e,o){this.assertions.push({description:o,passed:t===e,expected:String(e),actual:String(t)})}hasFailures(){return this.assertions.some(t=>!t.passed)}};var p=class extends m{static description="Tests the theme init command creates a valid theme structure";themeName="";themePath="";tests(){this.test("init creates theme directory",async()=>{this.themeName=`doctor-theme-${C("creative")}`,this.themePath=u(this.context.workingDirectory,this.themeName);let t=await this.runInteractive(`shopify theme init ${this.themeName} --path ${this.context.workingDirectory}`);this.assertSuccess(t),this.context.themeName=this.themeName,this.context.themePath=this.themePath}),this.test("essential theme files exist",async()=>{let t=["layout/theme.liquid","config/settings_schema.json","templates/index.json"];await Promise.all(t.map(e=>this.assertFile(u(this.themePath,e))))}),this.test("theme directories exist",async()=>{let t=["sections","snippets","assets","locales"];await Promise.all(t.map(e=>this.assertDirectory(u(this.themePath,e))))}),this.test("layout/theme.liquid has valid content",async()=>{await this.assertFile(u(this.themePath,"layout/theme.liquid"),/<!doctype html>|<html|{{ content_for_header }}/i,"layout/theme.liquid contains expected Liquid markup")})}};d();var l=class extends m{static description="Tests pushing a theme to the store creates an unpublished theme";static requiresStore=!0;tests(){this.test("push creates unpublished theme",async()=>{if(!this.context.themePath){this.assert(!1,"Theme init did not complete successfully; themePath is missing in context");return}let t=this.context.themeName??"doctor-theme",e=`shopify theme push --unpublished --json --path ${this.context.themePath} -t ${t}`;this.context.environment&&(e+=` -e ${this.context.environment}`),this.context.store&&(e+=` -s ${this.context.store}`),this.context.password&&(e+=` --password ${this.context.password}`);let o=await this.run(e);this.assertSuccess(o);let s=this.assertJson(o,r=>typeof r.theme?.id=="number");s?.theme&&(this.assert(typeof s.theme.id=="number","Theme was created with a valid ID"),this.assertEqual(s.theme.role,"unpublished","Theme role is unpublished"),this.assert(s.theme.editor_url.includes("/admin/themes/"),"Editor URL is provided"),this.assert(s.theme.preview_url.includes("preview_theme_id="),"Preview URL is provided"),this.context.themeId=String(s.theme.id),this.context.data.editorUrl=s.theme.editor_url,this.context.data.previewUrl=s.theme.preview_url)})}};d();function _(i){return{workingDirectory:i.path??y(),environment:i.environment,store:i.store,password:i.password,data:{}}}d();var a=i=>k(i),v;function J(i){v=i}function G(i){if(!v)return i;let t=/\/[^\s,)]+/g;return i.replace(t,e=>T(e,v))}function A(i,t){a(""),a(n.bold(n.cyan(`Suite: ${i}`))),a(n.dim(t))}function j(i){a(n.bold(n.blue(`Running: ${i}`)))}function q(i){let t=`(${(i.duration/1e3).toFixed(2)}s)`;if(i.status==="passed"){a(n.bold(n.green(`PASSED: ${i.name} ${n.dim(t)}`)));for(let e of I(i.assertions))a(e)}else if(i.status==="failed"){a(n.red(`FAILED: ${i.name} ${n.dim(t)}`));for(let e of I(i.assertions))a(e);i.error&&a(n.red(` Error: ${G(i.error.message)}`))}else a(n.yellow(`SKIPPED: ${i.name}`))}function S(i){let t=i.filter(h=>h.status==="passed").length,e=i.filter(h=>h.status==="failed").length,o=i.filter(h=>h.status==="skipped").length,s=i.length,r=i.reduce((h,c)=>h+c.duration,0);a(""),a(n.bold("\u2500".repeat(40))),e>0?a(n.red(n.bold(`Doctor Complete: ${e}/${s} tests failed`))):a(n.green(n.bold(`Doctor Complete: ${t}/${s} tests passed`))),a(` Passed: ${n.green(String(t))}`),a(` Failed: ${n.red(String(e))}`),o>0&&a(` Skipped: ${n.yellow(String(o))}`),a(` Total time: ${n.dim(`${(r/1e3).toFixed(2)}s`)}`)}function I(i){return i.map(t=>{if(t.passed)return n.green(` [OK] ${t.description}`);{let e=` (expected: ${t.expected}, actual: ${t.actual})`;return n.red(` [FAIL] ${t.description}${e}`)}})}var Y=[p,l];async function L(i){let t=[],e=_(i);J(e.workingDirectory);for(let o of Y){let s=new o,r=o.description??"Test suite";A(o.name,r);let h=await s.runSuite(e);for(let c of h)if(j(c.name),q(c),t.push(c),c.status==="failed")return S(t),t}return S(t),t}var f=H(U(),1);var $=class i extends b{static description="Run all theme command doctor-release tests";static hidden=!0;static flags={...E,path:f.Flags.string({char:"p",description:"The path to run tests in. Defaults to current directory.",env:"SHOPIFY_FLAG_PATH",parse:async t=>P(t),default:async()=>y()}),environment:f.Flags.string({char:"e",description:"The environment to use from shopify.theme.toml (required for store-connected tests).",env:"SHOPIFY_FLAG_ENVIRONMENT",required:!0}),store:f.Flags.string({char:"s",description:"Store URL (overrides environment).",env:"SHOPIFY_FLAG_STORE"}),password:f.Flags.string({description:"Password from Theme Access app (overrides environment).",env:"SHOPIFY_FLAG_PASSWORD"})};async run(){if(!R())return;let{flags:t}=await this.parse(i);(await L({path:t.path,environment:t.environment,store:t.store,password:t.password})).some(s=>s.status==="failed")&&(process.exitCode=1)}};export{$ as a};