shopify 4.8.5 → 4.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (489) hide show
  1. package/dist/analytics-EPKJADE2.js +1 -0
  2. package/dist/analytics-TVCGKQGZ.js +1 -0
  3. package/dist/assets/hydrogen/starter/package.json +1 -1
  4. package/dist/bootstrap.js +1 -3
  5. package/dist/chunk-23ITMFUO.js +3 -0
  6. package/dist/{chunk-WKTIQUQP.js → chunk-254XYKPN.js} +1 -1
  7. package/dist/{chunk-T3B6KIPU.js → chunk-2AAHKMPP.js} +1 -1
  8. package/dist/chunk-2AZXDU2R.js +3 -0
  9. package/dist/chunk-2FHVYY3B.js +1 -0
  10. package/dist/chunk-2KBTFKSM.js +1 -0
  11. package/dist/chunk-2NBNVDDA.js +1 -0
  12. package/dist/{chunk-6LNTC6EK.js → chunk-2QV5FHXJ.js} +1 -1
  13. package/dist/chunk-2RVMF4QP.js +1 -0
  14. package/dist/chunk-2TOIR7YQ.js +11 -0
  15. package/dist/chunk-32B4LIKH.js +1 -0
  16. package/dist/{chunk-6QWLOSUQ.js → chunk-33D7HGAI.js} +1 -1
  17. package/dist/{chunk-HGFCNPSN.js → chunk-3GVSG4S6.js} +1 -1
  18. package/dist/chunk-3MEL3WLG.js +1 -0
  19. package/dist/{chunk-HS3VTFW3.js → chunk-3UZYLXCB.js} +1 -1
  20. package/dist/chunk-3VOMVINB.js +6 -0
  21. package/dist/{chunk-H5MENHJ2.js → chunk-3VXXYY6S.js} +1 -1
  22. package/dist/{chunk-773TIA5M.js → chunk-3VYOLEQE.js} +2 -2
  23. package/dist/chunk-3WMFKHIM.js +9 -0
  24. package/dist/{chunk-WHXY372K.js → chunk-46IUD46F.js} +1 -1
  25. package/dist/{chunk-VIMFXQ3Q.js → chunk-4AXLWDKW.js} +1 -1
  26. package/dist/chunk-55JDA75S.js +5 -0
  27. package/dist/{chunk-PQDB3FUL.js → chunk-5CANB25O.js} +1 -1
  28. package/dist/{chunk-MVJSQT7V.js → chunk-5I5HKOQU.js} +1 -1
  29. package/dist/chunk-5KILOX2V.js +2 -0
  30. package/dist/{chunk-77KSMVIO.js → chunk-5MJX7RKQ.js} +6 -6
  31. package/dist/{chunk-FXBQKJTS.js → chunk-5UDBNXNH.js} +1 -1
  32. package/dist/chunk-5XO6PAMV.js +1 -0
  33. package/dist/chunk-5ZSN73EA.js +3 -0
  34. package/dist/chunk-63GEZEYP.js +1 -0
  35. package/dist/{chunk-Z4E2EXZV.js → chunk-6WGHVCYY.js} +1 -1
  36. package/dist/chunk-77QKJLBG.js +6 -0
  37. package/dist/chunk-77QYKF34.js +6 -0
  38. package/dist/{chunk-PL7AJVTV.js → chunk-7AD5YCLL.js} +1 -1
  39. package/dist/{chunk-WAZL37JY.js → chunk-7H4IM6PX.js} +1 -1
  40. package/dist/{chunk-NPATN7YS.js → chunk-7IS6Q756.js} +1 -1
  41. package/dist/chunk-7UV53AU2.js +1 -0
  42. package/dist/{chunk-OJSF3H2G.js → chunk-7UZO72KN.js} +2 -2
  43. package/dist/{chunk-DKAWQBTI.js → chunk-7WWPAHVE.js} +3 -3
  44. package/dist/{chunk-GW7IEG4G.js → chunk-7ZONBOEZ.js} +1 -1
  45. package/dist/chunk-A6OSIGQI.js +1 -0
  46. package/dist/chunk-ADIHYUQC.js +7 -0
  47. package/dist/chunk-AJOTU26E.js +3 -0
  48. package/dist/chunk-AKSOCKVF.js +317 -0
  49. package/dist/{chunk-2JM3XHTQ.js → chunk-AZCPTV4A.js} +9 -9
  50. package/dist/chunk-B4YDR22W.js +4 -0
  51. package/dist/{chunk-7O2KMA4J.js → chunk-B7Y2LMPU.js} +1 -1
  52. package/dist/{chunk-RX63KGTK.js → chunk-BATQEAGE.js} +1 -1
  53. package/dist/chunk-C4QR7Z4N.js +1 -0
  54. package/dist/chunk-C7YSU4R5.js +20 -0
  55. package/dist/{chunk-DV7FOLG4.js → chunk-CKLS5LTU.js} +1 -1
  56. package/dist/chunk-COFGQT76.js +18 -0
  57. package/dist/{chunk-ZMD5TNU5.js → chunk-CPKLTBLZ.js} +1 -1
  58. package/dist/chunk-CUZQRXTV.js +20 -0
  59. package/dist/chunk-DCSSFNW7.js +12 -0
  60. package/dist/chunk-DEY5P63E.js +4 -0
  61. package/dist/{chunk-I6DVGPJ7.js → chunk-DP7SBNLN.js} +1 -1
  62. package/dist/{chunk-PJ7L6NSD.js → chunk-DREP3FRJ.js} +1 -1
  63. package/dist/{chunk-D34ZSTCK.js → chunk-DUWS6Q7C.js} +1 -1
  64. package/dist/chunk-DUWU7CL7.js +3 -0
  65. package/dist/chunk-DYHRCMH6.js +4 -0
  66. package/dist/chunk-DZS4GBQX.js +1 -0
  67. package/dist/{chunk-4DIR65KL.js → chunk-EDLID4PK.js} +24 -24
  68. package/dist/{chunk-HSETBDXR.js → chunk-EVQPVO4P.js} +1 -1
  69. package/dist/{chunk-WQOV3LQA.js → chunk-EYB45DUG.js} +1 -1
  70. package/dist/chunk-F34MAI7X.js +8 -0
  71. package/dist/{chunk-NZE4C4OI.js → chunk-FJCNEHTH.js} +1 -1
  72. package/dist/chunk-FNITLQDL.js +1 -0
  73. package/dist/chunk-FROK2K3X.js +5 -0
  74. package/dist/{chunk-KHRZFJHM.js → chunk-GF75CMTJ.js} +1 -1
  75. package/dist/{chunk-RU6J6QQF.js → chunk-GHO2S3W3.js} +1 -1
  76. package/dist/chunk-GILHUPUG.js +7 -0
  77. package/dist/chunk-GPRUQBQX.js +1 -0
  78. package/dist/chunk-GRKZRK4G.js +1 -0
  79. package/dist/{chunk-PU6KWWVK.js → chunk-H3QLPW7Q.js} +1 -1
  80. package/dist/chunk-HB3MJYBK.js +1 -0
  81. package/dist/{chunk-AEUCDGTB.js → chunk-HDQXFGYG.js} +1 -1
  82. package/dist/{chunk-NZ3HLDJG.js → chunk-HJ3DOUAL.js} +1 -1
  83. package/dist/{chunk-MFP63IUM.js → chunk-HKNFZUAM.js} +1 -1
  84. package/dist/chunk-HQK6QRXN.js +1 -0
  85. package/dist/chunk-HSTNTHWM.js +1 -0
  86. package/dist/chunk-HT2JVMLK.js +16 -0
  87. package/dist/chunk-HVOYSAB3.js +1 -0
  88. package/dist/{chunk-BPJRQOHO.js → chunk-I4FS7HYY.js} +1 -1
  89. package/dist/{chunk-C4UCOQUP.js → chunk-ICFM55ZS.js} +2 -2
  90. package/dist/{chunk-H6TWXT6Q.js → chunk-IPWU2ALH.js} +1 -1
  91. package/dist/{chunk-MNYKIPG7.js → chunk-IQ4VOPT7.js} +1 -1
  92. package/dist/chunk-ISIPFEFB.js +1 -0
  93. package/dist/chunk-IUUKRTKF.js +5 -0
  94. package/dist/{chunk-F33TYJM5.js → chunk-J4SJHG3M.js} +1 -1
  95. package/dist/{chunk-CTNBSUVU.js → chunk-JA2QZ635.js} +2 -2
  96. package/dist/{chunk-RSGIMVPN.js → chunk-JCOQDVEB.js} +2 -2
  97. package/dist/{chunk-ZMTTZXC4.js → chunk-JCVQB6MX.js} +3 -3
  98. package/dist/{chunk-6IOVTFAH.js → chunk-JF47WERF.js} +1 -1
  99. package/dist/{chunk-NAQ7KT6L.js → chunk-JJ4MYCVU.js} +1 -1
  100. package/dist/chunk-JOEWOCHY.js +5 -0
  101. package/dist/chunk-JSGOBMF6.js +1 -0
  102. package/dist/chunk-JWQBRHVY.js +1 -0
  103. package/dist/{chunk-4SXHXMK6.js → chunk-K5KUOPEF.js} +1 -1
  104. package/dist/chunk-KCHERKZO.js +383 -0
  105. package/dist/chunk-KVZXRZ7U.js +1 -0
  106. package/dist/chunk-KXSUEB4Y.js +1 -0
  107. package/dist/{chunk-KDMJ2BLO.js → chunk-LAHZ6FO5.js} +1 -1
  108. package/dist/chunk-LBBYCPZP.js +18 -0
  109. package/dist/{chunk-AEPBX4GI.js → chunk-LEFAUWKH.js} +1 -1
  110. package/dist/{chunk-MMHTYLTG.js → chunk-LIB64ZJW.js} +1 -1
  111. package/dist/{chunk-4QBJ5JBX.js → chunk-LOKVWZD2.js} +16 -15
  112. package/dist/{chunk-WKRX4FBZ.js → chunk-LRKJSNM3.js} +1 -1
  113. package/dist/chunk-MDMKTILJ.js +1 -0
  114. package/dist/chunk-MEFJND2V.js +4 -0
  115. package/dist/{chunk-BU6LJZG7.js → chunk-MFXBSQDH.js} +1 -1
  116. package/dist/chunk-MIMOKFDI.js +1 -0
  117. package/dist/chunk-MINDMVTH.js +1 -0
  118. package/dist/{chunk-OAEGTH4Q.js → chunk-MZJKZLCC.js} +1 -1
  119. package/dist/{chunk-W6ST525S.js → chunk-N56BJ3F7.js} +1 -1
  120. package/dist/{chunk-SOJHJ4QK.js → chunk-NE32WJR5.js} +1 -1
  121. package/dist/chunk-NGQDG4CJ.js +1 -0
  122. package/dist/{chunk-6QDOCBD4.js → chunk-NHEUJKAO.js} +4 -3
  123. package/dist/{chunk-TUWRPDTE.js → chunk-NSHKVJST.js} +1 -1
  124. package/dist/{chunk-5GUXN2RU.js → chunk-NTFIW3VK.js} +1 -1
  125. package/dist/chunk-NWBAD3AV.js +8 -0
  126. package/dist/chunk-NYNSMHKY.js +15 -0
  127. package/dist/chunk-NZRQKFUB.js +1 -0
  128. package/dist/{chunk-4XE6E4DC.js → chunk-OJ7KRWUH.js} +1 -1
  129. package/dist/{chunk-3CKUOG4B.js → chunk-OKX6PKAW.js} +1 -1
  130. package/dist/chunk-ON3YXHON.js +1 -0
  131. package/dist/chunk-OSA6BKSU.js +1 -0
  132. package/dist/chunk-OUSRNKZG.js +1 -0
  133. package/dist/{chunk-IYFHBTJ2.js → chunk-OVOOQFRY.js} +1 -1
  134. package/dist/chunk-P676C7UT.js +1 -0
  135. package/dist/{chunk-XRWQ7AXY.js → chunk-P6ID3ULA.js} +1 -1
  136. package/dist/chunk-PCKWLJW2.js +1 -0
  137. package/dist/{chunk-PIQI72DV.js → chunk-PTS7J2JO.js} +1 -1
  138. package/dist/chunk-QEEA2KEN.js +2 -0
  139. package/dist/{chunk-J774336K.js → chunk-QEF43PR2.js} +1 -1
  140. package/dist/{chunk-DPMOLROM.js → chunk-QF6EH4HX.js} +5 -5
  141. package/dist/{chunk-LZZAD3FW.js → chunk-QH5R32AA.js} +1 -1
  142. package/dist/chunk-QNR3U4IO.js +1 -0
  143. package/dist/{chunk-GUPUXFIP.js → chunk-QPCDSJ4J.js} +1 -1
  144. package/dist/{chunk-UJSCQJLW.js → chunk-QZDFPNYT.js} +1 -1
  145. package/dist/{chunk-WM3GKSPE.js → chunk-RDCHRPKV.js} +1 -1
  146. package/dist/chunk-RFB7RXTA.js +8 -0
  147. package/dist/{chunk-4JU7N2OF.js → chunk-RFDOSK57.js} +1 -1
  148. package/dist/{chunk-4UD2LW4O.js → chunk-RNXWL6DS.js} +1 -1
  149. package/dist/chunk-RRBI2IRE.js +15 -0
  150. package/dist/chunk-RX27ER4R.js +7 -0
  151. package/dist/chunk-S3IDGHAZ.js +28 -0
  152. package/dist/{chunk-EBBS7VG6.js → chunk-S3J3BYQ3.js} +3 -3
  153. package/dist/chunk-S6YUSGTF.js +3 -0
  154. package/dist/{chunk-6ICRPFG4.js → chunk-SHDGD2WJ.js} +1 -1
  155. package/dist/{chunk-GCJAY2XJ.js → chunk-SKK7CPUY.js} +3 -3
  156. package/dist/{chunk-TTV2GWNE.js → chunk-SMZ74TME.js} +1 -1
  157. package/dist/chunk-STLYSBD5.js +1 -0
  158. package/dist/chunk-T7BUP75N.js +7 -0
  159. package/dist/chunk-TGUAZMI2.js +4 -0
  160. package/dist/{chunk-K5OTE6CX.js → chunk-TH4D7IGZ.js} +1 -1
  161. package/dist/{chunk-AOPEKBDL.js → chunk-U2WUTGPI.js} +1 -1
  162. package/dist/chunk-UJD7OQ3I.js +6 -0
  163. package/dist/{chunk-G7C4LBG2.js → chunk-UVSXPMUN.js} +1 -1
  164. package/dist/chunk-UZTL2UET.js +2368 -0
  165. package/dist/chunk-VEIZLSMG.js +3 -0
  166. package/dist/chunk-VEQDI5AB.js +1 -0
  167. package/dist/chunk-VL3XMULV.js +6 -0
  168. package/dist/{chunk-A2BZY6TE.js → chunk-VPH2AAHJ.js} +1 -1
  169. package/dist/chunk-VWYZCCRE.js +836 -0
  170. package/dist/chunk-VX2CDHRQ.js +1 -0
  171. package/dist/chunk-VXHLE5UQ.js +1 -0
  172. package/dist/{chunk-SYBKHTVU.js → chunk-VY7UGJZK.js} +3 -3
  173. package/dist/{chunk-R4TOHQH3.js → chunk-W6TPRWEE.js} +2 -2
  174. package/dist/chunk-WBTR5JZ6.js +16 -0
  175. package/dist/{chunk-VPOAOUT4.js → chunk-WGBUSO27.js} +1 -1
  176. package/dist/{chunk-DPNZWBT5.js → chunk-WNO2V53C.js} +1 -1
  177. package/dist/{chunk-M2M3I63K.js → chunk-WR2MMFJO.js} +1 -1
  178. package/dist/chunk-WR6KP7RT.js +1 -0
  179. package/dist/chunk-WRVB4JCZ.js +7 -0
  180. package/dist/chunk-X3WFHNF5.js +2 -0
  181. package/dist/chunk-X6Y3HDXN.js +16 -0
  182. package/dist/{chunk-POOKYUTJ.js → chunk-XCXQPV5W.js} +1 -1
  183. package/dist/chunk-XUJURYN5.js +1 -0
  184. package/dist/chunk-XW33ZO7F.js +2 -0
  185. package/dist/{chunk-6QU2BHVL.js → chunk-XY2SSJQD.js} +4 -4
  186. package/dist/{chunk-4UAJ6ULU.js → chunk-YACDI6IK.js} +1 -1
  187. package/dist/{chunk-EJJPVVQ2.js → chunk-YFR53MWF.js} +1 -1
  188. package/dist/{chunk-VVPIXC3W.js → chunk-YQZPL4K3.js} +1 -1
  189. package/dist/chunk-YRHFPXC3.js +1 -0
  190. package/dist/chunk-YS5RZ6D5.js +1 -0
  191. package/dist/chunk-YTJ3EPD3.js +1 -0
  192. package/dist/chunk-Z6VWYOKN.js +4 -0
  193. package/dist/{chunk-ZFA5DIJ3.js → chunk-ZDRQUKLN.js} +1 -1
  194. package/dist/chunk-ZGASBRSQ.js +5 -0
  195. package/dist/chunk-ZQKZC2KN.js +1 -0
  196. package/dist/cli/commands/app/app-logs/sources.js +1 -1
  197. package/dist/cli/commands/app/build.js +1 -1
  198. package/dist/cli/commands/app/bulk/cancel.js +1 -1
  199. package/dist/cli/commands/app/bulk/execute.js +1 -1
  200. package/dist/cli/commands/app/bulk/status.js +1 -1
  201. package/dist/cli/commands/app/config/link.js +1 -1
  202. package/dist/cli/commands/app/config/pull.js +1 -1
  203. package/dist/cli/commands/app/config/use.js +1 -1
  204. package/dist/cli/commands/app/config/validate.js +1 -1
  205. package/dist/cli/commands/app/demo/watcher.js +1 -1
  206. package/dist/cli/commands/app/deploy.js +1 -1
  207. package/dist/cli/commands/app/dev/clean.js +1 -1
  208. package/dist/cli/commands/app/dev.js +1 -1
  209. package/dist/cli/commands/app/env/pull.js +1 -1
  210. package/dist/cli/commands/app/env/show.js +1 -1
  211. package/dist/cli/commands/app/execute.js +1 -1
  212. package/dist/cli/commands/app/function/build.js +1 -1
  213. package/dist/cli/commands/app/function/info.js +1 -1
  214. package/dist/cli/commands/app/function/replay.js +1 -1
  215. package/dist/cli/commands/app/function/run.js +1 -1
  216. package/dist/cli/commands/app/function/schema.js +1 -1
  217. package/dist/cli/commands/app/function/typegen.js +1 -1
  218. package/dist/cli/commands/app/generate/extension.js +1 -1
  219. package/dist/cli/commands/app/graphiql.js +1 -1
  220. package/dist/cli/commands/app/import/channel-config.js +1 -0
  221. package/dist/cli/commands/app/import/custom-data-definitions.js +1 -0
  222. package/dist/cli/commands/app/import/dashboard-extensions.js +1 -0
  223. package/dist/cli/commands/app/import-custom-data-definitions.js +1 -1
  224. package/dist/cli/commands/app/import-extensions.js +1 -1
  225. package/dist/cli/commands/app/info.js +1 -1
  226. package/dist/cli/commands/app/init.js +1 -1
  227. package/dist/cli/commands/app/logs.js +1 -1
  228. package/dist/cli/commands/app/release.js +1 -1
  229. package/dist/cli/commands/app/security/check.js +1 -0
  230. package/dist/cli/commands/app/security/clean.js +1 -0
  231. package/dist/cli/commands/app/security/instructions.js +1 -0
  232. package/dist/cli/commands/app/security/record.js +1 -0
  233. package/dist/cli/commands/app/security/review.js +1 -0
  234. package/dist/cli/commands/app/subscription-migrations/cancel.js +1 -1
  235. package/dist/cli/commands/app/subscription-migrations/list.js +1 -1
  236. package/dist/cli/commands/app/subscription-migrations/schedule.js +1 -1
  237. package/dist/cli/commands/app/subscription-migrations/status.js +1 -1
  238. package/dist/cli/commands/app/subscription-migrations/unschedule.js +1 -1
  239. package/dist/cli/commands/app/versions/list.js +1 -1
  240. package/dist/cli/commands/app/webhook/trigger.js +1 -1
  241. package/dist/cli/commands/auth/login.d.ts +16 -1
  242. package/dist/cli/commands/auth/login.js +1 -1
  243. package/dist/cli/commands/auth/logout.d.ts +16 -1
  244. package/dist/cli/commands/auth/logout.js +1 -1
  245. package/dist/cli/commands/cache/clear.js +1 -1
  246. package/dist/cli/commands/config/autoupgrade/off.d.ts +13 -0
  247. package/dist/cli/commands/config/autoupgrade/off.js +1 -1
  248. package/dist/cli/commands/config/autoupgrade/on.d.ts +13 -0
  249. package/dist/cli/commands/config/autoupgrade/on.js +1 -1
  250. package/dist/cli/commands/config/autoupgrade/status.d.ts +13 -0
  251. package/dist/cli/commands/config/autoupgrade/status.js +1 -1
  252. package/dist/cli/commands/debug/command-flags.js +1 -1
  253. package/dist/cli/commands/doc/fetch.d.ts +2 -0
  254. package/dist/cli/commands/doc/fetch.js +1 -1
  255. package/dist/cli/commands/doc/search.d.ts +1 -0
  256. package/dist/cli/commands/doc/search.js +1 -1
  257. package/dist/cli/commands/docs/generate.js +1 -1
  258. package/dist/cli/commands/doctor-release/doctor-release.js +1 -1
  259. package/dist/cli/commands/doctor-release/theme/index.d.ts +1 -0
  260. package/dist/cli/commands/doctor-release/theme/index.js +1 -1
  261. package/dist/cli/commands/help.d.ts +431 -1
  262. package/dist/cli/commands/help.js +1 -1
  263. package/dist/cli/commands/kitchen-sink/async.js +1 -1
  264. package/dist/cli/commands/kitchen-sink/index.js +1 -1
  265. package/dist/cli/commands/kitchen-sink/prompts.js +1 -1
  266. package/dist/cli/commands/kitchen-sink/static.js +1 -1
  267. package/dist/cli/commands/notifications/generate.js +1 -1
  268. package/dist/cli/commands/notifications/list.js +1 -1
  269. package/dist/cli/commands/organization/list.js +1 -1
  270. package/dist/cli/commands/search.d.ts +11 -1
  271. package/dist/cli/commands/search.js +1 -1
  272. package/dist/cli/commands/send-analytics.js +1 -1
  273. package/dist/cli/commands/theme/check.js +1 -1
  274. package/dist/cli/commands/theme/console.js +1 -1
  275. package/dist/cli/commands/theme/delete.js +1 -1
  276. package/dist/cli/commands/theme/dev.js +1 -1
  277. package/dist/cli/commands/theme/duplicate.js +1 -1
  278. package/dist/cli/commands/theme/info.js +1 -1
  279. package/dist/cli/commands/theme/init.js +1 -1
  280. package/dist/cli/commands/theme/language-server.js +1 -1
  281. package/dist/cli/commands/theme/list.js +1 -1
  282. package/dist/cli/commands/theme/metafields/pull.js +1 -1
  283. package/dist/cli/commands/theme/open.js +1 -1
  284. package/dist/cli/commands/theme/package.js +1 -1
  285. package/dist/cli/commands/theme/preview.js +1 -1
  286. package/dist/cli/commands/theme/profile.js +1 -1
  287. package/dist/cli/commands/theme/publish.js +1 -1
  288. package/dist/cli/commands/theme/pull.js +1 -1
  289. package/dist/cli/commands/theme/push.js +1 -1
  290. package/dist/cli/commands/theme/rename.js +1 -1
  291. package/dist/cli/commands/theme/share.js +1 -1
  292. package/dist/cli/commands/upgrade.js +1 -1
  293. package/dist/cli/commands/version.d.ts +15 -1
  294. package/dist/cli/commands/version.js +1 -1
  295. package/dist/cli/help.d.ts +5 -2
  296. package/dist/cli/help.js +6 -2
  297. package/dist/cli/services/commands/auth/login/types.d.ts +11 -0
  298. package/dist/cli/services/commands/auth/login/types.js +7 -0
  299. package/dist/cli/services/commands/config/autoupgrade/index.d.ts +3 -0
  300. package/dist/cli/services/commands/config/autoupgrade/index.js +9 -0
  301. package/dist/cli/services/commands/config/autoupgrade/result.d.ts +2 -0
  302. package/dist/cli/services/commands/config/autoupgrade/result.js +15 -0
  303. package/dist/cli/services/commands/config/autoupgrade/types.d.ts +10 -0
  304. package/dist/cli/services/commands/config/autoupgrade/types.js +7 -0
  305. package/dist/cli/services/commands/doc/fetch.d.ts +1 -1
  306. package/dist/cli/services/commands/doc/fetch.js +11 -2
  307. package/dist/cli/services/commands/help/index.d.ts +3 -0
  308. package/dist/cli/services/commands/help/index.js +51 -0
  309. package/dist/cli/services/commands/help/result.d.ts +2 -0
  310. package/dist/cli/services/commands/help/result.js +6 -0
  311. package/dist/cli/services/commands/help/types.d.ts +431 -0
  312. package/dist/cli/services/commands/help/types.js +71 -0
  313. package/dist/cli/services/commands/search/index.d.ts +2 -0
  314. package/dist/cli/services/commands/search/index.js +8 -0
  315. package/dist/cli/services/commands/search/result.d.ts +2 -0
  316. package/dist/cli/services/commands/search/result.js +12 -0
  317. package/dist/cli/services/commands/search/types.d.ts +10 -0
  318. package/dist/cli/services/commands/search/types.js +7 -0
  319. package/dist/cli/services/commands/version/index.d.ts +2 -0
  320. package/dist/cli/services/commands/version/index.js +5 -0
  321. package/dist/cli/services/commands/version/result.d.ts +2 -0
  322. package/dist/cli/services/commands/version/result.js +6 -0
  323. package/dist/cli/services/commands/version/types.d.ts +10 -0
  324. package/dist/cli/services/commands/version/types.js +7 -0
  325. package/dist/command-json-schema-SU56F3T4.js +1 -0
  326. package/dist/command-registry.js +1 -1
  327. package/dist/{conf-store-5UUKEHZV.js → conf-store-WDYDHG6V.js} +1 -1
  328. package/dist/custom-oclif-loader-CP4XJAPS.js +1 -0
  329. package/dist/deprecations-CBSMNYL3.js +1 -0
  330. package/dist/dist-HI6AAP5V.js +1 -0
  331. package/dist/dist-W25ND3PJ.js +1 -0
  332. package/dist/environment-ZUTBXY7U.js +1 -0
  333. package/dist/environments-PUH6A5BU.js +1 -0
  334. package/dist/error-LNWX6IWE.js +1 -0
  335. package/dist/error-handler-24QGAUUD.js +1 -0
  336. package/dist/fs-Y33QBYY5.js +1 -0
  337. package/dist/hooks/did-you-mean.js +1 -1
  338. package/dist/hooks/hydrogen-init.js +1 -1
  339. package/dist/hooks/plugin-plugins.js +1 -1
  340. package/dist/hooks/postrun.js +1 -1
  341. package/dist/hooks/prerun.js +1 -1
  342. package/dist/hooks/public-metadata.js +1 -1
  343. package/dist/hooks/sensitive-metadata.js +1 -1
  344. package/dist/hooks/tunnel-provider.js +1 -1
  345. package/dist/hooks/tunnel-start.js +1 -1
  346. package/dist/http-proxy-node16-D3JUYA5D.js +38 -0
  347. package/dist/index.js +13 -14
  348. package/dist/is-global-KY3QE3OZ.js +1 -0
  349. package/dist/json-error-UR2OILQ6.js +1 -0
  350. package/dist/lib-AD2G3QH3.js +1 -0
  351. package/dist/lib-VEVNMHDE.js +1 -0
  352. package/dist/lib-ZQW4E7QU.js +1 -0
  353. package/dist/local-77XQ4CX3.js +1 -0
  354. package/dist/metadata-BC3BGHRY.js +1 -0
  355. package/dist/{morph-BMYYMQNX.js → morph-42EXMN3K.js} +3 -3
  356. package/dist/node-package-manager-6UZUTDCP.js +1 -0
  357. package/dist/notifications-system-4UDT72DQ.js +1 -0
  358. package/dist/os-U3LELTCV.js +1 -0
  359. package/dist/output-GGY66WEM.js +1 -0
  360. package/dist/{path-MBXP7ZIC.js → path-6YMSTSWG.js} +1 -1
  361. package/dist/system-MCWAHFXK.js +1 -0
  362. package/dist/tsconfig.tsbuildinfo +1 -1
  363. package/dist/ui-SYB4LLWY.js +1 -0
  364. package/dist/uncaught-error-handler.d.ts +6 -0
  365. package/dist/uncaught-error-handler.js +33 -0
  366. package/dist/upgrade-V4GCQJBN.js +1 -0
  367. package/dist/version-HQPFW4QN.js +1 -0
  368. package/dist/version-VOSHQCYM.js +1 -0
  369. package/dist/workerd-MEAM3XYI.js +18 -0
  370. package/oclif.manifest.json +2646 -226
  371. package/package.json +17 -8
  372. package/dist/analytics-4D5FCVMV.js +0 -1
  373. package/dist/analytics-XRYJEPWC.js +0 -1
  374. package/dist/chunk-2IZROVCY.js +0 -1
  375. package/dist/chunk-2KD4LHRT.js +0 -5
  376. package/dist/chunk-2SOA4M4G.js +0 -1
  377. package/dist/chunk-2WNF5BX4.js +0 -18
  378. package/dist/chunk-2Z52XJQG.js +0 -1
  379. package/dist/chunk-34PQ6LJC.js +0 -1
  380. package/dist/chunk-3NW372KT.js +0 -1
  381. package/dist/chunk-4JLOCGTK.js +0 -3
  382. package/dist/chunk-4NZ465W4.js +0 -1
  383. package/dist/chunk-5EME57E6.js +0 -7
  384. package/dist/chunk-5N33O2RV.js +0 -1
  385. package/dist/chunk-5PAPCPUM.js +0 -1
  386. package/dist/chunk-5U24BORP.js +0 -6
  387. package/dist/chunk-6ARAJULJ.js +0 -1
  388. package/dist/chunk-7VJPQ52S.js +0 -15
  389. package/dist/chunk-7ZEVVGCH.js +0 -1
  390. package/dist/chunk-A5FV7HOY.js +0 -16
  391. package/dist/chunk-ADS7BFDG.js +0 -15
  392. package/dist/chunk-ADUMJRRY.js +0 -1
  393. package/dist/chunk-AI4SPBPV.js +0 -2
  394. package/dist/chunk-AKETXXYD.js +0 -1
  395. package/dist/chunk-ANOCIVJ3.js +0 -8
  396. package/dist/chunk-BMPCDXJR.js +0 -4
  397. package/dist/chunk-CAKGQWX4.js +0 -7
  398. package/dist/chunk-CBGDD3ZG.js +0 -317
  399. package/dist/chunk-CRALWNNO.js +0 -1
  400. package/dist/chunk-CUGLV7UX.js +0 -1
  401. package/dist/chunk-CWSQIPY5.js +0 -5
  402. package/dist/chunk-D6LV5CJL.js +0 -2
  403. package/dist/chunk-DGMHUJV3.js +0 -4
  404. package/dist/chunk-ENUN2VSC.js +0 -2
  405. package/dist/chunk-EX7Y3BEH.js +0 -1
  406. package/dist/chunk-FDK3NDYQ.js +0 -5
  407. package/dist/chunk-FLV6UQRA.js +0 -1
  408. package/dist/chunk-FTC3BXSD.js +0 -3
  409. package/dist/chunk-FXWNYGIW.js +0 -1
  410. package/dist/chunk-G5272L77.js +0 -7
  411. package/dist/chunk-G5QSVBYP.js +0 -19
  412. package/dist/chunk-G6SURO6V.js +0 -8
  413. package/dist/chunk-GBYDMHZ3.js +0 -3
  414. package/dist/chunk-GCN4O7HM.js +0 -1
  415. package/dist/chunk-GR6NR5QK.js +0 -1
  416. package/dist/chunk-HKHGJYRC.js +0 -1
  417. package/dist/chunk-IKNCFVVX.js +0 -1
  418. package/dist/chunk-IMIPD73V.js +0 -6
  419. package/dist/chunk-IPN5OHBY.js +0 -6
  420. package/dist/chunk-J2HBEHCX.js +0 -9
  421. package/dist/chunk-K3OI5VDE.js +0 -1
  422. package/dist/chunk-KB43BSFM.js +0 -3
  423. package/dist/chunk-KGRDHI2A.js +0 -2
  424. package/dist/chunk-KNCYAIJ2.js +0 -7
  425. package/dist/chunk-KYNXMDFU.js +0 -836
  426. package/dist/chunk-L7CQQML6.js +0 -6
  427. package/dist/chunk-LCVDLQEZ.js +0 -1
  428. package/dist/chunk-NDAUL4H4.js +0 -1
  429. package/dist/chunk-NDFKLPHJ.js +0 -1705
  430. package/dist/chunk-NUKSSKYR.js +0 -1
  431. package/dist/chunk-NVNDQQN6.js +0 -8
  432. package/dist/chunk-O452KNRL.js +0 -1
  433. package/dist/chunk-P5R6JZMT.js +0 -6
  434. package/dist/chunk-PDWJ2YH2.js +0 -1
  435. package/dist/chunk-PSSOCUUD.js +0 -375
  436. package/dist/chunk-PWXGGZQB.js +0 -1
  437. package/dist/chunk-QKUTVLRJ.js +0 -4
  438. package/dist/chunk-QOOVB6RW.js +0 -6
  439. package/dist/chunk-RGJVJ22M.js +0 -3
  440. package/dist/chunk-TIG7SSKB.js +0 -3
  441. package/dist/chunk-TU47HMTL.js +0 -1
  442. package/dist/chunk-UBTHWHPB.js +0 -12
  443. package/dist/chunk-UDWSRNKO.js +0 -1
  444. package/dist/chunk-VE6BYYBP.js +0 -5
  445. package/dist/chunk-W3BNL2Q5.js +0 -1
  446. package/dist/chunk-WDY5CK2T.js +0 -11
  447. package/dist/chunk-WHZKFG2B.js +0 -1
  448. package/dist/chunk-WLU7UG44.js +0 -3
  449. package/dist/chunk-WNBRPWSB.js +0 -1
  450. package/dist/chunk-WWRLFLGM.js +0 -2
  451. package/dist/chunk-XOEBZR5C.js +0 -3
  452. package/dist/chunk-YGSXN3YD.js +0 -28
  453. package/dist/chunk-YN5SVIOI.js +0 -11
  454. package/dist/chunk-YVB7ZPHR.js +0 -20
  455. package/dist/chunk-ZIAXZ5VG.js +0 -1
  456. package/dist/chunk-ZZNGFCJ3.js +0 -4
  457. package/dist/cli/commands/app/doctor/instructions.js +0 -1
  458. package/dist/cli/commands/app/doctor.js +0 -1
  459. package/dist/cli/commands/config/autoupgrade/constants.d.ts +0 -4
  460. package/dist/cli/commands/config/autoupgrade/constants.js +0 -1
  461. package/dist/cli/services/commands/search.d.ts +0 -1
  462. package/dist/cli/services/commands/search.js +0 -7
  463. package/dist/cli/services/commands/version.d.ts +0 -1
  464. package/dist/cli/services/commands/version.js +0 -6
  465. package/dist/custom-oclif-loader-BWAMUFQ4.js +0 -1
  466. package/dist/deprecations-DVGWC3RL.js +0 -1
  467. package/dist/dist-CN7N5IOM.js +0 -1
  468. package/dist/dist-Q5U4WGYG.js +0 -1
  469. package/dist/environments-M4CFP4XF.js +0 -1
  470. package/dist/error-ZES2RSN7.js +0 -1
  471. package/dist/error-handler-CRTU67VJ.js +0 -1
  472. package/dist/fs-GELMKEWX.js +0 -1
  473. package/dist/http-proxy-node16-A6AKKRQH.js +0 -38
  474. package/dist/is-global-X2QNCXXB.js +0 -1
  475. package/dist/lib-2BR2WN7L.js +0 -1
  476. package/dist/lib-M72BVWQ3.js +0 -1
  477. package/dist/lib-P3APEIHY.js +0 -1
  478. package/dist/local-HMFFXIE3.js +0 -1
  479. package/dist/metadata-SXJZZMCI.js +0 -1
  480. package/dist/node-package-manager-2D2CIFTG.js +0 -1
  481. package/dist/notifications-system-WH6MAXEN.js +0 -1
  482. package/dist/os-PY42WAOB.js +0 -1
  483. package/dist/output-MSTNB7GI.js +0 -1
  484. package/dist/system-7XRI63YJ.js +0 -1
  485. package/dist/ui-77QYNWJB.js +0 -1
  486. package/dist/upgrade-UVPNOKKK.js +0 -1
  487. package/dist/version-DXGPL73I.js +0 -1
  488. package/dist/version-XMVQO6PD.js +0 -1
  489. package/dist/workerd-SOWC66FA.js +0 -18
