@shopify/cli 4.5.2 → 4.6.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 (363) hide show
  1. package/dist/analytics-3ICKUTK2.js +1 -0
  2. package/dist/analytics-73NVZI4Z.js +1 -0
  3. package/dist/assets/hydrogen/starter/package.json +1 -1
  4. package/dist/bootstrap.js +1 -1
  5. package/dist/{chokidar-VDIVGBZH.js → chokidar-5RWEYTNQ.js} +1 -1
  6. package/dist/{chunk-SH6Q5CLM.js → chunk-25Z36VJG.js} +1 -1
  7. package/dist/{chunk-OC5PD4ID.js → chunk-2AVFG5KT.js} +1 -1
  8. package/dist/chunk-2DMTEIS3.js +2 -0
  9. package/dist/chunk-2GB3EAD3.js +153 -0
  10. package/dist/{chunk-UQWFDL3F.js → chunk-2KD4LHRT.js} +1 -1
  11. package/dist/{chunk-4VJ5VBSR.js → chunk-2NB4P6BB.js} +1 -1
  12. package/dist/{chunk-75DBVSVI.js → chunk-2OYQHHKC.js} +1 -1
  13. package/dist/{chunk-OMXKQY2L.js → chunk-2VJKXWLG.js} +1 -1
  14. package/dist/{chunk-V6QZF5YS.js → chunk-3Q5ESVIY.js} +1 -1
  15. package/dist/{chunk-TPGREOWO.js → chunk-3XCIUG5P.js} +1 -1
  16. package/dist/chunk-445NFHXL.js +3 -0
  17. package/dist/{chunk-WN5VTUWJ.js → chunk-4BPFJDH3.js} +1 -1
  18. package/dist/chunk-4E5RGEJO.js +1 -0
  19. package/dist/{chunk-LGFOE4XL.js → chunk-4IHSAT76.js} +1 -1
  20. package/dist/chunk-4TANJ4JK.js +1 -0
  21. package/dist/{chunk-VCWESQBC.js → chunk-534U3DKZ.js} +2 -2
  22. package/dist/{chunk-KIAMA3L2.js → chunk-56T6YCU2.js} +1 -1
  23. package/dist/chunk-5HJTCBBV.js +317 -0
  24. package/dist/{chunk-523SJVNT.js → chunk-5INBKZRD.js} +1 -1
  25. package/dist/{chunk-DIPTSBQM.js → chunk-5Q4WAGQL.js} +1 -1
  26. package/dist/{chunk-35FS2NTM.js → chunk-5QDM4XIK.js} +1 -1
  27. package/dist/chunk-65CEF3SM.js +8 -0
  28. package/dist/{chunk-NSADN5S2.js → chunk-6HQMZ324.js} +141 -141
  29. package/dist/{chunk-QEVGRNUE.js → chunk-6KAWCN3I.js} +3 -3
  30. package/dist/{chunk-GDHD3TGC.js → chunk-6QDOCBD4.js} +1 -1
  31. package/dist/{chunk-LVLDPYH5.js → chunk-6ZPHB5U2.js} +1 -1
  32. package/dist/{chunk-XS7WK4YK.js → chunk-7AWKXTNS.js} +1 -1
  33. package/dist/chunk-7EE7YOCR.js +16 -0
  34. package/dist/{chunk-L42FYXFW.js → chunk-7L5AIZOP.js} +4 -4
  35. package/dist/chunk-7MD5MIGN.js +103 -0
  36. package/dist/{chunk-N6IFIMC6.js → chunk-7TXWKLPY.js} +1 -1
  37. package/dist/{chunk-ZUWEGJA7.js → chunk-7US4TVO2.js} +1 -1
  38. package/dist/{chunk-7TQ6HVHN.js → chunk-A7IDVXF7.js} +1 -1
  39. package/dist/chunk-AFM3UZQO.js +684 -0
  40. package/dist/{chunk-5GVE4ILZ.js → chunk-AHLNB45E.js} +1 -1
  41. package/dist/{chunk-JOKLZMTP.js → chunk-ARCAYYRW.js} +1 -1
  42. package/dist/{chunk-JADXT2DY.js → chunk-B3U6GDHL.js} +1 -1
  43. package/dist/chunk-BCZMDFI2.js +370 -0
  44. package/dist/chunk-BDDROQGK.js +26 -0
  45. package/dist/{chunk-P6LVSNTT.js → chunk-BKJMVAI7.js} +1 -1
  46. package/dist/chunk-BOAGJ6P5.js +1 -0
  47. package/dist/{chunk-TSEPNC3O.js → chunk-BPDUBZMU.js} +1 -1
  48. package/dist/chunk-BQOKTPUU.js +1 -0
  49. package/dist/{chunk-6VR22Z5R.js → chunk-C7LFLIRT.js} +3 -3
  50. package/dist/chunk-CELVG4AL.js +6 -0
  51. package/dist/{chunk-BQARKSGG.js → chunk-CNI7ZUST.js} +1 -1
  52. package/dist/{chunk-YKNMNGV7.js → chunk-CONJQV7M.js} +1 -1
  53. package/dist/chunk-CTNBSUVU.js +83 -0
  54. package/dist/chunk-CV5ELBVU.js +1 -0
  55. package/dist/{chunk-DI5ZPWNA.js → chunk-DC7TXY4K.js} +1 -1
  56. package/dist/{chunk-ODSMT2ZC.js → chunk-DXUISRMZ.js} +1 -1
  57. package/dist/chunk-EHV7EKB3.js +2 -0
  58. package/dist/{chunk-SZM6ANMN.js → chunk-EQNJ2NQD.js} +2 -2
  59. package/dist/{chunk-NIVGP4LB.js → chunk-EVIO6OWW.js} +1 -1
  60. package/dist/chunk-EZBB2ULE.js +1 -0
  61. package/dist/{chunk-Z6VNPAY7.js → chunk-FBVNXRVB.js} +1 -1
  62. package/dist/chunk-FFSDGRAN.js +1 -0
  63. package/dist/{chunk-YXNKDX56.js → chunk-FG5QXIQH.js} +1 -1
  64. package/dist/{chunk-6ZWMXMNM.js → chunk-FGG6HXIZ.js} +1 -1
  65. package/dist/{chunk-3EJGRQTH.js → chunk-FJCZ4F6J.js} +1 -1
  66. package/dist/{chunk-2ACN7JIZ.js → chunk-FKH5ZF2C.js} +1 -1
  67. package/dist/{chunk-LSCDB36D.js → chunk-GD5IRJBE.js} +1 -1
  68. package/dist/{chunk-ZAN7AZTX.js → chunk-GJEG7VGX.js} +1 -1
  69. package/dist/{chunk-XUAAQI5N.js → chunk-GT6BJ2GK.js} +1 -1
  70. package/dist/chunk-GWNV44NZ.js +18 -0
  71. package/dist/{chunk-ZT4PUH7L.js → chunk-GXO2RRV2.js} +1 -1
  72. package/dist/{chunk-MC466GSO.js → chunk-H5I7BSNG.js} +1 -1
  73. package/dist/{chunk-6AWRW3GS.js → chunk-H5YC3EP6.js} +1 -1
  74. package/dist/chunk-HVMEBH24.js +6 -0
  75. package/dist/{chunk-5N7H4PJJ.js → chunk-HY3INWPI.js} +1 -1
  76. package/dist/{chunk-XXLGM6OZ.js → chunk-I6ST5X56.js} +1 -1
  77. package/dist/{chunk-RFOALCVH.js → chunk-ID6ASBGV.js} +1 -1
  78. package/dist/{chunk-R6A754UW.js → chunk-IDQT2UY7.js} +1 -1
  79. package/dist/chunk-IIOFR25P.js +3 -0
  80. package/dist/{chunk-FSVSM57K.js → chunk-IJEDTDSJ.js} +6 -6
  81. package/dist/{chunk-42RVM4EZ.js → chunk-ILICQWUF.js} +1 -1
  82. package/dist/chunk-IMWEC6NF.js +16 -0
  83. package/dist/{chunk-Q7DSLGTN.js → chunk-ITNFDLZ4.js} +1 -1
  84. package/dist/chunk-IU5U6KKO.js +4 -0
  85. package/dist/{chunk-YNX4DT2O.js → chunk-IXCDFXMB.js} +1 -1
  86. package/dist/chunk-J3D4KQOQ.js +1 -0
  87. package/dist/chunk-JJZNUFPD.js +44 -0
  88. package/dist/chunk-JRTJZAFJ.js +19 -0
  89. package/dist/chunk-JT7YTXJ7.js +1 -0
  90. package/dist/{chunk-EEEKSYWV.js → chunk-JX4HSDDG.js} +15 -15
  91. package/dist/chunk-K4M32VKU.js +5 -0
  92. package/dist/{chunk-XHTICMA7.js → chunk-K5GJNXDK.js} +1 -1
  93. package/dist/{chunk-5CV7GFWZ.js → chunk-KCNOFNS5.js} +1 -1
  94. package/dist/{chunk-3OCR7P3S.js → chunk-KM2R6O7V.js} +1 -1
  95. package/dist/{chunk-CX44CQFL.js → chunk-KNFDN3AP.js} +1 -1
  96. package/dist/{chunk-ZG7BVVT2.js → chunk-LD6ZCTZ3.js} +1 -1
  97. package/dist/{chunk-TM44Z7U7.js → chunk-LDWMX3KZ.js} +1 -1
  98. package/dist/{chunk-6K4DVV37.js → chunk-LEDVV6XK.js} +1 -1
  99. package/dist/chunk-LEEVJH4B.js +1 -0
  100. package/dist/{chunk-EOJNSPIH.js → chunk-LJZIIURR.js} +1 -1
  101. package/dist/{chunk-UHMRDG6J.js → chunk-LURVEPYP.js} +1 -1
  102. package/dist/{chunk-HQE5B2CF.js → chunk-LXOBW4AW.js} +1 -1
  103. package/dist/{chunk-AAK3WGD7.js → chunk-M5YGJYNI.js} +1 -1
  104. package/dist/{chunk-UMB4BWCK.js → chunk-MDQHEW7V.js} +1 -1
  105. package/dist/{chunk-ICRQZAXP.js → chunk-MMP3F6LO.js} +1 -1
  106. package/dist/{chunk-HOAVZLEG.js → chunk-MPYCIVRA.js} +1 -1
  107. package/dist/chunk-MY2H5XPY.js +7 -0
  108. package/dist/{chunk-SG5TRPJ7.js → chunk-N4RYVOXT.js} +1 -1
  109. package/dist/chunk-NB6HHZ36.js +1 -0
  110. package/dist/{chunk-UVIGXZMV.js → chunk-NEK2KNKR.js} +1 -1
  111. package/dist/{chunk-VJQJ5PTQ.js → chunk-NENUUNWB.js} +1 -1
  112. package/dist/{chunk-K4APB7O3.js → chunk-NJONAV7V.js} +1 -1
  113. package/dist/{chunk-7KWBVZPI.js → chunk-NKBSS7YL.js} +1 -1
  114. package/dist/{chunk-HSVZU7MP.js → chunk-NKT5U6IJ.js} +1 -1
  115. package/dist/{chunk-RLB5QHWG.js → chunk-NVQOAHID.js} +1 -1
  116. package/dist/{chunk-P7OSUECN.js → chunk-OHQTOHUX.js} +1 -1
  117. package/dist/chunk-P2P2MAZQ.js +1 -0
  118. package/dist/{chunk-KFUOVO3X.js → chunk-PCTVUTV3.js} +1 -1
  119. package/dist/{chunk-OJZT3NA2.js → chunk-PKR6HS4T.js} +1 -1
  120. package/dist/chunk-PKRDBS7O.js +5 -0
  121. package/dist/{chunk-BVWQZKNK.js → chunk-PMD6S7YG.js} +1 -1
  122. package/dist/{chunk-KPNNGJAW.js → chunk-PUOCHFFI.js} +1 -1
  123. package/dist/{chunk-ANH2V6DJ.js → chunk-Q2DPBMV4.js} +1 -1
  124. package/dist/{chunk-23LZNWB5.js → chunk-Q6XT3YKV.js} +1 -1
  125. package/dist/{chunk-TNUY66EE.js → chunk-QARALFHD.js} +1 -1
  126. package/dist/{chunk-XCGV3IJ5.js → chunk-QEL3F2NY.js} +1 -1
  127. package/dist/{chunk-P2SBE77Z.js → chunk-R2W5B7YI.js} +1 -1
  128. package/dist/chunk-REABQXMP.js +1 -0
  129. package/dist/{chunk-KQTVJMV6.js → chunk-RMF3YNWE.js} +1 -1
  130. package/dist/{chunk-TH6CLNGO.js → chunk-RTPVI7LE.js} +1 -1
  131. package/dist/{chunk-U3MSTPZP.js → chunk-SFZQFEZB.js} +1 -1
  132. package/dist/{chunk-7AY6HLQG.js → chunk-STCLJWHD.js} +1 -1
  133. package/dist/{chunk-7AYYQUJG.js → chunk-STJWHL36.js} +1 -1
  134. package/dist/{chunk-NYG2VQFQ.js → chunk-SZJHOXS6.js} +1 -1
  135. package/dist/{chunk-DZMXYETH.js → chunk-TEPMNVJN.js} +1 -1
  136. package/dist/{chunk-ML6SILEL.js → chunk-TNSMROUR.js} +1 -1
  137. package/dist/chunk-TR4OWSEX.js +77 -0
  138. package/dist/{chunk-AUAUAK6P.js → chunk-U3P5TIIR.js} +1 -1
  139. package/dist/{chunk-CEBDKIVH.js → chunk-UDDJQ34Y.js} +1 -1
  140. package/dist/chunk-UKQ7NE5V.js +1 -0
  141. package/dist/{chunk-KMQE7WFZ.js → chunk-UOQBCBKY.js} +1 -1
  142. package/dist/{chunk-RTINXD5Z.js → chunk-UQWT2PFO.js} +1 -1
  143. package/dist/{chunk-AATUQ2AY.js → chunk-UTK6V2NE.js} +80 -80
  144. package/dist/{chunk-XDV4PRFT.js → chunk-V26QBVCN.js} +1 -1
  145. package/dist/{chunk-T35C6NC7.js → chunk-VVEQ4IHW.js} +1 -1
  146. package/dist/chunk-VXBHTSMX.js +20 -0
  147. package/dist/chunk-W2357IN2.js +2 -0
  148. package/dist/chunk-W6ST525S.js +99 -0
  149. package/dist/chunk-WDCCITSG.js +1 -0
  150. package/dist/{chunk-5VRU3BT5.js → chunk-WE3VLC2S.js} +1 -1
  151. package/dist/chunk-WGMYSPR2.js +10 -0
  152. package/dist/chunk-WHT2RCAD.js +11 -0
  153. package/dist/{chunk-YWQPSMRZ.js → chunk-WOYI6SDK.js} +1 -1
  154. package/dist/{chunk-BUVP2UUA.js → chunk-WXJGZGQS.js} +1 -1
  155. package/dist/{chunk-DELISRUH.js → chunk-X4AZV5A2.js} +1 -1
  156. package/dist/{chunk-7PVNAILK.js → chunk-X5RH4ALT.js} +1 -1
  157. package/dist/{chunk-2TJ6LOCC.js → chunk-XBBP5BWC.js} +1 -1
  158. package/dist/{chunk-4UJNCOE6.js → chunk-XH32NPYG.js} +1 -1
  159. package/dist/{chunk-PEYYIWP6.js → chunk-XZ2KUBFJ.js} +1 -1
  160. package/dist/{chunk-TC3JOEMA.js → chunk-Y2PC2BBJ.js} +60 -60
  161. package/dist/{chunk-I5X3IP6T.js → chunk-Y7A7Z2V3.js} +1 -1
  162. package/dist/{chunk-UW6YEKST.js → chunk-YE7XCF44.js} +1 -1
  163. package/dist/{chunk-LXOBFJZO.js → chunk-YHH3JA36.js} +1 -1
  164. package/dist/chunk-YIFT67BD.js +4 -0
  165. package/dist/{chunk-34SINZ7L.js → chunk-YR7K4NQT.js} +1 -1
  166. package/dist/{chunk-VGSH33QU.js → chunk-Z36JS7OX.js} +1 -1
  167. package/dist/{chunk-WDSBR7KX.js → chunk-ZHPPBTNE.js} +1 -1
  168. package/dist/chunk-ZMSE5SQB.js +1 -0
  169. package/dist/cli/commands/app/app-logs/sources.js +1 -1
  170. package/dist/cli/commands/app/build.js +1 -1
  171. package/dist/cli/commands/app/bulk/cancel.js +1 -1
  172. package/dist/cli/commands/app/bulk/execute.js +1 -1
  173. package/dist/cli/commands/app/bulk/status.js +1 -1
  174. package/dist/cli/commands/app/config/link.js +1 -1
  175. package/dist/cli/commands/app/config/pull.js +1 -1
  176. package/dist/cli/commands/app/config/use.js +1 -1
  177. package/dist/cli/commands/app/config/validate.js +1 -1
  178. package/dist/cli/commands/app/demo/watcher.js +1 -1
  179. package/dist/cli/commands/app/deploy.js +1 -1
  180. package/dist/cli/commands/app/dev/clean.js +1 -1
  181. package/dist/cli/commands/app/dev.js +1 -1
  182. package/dist/cli/commands/app/env/pull.js +1 -1
  183. package/dist/cli/commands/app/env/show.js +1 -1
  184. package/dist/cli/commands/app/execute.js +1 -1
  185. package/dist/cli/commands/app/function/build.js +1 -1
  186. package/dist/cli/commands/app/function/info.js +1 -1
  187. package/dist/cli/commands/app/function/replay.js +1 -1
  188. package/dist/cli/commands/app/function/run.js +1 -1
  189. package/dist/cli/commands/app/function/schema.js +1 -1
  190. package/dist/cli/commands/app/function/typegen.js +1 -1
  191. package/dist/cli/commands/app/generate/extension.js +1 -1
  192. package/dist/cli/commands/app/graphiql.js +1 -1
  193. package/dist/cli/commands/app/import-custom-data-definitions.js +1 -1
  194. package/dist/cli/commands/app/import-extensions.js +1 -1
  195. package/dist/cli/commands/app/info.js +1 -1
  196. package/dist/cli/commands/app/init.js +1 -1
  197. package/dist/cli/commands/app/logs.js +1 -1
  198. package/dist/cli/commands/app/release.js +1 -1
  199. package/dist/cli/commands/app/versions/list.js +1 -1
  200. package/dist/cli/commands/app/webhook/trigger.js +1 -1
  201. package/dist/cli/commands/auth/login.js +1 -1
  202. package/dist/cli/commands/auth/logout.js +1 -1
  203. package/dist/cli/commands/cache/clear.js +1 -1
  204. package/dist/cli/commands/config/autoupgrade/off.js +1 -1
  205. package/dist/cli/commands/config/autoupgrade/on.js +1 -1
  206. package/dist/cli/commands/config/autoupgrade/status.js +1 -1
  207. package/dist/cli/commands/debug/command-flags.js +1 -1
  208. package/dist/cli/commands/doc/fetch.js +1 -1
  209. package/dist/cli/commands/doc/search.js +1 -1
  210. package/dist/cli/commands/docs/generate.js +1 -1
  211. package/dist/cli/commands/doctor-release/doctor-release.js +1 -1
  212. package/dist/cli/commands/doctor-release/theme/index.js +1 -1
  213. package/dist/cli/commands/help.js +1 -1
  214. package/dist/cli/commands/kitchen-sink/async.js +1 -1
  215. package/dist/cli/commands/kitchen-sink/index.js +1 -1
  216. package/dist/cli/commands/kitchen-sink/prompts.js +1 -1
  217. package/dist/cli/commands/kitchen-sink/static.js +1 -1
  218. package/dist/cli/commands/notifications/generate.js +1 -1
  219. package/dist/cli/commands/notifications/list.js +1 -1
  220. package/dist/cli/commands/organization/list.js +1 -1
  221. package/dist/cli/commands/search.js +1 -1
  222. package/dist/cli/commands/theme/check.js +1 -1
  223. package/dist/cli/commands/theme/console.js +1 -1
  224. package/dist/cli/commands/theme/delete.js +1 -1
  225. package/dist/cli/commands/theme/dev.js +1 -1
  226. package/dist/cli/commands/theme/duplicate.js +1 -1
  227. package/dist/cli/commands/theme/info.js +1 -1
  228. package/dist/cli/commands/theme/init.js +1 -1
  229. package/dist/cli/commands/theme/language-server.js +1 -1
  230. package/dist/cli/commands/theme/list.js +1 -1
  231. package/dist/cli/commands/theme/metafields/pull.js +1 -1
  232. package/dist/cli/commands/theme/open.js +1 -1
  233. package/dist/cli/commands/theme/package.js +1 -1
  234. package/dist/cli/commands/theme/preview.js +1 -1
  235. package/dist/cli/commands/theme/profile.js +1 -1
  236. package/dist/cli/commands/theme/publish.js +1 -1
  237. package/dist/cli/commands/theme/pull.js +1 -1
  238. package/dist/cli/commands/theme/push.js +1 -1
  239. package/dist/cli/commands/theme/rename.js +1 -1
  240. package/dist/cli/commands/theme/share.js +1 -1
  241. package/dist/cli/commands/upgrade.js +1 -1
  242. package/dist/cli/commands/version.js +1 -1
  243. package/dist/cli/help.js +1 -1
  244. package/dist/command-registry.js +1 -1
  245. package/dist/conf-store-YW3NWYCN.js +1 -0
  246. package/dist/custom-oclif-loader-4ZAXX5MR.js +1 -0
  247. package/dist/deprecations-VW7UIMZX.js +1 -0
  248. package/dist/dist-I3VCRVOE.js +1 -0
  249. package/dist/dist-MP4AU5F4.js +1 -0
  250. package/dist/environments-5P57CTOG.js +1 -0
  251. package/dist/error-U7DOQOWG.js +1 -0
  252. package/dist/error-handler-AOEXPYI7.js +1 -0
  253. package/dist/{fs-B4UJTUCD.js → fs-K5NT4W2Q.js} +1 -1
  254. package/dist/hooks/app-init.js +1 -1
  255. package/dist/hooks/did-you-mean.js +1 -1
  256. package/dist/hooks/hydrogen-init.js +1 -1
  257. package/dist/hooks/plugin-plugins.js +1 -1
  258. package/dist/hooks/postrun.js +1 -1
  259. package/dist/hooks/prerun.js +1 -1
  260. package/dist/hooks/public-metadata.js +1 -1
  261. package/dist/hooks/sensitive-metadata.js +1 -1
  262. package/dist/hooks/tunnel-provider.js +1 -1
  263. package/dist/hooks/tunnel-start.js +1 -1
  264. package/dist/{http-proxy-node16-X2WAMUT5.js → http-proxy-node16-A6AKKRQH.js} +1 -1
  265. package/dist/index.js +15 -15
  266. package/dist/is-global-CFYYUAIJ.js +1 -0
  267. package/dist/{latest-version-32HXMWJ7.js → latest-version-LDWU5F7A.js} +7 -7
  268. package/dist/lib-2BR2WN7L.js +1 -0
  269. package/dist/lib-JKLF33A7.js +1 -0
  270. package/dist/{lib-NOROGV6N.js → lib-P3APEIHY.js} +1 -1
  271. package/dist/local-BRRQOCGY.js +1 -0
  272. package/dist/local-storage-FVSI2IBZ.js +1 -0
  273. package/dist/{metadata-FREAI3KR.js → metadata-HVSGVFUQ.js} +1 -1
  274. package/dist/{morph-QZGREMO2.js → morph-ABSWZEVT.js} +4 -4
  275. package/dist/node-package-manager-6JURLQKU.js +1 -0
  276. package/dist/notifications-system-BTEFKXCS.js +1 -0
  277. package/dist/out-53ABAVL7.js +1 -0
  278. package/dist/{output-VUR2QZPW.js → output-EXMTVS2V.js} +1 -1
  279. package/dist/system-DUJDILSL.js +1 -0
  280. package/dist/tsconfig.tsbuildinfo +1 -1
  281. package/dist/ui-AX6ZMY6P.js +1 -0
  282. package/dist/upgrade-5TEVQNLY.js +1 -0
  283. package/dist/version-7LKOAVDW.js +1 -0
  284. package/dist/version-PRFBZAWQ.js +1 -0
  285. package/dist/{workerd-KPQTFQD4.js → workerd-MFV7EBVM.js} +1 -1
  286. package/oclif.manifest.json +612 -2
  287. package/package.json +11 -11
  288. package/dist/analytics-M7ZU437S.js +0 -1
  289. package/dist/analytics-ZRM4FEOE.js +0 -1
  290. package/dist/assets/dev-console/extensions/dev-console/assets/apple-touch-icon-BXMqQaSW.png +0 -0
  291. package/dist/assets/dev-console/extensions/dev-console/assets/favicon-16x16-B6uL8SrV.png +0 -0
  292. package/dist/assets/dev-console/extensions/dev-console/assets/favicon-32x32-CGwlpz_y.png +0 -0
  293. package/dist/assets/dev-console/extensions/dev-console/assets/favicon-ByUl89Ab.ico +0 -0
  294. package/dist/assets/dev-console/extensions/dev-console/assets/index-Bm_GpKQW.js +0 -51
  295. package/dist/assets/dev-console/extensions/dev-console/assets/index-DISeE29z.css +0 -1
  296. package/dist/assets/dev-console/extensions/dev-console/assets/site-B9Ae890R.webmanifest +0 -19
  297. package/dist/assets/dev-console/index.html +0 -21
  298. package/dist/chunk-2O22LZKV.js +0 -44
  299. package/dist/chunk-3IFZECSI.js +0 -22
  300. package/dist/chunk-4MLEL3VK.js +0 -283
  301. package/dist/chunk-4P54DKG4.js +0 -3
  302. package/dist/chunk-4ROX2TCK.js +0 -1
  303. package/dist/chunk-5C7HDTHJ.js +0 -1
  304. package/dist/chunk-5VC4XXYH.js +0 -1
  305. package/dist/chunk-7RJPTSL6.js +0 -7
  306. package/dist/chunk-ADKFAPED.js +0 -21
  307. package/dist/chunk-B5MFFERE.js +0 -1
  308. package/dist/chunk-BLSWUNOK.js +0 -16
  309. package/dist/chunk-DN3BB4IO.js +0 -103
  310. package/dist/chunk-EAOT5CK5.js +0 -2
  311. package/dist/chunk-G6BFXMOV.js +0 -2
  312. package/dist/chunk-GMAZ2BQY.js +0 -26
  313. package/dist/chunk-HYF3VJYS.js +0 -3
  314. package/dist/chunk-IIFRDOYG.js +0 -1
  315. package/dist/chunk-KB6H5LQJ.js +0 -4
  316. package/dist/chunk-LKZ7ARYS.js +0 -18
  317. package/dist/chunk-MYQTAM77.js +0 -2
  318. package/dist/chunk-NGCPVRDM.js +0 -1
  319. package/dist/chunk-NJOO5XJV.js +0 -1
  320. package/dist/chunk-NNOSZ447.js +0 -1
  321. package/dist/chunk-NVA2354A.js +0 -5
  322. package/dist/chunk-NWH3TAHK.js +0 -1
  323. package/dist/chunk-OCBGHOH2.js +0 -19
  324. package/dist/chunk-P7U6BWKN.js +0 -1
  325. package/dist/chunk-QFXJNFMI.js +0 -1
  326. package/dist/chunk-R7QYSC6T.js +0 -567
  327. package/dist/chunk-RE652L3G.js +0 -1
  328. package/dist/chunk-SSDEWKDZ.js +0 -6
  329. package/dist/chunk-T6CC5WUU.js +0 -159
  330. package/dist/chunk-TB7HFPBB.js +0 -370
  331. package/dist/chunk-TIU7MMRT.js +0 -836
  332. package/dist/chunk-TTEY5PLR.js +0 -10
  333. package/dist/chunk-U4HLIXRH.js +0 -4
  334. package/dist/chunk-UAYIFFYJ.js +0 -11
  335. package/dist/chunk-UHIP5CFI.js +0 -1
  336. package/dist/chunk-UMFVRG33.js +0 -5
  337. package/dist/chunk-WTRKTFVE.js +0 -2
  338. package/dist/chunk-X3VG75LO.js +0 -1
  339. package/dist/chunk-XSUZPWYV.js +0 -5
  340. package/dist/chunk-Z33MWGCG.js +0 -1
  341. package/dist/chunk-ZIM2G3EP.js +0 -1
  342. package/dist/chunk-ZSYMRT3S.js +0 -4
  343. package/dist/conf-store-HOA62HKK.js +0 -1
  344. package/dist/custom-oclif-loader-3AICQCNU.js +0 -1
  345. package/dist/deprecations-2FTB7JEW.js +0 -1
  346. package/dist/dist-63JMGNUL.js +0 -1
  347. package/dist/dist-6TY6L7OW.js +0 -1
  348. package/dist/environments-XVYTKHRZ.js +0 -1
  349. package/dist/error-SDU6RPQQ.js +0 -1
  350. package/dist/error-handler-4YEBBCUH.js +0 -1
  351. package/dist/is-global-5LFZDDNH.js +0 -1
  352. package/dist/lib-QJDPPAWN.js +0 -1
  353. package/dist/lib-UCG2DNMS.js +0 -1
  354. package/dist/local-VTYGIJVD.js +0 -1
  355. package/dist/local-storage-A6NBLBB2.js +0 -1
  356. package/dist/node-package-manager-N5SUT2WN.js +0 -1
  357. package/dist/notifications-system-P3SUTD25.js +0 -1
  358. package/dist/out-CDCY25QC.js +0 -1
  359. package/dist/system-OXF2P5CT.js +0 -1
  360. package/dist/ui-N2C5FC3G.js +0 -1
  361. package/dist/upgrade-AJ36IT7H.js +0 -1
  362. package/dist/version-DSFP332V.js +0 -1
  363. package/dist/version-HUOO3XOE.js +0 -1
