@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.
- package/dist/analytics-3ICKUTK2.js +1 -0
- package/dist/analytics-73NVZI4Z.js +1 -0
- package/dist/assets/hydrogen/starter/package.json +1 -1
- package/dist/bootstrap.js +1 -1
- package/dist/{chokidar-VDIVGBZH.js → chokidar-5RWEYTNQ.js} +1 -1
- package/dist/{chunk-SH6Q5CLM.js → chunk-25Z36VJG.js} +1 -1
- package/dist/{chunk-OC5PD4ID.js → chunk-2AVFG5KT.js} +1 -1
- package/dist/chunk-2DMTEIS3.js +2 -0
- package/dist/chunk-2GB3EAD3.js +153 -0
- package/dist/{chunk-UQWFDL3F.js → chunk-2KD4LHRT.js} +1 -1
- package/dist/{chunk-4VJ5VBSR.js → chunk-2NB4P6BB.js} +1 -1
- package/dist/{chunk-75DBVSVI.js → chunk-2OYQHHKC.js} +1 -1
- package/dist/{chunk-OMXKQY2L.js → chunk-2VJKXWLG.js} +1 -1
- package/dist/{chunk-V6QZF5YS.js → chunk-3Q5ESVIY.js} +1 -1
- package/dist/{chunk-TPGREOWO.js → chunk-3XCIUG5P.js} +1 -1
- package/dist/chunk-445NFHXL.js +3 -0
- package/dist/{chunk-WN5VTUWJ.js → chunk-4BPFJDH3.js} +1 -1
- package/dist/chunk-4E5RGEJO.js +1 -0
- package/dist/{chunk-LGFOE4XL.js → chunk-4IHSAT76.js} +1 -1
- package/dist/chunk-4TANJ4JK.js +1 -0
- package/dist/{chunk-VCWESQBC.js → chunk-534U3DKZ.js} +2 -2
- package/dist/{chunk-KIAMA3L2.js → chunk-56T6YCU2.js} +1 -1
- package/dist/chunk-5HJTCBBV.js +317 -0
- package/dist/{chunk-523SJVNT.js → chunk-5INBKZRD.js} +1 -1
- package/dist/{chunk-DIPTSBQM.js → chunk-5Q4WAGQL.js} +1 -1
- package/dist/{chunk-35FS2NTM.js → chunk-5QDM4XIK.js} +1 -1
- package/dist/chunk-65CEF3SM.js +8 -0
- package/dist/{chunk-NSADN5S2.js → chunk-6HQMZ324.js} +141 -141
- package/dist/{chunk-QEVGRNUE.js → chunk-6KAWCN3I.js} +3 -3
- package/dist/{chunk-GDHD3TGC.js → chunk-6QDOCBD4.js} +1 -1
- package/dist/{chunk-LVLDPYH5.js → chunk-6ZPHB5U2.js} +1 -1
- package/dist/{chunk-XS7WK4YK.js → chunk-7AWKXTNS.js} +1 -1
- package/dist/chunk-7EE7YOCR.js +16 -0
- package/dist/{chunk-L42FYXFW.js → chunk-7L5AIZOP.js} +4 -4
- package/dist/chunk-7MD5MIGN.js +103 -0
- package/dist/{chunk-N6IFIMC6.js → chunk-7TXWKLPY.js} +1 -1
- package/dist/{chunk-ZUWEGJA7.js → chunk-7US4TVO2.js} +1 -1
- package/dist/{chunk-7TQ6HVHN.js → chunk-A7IDVXF7.js} +1 -1
- package/dist/chunk-AFM3UZQO.js +684 -0
- package/dist/{chunk-5GVE4ILZ.js → chunk-AHLNB45E.js} +1 -1
- package/dist/{chunk-JOKLZMTP.js → chunk-ARCAYYRW.js} +1 -1
- package/dist/{chunk-JADXT2DY.js → chunk-B3U6GDHL.js} +1 -1
- package/dist/chunk-BCZMDFI2.js +370 -0
- package/dist/chunk-BDDROQGK.js +26 -0
- package/dist/{chunk-P6LVSNTT.js → chunk-BKJMVAI7.js} +1 -1
- package/dist/chunk-BOAGJ6P5.js +1 -0
- package/dist/{chunk-TSEPNC3O.js → chunk-BPDUBZMU.js} +1 -1
- package/dist/chunk-BQOKTPUU.js +1 -0
- package/dist/{chunk-6VR22Z5R.js → chunk-C7LFLIRT.js} +3 -3
- package/dist/chunk-CELVG4AL.js +6 -0
- package/dist/{chunk-BQARKSGG.js → chunk-CNI7ZUST.js} +1 -1
- package/dist/{chunk-YKNMNGV7.js → chunk-CONJQV7M.js} +1 -1
- package/dist/chunk-CTNBSUVU.js +83 -0
- package/dist/chunk-CV5ELBVU.js +1 -0
- package/dist/{chunk-DI5ZPWNA.js → chunk-DC7TXY4K.js} +1 -1
- package/dist/{chunk-ODSMT2ZC.js → chunk-DXUISRMZ.js} +1 -1
- package/dist/chunk-EHV7EKB3.js +2 -0
- package/dist/{chunk-SZM6ANMN.js → chunk-EQNJ2NQD.js} +2 -2
- package/dist/{chunk-NIVGP4LB.js → chunk-EVIO6OWW.js} +1 -1
- package/dist/chunk-EZBB2ULE.js +1 -0
- package/dist/{chunk-Z6VNPAY7.js → chunk-FBVNXRVB.js} +1 -1
- package/dist/chunk-FFSDGRAN.js +1 -0
- package/dist/{chunk-YXNKDX56.js → chunk-FG5QXIQH.js} +1 -1
- package/dist/{chunk-6ZWMXMNM.js → chunk-FGG6HXIZ.js} +1 -1
- package/dist/{chunk-3EJGRQTH.js → chunk-FJCZ4F6J.js} +1 -1
- package/dist/{chunk-2ACN7JIZ.js → chunk-FKH5ZF2C.js} +1 -1
- package/dist/{chunk-LSCDB36D.js → chunk-GD5IRJBE.js} +1 -1
- package/dist/{chunk-ZAN7AZTX.js → chunk-GJEG7VGX.js} +1 -1
- package/dist/{chunk-XUAAQI5N.js → chunk-GT6BJ2GK.js} +1 -1
- package/dist/chunk-GWNV44NZ.js +18 -0
- package/dist/{chunk-ZT4PUH7L.js → chunk-GXO2RRV2.js} +1 -1
- package/dist/{chunk-MC466GSO.js → chunk-H5I7BSNG.js} +1 -1
- package/dist/{chunk-6AWRW3GS.js → chunk-H5YC3EP6.js} +1 -1
- package/dist/chunk-HVMEBH24.js +6 -0
- package/dist/{chunk-5N7H4PJJ.js → chunk-HY3INWPI.js} +1 -1
- package/dist/{chunk-XXLGM6OZ.js → chunk-I6ST5X56.js} +1 -1
- package/dist/{chunk-RFOALCVH.js → chunk-ID6ASBGV.js} +1 -1
- package/dist/{chunk-R6A754UW.js → chunk-IDQT2UY7.js} +1 -1
- package/dist/chunk-IIOFR25P.js +3 -0
- package/dist/{chunk-FSVSM57K.js → chunk-IJEDTDSJ.js} +6 -6
- package/dist/{chunk-42RVM4EZ.js → chunk-ILICQWUF.js} +1 -1
- package/dist/chunk-IMWEC6NF.js +16 -0
- package/dist/{chunk-Q7DSLGTN.js → chunk-ITNFDLZ4.js} +1 -1
- package/dist/chunk-IU5U6KKO.js +4 -0
- package/dist/{chunk-YNX4DT2O.js → chunk-IXCDFXMB.js} +1 -1
- package/dist/chunk-J3D4KQOQ.js +1 -0
- package/dist/chunk-JJZNUFPD.js +44 -0
- package/dist/chunk-JRTJZAFJ.js +19 -0
- package/dist/chunk-JT7YTXJ7.js +1 -0
- package/dist/{chunk-EEEKSYWV.js → chunk-JX4HSDDG.js} +15 -15
- package/dist/chunk-K4M32VKU.js +5 -0
- package/dist/{chunk-XHTICMA7.js → chunk-K5GJNXDK.js} +1 -1
- package/dist/{chunk-5CV7GFWZ.js → chunk-KCNOFNS5.js} +1 -1
- package/dist/{chunk-3OCR7P3S.js → chunk-KM2R6O7V.js} +1 -1
- package/dist/{chunk-CX44CQFL.js → chunk-KNFDN3AP.js} +1 -1
- package/dist/{chunk-ZG7BVVT2.js → chunk-LD6ZCTZ3.js} +1 -1
- package/dist/{chunk-TM44Z7U7.js → chunk-LDWMX3KZ.js} +1 -1
- package/dist/{chunk-6K4DVV37.js → chunk-LEDVV6XK.js} +1 -1
- package/dist/chunk-LEEVJH4B.js +1 -0
- package/dist/{chunk-EOJNSPIH.js → chunk-LJZIIURR.js} +1 -1
- package/dist/{chunk-UHMRDG6J.js → chunk-LURVEPYP.js} +1 -1
- package/dist/{chunk-HQE5B2CF.js → chunk-LXOBW4AW.js} +1 -1
- package/dist/{chunk-AAK3WGD7.js → chunk-M5YGJYNI.js} +1 -1
- package/dist/{chunk-UMB4BWCK.js → chunk-MDQHEW7V.js} +1 -1
- package/dist/{chunk-ICRQZAXP.js → chunk-MMP3F6LO.js} +1 -1
- package/dist/{chunk-HOAVZLEG.js → chunk-MPYCIVRA.js} +1 -1
- package/dist/chunk-MY2H5XPY.js +7 -0
- package/dist/{chunk-SG5TRPJ7.js → chunk-N4RYVOXT.js} +1 -1
- package/dist/chunk-NB6HHZ36.js +1 -0
- package/dist/{chunk-UVIGXZMV.js → chunk-NEK2KNKR.js} +1 -1
- package/dist/{chunk-VJQJ5PTQ.js → chunk-NENUUNWB.js} +1 -1
- package/dist/{chunk-K4APB7O3.js → chunk-NJONAV7V.js} +1 -1
- package/dist/{chunk-7KWBVZPI.js → chunk-NKBSS7YL.js} +1 -1
- package/dist/{chunk-HSVZU7MP.js → chunk-NKT5U6IJ.js} +1 -1
- package/dist/{chunk-RLB5QHWG.js → chunk-NVQOAHID.js} +1 -1
- package/dist/{chunk-P7OSUECN.js → chunk-OHQTOHUX.js} +1 -1
- package/dist/chunk-P2P2MAZQ.js +1 -0
- package/dist/{chunk-KFUOVO3X.js → chunk-PCTVUTV3.js} +1 -1
- package/dist/{chunk-OJZT3NA2.js → chunk-PKR6HS4T.js} +1 -1
- package/dist/chunk-PKRDBS7O.js +5 -0
- package/dist/{chunk-BVWQZKNK.js → chunk-PMD6S7YG.js} +1 -1
- package/dist/{chunk-KPNNGJAW.js → chunk-PUOCHFFI.js} +1 -1
- package/dist/{chunk-ANH2V6DJ.js → chunk-Q2DPBMV4.js} +1 -1
- package/dist/{chunk-23LZNWB5.js → chunk-Q6XT3YKV.js} +1 -1
- package/dist/{chunk-TNUY66EE.js → chunk-QARALFHD.js} +1 -1
- package/dist/{chunk-XCGV3IJ5.js → chunk-QEL3F2NY.js} +1 -1
- package/dist/{chunk-P2SBE77Z.js → chunk-R2W5B7YI.js} +1 -1
- package/dist/chunk-REABQXMP.js +1 -0
- package/dist/{chunk-KQTVJMV6.js → chunk-RMF3YNWE.js} +1 -1
- package/dist/{chunk-TH6CLNGO.js → chunk-RTPVI7LE.js} +1 -1
- package/dist/{chunk-U3MSTPZP.js → chunk-SFZQFEZB.js} +1 -1
- package/dist/{chunk-7AY6HLQG.js → chunk-STCLJWHD.js} +1 -1
- package/dist/{chunk-7AYYQUJG.js → chunk-STJWHL36.js} +1 -1
- package/dist/{chunk-NYG2VQFQ.js → chunk-SZJHOXS6.js} +1 -1
- package/dist/{chunk-DZMXYETH.js → chunk-TEPMNVJN.js} +1 -1
- package/dist/{chunk-ML6SILEL.js → chunk-TNSMROUR.js} +1 -1
- package/dist/chunk-TR4OWSEX.js +77 -0
- package/dist/{chunk-AUAUAK6P.js → chunk-U3P5TIIR.js} +1 -1
- package/dist/{chunk-CEBDKIVH.js → chunk-UDDJQ34Y.js} +1 -1
- package/dist/chunk-UKQ7NE5V.js +1 -0
- package/dist/{chunk-KMQE7WFZ.js → chunk-UOQBCBKY.js} +1 -1
- package/dist/{chunk-RTINXD5Z.js → chunk-UQWT2PFO.js} +1 -1
- package/dist/{chunk-AATUQ2AY.js → chunk-UTK6V2NE.js} +80 -80
- package/dist/{chunk-XDV4PRFT.js → chunk-V26QBVCN.js} +1 -1
- package/dist/{chunk-T35C6NC7.js → chunk-VVEQ4IHW.js} +1 -1
- package/dist/chunk-VXBHTSMX.js +20 -0
- package/dist/chunk-W2357IN2.js +2 -0
- package/dist/chunk-W6ST525S.js +99 -0
- package/dist/chunk-WDCCITSG.js +1 -0
- package/dist/{chunk-5VRU3BT5.js → chunk-WE3VLC2S.js} +1 -1
- package/dist/chunk-WGMYSPR2.js +10 -0
- package/dist/chunk-WHT2RCAD.js +11 -0
- package/dist/{chunk-YWQPSMRZ.js → chunk-WOYI6SDK.js} +1 -1
- package/dist/{chunk-BUVP2UUA.js → chunk-WXJGZGQS.js} +1 -1
- package/dist/{chunk-DELISRUH.js → chunk-X4AZV5A2.js} +1 -1
- package/dist/{chunk-7PVNAILK.js → chunk-X5RH4ALT.js} +1 -1
- package/dist/{chunk-2TJ6LOCC.js → chunk-XBBP5BWC.js} +1 -1
- package/dist/{chunk-4UJNCOE6.js → chunk-XH32NPYG.js} +1 -1
- package/dist/{chunk-PEYYIWP6.js → chunk-XZ2KUBFJ.js} +1 -1
- package/dist/{chunk-TC3JOEMA.js → chunk-Y2PC2BBJ.js} +60 -60
- package/dist/{chunk-I5X3IP6T.js → chunk-Y7A7Z2V3.js} +1 -1
- package/dist/{chunk-UW6YEKST.js → chunk-YE7XCF44.js} +1 -1
- package/dist/{chunk-LXOBFJZO.js → chunk-YHH3JA36.js} +1 -1
- package/dist/chunk-YIFT67BD.js +4 -0
- package/dist/{chunk-34SINZ7L.js → chunk-YR7K4NQT.js} +1 -1
- package/dist/{chunk-VGSH33QU.js → chunk-Z36JS7OX.js} +1 -1
- package/dist/{chunk-WDSBR7KX.js → chunk-ZHPPBTNE.js} +1 -1
- package/dist/chunk-ZMSE5SQB.js +1 -0
- package/dist/cli/commands/app/app-logs/sources.js +1 -1
- package/dist/cli/commands/app/build.js +1 -1
- package/dist/cli/commands/app/bulk/cancel.js +1 -1
- package/dist/cli/commands/app/bulk/execute.js +1 -1
- package/dist/cli/commands/app/bulk/status.js +1 -1
- package/dist/cli/commands/app/config/link.js +1 -1
- package/dist/cli/commands/app/config/pull.js +1 -1
- package/dist/cli/commands/app/config/use.js +1 -1
- package/dist/cli/commands/app/config/validate.js +1 -1
- package/dist/cli/commands/app/demo/watcher.js +1 -1
- package/dist/cli/commands/app/deploy.js +1 -1
- package/dist/cli/commands/app/dev/clean.js +1 -1
- package/dist/cli/commands/app/dev.js +1 -1
- package/dist/cli/commands/app/env/pull.js +1 -1
- package/dist/cli/commands/app/env/show.js +1 -1
- package/dist/cli/commands/app/execute.js +1 -1
- package/dist/cli/commands/app/function/build.js +1 -1
- package/dist/cli/commands/app/function/info.js +1 -1
- package/dist/cli/commands/app/function/replay.js +1 -1
- package/dist/cli/commands/app/function/run.js +1 -1
- package/dist/cli/commands/app/function/schema.js +1 -1
- package/dist/cli/commands/app/function/typegen.js +1 -1
- package/dist/cli/commands/app/generate/extension.js +1 -1
- package/dist/cli/commands/app/graphiql.js +1 -1
- package/dist/cli/commands/app/import-custom-data-definitions.js +1 -1
- package/dist/cli/commands/app/import-extensions.js +1 -1
- package/dist/cli/commands/app/info.js +1 -1
- package/dist/cli/commands/app/init.js +1 -1
- package/dist/cli/commands/app/logs.js +1 -1
- package/dist/cli/commands/app/release.js +1 -1
- package/dist/cli/commands/app/versions/list.js +1 -1
- package/dist/cli/commands/app/webhook/trigger.js +1 -1
- package/dist/cli/commands/auth/login.js +1 -1
- package/dist/cli/commands/auth/logout.js +1 -1
- package/dist/cli/commands/cache/clear.js +1 -1
- package/dist/cli/commands/config/autoupgrade/off.js +1 -1
- package/dist/cli/commands/config/autoupgrade/on.js +1 -1
- package/dist/cli/commands/config/autoupgrade/status.js +1 -1
- package/dist/cli/commands/debug/command-flags.js +1 -1
- package/dist/cli/commands/doc/fetch.js +1 -1
- package/dist/cli/commands/doc/search.js +1 -1
- package/dist/cli/commands/docs/generate.js +1 -1
- package/dist/cli/commands/doctor-release/doctor-release.js +1 -1
- package/dist/cli/commands/doctor-release/theme/index.js +1 -1
- package/dist/cli/commands/help.js +1 -1
- package/dist/cli/commands/kitchen-sink/async.js +1 -1
- package/dist/cli/commands/kitchen-sink/index.js +1 -1
- package/dist/cli/commands/kitchen-sink/prompts.js +1 -1
- package/dist/cli/commands/kitchen-sink/static.js +1 -1
- package/dist/cli/commands/notifications/generate.js +1 -1
- package/dist/cli/commands/notifications/list.js +1 -1
- package/dist/cli/commands/organization/list.js +1 -1
- package/dist/cli/commands/search.js +1 -1
- package/dist/cli/commands/theme/check.js +1 -1
- package/dist/cli/commands/theme/console.js +1 -1
- package/dist/cli/commands/theme/delete.js +1 -1
- package/dist/cli/commands/theme/dev.js +1 -1
- package/dist/cli/commands/theme/duplicate.js +1 -1
- package/dist/cli/commands/theme/info.js +1 -1
- package/dist/cli/commands/theme/init.js +1 -1
- package/dist/cli/commands/theme/language-server.js +1 -1
- package/dist/cli/commands/theme/list.js +1 -1
- package/dist/cli/commands/theme/metafields/pull.js +1 -1
- package/dist/cli/commands/theme/open.js +1 -1
- package/dist/cli/commands/theme/package.js +1 -1
- package/dist/cli/commands/theme/preview.js +1 -1
- package/dist/cli/commands/theme/profile.js +1 -1
- package/dist/cli/commands/theme/publish.js +1 -1
- package/dist/cli/commands/theme/pull.js +1 -1
- package/dist/cli/commands/theme/push.js +1 -1
- package/dist/cli/commands/theme/rename.js +1 -1
- package/dist/cli/commands/theme/share.js +1 -1
- package/dist/cli/commands/upgrade.js +1 -1
- package/dist/cli/commands/version.js +1 -1
- package/dist/cli/help.js +1 -1
- package/dist/command-registry.js +1 -1
- package/dist/conf-store-YW3NWYCN.js +1 -0
- package/dist/custom-oclif-loader-4ZAXX5MR.js +1 -0
- package/dist/deprecations-VW7UIMZX.js +1 -0
- package/dist/dist-I3VCRVOE.js +1 -0
- package/dist/dist-MP4AU5F4.js +1 -0
- package/dist/environments-5P57CTOG.js +1 -0
- package/dist/error-U7DOQOWG.js +1 -0
- package/dist/error-handler-AOEXPYI7.js +1 -0
- package/dist/{fs-B4UJTUCD.js → fs-K5NT4W2Q.js} +1 -1
- package/dist/hooks/app-init.js +1 -1
- package/dist/hooks/did-you-mean.js +1 -1
- package/dist/hooks/hydrogen-init.js +1 -1
- package/dist/hooks/plugin-plugins.js +1 -1
- package/dist/hooks/postrun.js +1 -1
- package/dist/hooks/prerun.js +1 -1
- package/dist/hooks/public-metadata.js +1 -1
- package/dist/hooks/sensitive-metadata.js +1 -1
- package/dist/hooks/tunnel-provider.js +1 -1
- package/dist/hooks/tunnel-start.js +1 -1
- package/dist/{http-proxy-node16-X2WAMUT5.js → http-proxy-node16-A6AKKRQH.js} +1 -1
- package/dist/index.js +15 -15
- package/dist/is-global-CFYYUAIJ.js +1 -0
- package/dist/{latest-version-32HXMWJ7.js → latest-version-LDWU5F7A.js} +7 -7
- package/dist/lib-2BR2WN7L.js +1 -0
- package/dist/lib-JKLF33A7.js +1 -0
- package/dist/{lib-NOROGV6N.js → lib-P3APEIHY.js} +1 -1
- package/dist/local-BRRQOCGY.js +1 -0
- package/dist/local-storage-FVSI2IBZ.js +1 -0
- package/dist/{metadata-FREAI3KR.js → metadata-HVSGVFUQ.js} +1 -1
- package/dist/{morph-QZGREMO2.js → morph-ABSWZEVT.js} +4 -4
- package/dist/node-package-manager-6JURLQKU.js +1 -0
- package/dist/notifications-system-BTEFKXCS.js +1 -0
- package/dist/out-53ABAVL7.js +1 -0
- package/dist/{output-VUR2QZPW.js → output-EXMTVS2V.js} +1 -1
- package/dist/system-DUJDILSL.js +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui-AX6ZMY6P.js +1 -0
- package/dist/upgrade-5TEVQNLY.js +1 -0
- package/dist/version-7LKOAVDW.js +1 -0
- package/dist/version-PRFBZAWQ.js +1 -0
- package/dist/{workerd-KPQTFQD4.js → workerd-MFV7EBVM.js} +1 -1
- package/oclif.manifest.json +612 -2
- package/package.json +11 -11
- package/dist/analytics-M7ZU437S.js +0 -1
- package/dist/analytics-ZRM4FEOE.js +0 -1
- package/dist/assets/dev-console/extensions/dev-console/assets/apple-touch-icon-BXMqQaSW.png +0 -0
- package/dist/assets/dev-console/extensions/dev-console/assets/favicon-16x16-B6uL8SrV.png +0 -0
- package/dist/assets/dev-console/extensions/dev-console/assets/favicon-32x32-CGwlpz_y.png +0 -0
- package/dist/assets/dev-console/extensions/dev-console/assets/favicon-ByUl89Ab.ico +0 -0
- package/dist/assets/dev-console/extensions/dev-console/assets/index-Bm_GpKQW.js +0 -51
- package/dist/assets/dev-console/extensions/dev-console/assets/index-DISeE29z.css +0 -1
- package/dist/assets/dev-console/extensions/dev-console/assets/site-B9Ae890R.webmanifest +0 -19
- package/dist/assets/dev-console/index.html +0 -21
- package/dist/chunk-2O22LZKV.js +0 -44
- package/dist/chunk-3IFZECSI.js +0 -22
- package/dist/chunk-4MLEL3VK.js +0 -283
- package/dist/chunk-4P54DKG4.js +0 -3
- package/dist/chunk-4ROX2TCK.js +0 -1
- package/dist/chunk-5C7HDTHJ.js +0 -1
- package/dist/chunk-5VC4XXYH.js +0 -1
- package/dist/chunk-7RJPTSL6.js +0 -7
- package/dist/chunk-ADKFAPED.js +0 -21
- package/dist/chunk-B5MFFERE.js +0 -1
- package/dist/chunk-BLSWUNOK.js +0 -16
- package/dist/chunk-DN3BB4IO.js +0 -103
- package/dist/chunk-EAOT5CK5.js +0 -2
- package/dist/chunk-G6BFXMOV.js +0 -2
- package/dist/chunk-GMAZ2BQY.js +0 -26
- package/dist/chunk-HYF3VJYS.js +0 -3
- package/dist/chunk-IIFRDOYG.js +0 -1
- package/dist/chunk-KB6H5LQJ.js +0 -4
- package/dist/chunk-LKZ7ARYS.js +0 -18
- package/dist/chunk-MYQTAM77.js +0 -2
- package/dist/chunk-NGCPVRDM.js +0 -1
- package/dist/chunk-NJOO5XJV.js +0 -1
- package/dist/chunk-NNOSZ447.js +0 -1
- package/dist/chunk-NVA2354A.js +0 -5
- package/dist/chunk-NWH3TAHK.js +0 -1
- package/dist/chunk-OCBGHOH2.js +0 -19
- package/dist/chunk-P7U6BWKN.js +0 -1
- package/dist/chunk-QFXJNFMI.js +0 -1
- package/dist/chunk-R7QYSC6T.js +0 -567
- package/dist/chunk-RE652L3G.js +0 -1
- package/dist/chunk-SSDEWKDZ.js +0 -6
- package/dist/chunk-T6CC5WUU.js +0 -159
- package/dist/chunk-TB7HFPBB.js +0 -370
- package/dist/chunk-TIU7MMRT.js +0 -836
- package/dist/chunk-TTEY5PLR.js +0 -10
- package/dist/chunk-U4HLIXRH.js +0 -4
- package/dist/chunk-UAYIFFYJ.js +0 -11
- package/dist/chunk-UHIP5CFI.js +0 -1
- package/dist/chunk-UMFVRG33.js +0 -5
- package/dist/chunk-WTRKTFVE.js +0 -2
- package/dist/chunk-X3VG75LO.js +0 -1
- package/dist/chunk-XSUZPWYV.js +0 -5
- package/dist/chunk-Z33MWGCG.js +0 -1
- package/dist/chunk-ZIM2G3EP.js +0 -1
- package/dist/chunk-ZSYMRT3S.js +0 -4
- package/dist/conf-store-HOA62HKK.js +0 -1
- package/dist/custom-oclif-loader-3AICQCNU.js +0 -1
- package/dist/deprecations-2FTB7JEW.js +0 -1
- package/dist/dist-63JMGNUL.js +0 -1
- package/dist/dist-6TY6L7OW.js +0 -1
- package/dist/environments-XVYTKHRZ.js +0 -1
- package/dist/error-SDU6RPQQ.js +0 -1
- package/dist/error-handler-4YEBBCUH.js +0 -1
- package/dist/is-global-5LFZDDNH.js +0 -1
- package/dist/lib-QJDPPAWN.js +0 -1
- package/dist/lib-UCG2DNMS.js +0 -1
- package/dist/local-VTYGIJVD.js +0 -1
- package/dist/local-storage-A6NBLBB2.js +0 -1
- package/dist/node-package-manager-N5SUT2WN.js +0 -1
- package/dist/notifications-system-P3SUTD25.js +0 -1
- package/dist/out-CDCY25QC.js +0 -1
- package/dist/system-OXF2P5CT.js +0 -1
- package/dist/ui-N2C5FC3G.js +0 -1
- package/dist/upgrade-AJ36IT7H.js +0 -1
- package/dist/version-DSFP332V.js +0 -1
- package/dist/version-HUOO3XOE.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b}from"./chunk-
|
|
1
|
+
import{b}from"./chunk-HVMEBH24.js";import{a as F}from"./chunk-LDWMX3KZ.js";import{j as h,l as u,o as T}from"./chunk-NKT5U6IJ.js";import{p as y,v as O}from"./chunk-445NFHXL.js";import{b as I}from"./chunk-4TANJ4JK.js";import{n as f,ra as v}from"./chunk-AFM3UZQO.js";import{v as _}from"./chunk-JX4HSDDG.js";import{m as s}from"./chunk-2GB3EAD3.js";import{Mb as S,Ua as l,ma as c}from"./chunk-BCZMDFI2.js";import{a as U}from"./chunk-CTNBSUVU.js";import{e as A,g as p}from"./chunk-VKWPEFWQ.js";p();p();p();async function P({session:e,overridesContent:r,themeId:t}){v("theme-preview:create");let w=`${u(e)}/theme_preview.json?preview_theme_id=${t}`,o=await h(e,{headers:{"Content-Type":"application/json"}}),i=await f(w,{method:"POST",body:r,headers:o});if(!i.ok)throw new s(`Theme preview request failed with status ${i.status}: ${i.statusText}`);let a=await J(i);return v("theme-preview:create"),a}async function g({session:e,overridesContent:r,themeId:t,previewIdentifier:d}){v("theme-preview:update");let o=`${u(e)}/theme_preview.json?preview_theme_id=${t}&preview_identifier=${encodeURIComponent(d)}`,i=await h(e,{headers:{"Content-Type":"application/json"}}),a=await f(o,{method:"POST",body:r,headers:i});if(!a.ok)throw new s(`Theme preview request failed with status ${a.status}: ${a.statusText}`);let x=await J(a);return v("theme-preview:update"),x}async function J(e){let r=await e.json();if(r.error)throw new s(`Theme preview failed: ${r.error}`);if(!r.url||!r.preview_identifier)throw new s("Theme preview returned an unexpected response");return{url:r.url,preview_identifier:r.preview_identifier}}async function $(e){if(!l(e.overrideJson))throw new s(`Override file not found: ${e.overrideJson}`);let r=await c(e.overrideJson),t;try{t=JSON.parse(r)}catch(i){let a=i instanceof Error?i.message:String(i);throw new s(`Failed to parse override file: ${e.overrideJson}`,a)}let d=await T(e.themeId,e.adminSession,e.password),w=JSON.stringify(t),o=e.previewIdentifier?await g({session:d,overridesContent:w,themeId:e.themeId,previewIdentifier:e.previewIdentifier}):await P({session:d,overridesContent:w,themeId:e.themeId});e.json?S(JSON.stringify({url:o.url,preview_identifier:o.preview_identifier})):_({body:[{list:{title:e.previewIdentifier?"Preview updated":"Preview is ready",items:[{link:{url:o.url}},`Preview ID: ${o.preview_identifier}`]}}]}),e.open&&b(o.url,"theme preview")}var m=A(U(),1);var E,n=class extends O{async command(r,t){let d=await F(t,{filter:{theme:r.theme}});await $({adminSession:t,overrideJson:r.overrides,themeId:d.id.toString(),previewIdentifier:r["preview-id"],open:r.open,password:r.password,json:r.json})}};E=n;n.summary="Applies JSON overrides to a theme and returns a preview URL.";n.descriptionWithMarkdown="Applies a JSON overrides file to a theme and creates or updates a preview. This lets you quickly preview changes.\n\n The command returns a preview URL and a preview identifier. You can reuse the preview identifier with `--preview-id` to update an existing preview instead of creating a new one.";n.description=E.descriptionWithoutMarkdown();n.flags={...I,...y,theme:m.Flags.string({char:"t",description:"Theme ID or name of the remote theme.",env:"SHOPIFY_FLAG_THEME_ID",required:!0}),overrides:m.Flags.string({description:"Path to a JSON overrides file.",env:"SHOPIFY_FLAG_OVERRIDES",required:!0}),"preview-id":m.Flags.string({description:"An existing preview identifier to update instead of creating a new preview.",env:"SHOPIFY_FLAG_PREVIEW_ID"}),open:m.Flags.boolean({description:"Automatically launch the theme preview in your default web browser.",env:"SHOPIFY_FLAG_OPEN",default:!1}),json:m.Flags.boolean({description:"Output the preview URL and identifier as JSON.",env:"SHOPIFY_FLAG_JSON",default:!1})};n.multiEnvironmentsFlags=null;var ee=n;export{ee as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as r}from"./chunk-
|
|
1
|
+
import{b as r}from"./chunk-NKBSS7YL.js";import{b as a}from"./chunk-WHT2RCAD.js";import{g as t}from"./chunk-VKWPEFWQ.js";t();var i=class extends a{static{this.summary="Upgrades Shopify CLI."}static{this.descriptionWithMarkdown="Upgrades Shopify CLI using your package manager."}static{this.description=this.descriptionWithoutMarkdown()}async run(){await r()}};export{i as a};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import{a as Ir}from"./chunk-R2W5B7YI.js";import{a as bt}from"./chunk-UOHNRH6E.js";import{a as br}from"./chunk-NEK2KNKR.js";import{a as Sr}from"./chunk-XBBP5BWC.js";import{a as Ar}from"./chunk-V26QBVCN.js";import{a as Ur}from"./chunk-5Q4WAGQL.js";import{a as Rr}from"./chunk-STJWHL36.js";import{b as _r}from"./chunk-CNI7ZUST.js";import{a as Cr}from"./chunk-ZHPPBTNE.js";import{a as kr}from"./chunk-PKR6HS4T.js";import{a as dr}from"./chunk-MPYCIVRA.js";import{a as fr}from"./chunk-BDDROQGK.js";import{a as hr}from"./chunk-7US4TVO2.js";import{a as gr}from"./chunk-PUOCHFFI.js";import{a as wr}from"./chunk-MDQHEW7V.js";import{a as yr}from"./chunk-H5I7BSNG.js";import{a as Pr,b as vr,c as xr,d as Er}from"./chunk-FGG6HXIZ.js";import{a as Tr}from"./chunk-AHLNB45E.js";import{g as mr}from"./chunk-7MD5MIGN.js";import{a as uo,b as mo,c as fo,d as ho}from"./chunk-J3D4KQOQ.js";import{a as cr}from"./chunk-JRTJZAFJ.js";import{a as ur}from"./chunk-OHQTOHUX.js";import{a as Ze}from"./chunk-RMF3YNWE.js";import{a as pr}from"./chunk-TEPMNVJN.js";import{c as Xe,m as et}from"./chunk-NKT5U6IJ.js";import{b as lr,g as Ce,j as Je}from"./chunk-Y7A7Z2V3.js";import{a as ar,b as ir,c as co,d as lo,e as ot,f as po,g as go}from"./chunk-WOYI6SDK.js";import{a as $,b as Qe}from"./chunk-PCTVUTV3.js";import{a as er,b as tr,d as Ae,f as rr,m as _e,n as H,s as q,u as or,v as nr,w as sr}from"./chunk-Q7BOSHWX.js";import{c as Lr}from"./chunk-DC7TXY4K.js";import{a as Zt}from"./chunk-XZ2KUBFJ.js";import{a as to,b as rt,c as te,d as ro}from"./chunk-534U3DKZ.js";import{a as wo,f as yo,g as Po,h as nt,i as vo,j as xo,k as Eo,l as bo,m as So,n as Uo,o as Ro,p as To,q as Ao,v as _o,x as Co,z as st}from"./chunk-QEL3F2NY.js";import{a as oo,b as no,c as so,d as ao,e as io}from"./chunk-MMP3F6LO.js";import{a as Mr}from"./chunk-M5YGJYNI.js";import{a as eo}from"./chunk-EZBB2ULE.js";import{a as Zr}from"./chunk-WDCCITSG.js";import{a as $r}from"./chunk-NENUUNWB.js";import{a as ko}from"./chunk-25Z36VJG.js";import{C as jr,E as zr,G as ee,N as Yr,O as Qr,Y as Jr,i as Dr,j as W,k as Fr,m as Nr,na as Ie,oa as Le,p as tt,q as qr,s as Wr,t as Hr,ta as Xr,u as Gr,v as Br,w as Kr}from"./chunk-5HJTCBBV.js";import{X as Vr,e as ke,j as ce,p as Or}from"./chunk-7EE7YOCR.js";import{c as Jt}from"./chunk-WE3VLC2S.js";import{a as j}from"./chunk-X5RH4ALT.js";import{b as Xt,e as Te}from"./chunk-4TANJ4JK.js";import{$ as Dt,N as Mt,Z as X,a as ze,c as At,e as _t,g as Ct,k as kt,m as It,p as Lt,qa as Ft,s as $t,t as xe,y as Ee}from"./chunk-AFM3UZQO.js";import{D as Se,H as Kt,J as Ue,O as Re,P as ie,Q as Ve,R as zt,T as Yt,a as Tt,i as Nt,j as qt,k as Wt,l as D,m as Ht,n as Ye,o as Gt,p as Bt,u as be,w as ae}from"./chunk-JX4HSDDG.js";import{a as In}from"./chunk-7UNQOKZW.js";import{d as Ot}from"./chunk-STCLJWHD.js";import{f as Rt,m as T,p as Z,u as jt}from"./chunk-2GB3EAD3.js";import{$a as xt,Ea as vt,Fb as v,Hb as b,Mb as K,Na as ge,P as Ke,Pb as g,Qb as C,Ta as F,Wa as we,cb as Et,eb as ye,fb as k,gb as L,jb as Pe,kb as ve,ma as I,mb as St,nb as Ut,tb as je,ua as fe,wa as he}from"./chunk-BCZMDFI2.js";import{d as Vt,f as Qt}from"./chunk-EQNJ2NQD.js";import{a as ht}from"./chunk-UKQ7NE5V.js";import{d as S,f as Be,g as gt,i as de,j as wt,k as me,o as yt,p as Pt}from"./chunk-773TIA5M.js";import{a as kn}from"./chunk-CTNBSUVU.js";import{e as J,g as p}from"./chunk-VKWPEFWQ.js";p();p();p();p();p();p();var Ln=300*1e3,$n='The host theme could not be created to host your theme app extension. Please try again or use the "--theme" flag to use an existing theme as the host theme.';async function Io(t,e,r=Date.now()){for(;await Mn(t,e,r););}async function Mn(t,e,r){let o=await Ce(t,e);if(!o||Dn(o,r))throw new T($n);return await ie(3),o.processing}function Dn(t,e){return t.processing&&Date.now()-e>=Ln}var Fn="https://codeload.github.com/Shopify/dawn/zip/refs/tags/v15.0.0",On="https://cdn.shopify.com/theme-store/uhrdefhlndzaoyrgylhto59sx2i7.jpg",at=3,$e=class extends pr{constructor(e,r={devPreview:!1}){super(e),this.context="App Ext. Host",this.themeId=Pr(e.storeFqdn),this.devPreview=r.devPreview}async findOrCreate(){let e=await this.fetch();return e??(e=this.devPreview?await this.createHostTheme():await this.create()),e}setTheme(e){vr(this.adminSession.storeFqdn,e)}removeTheme(){xr(this.adminSession.storeFqdn)}async createHostTheme(){let e={role:lr,name:this.generateThemeName(this.context),src:Fn};for(let o=0;o<at;o++){g(`Attempt ${o}/${at}: Creating theme with name "${e.name}" and role "${e.role}"`);try{let n=await Je(e,this.adminSession);if(n)return this.setTheme(n.id.toString()),g(`Waiting for theme with id "${n.id}" to be processed`),await Io(n.id,this.adminSession),n;throw new Error}catch{g(`Failed to create theme with name "${e.name}" and role "${e.role}". Retrying...`)}}g(`Theme creation failed after ${at} retries. Creating theme using fallback theme zip`);let r=await Je({...e,src:On},this.adminSession);if(!r)throw g("Theme creation failed. Exiting process."),new Z(`Could not create theme with name "${e.name}" and role "${e.role}"`);return r}};p();var Nn={"theme:init":wr,"theme:check":cr,"theme:console":ur,"theme:delete":dr,"theme:dev":fr,"theme:duplicate":hr,"theme:info":gr,"theme:language-server":yr,"theme:list":Er,"theme:metafields:pull":Tr,"theme:open":br,"theme:package":Sr,"theme:profile":Ur,"theme:publish":Rr,"theme:preview":Ar,"theme:pull":_r,"theme:push":Cr,"theme:rename":kr,"theme:share":Ir},La=Nn;async function Lo(t){let{remoteApp:e,localApp:r}=t,n=r.allExtensions.filter(U=>U.isThemeExtension);if(n.length===0)return;let a=n[0].directory,i=t.themeExtensionPort??9293,[c,d]=await Promise.all([Mt(t.storeFqdn),Hn(e)]),l=c.storeFqdn,[u,h]=await Promise.all([et(c),Xe(c)]),w=h?await Ze(t.storePassword,l,u):void 0,m=await Wn(c,t.theme),f=m.id.toString();return be({headline:"The theme app extension development server is ready.",orderedNextSteps:!0,nextSteps:[[{link:{label:"Install your app in your development store",url:d}}],[{link:{label:"Setup your theme app extension in the host theme",url:`https://${l}/admin/themes/${f}/editor`}}],["Preview your theme app extension at",{link:{label:`http://127.0.0.1:${i}`,url:`http://127.0.0.1:${i}`}}]]}),{type:"theme-app-extensions",prefix:"theme-extensions",function:qn,options:{theme:m,adminSession:c,storefrontPassword:w,crawlerSignatureHeaders:u,themeExtensionDirectory:a,themeExtensionPort:i}}}var qn=async(t,{theme:e,adminSession:r,storefrontPassword:o,crawlerSignatureHeaders:n,themeExtensionDirectory:s,themeExtensionPort:a})=>{await(await mr(e,{adminSession:r,storefrontPassword:o,crawlerSignatureHeaders:n,themeExtensionDirectory:s,themeExtensionPort:a})).start()};async function Wn(t,e){let r;if(e)g(`Fetching theme with provided id ${e}`),r=await Ce(parseInt(e,10),t);else{let o=new $e(t,{devPreview:!0});await Se([{title:"Configuring host theme for theme app extension",task:async()=>{g("Finding or creating host theme for theme app extensions"),r=await o.findOrCreate()}}])}if(!r)throw new T("Could not find or create a host theme for theme app extensions");return r}async function Hn(t){return t.developerPlatformClient?.clientName===Vr.AppManagement?`https://${await xe()}/?organization_id=${t.organizationId}&no_redirect=true&redirect=/oauth/redirect_from_developer_dashboard?client_id%3D${t.apiKey}`:`https://${await $t()}/${t.organizationId}/apps/${t.id}/test`}p();p();p();p();p();p();async function Gn(t){let e=S(t.directory,"locales");return we([S(e,"*.json")])}async function $o(t,e){let r=await Gn(t);if(!r.length)return{localization:void 0,status:""};let o=e.currentLocalizationPayload??{defaultLocale:"en",translations:{},lastUpdated:0},n="success";try{await Promise.all(r.map(async s=>{let[a,...i]=s.split("/").pop().split(".");if(a)return i[0]==="default"&&(o.defaultLocale=a),Bn(a,s,o,t,e)})),o.lastUpdated=Date.now(),g(`Parsed locales for extension ${t.handle} at ${t.directory}`,e.stdout)}catch{n="error"}return{localization:o,status:n}}async function Bn(t,e,r,o,n){let s;try{s=await I(e),r.translations[t]=JSON.parse(s)}catch(a){let i=`Error parsing ${t} locale for ${o.handle} at ${e}: ${a.message}`;throw C(i,n.stderr),new jt.ExtendableError(i)}}p();function Me(t,e){switch(t){case"checkout_ui_extension":return{url:e.checkoutCartUrl};case"checkout_post_purchase":return{url:e.checkoutCartUrl};case"product_subscription":return{url:e.subscriptionProductUrl??""};default:return{url:""}}}var it=".js.map";async function re(t,e,r,o){return D({outputPrefix:t.outputPrefix},async()=>{o?.clear();let n=t.getOutputPathForDirectory(e),s=`${r.url}/extensions/${t.devUUID}`,{localization:a,status:i}=await $o(t,r),c=await Fr(t),d=t.outputRelativePath?de(n):n,l=await Kn(t,s,d,o),u=null;return"metafields"in t.configuration&&Array.isArray(t.configuration.metafields)&&t.configuration.metafields.length>0&&(u=t.configuration.metafields),{assets:{main:le(l)&&l[0]?.assets?.main?l[0].assets.main:{name:"main",url:`${s}/assets/${t.outputFileName}`,lastUpdated:await ge(n)??0}},supportedFeatures:{runsOffline:t.configuration.supported_features?.runs_offline??!1},capabilities:{blockProgress:t.configuration.capabilities?.block_progress??!1,networkAccess:t.configuration.capabilities?.network_access??!1,apiAccess:t.configuration.capabilities?.api_access??!1,collectBuyerConsent:{smsMarketing:t.configuration.capabilities?.collect_buyer_consent?.sms_marketing??!1,customerPrivacy:t.configuration.capabilities?.collect_buyer_consent?.customer_privacy??!1},iframe:{sources:t.configuration.capabilities?.iframe?.sources??[]}},development:{...r.currentDevelopmentPayload,resource:Me(t.type,r),root:{url:s},hidden:r.currentDevelopmentPayload?.hidden??!1,localizationStatus:i,status:r.currentDevelopmentPayload?.status??"success",...r.currentDevelopmentPayload??{status:"success"}},extensionPoints:l,localization:a??null,metafields:u,type:t.type,externalType:t.externalType,uuid:t.devUUID,surface:t.surface,version:c?.version,title:t.name,handle:t.handle,name:t.name,description:t.configuration.description,apiVersion:t.configuration.api_version,approvalScopes:r.grantedScopes,settings:t.configuration.settings}})}async function Kn(t,e,r,o){let n=t.configuration,s=n.extension_points??n.targeting;if(t.type==="checkout_post_purchase"&&(s=[{target:"purchase.post.render"}]),le(s)){let a=await jn(r);return Promise.all(s.map(async i=>{let{target:c,resource:d}=i,l={...i,surface:Le(c),root:{url:`${e}/${c}`},resource:d||{url:""}},u=a?.[c];if(!u)return l;let w=await Xn(u,{target:c,extensionPoint:i,url:e,extension:t,buildDirectory:r,resolver:o});return{...l,...w}}))}return s}async function jn(t){try{let e=S(t,"manifest.json"),r=await I(e);return JSON.parse(r)}catch(e){if(e instanceof SyntaxError)throw new Error(`Invalid manifest.json in ${t}: ${e.message}`);return null}}async function zn({target:t,extensionPoint:e,url:r,extension:o,resolver:n},s,a){let i=`${t}/${s}`,c=e[s];if(typeof c=="string"){let w=await De(s,i,typeof a=="string"?a:c,r,o,n,typeof a=="string"?c:void 0);return{assets:{[w.name]:w}}}let l=e.build_manifest?.assets?.[s];if(l?.filepath){let u=await De(s,i,l.filepath,r,o,n,l.module);return{assets:{[u.name]:u}}}return{}}async function Yn({target:t,url:e,buildDirectory:r,resolver:o},n,s){if(s.length===0)return{};for(let i of s)o?.set(`${t}/${i}`,i);let a=await Promise.all(s.map(async i=>await ge(S(r,i))??0));return{assets:{[n]:{name:n,url:`${e}/assets/${t}/`,lastUpdated:Math.max(...a)}}}}async function Vn({target:t,extensionPoint:e,url:r,extension:o,resolver:n},s){return e.intents?{intents:await Promise.all(e.intents.map(async(i,c)=>{let d=i.schema,l=s[c]?.schema,u=typeof l=="string"?l:d,h=typeof l=="string"?d:void 0;return{...i,schema:await De("schema",`${t}/intents/${c}/schema`,u,r,o,n,h)}}))}:{}}async function Qn({target:t,url:e,extension:r,resolver:o},n,s){let a=await De(n,`${t}/${n}`,s,e,r,o);return await Jn(t,s,r,o),{assets:{[a.name]:a}}}async function Jn(t,e,r,o){if(!o)return;let n=`${e}.map`;n.endsWith(it)&&await F(S(r.directory,n))&&o.set(`${t}/${wt(n)}`,n)}async function Xn(t,e){return(await Promise.all(Object.keys(t).map(async o=>{let n=t[o];return Zn(o,n)?Vn(e,n):es(o,n)?Qn(e,o,n):ts(o,n)?Yn(e,o,n):zn(e,o,n)}))).reduce((o,n)=>({...o,...n,assets:{...o.assets,...n.assets}}),{})}function le(t){return Array.isArray(t)&&t.every(e=>typeof e=="object")}async function De(t,e,r,o,n,s,a){let i=`${e}${me(r)}`;return s?.set(i,r),{name:t,url:`${o}/assets/${i}`,lastUpdated:await ge(S(n.directory,a??r))??0}}function Zn(t,e){return t==="intents"&&Array.isArray(e)}function es(t,e){return(t==="main"||t==="should_render")&&typeof e=="string"}function ts(t,e){return t==="assets"&&Array.isArray(e)&&e.every(r=>typeof r=="string")}import{EventEmitter as rs}from"events";var pe;(function(t){t.Update="PayloadUpdatedEvent:UPDATE"})(pe||(pe={}));async function Mo(t,e,r){return{app:{title:t.appName,apiKey:t.apiKey,url:co(t.storeFqdn,t.apiKey),mobileUrl:po(t.storeFqdn,t.apiKey)},appId:t.id,version:t.manifestVersion,root:{url:new URL("/extensions",t.url).toString()},socket:{url:t.websocketURL},devConsole:{url:new URL("/extensions/dev-console",t.url).toString()},store:t.storeFqdn,extensions:await Promise.all(t.extensions.filter(n=>n.isPreviewable).map(n=>re(n,e,t,r&&ct(r,n.devUUID))))}}function ct(t,e){let r=t.get(e);return r||(r=new Map,t.set(e,r)),r}var Fe=class extends rs{constructor(e,r,o=new Map){super(),this.rawPayload=e,this.options=r,this.assetResolvers=o}getAssetResolver(e){return this.assetResolvers.get(e)}getConnectedPayload(){let e=this.getRawPayload();return{app:e.app,appId:e.appId,store:e.store,extensions:e.extensions}}getRawPayloadFilteredByExtensionIds(e){return{...this.rawPayload,extensions:this.rawPayload.extensions.filter(r=>e.includes(r.uuid))}}getRawPayload(){return this.rawPayload}updateApp(e){this.rawPayload=X(this.rawPayload,{app:e}),this.emitUpdate([])}updateExtensions(e){let r=this.rawPayload.extensions.map(o=>{let n=e.find(s=>s.uuid===o.uuid);if(n){if(le(n.extensionPoints)&&le(o.extensionPoints)){let s=n.extensionPoints.reduce((c,d)=>({...c,[d.target]:d}),{});o.extensionPoints=X(o.extensionPoints,n.extensionPoints,c=>c.map(d=>{let l=s[d.target];return l?X(d,l,(u,h)=>h):d}));let{extensionPoints:a,...i}=n;return X(o,i)}return X(o,n)}return o});this.rawPayload={...this.rawPayload,extensions:r},this.emitUpdate(e.map(o=>o.uuid))}async updateExtension(e,r,o,n){let s=this.rawPayload.extensions,a=s.findIndex(i=>i.uuid===e.devUUID);if(a===-1){g(b`Could not updateExtension() for extension with uuid: ${e.devUUID}`,r.stderr);return}s[a]=await re(e,o,{...this.options,currentDevelopmentPayload:n??{status:s[a]?.development.status},currentLocalizationPayload:s[a]?.localization},ct(this.assetResolvers,e.devUUID)),this.rawPayload.extensions=s,this.emitUpdate([e.devUUID])}deleteExtension(e){let r=this.rawPayload.extensions.findIndex(o=>o.uuid===e.devUUID);r!==-1&&(this.rawPayload.extensions.splice(r,1),this.assetResolvers.delete(e.devUUID),this.emitUpdate([e.devUUID]))}async addExtension(e,r){this.rawPayload.extensions.push(await re(e,r,this.options,ct(this.assetResolvers,e.devUUID))),this.emitUpdate([e.devUUID])}emitUpdate(e){this.emit(pe.Update,e)}};p();p();var z;(function(t){t.Update="update",t.Dispatch="dispatch",t.Log="log"})(z||(z={}));function Do(t,e){return(r,o,n)=>{r.url==="/extensions"&&(g("Upgrading HTTP request to a websocket connection",e.stdout),t.handleUpgrade(r,o,n,os(t,e)))}}function os(t,e){return r=>{g("Websocket connection successfully established",e.stdout);let o={event:"connected",data:e.payloadStore.getConnectedPayload(),version:e.manifestVersion};g(b`Sending connected payload: ${v.json(o)}`,e.stdout),r.send(JSON.stringify(o)),r.on("message",cs(t,e))}}function ns(t){try{let e=JSON.parse(t);if(!Array.isArray(e))return t;let r=e.map(o=>typeof o=="object"&&o!==null?v.json(o).output():String(o)).join(" ");return b`${r}`.value}catch(e){if(e instanceof SyntaxError)return t;throw e}}var ss={debug:t=>v.gray(t),warn:t=>v.yellow(t),error:t=>v.errorText(t)};function as({type:t,message:e}){let r=ns(e);switch(t){case"debug":case"warn":case"error":return b`${ss[t](t.toUpperCase())}: ${r}`.value;case"log":case"info":return r;default:return`${t.toUpperCase()}: ${r}`}}function is(t,e){D({outputPrefix:t.extensionName,stripAnsi:!1},()=>{e.stdout.write(as(t))})}function cs(t,e){return r=>{let o=JSON.parse(r.toString()),{event:n,data:s}=o;if(g(b`Received websocket message with event type ${n} and data:
|
|
2
|
+
${v.json(s)}
|
|
3
|
+
`,e.stdout),n===z.Update){let a=e.payloadStore.getRawPayload().app.apiKey,i=s.app?.apiKey;if(s.app){if(a!==i)return;e.payloadStore.updateApp(s.app)}s.extensions&&e.payloadStore.updateExtensions(s.extensions)}else if(n===z.Dispatch){let a=ls(o,e);Oo(t,a,e)}else n===z.Log&&is(s,e)}}function Fo(t,e){return r=>{let o={event:z.Update,version:e.manifestVersion,data:{...e.payloadStore.getRawPayloadFilteredByExtensionIds(r)}};g(b`Sending websocket update event to the websocket clients:
|
|
4
|
+
${v.json(o)}
|
|
5
|
+
`,e.stdout),Oo(t,o,e)}}function Oo(t,e,r){g(b`Sending websocket with event type ${e.event} and data:
|
|
6
|
+
${v.json(e.data)}
|
|
7
|
+
`,r.stdout);let o=JSON.stringify(e);t.clients.forEach(n=>n.send(o))}function ls(t,e){let r=e.payloadStore.getRawPayload();return{...t,version:e.manifestVersion,data:{...t.data,extensions:[],store:r.store,app:r.app}}}var ps=10;function No(t){let e=new bt.default({noServer:!0,clientTracking:!0}),r=us(e);return t.httpServer.on("upgrade",Do(e,t)),t.payloadStore.on(pe.Update,Fo(e,t)),{close:()=>{e.close(),clearInterval(r)}}}function us(t){return setInterval(()=>{t.clients.forEach(e=>{e.readyState<2&&e.ping()})},ps*1e3)}p();p();p();function qo(t,e){let{url:r}=Me(t.type,e);if(t.surface==="checkout"&&r){let o=new URL(`https://${e.storeFqdn}/`);return o.pathname=r,o.searchParams.append("dev",`${e.url}/extensions`),o.toString()}else{let o=new URL(`https://${e.storeFqdn}/`);return o.pathname="admin/extensions-dev",o.searchParams.append("url",Oe(t,e)),o.toString()}}function Wo(t,e,r){let o=Le(t),n=new URL(`https://${r.storeFqdn}/`);switch(o){case"checkout":n.pathname=r.checkoutCartUrl,n.searchParams.append("dev",`${r.url}/extensions`);break;case"post_purchase":if(n.pathname=r.checkoutCartUrl,n.searchParams.set("script_url",`${r.url}/extensions/${e.devUUID}/assets/${e.localIdentifier}.js`),n.searchParams.set("post_purchase_dev_api_key",r.apiKey),e.devUUID&&r.websocketURL&&(n.searchParams.set("uuid",e.devUUID),n.searchParams.set("socket_url",r.websocketURL)),"metafields"in e.configuration){let s={config:{metafields:e.configuration.metafields}};n.searchParams.set("config",JSON.stringify(s))}break;case"admin":n.pathname="admin/extensions-dev",n.searchParams.append("url",Oe(e,r)),n.searchParams.append("target",t);break;case"customer-accounts":n=ds(e,r,t);break;default:return}return n.toString()}function ds(t,e,r=""){let o=`${e.url}/extensions`,n=e.storeId,s="shopify.com",a=new URL(`https://${s}/${n}/account/extensions-development`);return a.searchParams.append("origin",o),a.searchParams.append("extensionId",t.devUUID),a.searchParams.append("source","CUSTOMER_ACCOUNT_EXTENSION"),a.searchParams.append("appId",e.id??""),r!==""&&a.searchParams.append("target",r),a}function Oe(t,e){let r=new URL(e.url);return r.pathname=`/extensions/${t.devUUID}`,r.toString()}function O(t,e){tr(t,er(e))}p();var lt=class extends Z{constructor(e){super(`Couldn't find template ${e.template} for extension surface ${e.extensionSurface}`)}};async function Ho(t){let e=await ms(t),r=await I(e);return Zt(r,t.data)}async function ms(t){let e=await fs(),r=[];t.extensionSurface&&r.push(S(e,`${t.extensionSurface}/${t.template}.html.liquid`)),r.push(S(e,`${t.template}.html.liquid`));let o=await we(r);if(o.length===0)throw new lt(t);return o[0]}async function fs(){return await xt("templates/ui-extensions/html",{type:"directory",cwd:Pt(import.meta.url)})}var Go=q(t=>{H(t,"Access-Control-Allow-Origin","*"),H(t,"Access-Control-Allow-Methods","GET, OPTIONS"),H(t,"Access-Control-Allow-Headers","Accept, Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, Authorization, ngrok-skip-browser-warning")}),Bo=q(t=>{H(t,"Cache-Control","no-cache")}),pt=q(async t=>_e(t,"/extensions",307));async function hs(t,e){let{filePath:r}=e;if(!await F(r))return O(t,{statusCode:404,statusMessage:`Not Found: ${r}`});if(await vt(r)&&(r+=r.endsWith("/")?"index.html":"/index.html",!await F(r)))return O(t,{statusCode:404,statusMessage:`Not Found: ${r}`});let o=await I(r,{}),n={".ico":"image/x-icon",".html":"text/html",".js":"text/javascript",".json":"application/json",".map":"application/json",".wasm":"application/wasm",".css":"text/css",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".wav":"audio/wav",".mp3":"audio/mpeg",".svg":"image/svg+xml",".pdf":"application/pdf",".doc":"application/msword"},s=me(r),a=n[s]||"text/plain";return H(t,"Content-Type",a),o}function Ko({getExtensions:t,payloadStore:e}){return q(async r=>{let{extensionId:o,assetPath:n=""}=Ae(r),s=t().find(h=>h.devUUID===o);if(!s)return O(r,{statusCode:404,statusMessage:`Extension with id ${o} not found`});let i=e.getAssetResolver(s.devUUID)?.get(n),c=i??n,d=c.endsWith(it);if(d&&i===void 0)return O(r,{statusCode:404,statusMessage:"Not Found"});let l=Be(d?s.directory:Nr(s.outputPath)),u=Be(S(l,c));return yt(l,u)?hs(r,{filePath:u}):O(r,{statusCode:404,statusMessage:"Not Found"})})}function ut({payloadStore:t}){return q(e=>(H(e,"content-type","application/json"),t.getRawPayload()))}function jo({devOptions:t}){return q(e=>{g(`UI extensions server received a ${e.method} request to URL ${e.path}`,t.stdout)})}function dt({devOptions:t,getExtensions:e}){return q(async r=>{let{extensionId:o}=Ae(r),n=e().find(i=>i.devUUID===o);if(!n)return O(r,{statusCode:404,statusMessage:`Extension with id ${o} not found`});if(rr(r,"accept")?.startsWith("text/html")){if(n.type==="checkout_post_purchase")return Ho({data:{url:Oe(n,t)},template:"index",extensionSurface:"post_purchase"});{let i=qo(n,t);return _e(r,i,307)}}let a=t.appWatcher.buildOutputPath;return H(r,"content-type","application/json"),{app:{apiKey:t.apiKey},version:t.manifestVersion,root:{url:new URL("/extensions",t.url).toString()},socket:{url:oe(t.url)},devConsole:{url:new URL("/extensions/dev-console",t.url).toString()},store:t.storeFqdn,extension:await re(n,a,t)}})}function zo({devOptions:t,getExtensions:e}){return q(async r=>{let{extensionId:o,extensionPointTarget:n=""}=Ae(r),s=e().find(i=>i.devUUID===o);if(!s)return O(r,{statusCode:404,statusMessage:`Extension with id ${o} not found`});if(s.configuration.type!=="checkout_post_purchase"&&!s.hasExtensionPointTarget(n))return O(r,{statusCode:404,statusMessage:`Extension with id ${o} has not configured the "${n}" extension target`});let a=Wo(n,s,t);return a?_e(r,a,307):O(r,{statusCode:404,statusMessage:`Redirect url can't be constructed for extension with id ${o} and extension target "${n}"`})})}import{createServer as gs}from"http";function Yo(t){let e=or(),r=nr();e.use(jo(t)),e.use(Go),e.use(Bo),r.use("/extensions/dev-console",pt),r.use("/extensions/:extensionId",dt(t)),r.use("/extensions/:extensionId/",dt(t)),r.use("/extensions/:extensionId/:extensionPointTarget",zo(t)),r.use("/extensions/:extensionId/assets/**:assetPath",Ko(t)),r.use("/extensions",ut(t)),r.use("/extensions/",ut(t)),r.use("/",pt),e.use(r);let o=gs(sr(e));return o.listen(t.devOptions.port,"localhost"),o}async function Vo(t){let e={...t,websocketURL:oe(t.url)},r=e.appWatcher.buildOutputPath,o=new Map,n=await Mo(e,r,o),s=new Fe(n,e,o),a=e.extensions.filter(u=>u.isPreviewable),i=()=>a;g("Setting up the UI extensions HTTP server...",e.stdout);let c=Yo({devOptions:e,payloadStore:s,getExtensions:i});g("Setting up the UI extensions Websocket server...",e.stdout);let d=No({...e,httpServer:c,payloadStore:s});g("Setting up the UI extensions bundler and file watching...",e.stdout);let l=async({appWasReloaded:u,app:h,extensionEvents:w})=>{u&&(a=h.allExtensions.filter(m=>m.isPreviewable));for(let m of w){if(!m.extension.isPreviewable)continue;let f=m.buildResult?.status==="ok"?"success":"error",U=m.buildResult?.status==="error"?{message:m.buildResult.error,file:m.buildResult.file}:void 0;switch(m.type){case te.Created:if(e.extensions.push(m.extension),!e.checkoutCartUrl){let E=await Ie(e.extensions,e.storeFqdn);e.checkoutCartUrl=E}await s.addExtension(m.extension,r);break;case te.Updated:await s.updateExtension(m.extension,e,r,{status:f,error:U});break;case te.Deleted:e.extensions=e.extensions.filter(E=>E.devUUID!==m.extension.devUUID),await s.deleteExtension(m.extension);break}}};e.appWatcher.onEvent(l).onStart(l),e.signal.addEventListener("abort",()=>{g("Closing the UI extensions dev server..."),d.close(),c.close()})}function oe(t){let e=new URL("/extensions",t);return e.protocol="wss:",e.toString()}var ws="3",ys=async({stderr:t,stdout:e,abortSignal:r},{apiKey:o,storeFqdn:n,storeId:s,subscriptionProductUrl:a,port:i,cartUrl:c,proxyUrl:d,appName:l,appDotEnvFile:u,appId:h,grantedScopes:w,allExtensions:m,appDirectory:f,appWatcher:U})=>{await Vo({appName:l,appDotEnvFile:u,appDirectory:f,id:h,extensions:m,stdout:e,stderr:t,signal:r,url:d,port:i,storeFqdn:Ee(n),storeId:s,apiKey:o,grantedScopes:w,checkoutCartUrl:c,subscriptionProductUrl:a,manifestVersion:ws,appWatcher:U})};async function Qo({allExtensions:t,storeFqdn:e,checkoutCartUrl:r,...o}){let n=t.filter(a=>a.isPreviewable),s=await Ie(n,e,r);return{prefix:"extensions",type:"previewable-extension",function:ys,options:{pathPrefix:"/extensions",port:-1,storeFqdn:e,allExtensions:t,cartUrl:s,...o}}}p();p();function Y(t){let e=t.find(o=>ee(o,W.Frontend)),r=t.find(o=>ee(o,W.Backend));return{frontendConfig:e,backendConfig:r}}p();async function Jo(t){let r={topic:"app/uninstalled",api_version:(await uo(t.developerPlatformClient,t.organizationId))[1],address:t.address,delivery_method:ho.LOCALHOST,shared_secret:t.sharedSecret},o=await mo(t.developerPlatformClient,r,t.organizationId);t.stdout.write("Sending APP_UNINSTALLED webhook to app server"),await ie(3);let n=await Ps(t,o);return t.stdout.write(n?"APP_UNINSTALLED webhook delivered":"APP_UNINSTALLED webhook delivery failed"),n}async function Ps(t,e){let r=0;for(;r<3;){try{return await fo(t.address,e.samplePayload,JSON.stringify({...JSON.parse(e.headers),"X-Shopify-Shop-Domain":t.storeFqdn}))}catch(o){if(o instanceof kt&&o.code==="ECONNREFUSED")r<3&&(t.stdout.write("App isn't responding yet, retrying in 5 seconds"),await ie(5));else throw o}r++}return t.stdout.write("App hasn't started in time, giving up"),!1}var vs=async({stdout:t},e)=>{await Jo({stdout:t,developerPlatformClient:e.developerPlatformClient,address:`http://localhost:${e.deliveryPort}${e.webhooksPath}`,sharedSecret:e.apiSecret,storeFqdn:e.storeFqdn,organizationId:e.organizationId})};function Xo({webs:t,remoteAppUpdated:e,backendPort:r,frontendPort:o,organizationId:n,...s}){let{backendConfig:a,frontendConfig:i}=Y(t),c=t.map(({configuration:l})=>l.webhooks_path).find(l=>l)??"/api/webhooks";if(c&&e&&(i??a))return{type:"send-webhook",prefix:"webhooks",function:vs,options:{deliveryPort:a?r:o,webhooksPath:c,organizationId:n,...s}}}p();async function Zo(t){return{type:"graphiql",prefix:"graphiql",options:t,function:xs}}var xs=async({stdout:t,abortSignal:e},r)=>{let o=go({apiKey:r.apiKey,apiSecret:r.apiSecret,storeFqdn:r.storeFqdn}),n=ir({stdout:t,port:r.port,storeFqdn:r.storeFqdn,key:r.key,tokenProvider:o,appContext:{appName:r.appName,appUrl:r.appUrl,apiSecret:r.apiSecret}});e.addEventListener("abort",async()=>{n.close()})};p();async function tn({webs:t,proxyUrl:e,frontendPort:r,backendPort:o,apiKey:n,apiSecret:s,scopes:a}){let{frontendConfig:i}=Y(t),c=i?.configuration.hmr_server?await $():void 0,d=void 0,l=t.map(async u=>{let h=await Es({web:u,frontendPort:r,backendPort:o}),w=c&&u.configuration.roles.includes(W.Frontend)?{port:c,httpPaths:u.configuration.hmr_server.http_paths}:void 0;return{type:"web",prefix:u.configuration.name??["web",...u.configuration.roles].join("-"),function:bs,options:{port:h,portFromConfig:u.configuration.port,apiKey:n,apiSecret:s,hostname:e,backendPort:o,frontendServerPort:r,directory:u.directory,devCommand:u.configuration.commands.dev,preDevCommand:u.configuration.commands.predev,scopes:a,shopCustomDomain:d,hmrServerOptions:w,roles:u.configuration.roles}}});return Promise.all(l)}async function Es({web:t,frontendPort:e,backendPort:r}){return ee(t,W.Frontend)?e:ee(t,W.Backend)?r:$()}async function bs({stdout:t,stderr:e,abortSignal:r},{port:o,apiKey:n,apiSecret:s,hostname:a,backendPort:i,frontendServerPort:c,directory:d,devCommand:l,preDevCommand:u,scopes:h,shopCustomDomain:w,hmrServerOptions:m}){let f=m?.port,U={SHOPIFY_API_KEY:n,SHOPIFY_API_SECRET:s,HOST:a,SCOPES:h,NODE_ENV:"development",...w&&{SHOP_CUSTOM_DOMAIN:w},BACKEND_PORT:`${i}`,FRONTEND_PORT:`${c}`,...f&&{HMR_SERVER_PORT:`${f}`},APP_URL:a,APP_ENV:"development",REMIX_DEV_ORIGIN:a},E={signal:r,directory:d,port:o,env:U,stdout:t,stderr:e};u&&(t.write(`Running pre-dev command: "${u}"`),await en({...E,command:u,showOutput:Vt()})),await en({...E,command:l,showOutput:!0})}async function en({command:t,signal:e,directory:r,port:o,env:n,showOutput:s,stdout:a,stderr:i}){let c=t.split("&&").map(d=>d.trim())??[];for(let d of c){let[l,...u]=d.split(" ");l?.length!==0&&await Re(l,u,{cwd:r,stdout:s?a:void 0,stderr:i,signal:e,env:{...n,PORT:`${o}`,SERVER_PORT:`${o}`}})}}p();p();p();var Ne=class{constructor(e){this.stdout=e}async info(e){await this.log(e)}async warning(e){await this.log(b`${v.yellow(e)}`.value)}async success(e){await this.log(b`${v.green(e)}`.value)}async debug(e){g(e,this.stdout)}async error(e,r){let o=v.errorText("\u274C Error"),n=v.errorText(`\u2514 ${e}`);await this.log(b`${o}`.value,r),await this.log(b`${n}`.value,r)}async logUserErrors(e,r){if(typeof e=="string")await this.error(e);else if(e instanceof Error)await this.error(e.message);else{let o=e.map(n=>{let s=n.on?n.on[0]:void 0,a=r.find(i=>i.uid===s?.user_identifier);return{error:n.message,prefix:a?.handle??"app-preview"}});await this.logMultipleErrors(o)}}async logExtensionEvents(e){let r=e.extensionEvents.filter(n=>n.extension.isAppConfigExtension),o=e.extensionEvents.filter(n=>!n.extension.isAppConfigExtension);r.length&&await this.log("App config updated","app-config"),o.forEach(async n=>{let s=n.extension.handle,a=`Extension ${n.type}`;await this.log(a,s)})}async logExtensionUpdateMessages(e){if(!e)return;let r=e.extensionEvents??[],n=(await Promise.all(r.map(async a=>a.type===te.Deleted?[]:(await a.extension.getDevSessionUpdateMessages())?.map(c=>({message:c,prefix:a.extension.handle}))??[]))).flat(),s=n.map((a,i)=>{let c=b`${v.gray(i===n.length-1?"\u2514 ":"\u2502 ")}${a.message}`.value;return this.log(c,a.prefix)});await Promise.all(s)}async logMultipleErrors(e){let r=v.errorText("\u274C Error");await this.log(b`${r}`.value,"app-preview");let o=e.map(n=>{let s=v.errorText(`\u2514 ${n.error}`);return this.log(b`${s}`.value,n.prefix)});await Promise.all(o)}async log(e,r){await D({outputPrefix:r??"app-preview",stripAnsi:!1},()=>{this.stdout.write(e)})}};p();var qe=class{constructor(e){this.processBatch=e,this.queue=[],this.processingPromise=void 0}enqueue(e){this.queue.push(e),this.processingPromise??(this.processingPromise=this.startProcessing())}async waitForCompletion(){if(this.processingPromise)return this.processingPromise}async startProcessing(){try{for(;this.queue.length>0;){let e=[...this.queue];this.queue=[],await this.processBatch(e)}}finally{this.processingPromise=void 0}}};var We=class t{static async start(e,r){let o=new t(e,r);return await o.start(),o}constructor(e,r){this.failedEvents=[],this.currentSessionState=null,this.statusManager=e.devSessionStatusManager,this.logger=new Ne(r),this.options=e,this.appWatcher=e.appWatcher,this.bundlePath=e.appWatcher.buildOutputPath,this.appEventsProcessor=new qe(o=>this.processEvents(o))}async start(){await this.logger.info(`Preparing dev preview on ${this.options.storeFqdn}`),this.statusManager.setMessage("LOADING"),this.appWatcher.onEvent(async e=>this.onEvent(e)).onStart(async e=>this.onStart(e)).onError(async e=>this.handleDevSessionResult({status:"unknown-error",error:e}))}async onEvent(e){await this.validateAppEvent(e)&&this.appEventsProcessor.enqueue(e)}async processEvents(e){let r=[...this.failedEvents,...e],o=this.consolidateAppEvents(r);if(this.failedEvents=[],!o)return;this.statusManager.setMessage("CHANGE_DETECTED"),this.updatePreviewURL(o),await this.logger.logExtensionEvents(o);let n=to(),s=await this.bundleExtensionsAndUpload(o);await this.handleDevSessionResult(s,o),await this.logger.debug(`\u2705 Event handled [Network: ${rt(n)}ms - Total: ${rt(o.startTime)}ms]`)}consolidateAppEvents(e){if(e.length===0)return;if(e.length===1)return e[0];let r=e[0],o=e[e.length-1];if(!r||!o)return;let n=new Map;for(let a of e)for(let i of a.extensionEvents)n.set(i.extension.uid,i);return{app:o.app,path:o.path,extensionEvents:Array.from(n.values()),startTime:r.startTime,appWasReloaded:e.some(a=>a.appWasReloaded)}}async onStart(e){let r=this.parseBuildErrors(e);if(r.length)await this.logger.logMultipleErrors(r),await setImmediate(()=>{let o=r.map(n=>n.prefix);throw new T(`Dev preview aborted, build errors detected in extensions: ${o}`)});else{let o=await this.bundleExtensionsAndUpload(e);await this.handleDevSessionResult(o,e)}}async validateAppEvent(e){if(!this.statusManager.status.isReady)return await this.logger.warning("Change detected, but dev preview is not ready yet."),!1;let r=this.parseBuildErrors(e);return r.length?(await this.logger.logMultipleErrors(r),this.statusManager.setMessage("BUILD_ERROR"),!1):e.extensionEvents.length===0?(this.statusManager.setMessage("READY"),!1):!0}parseBuildErrors(e){return e.extensionEvents.filter(o=>o.buildResult?.status==="error").map(o=>({error:"Build error. Please review your code and try again.",prefix:o.extension.handle}))}async handleDevSessionResult(e,r){e.status==="updated"?(await this.logger.success(`\u2705 Updated dev preview on ${this.options.storeFqdn}`),await this.logger.logExtensionUpdateMessages(r),await this.setUpdatedStatusMessage()):e.status==="created"?(this.statusManager.updateStatus({isReady:!0}),await this.logger.success("\u2705 Ready, watching for changes in your app "),await this.logger.logExtensionUpdateMessages(r),this.statusManager.setMessage("READY")):e.status==="aborted"?await this.logger.debug("\u274C Dev preview update aborted (new change detected or error during update)"):(e.status==="remote-error"||e.status==="unknown-error")&&(await this.logger.logUserErrors(e.error,r?.app.allExtensions??[]),e.error instanceof Error&&e.error.cause==="validation-error"?this.statusManager.setMessage("VALIDATION_ERROR"):(r&&this.failedEvents.push(r),this.statusManager.setMessage("REMOTE_ERROR"))),!this.statusManager.status.isReady&&!Qt()&&setImmediate(()=>{throw new T("Failed to start dev preview.")})}updatePreviewURL(e){let r=e.app.nonConfigExtensions.length>0;this.statusManager.updateStatus({previewURL:this.options.appPreviewURL,appEmbedded:e.app.configuration.embedded,hasExtensions:r})}async setUpdatedStatusMessage(){this.statusManager.setMessage("UPDATED"),setTimeout(async()=>{this.statusManager.status.statusMessage?.message==="Updated"&&this.statusManager.setMessage("READY")},2e3)}async bundleExtensionsAndUpload(e){try{let{manifest:r,inheritedModuleUids:o,assets:n}=await this.createManifest(e),s=await this.uploadAssetsIfNeeded(n,!this.statusManager.status.isReady),a=oe(this.options.url);if(this.statusManager.status.isReady){let i={shopFqdn:this.options.storeFqdn,appId:this.options.appId,assetsUrl:s,manifest:r,inheritedModuleUids:o};return this.devSessionUpdateWithRetry(i)}else{let i={shopFqdn:this.options.storeFqdn,appId:this.options.appId,assetsUrl:s,websocketUrl:a};return this.devSessionCreateWithRetry(i)}}catch(r){if(r.statusCode===401)throw new Error("Unauthorized");if(r instanceof Rt)throw r.response.status===401||r.response.status===403?new T("Auth session expired. Please run `shopify app dev` again."):(await this.logger.debug(JSON.stringify(r.response,null,2)),new T("Unknown error"));return r.code==="ETIMEDOUT"?{status:"unknown-error",error:new Error("Request timed out, please check your internet connection and try again.")}:{status:"unknown-error",error:r}}}async createManifest(e){let r=e.extensionEvents.filter(i=>i.type!=="deleted").map(i=>i.extension.uid);e.app.allExtensions.some(i=>i.type==="admin")&&!r.includes("admin")&&r.push("admin");let o=e.app.allExtensions.filter(i=>!r.includes(i.uid)).map(i=>i.uid),n=await e.app.manifest(void 0);await oo(n,this.bundlePath),this.statusManager.status.isReady&&(n.modules=n.modules.filter(i=>r.includes(i.uid)));let s=await Et(this.bundlePath),a=n.modules.map(i=>i.assets).filter(i=>s.includes(i));return{manifest:n,inheritedModuleUids:o,assets:a}}async uploadAssetsIfNeeded(e,r){if(!e.length&&!r)return;let o=S(de(this.bundlePath),`dev-bundle.${this.options.developerPlatformClient.bundleFormat}`),n=[...e.map(a=>`${a}/**`),...no];r&&n.push("manifest.json"),await so(this.bundlePath,o,n);let s=await this.getSignedURLWithRetry();return await ao(s,o),s}async getSignedURLWithRetry(){return io(this.options.developerPlatformClient,{apiKey:this.options.appId,organizationId:this.options.organizationId,id:this.options.appId})}async devSessionUpdateWithRetry(e){let r=await this.options.developerPlatformClient.devSessionUpdate(e),o=r.devSessionUpdate?.userErrors??[],n=r.devSessionUpdate?.devSession;if(n&&this.currentSessionState){let s=oe(this.options.url),a=this.currentSessionState?.userId;if(n.websocketUrl!==s||n.user?.id!==a){let i=n.user?.email;await this.logger.error(`Another developer ${i?`(${i}) `:""}has taken ownership of this dev preview.`);let c=`Another user${i?` (${i})`:""} has taken ownership of this dev preview. Your preview is no longer active.`,d=["You can restart by running",{command:"shopify app dev"},"again."];throw new T(c,d)}this.currentSessionState={websocketUrl:n.websocketUrl,userId:n.user?.id??null,userEmail:n.user?.email??null}}return o.length?{status:"remote-error",error:o}:{status:"updated"}}async devSessionCreateWithRetry(e){let r=await this.options.developerPlatformClient.devSessionCreate(e),o=r.devSessionCreate?.userErrors??[],n=r.devSessionCreate?.warnings??[],s=r.devSessionCreate?.devSession;return s&&(this.currentSessionState={websocketUrl:s.websocketUrl,userId:s.user?.id??null,userEmail:s.user?.email??null}),n.length>0&&await Promise.all(n.map(a=>{let i=a.code==="SESSION_TAKEOVER"?`\u26A0\uFE0F ${a.message}`:a.message;return this.logger.warning(i)})),o.length?{status:"remote-error",error:o}:{status:"created"}}};async function rn({app:t,apiKey:e,developerPlatformClient:r,...o}){return{type:"dev-session",prefix:"app-preview",function:Ss,options:{app:t,apiKey:e,developerPlatformClient:r,...o}}}var Ss=async({stdout:t},e)=>{await We.start(e,t)};p();p();p();var on=async({appLog:t,appLogPayload:e,stdout:r,storeName:o,logsDir:n})=>{let s=At().substring(0,6),i=`${Us(t.log_timestamp)}_${t.source_namespace}_${t.source}_${s}.json`,c=Co({appLog:t,appLogPayload:e,prettyPrint:!0,storeName:o}),d=S(n,i);try{return await he(n),await fe(d,c),{fullOutputPath:d,identifier:s}}catch(l){throw r.write(`Error while writing log to file: ${l}
|
|
8
|
+
`),l}};function Us(t){let e=new Date(t),r=e.getUTCFullYear(),o=(e.getUTCMonth()+1).toString().padStart(2,"0"),n=e.getUTCDate().toString().padStart(2,"0"),s=e.getUTCHours().toString().padStart(2,"0"),a=e.getUTCMinutes().toString().padStart(2,"0"),i=e.getUTCSeconds().toString().padStart(2,"0"),c=e.getUTCMilliseconds().toString().padStart(3,"0");return`${r}${o}${n}_${s}${a}${i}_${c}Z`}var He=async({stdout:t,appLogsFetchInput:{jwtToken:e,cursor:r},developerPlatformClient:o,resubscribeCallback:n,storeName:s,organizationId:a,abortSignal:i,logsDir:c,consecutiveResubscribeFailures:d=0})=>{if(!i?.aborted)try{let l=e,u=Po,h=d,w=await o.appLogs({jwtToken:e,cursor:r},a),{errors:m,status:f}=w;if(f===200){h=0;let{app_logs:E}=w;for(let R of E){let x=JSON.parse(R.payload);await D({outputPrefix:R.source,stripAnsi:!1},async()=>{R.log_type===Eo?(Rs(R,x,t),x=new wo(yo(x))):R.log_type.startsWith(bo)?Ts(R,x,t):t.write(JSON.stringify(x));let _=await on({appLog:R,appLogPayload:x,stdout:t,storeName:s,logsDir:c});t.write(b`${v.gray("\u2514 ")}${v.link("Open log file",`file://${_.fullOutputPath}`,`Log: ${_.fullOutputPath}`)} ${v.gray(`(${_.identifier})`)}\n`.value)})}}else{let E={errors:m.map(x=>({message:x,status:f}))},R=await _o({response:E,onThrottle:x=>{C("Request throttled while polling app logs.",t),C(`Retrying in ${x/1e3} seconds.`,t)},onUnknownError:x=>{C("Error while polling app logs.",t),C(`Retrying in ${x/1e3} seconds.`,t)},onResubscribe:()=>n()});if(R.resubscribeResult==="failed"){if(h+=1,h>=vo){C("App log streaming session has expired. Please restart your dev session.",t);return}}else R.resubscribeResult==="succeeded"&&(h=0);R.nextJwtToken&&(l=R.nextJwtToken),u=R.retryIntervalMs}let{cursor:U}=w;setTimeout(()=>{He({stdout:t,appLogsFetchInput:{jwtToken:l,cursor:U??r},developerPlatformClient:o,resubscribeCallback:n,storeName:s,organizationId:a,abortSignal:i,logsDir:c,consecutiveResubscribeFailures:h}).catch(E=>{g(`Unexpected error during polling: ${E}}
|
|
9
|
+
`)})},u)}catch(l){C("Error while polling app logs.",t),C(`Retrying in ${nt/1e3} seconds.`,t),g(`${l}}
|
|
10
|
+
`),setTimeout(()=>{He({stdout:t,appLogsFetchInput:{jwtToken:e,cursor:void 0},developerPlatformClient:o,resubscribeCallback:n,storeName:s,organizationId:a,abortSignal:i,logsDir:c}).catch(u=>{g(`Unexpected error during polling: ${u}}
|
|
11
|
+
`)})},nt)}};function Rs(t,e,r){let o=(e.fuel_consumed/xo).toFixed(4);t.status==="success"?r.write(`Function export "${e.export}" executed successfully using ${o}M instructions.`):t.status==="failure"&&r.write(`\u274C Function export "${e.export}" failed to execute with error: ${e.error_type}`);let n=e.logs;n.length>0&&r.write(n.split(`
|
|
12
|
+
`).filter(Boolean).map(s=>b`${v.gray("\u2502 ")}${s}`.value).join(`
|
|
13
|
+
`))}function Ts(t,e,r){t.log_type===So?r.write("Function network access response retrieved from cache."):t.log_type===Uo?e.reason===To?r.write("Function network access request executing in background because there is no cached response."):e.reason===Ao&&r.write("Function network access request executing in background because the cached response is about to expire."):t.log_type===Ro&&(t.status==="success"?r.write("Function network access request executed successfully."):t.status==="failure"&&r.write(`\u274C Function network access request failed to execute with error: ${e.error}.`))}function As(t){return t.allExtensions.some(e=>e.isFunctionExtension)}async function nn({developerPlatformClient:t,subscription:{shopIds:e,apiKey:r},storeName:o,organizationId:n,appWatcher:s,localApp:a}){return{type:"app-logs-subscribe",prefix:"app-logs",function:_s,options:{developerPlatformClient:t,appLogsSubscribeVariables:{shopIds:e,apiKey:r},storeName:o,organizationId:n,appWatcher:s,localApp:a}}}var _s=async({stdout:t,stderr:e,abortSignal:r},{developerPlatformClient:o,appLogsSubscribeVariables:n,storeName:s,organizationId:a,appWatcher:i,localApp:c})=>{async function d(l){let u=await st(o,n,a,t),h=c.getLogsDir();await he(h),await He({stdout:t,appLogsFetchInput:{jwtToken:u},resubscribeCallback:()=>st(o,n,a),developerPlatformClient:o,storeName:s,organizationId:a,abortSignal:l,logsDir:h})}try{let l=!1,u,h=async w=>{let m=As(w.app);if(m&&!l){g("Function extensions detected, starting logs polling"),l=!0,u=new AbortController;try{await d(u.signal)}catch(f){g(`Failed to start function logs: ${f}`,e)}}else!m&&l&&(g("No function extensions detected, stopping logs polling"),l=!1,u?.abort(),u=void 0)};i.onStart(h).onEvent(h)}catch{}};p();async function sn(t){return{type:"app-watcher",prefix:"app-preview",options:t,function:Cs}}var Cs=async({stdout:t,stderr:e,abortSignal:r},o)=>{let{appWatcher:n}=o;await n.start({stdout:t,stderr:e,signal:r})};p();import{EventEmitter as ks}from"events";var Is={BUILD_ERROR:{message:"Build error. Please review your code and try again",type:"error"},READY:{message:"Ready, watching for changes in your app",type:"success"},LOADING:{message:"Preparing dev preview",type:"loading"},UPDATED:{message:"Updated",type:"success"},VALIDATION_ERROR:{message:"Validation error in your app configuration",type:"error"},REMOTE_ERROR:{message:"Error updating dev preview",type:"error"},CHANGE_DETECTED:{message:"Change detected, updating dev preview",type:"loading"}},Ge=class extends ks{constructor(e){super(),this.currentStatus={isReady:!1,previewURL:void 0,graphiqlURL:void 0,statusMessage:void 0},e&&(this.currentStatus=e)}updateStatus(e){let r={...this.currentStatus,...e};Dt(this.currentStatus,r)||(this.currentStatus=r,this.emit("dev-session-update",r))}setMessage(e){this.updateStatus({statusMessage:Is[e]})}get status(){return this.currentStatus}reset(){this.currentStatus={isReady:!1,previewURL:void 0,graphiqlURL:void 0,statusMessage:void 0}}};p();import*as an from"http";import*as cn from"https";function ln(t){return"errors"in t&&Array.isArray(t.errors)}async function pn(t,e,r,o){let s=(await import("./http-proxy-node16-A6AKKRQH.js")).default.createProxyServer(),a=$s(t,s,o),i=r?cn.createServer(r,a):an.createServer(a);return i.on("upgrade",Ls(t,s,o)),e.addEventListener("abort",()=>{g("Closing reverse HTTP proxy"),i.close()}),{server:i}}function Ls(t,e,r){return function(o,n,s){let a=un(t,o,!0);if(a)return e.ws(o,n,s,{target:a},i=>{D({outputPrefix:"proxy",stripAnsi:!1},()=>{let d=(ln(i)?i.errors[i.errors.length-1]:void 0)??i;C(`Error forwarding websocket request: ${d.message}`,r),C(`\u2514 Unreachable target "${a}" for path: "${o.url}"`,r)})});n.destroy()}}function $s(t,e,r){return function(o,n){let s=un(t,o);if(s)return o.method==="OPTIONS"?(n.writeHead(204,{"Access-Control-Allow-Origin":o.headers.origin??"*","Access-Control-Allow-Methods":o.headers["access-control-request-method"]??"GET, POST, PUT, DELETE, PATCH, OPTIONS","Access-Control-Allow-Headers":o.headers["access-control-request-headers"]??"Content-Type, Authorization","Access-Control-Max-Age":"86400"}),n.end()):e.web(o,n,{target:s},a=>{D({outputPrefix:"proxy",stripAnsi:!1},()=>{let c=(ln(a)?a.errors[a.errors.length-1]:void 0)??a;C(`Error forwarding web request: ${c.message}`,r),C(`\u2514 Unreachable target "${s}" for path: "${o.url}"`,r)})});g(b`
|
|
14
|
+
Reverse HTTP proxy error - Invalid path: ${o.url??""}
|
|
15
|
+
These are the allowed paths:
|
|
16
|
+
${v.json(JSON.stringify(t))}
|
|
17
|
+
`),n.statusCode=500,n.end(`Invalid path ${o.url}`)}}function un(t,e,r=!1){let o=e.url??"/";for(let n in t)if(o.startsWith(n))return t[n];return r&&t.websocket?t.websocket:t.default}async function dn({localApp:t,remoteAppUpdated:e,developerPlatformClient:r,remoteApp:o,storeFqdn:n,storeId:s,commandOptions:a,network:i,graphiqlPort:c,graphiqlKey:d}){let l=o.apiKey,u=o.apiSecretKeys[0]?.secret??"",h=_t(),w=!ht(h[ke.disableGraphiQLExplorer]),m=await zr(t),f=new ro(m,i.proxyUrl),U=await xe(),E=lo(n,l,U),R=E,x=ar(d,u,n),_=w?`http://localhost:${c}/graphiql?key=${encodeURIComponent(x)}`:void 0,se=m.configuration.embedded,Q=m.nonConfigExtensions.length>0,N=new Ge({isReady:!1,previewURL:R,graphiqlURL:_,appEmbedded:se,hasExtensions:Q}),B=[...await tn({webs:m.webs,proxyUrl:i.proxyUrl,frontendPort:i.frontendPort,backendPort:i.backendPort,apiKey:l,apiSecret:u,scopes:Dr(m.configuration)}),w?await Zo({appName:o.title,appUrl:E,port:c,apiKey:l,apiSecret:u,key:x,storeFqdn:n}):void 0,await Qo({allExtensions:m.realExtensions,storeFqdn:n,storeId:s,apiKey:l,subscriptionProductUrl:a.subscriptionProductUrl,checkoutCartUrl:a.checkoutCartUrl,proxyUrl:i.proxyUrl,appName:m.name,appDotEnvFile:m.dotenv,grantedScopes:o.grantedScopes,appId:o.id,appDirectory:m.directory,appWatcher:f}),await rn({app:m,apiKey:l,developerPlatformClient:r,url:i.proxyUrl,appId:o.id,organizationId:o.organizationId,storeFqdn:n,appWatcher:f,appPreviewURL:E,devSessionStatusManager:N}),await Lo({remoteApp:o,localApp:m,storeFqdn:n,theme:a.theme,themeExtensionPort:a.themeExtensionPort,storePassword:a.storePassword}),Xo({webs:m.webs,backendPort:i.backendPort,frontendPort:i.frontendPort,organizationId:o.organizationId,developerPlatformClient:r,storeFqdn:n,apiSecret:u,remoteAppUpdated:e}),await nn({developerPlatformClient:r,subscription:{shopIds:[Number(s)],apiKey:l},storeName:n,organizationId:o.organizationId,localApp:t,appWatcher:f}),await sn({appWatcher:f})].filter(Ms);return{processes:await Ds(B,i.proxyPort,i.reverseProxyCert),previewUrl:R,graphiqlUrl:_,devSessionStatusManager:N}}var Ms=t=>t!==void 0&&t!==!1;async function Ds(t,e,r){let o=await Promise.all(t.map(async a=>{let i={};if(a.type==="web"&&a.options.roles.includes(W.Frontend)){let c=a.options.portFromConfig??a.options.port;i.default=`http://localhost:${c}`;let d=a.options.hmrServerOptions;d&&(i.websocket=`http://localhost:${d.port}`,d.httpPaths.forEach(l=>i[l]=`http://localhost:${d.port}`)),a.options.port=c}else if(a.type==="previewable-extension"){let c=await $();i[a.options.pathPrefix]=`http://localhost:${c}`,a.options.port=c}return{process:a,rules:i}})),n=o.map(({process:a})=>a),s=o.map(({rules:a})=>a).reduce((a,i)=>({...a,...i}),{});return Object.keys(s).length>0&&n.push({type:"proxy-server",prefix:"proxy",function:Fs,options:{port:e,rules:s,localhostCert:r}}),n}var Fs=async({abortSignal:t,stdout:e},{port:r,rules:o,localhostCert:n})=>{let{server:s}=await pn(o,t,n,e);K(`Proxy server started on port ${r} ${n?`with certificate ${n.certPath}`:""}`,e),await s.listen(r,"localhost")};p();p();p();var ne=J(ye(),1);var mn=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];function fn(){let[t,e]=(0,ne.useState)(0);return(0,ne.useEffect)(()=>{let r=setInterval(()=>{e(o=>(o+1)%mn.length)},70);return()=>clearInterval(r)},[]),ne.default.createElement(L,null,mn[t])}p();var A=J(ye(),1);var hn=.9,gn=({tabs:t,initialActiveTab:e})=>{let{stdout:r}=St(),{isRawModeSupported:o}=Pe(),[n,s]=(0,A.useState)(e),[a,i]=(0,A.useState)(Math.floor(r.columns*hn)),[c,d]=(0,A.useState)(!0),l=(0,A.useRef)(null);if(!n)throw new Error("No tabs provided");ve((m,f)=>{(async()=>{if(f?.leftArrow||f?.rightArrow||f?.tab){let x=Object.entries(t).filter(([B,P])=>P.content),_=x.findIndex(([B])=>B===n);if(_===-1)return;let se=f?.leftArrow?-1:1,Q=(_+se+x.length)%x.length,N=x[Q];N&&s(N[0])}let E=t[m];if(E){E.action?await E.action():s(m);return}let R=t[n];if(R?.shortcuts){let x=R.shortcuts.find(_=>_.key===m);x&&(!x.condition||x.condition())&&await x.action()}})()},{isActive:!!o}),(0,A.useLayoutEffect)(()=>{let m=()=>{if(i(Math.floor(r.columns*hn)),!l.current)return;let f=Ut(l.current);d(f.width<r.columns)};return r.on("resize",m),()=>{r.off("resize",m)}},[r]);let u=Object.entries(t).map(([m,f])=>({...f,inputKey:m,header:` (${m}) ${f.label} `})),h=u.filter(m=>!m.action),w=u.filter(m=>m.action);return A.default.createElement(A.default.Fragment,null,A.default.createElement(k,{paddingTop:0,width:a,flexDirection:"row",flexGrow:1,borderStyle:"single",borderBottom:!1,borderLeft:!1,borderRight:!1,borderTop:!0},A.default.createElement(k,{ref:l,flexDirection:"row",flexWrap:"nowrap",flexShrink:0,marginRight:3},A.default.createElement(L,{wrap:"truncate-end"},"\u2502",h.map(m=>A.default.createElement(A.default.Fragment,{key:m.inputKey},A.default.createElement(L,{bold:n===m.inputKey,inverse:n===m.inputKey,wrap:"truncate"},m.header),"\u2502")))),c&&A.default.createElement(k,{flexGrow:1,justifyContent:"flex-end"},w.map((m,f)=>A.default.createElement(L,{wrap:"truncate",key:m.inputKey},"(",m.inputKey,") ",m.label,f<w.length-1&&" \u2502 ")))),A.default.createElement(k,{flexDirection:"column",marginLeft:1,marginRight:1,marginTop:1},t[n]?.content))};var y=J(ye(),1);var wn=({abortController:t,processes:e,devSessionStatusManager:r,shopFqdn:o,appURL:n,appName:s,organizationName:a,configPath:i,localURL:c,onAbort:d})=>{let{isRawModeSupported:l}=Pe(),[u,h]=(0,y.useState)(void 0),[w,m]=(0,y.useState)(void 0),[f,U]=(0,y.useState)(r.status),[E,R]=(0,y.useState)(!1),{isAborted:x}=Bt(t.signal,async P=>{P&&m(typeof P=="string"?P:P.message),r.status.isReady?R(!0):(h("Shutting down dev ..."),await d()),ko()}),_=(0,y.useMemo)(()=>e.map(P=>({...P,action:async(ue,An,_n)=>{try{return await P.action(ue,An,_n)}catch(Cn){t.abort(Cn)}}})),[e,t]);(0,y.useEffect)(()=>(r.on("dev-session-update",U),()=>{r.off("dev-session-update",U)}),[]),ve((P,ue)=>{qt(P,ue,()=>t.abort())},{isActive:!!l});let se=P=>{switch(P){case"loading":return y.default.createElement(fn,null);case"success":return"\u2705";case"error":return"\u274C"}},Q=[{key:"p",shortcutLabel:"Open app preview",linkLabel:"Preview",url:f.previewURL,condition:()=>!!(f.isReady&&f.previewURL),action:async()=>{await j.addPublicMetadata(()=>({cmd_dev_preview_url_opened:!0})),f.previewURL&&await Ue(f.previewURL)}},{key:"c",shortcutLabel:"Open Dev Console for extension previews",linkLabel:"Dev Console",url:ot(o),condition:()=>!!(f.isReady&&f.appEmbedded===!1&&f.hasExtensions),action:async()=>{await j.addPublicMetadata(()=>({cmd_dev_preview_url_opened:!0})),await Ue(ot(o))}},{key:"g",shortcutLabel:"Open GraphiQL (Admin API)",linkLabel:"GraphiQL",url:f.graphiqlURL,condition:()=>!!(f.isReady&&f.graphiqlURL),action:async()=>{await j.addPublicMetadata(()=>({cmd_dev_graphiql_opened:!0})),f.graphiqlURL&&await Ue(f.graphiqlURL)}}],N=Q.filter(P=>P.condition?.()??!0),B={d:{label:"Dev status",shortcuts:Q,content:y.default.createElement(y.default.Fragment,null,f.statusMessage&&y.default.createElement(L,null,se(f.statusMessage.type)," ",f.statusMessage.message),l&&N.length>0&&y.default.createElement(k,{marginTop:1,flexDirection:"column"},N.map(P=>y.default.createElement(L,{key:P.key},Wt.pointerSmall," ",y.default.createElement(L,{bold:!0},"(",P.key,")")," ",Ve()&&P.url?y.default.createElement(je,{url:P.url,label:P.shortcutLabel}):P.shortcutLabel))),y.default.createElement(k,{marginTop:l?1:0,flexDirection:"column"},u?y.default.createElement(L,null,u):y.default.createElement(y.default.Fragment,null,f.isReady&&!(l&&Ve())&&y.default.createElement(y.default.Fragment,null,N.filter(P=>P.url).map(P=>y.default.createElement(L,{key:P.key},P.linkLabel," URL: ",y.default.createElement(je,{url:P.url})))))))},a:{label:"App info",content:y.default.createElement(k,{flexDirection:"column"},y.default.createElement(Ye,{tabularData:[["App:",s??""],["App URL:",n??""],["Local URL:",n?"":c??""],["Config:",i?.split("/").pop()??""],["Org:",a??""]].filter(([,P])=>P)}))},s:{label:"Store info",content:y.default.createElement(k,{flexDirection:"column"},y.default.createElement(Ye,{tabularData:[["Dev store:",{link:{url:`https://${o}`}}],["Dev store admin:",{link:{url:`https://${o}/admin`}}],["Org:",a??""]].filter(([,P])=>P)}))},q:{label:"Quit",action:async()=>{t.abort()}}};return y.default.createElement(y.default.Fragment,null,y.default.createElement(Ht,{processes:_,prefixColumnSize:Or,abortSignal:t.signal,keepRunningAfterProcessesResolve:!0,useAlternativeColorPalette:!0}),E&&y.default.createElement(k,{marginTop:1,flexDirection:"column"},y.default.createElement(Gt,{type:"info",headline:`A preview of your development changes is still available on ${o}.`,body:["Run",{command:"shopify app dev clean"},"to restore the latest released version of your app."],link:{label:"Learn more about dev previews",url:"https://shopify.dev/beta/developer-dashboard/shopify-app-dev"}})),x?null:y.default.createElement(k,{paddingTop:1,flexDirection:"column",flexGrow:1},l?y.default.createElement(gn,{tabs:B,initialActiveTab:"d"}):y.default.createElement(k,{marginY:1,paddingTop:0,flexDirection:"column",flexGrow:1,borderStyle:"single",borderBottom:!1,borderLeft:!1,borderRight:!1,borderTop:!0},B.d?.content)),w?y.default.createElement(k,{marginTop:1,flexDirection:"column"},y.default.createElement(L,{color:"red"},w)):null)};var yn=J(ye(),1);async function Pn({processes:t,previewUrl:e,app:r,abortController:o,graphiqlUrl:n,shopFqdn:s,devSessionStatusManager:a,appURL:i,appName:c,organizationName:d,configPath:l,localURL:u}){if(zt())return Nt(yn.default.createElement(wn,{processes:t,abortController:o,devSessionStatusManager:a,shopFqdn:s,appURL:i,appName:c,organizationName:d,configPath:l,localURL:u,onAbort:async()=>{await r.developerPlatformClient.devSessionDelete({appId:r.id,shopFqdn:s})}}),{exitOnCtrlC:!1});await Os({processes:t,previewUrl:e,graphiqlUrl:n,abortController:o})}async function Os({processes:t,previewUrl:e,graphiqlUrl:r,abortController:o}){return process.stdout.write(`
|
|
18
|
+
Preview URL: ${e}
|
|
19
|
+
`),r&&process.stdout.write(`GraphiQL URL (Admin API): ${r}
|
|
20
|
+
`),Promise.all(t.map(async n=>{await n.action(process.stdout,process.stderr,o.signal)}))}p();function vn(t){if(!t.length)return;let e=t.filter(n=>n.requested!==n.actual);if(e.length===0)return;if(e.length===1&&e[0]){let n=e[0];ae({headline:[`A random port will be used for ${n.for} because ${n?.requested} is not available.`],body:["If you want to use a specific port, you can choose a different one by setting the ",{command:n?.flagToRemedy}," flag."]});return}let r=Ke(e.map(n=>n.for)).join(" "),o=Ke(e.map(n=>({command:n.flagToRemedy})));ae({headline:[`Random ports will be used for ${r} because the requested ports are not available.`],body:["If you want to use specific ports, you can choose different ports using the",...o,"flags."]})}p();async function xn(t,e){return e?e.includes("localhost")?"localhost":(await Lt(t)).plugins.find(o=>e?.includes(o))??"custom":void 0}p();var En=J(In(),1);var V="v1.4.4",bn="FiloSottile/mkcert",mt=v.genericShellCommand("mkcert");async function Ns(t,e,r,o){let n=e[ke.mkcertBinaryPath];if(n)return n;let a=S(t,r==="win32"?"mkcert.exe":"mkcert");if(await F(a))return a;let i=await(0,En.default)("mkcert",{nothrow:!0});return i?(g(b`Found ${mt} at ${v.path(i)}`),i):(await qs(a,r,o),a)}async function qs(t,e,r){let o;switch(e){case"darwin":o=r==="arm64"?`mkcert-${V}-darwin-arm64`:`mkcert-${V}-darwin-amd64`;break;case"linux":o=r==="arm64"?`mkcert-${V}-linux-arm64`:`mkcert-${V}-linux-amd64`;break;case"win32":o=`mkcert-${V}-windows-amd64.exe`;break;default:throw new Z(`Unsupported platform: ${e}`)}await Lr(bn,V,o,t),g(b`${mt} saved to ${v.path(t)}`)}async function Ws(t){let e=S(t,"mkcert-LICENSE");if(await F(e))return;let r=`https://raw.githubusercontent.com/${bn}/refs/tags/${V}/LICENSE`,o={headline:"Failed to download mkcert license.",body:["We tried to download the license for mkcert, but the request failed. You can ",{link:{url:r,label:"view the license here"}}]},n;try{if(n=await It(r),!n.ok)return o}catch{return o}let s=await n.text();await fe(e,s)}async function Sn({appDirectory:t,forceInstall:e,env:r=process.env,platform:o=process.platform,arch:n=process.arch}){let s=S(".shopify","localhost-key.pem"),a=S(".shopify","localhost.pem"),i=S(t,s),c=S(t,a);if(await F(i)&&await F(c))return{keyContent:await I(i),certContent:await I(c),certPath:a};if(!(e??await Yr()))throw new T(`Localhost certificate and key are required at ${a} and ${s}`);let l="",u;return await Se([{title:"Finding or downloading mkcert binary",task:async()=>{let w=S(t,".shopify");l=await Ns(w,r,o,n),u=await Ws(w),g(b`${mt} found at: ${v.path(l)}`)}}]),u&&be(u),K(b`Generating self-signed certificate for localhost. You may be prompted for your password.`),await Re(l,["-install","-key-file",i,"-cert-file",c,"localhost"]),K(b`${v.successIcon()} Certificate generated at ${a}\n`),await Yt()&&(ae({headline:"It looks like you're using WSL.",body:["Additional steps are required to configure certificate trust in Windows."],link:{label:"See Shopify CLI documentation",url:"https://shopify.dev/docs/apps/build/cli-for-apps/networking-options#localhost-based-development-with-windows-subsystem-for-linux-wsl"}}),K("\u{1F449} Press any key to continue"),await Kt(),K("")),{keyContent:await I(i),certContent:await I(c),certPath:gt(t,c)}}p();function Un(){let t=["Your app has extensions which need to be assigned",{command:"uid"},"identifiers."],e=["You must first map IDs to your existing extensions by running",{command:"shopify app deploy"},"interactively, without",{command:"--allow-updates"},"or",{command:"--allow-deletes"},", to finish the migration."],r={title:"Reference",body:{list:{items:[{link:{label:"Migrating from the Partner Dashboard",url:"https://shopify.dev/docs/apps/build/dev-dashboard/migrate-from-partners"}}]}}};throw new T(t,void 0,[e],[r])}async function Rn(t){let e=await Hs(t);await Gs(e);let{processes:r,graphiqlUrl:o,previewUrl:n,devSessionStatusManager:s}=await dn(e);await Ks(e),await Ys({processes:r,previewUrl:n,graphiqlUrl:o,config:e,devSessionStatusManager:s})}async function Hs(t){let{app:e,remoteApp:r,developerPlatformClient:o,store:n,specifications:s,tunnel:a}=t,i;if(a.mode==="auto"){let E=await $();i=await Kr(t.commandConfig,E,"cloudflare")}let c=await Qr(r,o,s,r.flags);r.configuration=c,Jr({app:e,remoteApp:r,selectedStore:n,cachedInfo:tt(t.directory),organization:t.organization,tunnelMode:a.mode}),e.configuration.build?.dev_store_url&&(e.configuration.build={...e.configuration.build,dev_store_url:n.shopDomain},await(await Jt.read(e.configPath)).patch({build:{dev_store_url:n.shopDomain}})),!t.skipDependenciesInstallation&&!t.project.usesWorkspaces&&await Mr(t.project);let d=t.graphiqlPort??await $(ce.graphiql),l=[{for:"GraphiQL",flagToRemedy:"--graphiql-port",requested:t.graphiqlPort??ce.graphiql,actual:d}];a.mode==="use-localhost"&&l.push({for:"localhost",flagToRemedy:"--localhost-port",requested:a.requestedPort,actual:a.actualPort}),vn(l);let{webs:u,...h}=await zs(e.directory,e.webs,d,a,i,r.configuration,t.installMkcert);e.webs=u;let w=e.configuration.build?.automatically_update_urls_on_dev,m=tt(t.directory)?.previousAppId,f=r.apiKey,U=await js(u,t.update,h,e,w,r,f);return{storeFqdn:n.shopDomain,storeId:n.shopId,remoteApp:r,remoteAppUpdated:r.apiKey!==m,localApp:e,developerPlatformClient:o,commandOptions:t,network:h,partnerUrlsUpdated:U,graphiqlPort:d,graphiqlKey:t.graphiqlKey}}async function Gs(t){await Bs(t)}async function Bs(t){let{developerPlatformClient:e,remoteApp:r}=t;(await e.appExtensionRegistrations(r)).app.extensionRegistrations.filter(n=>n.type.toLowerCase()!=="webhook_subscription").every(n=>n.id)||Un()}async function Ks(t){qr({directory:t.commandOptions.directory,previousAppId:t.remoteApp.apiKey}),await Vs({devOptions:t.commandOptions,tunnelUrl:t.network.proxyUrl,shouldUpdateURLs:t.partnerUrlsUpdated,storeFqdn:t.storeFqdn}),await Ft({config:t.commandOptions.commandConfig,exitMode:"ok"})}async function js(t,e,r,o,n,s,a){let{backendConfig:i,frontendConfig:c}=Y(t),d=!1;if((c??i)&&e){let l=Hr(r.proxyUrl,t.map(({configuration:u})=>u.auth_callback_path).find(u=>u),o.configuration.app_proxy);d=await Br({currentURLs:r.currentUrls,appDirectory:o.directory,cachedUpdateURLs:n,newApp:s.newApp,localApp:o,apiKey:a,newURLs:l}),d&&o.setDevApplicationURLs(l)}return d}async function zs(t,e,r,o,n,s,a){let{backendConfig:i,frontendConfig:c}=Y(e);await Qs(e,r);let d=o.mode==="use-localhost"?{noTunnelUseLocalhost:!0,port:o.actualPort}:{noTunnelUseLocalhost:!1,tunnelUrl:o.mode==="custom"?o.url:void 0,tunnelClient:n},[{frontendUrl:l,frontendPort:u,usingLocalhost:h},w,m]=await Promise.all([Wr(d),Ct()??i?.configuration.port??$(),Gr(s)]),f=h?`${l}:${u}`:l,U=c?.configuration.port;c&&(U??(U=c===i?w:await $()),c.configuration.port=U),U=U??await $();let E;if(o.mode==="use-localhost"){let{keyContent:R,certContent:x,certPath:_}=await Sn({appDirectory:t,forceInstall:a});E={key:R,cert:x,certPath:_,port:o.actualPort}}return{proxyUrl:f,proxyPort:u,frontendPort:U,backendPort:w,currentUrls:m,webs:e,reverseProxyCert:E}}async function Ys({processes:t,previewUrl:e,graphiqlUrl:r,config:o,devSessionStatusManager:n}){let s=new Tt,a=t.map(d=>({prefix:d.prefix,action:async(u,h,w)=>{let m=d.function;return m({stdout:u,stderr:h,abortSignal:w},d.options)}})),i=o.developerPlatformClient,c={id:o.remoteApp.id,developerPlatformClient:i};return Pn({processes:a,previewUrl:e,graphiqlUrl:r,app:c,abortController:s,shopFqdn:o.storeFqdn,devSessionStatusManager:n,appURL:o.localApp.devApplicationURLs?.applicationUrl,appName:o.remoteApp.title,organizationName:o.commandOptions.organization.businessName,configPath:o.localApp.configPath,localURL:o.network.proxyUrl})}async function Vs(t){let e=await xn(t.devOptions.commandConfig,t.tunnelUrl);await j.addPublicMetadata(()=>({cmd_dev_tunnel_type:e,cmd_dev_tunnel_custom_hash:e==="custom"?ze(t.tunnelUrl):void 0,cmd_dev_urls_updated:t.shouldUpdateURLs,store_fqdn_hash:ze(t.storeFqdn),store_domain:t.storeFqdn,cmd_app_dependency_installation_skipped:t.devOptions.skipDependenciesInstallation})),await j.addSensitiveMetadata(()=>({store_fqdn:t.storeFqdn,cmd_dev_tunnel_custom:e==="custom"?t.tunnelUrl:void 0}))}async function Qs(t,e){let r=t.map(n=>n.configuration.port).filter(n=>n),o=r.find((n,s)=>r.indexOf(n)!==s);if(o)throw new T(`Found port ${o} for multiple webs.`,"Please define a unique port for each web.");await Promise.all([...r.map(async n=>{if(!await Qe(n))throw new T(`Hard-coded port ${n} is not available, please choose a different one.`)}),(async()=>{if(!await Qe(e)){let s=`Port ${e} is not available for serving GraphiQL.`,a=["Choose a different port for the",{command:"--graphiql-port"},"flag."];throw new T(s,a)}})()])}p();async function Tn({useLocalhost:t,localhostPort:e,tunnelUrl:r}){if(r)return{mode:"custom",url:r};if(!t&&!e)return{mode:"auto"};let o=e??ce.localhost,n=await $(o);if(e&&n!==o){let s=`Port ${e} is not available.`,a=["Choose a different port for the",{command:"--localhost-port"},"flag."];throw new T(s,a)}return{mode:"use-localhost",requestedPort:o,actualPort:n}}var M=J(kn(),1);var ft,G=class extends Zr{static analyticsStopCommand(){return"app dev stop"}async run(){let{flags:e}=await this.parse(ft),r=await Tn({useLocalhost:e["use-localhost"]??!1,tunnelUrl:e["tunnel-url"],localhostPort:e["localhost-port"]});await Ot(()=>({cmd_app_dependency_installation_skipped:e["skip-dependencies-installation"],cmd_app_reset_used:e.reset,cmd_dev_tunnel_type:r.mode})),await jr(e.path);let o=await Xr({directory:e.path,clientId:e["client-id"],forceRelink:e.reset,userProvidedConfigName:e.config}),n=await eo({appContextResult:o,storeFqdn:e.store,forceReselectStore:e.reset}),s={...o,store:n,directory:e.path,update:!e["no-update"],skipDependenciesInstallation:e["skip-dependencies-installation"],commandConfig:this.config,subscriptionProductUrl:e["subscription-product-url"],checkoutCartUrl:e["checkout-cart-url"],theme:e.theme,themeExtensionPort:e["theme-app-extension-port"],storePassword:e["store-password"],notify:e.notify,graphiqlPort:e["graphiql-port"],graphiqlKey:e["graphiql-key"],installMkcert:e["install-mkcert"]??!1,tunnel:r};return await Rn(s),{app:o.app}}};ft=G;G.summary="Run the app.";G.descriptionWithMarkdown="Builds and previews your app on a dev store, and watches for changes. [Read more about testing apps locally](https://shopify.dev/docs/apps/build/cli-for-apps/test-apps-locally).";G.description=ft.descriptionWithoutMarkdown();G.flags={...Xt,...$r,store:M.Flags.string({char:"s",description:"Store URL. Must be an existing development or Shopify Plus sandbox store.",env:"SHOPIFY_FLAG_STORE",parse:async t=>Ee(t)}),"skip-dependencies-installation":M.Flags.boolean({description:"Skips the installation of dependencies. Deprecated, use workspaces instead.",env:"SHOPIFY_FLAG_SKIP_DEPENDENCIES_INSTALLATION",default:!1}),"no-update":M.Flags.boolean({description:"Uses the app URL from the toml file instead an autogenerated URL for dev.",env:"SHOPIFY_FLAG_NO_UPDATE",default:!1}),"subscription-product-url":M.Flags.string({description:'Resource URL for subscription UI extension. Format: "/products/{productId}"',env:"SHOPIFY_FLAG_SUBSCRIPTION_PRODUCT_URL"}),"checkout-cart-url":M.Flags.string({description:'Resource URL for checkout UI extension. Format: "/cart/{productVariantID}:{productQuantity}"',env:"SHOPIFY_FLAG_CHECKOUT_CART_URL"}),"tunnel-url":M.Flags.string({description:'Use a custom tunnel, it must be running before executing dev. Format: "https://my-tunnel-url:port".',env:"SHOPIFY_FLAG_TUNNEL_URL",exclusive:["tunnel"]}),"use-localhost":M.Flags.boolean({description:"Service entry point will listen to localhost. A tunnel won't be used. Will work for testing many app features, but not those that directly invoke your app (E.g: Webhooks)",env:"SHOPIFY_FLAG_USE_LOCALHOST",exclusive:["tunnel-url"]}),"install-mkcert":M.Flags.boolean({description:"Install and use mkcert to generate localhost certificates when --use-localhost is enabled without prompting.",env:"SHOPIFY_FLAG_INSTALL_MKCERT",dependsOn:["use-localhost"]}),"localhost-port":Te({description:"Port to use for localhost.",env:"SHOPIFY_FLAG_LOCALHOST_PORT"}),theme:M.Flags.string({char:"t",description:"Theme ID or name of the theme app extension host theme.",env:"SHOPIFY_FLAG_THEME"}),"theme-app-extension-port":Te({description:"Local port of the theme app extension development server.",env:"SHOPIFY_FLAG_THEME_APP_EXTENSION_PORT"}),"store-password":M.Flags.string({description:"The password for storefronts with password protection.",env:"SHOPIFY_FLAG_STORE_PASSWORD"}),notify:M.Flags.string({description:"The file path or URL. The file path is to a file that you want updated on idle. The URL path is where you want a webhook posted to report on file changes.",env:"SHOPIFY_FLAG_NOTIFY"}),"graphiql-port":Te({hidden:!0,description:"Local port of the GraphiQL development server.",env:"SHOPIFY_FLAG_GRAPHIQL_PORT"}),"graphiql-key":M.Flags.string({hidden:!0,description:"Key used to authenticate GraphiQL requests. By default, a key is automatically derived from the app secret. Use this flag to override with a custom key.",env:"SHOPIFY_FLAG_GRAPHIQL_KEY"})};var Yu=G;export{La as a,Yu as b};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Pb as d}from"./chunk-BCZMDFI2.js";import{g as p}from"./chunk-VKWPEFWQ.js";p();import{spawn as m}from"child_process";function b(n=process.pid,s="SIGTERM",e=!0,i){$(n,s,e,i??(t=>{t&&d(`Failed to kill process ${n}: ${t}`)}))}function $(n,s,e,i){let o=typeof n=="number"?n.toString():n;if(!/^\d+$/.test(o)){i(new Error("pid must be a number"));return}let t={};t[o]=[];let r=new Set;switch(r.add(o),process.platform){case"win32":{m("taskkill",["/pid",o,"/T","/F"]).on("close",f=>{f===0?i():i(new Error(`taskkill exited with code ${f}`))});break}case"darwin":h(o,t,r,function(c){return m("pgrep",["-lfP",c])},function(){k(t,s,o,e,i)});break;default:h(o,t,r,function(c){return m("ps",["-o","pid command","--no-headers","--ppid",c])},function(){k(t,s,o,e,i)});break}}function k(n,s,e,i,o){let t=new Set;try{Object.keys(n).forEach(function(r){n[r].forEach(function(c){t.has(c)||(w(c,s),t.add(c))}),r===e&&i&&!t.has(r)&&(w(r,s),t.add(r))})}catch(r){o(r);return}o()}function w(n,s){try{process.kill(parseInt(n,10),s)}catch(e){if(e.code!=="ESRCH")throw e}}function h(n,s,e,i,o){let t=i(n),r="";t.stdout?.on("data",function(f){let a=f.toString("ascii");r+=a});let c=f=>{if(e.delete(n),f!==0){if(e.size===0){o();return}return}r.trim().split(`
|
|
2
|
+
`).forEach(function(a){let l=a.match(/^(\d+)\s(.*)$/);if(l){let u=l[1],E=l[2];s[n].push(u),s[u]=[],d(`Killing process ${u}: ${E}`),e.add(u),h(u,s,e,i,o)}})};t.on("close",c)}export{b as a};
|