@@ -1,19 +1,19 @@
1
- import{p as C,v as Y}from"./chunk-GBYDMHZ3.js";import{$ as re,aa as H}from"./chunk-MFP63IUM.js";import{b as U}from"./chunk-2IZROVCY.js";import{r as L}from"./chunk-5GUXN2RU.js";import{y as w,z as E}from"./chunk-PSSOCUUD.js";import{h as P}from"./chunk-W3BNL2Q5.js";import{a as oe}from"./chunk-CTNBSUVU.js";import{$a as A,Ab as j,N as I,Ta as N,ua as T,wb as p,xb as $,yb as G}from"./chunk-G5QSVBYP.js";import{d as O,f as _,p as b}from"./chunk-773TIA5M.js";import{e as k,g as v}from"./chunk-VKWPEFWQ.js";v();v();var r=k(H(),1),l=k(re(),1);function se(e,t){return e instanceof Error&&"code"in e&&e.code==="ENOENT"&&"path"in e&&typeof e.path=="string"&&_(e.path)===_(t)}async function F(e,t){try{return await t()}catch(n){throw e!==void 0&&se(n,e)?new P(`Theme Check config file not found: ${e}`):n}}function ce(e){switch(e){case"error":return r.Severity.ERROR;case"suggestion":case"warning":return r.Severity.WARNING;case"style":case"info":return r.Severity.INFO;case"crash":return}}function W(e){switch(e){case r.Severity.ERROR:return"error";case r.Severity.WARNING:return"warning";case r.Severity.INFO:return"info"}}function ae(e){return new Map(e.map(t=>[t.uri,t.source]))}function ue(e,t,n){let o=e.split(`
2
- `).slice(t,n+1),s=o.length===1;return o.map((c,a)=>{let u=t+a+1,m=s?c.trim():c;return`${u} ${m}`}).join(`
1
+ import{p as C,v as Y}from"./chunk-2AZXDU2R.js";import{$ as re,aa as q}from"./chunk-HKNFZUAM.js";import{b as H}from"./chunk-2KBTFKSM.js";import{r as L}from"./chunk-NTFIW3VK.js";import{y as w,z as E}from"./chunk-KCHERKZO.js";import{i as $}from"./chunk-XUJURYN5.js";import{Ib as p,Kb as P,Lb as G,Nb as j,R as I,Xa as N,db as A,ya as T}from"./chunk-COFGQT76.js";import{b as oe}from"./chunk-JA2QZ635.js";import{d as O,f as S,p as b}from"./chunk-3VYOLEQE.js";import{e as k,g as v}from"./chunk-VKWPEFWQ.js";v();v();var r=k(q(),1),l=k(re(),1);function se(e,t){return e instanceof Error&&"code"in e&&e.code==="ENOENT"&&"path"in e&&typeof e.path=="string"&&S(e.path)===S(t)}async function F(e,t){try{return await t()}catch(n){throw e!==void 0&&se(n,e)?new $(`Theme Check config file not found: ${e}`):n}}function ce(e){switch(e){case"error":return r.Severity.ERROR;case"suggestion":case"warning":return r.Severity.WARNING;case"style":case"info":return r.Severity.INFO;case"crash":return}}function U(e){switch(e){case r.Severity.ERROR:return"error";case r.Severity.WARNING:return"warning";case r.Severity.INFO:return"info"}}function ae(e){return new Map(e.map(t=>[t.uri,t.source]))}function ue(e,t,n){let o=e.split(`
2
+ `).slice(t,n+1),s=o.length===1;return o.map((c,a)=>{let u=t+a+1,d=s?c.trim():c;return`${u} ${d}`}).join(`
3
3
  `)}function fe(e){switch(e){case r.Severity.ERROR:return{error:`
4
4
  [error]:`};case r.Severity.WARNING:return{warn:`
5
5
  [warning]:`};case r.Severity.INFO:return{info:`
6
- [info]:`}}}function he(e,t){return e.map((i,o)=>{let{message:s,uri:c,start:a,end:u,check:m,severity:d}=i,f=t.get(c),x=f===void 0?[]:[`
6
+ [info]:`}}}function he(e,t){return e.map((i,o)=>{let{message:s,uri:c,start:a,end:u,check:d,severity:m}=i,f=t.get(c),x=f===void 0?[]:[`
7
7
 
8
- ${ue(f,a.line,u.line)}`],S=o===e.length-1?"":`
8
+ ${ue(f,a.line,u.line)}`],_=o===e.length-1?"":`
9
9
 
10
- `;return[fe(d),{bold:m},{subdued:`
11
- ${s}`},...x,S]}).flat()}var de=(e,t)=>e.severity-t.severity;function q(e){let t=e.reduce((n,i)=>{let{uri:o}=i,s=r.path.fsPath(o);return n[s]??=[],n[s].push(i),n},{});return Object.keys(t).reduce((n,i)=>(n[i]=t[i].sort(de),n),{})}function B(e){return e.reduce((t,n)=>(!Object.prototype.hasOwnProperty.call(t,n.severity)&&(t[n.severity]=0),t[n.severity]++,t),{})}function M(e,t,n){let i=[`${n.length} files inspected`];if(e.length===0)i.push("with no offenses found.");else{i.push(`with ${e.length} total offenses found across ${Object.keys(t).length} files.`);let o=B(e);o[r.Severity.ERROR]&&i.push(`
10
+ `;return[fe(m),{bold:d},{subdued:`
11
+ ${s}`},...x,_]}).flat()}var me=(e,t)=>e.severity-t.severity;function W(e){let t=e.reduce((n,i)=>{let{uri:o}=i,s=r.path.fsPath(o);return n[s]??=[],n[s].push(i),n},{});return Object.keys(t).reduce((n,i)=>(n[i]=t[i].sort(me),n),{})}function B(e){return e.reduce((t,n)=>(t[n.severity]=(t[n.severity]??0)+1,t),{})}function M(e,t,n){let i=[`${n.length} files inspected`];if(e.length===0)i.push("with no offenses found.");else{i.push(`with ${e.length} total offenses found across ${Object.keys(t).length} files.`);let o=B(e);o[r.Severity.ERROR]&&i.push(`
12
12
  ${o[r.Severity.ERROR]} errors.`),o[r.Severity.WARNING]&&i.push(`
13
13
  ${o[r.Severity.WARNING]} warnings.`),o[r.Severity.INFO]&&i.push(`
14
- ${o[r.Severity.INFO]} info issues.`)}return i}function D(e,t,n,i){let o=ae(n);Object.keys(e).sort().forEach(c=>{let a=c.replace(t,"").slice(1);w({headline:i?`[${i}] ${a}`:a,body:he(e[c],o)})})}function J(e,t){return Object.entries(e).map(([n,i])=>{let o=i.map(c=>({check:c.check,severity:W(c.severity),start_row:c.start.line,start_column:c.start.character,end_row:c.end.line,end_column:c.end.character,message:c.message})),s=B(i);return{environment:t,path:n,offenses:o,errorCount:s[r.Severity.ERROR]??0,warningCount:s[r.Severity.WARNING]??0,infoCount:s[r.Severity.INFO]??0}})}function V(e,t){t||process.exit(0);let n=ce(t),i=n!==void 0&&e.some(o=>o.severity<=n);process.exit(i?1:0)}function me(e){return e.split(`
14
+ ${o[r.Severity.INFO]} info issues.`)}return i}function D(e,t,n,i){let o=ae(n);Object.keys(e).sort().forEach(c=>{let a=c.replace(t,"").slice(1);w({headline:i?`[${i}] ${a}`:a,body:he(e[c],o)})})}function J(e,t){return Object.entries(e).map(([n,i])=>{let o=i.map(c=>({check:c.check,severity:U(c.severity),start_row:c.start.line,start_column:c.start.character,end_row:c.end.line,end_column:c.end.character,message:c.message})),s=B(i);return{environment:t,path:n,offenses:o,errorCount:s[r.Severity.ERROR]??0,warningCount:s[r.Severity.WARNING]??0,infoCount:s[r.Severity.INFO]??0}})}function V(e,t){t||process.exit(0);let n=ce(t),i=n!==void 0&&e.some(o=>o.severity<=n);process.exit(i?1:0)}function de(e){return e.split(`
15
15
  `).map(t=>`# ${t}`).join(`
16
- `)}async function z(e){let t=".theme-check.yml",n=O(e,t);if(await N(n)){$(`${t} already exists at ${e}`);return}let{settings:i}=await(0,r.loadConfig)(void 0,e),o=me(l.default.stringify(i)),s=l.default.stringify({extends:"theme-check:recommended",ignore:["node_modules/**"]});await T(n,`${s}${o}`),G(`Created ${t} at ${e}`)}var pe=async(e,t)=>{let n=(0,r.applyFixToString)(e.source,t),i=r.path.fsPath(e.uri);await T(i,n)};async function K(e,t){await(0,r.autofix)(e,t,pe)}async function Q(e,t,n){let{ignore:i,settings:o,rootUri:s}=await F(t,()=>(0,r.loadConfig)(t,e)),c={extends:[],ignore:I(i??[]),rootUri:s,...o},a=n?{[n]:c}:c;p(l.default.stringify(a))}async function X(e,t,n){let{settings:i,ignore:o,checks:s}=await F(t,()=>(0,r.loadConfig)(t,e)),c=I(o??[]),u=Object.keys(i).reduce((d,f)=>{let{severity:x,enabled:S,...ee}=i[f];if(!S)return d;let te=W(x??r.Severity.INFO),g=s.find(ie=>ie.meta.code===f),ne=g&&g.meta?{description:g.meta.docs.description,doc:g.meta.docs.url}:{};return d[f]={severity:te,...ne,ignored_patterns:`[${c.join(", ")}]`,...ee},d},{}),m=n?{[n]:u}:u;p(l.default.stringify(m))}function Z(e){return"_handle"in e&&typeof e._handle=="object"&&e._handle!==null&&typeof e._handle.setBlocking=="function"}var h=k(oe(),1);var y=k(H(),1);var R=class extends Y{static summary="Validate the theme.";static descriptionWithMarkdown="Calls and runs [Theme Check](https://shopify.dev/docs/themes/tools/theme-check) to analyze your theme code for errors and to ensure that it follows theme and Liquid best practices. [Learn more about the checks that Theme Check runs.](https://shopify.dev/docs/themes/tools/theme-check/checks)";static description=this.descriptionWithoutMarkdown();static flags={...U,path:C.path,"auto-correct":h.Flags.boolean({char:"a",required:!1,description:"Automatically fix offenses",env:"SHOPIFY_FLAG_AUTO_CORRECT"}),config:h.Flags.string({char:"C",required:!1,description:`Use the config provided, overriding .theme-check.yml if present
16
+ `)}async function z(e){let t=".theme-check.yml",n=O(e,t);if(await N(n)){P(`${t} already exists at ${e}`);return}let{settings:i}=await(0,r.loadConfig)(void 0,e),o=de(l.default.stringify(i)),s=l.default.stringify({extends:"theme-check:recommended",ignore:["node_modules/**"]});await T(n,`${s}${o}`),G(`Created ${t} at ${e}`)}var pe=async(e,t)=>{let n=(0,r.applyFixToString)(e.source,t),i=r.path.fsPath(e.uri);await T(i,n)};async function K(e,t){await(0,r.autofix)(e,t,pe)}async function Q(e,t,n){let{ignore:i,settings:o,rootUri:s}=await F(t,()=>(0,r.loadConfig)(t,e)),c={extends:[],ignore:I(i??[]),rootUri:s,...o},a=n?{[n]:c}:c;p(l.default.stringify(a))}async function X(e,t,n){let{settings:i,ignore:o,checks:s}=await F(t,()=>(0,r.loadConfig)(t,e)),c=I(o??[]),u=Object.keys(i).reduce((m,f)=>{let{severity:x,enabled:_,...ee}=i[f];if(!_)return m;let te=U(x??r.Severity.INFO),y=s.find(ie=>ie.meta.code===f),ne=y&&y.meta?{description:y.meta.docs.description,doc:y.meta.docs.url}:{};return m[f]={severity:te,...ne,ignored_patterns:`[${c.join(", ")}]`,...ee},m},{}),d=n?{[n]:u}:u;p(l.default.stringify(d))}function Z(e){return"_handle"in e&&typeof e._handle=="object"&&e._handle!==null&&typeof e._handle.setBlocking=="function"}var h=k(oe(),1);var g=k(q(),1);var R=class extends Y{static summary="Validate the theme.";static descriptionWithMarkdown="Calls and runs [Theme Check](https://shopify.dev/docs/themes/tools/theme-check) to analyze your theme code for errors and to ensure that it follows theme and Liquid best practices. [Learn more about the checks that Theme Check runs.](https://shopify.dev/docs/themes/tools/theme-check/checks)";static description=this.descriptionForHelp();static flags={...H,path:C.path,"auto-correct":h.Flags.boolean({char:"a",required:!1,description:"Automatically fix offenses",env:"SHOPIFY_FLAG_AUTO_CORRECT"}),config:h.Flags.string({char:"C",required:!1,description:`Use the config provided, overriding .theme-check.yml if present
17
17
  Supports all theme-check: config values, e.g., theme-check:theme-app-extension,
18
18
  theme-check:recommended, theme-check:all
19
- For backwards compatibility, :theme_app_extension is also supported `,env:"SHOPIFY_FLAG_CONFIG"}),"fail-level":h.Flags.string({required:!1,description:"Minimum severity for exit with error code",env:"SHOPIFY_FLAG_FAIL_LEVEL",options:["crash","error","suggestion","style","warning","info"],default:"error"}),init:h.Flags.boolean({required:!1,description:"Generate a .theme-check.yml file",env:"SHOPIFY_FLAG_INIT"}),list:h.Flags.boolean({required:!1,description:"List enabled checks",env:"SHOPIFY_FLAG_LIST"}),output:h.Flags.string({char:"o",required:!1,description:"The output format to use",env:"SHOPIFY_FLAG_OUTPUT",options:["text","json"],default:"text"}),print:h.Flags.boolean({required:!1,description:"Output active config to STDOUT",env:"SHOPIFY_FLAG_PRINT"}),version:h.Flags.boolean({char:"v",required:!1,description:"Print Theme Check version",env:"SHOPIFY_FLAG_VERSION"}),environment:C.environment};static multiEnvironmentsFlags=["path"];async command(t,n,i){let o=t.path,s=t.environment?.[0],a=t.config?.startsWith(":")&&y.LegacyIdentifiers.has(t.config.slice(1))?y.LegacyIdentifiers.get(t.config.slice(1)):t.config;if(t.init){await z(o);return}if(t.version){let d=await A(O("node_modules","@shopify","theme-check-node","package.json"),{type:"file",cwd:b(import.meta.url)}),f="unknown";d&&(f=await L(d)??"unknown"),p(f);return}if(t.print){await Q(o,a,s);return}if(t.list){await X(o,a,s);return}let{offenses:u,theme:m}=await le(o,t.output,a,s);if(t["auto-correct"]&&await K(m,u),!i)return V(u,t["fail-level"])}};async function le(e,t,n,i){let{offenses:o,theme:s}=await F(n,()=>(0,y.themeCheckRun)(e,n,a=>{process.env.SHOPIFY_TMP_FLAG_DEBUG&&j(a)})),c=q(o);if(t==="text"&&(D(c,e,s,i),(o.length?w:E)({headline:i?`[${i}] Theme Check Summary.`:"Theme Check Summary.",body:M(o,c,s)})),t==="json"){let a=process.stdout;Z(a)&&a._handle.setBlocking(!0),p(JSON.stringify(J(c,i)))}return{offenses:o,theme:s}}export{R as a,le as b};
19
+ For backwards compatibility, :theme_app_extension is also supported `,env:"SHOPIFY_FLAG_CONFIG"}),"fail-level":h.Flags.string({required:!1,description:"Minimum severity for exit with error code",env:"SHOPIFY_FLAG_FAIL_LEVEL",options:["crash","error","suggestion","style","warning","info"],default:"error"}),init:h.Flags.boolean({required:!1,description:"Generate a .theme-check.yml file",env:"SHOPIFY_FLAG_INIT"}),list:h.Flags.boolean({required:!1,description:"List enabled checks",env:"SHOPIFY_FLAG_LIST"}),output:h.Flags.string({char:"o",required:!1,description:"The output format to use",env:"SHOPIFY_FLAG_OUTPUT",options:["text","json"],default:"text"}),print:h.Flags.boolean({required:!1,description:"Output active config to STDOUT",env:"SHOPIFY_FLAG_PRINT"}),version:h.Flags.boolean({char:"v",required:!1,description:"Print Theme Check version",env:"SHOPIFY_FLAG_VERSION"}),environment:C.environment};static multiEnvironmentsFlags=["path"];async command(t,n,i){let o=t.path,s=t.environment?.[0],a=t.config?.startsWith(":")&&g.LegacyIdentifiers.has(t.config.slice(1))?g.LegacyIdentifiers.get(t.config.slice(1)):t.config;if(t.init){await z(o);return}if(t.version){let m=await A(O("node_modules","@shopify","theme-check-node","package.json"),{type:"file",cwd:b(import.meta.url)}),f="unknown";m&&(f=await L(m)??"unknown"),p(f);return}if(t.print){await Q(o,a,s);return}if(t.list){await X(o,a,s);return}let{offenses:u,theme:d}=await le(o,t.output,a,s);if(t["auto-correct"]&&await K(d,u),!i)return V(u,t["fail-level"])}};async function le(e,t,n,i){let{offenses:o,theme:s}=await F(n,()=>(0,g.themeCheckRun)(e,n,a=>{process.env.SHOPIFY_TMP_FLAG_DEBUG&&j(a)})),c=W(o);if(t==="text"&&(D(c,e,s,i),(o.length?w:E)({headline:i?`[${i}] Theme Check Summary.`:"Theme Check Summary.",body:M(o,c,s)})),t==="json"){let a=process.stdout;Z(a)&&a._handle.setBlocking(!0),p(JSON.stringify(J(c,i)))}return{offenses:o,theme:s}}export{R as a,le as b};
@@ -0,0 +1,4 @@
1
+ import{b as A}from"./chunk-2KBTFKSM.js";import{b as w}from"./chunk-CUZQRXTV.js";import{j as g}from"./chunk-VWYZCCRE.js";import{i as a}from"./chunk-XUJURYN5.js";import{Aa as m,Ib as y,Kb as v,ya as u}from"./chunk-COFGQT76.js";import{b as L}from"./chunk-JA2QZ635.js";import{f as h,i as f}from"./chunk-3VYOLEQE.js";import{e as x,g as s}from"./chunk-VKWPEFWQ.js";s();s();var U="text/markdown",b="X-Shopify-Surface",R="cli",F=["shopify.dev"];async function S(t,e,p){let c;try{c=new URL(t)}catch{throw new a(`Invalid URL: ${t}`)}let{hostname:d}=c;if(!F.some(o=>d===o||d.endsWith(`.${o}`)))throw new a(`Only documents from the following hosts can be fetched: ${F.join(", ")}.`);let i=await g(t,{headers:{Accept:U,[b]:R,...p?{"Accept-Language":p}:{}}});if(!i.ok)throw new a(`Failed to fetch ${t}: ${i.status} ${i.statusText}`);let l=await i.text();if(e){let o=h(e);await m(f(o)),await u(o,l),v(`Saved ${t} to ${o}`);return}y(l)}var n=x(L(),1),r=class t extends w{static description="Download a complete document from shopify.dev. Every page on shopify.dev has a Markdown version, and that is what this tool returns. Use this to pull an entire document verbatim \u2014 for example, a set of instructions an agent follows like a centrally-served skill. Pass `--language` for the language of the app you are building so code examples match your stack. For finding the relevant pieces of content across shopify.dev instead, use `doc search`.";static examples=[`# fetch the Markdown version of a Shopify.dev page
2
+ shopify doc fetch --url https://shopify.dev/docs/api/shopify-cli`,`# filter code examples to the language of the app you are building
3
+ shopify doc fetch --url https://shopify.dev/docs/api/shopify-cli --language ruby`,`# save the document to a file instead of printing it
4
+ shopify doc fetch --url https://shopify.dev/docs/api/shopify-cli --output docs/shopify-cli.md`];static flags={...A,url:n.Flags.string({description:"The shopify.dev URL to fetch.",env:"SHOPIFY_FLAG_URL",required:!0}),language:n.Flags.string({description:"Filter code examples in the returned Markdown to this language. Supply the language of the app you are building so examples match your stack. Optional \u2014 if omitted, or if shopify.dev does not recognize the language for a given page, the document includes examples in every language.",env:"SHOPIFY_FLAG_LANGUAGE",options:["javascript","typescript","python","ruby","php","rust","curl","liquid","graphql","html"]}),output:n.Flags.string({description:"Write the document to this file path instead of printing it to stdout.",env:"SHOPIFY_FLAG_OUTPUT"})};async run(){let{flags:e}=await this.parse(t);await S(e.url,e.output,e.language)}};export{r as a};
@@ -1 +1 @@
1
- import{h as l}from"./chunk-TUWRPDTE.js";import{T as c}from"./chunk-KYNXMDFU.js";import{h as u}from"./chunk-W3BNL2Q5.js";import{g as i}from"./chunk-VKWPEFWQ.js";i();var s=["live","unpublished","development"];async function x(e,r){let t=await c(e,r);return p(t)}async function p(e){let r=e.storeFqdn,t=(await l(e)).filter(d);if(t.length===0)throw new u(`There are no themes in the ${r} store`);return t.sort(w)}function d(e){return s.includes(e.role)}function w(e,r){return s.indexOf(e.role)-s.indexOf(r.role)}i();function b(e,r,t){return y(e,r,t)??T(e,r,t)}function y(e,r,t){let o=t.role;if(!o)return;let n=`No themes on the store ${e} match the role "${o}"`;return m(r,h=>h.role===o).orThrow(n)}function T(e,r,t){return t.themeIdentifiers.flatMap(n=>{let h=`No themes on the store ${e} match the ID or name "${n}"`;return m(r,f=>`${f.id}`===n||f.name.toLowerCase()===n.toLowerCase()?!0:L(f.name.toLowerCase(),n.toLowerCase())).orThrow(h)})}function m(e,r){let t=e.filter(r);return t.length>0?{orThrow:o=>t}:{orThrow:o=>{throw new u(o)}}}var a=class{queryProps;constructor(r){this.queryProps=r}get role(){for(let r of s)if(this.queryProps[r])return r}get themeIdentifiers(){return[this.queryProps.theme,this.queryProps.themes].flat().filter(t=>!!t)}any(){return Object.values(this.queryProps).some(r=>r?.length!==void 0?r.length>0:!!r)}};function L(e,r){let t=r.replace(/(^\*)|(\*$)/g,"");return r.startsWith("*")&&r.endsWith("*")?e.includes(t):r.startsWith("*")?e.endsWith(t):r.endsWith("*")?e.startsWith(t):!1}export{s as a,x as b,p as c,b as d,a as e};
1
+ import{h as l}from"./chunk-NSHKVJST.js";import{K as c}from"./chunk-VWYZCCRE.js";import{i as u}from"./chunk-XUJURYN5.js";import{g as i}from"./chunk-VKWPEFWQ.js";i();var s=["live","unpublished","development"];async function x(e,r){let t=await c(e,r);return p(t)}async function p(e){let r=e.storeFqdn,t=(await l(e)).filter(d);if(t.length===0)throw new u(`There are no themes in the ${r} store`);return t.sort(w)}function d(e){return s.includes(e.role)}function w(e,r){return s.indexOf(e.role)-s.indexOf(r.role)}i();function b(e,r,t){return y(e,r,t)??T(e,r,t)}function y(e,r,t){let o=t.role;if(!o)return;let n=`No themes on the store ${e} match the role "${o}"`;return m(r,h=>h.role===o).orThrow(n)}function T(e,r,t){return t.themeIdentifiers.flatMap(n=>{let h=`No themes on the store ${e} match the ID or name "${n}"`;return m(r,f=>`${f.id}`===n||f.name.toLowerCase()===n.toLowerCase()?!0:L(f.name.toLowerCase(),n.toLowerCase())).orThrow(h)})}function m(e,r){let t=e.filter(r);return t.length>0?{orThrow:o=>t}:{orThrow:o=>{throw new u(o)}}}var a=class{queryProps;constructor(r){this.queryProps=r}get role(){for(let r of s)if(this.queryProps[r])return r}get themeIdentifiers(){return[this.queryProps.theme,this.queryProps.themes].flat().filter(t=>!!t)}any(){return Object.values(this.queryProps).some(r=>r?.length!==void 0?r.length>0:!!r)}};function L(e,r){let t=r.replace(/(^\*)|(\*$)/g,"");return r.startsWith("*")&&r.endsWith("*")?e.includes(t):r.startsWith("*")?e.endsWith(t):r.endsWith("*")?e.startsWith(t):!1}export{s as a,x as b,p as c,b as d,a as e};
@@ -1 +1 @@
1
- import{g as o}from"./chunk-2IZROVCY.js";import{b as s}from"./chunk-UBTHWHPB.js";import{g as e}from"./chunk-VKWPEFWQ.js";e();var t=class extends s{static description="Clear the CLI cache, used to store some API responses and handle notifications status";static hidden=!0;async run(){await o()}};export{t as a};
1
+ import{g as o}from"./chunk-2KBTFKSM.js";import{b as s}from"./chunk-CUZQRXTV.js";import{g as e}from"./chunk-VKWPEFWQ.js";e();var t=class extends s{static description="Clear the CLI cache, used to store some API responses and handle notifications status";static hidden=!0;async run(){await o()}};export{t as a};
@@ -0,0 +1 @@
1
+ import{b as u}from"./chunk-5XO6PAMV.js";import{b as r,c as I,e as p}from"./chunk-WNO2V53C.js";import{a as o}from"./chunk-JD5P5RAJ.js";import{g as c}from"./chunk-VKWPEFWQ.js";c();c();function i(t){return!(t===void 0||t.trim()==="")}function s(t,e){switch(t){case"bitbucket":return{branch:e.BITBUCKET_BRANCH,build:e.BITBUCKET_BUILD_NUMBER,commitSha:e.BITBUCKET_COMMIT,run:e.BITBUCKET_BUILD_NUMBER,url:`https://bitbucket.org/${e.BITBUCKET_WORKSPACE}/${e.BITBUCKET_REPO_SLUG}/pipelines/results/${e.BITBUCKET_BUILD_NUMBER}`};case"circleci":return{actor:e.CIRCLE_USERNAME,branch:e.CIRCLE_BRANCH,build:e.CIRCLE_BUILD_NUM,commitSha:e.CIRCLE_SHA1,run:e.CIRCLE_WORKFLOW_ID,url:e.CIRCLE_BUILD_URL};case"github":return{actor:e.GITHUB_ACTOR,attempt:e.GITHUB_RUN_ATTEMPT,branch:e.GITHUB_REF_NAME,build:e.GITHUB_RUN_ID,commitSha:e.GITHUB_SHA,run:e.GITHUB_RUN_ID,runNumber:e.GITHUB_RUN_NUMBER,url:`${e.GITHUB_SERVER_URL}/${e.GITHUB_REPOSITORY}/actions/runs/${e.GITHUB_RUN_ID}`};case"gitlab":return{actor:e.GITLAB_USER_LOGIN,branch:e.CI_COMMIT_REF_NAME,build:e.CI_PIPELINE_ID,commitSha:e.CI_COMMIT_SHA,commitMessage:e.CI_COMMIT_MESSAGE,run:e.CI_RUNNER_ID,url:e.CI_PIPELINE_URL};case"buildkite":return{branch:e.BUILDKITE_BRANCH,build:e.BUILDKITE_BUILD_NUMBER,commitSha:e.BUILDKITE_COMMIT,commitMessage:e.BUILDKITE_MESSAGE,run:e.BUILDKITE_BUILD_NUMBER,url:e.BUILDKITE_BUILD_URL};default:return{}}}import{randomUUID as m}from"crypto";import{homedir as f,networkInterfaces as U}from"os";async function _(t){let{fileExists:e}=await import("./fs-Y33QBYY5.js");return e(t)}async function T(t,e){let{exec:a}=await import("./system-MCWAHFXK.js");await a(t,e)}function N(){return!!(!u()&&process.stdout.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}function A(){return f()}var d,l;function y(){l=void 0}function B(t=process.env){return t[r.env]==="development"}function g(t=process.env){return t===process.env?d??=o(t[r.verbose])||process.argv.includes("--verbose"):o(t[r.verbose])||process.argv.includes("--verbose")}async function S(t=process.env){return Object.prototype.hasOwnProperty.call(t,r.runAsUser)?!o(t[r.runAsUser]):await _(p.executables.dev)}function K(t=process.env){return t===process.env?l??=o(t[r.unitTest]):o(t[r.unitTest])}function G(t=process.env){return o(t[r.noAnalytics])||o(t[r.optOutInstrumentation])||B(t)}function O(t=process.env){return o(t[r.alwaysLogAnalytics])}function H(t=process.env){return o(t[r.alwaysLogMetrics])}function w(t=process.env){return o(t[r.doctor])}function P(t=process.env){return t[r.gitpod]}function k(t=process.env){return t[r.codespaceName]}function z(t=process.env){return t[r.codespacePortForwardingDomain]}function F(t=process.env){return E(t).platform!=="localhost"}function $(t=process.env){return t[r.themeToken]}function E(t=process.env){return i(t[r.codespaces])?{platform:"codespaces",editor:!0}:i(t[r.gitpod])?{platform:"gitpod",editor:!0}:i(t[r.cloudShell])?{platform:"cloudShell",editor:!0}:{platform:"localhost",editor:!1}}async function V(){try{return await T("git",["--version"]),!0}catch{return!1}}function W(t=process.env){if(o(t.CI)){let e="unknown";return i(t.BITBUCKET_BUILD_NUMBER)?e="bitbucket":o(t.CIRCLECI)?e="circleci":i(t.GITHUB_ACTION)?e="github":o(t.GITLAB_CI)?e="gitlab":i(t.BUILDKITE)&&(e="buildkite"),{isCI:!0,name:e,metadata:s(e,t)}}else if(o(t.TF_BUILD))return{isCI:!0,name:"azure",metadata:s("azure",t)};return{isCI:!1}}async function j(){let t="00:00:00:00:00:00",e=Object.values(U()).flat().filter(n=>!!(n&&n.mac!==t));return(e.find(n=>!n.internal)??e[0])?.mac??m()}function Y(t=process.env){let e=t[r.themeKitAccessDomain];return i(e)?e:I}function q(t=process.env){let e=t[r.otelURL];return i(e)?e:"https://otlp-http-production-cli.shopifysvc.com"}export{N as a,A as b,y as c,B as d,g as e,S as f,K as g,G as h,O as i,H as j,w as k,P as l,k as m,z as n,F as o,$ as p,E as q,V as r,W as s,j as t,Y as u,q as v};
@@ -0,0 +1,20 @@
1
+ import{a as Mt}from"./chunk-UOHNRH6E.js";import{a as Ur}from"./chunk-ADIHYUQC.js";import{b as Tr}from"./chunk-5ZSN73EA.js";import{a as _r}from"./chunk-S3IDGHAZ.js";import{a as Cr}from"./chunk-UJD7OQ3I.js";import{a as Ir}from"./chunk-23ITMFUO.js";import{a as gr}from"./chunk-NWBAD3AV.js";import{a as wr}from"./chunk-W6TPRWEE.js";import{a as yr,b as vr,c as Pr,d as xr}from"./chunk-LEFAUWKH.js";import{a as Rr}from"./chunk-VEIZLSMG.js";import{a as Er}from"./chunk-F34MAI7X.js";import{a as br}from"./chunk-GILHUPUG.js";import{a as Ar}from"./chunk-GF75CMTJ.js";import{a as Sr}from"./chunk-JCOQDVEB.js";import{a as ar}from"./chunk-AZCPTV4A.js";import{a as lr}from"./chunk-NYNSMHKY.js";import{a as pr}from"./chunk-T7BUP75N.js";import{a as dr}from"./chunk-SKK7CPUY.js";import{g as ur}from"./chunk-LAHZ6FO5.js";import{a as Xe}from"./chunk-5UDBNXNH.js";import{c as Je,m as Ze}from"./chunk-3UZYLXCB.js";import{a as mr}from"./chunk-JCVQB6MX.js";import{a as fr}from"./chunk-OJ7KRWUH.js";import{a as cr}from"./chunk-FJCNEHTH.js";import{b as ir,g as _e,j as Qe}from"./chunk-NSHKVJST.js";import{a as lo,b as po,c as uo,d as mo}from"./chunk-UVSXPMUN.js";import{d as hr}from"./chunk-3GVSG4S6.js";import{a as nr,b as sr,c as ao,d as io,e as rt,f as co,g as fo}from"./chunk-ZDRQUKLN.js";import{a as M,b as Ye}from"./chunk-LRKJSNM3.js";import{a as Xt,b as Zt,d as Ae,f as er,m as Te,n as H,s as q,u as tr,v as rr,w as or}from"./chunk-Q7BOSHWX.js";import{a as Jt}from"./chunk-254XYKPN.js";import{a as Zr,b as tt,c as ee,d as eo}from"./chunk-QH5R32AA.js";import{a as ho,f as go,g as wo,h as ot,i as yo,j as vo,k as Po,l as xo,m as Eo,n as bo,o as So,p as Uo,q as Ro,v as Ao,x as To,z as nt}from"./chunk-55JDA75S.js";import{a as to,b as ro,c as oo,d as no,e as so}from"./chunk-2FHVYY3B.js";import{a as Lr}from"./chunk-33D7HGAI.js";import{a as Xr}from"./chunk-STLYSBD5.js";import{a as Jr}from"./chunk-MINDMVTH.js";import{a as kr}from"./chunk-RFDOSK57.js";import{Ha as Qr,I as Br,K as Kr,M as Z,W as jr,X as zr,ha as Yr,i as $r,j as W,k as Mr,o as Dr,t as et,u as Or,v as Nr,w as qr,x as Wr,y as Hr,ya as Ie,z as Gr,za as ke}from"./chunk-AKSOCKVF.js";import{B as Fr,la as Vr,p as Ce,u as ie}from"./chunk-WBTR5JZ6.js";import{d as Yt}from"./chunk-LOKVWZD2.js";import{a as K}from"./chunk-7AD5YCLL.js";import{b as Qt,e as Re}from"./chunk-2KBTFKSM.js";import{J as It,V as J,X as kt,c as Rt,h as At,j as Tt,m as _t,na as Lt,o as Ct,p as we,u as ye}from"./chunk-VWYZCCRE.js";import{A as se,H as be,L as Bt,N as Se,S as Ue,T as ae,U as ze,V as Kt,X as jt,a as Ut,d as ve,e as k,f as $,h as Pe,i as xe,j as Ft,k as Dt,l as Ot,m as Nt,n as qt,o as F,p as Wt,q as je,r as Ve,s as Ht,t as Gt,y as Ee}from"./chunk-KCHERKZO.js";import{b as Ke,d as Et,f as bt,i as St}from"./chunk-YTJ3EPD3.js";import{a as In}from"./chunk-7UNQOKZW.js";import{d as $t}from"./chunk-WR2MMFJO.js";import{i as A,l as X}from"./chunk-XUJURYN5.js";import{a as _o}from"./chunk-QPCDSJ4J.js";import{Aa as fe,Cb as P,Eb as b,Ia as vt,Kb as B,Nb as g,Ob as C,Ra as he,T as Be,Xa as D,_a as ge,db as Pt,gb as xt,qa as L,ya as me}from"./chunk-COFGQT76.js";import{e as Vt,g as zt}from"./chunk-C4QR7Z4N.js";import{b as Cn}from"./chunk-JA2QZ635.js";import{a as ft}from"./chunk-JD5P5RAJ.js";import{d as S,f as Ge,g as ht,i as ue,j as gt,k as de,o as wt,p as yt}from"./chunk-3VYOLEQE.js";import{e as Q,g as p}from"./chunk-VKWPEFWQ.js";p();p();p();p();p();p();var kn=300*1e3,Ln='The host theme could not be created to host your theme app extension. Please try again or use the "--theme" flag to use an existing theme as the host theme.';async function Co(t,e,r=Date.now()){for(;await $n(t,e,r););}async function $n(t,e,r){let o=await _e(t,e);if(!o||Mn(o,r))throw new A(Ln);return await ae(3),o.processing}function Mn(t,e){return t.processing&&Date.now()-e>=kn}var Fn="https://codeload.github.com/Shopify/dawn/zip/refs/tags/v15.0.0",Dn="https://cdn.shopify.com/theme-store/uhrdefhlndzaoyrgylhto59sx2i7.jpg",st=3,Le=class extends cr{context="App Ext. Host";devPreview;constructor(e,r={devPreview:!1}){super(e),this.themeId=yr(e.storeFqdn),this.devPreview=r.devPreview}async findOrCreate(){let e=await this.fetch();return e??=this.devPreview?await this.createHostTheme():await this.create(),e}setTheme(e){vr(this.adminSession.storeFqdn,e)}removeTheme(){Pr(this.adminSession.storeFqdn)}async createHostTheme(){let e={role:ir,name:this.generateThemeName(this.context),src:Fn};for(let o=0;o<st;o++){g(`Attempt ${o}/${st}: Creating theme with name "${e.name}" and role "${e.role}"`);try{let n=await Qe(e,this.adminSession);if(n)return this.setTheme(n.id.toString()),g(`Waiting for theme with id "${n.id}" to be processed`),await Co(n.id,this.adminSession),n;throw new Error}catch{g(`Failed to create theme with name "${e.name}" and role "${e.role}". Retrying...`)}}g(`Theme creation failed after ${st} retries. Creating theme using fallback theme zip`);let r=await Qe({...e,src:Dn},this.adminSession);if(!r)throw g("Theme creation failed. Exiting process."),new X(`Could not create theme with name "${e.name}" and role "${e.role}"`);return r}};p();var On={"theme:init":gr,"theme:check":ar,"theme:console":lr,"theme:delete":pr,"theme:dev":dr,"theme:duplicate":mr,"theme:info":fr,"theme:language-server":wr,"theme:list":xr,"theme:metafields:pull":Rr,"theme:open":Er,"theme:package":br,"theme:profile":Sr,"theme:publish":Ur,"theme:preview":Ar,"theme:pull":Tr,"theme:push":_r,"theme:rename":Cr,"theme:share":Ir},ka=On;async function Io(t){let{remoteApp:e,localApp:r}=t,n=r.allExtensions.filter(U=>U.isThemeExtension);if(n.length===0)return;let a=n[0].directory,i=t.themeExtensionPort??9293,[c,d]=await Promise.all([It(t.storeFqdn),Wn(e)]),l=c.storeFqdn,[u,h]=await Promise.all([Ze(c),Je(c)]),y=h?await Xe(t.storePassword,l,u):void 0,m=await qn(c,t.theme),f=m.id.toString();return Ee({headline:"The theme app extension development server is ready.",orderedNextSteps:!0,nextSteps:[[{link:{label:"Install your app in your development store",url:d}}],[{link:{label:"Setup your theme app extension in the host theme",url:`https://${l}/admin/themes/${f}/editor`}}],["Preview your theme app extension at",{link:{label:`http://127.0.0.1:${i}`,url:`http://127.0.0.1:${i}`}}]]}),{type:"theme-app-extensions",prefix:"theme-extensions",function:Nn,options:{theme:m,adminSession:c,storefrontPassword:y,crawlerSignatureHeaders:u,themeExtensionDirectory:a,themeExtensionPort:i}}}var Nn=async(t,{theme:e,adminSession:r,storefrontPassword:o,crawlerSignatureHeaders:n,themeExtensionDirectory:s,themeExtensionPort:a})=>{await(await ur(e,{adminSession:r,storefrontPassword:o,crawlerSignatureHeaders:n,themeExtensionDirectory:s,themeExtensionPort:a})).start()};async function qn(t,e){let r;if(e)g(`Fetching theme with provided id ${e}`),r=await _e(parseInt(e,10),t);else{let o=new Le(t,{devPreview:!0});await be([{title:"Configuring host theme for theme app extension",task:async()=>{g("Finding or creating host theme for theme app extensions"),r=await o.findOrCreate()}}])}if(!r)throw new A("Could not find or create a host theme for theme app extensions");return r}async function Wn(t){return t.developerPlatformClient?.clientName===Vr.AppManagement?`https://${await we()}/?organization_id=${t.organizationId}&no_redirect=true&redirect=/oauth/redirect_from_developer_dashboard?client_id%3D${t.apiKey}`:`https://${await Ct()}/${t.organizationId}/apps/${t.id}/test`}p();p();p();p();p();p();async function Hn(t){let e=S(t.directory,"locales");return ge([S(e,"*.json")])}async function ko(t,e){let r=await Hn(t);if(!r.length)return{localization:void 0,status:""};let o=e.currentLocalizationPayload??{defaultLocale:"en",translations:{},lastUpdated:0},n="success";try{await Promise.all(r.map(async s=>{let[a,...i]=s.split("/").pop().split(".");if(a)return i[0]==="default"&&(o.defaultLocale=a),Gn(a,s,o,t,e)})),o.lastUpdated=Date.now(),g(`Parsed locales for extension ${t.handle} at ${t.directory}`,e.stdout)}catch{n="error"}return{localization:o,status:n}}async function Gn(t,e,r,o,n){let s;try{s=await L(e),r.translations[t]=JSON.parse(s)}catch(a){let i=`Error parsing ${t} locale for ${o.handle} at ${e}: ${a.message}`;throw C(i,n.stderr),new Error(i)}}p();function $e(t,e){switch(t){case"checkout_ui_extension":return{url:e.checkoutCartUrl};case"checkout_post_purchase":return{url:e.checkoutCartUrl};case"product_subscription":return{url:e.subscriptionProductUrl??""};default:return{url:""}}}var at=".js.map";async function te(t,e,r,o){return F({outputPrefix:t.outputPrefix},async()=>{o?.clear();let n=t.getOutputPathForDirectory(e),s=`${r.url}/extensions/${t.devUUID}`,{localization:a,status:i}=await ko(t,r),c=await Mr(t),d=t.outputRelativePath?ue(n):n,l=await Bn(t,s,d,o),u=null;return"metafields"in t.configuration&&Array.isArray(t.configuration.metafields)&&t.configuration.metafields.length>0&&(u=Lo(t.configuration.metafields)),{assets:{main:ce(l)&&l[0]?.assets?.main?l[0].assets.main:{name:"main",url:`${s}/assets/${t.outputFileName}`,lastUpdated:await he(n)??0}},supportedFeatures:{runsOffline:t.configuration.supported_features?.runs_offline??!1},capabilities:{blockProgress:t.configuration.capabilities?.block_progress??!1,networkAccess:t.configuration.capabilities?.network_access??!1,apiAccess:t.configuration.capabilities?.api_access??!1,collectBuyerConsent:{smsMarketing:t.configuration.capabilities?.collect_buyer_consent?.sms_marketing??!1,customerPrivacy:t.configuration.capabilities?.collect_buyer_consent?.customer_privacy??!1},iframe:{sources:t.configuration.capabilities?.iframe?.sources??[]}},development:{...r.currentDevelopmentPayload,resource:$e(t.type,r),root:{url:s},hidden:r.currentDevelopmentPayload?.hidden??!1,localizationStatus:i,status:r.currentDevelopmentPayload?.status??"success",...r.currentDevelopmentPayload??{status:"success"}},extensionPoints:l,localization:a??null,metafields:u,type:t.type,externalType:t.externalType,uuid:t.devUUID,surface:t.surface,version:c?.version,title:t.name,handle:t.handle,name:t.name,description:t.configuration.description,apiVersion:t.configuration.api_version,approvalScopes:r.grantedScopes,settings:t.configuration.settings}})}async function Bn(t,e,r,o){let n=t.configuration,s=n.extension_points??n.targeting;if(t.type==="checkout_post_purchase"&&(s=[{target:"purchase.post.render"}]),ce(s)){let a=await Kn(r);return Promise.all(s.map(async i=>{let{target:c,resource:d}=i,l="metafields"in i?Lo(i.metafields??[]):void 0,u={...i,...l?{metafields:l}:{},surface:ke(c),root:{url:`${e}/${c}`},resource:d||{url:""}},h=a?.[c];if(!h)return u;let m=await Jn(h,{target:c,extensionPoint:i,url:e,extension:t,buildDirectory:r,resolver:o});return{...u,...m}}))}return s}async function Kn(t){try{let e=S(t,"manifest.json"),r=await L(e);return JSON.parse(r)}catch(e){if(e instanceof SyntaxError)throw new Error(`Invalid manifest.json in ${t}: ${e.message}`);return null}}async function jn({target:t,extensionPoint:e,url:r,extension:o,resolver:n},s,a){let i=`${t}/${s}`,c=e[s];if(typeof c=="string"){let y=await Me(s,i,typeof a=="string"?a:c,r,o,n,typeof a=="string"?c:void 0);return{assets:{[y.name]:y}}}let l=e.build_manifest?.assets?.[s];if(l?.filepath){let u=await Me(s,i,l.filepath,r,o,n,l.module);return{assets:{[u.name]:u}}}return{}}async function Vn({target:t,url:e,buildDirectory:r,resolver:o},n,s){if(s.length===0)return{};for(let i of s)o?.set(`${t}/${i}`,i);let a=await Promise.all(s.map(async i=>await he(S(r,i))??0));return{assets:{[n]:{name:n,url:`${e}/assets/${t}/`,lastUpdated:Math.max(...a)}}}}async function zn({target:t,extensionPoint:e,url:r,extension:o,resolver:n},s){return e.intents?{intents:await Promise.all(e.intents.map(async(i,c)=>{let d=i.schema,l=s[c]?.schema,u=typeof l=="string"?l:d,h=typeof l=="string"?d:void 0;return{...i,schema:await Me("schema",`${t}/intents/${c}/schema`,u,r,o,n,h)}}))}:{}}async function Yn({target:t,url:e,extension:r,resolver:o},n,s){let a=await Me(n,`${t}/${n}`,s,e,r,o);return await Qn(t,s,r,o),{assets:{[a.name]:a}}}async function Qn(t,e,r,o){if(!o)return;let n=`${e}.map`;n.endsWith(at)&&await D(S(r.directory,n))&&o.set(`${t}/${gt(n)}`,n)}async function Jn(t,e){return(await Promise.all(Object.keys(t).map(async o=>{let n=t[o];return Xn(o,n)?zn(e,n):Zn(o,n)?Yn(e,o,n):es(o,n)?Vn(e,o,n):jn(e,o,n)}))).reduce((o,n)=>({...o,...n,assets:{...o.assets,...n.assets}}),{})}function Lo(t){return t.map(e=>({namespace:e.namespace,key:e.key,...e.owner_type===void 0?{}:{ownerType:e.owner_type.replaceAll("_","")}}))}function ce(t){return Array.isArray(t)&&t.every(e=>typeof e=="object")}async function Me(t,e,r,o,n,s,a){let i=`${e}${de(r)}`;return s?.set(i,r),{name:t,url:`${o}/assets/${i}`,lastUpdated:await he(S(n.directory,a??r))??0}}function Xn(t,e){return t==="intents"&&Array.isArray(e)}function Zn(t,e){return(t==="main"||t==="should_render")&&typeof e=="string"}function es(t,e){return t==="assets"&&Array.isArray(e)&&e.every(r=>typeof r=="string")}import{EventEmitter as ts}from"events";var le;(function(t){t.Update="PayloadUpdatedEvent:UPDATE"})(le||(le={}));async function $o(t,e,r){return{app:{title:t.appName,apiKey:t.apiKey,url:ao(t.storeFqdn,t.apiKey),mobileUrl:co(t.storeFqdn,t.apiKey)},appId:t.id,version:t.manifestVersion,root:{url:new URL("/extensions",t.url).toString()},socket:{url:t.websocketURL},devConsole:{url:new URL("/extensions/dev-console",t.url).toString()},store:t.storeFqdn,extensions:await Promise.all(t.extensions.filter(n=>n.isPreviewable).map(n=>te(n,e,t,r&&it(r,n.devUUID))))}}function it(t,e){let r=t.get(e);return r||(r=new Map,t.set(e,r)),r}var Fe=class extends ts{options;rawPayload;assetResolvers;constructor(e,r,o=new Map){super(),this.rawPayload=e,this.options=r,this.assetResolvers=o}getAssetResolver(e){return this.assetResolvers.get(e)}getConnectedPayload(){let e=this.getRawPayload();return{app:e.app,appId:e.appId,store:e.store,extensions:e.extensions}}getRawPayloadFilteredByExtensionIds(e){return{...this.rawPayload,extensions:this.rawPayload.extensions.filter(r=>e.includes(r.uuid))}}getRawPayload(){return this.rawPayload}updateApp(e){this.rawPayload=J(this.rawPayload,{app:e}),this.emitUpdate([])}updateExtensions(e){let r=this.rawPayload.extensions.map(o=>{let n=e.find(s=>s.uuid===o.uuid);if(n){if(ce(n.extensionPoints)&&ce(o.extensionPoints)){let s=n.extensionPoints.reduce((c,d)=>({...c,[d.target]:d}),{});o.extensionPoints=J(o.extensionPoints,n.extensionPoints,c=>c.map(d=>{let l=s[d.target];return l?J(d,l,(u,h)=>h):d}));let{extensionPoints:a,...i}=n;return J(o,i)}return J(o,n)}return o});this.rawPayload={...this.rawPayload,extensions:r},this.emitUpdate(e.map(o=>o.uuid))}async updateExtension(e,r,o,n){let s=this.rawPayload.extensions,a=s.findIndex(i=>i.uuid===e.devUUID);if(a===-1){g(b`Could not updateExtension() for extension with uuid: ${e.devUUID}`,r.stderr);return}s[a]=await te(e,o,{...this.options,currentDevelopmentPayload:n??{status:s[a]?.development.status},currentLocalizationPayload:s[a]?.localization},it(this.assetResolvers,e.devUUID)),this.rawPayload.extensions=s,this.emitUpdate([e.devUUID])}deleteExtension(e){let r=this.rawPayload.extensions.findIndex(o=>o.uuid===e.devUUID);r!==-1&&(this.rawPayload.extensions.splice(r,1),this.assetResolvers.delete(e.devUUID),this.emitUpdate([e.devUUID]))}async addExtension(e,r){this.rawPayload.extensions.push(await te(e,r,this.options,it(this.assetResolvers,e.devUUID))),this.emitUpdate([e.devUUID])}emitUpdate(e){this.emit(le.Update,e)}};p();p();var j;(function(t){t.Update="update",t.Dispatch="dispatch",t.Log="log"})(j||(j={}));function Mo(t,e){return(r,o,n)=>{r.url==="/extensions"&&(g("Upgrading HTTP request to a websocket connection",e.stdout),t.handleUpgrade(r,o,n,rs(t,e)))}}function rs(t,e){return r=>{g("Websocket connection successfully established",e.stdout);let o={event:"connected",data:e.payloadStore.getConnectedPayload(),version:e.manifestVersion};g(b`Sending connected payload: ${P.json(o)}`,e.stdout),r.send(JSON.stringify(o)),r.on("message",is(t,e))}}function os(t){try{let e=JSON.parse(t);if(!Array.isArray(e))return t;let r=e.map(o=>typeof o=="object"&&o!==null?P.json(o).output():String(o)).join(" ");return b`${r}`.value}catch(e){if(e instanceof SyntaxError)return t;throw e}}var ns={debug:t=>P.gray(t),warn:t=>P.yellow(t),error:t=>P.errorText(t)};function ss({type:t,message:e}){let r=os(e);switch(t){case"debug":case"warn":case"error":return b`${ns[t](t.toUpperCase())}: ${r}`.value;case"log":case"info":return r;default:return`${t.toUpperCase()}: ${r}`}}function as(t,e){F({outputPrefix:t.extensionName,stripAnsi:!1},()=>{e.stdout.write(ss(t))})}function is(t,e){return r=>{let o=JSON.parse(r.toString()),{event:n,data:s}=o;if(g(b`Received websocket message with event type ${n} and data:
2
+ ${P.json(s)}
3
+ `,e.stdout),n===j.Update){let a=e.payloadStore.getRawPayload().app.apiKey,i=s.app?.apiKey;if(s.app){if(a!==i)return;e.payloadStore.updateApp(s.app)}s.extensions&&e.payloadStore.updateExtensions(s.extensions)}else if(n===j.Dispatch){let a=cs(o,e);Do(t,a,e)}else n===j.Log&&as(s,e)}}function Fo(t,e){return r=>{let o={event:j.Update,version:e.manifestVersion,data:{...e.payloadStore.getRawPayloadFilteredByExtensionIds(r)}};g(b`Sending websocket update event to the websocket clients:
4
+ ${P.json(o)}
5
+ `,e.stdout),Do(t,o,e)}}function Do(t,e,r){g(b`Sending websocket with event type ${e.event} and data:
6
+ ${P.json(e.data)}
7
+ `,r.stdout);let o=JSON.stringify(e);t.clients.forEach(n=>n.send(o))}function cs(t,e){let r=e.payloadStore.getRawPayload();return{...t,version:e.manifestVersion,data:{...t.data,extensions:[],store:r.store,app:r.app}}}var ls=10;function Oo(t){let e=new Mt.default({noServer:!0,clientTracking:!0}),r=ps(e);return t.httpServer.on("upgrade",Mo(e,t)),t.payloadStore.on(le.Update,Fo(e,t)),{close:()=>{e.close(),clearInterval(r)}}}function ps(t){return setInterval(()=>{t.clients.forEach(e=>{e.readyState<2&&e.ping()})},ls*1e3)}p();p();p();function No(t,e){let{url:r}=$e(t.type,e);if(t.surface==="checkout"&&r){let o=new URL(`https://${e.storeFqdn}/`);return o.pathname=r,o.searchParams.append("dev",`${e.url}/extensions`),o.toString()}else{let o=new URL(`https://${e.storeFqdn}/`);return o.pathname="admin/extensions-dev",o.searchParams.append("url",De(t,e)),o.toString()}}function qo(t,e,r){let o=ke(t),n=new URL(`https://${r.storeFqdn}/`);switch(o){case"checkout":n.pathname=r.checkoutCartUrl,n.searchParams.append("dev",`${r.url}/extensions`);break;case"post_purchase":if(n.pathname=r.checkoutCartUrl,n.searchParams.set("script_url",`${r.url}/extensions/${e.devUUID}/assets/${e.localIdentifier}.js`),n.searchParams.set("post_purchase_dev_api_key",r.apiKey),e.devUUID&&r.websocketURL&&(n.searchParams.set("uuid",e.devUUID),n.searchParams.set("socket_url",r.websocketURL)),"metafields"in e.configuration){let s={config:{metafields:e.configuration.metafields}};n.searchParams.set("config",JSON.stringify(s))}break;case"admin":n.pathname="admin/extensions-dev",n.searchParams.append("url",De(e,r)),n.searchParams.append("target",t);break;case"customer-accounts":n=us(e,r,t);break;default:return}return n.toString()}function us(t,e,r=""){let o=`${e.url}/extensions`,n=e.storeId,s="shopify.com",a=new URL(`https://${s}/${n}/account/extensions-development`);return a.searchParams.append("origin",o),a.searchParams.append("extensionId",t.devUUID),a.searchParams.append("source","CUSTOMER_ACCOUNT_EXTENSION"),a.searchParams.append("appId",e.id??""),r!==""&&a.searchParams.append("target",r),a}function De(t,e){let r=new URL(e.url);return r.pathname=`/extensions/${t.devUUID}`,r.toString()}function O(t,e){Zt(t,Xt(e))}p();var ct=class extends X{constructor(e){super(`Couldn't find template ${e.template} for extension surface ${e.extensionSurface}`)}};async function Wo(t){let e=await ds(t),r=await L(e);return Jt(r,t.data)}async function ds(t){let e=await ms(),r=[];t.extensionSurface&&r.push(S(e,`${t.extensionSurface}/${t.template}.html.liquid`)),r.push(S(e,`${t.template}.html.liquid`));let o=await ge(r);if(o.length===0)throw new ct(t);return o[0]}async function ms(){return await Pt("templates/ui-extensions/html",{type:"directory",cwd:yt(import.meta.url)})}var Ho=q(t=>{H(t,"Access-Control-Allow-Origin","*"),H(t,"Access-Control-Allow-Methods","GET, OPTIONS"),H(t,"Access-Control-Allow-Headers","Accept, Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, Authorization, ngrok-skip-browser-warning")}),Go=q(t=>{H(t,"Cache-Control","no-cache")}),lt=q(async t=>Te(t,"/extensions",307));async function fs(t,e){let{filePath:r}=e;if(!await D(r))return O(t,{statusCode:404,statusMessage:`Not Found: ${r}`});if(await vt(r)&&(r+=r.endsWith("/")?"index.html":"/index.html",!await D(r)))return O(t,{statusCode:404,statusMessage:`Not Found: ${r}`});let o=await L(r,{}),n={".ico":"image/x-icon",".html":"text/html",".js":"text/javascript",".json":"application/json",".map":"application/json",".wasm":"application/wasm",".css":"text/css",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".wav":"audio/wav",".mp3":"audio/mpeg",".svg":"image/svg+xml",".pdf":"application/pdf",".doc":"application/msword"},s=de(r),a=n[s]||"text/plain";return H(t,"Content-Type",a),o}function Bo({getExtensions:t,payloadStore:e}){return q(async r=>{let{extensionId:o,assetPath:n=""}=Ae(r),s=t().find(h=>h.devUUID===o);if(!s)return O(r,{statusCode:404,statusMessage:`Extension with id ${o} not found`});let i=e.getAssetResolver(s.devUUID)?.get(n),c=i??n,d=c.endsWith(at);if(d&&i===void 0)return O(r,{statusCode:404,statusMessage:"Not Found"});let l=Ge(d?s.directory:Dr(s.outputPath)),u=Ge(S(l,c));return wt(l,u)?fs(r,{filePath:u}):O(r,{statusCode:404,statusMessage:"Not Found"})})}function pt({payloadStore:t}){return q(e=>(H(e,"content-type","application/json"),t.getRawPayload()))}function Ko({devOptions:t}){return q(e=>{g(`UI extensions server received a ${e.method} request to URL ${e.path}`,t.stdout)})}function ut({devOptions:t,getExtensions:e}){return q(async r=>{let{extensionId:o}=Ae(r),n=e().find(i=>i.devUUID===o);if(!n)return O(r,{statusCode:404,statusMessage:`Extension with id ${o} not found`});if(er(r,"accept")?.startsWith("text/html")){if(n.type==="checkout_post_purchase")return Wo({data:{url:De(n,t)},template:"index",extensionSurface:"post_purchase"});{let i=No(n,t);return Te(r,i,307)}}let a=t.appWatcher.buildOutputPath;return H(r,"content-type","application/json"),{app:{apiKey:t.apiKey},version:t.manifestVersion,root:{url:new URL("/extensions",t.url).toString()},socket:{url:re(t.url)},devConsole:{url:new URL("/extensions/dev-console",t.url).toString()},store:t.storeFqdn,extension:await te(n,a,t)}})}function jo({devOptions:t,getExtensions:e}){return q(async r=>{let{extensionId:o,extensionPointTarget:n=""}=Ae(r),s=e().find(i=>i.devUUID===o);if(!s)return O(r,{statusCode:404,statusMessage:`Extension with id ${o} not found`});if(s.configuration.type!=="checkout_post_purchase"&&!s.hasExtensionPointTarget(n))return O(r,{statusCode:404,statusMessage:`Extension with id ${o} has not configured the "${n}" extension target`});let a=qo(n,s,t);return a?Te(r,a,307):O(r,{statusCode:404,statusMessage:`Redirect url can't be constructed for extension with id ${o} and extension target "${n}"`})})}import{createServer as hs}from"http";function Vo(t){let e=tr(),r=rr();e.use(Ko(t)),e.use(Ho),e.use(Go),r.use("/extensions/dev-console",lt),r.use("/extensions/:extensionId",ut(t)),r.use("/extensions/:extensionId/",ut(t)),r.use("/extensions/:extensionId/:extensionPointTarget",jo(t)),r.use("/extensions/:extensionId/assets/**:assetPath",Bo(t)),r.use("/extensions",pt(t)),r.use("/extensions/",pt(t)),r.use("/",lt),e.use(r);let o=hs(or(e));return o.listen(t.devOptions.port,"localhost"),o}async function zo(t){let e={...t,websocketURL:re(t.url)},r=e.appWatcher.buildOutputPath,o=new Map,n=await $o(e,r,o),s=new Fe(n,e,o),a=e.extensions.filter(u=>u.isPreviewable),i=()=>a;g("Setting up the UI extensions HTTP server...",e.stdout);let c=Vo({devOptions:e,payloadStore:s,getExtensions:i});g("Setting up the UI extensions Websocket server...",e.stdout);let d=Oo({...e,httpServer:c,payloadStore:s});g("Setting up the UI extensions bundler and file watching...",e.stdout);let l=async({appWasReloaded:u,app:h,extensionEvents:y})=>{u&&(a=h.allExtensions.filter(m=>m.isPreviewable));for(let m of y){if(!m.extension.isPreviewable)continue;let f=m.buildResult?.status==="ok"?"success":"error",U=m.buildResult?.status==="error"?{message:m.buildResult.error,file:m.buildResult.file}:void 0;switch(m.type){case ee.Created:if(e.extensions.push(m.extension),!e.checkoutCartUrl){let E=await Ie(e.extensions,e.storeFqdn);e.checkoutCartUrl=E}await s.addExtension(m.extension,r);break;case ee.Updated:await s.updateExtension(m.extension,e,r,{status:f,error:U});break;case ee.Deleted:e.extensions=e.extensions.filter(E=>E.devUUID!==m.extension.devUUID),await s.deleteExtension(m.extension);break}}};e.appWatcher.onEvent(l).onStart(l),e.signal.addEventListener("abort",()=>{g("Closing the UI extensions dev server..."),d.close(),c.close()})}function re(t){let e=new URL("/extensions",t);return e.protocol="wss:",e.toString()}var gs="3",ws=async({stderr:t,stdout:e,abortSignal:r},{apiKey:o,storeFqdn:n,storeId:s,subscriptionProductUrl:a,port:i,cartUrl:c,proxyUrl:d,appName:l,appDotEnvFile:u,appId:h,grantedScopes:y,allExtensions:m,appDirectory:f,appWatcher:U})=>{await zo({appName:l,appDotEnvFile:u,appDirectory:f,id:h,extensions:m,stdout:e,stderr:t,signal:r,url:d,port:i,storeFqdn:ye(n),storeId:s,apiKey:o,grantedScopes:y,checkoutCartUrl:c,subscriptionProductUrl:a,manifestVersion:gs,appWatcher:U})};async function Yo({allExtensions:t,storeFqdn:e,checkoutCartUrl:r,...o}){let n=t.filter(a=>a.isPreviewable),s=await Ie(n,e,r);return{prefix:"extensions",type:"previewable-extension",function:ws,options:{pathPrefix:"/extensions",port:-1,storeFqdn:e,allExtensions:t,cartUrl:s,...o}}}p();p();function V(t){let e=t.find(o=>Z(o,W.Frontend)),r=t.find(o=>Z(o,W.Backend));return{frontendConfig:e,backendConfig:r}}p();async function Qo(t){let r={topic:"app/uninstalled",api_version:(await lo(t.developerPlatformClient,t.organizationId))[1],address:t.address,delivery_method:mo.LOCALHOST,shared_secret:t.sharedSecret},o=await po(t.developerPlatformClient,r,t.organizationId);t.stdout.write("Sending APP_UNINSTALLED webhook to app server"),await ae(3);let n=await ys(t,o);return t.stdout.write(n?"APP_UNINSTALLED webhook delivered":"APP_UNINSTALLED webhook delivery failed"),n}async function ys(t,e){let r=0;for(;r<3;){try{return await uo(t.address,e.samplePayload,JSON.stringify({...JSON.parse(e.headers),"X-Shopify-Shop-Domain":t.storeFqdn}))}catch(o){if(o instanceof At&&o.code==="ECONNREFUSED")r<3&&(t.stdout.write("App isn't responding yet, retrying in 5 seconds"),await ae(5));else throw o}r++}return t.stdout.write("App hasn't started in time, giving up"),!1}var vs=async({stdout:t},e)=>{await Qo({stdout:t,developerPlatformClient:e.developerPlatformClient,address:`http://localhost:${e.deliveryPort}${e.webhooksPath}`,sharedSecret:e.apiSecret,storeFqdn:e.storeFqdn,organizationId:e.organizationId})};function Jo({webs:t,remoteAppUpdated:e,backendPort:r,frontendPort:o,organizationId:n,...s}){let{backendConfig:a,frontendConfig:i}=V(t),c=t.map(({configuration:l})=>l.webhooks_path).find(l=>l)??"/api/webhooks";if(c&&e&&(i??a))return{type:"send-webhook",prefix:"webhooks",function:vs,options:{deliveryPort:a?r:o,webhooksPath:c,organizationId:n,...s}}}p();async function Xo(t){return{type:"graphiql",prefix:"graphiql",options:t,function:Ps}}var Ps=async({stdout:t,abortSignal:e},r)=>{let o=fo({apiKey:r.apiKey,apiSecret:r.apiSecret,storeFqdn:r.storeFqdn}),n=sr({stdout:t,port:r.port,storeFqdn:r.storeFqdn,key:r.key,tokenProvider:o,appContext:{appName:r.appName,appUrl:r.appUrl,apiSecret:r.apiSecret}});e.addEventListener("abort",()=>{n.close()})};p();async function en({webs:t,proxyUrl:e,frontendPort:r,backendPort:o,apiKey:n,apiSecret:s,scopes:a}){let{frontendConfig:i}=V(t),c=i?.configuration.hmr_server?await M():void 0,d=void 0,l=t.map(async u=>{let h=await xs({web:u,frontendPort:r,backendPort:o}),y=c&&u.configuration.roles.includes(W.Frontend)?{port:c,httpPaths:u.configuration.hmr_server.http_paths}:void 0;return{type:"web",prefix:u.configuration.name??["web",...u.configuration.roles].join("-"),function:Es,options:{port:h,portFromConfig:u.configuration.port,apiKey:n,apiSecret:s,hostname:e,backendPort:o,frontendServerPort:r,directory:u.directory,devCommand:u.configuration.commands.dev,preDevCommand:u.configuration.commands.predev,scopes:a,shopCustomDomain:d,hmrServerOptions:y,roles:u.configuration.roles}}});return Promise.all(l)}async function xs({web:t,frontendPort:e,backendPort:r}){return Z(t,W.Frontend)?e:Z(t,W.Backend)?r:M()}async function Es({stdout:t,stderr:e,abortSignal:r},{port:o,apiKey:n,apiSecret:s,hostname:a,backendPort:i,frontendServerPort:c,directory:d,devCommand:l,preDevCommand:u,scopes:h,shopCustomDomain:y,hmrServerOptions:m}){let f=m?.port,U={SHOPIFY_API_KEY:n,SHOPIFY_API_SECRET:s,HOST:a,SCOPES:h,NODE_ENV:"development",...y&&{SHOP_CUSTOM_DOMAIN:y},BACKEND_PORT:`${i}`,FRONTEND_PORT:`${c}`,...f&&{HMR_SERVER_PORT:`${f}`},APP_URL:a,APP_ENV:"development",REMIX_DEV_ORIGIN:a},E={signal:r,directory:d,port:o,env:U,stdout:t,stderr:e};u&&(t.write(`Running pre-dev command: "${u}"`),await Zo({...E,command:u,showOutput:Vt()})),await Zo({...E,command:l,showOutput:!0})}async function Zo({command:t,signal:e,directory:r,port:o,env:n,showOutput:s,stdout:a,stderr:i}){let c=t.split("&&").map(d=>d.trim())??[];for(let d of c){let[l,...u]=d.split(" ");l?.length!==0&&await Ue(l,u,{cwd:r,stdout:s?a:void 0,stderr:i,signal:e,env:{...n,PORT:`${o}`,SERVER_PORT:`${o}`}})}}p();p();p();var Oe=class{stdout;constructor(e){this.stdout=e}async info(e){await this.log(e)}async warning(e){await this.log(b`${P.yellow(e)}`.value)}async success(e){await this.log(b`${P.green(e)}`.value)}async debug(e){g(e,this.stdout)}async error(e,r){let o=P.errorText("\u274C Error"),n=P.errorText(`\u2514 ${e}`);await this.log(b`${o}`.value,r),await this.log(b`${n}`.value,r)}async logUserErrors(e,r){if(typeof e=="string")await this.error(e);else if(e instanceof Error)await this.error(e.message);else{let o=e.map(n=>{let s=n.on?n.on[0]:void 0,a=r.find(i=>i.uid===s?.user_identifier);return{error:n.message,prefix:a?.handle??"app-preview"}});await this.logMultipleErrors(o)}}async logExtensionEvents(e){let r=e.extensionEvents.filter(n=>n.extension.isAppConfigExtension),o=e.extensionEvents.filter(n=>!n.extension.isAppConfigExtension);r.length&&await this.log("App config updated","app-config"),o.forEach(async n=>{let s=n.extension.handle,a=`Extension ${n.type}`;await this.log(a,s)})}async logExtensionUpdateMessages(e,r){if(!e||r.status==="remote-error"||r.status==="unknown-error")return;let o={status:r.status},n=e.extensionEvents??[],a=(await Promise.all(n.map(async c=>c.type===ee.Deleted?[]:(await c.extension.getDevSessionUpdateMessages(o))?.map(l=>({message:l,prefix:c.extension.handle}))??[]))).flat(),i=a.map((c,d)=>{let l=b`${P.gray(d===a.length-1?"\u2514 ":"\u2502 ")}${c.message}`.value;return this.log(l,c.prefix)});await Promise.all(i)}async logMultipleErrors(e){let r=P.errorText("\u274C Error");await this.log(b`${r}`.value,"app-preview");let o=e.map(n=>{let s=P.errorText(`\u2514 ${n.error}`);return this.log(b`${s}`.value,n.prefix)});await Promise.all(o)}async log(e,r){await F({outputPrefix:r??"app-preview",stripAnsi:!1},()=>{this.stdout.write(e)})}};p();var Ne=class{processBatch;queue=[];processingPromise=void 0;constructor(e){this.processBatch=e}enqueue(e){this.queue.push(e),this.processingPromise??=this.startProcessing()}async waitForCompletion(){if(this.processingPromise)return this.processingPromise}async startProcessing(){try{for(;this.queue.length>0;){let e=[...this.queue];this.queue=[],await this.processBatch(e)}}finally{this.processingPromise=void 0}}};var qe=class t{static async start(e,r){let o=new t(e,r);return await o.start(),o}statusManager;logger;options;appWatcher;bundlePath;appEventsProcessor;failedEvents=[];currentSessionState=null;constructor(e,r){this.statusManager=e.devSessionStatusManager,this.logger=new Oe(r),this.options=e,this.appWatcher=e.appWatcher,this.bundlePath=e.appWatcher.buildOutputPath,this.appEventsProcessor=new Ne(o=>this.processEvents(o))}async start(){await this.logger.info(`Preparing dev preview on ${this.options.storeFqdn}`),this.statusManager.setMessage("LOADING"),this.appWatcher.onEvent(async e=>this.onEvent(e)).onStart(async e=>this.onStart(e)).onError(async e=>this.handleDevSessionResult({status:"unknown-error",error:e}))}async onEvent(e){await this.validateAppEvent(e)&&this.appEventsProcessor.enqueue(e)}async processEvents(e){let r=[...this.failedEvents,...e],o=this.consolidateAppEvents(r);if(this.failedEvents=[],!o)return;this.statusManager.setMessage("CHANGE_DETECTED"),this.updatePreviewURL(o),await this.logger.logExtensionEvents(o);let n=Zr(),s=await this.bundleExtensionsAndUpload(o);await this.handleDevSessionResult(s,o),await this.logger.debug(`\u2705 Event handled [Network: ${tt(n)}ms - Total: ${tt(o.startTime)}ms]`)}consolidateAppEvents(e){if(e.length===0)return;if(e.length===1)return e[0];let r=e[0],o=e[e.length-1];if(!r||!o)return;let n=new Map;for(let a of e)for(let i of a.extensionEvents)n.set(i.extension.uid,i);return{app:o.app,path:o.path,extensionEvents:Array.from(n.values()),startTime:r.startTime,appWasReloaded:e.some(a=>a.appWasReloaded)}}async onStart(e){let r=this.parseBuildErrors(e);if(r.length)await this.logger.logMultipleErrors(r),await setImmediate(()=>{let o=r.map(n=>n.prefix);throw new A(`Dev preview aborted, build errors detected in extensions: ${o}`)});else{let o=await this.bundleExtensionsAndUpload(e);await this.handleDevSessionResult(o,e)}}async validateAppEvent(e){if(!this.statusManager.status.isReady)return await this.logger.warning("Change detected, but dev preview is not ready yet."),!1;let r=this.parseBuildErrors(e);return r.length?(await this.logger.logMultipleErrors(r),this.statusManager.setMessage("BUILD_ERROR"),!1):e.extensionEvents.length===0?(this.statusManager.setMessage("READY"),!1):!0}parseBuildErrors(e){return e.extensionEvents.filter(o=>o.buildResult?.status==="error").map(o=>({error:"Build error. Please review your code and try again.",prefix:o.extension.handle}))}async handleDevSessionResult(e,r){e.status==="updated"?(await this.logger.success(`\u2705 Updated dev preview on ${this.options.storeFqdn}`),await this.logger.logExtensionUpdateMessages(r,e),await this.setUpdatedStatusMessage()):e.status==="created"?(this.statusManager.updateStatus({isReady:!0}),await this.logger.success("\u2705 Ready, watching for changes in your app "),await this.logger.logExtensionUpdateMessages(r,e),this.statusManager.setMessage("READY")):(e.status==="remote-error"||e.status==="unknown-error")&&(await this.logger.logUserErrors(e.error,r?.app.allExtensions??[]),e.error instanceof Error&&e.error.cause==="validation-error"?this.statusManager.setMessage("VALIDATION_ERROR"):(r&&this.failedEvents.push(r),this.statusManager.setMessage("REMOTE_ERROR"))),!this.statusManager.status.isReady&&!zt()&&setImmediate(()=>{throw new A("Failed to start dev preview.")})}updatePreviewURL(e){let r=e.app.nonConfigExtensions.length>0;this.statusManager.updateStatus({previewURL:this.options.appPreviewURL,appEmbedded:e.app.configuration.embedded,hasExtensions:r})}async setUpdatedStatusMessage(){this.statusManager.setMessage("UPDATED"),setTimeout(async()=>{this.statusManager.status.statusMessage?.message==="Updated"&&this.statusManager.setMessage("READY")},2e3)}async bundleExtensionsAndUpload(e){try{let{manifest:r,inheritedModuleUids:o,assets:n}=await this.createManifest(e),s=await this.uploadAssetsIfNeeded(n,!this.statusManager.status.isReady),a=re(this.options.url);if(this.statusManager.status.isReady){let i={shopFqdn:this.options.storeFqdn,appId:this.options.appId,assetsUrl:s,manifest:r,inheritedModuleUids:o,unsafeValidation:this.options.unsafeValidation??!1};return this.devSessionUpdateWithRetry(i)}else{let i={shopFqdn:this.options.storeFqdn,appId:this.options.appId,assetsUrl:s,websocketUrl:a,unsafeValidation:this.options.unsafeValidation??!1};return this.devSessionCreateWithRetry(i)}}catch(r){if(r.statusCode===401)throw new Error("Unauthorized");if(r instanceof Rt)throw r.response.status===401||r.response.status===403?new A("Auth session expired. Please run `shopify app dev` again."):(await this.logger.debug(JSON.stringify(r.response,null,2)),new A("Unknown error"));return r.code==="ETIMEDOUT"?{status:"unknown-error",error:new Error("Request timed out, please check your internet connection and try again.")}:{status:"unknown-error",error:r}}}async createManifest(e){let r=e.extensionEvents.filter(i=>i.type!=="deleted").map(i=>i.extension.uid);e.app.allExtensions.some(i=>i.type==="admin")&&!r.includes("admin")&&r.push("admin");let o=e.app.allExtensions.filter(i=>!r.includes(i.uid)).map(i=>i.uid),n=await e.app.manifest(void 0);await to(n,this.bundlePath),this.statusManager.status.isReady&&(n.modules=n.modules.filter(i=>r.includes(i.uid)));let s=await xt(this.bundlePath),a=n.modules.map(i=>i.assets).filter(i=>s.includes(i));return{manifest:n,inheritedModuleUids:o,assets:a}}async uploadAssetsIfNeeded(e,r){if(!e.length&&!r)return;let o=S(ue(this.bundlePath),`dev-bundle.${this.options.developerPlatformClient.bundleFormat}`),n=[...e.map(a=>`${a}/**`),...ro];r&&n.push("manifest.json"),await oo(this.bundlePath,o,n);let s=await this.getSignedURLWithRetry();return await no(s,o),s}async getSignedURLWithRetry(){return so(this.options.developerPlatformClient,{apiKey:this.options.appId,organizationId:this.options.organizationId,id:this.options.appId})}async devSessionUpdateWithRetry(e){let r=await this.options.developerPlatformClient.devSessionUpdate(e),o=r.devSessionUpdate?.userErrors??[],n=r.devSessionUpdate?.warnings??[],s=r.devSessionUpdate?.devSession;if(s&&this.currentSessionState){let a=re(this.options.url),i=this.currentSessionState?.userId;if(s.websocketUrl!==a||s.user?.id!==i){let c=s.user?.email;await this.logger.error(`Another developer ${c?`(${c}) `:""}has taken ownership of this dev preview.`);let d=`Another user${c?` (${c})`:""} has taken ownership of this dev preview. Your preview is no longer active.`,l=["You can restart by running",{command:"shopify app dev"},"again."];throw new A(d,l)}this.currentSessionState={websocketUrl:s.websocketUrl,userId:s.user?.id??null,userEmail:s.user?.email??null}}return n.length>0&&await this.logWarnings(n),o.length?{status:"remote-error",error:o}:{status:"updated"}}async devSessionCreateWithRetry(e){let r=await this.options.developerPlatformClient.devSessionCreate(e),o=r.devSessionCreate?.userErrors??[],n=r.devSessionCreate?.warnings??[],s=r.devSessionCreate?.devSession;return s&&(this.currentSessionState={websocketUrl:s.websocketUrl,userId:s.user?.id??null,userEmail:s.user?.email??null}),n.length>0&&await this.logWarnings(n),o.length?{status:"remote-error",error:o}:{status:"created"}}async logWarnings(e){await Promise.all(e.map(r=>{let o=r.code==="SESSION_TAKEOVER"?`\u26A0\uFE0F ${r.message}`:r.message;return this.logger.warning(o)}))}};async function tn({app:t,apiKey:e,developerPlatformClient:r,...o}){return{type:"dev-session",prefix:"app-preview",function:bs,options:{app:t,apiKey:e,developerPlatformClient:r,...o}}}var bs=async({stdout:t},e)=>{await qe.start(e,t)};p();p();p();var rn=async({appLog:t,appLogPayload:e,stdout:r,storeName:o,logsDir:n})=>{let s=Et().substring(0,6),i=`${Ss(t.log_timestamp)}_${t.source_namespace}_${t.source}_${s}.json`,c=To({appLog:t,appLogPayload:e,prettyPrint:!0,storeName:o}),d=S(n,i);try{return await fe(n),await me(d,c),{fullOutputPath:d,identifier:s}}catch(l){throw r.write(`Error while writing log to file: ${l}
8
+ `),l}};function Ss(t){let e=new Date(t),r=e.getUTCFullYear(),o=(e.getUTCMonth()+1).toString().padStart(2,"0"),n=e.getUTCDate().toString().padStart(2,"0"),s=e.getUTCHours().toString().padStart(2,"0"),a=e.getUTCMinutes().toString().padStart(2,"0"),i=e.getUTCSeconds().toString().padStart(2,"0"),c=e.getUTCMilliseconds().toString().padStart(3,"0");return`${r}${o}${n}_${s}${a}${i}_${c}Z`}var We=async({stdout:t,appLogsFetchInput:{jwtToken:e,cursor:r},developerPlatformClient:o,resubscribeCallback:n,storeName:s,organizationId:a,abortSignal:i,logsDir:c,consecutiveResubscribeFailures:d=0})=>{if(!i?.aborted)try{let l=e,u=wo,h=d,y=await o.appLogs({jwtToken:e,cursor:r},a),{errors:m,status:f}=y;if(f===200){h=0;let{app_logs:E}=y;for(let R of E){let x=JSON.parse(R.payload);await F({outputPrefix:R.source,stripAnsi:!1},async()=>{R.log_type===Po?(Us(R,x,t),x=new ho(go(x))):R.log_type.startsWith(xo)?Rs(R,x,t):t.write(JSON.stringify(x));let _=await rn({appLog:R,appLogPayload:x,stdout:t,storeName:s,logsDir:c});t.write(b`${P.gray("\u2514 ")}${P.link("Open log file",`file://${_.fullOutputPath}`,`Log: ${_.fullOutputPath}`)} ${P.gray(`(${_.identifier})`)}\n`.value)})}}else{let E={errors:m.map(x=>({message:x,status:f}))},R=await Ao({response:E,onThrottle:x=>{C("Request throttled while polling app logs.",t),C(`Retrying in ${x/1e3} seconds.`,t)},onUnknownError:x=>{C("Error while polling app logs.",t),C(`Retrying in ${x/1e3} seconds.`,t)},onResubscribe:()=>n()});if(R.resubscribeResult==="failed"){if(h+=1,h>=yo){C("App log streaming session has expired. Please restart your dev session.",t);return}}else R.resubscribeResult==="succeeded"&&(h=0);R.nextJwtToken&&(l=R.nextJwtToken),u=R.retryIntervalMs}let{cursor:U}=y;setTimeout(()=>{We({stdout:t,appLogsFetchInput:{jwtToken:l,cursor:U??r},developerPlatformClient:o,resubscribeCallback:n,storeName:s,organizationId:a,abortSignal:i,logsDir:c,consecutiveResubscribeFailures:h}).catch(E=>{g(`Unexpected error during polling: ${E}}
9
+ `)})},u)}catch(l){C("Error while polling app logs.",t),C(`Retrying in ${ot/1e3} seconds.`,t),g(`${l}}
10
+ `),setTimeout(()=>{We({stdout:t,appLogsFetchInput:{jwtToken:e,cursor:void 0},developerPlatformClient:o,resubscribeCallback:n,storeName:s,organizationId:a,abortSignal:i,logsDir:c}).catch(u=>{g(`Unexpected error during polling: ${u}}
11
+ `)})},ot)}};function Us(t,e,r){let o=(e.fuel_consumed/vo).toFixed(4);t.status==="success"?r.write(`Function export "${e.export}" executed successfully using ${o}M instructions.`):t.status==="failure"&&r.write(`\u274C Function export "${e.export}" failed to execute with error: ${e.error_type}`);let n=e.logs;n.length>0&&r.write(n.split(`
12
+ `).filter(Boolean).map(s=>b`${P.gray("\u2502 ")}${s}`.value).join(`
13
+ `))}function Rs(t,e,r){t.log_type===Eo?r.write("Function network access response retrieved from cache."):t.log_type===bo?e.reason===Uo?r.write("Function network access request executing in background because there is no cached response."):e.reason===Ro&&r.write("Function network access request executing in background because the cached response is about to expire."):t.log_type===So&&(t.status==="success"?r.write("Function network access request executed successfully."):t.status==="failure"&&r.write(`\u274C Function network access request failed to execute with error: ${e.error}.`))}function As(t){return t.allExtensions.some(e=>e.isFunctionExtension)}async function on({developerPlatformClient:t,subscription:{shopIds:e,apiKey:r},storeName:o,organizationId:n,appWatcher:s,localApp:a}){return{type:"app-logs-subscribe",prefix:"app-logs",function:Ts,options:{developerPlatformClient:t,appLogsSubscribeVariables:{shopIds:e,apiKey:r},storeName:o,organizationId:n,appWatcher:s,localApp:a}}}var Ts=async({stdout:t,stderr:e,abortSignal:r},{developerPlatformClient:o,appLogsSubscribeVariables:n,storeName:s,organizationId:a,appWatcher:i,localApp:c})=>{async function d(l){let u=await nt(o,n,a,t),h=c.getLogsDir();await fe(h),await We({stdout:t,appLogsFetchInput:{jwtToken:u},resubscribeCallback:()=>nt(o,n,a),developerPlatformClient:o,storeName:s,organizationId:a,abortSignal:l,logsDir:h})}try{let l=!1,u,h=async y=>{let m=As(y.app);if(m&&!l){g("Function extensions detected, starting logs polling"),l=!0,u=new AbortController;try{await d(u.signal)}catch(f){g(`Failed to start function logs: ${f}`,e)}}else!m&&l&&(g("No function extensions detected, stopping logs polling"),l=!1,u?.abort(),u=void 0)};i.onStart(h).onEvent(h)}catch{}};p();async function nn(t){return{type:"app-watcher",prefix:"app-preview",options:t,function:_s}}var _s=async({stdout:t,stderr:e,abortSignal:r},o)=>{let{appWatcher:n}=o;await n.start({stdout:t,stderr:e,signal:r})};p();import{EventEmitter as Cs}from"events";var Is={BUILD_ERROR:{message:"Build error. Please review your code and try again",type:"error"},READY:{message:"Ready, watching for changes in your app",type:"success"},LOADING:{message:"Preparing dev preview",type:"loading"},UPDATED:{message:"Updated",type:"success"},VALIDATION_ERROR:{message:"Validation error in your app configuration",type:"error"},REMOTE_ERROR:{message:"Error updating dev preview",type:"error"},CHANGE_DETECTED:{message:"Change detected, updating dev preview",type:"loading"}},He=class extends Cs{currentStatus={isReady:!1,previewURL:void 0,graphiqlURL:void 0,statusMessage:void 0};constructor(e){super(),e&&(this.currentStatus=e)}updateStatus(e){let r={...this.currentStatus,...e};kt(this.currentStatus,r)||(this.currentStatus=r,this.emit("dev-session-update",r))}setMessage(e){this.updateStatus({statusMessage:Is[e]})}get status(){return this.currentStatus}reset(){this.currentStatus={isReady:!1,previewURL:void 0,graphiqlURL:void 0,statusMessage:void 0}}};p();import*as sn from"http";import*as an from"https";function cn(t){return"errors"in t&&Array.isArray(t.errors)}async function ln(t,e,r,o){let s=(await import("./http-proxy-node16-D3JUYA5D.js")).default.createProxyServer(),a=Ls(t,s,o),i=r?an.createServer(r,a):sn.createServer(a);return i.on("upgrade",ks(t,s,o)),e.addEventListener("abort",()=>{g("Closing reverse HTTP proxy"),i.close()}),{server:i}}function ks(t,e,r){return function(o,n,s){let a=pn(t,o,!0);if(a)return e.ws(o,n,s,{target:a},i=>{F({outputPrefix:"proxy",stripAnsi:!1},()=>{let d=(cn(i)?i.errors[i.errors.length-1]:void 0)??i;C(`Error forwarding websocket request: ${d.message}`,r),C(`\u2514 Unreachable target "${a}" for path: "${o.url}"`,r)})});n.destroy()}}function Ls(t,e,r){return function(o,n){let s=pn(t,o);if(s)return o.method==="OPTIONS"?(n.writeHead(204,{"Access-Control-Allow-Origin":o.headers.origin??"*","Access-Control-Allow-Methods":o.headers["access-control-request-method"]??"GET, POST, PUT, DELETE, PATCH, OPTIONS","Access-Control-Allow-Headers":o.headers["access-control-request-headers"]??"Content-Type, Authorization","Access-Control-Max-Age":"86400"}),n.end()):e.web(o,n,{target:s},a=>{F({outputPrefix:"proxy",stripAnsi:!1},()=>{let c=(cn(a)?a.errors[a.errors.length-1]:void 0)??a;C(`Error forwarding web request: ${c.message}`,r),C(`\u2514 Unreachable target "${s}" for path: "${o.url}"`,r)})});g(b`
14
+ Reverse HTTP proxy error - Invalid path: ${o.url??""}
15
+ These are the allowed paths:
16
+ ${P.json(JSON.stringify(t))}
17
+ `),n.statusCode=500,n.end(`Invalid path ${o.url}`)}}function pn(t,e,r=!1){let o=e.url??"/";for(let n in t)if(o.startsWith(n))return t[n];return r&&t.websocket?t.websocket:t.default}async function un({localApp:t,remoteAppUpdated:e,developerPlatformClient:r,remoteApp:o,storeFqdn:n,storeId:s,commandOptions:a,network:i,graphiqlPort:c,graphiqlKey:d}){let l=o.apiKey,u=o.apiSecretKeys[0]?.secret??"",h=bt(),y=!ft(h[Ce.disableGraphiQLExplorer]),m=await Kr(t),f=new eo(m,i.proxyUrl),U=await we(),E=io(n,l,U),R=E,x=nr(d,u,n),_=y?`http://localhost:${c}/graphiql?key=${encodeURIComponent(x)}`:void 0,ne=m.configuration.embedded,Y=m.nonConfigExtensions.length>0,N=new He({isReady:!1,previewURL:R,graphiqlURL:_,appEmbedded:ne,hasExtensions:Y}),G=[...await en({webs:m.webs,proxyUrl:i.proxyUrl,frontendPort:i.frontendPort,backendPort:i.backendPort,apiKey:l,apiSecret:u,scopes:$r(m.configuration)}),y?await Xo({appName:o.title,appUrl:E,port:c,apiKey:l,apiSecret:u,key:x,storeFqdn:n}):void 0,await Yo({allExtensions:m.realExtensions,storeFqdn:n,storeId:s,apiKey:l,subscriptionProductUrl:a.subscriptionProductUrl,checkoutCartUrl:a.checkoutCartUrl,proxyUrl:i.proxyUrl,appName:m.name,appDotEnvFile:m.dotenv,grantedScopes:o.grantedScopes,appId:o.id,appDirectory:m.directory,appWatcher:f}),await tn({app:m,apiKey:l,developerPlatformClient:r,url:i.proxyUrl,appId:o.id,organizationId:o.organizationId,storeFqdn:n,appWatcher:f,appPreviewURL:E,devSessionStatusManager:N,unsafeValidation:a.unsafeValidation}),await Io({remoteApp:o,localApp:m,storeFqdn:n,theme:a.theme,themeExtensionPort:a.themeExtensionPort,storePassword:a.storePassword}),Jo({webs:m.webs,backendPort:i.backendPort,frontendPort:i.frontendPort,organizationId:o.organizationId,developerPlatformClient:r,storeFqdn:n,apiSecret:u,remoteAppUpdated:e}),await on({developerPlatformClient:r,subscription:{shopIds:[Number(s)],apiKey:l},storeName:n,organizationId:o.organizationId,localApp:t,appWatcher:f}),await nn({appWatcher:f})].filter($s);return{processes:await Ms(G,i.proxyPort,i.reverseProxyCert),previewUrl:R,graphiqlUrl:_,devSessionStatusManager:N}}var $s=t=>t!==void 0&&t!==!1;async function Ms(t,e,r){let o=await Promise.all(t.map(async a=>{let i={};if(a.type==="web"&&a.options.roles.includes(W.Frontend)){let c=a.options.portFromConfig??a.options.port;i.default=`http://localhost:${c}`;let d=a.options.hmrServerOptions;d&&(i.websocket=`http://localhost:${d.port}`,d.httpPaths.forEach(l=>i[l]=`http://localhost:${d.port}`)),a.options.port=c}else if(a.type==="previewable-extension"){let c=await M();i[a.options.pathPrefix]=`http://localhost:${c}`,a.options.port=c}return{process:a,rules:i}})),n=o.map(({process:a})=>a),s=o.map(({rules:a})=>a).reduce((a,i)=>({...a,...i}),{});return Object.keys(s).length>0&&n.push({type:"proxy-server",prefix:"proxy",function:Fs,options:{port:e,rules:s,localhostCert:r}}),n}var Fs=async({abortSignal:t,stdout:e},{port:r,rules:o,localhostCert:n})=>{let{server:s}=await ln(o,t,n,e);B(`Proxy server started on port ${r} ${n?`with certificate ${n.certPath}`:""}`,e),await s.listen(r,"localhost")};p();p();p();var oe=Q(ve(),1);var dn=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];function mn(){let[t,e]=(0,oe.useState)(0);return(0,oe.useEffect)(()=>{let r=setInterval(()=>{e(o=>(o+1)%dn.length)},70);return()=>clearInterval(r)},[]),oe.default.createElement($,null,dn[t])}p();var T=Q(ve(),1);var fn=.9,hn=({tabs:t,initialActiveTab:e})=>{let{stdout:r}=Ft(),{isRawModeSupported:o}=Pe(),[n,s]=(0,T.useState)(e),[a,i]=(0,T.useState)(Math.floor(r.columns*fn)),[c,d]=(0,T.useState)(!0),l=(0,T.useRef)(null);if(!n)throw new Error("No tabs provided");xe((m,f)=>{(async()=>{if(f?.leftArrow||f?.rightArrow||f?.tab){let x=Object.entries(t).filter(([G,v])=>v.content),_=x.findIndex(([G])=>G===n);if(_===-1)return;let ne=f?.leftArrow?-1:1,Y=(_+ne+x.length)%x.length,N=x[Y];N&&s(N[0])}let E=t[m];if(E){E.action?await E.action():s(m);return}let R=t[n];if(R?.shortcuts){let x=R.shortcuts.find(_=>_.key===m);x&&(!x.condition||x.condition())&&await x.action()}})()},{isActive:!!o}),(0,T.useLayoutEffect)(()=>{let m=()=>{if(i(Math.floor(r.columns*fn)),!l.current)return;let f=Dt(l.current);d(f.width<r.columns)};return r.on("resize",m),()=>{r.off("resize",m)}},[r]);let u=Object.entries(t).map(([m,f])=>({...f,inputKey:m,header:` (${m}) ${f.label} `})),h=u.filter(m=>!m.action),y=u.filter(m=>m.action);return T.default.createElement(T.default.Fragment,null,T.default.createElement(k,{paddingTop:0,width:a,flexDirection:"row",flexGrow:1,borderStyle:"single",borderBottom:!1,borderLeft:!1,borderRight:!1,borderTop:!0},T.default.createElement(k,{ref:l,flexDirection:"row",flexWrap:"nowrap",flexShrink:0,marginRight:3},T.default.createElement($,{wrap:"truncate-end"},"\u2502",h.map(m=>T.default.createElement(T.default.Fragment,{key:m.inputKey},T.default.createElement($,{bold:n===m.inputKey,inverse:n===m.inputKey,wrap:"truncate"},m.header),"\u2502")))),c&&T.default.createElement(k,{flexGrow:1,justifyContent:"flex-end"},y.map((m,f)=>T.default.createElement($,{wrap:"truncate",key:m.inputKey},"(",m.inputKey,") ",m.label,f<y.length-1&&" \u2502 ")))),T.default.createElement(k,{flexDirection:"column",marginLeft:1,marginRight:1,marginTop:1},t[n]?.content))};var w=Q(ve(),1);var gn=({abortController:t,processes:e,devSessionStatusManager:r,shopFqdn:o,appURL:n,appName:s,organizationName:a,configPath:i,localURL:c,onAbort:d})=>{let{isRawModeSupported:l}=Pe(),[u,h]=(0,w.useState)(void 0),[y,m]=(0,w.useState)(void 0),[f,U]=(0,w.useState)(r.status),[E,R]=(0,w.useState)(!1),{isAborted:x}=Gt(t.signal,async v=>{v&&m(typeof v=="string"?v:v.message),r.status.isReady?R(!0):(h("Shutting down dev ..."),await d()),_o()}),_=(0,w.useMemo)(()=>e.map(v=>({...v,action:async(pe,An,Tn)=>{try{return await v.action(pe,An,Tn)}catch(_n){t.abort(_n)}}})),[e,t]);(0,w.useEffect)(()=>(r.on("dev-session-update",U),()=>{r.off("dev-session-update",U)}),[]),xe((v,pe)=>{Nt(v,pe,()=>t.abort())},{isActive:!!l});let ne=v=>{switch(v){case"loading":return w.default.createElement(mn,null);case"success":return"\u2705";case"error":return"\u274C"}},Y=[{key:"p",shortcutLabel:"Open app preview",linkLabel:"Preview",url:f.previewURL,condition:()=>!!(f.isReady&&f.previewURL),action:async()=>{await K.addPublicMetadata(()=>({cmd_dev_preview_url_opened:!0})),f.previewURL&&await Se(f.previewURL)}},{key:"c",shortcutLabel:"Open Dev Console for extension previews",linkLabel:"Dev Console",url:rt(o),condition:()=>!!(f.isReady&&f.appEmbedded===!1&&f.hasExtensions),action:async()=>{await K.addPublicMetadata(()=>({cmd_dev_preview_url_opened:!0})),await Se(rt(o))}},{key:"g",shortcutLabel:"Open GraphiQL (Admin API)",linkLabel:"GraphiQL",url:f.graphiqlURL,condition:()=>!!(f.isReady&&f.graphiqlURL),action:async()=>{await K.addPublicMetadata(()=>({cmd_dev_graphiql_opened:!0})),f.graphiqlURL&&await Se(f.graphiqlURL)}}],N=Y.filter(v=>v.condition?.()??!0),G={d:{label:"Dev status",shortcuts:Y,content:w.default.createElement(w.default.Fragment,null,f.statusMessage&&w.default.createElement($,null,ne(f.statusMessage.type)," ",f.statusMessage.message),l&&N.length>0&&w.default.createElement(k,{marginTop:1,flexDirection:"column"},N.map(v=>w.default.createElement($,{key:v.key},qt.pointerSmall," ",w.default.createElement($,{bold:!0},"(",v.key,")")," ",ze()&&v.url?w.default.createElement(je,{url:v.url,label:v.shortcutLabel}):v.shortcutLabel))),w.default.createElement(k,{marginTop:l?1:0,flexDirection:"column"},u?w.default.createElement($,null,u):w.default.createElement(w.default.Fragment,null,f.isReady&&!(l&&ze())&&w.default.createElement(w.default.Fragment,null,N.filter(v=>v.url).map(v=>w.default.createElement($,{key:v.key},v.linkLabel," URL: ",w.default.createElement(je,{url:v.url})))))))},a:{label:"App info",content:w.default.createElement(k,{flexDirection:"column"},w.default.createElement(Ve,{tabularData:[["App:",s??""],["App URL:",n??""],["Local URL:",n?"":c??""],["Config:",i?.split("/").pop()??""],["Org:",a??""]].filter(([,v])=>v)}))},s:{label:"Store info",content:w.default.createElement(k,{flexDirection:"column"},w.default.createElement(Ve,{tabularData:[["Dev store:",{link:{url:`https://${o}`}}],["Dev store admin:",{link:{url:`https://${o}/admin`}}],["Org:",a??""]].filter(([,v])=>v)}))},q:{label:"Quit",action:async()=>{t.abort()}}};return w.default.createElement(w.default.Fragment,null,w.default.createElement(Wt,{processes:_,prefixColumnSize:Fr,abortSignal:t.signal,keepRunningAfterProcessesResolve:!0,useAlternativeColorPalette:!0}),E&&w.default.createElement(k,{marginTop:1,flexDirection:"column"},w.default.createElement(Ht,{type:"info",headline:`A preview of your development changes is still available on ${o}.`,body:["Run",{command:"shopify app dev clean"},"to restore the latest released version of your app."],link:{label:"Learn more about dev previews",url:"https://shopify.dev/beta/developer-dashboard/shopify-app-dev"}})),x?null:w.default.createElement(k,{paddingTop:1,flexDirection:"column",flexGrow:1},l?w.default.createElement(hn,{tabs:G,initialActiveTab:"d"}):w.default.createElement(k,{marginY:1,paddingTop:0,flexDirection:"column",flexGrow:1,borderStyle:"single",borderBottom:!1,borderLeft:!1,borderRight:!1,borderTop:!0},G.d?.content)),y?w.default.createElement(k,{marginTop:1,flexDirection:"column"},w.default.createElement($,{color:"red"},y)):null)};var wn=Q(ve(),1);async function yn({processes:t,previewUrl:e,app:r,abortController:o,graphiqlUrl:n,shopFqdn:s,devSessionStatusManager:a,appURL:i,appName:c,organizationName:d,configPath:l,localURL:u}){if(Kt())return Ot(wn.default.createElement(gn,{processes:t,abortController:o,devSessionStatusManager:a,shopFqdn:s,appURL:i,appName:c,organizationName:d,configPath:l,localURL:u,onAbort:async()=>{await r.developerPlatformClient.devSessionDelete({appId:r.id,shopFqdn:s})}}),{exitOnCtrlC:!1});await Ds({processes:t,previewUrl:e,graphiqlUrl:n,abortController:o})}async function Ds({processes:t,previewUrl:e,graphiqlUrl:r,abortController:o}){return process.stdout.write(`
18
+ Preview URL: ${e}
19
+ `),r&&process.stdout.write(`GraphiQL URL (Admin API): ${r}
20
+ `),Promise.all(t.map(async n=>{await n.action(process.stdout,process.stderr,o.signal)}))}p();function vn(t){if(!t.length)return;let e=t.filter(n=>n.requested!==n.actual);if(e.length===0)return;if(e.length===1&&e[0]){let n=e[0];se({headline:[`A random port will be used for ${n.for} because ${n?.requested} is not available.`],body:["If you want to use a specific port, you can choose a different one by setting the ",{command:n?.flagToRemedy}," flag."]});return}let r=Be(e.map(n=>n.for)).join(" "),o=Be(e.map(n=>({command:n.flagToRemedy})));se({headline:[`Random ports will be used for ${r} because the requested ports are not available.`],body:["If you want to use specific ports, you can choose different ports using the",...o,"flags."]})}p();async function Pn(t,e){return e?e.includes("localhost")?"localhost":(await _t(t)).plugins.find(o=>e?.includes(o))??"custom":void 0}p();var xn=Q(In(),1);var z="v1.4.4",En="FiloSottile/mkcert",dt=P.genericShellCommand("mkcert");async function Os(t,e,r,o){let n=e[Ce.mkcertBinaryPath];if(n)return n;let a=S(t,r==="win32"?"mkcert.exe":"mkcert");if(await D(a))return a;let i=await(0,xn.default)("mkcert",{nothrow:!0});return i?(g(b`Found ${dt} at ${P.path(i)}`),i):(await Ns(a,r,o),a)}async function Ns(t,e,r){let o;switch(e){case"darwin":o=r==="arm64"?`mkcert-${z}-darwin-arm64`:`mkcert-${z}-darwin-amd64`;break;case"linux":o=r==="arm64"?`mkcert-${z}-linux-arm64`:`mkcert-${z}-linux-amd64`;break;case"win32":o=`mkcert-${z}-windows-amd64.exe`;break;default:throw new X(`Unsupported platform: ${e}`)}await hr(En,z,o,t),g(b`${dt} saved to ${P.path(t)}`)}async function qs(t){let e=S(t,"mkcert-LICENSE");if(await D(e))return;let r=`https://raw.githubusercontent.com/${En}/refs/tags/${z}/LICENSE`,o={headline:"Failed to download mkcert license.",body:["We tried to download the license for mkcert, but the request failed. You can ",{link:{url:r,label:"view the license here"}}]},n;try{if(n=await Tt(r),!n.ok)return o}catch{return o}let s=await n.text();await me(e,s)}async function bn({appDirectory:t,forceInstall:e,env:r=process.env,platform:o=process.platform,arch:n=process.arch}){let s=S(".shopify","localhost-key.pem"),a=S(".shopify","localhost.pem"),i=S(t,s),c=S(t,a);if(await D(i)&&await D(c))return{keyContent:await L(i),certContent:await L(c),certPath:a};if(!(e??await jr()))throw new A(`Localhost certificate and key are required at ${a} and ${s}`);let l="",u;return await be([{title:"Finding or downloading mkcert binary",task:async()=>{let y=S(t,".shopify");l=await Os(y,r,o,n),u=await qs(y),g(b`${dt} found at: ${P.path(l)}`)}}]),u&&Ee(u),B(b`Generating self-signed certificate for localhost. You may be prompted for your password.`),await Ue(l,["-install","-key-file",i,"-cert-file",c,"localhost"]),B(b`${P.successIcon()} Certificate generated at ${a}\n`),await jt()&&(se({headline:"It looks like you're using WSL.",body:["Additional steps are required to configure certificate trust in Windows."],link:{label:"See Shopify CLI documentation",url:"https://shopify.dev/docs/apps/build/cli-for-apps/networking-options#localhost-based-development-with-windows-subsystem-for-linux-wsl"}}),B("\u{1F449} Press any key to continue"),await Bt(),B("")),{keyContent:await L(i),certContent:await L(c),certPath:ht(t,c)}}p();function Sn(){let t=["Your app has extensions which need to be assigned",{command:"uid"},"identifiers."],e=["You must first map IDs to your existing extensions by running",{command:"shopify app deploy"},"interactively, without",{command:"--allow-updates"},"or",{command:"--allow-deletes"},", to finish the migration."],r={title:"Reference",body:{list:{items:[{link:{label:"Migrating from the Partner Dashboard",url:"https://shopify.dev/docs/apps/build/dev-dashboard/migrate-from-partners"}}]}}};throw new A(t,void 0,[e],[r])}async function Un(t){let e=await Ws(t);await Hs(e);let{processes:r,graphiqlUrl:o,previewUrl:n,devSessionStatusManager:s}=await un(e);await Bs(e),await Vs({processes:r,previewUrl:n,graphiqlUrl:o,config:e,devSessionStatusManager:s})}async function Ws(t){let{app:e,remoteApp:r,developerPlatformClient:o,store:n,specifications:s,tunnel:a}=t,i;if(a.mode==="auto"){let E=await M();i=await Gr(t.commandConfig,E,"cloudflare")}let c=await zr(r,o,s,r.flags);r.configuration=c,Yr({app:e,remoteApp:r,selectedStore:n,cachedInfo:et(t.directory),organization:t.organization,tunnelMode:a.mode}),e.configuration.build?.dev_store_url&&(e.configuration.build={...e.configuration.build,dev_store_url:n.shopDomain},await(await Yt.read(e.configPath)).patch({build:{dev_store_url:n.shopDomain}})),!t.skipDependenciesInstallation&&!t.project.usesWorkspaces&&await Lr(t.project);let d=t.graphiqlPort??await M(ie.graphiql),l=[{for:"GraphiQL",flagToRemedy:"--graphiql-port",requested:t.graphiqlPort??ie.graphiql,actual:d}];a.mode==="use-localhost"&&l.push({for:"localhost",flagToRemedy:"--localhost-port",requested:a.requestedPort,actual:a.actualPort}),vn(l);let{webs:u,...h}=await js(e.directory,e.webs,d,a,i,r.configuration,t.installMkcert);e.webs=u;let y=e.configuration.build?.automatically_update_urls_on_dev,m=et(t.directory)?.previousAppId,f=r.apiKey,U=await Ks(u,t.update,h,e,y,r,f);return{storeFqdn:n.shopDomain,storeId:n.shopId,remoteApp:r,remoteAppUpdated:r.apiKey!==m,localApp:e,developerPlatformClient:o,commandOptions:t,network:h,partnerUrlsUpdated:U,graphiqlPort:d,graphiqlKey:t.graphiqlKey}}async function Hs(t){await Gs(t)}async function Gs(t){let{developerPlatformClient:e,remoteApp:r}=t;(await e.appExtensionRegistrations(r)).app.extensionRegistrations.filter(n=>n.type.toLowerCase()!=="webhook_subscription").every(n=>n.id)||Sn()}async function Bs(t){Or({directory:t.commandOptions.directory,previousAppId:t.remoteApp.apiKey}),await zs({devOptions:t.commandOptions,tunnelUrl:t.network.proxyUrl,shouldUpdateURLs:t.partnerUrlsUpdated,storeFqdn:t.storeFqdn}),await Lt({config:t.commandOptions.commandConfig,exitMode:"ok"})}async function Ks(t,e,r,o,n,s,a){let{backendConfig:i,frontendConfig:c}=V(t),d=!1;if((c??i)&&e){let l=qr(r.proxyUrl,t.map(({configuration:u})=>u.auth_callback_path).find(u=>u),o.configuration.app_proxy);d=await Hr({currentURLs:r.currentUrls,appDirectory:o.directory,cachedUpdateURLs:n,newApp:s.newApp,localApp:o,apiKey:a,newURLs:l}),d&&o.setDevApplicationURLs(l)}return d}async function js(t,e,r,o,n,s,a){let{backendConfig:i,frontendConfig:c}=V(e);await Ys(e,r);let d=o.mode==="use-localhost"?{noTunnelUseLocalhost:!0,port:o.actualPort}:{noTunnelUseLocalhost:!1,tunnelUrl:o.mode==="custom"?o.url:void 0,tunnelClient:n},[{frontendUrl:l,frontendPort:u,usingLocalhost:h},y,m]=await Promise.all([Nr(d),St()??i?.configuration.port??M(),Wr(s)]),f=h?`${l}:${u}`:l,U=c?.configuration.port;c&&(U??=c===i?y:await M(),c.configuration.port=U),U=U??await M();let E;if(o.mode==="use-localhost"){let{keyContent:R,certContent:x,certPath:_}=await bn({appDirectory:t,forceInstall:a});E={key:R,cert:x,certPath:_,port:o.actualPort}}return{proxyUrl:f,proxyPort:u,frontendPort:U,backendPort:y,currentUrls:m,webs:e,reverseProxyCert:E}}async function Vs({processes:t,previewUrl:e,graphiqlUrl:r,config:o,devSessionStatusManager:n}){let s=new Ut,a=t.map(d=>({prefix:d.prefix,action:async(u,h,y)=>{let m=d.function;return m({stdout:u,stderr:h,abortSignal:y},d.options)}})),i=o.developerPlatformClient,c={id:o.remoteApp.id,developerPlatformClient:i};return yn({processes:a,previewUrl:e,graphiqlUrl:r,app:c,abortController:s,shopFqdn:o.storeFqdn,devSessionStatusManager:n,appURL:o.localApp.devApplicationURLs?.applicationUrl,appName:o.remoteApp.title,organizationName:o.commandOptions.organization.businessName,configPath:o.localApp.configPath,localURL:o.network.proxyUrl})}async function zs(t){let e=await Pn(t.devOptions.commandConfig,t.tunnelUrl);await K.addPublicMetadata(()=>({cmd_dev_tunnel_type:e,cmd_dev_tunnel_custom_hash:e==="custom"?Ke(t.tunnelUrl):void 0,cmd_dev_urls_updated:t.shouldUpdateURLs,store_fqdn_hash:Ke(t.storeFqdn),store_domain:t.storeFqdn,cmd_app_dependency_installation_skipped:t.devOptions.skipDependenciesInstallation})),await K.addSensitiveMetadata(()=>({store_fqdn:t.storeFqdn,cmd_dev_tunnel_custom:e==="custom"?t.tunnelUrl:void 0}))}async function Ys(t,e){let r=t.map(n=>n.configuration.port).filter(n=>n),o=r.find((n,s)=>r.indexOf(n)!==s);if(o)throw new A(`Found port ${o} for multiple webs.`,"Please define a unique port for each web.");await Promise.all([...r.map(async n=>{if(!await Ye(n))throw new A(`Hard-coded port ${n} is not available, please choose a different one.`)}),(async()=>{if(!await Ye(e)){let s=`Port ${e} is not available for serving GraphiQL.`,a=["Choose a different port for the",{command:"--graphiql-port"},"flag."];throw new A(s,a)}})()])}p();async function Rn({useLocalhost:t,localhostPort:e,tunnelUrl:r}){if(r)return{mode:"custom",url:r};if(!t&&!e)return{mode:"auto"};let o=e??ie.localhost,n=await M(o);if(e&&n!==o){let s=`Port ${e} is not available.`,a=["Choose a different port for the",{command:"--localhost-port"},"flag."];throw new A(s,a)}return{mode:"use-localhost",requestedPort:o,actualPort:n}}var I=Q(Cn(),1);var mt=class t extends Jr{static get requiresSyncAnalytics(){return!0}static summary="Run the app.";static descriptionWithMarkdown="Builds and previews your app on a dev store, and watches for changes. [Read more about testing apps locally](https://shopify.dev/docs/apps/build/cli-for-apps/test-apps-locally).";static description=this.descriptionForHelp();static flags={...Qt,...kr,"client-id":I.Flags.string({hidden:!1,description:"The Client ID of your app. Use with --config to run dev with that configuration for a different app than the one it is linked to.",env:"SHOPIFY_FLAG_CLIENT_ID"}),store:I.Flags.string({char:"s",description:"Store URL. Must be an existing development or Shopify Plus sandbox store.",env:"SHOPIFY_FLAG_STORE",parse:async e=>ye(e)}),"skip-dependencies-installation":I.Flags.boolean({description:"Skips the installation of dependencies. Deprecated, use workspaces instead.",env:"SHOPIFY_FLAG_SKIP_DEPENDENCIES_INSTALLATION",default:!1}),"no-update":I.Flags.boolean({description:"Uses the app URL from the toml file instead an autogenerated URL for dev.",env:"SHOPIFY_FLAG_NO_UPDATE",default:!1}),"unsafe-validation":I.Flags.boolean({description:"Allow app dev to continue with warnings for eligible app version validation failures.",env:"SHOPIFY_FLAG_UNSAFE_VALIDATION",default:!1}),"subscription-product-url":I.Flags.string({description:'Resource URL for subscription UI extension. Format: "/products/{productId}"',env:"SHOPIFY_FLAG_SUBSCRIPTION_PRODUCT_URL"}),"checkout-cart-url":I.Flags.string({description:'Resource URL for checkout UI extension. Format: "/cart/{productVariantID}:{productQuantity}"',env:"SHOPIFY_FLAG_CHECKOUT_CART_URL"}),"tunnel-url":I.Flags.string({description:'Use a custom tunnel, it must be running before executing dev. Format: "https://my-tunnel-url:port".',env:"SHOPIFY_FLAG_TUNNEL_URL",exclusive:["tunnel"]}),"use-localhost":I.Flags.boolean({description:"Service entry point will listen to localhost. A tunnel won't be used. Will work for testing many app features, but not those that directly invoke your app (E.g: Webhooks)",env:"SHOPIFY_FLAG_USE_LOCALHOST",exclusive:["tunnel-url"]}),"install-mkcert":I.Flags.boolean({description:"Install and use mkcert to generate localhost certificates when --use-localhost is enabled without prompting.",env:"SHOPIFY_FLAG_INSTALL_MKCERT",dependsOn:["use-localhost"]}),"localhost-port":Re({description:"Port to use for localhost.",env:"SHOPIFY_FLAG_LOCALHOST_PORT"}),theme:I.Flags.string({char:"t",description:"Theme ID or name of the theme app extension host theme.",env:"SHOPIFY_FLAG_THEME"}),"theme-app-extension-port":Re({description:"Local port of the theme app extension development server.",env:"SHOPIFY_FLAG_THEME_APP_EXTENSION_PORT"}),"store-password":I.Flags.string({description:"The password for storefronts with password protection.",env:"SHOPIFY_FLAG_STORE_PASSWORD"}),notify:I.Flags.string({description:"The file path or URL. The file path is to a file that you want updated on idle. The URL path is where you want a webhook posted to report on file changes.",env:"SHOPIFY_FLAG_NOTIFY"}),"graphiql-port":Re({hidden:!0,description:"Local port of the GraphiQL development server.",env:"SHOPIFY_FLAG_GRAPHIQL_PORT"}),"graphiql-key":I.Flags.string({hidden:!0,description:"Key used to authenticate GraphiQL requests. By default, a key is automatically derived from the app secret. Use this flag to override with a custom key.",env:"SHOPIFY_FLAG_GRAPHIQL_KEY"})};static analyticsStopCommand(){return"app dev stop"}async run(){let{flags:e}=await this.parse(t),r=await Rn({useLocalhost:e["use-localhost"]??!1,tunnelUrl:e["tunnel-url"],localhostPort:e["localhost-port"]});await $t(()=>({cmd_app_dependency_installation_skipped:e["skip-dependencies-installation"],cmd_app_reset_used:e.reset,cmd_dev_tunnel_type:r.mode})),await Br(e.path);let o=await Qr({directory:e.path,clientId:e["client-id"],forceRelink:e.reset,userProvidedConfigName:e.config}),n=await Xr({appContextResult:o,storeFqdn:e.store,forceReselectStore:e.reset,storeCreationMode:"selection-option"}),s={...o,store:n,directory:e.path,update:!e["no-update"],unsafeValidation:e["unsafe-validation"],skipDependenciesInstallation:e["skip-dependencies-installation"],commandConfig:this.config,subscriptionProductUrl:e["subscription-product-url"],checkoutCartUrl:e["checkout-cart-url"],theme:e.theme,themeExtensionPort:e["theme-app-extension-port"],storePassword:e["store-password"],notify:e.notify,graphiqlPort:e["graphiql-port"],graphiqlKey:e["graphiql-key"],installMkcert:e["install-mkcert"],tunnel:r};return await Un(s),{app:o.app}}};export{ka as a,mt as b};
@@ -1 +1 @@
1
- import{n as A}from"./chunk-KDMJ2BLO.js";import{a as P}from"./chunk-NAQ7KT6L.js";import{c as C}from"./chunk-K3OI5VDE.js";import{s as T}from"./chunk-TUWRPDTE.js";import{r as w}from"./chunk-GBYDMHZ3.js";import{a as D}from"./chunk-VIMFXQ3Q.js";import{T as u}from"./chunk-KYNXMDFU.js";import{B as y,z as h}from"./chunk-PSSOCUUD.js";import{Ab as O,va as p}from"./chunk-G5QSVBYP.js";import{d,q as m}from"./chunk-773TIA5M.js";import{g as l}from"./chunk-VKWPEFWQ.js";l();async function q(e){P({verbose:e.verbose,noColor:e.noColor});let t=w({store:e.store}),o=await u(t,e.password);await R(o,{path:e.path??m(),force:e.force??!1,silent:e.silent??!1})}var E={article:"ARTICLE",blog:"BLOG",collection:"COLLECTION",company:"COMPANY",company_location:"COMPANY_LOCATION",location:"LOCATION",market:"MARKET",order:"ORDER",page:"PAGE",product:"PRODUCT",variant:"PRODUCTVARIANT",shop:"SHOP"};async function R(e,t){let{force:o,path:i,silent:n}=t;if(!await A(i)&&(process.env.SHOPIFY_LANGUAGE_SERVER==="1"||!await C(o)))return;let f=[],r=[];for(let[a,s]of Object.entries(E))f.push(T(s,e).catch(c=>(r.push(s),[])).then(c=>({[a]:c})));let b=(await Promise.all(f)).reduce((a,s)=>({...a,...s}));if(r.length===Object.values(E).length){n||y({body:"Failed to fetch metafield definitions.",nextSteps:["Check your network connection and try again.","Ensure you have the permission to fetch metafield definitions."],reference:[{link:{label:"Metafield Definition API",url:"https://shopify.dev/docs/api/admin-graphql/latest/queries/metafieldDefinition"}}]});return}await S(i,b),r.length>0&&O(`Failed to fetch metafield definitions for the following owner types: ${r.join(", ")}`),n||h({body:"Metafield definitions have been successfully downloaded."})}async function S(e,t){let o=await D(e),i=d(o,"metafields.json"),n=JSON.stringify(t,null,2);p(i,n)}export{q as a};
1
+ import{n as A}from"./chunk-LAHZ6FO5.js";import{a as P}from"./chunk-JJ4MYCVU.js";import{c as C}from"./chunk-NZRQKFUB.js";import{s as T}from"./chunk-NSHKVJST.js";import{r as w}from"./chunk-2AZXDU2R.js";import{a as D}from"./chunk-4AXLWDKW.js";import{K as u}from"./chunk-VWYZCCRE.js";import{B as y,z as h}from"./chunk-KCHERKZO.js";import{Nb as O,za as p}from"./chunk-COFGQT76.js";import{d,q as m}from"./chunk-3VYOLEQE.js";import{g as l}from"./chunk-VKWPEFWQ.js";l();async function q(e){P({verbose:e.verbose,noColor:e.noColor});let t=w({store:e.store}),o=await u(t,e.password);await R(o,{path:e.path??m(),force:e.force??!1,silent:e.silent??!1})}var E={article:"ARTICLE",blog:"BLOG",collection:"COLLECTION",company:"COMPANY",company_location:"COMPANY_LOCATION",location:"LOCATION",market:"MARKET",order:"ORDER",page:"PAGE",product:"PRODUCT",variant:"PRODUCTVARIANT",shop:"SHOP"};async function R(e,t){let{force:o,path:i,silent:n}=t;if(!await A(i)&&(process.env.SHOPIFY_LANGUAGE_SERVER==="1"||!await C(o)))return;let f=[],r=[];for(let[a,s]of Object.entries(E))f.push(T(s,e).catch(c=>(r.push(s),[])).then(c=>({[a]:c})));let b=(await Promise.all(f)).reduce((a,s)=>({...a,...s}));if(r.length===Object.values(E).length){n||y({body:"Failed to fetch metafield definitions.",nextSteps:["Check your network connection and try again.","Ensure you have the permission to fetch metafield definitions."],reference:[{link:{label:"Metafield Definition API",url:"https://shopify.dev/docs/api/admin-graphql/latest/queries/metafieldDefinition"}}]});return}await S(i,b),r.length>0&&O(`Failed to fetch metafield definitions for the following owner types: ${r.join(", ")}`),n||h({body:"Metafield definitions have been successfully downloaded."})}async function S(e,t){let o=await D(e),i=d(o,"metafields.json"),n=JSON.stringify(t,null,2);p(i,n)}export{q as a};