@@ -2,4 +2,4 @@ import{a as X}from"./chunk-CRALWNNO.js";import{a as x,c as O,g as p}from"./chunk
2
2
  `).join(`
3
3
  `+m),e.push(l+"m+"+L.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=ye()+t+" "+e[0]}function ye(){return u.inspectOpts.hideDate?"":new Date().toISOString()+" "}function be(...e){return process.stderr.write(_.formatWithOptions(u.inspectOpts,...e)+`
4
4
  `)}function Oe(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function we(){return process.env.DEBUG}function ve(e){e.inspectOpts={};let t=Object.keys(u.inspectOpts);for(let r=0;r<t.length;r++)e.inspectOpts[t[r]]=u.inspectOpts[t[r]]}L.exports=k()(u);var{formatters:$}=L.exports;$.o=function(e){return this.inspectOpts.colors=this.useColors,_.inspect(e,this.inspectOpts).split(`
5
- `).map(t=>t.trim()).join(" ")};$.O=function(e){return this.inspectOpts.colors=this.useColors,_.inspect(e,this.inspectOpts)}});var Ee=O((ke,S)=>{p();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?S.exports=U():S.exports=V()});export{q as a,z as b,Ee as c};
5
+ `).map(t=>t.trim()).join(" ")};$.O=function(e){return this.inspectOpts.colors=this.useColors,_.inspect(e,this.inspectOpts)}});var Ee=O((ke,S)=>{p();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?S.exports=U():S.exports=V()});export{z as a,Ee as b};
@@ -1,4 +1,4 @@
1
- import{a as D}from"./chunk-TPGREOWO.js";import{b as ne,c as re}from"./chunk-TSEPNC3O.js";import{c as ee,d as te}from"./chunk-VCWESQBC.js";import{A as T}from"./chunk-XCGV3IJ5.js";import{a as Z}from"./chunk-UHIP5CFI.js";import{a as Q}from"./chunk-VJQJ5PTQ.js";import{Fa as X}from"./chunk-4MLEL3VK.js";import{b as Y,c as V}from"./chunk-NGCPVRDM.js";import{B as q,a as S,i as K,j as U,k as b,p as C}from"./chunk-EEEKSYWV.js";import{a as J}from"./chunk-WTRKTFVE.js";import{d as M}from"./chunk-IIFRDOYG.js";import{eb as O,fb as l,gb as s,ib as j,jb as G,kb as H,ma as N}from"./chunk-TB7HFPBB.js";import{f as z}from"./chunk-SZM6ANMN.js";import{d as I}from"./chunk-773TIA5M.js";import{r as ye}from"./chunk-T6CC5WUU.js";import{e as R,g as c}from"./chunk-VKWPEFWQ.js";c();c();c();c();c();var y=R(O(),1);import{Writable as oe}from"stream";function ie({selectedRun:e,abortController:t,app:o,extension:r,appWatcher:i}){let a={type:"functionRun",input:e.payload.input,output:e.payload.output,logs:e.payload.logs,name:e.source,size:0,memory_usage:0,instructions:e.payload.fuelConsumed},[u,f]=(0,y.useState)([]),[p,m]=(0,y.useState)([a,a]),[w,d]=(0,y.useState)(void 0),{input:E,export:$}=e.payload,[fe,L]=(0,y.useState)(`Watching for changes to ${e.source}...`);return(0,y.useEffect)(()=>{let A=new S;t.signal.addEventListener("abort",()=>{A.abort()});let B=async()=>{let F=await we(r,JSON.stringify(E),$);m(h=>[F,h[0]]),L(`Watching for changes to ${e.source}...`),f(h=>[...h,F])},de=async()=>{L("Replaying log with local function..."),await B()},ge=async()=>{i.onEvent(async h=>{let x=h.extensionEvents.find(v=>v.extension.handle===r.handle);if(!(!x||x.type!==ee.Updated)){if(x.buildResult?.status==="error"){d(`Error while reloading and building extension: ${x.buildResult?.error}`);return}d(void 0),L("Re-running with latest changes..."),await B()}});let F=new oe({write(h,x,v){f(he=>[...he,{type:"systemMessage",message:h.toString()}]),v()}});await i.start({stdout:F,stderr:F,signal:A.signal},!1)};return de().then(()=>{ge()}),()=>{A.abort()}},[E,$,o,r]),C(t.signal,async()=>{setTimeout(()=>{z()||J(process.pid,"SIGINT",!1,()=>{process.exit(0)})},2e3)}),{logs:u,statusMessage:fe,recentFunctionRuns:p,error:w}}async function we(e,t,o){let r="",i=new oe({write(u,f,p){r+=u,p()}});return await D({functionExtension:e,input:t,export:o,stdout:i,json:!0}),{...JSON.parse(r),type:"functionRun"}}var n=R(O(),1);var ae=({selectedRun:e,abortController:t,app:o,extension:r})=>{let{isAborted:i}=C(t.signal),{isRawModeSupported:a}=G(),u=new te(o),{logs:f,statusMessage:p,recentFunctionRuns:m,error:w}=ie({selectedRun:e,abortController:t,app:o,extension:r,appWatcher:u});return H((d,E)=>{U(d,E,()=>t.abort()),d==="q"&&t.abort()},{isActive:!!a}),n.default.createElement(n.default.Fragment,null,n.default.createElement(j,{items:f},(d,E)=>n.default.createElement(l,{key:`replayOutputScrollerLog${E}`,flexDirection:"column"},n.default.createElement(Se,{log:d}))),i?null:n.default.createElement(l,{marginY:1,paddingTop:1,flexDirection:"column",flexGrow:1,borderStyle:"single",borderBottom:!1,borderLeft:!1,borderRight:!1,borderTop:!0},a?n.default.createElement(l,{flexDirection:"column"},n.default.createElement(l,{flexDirection:"row"},n.default.createElement(s,null,b.pointerSmall," ",p)),n.default.createElement(Re,{recentFunctionRuns:m}),n.default.createElement(s,null,b.pointerSmall," Press ",n.default.createElement(s,{bold:!0},"q")," ",b.lineVertical," quit")):null,w?n.default.createElement(s,{color:"red"},w):null))};function k({title:e,backgroundColor:t}){let o=Math.max(Math.round((28-e.length)/2),0),r=" ".repeat(o);return n.default.createElement(s,{backgroundColor:t,color:"black"},`
1
+ import{a as D}from"./chunk-3XCIUG5P.js";import{b as ne,c as re}from"./chunk-BPDUBZMU.js";import{c as ee,d as te}from"./chunk-534U3DKZ.js";import{A as T}from"./chunk-QEL3F2NY.js";import{a as Z}from"./chunk-WDCCITSG.js";import{a as Q}from"./chunk-NENUUNWB.js";import{ta as X}from"./chunk-5HJTCBBV.js";import{b as Y,c as V}from"./chunk-4TANJ4JK.js";import{B as q,a as S,i as K,j as U,k as b,p as C}from"./chunk-JX4HSDDG.js";import{a as J}from"./chunk-W2357IN2.js";import{m as M}from"./chunk-2GB3EAD3.js";import{eb as O,fb as l,gb as s,ib as j,jb as G,kb as H,ma as N}from"./chunk-BCZMDFI2.js";import{f as z}from"./chunk-EQNJ2NQD.js";import{d as I}from"./chunk-773TIA5M.js";import{a as ye}from"./chunk-CTNBSUVU.js";import{e as R,g as c}from"./chunk-VKWPEFWQ.js";c();c();c();c();c();var y=R(O(),1);import{Writable as oe}from"stream";function ie({selectedRun:e,abortController:t,app:o,extension:r,appWatcher:i}){let a={type:"functionRun",input:e.payload.input,output:e.payload.output,logs:e.payload.logs,name:e.source,size:0,memory_usage:0,instructions:e.payload.fuelConsumed},[u,f]=(0,y.useState)([]),[p,m]=(0,y.useState)([a,a]),[w,d]=(0,y.useState)(void 0),{input:E,export:$}=e.payload,[fe,L]=(0,y.useState)(`Watching for changes to ${e.source}...`);return(0,y.useEffect)(()=>{let A=new S;t.signal.addEventListener("abort",()=>{A.abort()});let B=async()=>{let F=await we(r,JSON.stringify(E),$);m(h=>[F,h[0]]),L(`Watching for changes to ${e.source}...`),f(h=>[...h,F])},de=async()=>{L("Replaying log with local function..."),await B()},ge=async()=>{i.onEvent(async h=>{let x=h.extensionEvents.find(v=>v.extension.handle===r.handle);if(!(!x||x.type!==ee.Updated)){if(x.buildResult?.status==="error"){d(`Error while reloading and building extension: ${x.buildResult?.error}`);return}d(void 0),L("Re-running with latest changes..."),await B()}});let F=new oe({write(h,x,v){f(he=>[...he,{type:"systemMessage",message:h.toString()}]),v()}});await i.start({stdout:F,stderr:F,signal:A.signal},!1)};return de().then(()=>{ge()}),()=>{A.abort()}},[E,$,o,r]),C(t.signal,async()=>{setTimeout(()=>{z()||J(process.pid,"SIGINT",!1,()=>{process.exit(0)})},2e3)}),{logs:u,statusMessage:fe,recentFunctionRuns:p,error:w}}async function we(e,t,o){let r="",i=new oe({write(u,f,p){r+=u,p()}});return await D({functionExtension:e,input:t,export:o,stdout:i,json:!0}),{...JSON.parse(r),type:"functionRun"}}var n=R(O(),1);var ae=({selectedRun:e,abortController:t,app:o,extension:r})=>{let{isAborted:i}=C(t.signal),{isRawModeSupported:a}=G(),u=new te(o),{logs:f,statusMessage:p,recentFunctionRuns:m,error:w}=ie({selectedRun:e,abortController:t,app:o,extension:r,appWatcher:u});return H((d,E)=>{U(d,E,()=>t.abort()),d==="q"&&t.abort()},{isActive:!!a}),n.default.createElement(n.default.Fragment,null,n.default.createElement(j,{items:f},(d,E)=>n.default.createElement(l,{key:`replayOutputScrollerLog${E}`,flexDirection:"column"},n.default.createElement(Se,{log:d}))),i?null:n.default.createElement(l,{marginY:1,paddingTop:1,flexDirection:"column",flexGrow:1,borderStyle:"single",borderBottom:!1,borderLeft:!1,borderRight:!1,borderTop:!0},a?n.default.createElement(l,{flexDirection:"column"},n.default.createElement(l,{flexDirection:"row"},n.default.createElement(s,null,b.pointerSmall," ",p)),n.default.createElement(Re,{recentFunctionRuns:m}),n.default.createElement(s,null,b.pointerSmall," Press ",n.default.createElement(s,{bold:!0},"q")," ",b.lineVertical," quit")):null,w?n.default.createElement(s,{color:"red"},w):null))};function k({title:e,backgroundColor:t}){let o=Math.max(Math.round((28-e.length)/2),0),r=" ".repeat(o);return n.default.createElement(s,{backgroundColor:t,color:"black"},`
2
2
 
3
3
  `,r,e,r,`
4
4
  `)}function Ee({input:e}){return n.default.createElement(l,{flexDirection:"column"},n.default.createElement(k,{title:"Input",backgroundColor:"yellow"}),n.default.createElement(s,null,T(e)))}function Fe({logs:e}){return n.default.createElement(l,{flexDirection:"column"},n.default.createElement(k,{title:"Logs",backgroundColor:"blueBright"}),n.default.createElement(s,null,e))}function xe({output:e}){return n.default.createElement(l,{flexDirection:"column"},n.default.createElement(k,{title:"Output",backgroundColor:"greenBright"}),n.default.createElement(s,null,T(e)))}function be({functionRun:e}){return n.default.createElement(l,{flexDirection:"column"},n.default.createElement(k,{title:"Benchmark Results",backgroundColor:"green"}),n.default.createElement(s,null,"Name: ",e.name),n.default.createElement(s,null,"Linear Memory Usage: ",e.memory_usage,"KB"),n.default.createElement(s,null,"Instructions: ",e.instructions/1e3,"K"),n.default.createElement(s,null,"Size: ",e.size,"KB"))}function Re({recentFunctionRuns:e}){let t=e[0].instructions-e[1].instructions;return n.default.createElement(l,{flexDirection:"column"},n.default.createElement(s,null,b.pointerSmall," Instruction count change: ",t>0?"+":"",t))}function Se({log:e}){switch(e.type){case"functionRun":return n.default.createElement(l,{flexDirection:"column"},n.default.createElement(Ee,{input:e.input}),n.default.createElement(Fe,{logs:e.logs}),n.default.createElement(xe,{output:e.output}),n.default.createElement(be,{functionRun:e}),n.default.createElement(s,null,"\xA0"));case"systemMessage":return n.default.createElement(s,null,e.message);default:return null}}var se=R(O(),1);async function ce({selectedRun:e,abortController:t,app:o,extension:r}){return K(se.default.createElement(ae,{selectedRun:e,abortController:t,app:o,extension:r}),{exitOnCtrlC:!1})}c();async function le(e){if(e.length===0)return;let t=i=>({label:`${i.logTimestamp} (${i.status}) - ${i.identifier}`,value:i}),o=e.map(t);return await q({message:"Which function run would you like to replay locally?",choices:o})}import{existsSync as Ce,readdirSync as De}from"fs";var _=100;async function ue(e){let{watch:t,extension:o,app:r}=e,i=new S;try{let a=r.getLogsDir(),u=e.log?await ke(a,o.handle,e.log):await Ae(a,o.handle),{input:f,export:p}=u.payload;t?await ce({selectedRun:u,abortController:i,app:r,extension:o}):await D({functionExtension:o,json:e.json,input:JSON.stringify(f),export:p})}catch(a){throw i.abort(),a}}async function ke(e,t,o){let r=await Le(e,t,o);if(r===void 0)throw new M(`No log found for '${o}'.
@@ -1,3 +1,3 @@
1
- import{a as R}from"./chunk-VJEKDBGZ.js";import{e as l}from"./chunk-EEEKSYWV.js";import{f as I}from"./chunk-7AY6HLQG.js";import{d as n}from"./chunk-IIFRDOYG.js";import{Ea as b,Fb as a,Hb as s,Pb as f,Ta as G,Wa as C}from"./chunk-TB7HFPBB.js";import{a as k,r as w}from"./chunk-SZM6ANMN.js";import{q as g}from"./chunk-773TIA5M.js";import{e as D,g as $}from"./chunk-VKWPEFWQ.js";$();var A=D(R());async function r(t,e){try{return(await l("git",t,{cwd:e})).stdout}catch(o){if(o instanceof Error){let i=new n(o.message);throw i.stack=o.stack,"exitCode"in o&&Object.assign(i,{exitCode:o.exitCode}),i}throw o}}async function K(t,e="main"){f(s`Initializing git repository at ${a.path(t)}...`),await h(),await r(["init"],t),await r(["checkout","-b",e],t)}async function Q(t,e){try{return(await r(["check-ignore",...e],t)).split(`
1
+ import{a as R}from"./chunk-VJEKDBGZ.js";import{e as l}from"./chunk-JX4HSDDG.js";import{f as I}from"./chunk-STCLJWHD.js";import{m as n}from"./chunk-2GB3EAD3.js";import{Ea as b,Fb as a,Hb as s,Pb as f,Ta as G,Wa as C}from"./chunk-BCZMDFI2.js";import{a as k,q as w}from"./chunk-EQNJ2NQD.js";import{q as g}from"./chunk-773TIA5M.js";import{e as D,g as $}from"./chunk-VKWPEFWQ.js";$();var A=D(R());async function r(t,e){try{return(await l("git",t,{cwd:e})).stdout}catch(o){if(o instanceof Error){let i=new n(o.message);throw i.stack=o.stack,"exitCode"in o&&Object.assign(i,{exitCode:o.exitCode}),i}throw o}}async function K(t,e="main"){f(s`Initializing git repository at ${a.path(t)}...`),await h(),await r(["init"],t),await r(["checkout","-b",e],t)}async function Q(t,e){try{return(await r(["check-ignore",...e],t)).split(`
2
2
  `).filter(Boolean)}catch(o){if(o instanceof n&&"exitCode"in o&&o.exitCode===1)return[];throw o}}async function V(t){return I("cmd_all_timing_network_ms")(async()=>{let{repoUrl:e,destination:o,shallow:i,latestTag:m}=t;if(f(s`Git-cloning repository ${e} into ${a.path(o)}...`),await h(),await G(o)){if(!await b(o))throw new n(s`Can't clone to ${a.path(o)}`,"The path exists but isn't a directory.");if((await C(["*",".*"],{cwd:o,deep:1,onlyFiles:!1})).length>0)throw new n(s`Directory ${a.path(o)} already exists and is not empty`,s`Choose a different name or remove the existing directory first.`)}let[v,d]=e.split("#");if(d&&m)throw new n("Error cloning the repository. Git can't clone the latest release with a 'branch'.");if(i&&m)throw new n("Error cloning the repository. Git can't clone the latest release with the 'shallow' property.");let u=["clone","--recurse-submodules"];d&&u.push("--branch",d),i&&u.push("--depth","1"),k()||u.push("-c","core.askpass=true"),u.push(v,o);try{if(await l("git",u),m){let c=await S(o,e);await r(["checkout",c],o)}}catch(c){if(c instanceof n)throw c;if(c instanceof Error){let x=new n(c.message);throw x.stack=c.stack,x}throw c}})}async function S(t,e){let o=await F(t);if(!o)throw new n(`Couldn't obtain the most recent tag of the repository ${e}`);return o}async function X(t){let o=await r(["log","-1","--format=%H%x00%ai%x00%s%x00%D%x00%b%x00%an%x00%ae"],t);if(!o.trim())throw new n("Must have at least one commit to run command",s`Run ${a.genericShellCommand("git commit -m 'Initial commit'")} to create your first commit.`);let i=o.split("\0");return{hash:i[0],date:i[1],message:i[2],refs:i[3],body:i[4],author_name:i[5],author_email:i[6]}}async function Y(t){await r(["add","--all"],t)}async function Z(t,e){let o=["commit","-m",t];return e?.author&&o.push("--author",e.author),await r(o,e?.directory),(await r(["rev-parse","HEAD"],e?.directory)).trim()}async function h(){if(!await w())throw new n("Git is necessary in the environment to continue",s`Install ${a.link("git","https://git-scm.com/book/en/v2/Getting-Started-Installing-Git")}`)}var p=class extends n{};async function N(t){if(await h(),!await E(t))throw new p(`${a.path(t??g())} is not a Git directory`)}async function tt(t){return await w()?E(t):!1}async function E(t){try{return await l("git",["rev-parse","--git-dir"],{cwd:t}),!0}catch(e){if(e instanceof Error&&"exitCode"in e&&e.exitCode===128)return!1;throw e}}var y=class extends n{};async function et(t){if(!await T(t))throw new y(`${a.path(t??g())} is not a clean Git directory`)}async function T(t){return(await r(["status","--porcelain"],t)).trim()===""}async function F(t){try{return(await r(["describe","--tags","--abbrev=0"],t)).trim()||void 0}catch(e){if(e instanceof n&&"exitCode"in e&&e.exitCode===128)return;throw e}}async function ot(t,e="origin"){if(f(s`Removing git remote ${e} from ${a.path(t)}...`),await h(),!(await r(["remote"],t)).split(`
3
3
  `).filter(Boolean).includes(e)){f(s`Remote ${e} does not exist, no action needed`);return}await r(["remote","remove",e],t)}export{K as a,Q as b,V as c,X as d,Y as e,Z as f,N as g,tt as h,y as i,et as j,T as k,ot as l};
@@ -1,4 +1,4 @@
1
- import{a as L}from"./chunk-RE652L3G.js";import{a as M}from"./chunk-UHIP5CFI.js";import{a as C}from"./chunk-VJQJ5PTQ.js";import{F as j,Fa as E}from"./chunk-4MLEL3VK.js";import{e as I}from"./chunk-WN5VTUWJ.js";import{a as J}from"./chunk-5VRU3BT5.js";import{R as h,da as g,ga as A,z as y}from"./chunk-TIU7MMRT.js";import{b as O}from"./chunk-NGCPVRDM.js";import{D,E as f,u as T}from"./chunk-EEEKSYWV.js";import{g as R}from"./chunk-IIFRDOYG.js";import{Fb as k,Hb as m,Mb as v}from"./chunk-TB7HFPBB.js";import{r as z}from"./chunk-T6CC5WUU.js";import{e as _,g as s}from"./chunk-VKWPEFWQ.js";s();s();s();var P={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"metafieldDefinitions"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"ownerType"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"MetafieldOwnerType"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"metafieldDefinitions"},arguments:[{kind:"Argument",name:{kind:"Name",value:"ownerType"},value:{kind:"Variable",name:{kind:"Name",value:"ownerType"}}},{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"30"}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"endCursor"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"MetafieldForImport"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"MetafieldForImport"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"MetafieldDefinition"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"key"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"namespace"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"type"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"category"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}},{kind:"Field",name:{kind:"Name",value:"access"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin"}},{kind:"Field",name:{kind:"Name",value:"storefront"}},{kind:"Field",name:{kind:"Name",value:"customerAccount"}}]}},{kind:"Field",name:{kind:"Name",value:"capabilities"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"adminFilterable"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"enabled"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"validations"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"value"}}]}}]}}]};s();async function Q(e){let i="Admin",n=I(e.storeFqdn,"unstable");return{token:e.token,api:i,url:n}}async function w(e){return A({query:e.query,...await Q(e.session),variables:e.variables,autoRateLimitRestore:e.autoRateLimitRestore})}s();var V={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"metaobjectDefinitions"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"metaobjectDefinitions"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"10"}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"endCursor"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"MetaobjectForImport"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"MetaobjectForImport"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"MetaobjectDefinition"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"access"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin"}},{kind:"Field",name:{kind:"Name",value:"storefront"}}]}},{kind:"Field",name:{kind:"Name",value:"displayNameKey"}},{kind:"Field",name:{kind:"Name",value:"capabilities"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"publishable"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"enabled"}}]}},{kind:"Field",name:{kind:"Name",value:"translatable"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"enabled"}}]}},{kind:"Field",name:{kind:"Name",value:"renderable"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"enabled"}},{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"metaTitleKey"}},{kind:"Field",name:{kind:"Name",value:"metaDescriptionKey"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"fieldDefinitions"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"key"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"type"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"category"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"required"}},{kind:"Field",name:{kind:"Name",value:"validations"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"value"}}]}}]}}]}}]};var $=_(J(),1);var Z={article:"ARTICLE",blog:"BLOG",collection:"COLLECTION",company:"COMPANY",company_location:"COMPANY_LOCATION",location:"LOCATION",market:"MARKET",order:"ORDER",page:"PAGE",product:"PRODUCT",customer:"CUSTOMER",delivery_customization:"DELIVERY_CUSTOMIZATION",delivery_method:"DELIVERY_METHOD",delivery_option_generator:"DELIVERY_OPTION_GENERATOR",discount:"DISCOUNT",draft_order:"DRAFTORDER",fulfillment_constraint_rule:"FULFILLMENT_CONSTRAINT_RULE",gift_card_transaction:"GIFT_CARD_TRANSACTION",order_routing_location_rule:"ORDER_ROUTING_LOCATION_RULE",payment_customization:"PAYMENT_CUSTOMIZATION",selling_plan:"SELLING_PLAN",shop:"SHOP",validation:"VALIDATION",variant:"PRODUCTVARIANT",cart_transform:"CARTTRANSFORM"};async function q({query:e,session:i,toNodes:n,toVariables:t,performQuery:d=a=>w({query:e,session:i,variables:a,autoRateLimitRestore:!0})}){let a;try{let o=n(await d(t(a))),l=[];for(l.push(...o.nodes);o.pageInfo.hasNextPage;)a=o.pageInfo.endCursor,o=n(await d(t(a))),l.push(...o.nodes);return{status:"ok",items:l}}catch(o){if(o instanceof Error&&o.message.includes("ACCESS_DENIED"))return{status:"scope_error"};throw o}}function x(e,i){let n="";for(let t of e)n=(0,$.updateTomlValues)(n,t);return`# ${i}
1
+ import{a as L}from"./chunk-EZBB2ULE.js";import{a as M}from"./chunk-WDCCITSG.js";import{a as C}from"./chunk-NENUUNWB.js";import{C as j,ta as E}from"./chunk-5HJTCBBV.js";import{e as I}from"./chunk-4BPFJDH3.js";import{a as J}from"./chunk-WE3VLC2S.js";import{b as O}from"./chunk-4TANJ4JK.js";import{R as h,da as g,ga as A,y}from"./chunk-AFM3UZQO.js";import{D,E as f,u as T}from"./chunk-JX4HSDDG.js";import{p as R}from"./chunk-2GB3EAD3.js";import{Fb as k,Hb as m,Mb as v}from"./chunk-BCZMDFI2.js";import{a as z}from"./chunk-CTNBSUVU.js";import{e as _,g as s}from"./chunk-VKWPEFWQ.js";s();s();s();var P={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"metafieldDefinitions"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"ownerType"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"MetafieldOwnerType"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"metafieldDefinitions"},arguments:[{kind:"Argument",name:{kind:"Name",value:"ownerType"},value:{kind:"Variable",name:{kind:"Name",value:"ownerType"}}},{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"30"}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"endCursor"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"MetafieldForImport"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"MetafieldForImport"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"MetafieldDefinition"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"key"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"namespace"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"type"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"category"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}},{kind:"Field",name:{kind:"Name",value:"access"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin"}},{kind:"Field",name:{kind:"Name",value:"storefront"}},{kind:"Field",name:{kind:"Name",value:"customerAccount"}}]}},{kind:"Field",name:{kind:"Name",value:"capabilities"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"adminFilterable"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"enabled"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"validations"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"value"}}]}}]}}]};s();async function Q(e){let i="Admin",n=I(e.storeFqdn,"unstable");return{token:e.token,api:i,url:n}}async function w(e){return A({query:e.query,...await Q(e.session),variables:e.variables,autoRateLimitRestore:e.autoRateLimitRestore})}s();var V={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"metaobjectDefinitions"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"metaobjectDefinitions"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"10"}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"endCursor"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"MetaobjectForImport"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"MetaobjectForImport"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"MetaobjectDefinition"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"access"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin"}},{kind:"Field",name:{kind:"Name",value:"storefront"}}]}},{kind:"Field",name:{kind:"Name",value:"displayNameKey"}},{kind:"Field",name:{kind:"Name",value:"capabilities"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"publishable"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"enabled"}}]}},{kind:"Field",name:{kind:"Name",value:"translatable"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"enabled"}}]}},{kind:"Field",name:{kind:"Name",value:"renderable"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"enabled"}},{kind:"Field",name:{kind:"Name",value:"data"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"metaTitleKey"}},{kind:"Field",name:{kind:"Name",value:"metaDescriptionKey"}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"fieldDefinitions"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"key"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"type"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"category"}},{kind:"Field",name:{kind:"Name",value:"name"}}]}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"required"}},{kind:"Field",name:{kind:"Name",value:"validations"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"value"}}]}}]}}]}}]};var $=_(J(),1);var Z={article:"ARTICLE",blog:"BLOG",collection:"COLLECTION",company:"COMPANY",company_location:"COMPANY_LOCATION",location:"LOCATION",market:"MARKET",order:"ORDER",page:"PAGE",product:"PRODUCT",customer:"CUSTOMER",delivery_customization:"DELIVERY_CUSTOMIZATION",delivery_method:"DELIVERY_METHOD",delivery_option_generator:"DELIVERY_OPTION_GENERATOR",discount:"DISCOUNT",draft_order:"DRAFTORDER",fulfillment_constraint_rule:"FULFILLMENT_CONSTRAINT_RULE",gift_card_transaction:"GIFT_CARD_TRANSACTION",order_routing_location_rule:"ORDER_ROUTING_LOCATION_RULE",payment_customization:"PAYMENT_CUSTOMIZATION",selling_plan:"SELLING_PLAN",shop:"SHOP",validation:"VALIDATION",variant:"PRODUCTVARIANT",cart_transform:"CARTTRANSFORM"};async function q({query:e,session:i,toNodes:n,toVariables:t,performQuery:d=a=>w({query:e,session:i,variables:a,autoRateLimitRestore:!0})}){let a;try{let o=n(await d(t(a))),l=[];for(l.push(...o.nodes);o.pageInfo.hasNextPage;)a=o.pageInfo.endCursor,o=n(await d(t(a))),l.push(...o.nodes);return{status:"ok",items:l}}catch(o){if(o instanceof Error&&o.message.includes("ACCESS_DENIED"))return{status:"scope_error"};throw o}}function x(e,i){let n="";for(let t of e)n=(0,$.updateTomlValues)(n,t);return`# ${i}
2
2
  ${n}`}function X(e,i){let n=i.map(le).map(a=>{switch(a.status){case"ok":{let{typeName:o,patches:l}=a;return x(l,`type: $app:${o}`)}case"not_app_reserved":return null}}).filter(a=>a!==null),t=e.flatMap(({items:a,ownerType:o,graphQLOwner:l})=>a.map(r=>({result:oe(r,o),graphQLOwner:l}))).map(({result:a,graphQLOwner:o})=>{switch(a.status){case"ok":{let{namespace:l,key:r,patches:b}=a;return x(b,`namespace: ${l==="app"?"$app":`$app:${l}`} key: ${r} owner_type: ${o}`)}case"not_app_reserved":return null}}).filter(a=>a!==null);return{tomlContent:[...n,...t].join(`
3
3
  `),metafieldCount:t.length,metaobjectCount:n.length}}async function K(e){let i=await de(e),n=i.storeFqdn,t=await ne(i),d=await ie(i);e.includeExistingDeclaredDefinitions||(t=te(t,e.appConfiguration),d=ae(d,e.appConfiguration));let{tomlContent:a,metafieldCount:o,metaobjectCount:l}=X(t,d);ee(o,l,n,a)}function ee(e,i,n,t){T({headline:"Conversion to TOML complete.",body:["Converted",{warn:`${e} metafields`},"and",{warn:`${i} metaobjects`},"from",{warn:n},"into TOML, ready for you to copy."],orderedNextSteps:!0,nextSteps:["Review the suggested TOML carefully before applying.",["Missing sections? Make sure your app has the required access scopes to load metafields and metaobjects (e.g.",{command:"read_customers"},"to load customer metafields,",{command:"read_metaobject_definitions"},"to load metaobjects.)"],["Missing definitions? Only metafields and metaobjects that are app-reserved (using",{command:"$app"},") will be converted."],["When you're ready, add the generated TOML to your app's configuration file and test out changes with the",{command:"shopify app dev"},"command."]]}),ue(t)}async function ne(e){let i=[];return await D(Object.entries(Z).map(([n,t])=>({title:m`Loading ${k.green(n)} metafields`,task:async()=>{let d=await q({query:P,session:e,toNodes:a=>a.metafieldDefinitions,toVariables:a=>({ownerType:t,after:a})});i.push({metafields:d,ownerType:n,graphQLOwner:t})}}))),i.map(({metafields:n,ownerType:t,graphQLOwner:d})=>n.status==="ok"?{ownerType:t,items:n.items,graphQLOwner:d}:null).filter(n=>n!==null)}async function ie(e){let i=await f({title:m`Loading ${k.green("metaobjects")}`,task:async()=>q({query:V,session:e,toNodes:n=>n.metaobjectDefinitions,toVariables:n=>({after:n})})});return i.status==="ok"?i.items:[]}function te(e,i){return e.map(n=>{let t=n.items.filter(d=>!U(i,[n.ownerType,"metafields",p(d.namespace)??"",d.key]));return t.length>0?{...n,items:t}:null}).filter(n=>n!==null)}function ae(e,i){return e.filter(n=>!U(i,["metaobjects","app",p(n.type)??""]))}function U(e,i){let n=e;for(let t of i){if(!n[t])return!1;n=n[t]}return!0}async function de(e){let{remoteApp:i,store:n}=e,t=i.apiSecretKeys[0]?.secret;if(!t)throw new R("No API secret keys found for app");return await h(n.shopDomain,i.apiKey,t)}function p(e){if(!e.match(/^app--\d+/))return null;let i="app";return e.match(/^app--\d+--/)&&(i=e.replace(/^app--\d+--/,"")),i}function oe(e,i){let n=p(e.namespace);if(!n)return{status:"not_app_reserved"};let t=e.key,d=se(e),a=me(d,i,n,t);return{status:"ok",key:t,namespace:n,patches:a}}function le(e){let i=p(e.type);if(!i)return{status:"not_app_reserved"};let n=re(e,i),t=ce(n,i);return{status:"ok",typeName:i,patches:t}}function se(e){let i={name:e.name===e.key?void 0:e.name,type:e.type.name,description:e.description??void 0,capabilities:u({admin_filterable:e.capabilities.adminFilterable.enabled||void 0}),access:u({admin:Y(e.access.admin),storefront:H(e.access.storefront),customer_account:pe(e.access.customerAccount)}),validations:B(e.validations)},{type:n,validations:t}=G(i.type,i.validations);return i.type=n,i.validations=t,i}function re(e,i){return{name:e.name===i?void 0:e.name,description:e.description??void 0,display_name_field:e.displayNameKey??void 0,access:u({admin:Y(e.access.admin),storefront:H(e.access.storefront)}),capabilities:u({translatable:e.capabilities.translatable.enabled||void 0,publishable:e.capabilities.publishable.enabled||void 0,renderable:e.capabilities.renderable?.enabled||void 0,renderable_meta_title_field:e.capabilities.renderable?.data?.metaTitleKey??void 0,renderable_meta_description_field:e.capabilities.renderable?.data?.metaDescriptionKey??void 0}),fields:Object.fromEntries(e.fieldDefinitions.map(n=>{let t={type:n.type.name,description:n.description??void 0,name:n.name===n.key?void 0:n.name,required:n.required||void 0,validations:B(n.validations)},{type:d,validations:a}=G(t.type,t.validations);return t.type=d,t.validations=a,[n.key,t]}))}}function G(e,i){if(!i)return{type:e,validations:void 0};if(i.metaobject_definition_type&&typeof i.metaobject_definition_type=="string"){let n=p(i.metaobject_definition_type);return{type:`${e}<$app:${n}>`,validations:u({...i,metaobject_definition_type:void 0})}}if(i.metaobject_definition_types&&Array.isArray(i.metaobject_definition_types)&&i.metaobject_definition_types.every(n=>typeof n=="string")){let n=i.metaobject_definition_types.map(t=>p(t));return{type:`${e}<${n.map(t=>`$app:${t}`).join(",")}>`,validations:u({...i,metaobject_definition_types:void 0})}}return{type:e,validations:i}}function B(e){let i=n=>{try{return JSON.parse(n)}catch{return n}};return u(Object.fromEntries(e.filter(n=>n.value!==void 0&&n.name!=="metaobject_definition_id"&&n.name!=="metaobject_definition_ids").map(n=>[n.name,n.value?i(n.value):void 0])))}function me(e,i,n,t){let d=[[[i,"metafields",n,t,"name"],e.name],[[i,"metafields",n,t,"type"],e.type],[[i,"metafields",n,t,"description"],e.description]],a=[[[i,"metafields",n,t,"access","admin"],e.access?.admin],[[i,"metafields",n,t,"access","storefront"],e.access?.storefront],[[i,"metafields",n,t,"access","customer_account"],e.access?.customer_account],[[i,"metafields",n,t,"capabilities","admin_filterable"],e.capabilities?.admin_filterable||void 0]];return e.validations&&W(e.validations).forEach(({validationKey:l,actualValue:r})=>{d.push([[i,"metafields",n,t,"validations",l],r])}),[N(d),N(a)]}function ce(e,i){let n=[[["metaobjects","app",i,"name"],e.name===i?void 0:e.name],[["metaobjects","app",i,"description"],e.description],[["metaobjects","app",i,"display_name_field"],e.display_name_field]],t=[[["metaobjects","app",i,"access","admin"],e.access?.admin],[["metaobjects","app",i,"access","storefront"],e.access?.storefront]];return e.capabilities?.translatable&&t.push([["metaobjects","app",i,"capabilities","translatable"],!0]),e.capabilities?.publishable&&t.push([["metaobjects","app",i,"capabilities","publishable"],!0]),e.capabilities?.renderable&&(t.push([["metaobjects","app",i,"capabilities","renderable"],!0]),e.capabilities?.renderable_meta_title_field&&t.push([["metaobjects","app",i,"capabilities","renderable_meta_title_field"],e.capabilities.renderable_meta_title_field]),e.capabilities?.renderable_meta_description_field&&t.push([["metaobjects","app",i,"capabilities","renderable_meta_description_field"],e.capabilities.renderable_meta_description_field])),Object.entries(e.fields).forEach(([d,a])=>{if(typeof a=="string")n.push([["metaobjects","app",i,"fields",d],a]);else{let o=Object.fromEntries(Object.entries(a).filter(([l,r])=>r!==void 0));Object.keys(o).length===1?n.push([["metaobjects","app",i,"fields",d],a.type]):(n.push([["metaobjects","app",i,"fields",d,"type"],a.type]),n.push([["metaobjects","app",i,"fields",d,"description"],a.description]),n.push([["metaobjects","app",i,"fields",d,"name"],a.name]),n.push([["metaobjects","app",i,"fields",d,"required"],a.required||void 0]),a.validations&&W(a.validations).forEach(({validationKey:r,actualValue:b})=>{n.push([["metaobjects","app",i,"fields",d,"validations",r],b])}))}}),[N(n),N(t)]}function W(e){return Object.entries(e).map(([i,n])=>{let t;return typeof n=="string"||typeof n=="number"||typeof n=="boolean"||Array.isArray(n)&&n.every(d=>typeof d=="string")?t=n:t=JSON.stringify(n),{validationKey:i,actualValue:t}})}function ue(e){let i=e.split(`
4
4
  `);for(let n of i)n.match(/^\s*\[/)?v(m`${k.green(n)}`):n.match(/^\s*#/)?v(m`${k.gray(n)}`):v(m`${n}`)}function Y(e){switch(e){case"MERCHANT_READ_WRITE":return"merchant_read_write";case"MERCHANT_READ":case"PRIVATE":case"PUBLIC_READ":case"PUBLIC_READ_WRITE":case null:case void 0:return}}function H(e){switch(e){case"PUBLIC_READ":return"public_read";case"NONE":case null:case void 0:return}}function pe(e){switch(e){case"READ":return"read";case"READ_WRITE":return"read_write";case"NONE":case null:case void 0:return}}function u(e){if(e&&!g(e)&&!(typeof e=="object"&&Object.values(e).every(i=>i===void 0)))return e}function N(e){return e.filter(([i,n])=>n!==void 0)}var S=_(z(),1);var F,c=class extends M{async run(){let{appContextResult:i,...n}=await f({title:m`Loading application`,task:async()=>{let{flags:t}=await this.parse(F);await j(t.path);let d=await E({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config}),a=await L({appContextResult:d,storeFqdn:t.store,forceReselectStore:t.reset});return{appContextResult:d,appConfiguration:d.app.configuration,remoteApp:d.remoteApp,store:a,includeExistingDeclaredDefinitions:t["include-existing"]}}});return await K(n),{app:i.app}}};F=c;c.summary="Import metafield and metaobject definitions.";c.descriptionWithMarkdown="Import metafield and metaobject definitions from your development store. [Read more about declarative custom data definitions](https://shopify.dev/docs/apps/build/custom-data/declarative-custom-data-definitions).";c.description=F.descriptionWithoutMarkdown();c.flags={...O,...C,store:S.Flags.string({char:"s",description:"Store URL. Must be an existing development or Shopify Plus sandbox store.",env:"SHOPIFY_FLAG_STORE",parse:async e=>y(e)}),"include-existing":S.Flags.boolean({description:"Include existing declared definitions in the output.",default:!1,env:"SHOPIFY_FLAG_INCLUDE_EXISTING"})};var Ke=c;export{Ke as a};
@@ -1 +1 @@
1
- import{a as d}from"./chunk-NVA2354A.js";import{a as m}from"./chunk-UHIP5CFI.js";import{a as p}from"./chunk-VJQJ5PTQ.js";import{Fa as s}from"./chunk-4MLEL3VK.js";import{b as n}from"./chunk-NGCPVRDM.js";import{Lb as r}from"./chunk-TB7HFPBB.js";import{g as i}from"./chunk-VKWPEFWQ.js";i();var o,t=class extends m{async run(){let{flags:a}=await this.parse(o),{app:e,remoteApp:l,organization:c}=await s({directory:a.path,clientId:a["client-id"],forceRelink:a.reset,userProvidedConfigName:a.config});return r(await d(e,l,c)),{app:e}}};o=t;t.summary="Display app and extensions environment variables.";t.descriptionWithMarkdown="Displays environment variables that can be used to deploy apps and app extensions.";t.description=o.descriptionWithoutMarkdown();t.flags={...n,...p};var w=t;export{w as a};
1
+ import{a as d}from"./chunk-K4M32VKU.js";import{a as m}from"./chunk-WDCCITSG.js";import{a as p}from"./chunk-NENUUNWB.js";import{ta as s}from"./chunk-5HJTCBBV.js";import{b as n}from"./chunk-4TANJ4JK.js";import{Lb as r}from"./chunk-BCZMDFI2.js";import{g as i}from"./chunk-VKWPEFWQ.js";i();var o,t=class extends m{async run(){let{flags:a}=await this.parse(o),{app:e,remoteApp:l,organization:c}=await s({directory:a.path,clientId:a["client-id"],forceRelink:a.reset,userProvidedConfigName:a.config});return r(await d(e,l,c)),{app:e}}};o=t;t.summary="Display app and extensions environment variables.";t.descriptionWithMarkdown="Displays environment variables that can be used to deploy apps and app extensions.";t.description=o.descriptionWithoutMarkdown();t.flags={...n,...p};var w=t;export{w as a};
@@ -1 +1 @@
1
- import{b as u,c as h,f}from"./chunk-4MLEL3VK.js";import{O as c}from"./chunk-EEEKSYWV.js";import{d as e}from"./chunk-773TIA5M.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();async function s(n){if(n.features.includes("function")&&n.isJavaScript){let r=await f(n);return u(r.functionRunner)}return u()}function d(n){return n.configuration.build?.path?e(n.directory,n.configuration.build.path):n.outputPath}async function g(n){let r=n.functionExtension,i=await s(r);await h(i);let t=[];n.inputPath&&t.push("--input",n.inputPath),n.export&&t.push("--export",n.export),n.json&&t.push("--json"),n.schemaPath&&n.queryPath&&(t.push("--schema-path",n.schemaPath),t.push("--query-path",n.queryPath));let o=d(r);return c(i.path,["-f",o,...t],{cwd:n.functionExtension.directory,stdin:n.stdin,stdout:n.stdout??"inherit",stderr:n.stderr??"inherit",input:n.input})}export{g as a};
1
+ import{b as u,c as h,f}from"./chunk-5HJTCBBV.js";import{O as c}from"./chunk-JX4HSDDG.js";import{d as e}from"./chunk-773TIA5M.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();async function s(n){if(n.features.includes("function")&&n.isJavaScript){let r=await f(n);return u(r.functionRunner)}return u()}function d(n){return n.configuration.build?.path?e(n.directory,n.configuration.build.path):n.outputPath}async function g(n){let r=n.functionExtension,i=await s(r);await h(i);let t=[];n.inputPath&&t.push("--input",n.inputPath),n.export&&t.push("--export",n.export),n.json&&t.push("--json"),n.schemaPath&&n.queryPath&&(t.push("--schema-path",n.schemaPath),t.push("--query-path",n.queryPath));let o=d(r);return c(i.path,["-f",o,...t],{cwd:n.functionExtension.directory,stdin:n.stdin,stdout:n.stdout??"inherit",stderr:n.stderr??"inherit",input:n.input})}export{g as a};
@@ -0,0 +1,3 @@
1
+ import{a as ce}from"./chunk-YHH3JA36.js";import{d as de}from"./chunk-4TANJ4JK.js";import{a as ue,b as me}from"./chunk-WHT2RCAD.js";import{F as L,O as U,a as ee,sa as te,ua as N,va as re,y as w}from"./chunk-AFM3UZQO.js";import{b as x}from"./chunk-6KAWCN3I.js";import{A as ie,a as Z,t as se,w as R,x as I}from"./chunk-JX4HSDDG.js";import{d as oe,e as ne}from"./chunk-STCLJWHD.js";import{m as F,p as ae}from"./chunk-2GB3EAD3.js";import{Fa as X,Fb as q,Hb as l,Pb as h,Ua as _}from"./chunk-BCZMDFI2.js";import{d as Q,f as k,i as V,q as $}from"./chunk-773TIA5M.js";import{a as Ie}from"./chunk-CTNBSUVU.js";import{e as Te,g as f}from"./chunk-VKWPEFWQ.js";f();var T=Te(Ie(),1);var O={path:T.Flags.string({description:"The path where you want to run the command. Defaults to the current working directory.",env:"SHOPIFY_FLAG_PATH",parse:async t=>{let e=k(t);return _(e)?X(e)?e:(I({headline:"The path must be a directory, not a file.",body:[`The provided path is not a directory: ${e}`,`Did you mean: ${V(e)}`]}),process.exit(1)):(I({headline:"A path was explicitly provided but doesn't exist.",body:[`Please check the path and try again: ${e}`]}),process.exit(1))},default:async()=>$(),noCacheDefault:!0}),password:T.Flags.string({description:"Password generated from the Theme Access app or an Admin API token.",env:"SHOPIFY_CLI_THEME_TOKEN"}),store:T.Flags.string({char:"s",description:"Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).",env:"SHOPIFY_FLAG_STORE",parse:async t=>w(t)}),environment:T.Flags.string({char:"e",description:"The environment to apply to the current command.",env:"SHOPIFY_FLAG_ENVIRONMENT",multiple:!0})},pe="Wrap the value in double quotes if you're using wildcards.",qe=t=>({only:T.Flags.string({char:"o",multiple:!0,description:`${t.charAt(0).toUpperCase()+t.slice(1)} only the specified files (Multiple flags allowed). ${pe}`,env:"SHOPIFY_FLAG_ONLY"}),ignore:T.Flags.string({char:"x",multiple:!0,description:`Skip ${t}ing the specified files (Multiple flags allowed). ${pe}`,env:"SHOPIFY_FLAG_IGNORE"})});f();f();import{AsyncLocalStorage as _e}from"node:async_hooks";var fe=new _e,j,D,M,B;function S(){return j??(j=new x({projectName:"shopify-cli-theme-conf"})),j}function G(){return D??(D=new x({projectName:"shopify-cli-development-theme-config"})),D}function H(){return M??(M=new x({projectName:"shopify-cli-repl-theme-config"})),M}function z(){return B??(B=new x({projectName:"shopify-cli-theme-store-password"})),B}function Y(t=S()){return fe.getStore()?.store??t.get("themeStore")}function he(t,e=S()){e.set("themeStore",t)}function He(t=S()){return h(l`Getting development theme...`),G().get(v(t))}function ze(t,e=S()){h(l`Setting development theme...`),G().set(v(e),t)}function Ye(t=S()){h(l`Removing development theme...`),G().delete(v(t))}function Je(t=S()){return h(l`Getting REPL theme...`),H().get(v(t))}function We(t,e=S()){h(l`Setting REPL theme to ${t}...`),H().set(v(e),t)}function Ke(t=S()){h(l`Removing REPL theme...`),H().delete(v(t))}function Qe(t=S()){let e=v(t);return h(l`Getting storefront password for shop ${e}...`),z().get(e)}function Ve(t,e=S()){let o=v(e);h(l`Setting storefront password for shop ${o}...`),z().set(o,t)}function Xe(t=S()){let e=v(t);h(l`Removing storefront password for ${e}...`),z().delete(e)}function v(t=S()){let e=Y(t);if(!e)throw new ae("Theme store is not set. This indicates an unexpected issue with the CLI. Please report this to the Shopify CLI team.",["It may be possible to recover by running",{command:"shopify theme list --store <store>"},"(setting the store flag to the store you wish to use) and then running the command again."]);return e}async function le(t,e){return fe.run({store:t},e)}function Se(t){let e=t.store??Y();if(!e)throw te(new F("A store is required",`Specify the store passing ${l`${q.genericShellCommand(`--${O.store.name}=example.myshopify.com`)}`.value} or set the ${l`${q.genericShellCommand(O.store.env)}`.value} environment variable.`));return he(e),e}f();f();var ge="shopify.theme.toml",ct=new Intl.DateTimeFormat(void 0,{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),ut=["**/.git","**/.vscode","**/.hg","**/.bzr","**/.svn","**/_darcs","**/CVS","**/*.sublime-(project|workspace)","**/.DS_Store","**/.sass-cache","**/Thumbs.db","**/desktop.ini","**/config.yml","**/node_modules/",".prettierrc.json","**/{blocks,layout,snippets}/**/*.liquid.tmp.*","**/{config,locales}/**/*.json.tmp.*","**/{sections,templates}/**/*.{liquid,json}.tmp.*"],mt=50;f();f();var J="7e9cb568cfd431c538f36d1ad3f2b4f6";var Fe="shopify-cli-store",be=240*1e3,W;function P(){return W??(W=new x({projectName:Fe})),W}function b(t){return`${J}::${Ee(t)}`}function Ee(t){return t.replace(/\\/g,"\\\\").replace(/\./g,"\\.")}function d(t){return typeof t=="string"}function ke(t){if(!t||typeof t!="object")return;let e=t;if(typeof e.id=="number")return{id:e.id,...d(e.email)?{email:e.email}:{},...d(e.firstName)?{firstName:e.firstName}:{},...d(e.lastName)?{lastName:e.lastName}:{},...typeof e.accountOwner=="boolean"?{accountOwner:e.accountOwner}:{}}}function $e(t){if(!t||typeof t!="object")return;let e=t;if(!(!d(e.shopId)||!d(e.name)||!d(e.createdAt)))return{shopId:e.shopId,name:e.name,createdAt:e.createdAt,...d(e.placeholderAccountUuid)?{placeholderAccountUuid:e.placeholderAccountUuid}:{},...d(e.country)?{country:e.country}:{},...d(e.accessUrl)?{accessUrl:e.accessUrl}:{}}}function Pe(t){if(!t||typeof t!="object")return;let e=t;if(!d(e.store)||!d(e.clientId)||!d(e.userId)||!d(e.accessToken)||!Array.isArray(e.scopes)||!e.scopes.every(d)||!d(e.acquiredAt))return;let o=ke(e.associatedUser),r=e.kind==="preview"?"preview":"standard",n=r==="preview"?$e(e.preview):void 0;if(!(r==="preview"&&!n))return{store:e.store,clientId:e.clientId,userId:e.userId,accessToken:e.accessToken,scopes:e.scopes,acquiredAt:e.acquiredAt,...d(e.refreshToken)?{refreshToken:e.refreshToken}:{},...d(e.expiresAt)?{expiresAt:e.expiresAt}:{},...d(e.refreshTokenExpiresAt)?{refreshTokenExpiresAt:e.refreshTokenExpiresAt}:{},...o?{associatedUser:o}:{},...r==="preview"?{kind:r}:{},...n?{preview:n}:{}}}function ye(t,e,o){if(!e||typeof e!="object")return;let{sessionsByUserId:r,currentUserId:n}=e;if(!(r!==void 0||n!==void 0))return;let s=b(t);if(!r||typeof r!="object"||Array.isArray(r)||typeof n!="string"){o.delete(s);return}let a=Object.fromEntries(Object.entries(r).flatMap(([u,c])=>{let p=Pe(c);return p?[[u,p]]:[]}));if(Object.keys(a).length!==Object.keys(r).length)if(a[n])o.set(s,{currentUserId:n,sessionsByUserId:a});else{o.delete(s);return}return{currentUserId:n,sessionsByUserId:a}}function K(t,e){return ye(t,e.get(b(t)),e)}function Ce(t){return t.config?.store??{}}function we(t=P()){let e=[],o=`${J}::`;for(let[r,n]of Object.entries(Ce(t))){if(!r.startsWith(o))continue;let i=ye(r.slice(o.length),n,t),s=i?.sessionsByUserId[i.currentUserId];s&&e.push(s)}return e}function Ae(t,e=P()){let o=w(t),r=K(o,e);if(!r)return;let n=r.sessionsByUserId[r.currentUserId];if(!n){e.delete(b(o));return}return n}function wt(t,e=P()){let o=b(t.store),r=K(t.store,e),n={currentUserId:t.userId,sessionsByUserId:{...r?.sessionsByUserId??{},[t.userId]:t}};e.set(o,n)}function At(t,e,o){let r=w(t),n=typeof e=="string"?e:void 0,i=(typeof e=="string"?o:e)??P(),s=b(r);if(!n){i.delete(s);return}let a=K(r,i);if(!a)return;let{[n]:u,...c}=a.sessionsByUserId,p=Object.keys(c);if(p.length===0){i.delete(s);return}i.set(s,{currentUserId:a.currentUserId===n?p[0]:a.currentUserId,sessionsByUserId:c})}function ve(t){if(!t.expiresAt)return!1;let e=new Date(t.expiresAt).getTime();return Number.isNaN(e)?!0:e-be<Date.now()}var C=class extends me{environmentsFilename(){return ge}async command(e,o,r=!1,n,i){}async run(e){let o=this.constructor,r=o.multiEnvironmentsFlags,{args:n,flags:i}=await this.parse(o),s="password"in o.flags,a=(Array.isArray(i.environment)?i.environment:[i.environment]).filter(Boolean),u=r!==null&&r.some(m=>Array.isArray(m)?m.includes("store"):m==="store");if(a.length<=1){if(a[0]&&!i.store&&u)throw new F("Please provide a valid environment.");let m=s?await this.createSession(i):void 0,A=this.constructor.name.toLowerCase();if(N(`theme-command:${A}:single-env:authenticated`),i.path&&!_(i.path))throw new F(`Path does not exist: ${i.path}`);try{await this.command(i,m,!1,n)}finally{await this.logAnalyticsData(m)}return}if(r===null){R({body:"This command does not support multiple environments."});return}let{flags:c}=await this.parse(ue(o),this.argv);if("path"in c){this.errorOnGlobalPath();return}let p=await this.loadEnvironments(a,i,c),g=await this.validateEnvironments(p,r,s);"force"in o.flags&&!i.force&&!await this.showConfirmation(this.constructor.name,r,g)||await this.runConcurrent(g.valid)}storeAuthScopes(){}async loadEnvironments(e,o,r){let n=new Map;for(let i of e){let s=await ce(i,"shopify.theme.toml",{from:o.path,silent:!0});s?.store&&typeof s.store=="string"&&(s.store=w(s.store)),s?.path&&typeof s.path=="string"&&(s.path=k(s.path)),n.set(i,{flags:{...o,...s,...r,environment:[i]},validationFlags:{...s,...r}})}return n}async validateEnvironments(e,o,r){let n=[],i=[],s=r?this.storeAuthSessionsForTheme(Array.from(e.values()).map(({validationFlags:u})=>u)):new Map,a=Array.from(e.entries()).map(([u,{flags:c,validationFlags:p}])=>({environmentName:u,flags:c,validationFlags:p,storeAuthSession:this.storeAuthSessionFromCache(p,s)}));for(let{environmentName:u,flags:c,validationFlags:p,storeAuthSession:g}of a){let y=this.validConfig(p,o,u,g);if(y!==!0){let m=y.join(", ");i.push({environment:u,reason:`Missing flags: ${m}`});continue}n.push({environment:u,flags:c,requiresAuth:r,storeAuthSession:g})}return{valid:n,invalid:i}}async showConfirmation(e,o,r){let s={message:[`Run ${e.toLowerCase()} in the following environments?`],confirmationMessage:"Yes, proceed",cancellationMessage:"Cancel"},a=[...r.valid.map(({environment:u,flags:c})=>{let p=o.map(g=>{let y=Array.isArray(g)?g.find(m=>c[m]):g;if(y==="password")return"password";if(y==="path"&&typeof c.path=="string"){let m=c.path.split(/[/\\]/);if(m.length===1)return`path: ${c.path}`;let A=m[0]===""?`/${m[1]}`:m[0],E=m.at(-1);return`path: ${A}/.../${E}`}return y&&`${y}: ${c[y]}`}).join(", ");return[u,{subdued:p||"No flags required"}]}),...r.invalid.map(({environment:u,reason:c})=>[u,{error:`Skipping | ${c}`}])];return s.infoTable={Environment:a},r.invalid.length>0&&(s.confirmationMessage="Proceed anyway (will skip invalid environments)"),ie(s)}async runConcurrent(e){let o=new Z,r=e.map(s=>s.flags.store),n=new Set(r),i=r.length===n.size?[e]:this.createSequentialGroups(e);for(let s of i)await se({processes:s.map(({environment:a,flags:u,requiresAuth:c,storeAuthSession:p})=>({prefix:a,action:async(g,y,m)=>{try{let A=u.store;await le(A,async()=>{let E=c?await this.createSession(u,p):void 0,xe=this.constructor.name.toLowerCase();N(`theme-command:${xe}:multi-env:authenticated`);try{await this.command(u,E,!0,{},{stdout:g,stderr:y})}finally{await this.logAnalyticsData(E)}})}catch(A){A instanceof Error&&(A.message=`Environment ${a} failed:
2
+
3
+ ${A.message}`,I({body:[A.message]}))}}})),abortSignal:o.signal,showTimestamps:!0,renderOptions:{stdout:process.stderr}})}createSequentialGroups(e){let o=[];return e.forEach(r=>{let n=o.find(i=>!i.some(s=>s.flags.store===r.flags.store));n?n.push(r):o.push([r])}),o}async createSession(e,o){let r=Se({store:e.store}),n=e.password;return n?await U(r,n):o??await this.storeAuthSessionForTheme({store:r})??await U(r,n)}async storeAuthSessionForTheme(e){let o=this.storeAuthScopes();if(!o)return;let r=typeof e.store=="string"?e.store:void 0,n=e.password;if(!r||n)return;let i=w(r),s=Ae(i);if(s)return this.adminSessionFromStoreAuthSession(s,i,o)}storeAuthSessionsForTheme(e){let o=this.storeAuthScopes();if(!o)return new Map;let r=new Set(e.filter(({store:n,password:i})=>typeof n=="string"&&!i).map(({store:n})=>w(n)));return r.size===0?new Map:new Map(we().map(n=>{let i=w(n.store);if(!r.has(i))return;let s=this.adminSessionFromStoreAuthSession(n,i,o);return s?[i,s]:void 0}).filter(n=>n!==void 0))}storeAuthSessionFromCache(e,o){let r=typeof e.store=="string"?e.store:void 0,n=e.password;if(!(!r||n))return o.get(w(r))}adminSessionFromStoreAuthSession(e,o,r){if(ve(e)){h(`Ignoring stored store auth session for ${o}: it expired at ${e.expiresAt??"unknown"}.`);return}if(!this.hasRequiredStoreAuthScopes(e.scopes,r)){h(`Ignoring stored store auth session for ${o}: it is missing required scopes (has: ${e.scopes.join(", ")}; needs: ${r.join(", ")}).`);return}return h(`Using stored store auth session for ${o} (scopes: ${e.scopes.join(", ")}).`),L(e.userId),{token:e.accessToken,storeFqdn:o}}expandImpliedStoreAuthScopes(e){let o=new Set(e);for(let r of e){let n=r.match(/^(unauthenticated_)?write_(.*)$/);n&&o.add(`${n[1]??""}read_${n[2]}`)}return o}hasRequiredStoreAuthScopes(e,o){let r=this.expandImpliedStoreAuthScopes(e);return o.every(n=>r.has(n))}validConfig(e,o,r,n){let i=o.filter(s=>Array.isArray(s)?!s.some(a=>this.hasRequiredFlag(e,a,n)):!this.hasRequiredFlag(e,s,n)).map(s=>Array.isArray(s)?s.join(" or "):s);return i.length>0?(R({body:[`Missing required flags in environment configuration${r?` for ${r}`:""}:`,{list:{items:i}}]}),i):!0}hasRequiredFlag(e,o,r){return o==="password"&&r?!0:!!e[o]}errorOnGlobalPath(){let e=Q($(),"shopify.theme.toml"),o=_(e);I({body:["Can't use `--path` flag with multiple environments.",...o?["Configure each environment's theme path in your shopify.theme.toml file instead."]:["Run this command from the directory containing shopify.theme.toml.","No shopify.theme.toml found in current directory."]]})}async logAnalyticsData(e){if(!e)return;let o=re();await oe(()=>({store_fqdn_hash:ee(e.storeFqdn),store_domain:e.storeFqdn,cmd_theme_timings:JSON.stringify(o.timings),cmd_theme_errors:JSON.stringify(o.errors),cmd_theme_retries:JSON.stringify(o.retries),cmd_theme_events:JSON.stringify(o.events)})),await ne(()=>({store_fqdn:e.storeFqdn}))}};C.baseFlags=de;var Mt=C;export{J as a,we as b,Ae as c,wt as d,At as e,Y as f,He as g,ze as h,Ye as i,Je as j,We as k,Ke as l,Qe as m,Ve as n,Xe as o,O as p,qe as q,Se as r,ct as s,ut as t,mt as u,Mt as v};
@@ -1 +1 @@
1
- import{F as f,fa as v,ga as A,h as d,k as w,s as m}from"./chunk-TIU7MMRT.js";import{b as l}from"./chunk-ZT4PUH7L.js";import{d as p,g as F}from"./chunk-IIFRDOYG.js";import{Fb as V,Hb as h}from"./chunk-TB7HFPBB.js";import{j as q}from"./chunk-NNOSZ447.js";import{g as c}from"./chunk-VKWPEFWQ.js";c();c();var g={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"publicApiVersions"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"publicApiVersions"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"handle"}},{kind:"Field",name:{kind:"Name",value:"supported"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};var S=new Map;async function W(t,r,e,o){let a="Admin",u=o??await b(r),n=r.storeFqdn,s=$(r);l()==="local"&&(s["x-forwarded-host"]=n,n=new m().host("app"));let i=x(n,u,r);return v({query:t,api:a,addedHeaders:s,url:i,token:r.token,variables:e})}async function E(t){let{query:r,session:e,variables:o,version:a,responseOptions:u,preferredBehaviour:n}=t,s=a??S.get(e.storeFqdn);s??(s=await b(e,n));let i=e.storeFqdn,k=$(e);l()==="local"&&(k["x-forwarded-host"]=i,i=new m().host("app"));let D={url:x(i,s,e),api:"Admin",token:e.token,addedHeaders:k},y;return"refresh"in e&&(y={type:"token_refresh",handler:e.refresh}),A({...D,query:r,variables:o,responseOptions:u,unauthorizedHandler:y,preferredBehaviour:n})}function $(t){return f(t)?{"X-Shopify-Shop":t.storeFqdn,"X-Shopify-Access-Token":t.token}:{}}async function b(t,r){let o=(await N(t,r)).reverse()[0];return S.set(t.storeFqdn,o),o}async function N(t,r){return(await R(t,r)).filter(o=>o.supported).map(o=>o.handle).sort()}async function R(t,r){try{return(await E({query:g,session:t,variables:{},version:"unstable",responseOptions:{handleErrors:!1},preferredBehaviour:r})).publicApiVersions}catch(e){if(e instanceof d&&e.response.status===403){let o=t.storeFqdn.replace(".myshopify.com","");throw new p(h`Looks like you don't have access to this dev store: (${V.link(o,`https://${t.storeFqdn}`)})`,h`If you're not the owner, create a dev store staff account for yourself`)}throw e instanceof d&&(e.response.status===401||e.response.status===404)?new p(`Error connecting to your store ${t.storeFqdn}: ${e.message} ${e.response.status} ${e.response.data}`):w(e)?new p(`Network error connecting to your store ${t.storeFqdn}: ${e instanceof Error?e.message:String(e)}`,"Check your internet connection and try again."):new F(`Unknown error connecting to your store ${t.storeFqdn}: ${e instanceof Error?e.message:String(e)}`)}}function x(t,r,e){let o=r??"unstable";return e&&f(e)?`https://${q}/cli/admin/api/${o}/graphql.json`:`https://${t}/admin/api/${o}/graphql.json`}export{W as a,E as b,N as c,R as d,x as e};
1
+ import{E as f,fa as v,ga as A,j as w,r as m}from"./chunk-AFM3UZQO.js";import{b as l}from"./chunk-GXO2RRV2.js";import{f as d,m as p,p as F}from"./chunk-2GB3EAD3.js";import{Fb as V,Hb as h}from"./chunk-BCZMDFI2.js";import{j as q}from"./chunk-UKQ7NE5V.js";import{g as c}from"./chunk-VKWPEFWQ.js";c();c();var g={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"publicApiVersions"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"publicApiVersions"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"handle"}},{kind:"Field",name:{kind:"Name",value:"supported"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};var S=new Map;async function W(t,r,e,o){let a="Admin",u=o??await b(r),n=r.storeFqdn,s=$(r);l()==="local"&&(s["x-forwarded-host"]=n,n=new m().host("app"));let i=x(n,u,r);return v({query:t,api:a,addedHeaders:s,url:i,token:r.token,variables:e})}async function E(t){let{query:r,session:e,variables:o,version:a,responseOptions:u,preferredBehaviour:n}=t,s=a??S.get(e.storeFqdn);s??(s=await b(e,n));let i=e.storeFqdn,k=$(e);l()==="local"&&(k["x-forwarded-host"]=i,i=new m().host("app"));let D={url:x(i,s,e),api:"Admin",token:e.token,addedHeaders:k},y;return"refresh"in e&&(y={type:"token_refresh",handler:e.refresh}),A({...D,query:r,variables:o,responseOptions:u,unauthorizedHandler:y,preferredBehaviour:n})}function $(t){return f(t)?{"X-Shopify-Shop":t.storeFqdn,"X-Shopify-Access-Token":t.token}:{}}async function b(t,r){let o=(await N(t,r)).reverse()[0];return S.set(t.storeFqdn,o),o}async function N(t,r){return(await R(t,r)).filter(o=>o.supported).map(o=>o.handle).sort()}async function R(t,r){try{return(await E({query:g,session:t,variables:{},version:"unstable",responseOptions:{handleErrors:!1},preferredBehaviour:r})).publicApiVersions}catch(e){if(e instanceof d&&e.response.status===403){let o=t.storeFqdn.replace(".myshopify.com","");throw new p(h`Looks like you don't have access to this dev store: (${V.link(o,`https://${t.storeFqdn}`)})`,h`If you're not the owner, create a dev store staff account for yourself`)}throw e instanceof d&&(e.response.status===401||e.response.status===404)?new p(`Error connecting to your store ${t.storeFqdn}: ${e.message} ${e.response.status} ${e.response.data}`):w(e)?new p(`Network error connecting to your store ${t.storeFqdn}: ${e instanceof Error?e.message:String(e)}`,"Check your internet connection and try again."):new F(`Unknown error connecting to your store ${t.storeFqdn}: ${e instanceof Error?e.message:String(e)}`)}}function x(t,r,e){let o=r??"unstable";return e&&f(e)?`https://${q}/cli/admin/api/${o}/graphql.json`:`https://${t}/admin/api/${o}/graphql.json`}export{W as a,E as b,N as c,R as d,x as e};
@@ -0,0 +1 @@
1
+ import{b as e}from"./chunk-WHT2RCAD.js";import{a as r}from"./chunk-CTNBSUVU.js";import{e as c,g as t}from"./chunk-VKWPEFWQ.js";t();var s=c(r(),1);var a=class o extends e{static{this.args={command:s.Args.string({description:"Command to show help for.",required:!1})}}static{this.description="Display help for Shopify CLI"}static{this.usage="help [command] [flags]"}static{this.flags={"nested-commands":s.Flags.boolean({char:"n",description:"Include all nested commands in the output.",env:"SHOPIFY_FLAG_CLI_NESTED_COMMANDS",default:!1})}}static{this.strict=!1}async run(){let{argv:i,flags:n}=await this.parse(o),l=await(0,s.loadHelpClass)(this.config);await new l(this.config,{all:n["nested-commands"]}).showHelp(i)}};export{a};
@@ -1,2 +1,2 @@
1
- import{Fb as e,Hb as r,Pb as n,Ta as o,ua as g,wa as d}from"./chunk-TB7HFPBB.js";import{d as i}from"./chunk-773TIA5M.js";import{g as s}from"./chunk-VKWPEFWQ.js";s();var f=".shopify";async function E(p){let t=i(p,f),a=i(t,".gitignore"),[h,u]=await Promise.all([o(t),o(a)]);return h||(n(r`Creating hidden .shopify folder at ${e.path(t)}...`),await d(t)),u||(n(r`Creating .gitignore in ${e.path(t)}...`),await g(a,`# Ignore the entire ${f} directory
1
+ import{Fb as e,Hb as r,Pb as n,Ta as o,ua as g,wa as d}from"./chunk-BCZMDFI2.js";import{d as i}from"./chunk-773TIA5M.js";import{g as s}from"./chunk-VKWPEFWQ.js";s();var f=".shopify";async function E(p){let t=i(p,f),a=i(t,".gitignore"),[h,u]=await Promise.all([o(t),o(a)]);return h||(n(r`Creating hidden .shopify folder at ${e.path(t)}...`),await d(t)),u||(n(r`Creating .gitignore in ${e.path(t)}...`),await g(a,`# Ignore the entire ${f} directory
2
2
  *`)),t}export{E as a};
@@ -0,0 +1 @@
1
+ import{a as c,c as u}from"./chunk-UKQ7NE5V.js";import{a as L}from"./chunk-CTNBSUVU.js";import{e as h,g as i}from"./chunk-VKWPEFWQ.js";i();i();import{fileURLToPath as C}from"node:url";async function m(e){let{isDevelopment:o}=await import("./local-BRRQOCGY.js"),{ShopifyConfig:n}=await import("./custom-oclif-loader-4ZAXX5MR.js"),r=await import("./lib-2BR2WN7L.js"),{run:a,flush:p,Errors:d,settings:f}=r.default??r;o()&&(f.debug=!0);try{let t=new n({root:C(e.moduleURL)});await t.load(),e.lazyCommandLoader&&t.setLazyCommandLoader(e.lazyCommandLoader),await a(e.argv,t),await p()}catch(t){let{errorHandler:l}=await import("./error-handler-AOEXPYI7.js");return await l(t),d.handle(t)}}var s=h(L());async function I(e=process.versions){let o=e.node,n=Number(o.split(".")[0]);if(n<18){let{renderError:a}=await import("./ui-AX6ZMY6P.js");a({headline:"Upgrade to a supported Node version now.",body:[`Node ${n} has reached end-of-life and poses security risks. When you upgrade to a`,{link:{url:"https://nodejs.dev/en/about/previous-releases",label:"supported version"}},{char:","},"you'll be able to use Shopify CLI without interruption."]}),process.exit(1)}}function y(e,o=process.argv,n=process.env){o.includes("--verbose")&&(n.DEBUG=n.DEBUG??"*"),e.development&&(n.SHOPIFY_CLI_ENV=n.SHOPIFY_CLI_ENV??"development")}function b(e=process.argv,o=process.env){(e.includes("--no-color")||e.includes("--json")||e.includes("-j")||c(o.NO_COLOR)||c(o.SHOPIFY_FLAG_NO_COLOR)||c(o[u.json])||o.TERM==="dumb")&&(o.FORCE_COLOR="0")}async function N(e,o=m,n=process.argv,r=process.env,a=process.versions){return y(e,n,r),e.runInCreateMode&&await g(e,n),b(n,r),await I(a),o({moduleURL:e.moduleURL,lazyCommandLoader:e.lazyCommandLoader})}async function g(e,o=process.argv){let{findUpAndReadPackageJson:n}=await import("./node-package-manager-6JURLQKU.js"),{moduleDirectory:r}=await import("./path-MBXP7ZIC.js"),d=(await n(r(e.moduleURL))).content.name.replace("@shopify/create-","");if(o.findIndex(t=>t.includes("init"))===-1){let t=o.findIndex(l=>l.match(new RegExp(`bin(\\/|\\\\)+(create-${d}|dev|run)`)))+1;o.splice(t,0,"init")}}var R={"no-color":s.Flags.boolean({hidden:!1,description:"Disable color output.",env:"SHOPIFY_FLAG_NO_COLOR"}),verbose:s.Flags.boolean({hidden:!1,description:"Increase the verbosity of the output.",env:"SHOPIFY_FLAG_VERBOSE"})},S={json:s.Flags.boolean({char:"j",description:"Output the result as JSON. Automatically disables color output.",hidden:!1,default:!1,env:u.json})},A={"auth-alias":s.Flags.string({description:"Alias of the Shopify account to use for authentication.",env:"SHOPIFY_FLAG_AUTH_ALIAS"})},E=(e={})=>{let o=[e.description,"Must be between 1 and 65535."].filter(Boolean).join(" ");return s.Flags.integer({min:1,max:65535,...e,description:o})};async function j(){let{cacheClear:e}=await import("./conf-store-YW3NWYCN.js");e()}export{N as a,R as b,S as c,A as d,E as e,j as f};
@@ -1,6 +1,6 @@
1
- import{H,S as U}from"./chunk-4MLEL3VK.js";import{a as G}from"./chunk-VJEKDBGZ.js";import{f as T}from"./chunk-R7QYSC6T.js";import{b as D,l as O,s as k}from"./chunk-EEEKSYWV.js";import{d as N}from"./chunk-IIFRDOYG.js";import{Ca as P,Pb as u,Ta as A,Ua as I,bb as _,na as R,wa as w}from"./chunk-TB7HFPBB.js";import{f as S}from"./chunk-SZM6ANMN.js";import{d as x,e as E,g as F,i as C}from"./chunk-773TIA5M.js";import{e as q,g as m}from"./chunk-VKWPEFWQ.js";m();function b(){return process.hrtime()}function M(r){let t=process.hrtime(r);return(t[0]*1e3+t[1]/1e6).toFixed(2)}m();m();var $=q(G(),1),K=200,Q=6e4,L=200,Y=500,v=class{constructor(t,s,i=K){this.currentEvents=[],this.extensionPaths=[],this.ignored={},this.extensionWatchedFiles=new Map,this.emitEvents=()=>{let e=this.currentEvents;this.currentEvents=[];let n=`\u{1F509} ${e.length} EVENTS EMITTED in files: ${e.map(o=>o.path).join(`
1
+ import{a as U}from"./chunk-P2P2MAZQ.js";import{E as H}from"./chunk-5HJTCBBV.js";import{a as G}from"./chunk-VJEKDBGZ.js";import{f as T}from"./chunk-7EE7YOCR.js";import{b as D,l as O,s as k}from"./chunk-JX4HSDDG.js";import{m as N}from"./chunk-2GB3EAD3.js";import{Ca as P,Pb as u,Ta as A,Ua as I,bb as _,na as R,wa as w}from"./chunk-BCZMDFI2.js";import{f as S}from"./chunk-EQNJ2NQD.js";import{d as x,e as E,g as F,i as C}from"./chunk-773TIA5M.js";import{e as q,g as m}from"./chunk-VKWPEFWQ.js";m();function b(){return process.hrtime()}function M(r){let t=process.hrtime(r);return(t[0]*1e3+t[1]/1e6).toFixed(2)}m();m();var $=q(G(),1),K=200,Q=6e4,L=200,Y=500,v=class{constructor(t,s,i=K){this.currentEvents=[],this.extensionPaths=[],this.ignored={},this.extensionWatchedFiles=new Map,this.emitEvents=()=>{let e=this.currentEvents;this.currentEvents=[];let n=`\u{1F509} ${e.length} EVENTS EMITTED in files: ${e.map(o=>o.path).join(`
2
2
  `)}`;u(n,this.options.stdout),this.onChangeCallback?.(e)},this.handleFileEvent=(e,n)=>{let o=b(),d=E(n),h=n===this.app.configPath,l=n.endsWith(".extension.toml");if(u(`\u{1F300}: ${e} ${n.replace(this.app.directory,"")}
3
- `),h)this.handleEventForExtension(e,n,this.app.directory,o,!1);else{let a=this.extensionWatchedFiles.get(d),p=a===void 0||a.size===0;if(p&&e==="add"&&!l){let c=this.discoverFileOwners(d);c.size>0&&(this.extensionWatchedFiles.set(d,c),a=c,p=!1)}if(p&&!l&&!h){u(`\u{1F300}: File ${n} is not watched by any extension`,this.options.stdout);return}for(let c of a??[]){let g=this.app.realExtensions.find(X=>X.handle===c),y=g?E(g.directory):this.app.directory;this.handleEventForExtension(e,n,y,o,!1,c)}p&&this.handleEventForExtension(e,n,this.app.directory,o,!0)}this.debouncedEmit()},this.close=()=>{this.watcher&&(u("Closing file watcher",this.options.stdout),this.watcher.close().then(()=>u("File watching closed",this.options.stdout)).catch(e=>u(`File watching failed to close: ${e.message}`,this.options.stderr)))},this.app=t,this.options=s,this.debouncedEmit=k(this.emitEvents.bind(this),i,{leading:!0,trailing:!0}),this.updateApp(t)}onChange(t){this.onChangeCallback=t}async start(){let s=[...this.app.configuration.extension_directories??["extensions"]].map(o=>x(this.app.directory,o));await Promise.all(s.map(async o=>{try{await w(o.replace(/\/\*+$/,""))}catch{}}));let i=[this.app.configPath,...s],e=this.getAllWatchedFiles();i.push(...e),this.close();let{default:n}=await import("./chokidar-VDIVGBZH.js");this.watcher=n.watch(i,{ignored:["**/node_modules/**","**/.git/**"],persistent:!0,ignoreInitial:!0}),this.watcher.on("all",this.handleFileEvent),this.addAbortListener(),u(`File watcher started with ${i.length} paths`,this.options.stdout)}updateApp(t){this.app=t,this.extensionPaths=this.app.nonConfigExtensions.map(s=>E(s.directory)).filter(s=>s!==this.app.directory),this.extensionPaths.forEach(s=>{var i;(i=this.ignored)[s]??(i[s]=this.createIgnoreInstance(s))})}addAbortListener(){this.options.signal.removeEventListener("abort",this.close),this.options.signal.addEventListener("abort",this.close)}getAllWatchedFiles(){this.extensionWatchedFiles.clear();let t=this.app.realExtensions.map(i=>({extension:i,watchedFiles:i.watchedFiles()})),s=new Set;for(let{extension:i,watchedFiles:e}of t)for(let n of e){let o=E(n);s.add(o);let d=this.extensionWatchedFiles.get(o)??new Set;d.add(i.handle),this.extensionWatchedFiles.set(o,d)}return Array.from(s)}pushEvent(t){this.shouldIgnoreEvent(t)||(t.type==="extension_folder_created"&&(this.ignored[t.path]=this.createIgnoreInstance(t.path)),!this.currentEvents.some(s=>s.path===t.path&&s.type===t.type&&s.extensionHandle===t.extensionHandle)&&this.currentEvents.push(t))}shouldIgnoreEvent(t){if(t.type==="extension_folder_deleted"||t.type==="extension_folder_created"||t.extensionHandle&&this.extensionWatchedFiles.get(E(t.path))?.has(t.extensionHandle))return!1;let i=(t.extensionHandle?this.app.realExtensions.find(n=>n.handle===t.extensionHandle):void 0)?.watchedFiles(),e=this.ignored[t.extensionPath];if(i)return!i.some(o=>_(t.path,o));if(e){let n=F(t.extensionPath,t.path);return e.ignores(n)}return!1}discoverFileOwners(t){let s=new Set;for(let i of this.app.realExtensions){let e=E(i.directory);e!==this.app.directory&&t.startsWith(`${e}/`)&&this.pathMatchesWatchPatterns(t,i)&&s.add(i.handle)}return s}pathMatchesWatchPatterns(t,s){let{paths:i,ignore:e}=s.watchPatterns(),n=F(E(s.directory),t);return e.some(o=>_(n,o))?!1:i.some(o=>_(n,o))}handleEventForExtension(t,s,i,e,n,o){let d=s.endsWith(".extension.toml"),h=s===this.app.configPath;switch(t){case"change":if(n)break;d||h?this.pushEvent({type:"extensions_config_updated",path:s,extensionPath:i,extensionHandle:o,startTime:e}):this.pushEvent({type:"file_updated",path:s,extensionPath:i,extensionHandle:o,startTime:e});break;case"add":if(!d){this.pushEvent({type:"file_created",path:s,extensionPath:i,extensionHandle:o,startTime:e});break}let l=0,a=C(s),p=setInterval(()=>{I(x(a,T.lockFile))?(u(`Waiting for extension to complete creation: ${s}
3
+ `),h)this.handleEventForExtension(e,n,this.app.directory,o,!1);else{let a=this.extensionWatchedFiles.get(d),p=a===void 0||a.size===0;if(p&&e==="add"&&!l){let c=this.discoverFileOwners(d);c.size>0&&(this.extensionWatchedFiles.set(d,c),a=c,p=!1)}if(p&&!l&&!h){u(`\u{1F300}: File ${n} is not watched by any extension`,this.options.stdout);return}for(let c of a??[]){let g=this.app.realExtensions.find(X=>X.handle===c),y=g?E(g.directory):this.app.directory;this.handleEventForExtension(e,n,y,o,!1,c)}p&&this.handleEventForExtension(e,n,this.app.directory,o,!0)}this.debouncedEmit()},this.close=()=>{this.watcher&&(u("Closing file watcher",this.options.stdout),this.watcher.close().then(()=>u("File watching closed",this.options.stdout)).catch(e=>u(`File watching failed to close: ${e.message}`,this.options.stderr)))},this.app=t,this.options=s,this.debouncedEmit=k(this.emitEvents.bind(this),i,{leading:!0,trailing:!0}),this.updateApp(t)}onChange(t){this.onChangeCallback=t}async start(){let s=[...this.app.configuration.extension_directories??["extensions"]].map(o=>x(this.app.directory,o));await Promise.all(s.map(async o=>{try{await w(o.replace(/\/\*+$/,""))}catch{}}));let i=[this.app.configPath,...s],e=this.getAllWatchedFiles();i.push(...e),this.close();let{default:n}=await import("./chokidar-5RWEYTNQ.js");this.watcher=n.watch(i,{ignored:["**/node_modules/**","**/.git/**"],persistent:!0,ignoreInitial:!0}),this.watcher.on("all",this.handleFileEvent),this.addAbortListener(),u(`File watcher started with ${i.length} paths`,this.options.stdout)}updateApp(t){this.app=t,this.extensionPaths=this.app.nonConfigExtensions.map(s=>E(s.directory)).filter(s=>s!==this.app.directory),this.extensionPaths.forEach(s=>{var i;(i=this.ignored)[s]??(i[s]=this.createIgnoreInstance(s))})}addAbortListener(){this.options.signal.removeEventListener("abort",this.close),this.options.signal.addEventListener("abort",this.close)}getAllWatchedFiles(){this.extensionWatchedFiles.clear();let t=this.app.realExtensions.map(i=>({extension:i,watchedFiles:i.watchedFiles()})),s=new Set;for(let{extension:i,watchedFiles:e}of t)for(let n of e){let o=E(n);s.add(o);let d=this.extensionWatchedFiles.get(o)??new Set;d.add(i.handle),this.extensionWatchedFiles.set(o,d)}return Array.from(s)}pushEvent(t){this.shouldIgnoreEvent(t)||(t.type==="extension_folder_created"&&(this.ignored[t.path]=this.createIgnoreInstance(t.path)),!this.currentEvents.some(s=>s.path===t.path&&s.type===t.type&&s.extensionHandle===t.extensionHandle)&&this.currentEvents.push(t))}shouldIgnoreEvent(t){if(t.type==="extension_folder_deleted"||t.type==="extension_folder_created"||t.extensionHandle&&this.extensionWatchedFiles.get(E(t.path))?.has(t.extensionHandle))return!1;let i=(t.extensionHandle?this.app.realExtensions.find(n=>n.handle===t.extensionHandle):void 0)?.watchedFiles(),e=this.ignored[t.extensionPath];if(i)return!i.some(o=>_(t.path,o));if(e){let n=F(t.extensionPath,t.path);return e.ignores(n)}return!1}discoverFileOwners(t){let s=new Set;for(let i of this.app.realExtensions){let e=E(i.directory);e!==this.app.directory&&t.startsWith(`${e}/`)&&this.pathMatchesWatchPatterns(t,i)&&s.add(i.handle)}return s}pathMatchesWatchPatterns(t,s){let{paths:i,ignore:e}=s.watchPatterns(),n=F(E(s.directory),t);return e.some(o=>_(n,o))?!1:i.some(o=>_(n,o))}handleEventForExtension(t,s,i,e,n,o){let d=s.endsWith(".extension.toml"),h=s===this.app.configPath;switch(t){case"change":if(n)break;d||h?this.pushEvent({type:"extensions_config_updated",path:s,extensionPath:i,extensionHandle:o,startTime:e}):this.pushEvent({type:"file_updated",path:s,extensionPath:i,extensionHandle:o,startTime:e});break;case"add":if(!d){this.pushEvent({type:"file_created",path:s,extensionPath:i,extensionHandle:o,startTime:e});break}let l=0,a=C(s),p=setInterval(()=>{I(x(a,T.lockFile))?(u(`Waiting for extension to complete creation: ${s}
4
4
  `),l+=L):(clearInterval(p),this.extensionPaths.push(a),this.pushEvent({type:"extension_folder_created",path:a,extensionPath:i,startTime:e}),this.debouncedEmit()),l>=Q&&(clearInterval(p),this.options.stderr.write(`Error loading new extension at path: ${s}.
5
5
  Please restart the process.`))},L);break;case"unlink":if(s.endsWith(T.lockFile))break;h?this.pushEvent({type:"app_config_deleted",path:s,extensionPath:i,startTime:e}):d?(this.extensionPaths=this.extensionPaths.filter(c=>c!==i),this.pushEvent({type:"extension_folder_deleted",path:i,extensionPath:i,startTime:e})):setTimeout(()=>{this.extensionPaths.includes(i)&&(this.pushEvent({type:"file_deleted",path:s,extensionPath:i,extensionHandle:o,startTime:e}),this.extensionWatchedFiles.delete(E(s)),this.debouncedEmit())},Y);break;case"addDir":case"unlinkDir":break}}createIgnoreInstance(t){let s=x(t,".gitignore");if(!I(s))return;let i=R(s).toString().split(`
6
6
  `).map(e=>e.trim()).filter(e=>e!==""&&!e.startsWith("#"));return $.default.default().add(i)}};m();m();function B(r,t,s=!0){let i=r.realExtensions,e=i.map(a=>a.uid),n=t.realExtensions,o=n.map(a=>a.uid),d=n.filter(a=>!e.includes(a.uid)),h=i.filter(a=>!o.includes(a.uid)),l;return s&&(l=n.filter(a=>{let p=i.find(y=>y.uid===a.uid);if(!p)return!1;let c=JSON.stringify(p.configuration)!==JSON.stringify(a.configuration),g=p.configurationPath!==a.configurationPath;return c||g})),{created:d,updated:l??[],deleted:h}}async function V(r,t,s){if(r[0]===void 0)return;let i=r.some(o=>j.includes(o.type)),e=r.filter(o=>!j.includes(o.type));if(i)return st({event:r[0],app:t,options:s,extensions:[]});let n={app:t,extensionEvents:[],path:r[0].path,startTime:r[0].startTime};for(let o of e){let d=o.extensionHandle?t.realExtensions.filter(l=>l.handle===o.extensionHandle):t.realExtensions.filter(l=>l.directory===o.extensionPath),h=Z[o.type]({event:o,app:n.app,extensions:d,options:s});n.extensionEvents.push(...h.extensionEvents)}return n}var j=["extensions_config_updated","extension_folder_created"],Z={extension_folder_deleted:tt,file_created:W,file_deleted:W,file_updated:W,app_config_deleted:et,extension_folder_created:z,extensions_config_updated:z};function tt({event:r,app:t,extensions:s}){let i=s.map(e=>(t.removeExtension(e.uid),{type:f.Deleted,extension:e}));return{app:t,extensionEvents:i,startTime:r.startTime,path:r.path}}function W({event:r,app:t,extensions:s}){let i=s.map(e=>({type:f.Updated,extension:e}));return{app:t,extensionEvents:i,startTime:r.startTime,path:r.path}}function z(r){return{app:r.app,extensionEvents:[],startTime:r.event.startTime,path:r.event.path}}function et(r){throw new N("The active app.toml was deleted, exiting")}async function st({event:r,app:t}){let s=await it(t),i=B(t,s,!0),e=i.created.map(h=>({type:f.Created,extension:h})),n=i.deleted.map(h=>({type:f.Deleted,extension:h})),o=i.updated.map(h=>({type:f.Updated,extension:h})),d=[...e,...n,...o];return{app:s,extensionEvents:d,startTime:r.startTime,path:r.path,appWasReloaded:!0}}async function it(r){let t=b();try{let s=await H(r);return u(`App reloaded [${M(t)}ms]`),s}catch(s){let i=new Error(`Error reloading app: ${s.message}`);throw i.cause="validation-error",i}}import{formatMessagesSync as nt}from"esbuild";import ot from"events";var f;(function(r){r.Updated="changed",r.Deleted="deleted",r.Created="created"})(f||(f={}));var J=class extends ot{constructor(t,s,i,e){super(),this.started=!1,this.ready=!1,this.initialEvents=[],this.app=t,this.appURL=s,this.buildOutputPath=i??x(t.directory,".shopify","dev-bundle"),this.options={stdout:process.stdout,stderr:process.stderr,signal:new D},this.fileWatcher=e}async start(t,s=!0){this.started||(this.started=!0,this.options=t??this.options,await A(this.buildOutputPath)&&await P(this.buildOutputPath,{force:!0}),await w(this.buildOutputPath),s&&(this.initialEvents=this.app.realExtensions.map(i=>({type:f.Updated,extension:i})),await this.buildExtensions(this.initialEvents)),this.fileWatcher=this.fileWatcher??new v(this.app,this.options),this.fileWatcher.onChange(i=>{V(i,this.app,this.options).then(async e=>{if(e?.extensionEvents.length===0&&u("Change detected, but no extensions were affected"),!e)return;this.app=e.app,e.appWasReloaded&&this.fileWatcher?.updateApp(this.app),await this.rescanImports(e);let n=e.extensionEvents.filter(o=>o.type!==f.Deleted);await this.buildExtensions(n),e.appWasReloaded||await this.app.generateExtensionTypes(),await this.deleteExtensionsBuildOutput(e),this.emit("all",e)}).catch(e=>{this.emit("error",e)})}),await this.fileWatcher.start(),this.ready=!0,this.emit("ready",{app:this.app,extensionEvents:this.initialEvents}))}onEvent(t){return this.addListener("all",t),this}onStart(t){if(this.ready){let s={app:this.app,extensionEvents:this.initialEvents,startTime:[0,0],path:""};t(s)?.catch(()=>{})}else this.once("ready",t);return this}onError(t){return this.addListener("error",t),this}async deleteExtensionsBuildOutput(t){let i=t.extensionEvents.filter(e=>e.type===f.Deleted).map(e=>e.extension).map(async e=>{let n=x(this.buildOutputPath,e.getOutputFolderId());return P(n,{force:!0})});await Promise.all(i)}async buildExtensions(t){let s=U(t,n=>n.extension.uid),i=[];for(let n of Object.values(s))n.length>0&&n[0]&&i.push({extension:n[0].extension,events:n});let e=i.map(async({extension:n,events:o})=>O({outputPrefix:n.handle,stripAnsi:!1},async()=>{try{await this.buildExtension(n);let d={status:"ok",uid:n.uid};o.forEach(h=>{h.buildResult=d})}catch(d){let h=d.errors??[],l=d.message,a;if(h.length){let c=h[0];l=c?.text,a=c?.location?.file,nt(h,{kind:"error",color:!S()}).forEach(y=>{this.options.stderr.write(y)})}else this.options.stderr.write(d.message);let p={status:"error",error:l,file:a,uid:n.uid};o.forEach(c=>{c.buildResult=p})}}));return Promise.all(e)}async buildExtension(t){let s={app:this.app,stdout:this.options.stdout,stderr:this.options.stderr,useTasks:!1,environment:"development",appURL:this.appURL};await t.buildForBundle(s,this.buildOutputPath)}async rescanImports(t){if(t.path.endsWith(".toml"))return;let i=t.extensionEvents.filter(e=>e.type!==f.Deleted).map(e=>e.extension);i.length>0&&(await Promise.all(i.map(async o=>o.rescanImports()))).some(o=>o)&&await this.fileWatcher?.start()}};export{b as a,M as b,f as c,J as d};
@@ -1 +1 @@
1
- import{b as u,c as d}from"./chunk-TSEPNC3O.js";import{a as m}from"./chunk-P7U6BWKN.js";import{a}from"./chunk-VJQJ5PTQ.js";import{Ga as c,q as p}from"./chunk-4MLEL3VK.js";import{b as e}from"./chunk-NGCPVRDM.js";import{v as n}from"./chunk-EEEKSYWV.js";import{g as i}from"./chunk-VKWPEFWQ.js";i();var s,o=class extends m{async run(){let{flags:t}=await this.parse(s),{app:r}=await c({directory:t.path,userProvidedConfigName:t.config}),l=await d(r,t.path);return await p(l,{app:r,stdout:process.stdout,stderr:process.stderr,useTasks:!0,environment:"production"}),n({headline:"Function built successfully."}),{app:r}}};s=o;o.summary="Compile a function to wasm.";o.descriptionWithMarkdown="Compiles the function in your current directory to WebAssembly (Wasm) for testing purposes.";o.description=s.descriptionWithoutMarkdown();o.flags={...e,...a,...u};var k=o;export{k as a};
1
+ import{b as u,c as d}from"./chunk-BPDUBZMU.js";import{a as m}from"./chunk-LEEVJH4B.js";import{a}from"./chunk-NENUUNWB.js";import{o as p,ua as c}from"./chunk-5HJTCBBV.js";import{b as e}from"./chunk-4TANJ4JK.js";import{v as n}from"./chunk-JX4HSDDG.js";import{g as i}from"./chunk-VKWPEFWQ.js";i();var s,o=class extends m{async run(){let{flags:t}=await this.parse(s),{app:r}=await c({directory:t.path,userProvidedConfigName:t.config}),l=await d(r,t.path);return await p(l,{app:r,stdout:process.stdout,stderr:process.stderr,useTasks:!0,environment:"production"}),n({headline:"Function built successfully."}),{app:r}}};s=o;o.summary="Compile a function to wasm.";o.descriptionWithMarkdown="Compiles the function in your current directory to WebAssembly (Wasm) for testing purposes.";o.description=s.descriptionWithoutMarkdown();o.flags={...e,...a,...u};var k=o;export{k as a};