shopify 4.6.1 → 4.7.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-5SII3GTA.js +1 -0
- package/dist/analytics-F56E2NGH.js +1 -0
- package/dist/bootstrap.js +1 -1
- package/dist/{chunk-6HQMZ324.js → chunk-22NROZ5X.js} +18 -18
- package/dist/chunk-22NWEE5U.js +5 -0
- package/dist/{chunk-LURVEPYP.js → chunk-26DH5P7S.js} +1 -1
- package/dist/chunk-27UEK3FU.js +6 -0
- package/dist/chunk-2F2DXTRI.js +9 -0
- package/dist/chunk-2S3GOPRL.js +1 -0
- package/dist/{chunk-YR7K4NQT.js → chunk-3HCWJRL6.js} +1 -1
- package/dist/chunk-3KM2GKXH.js +3 -0
- package/dist/chunk-3MN3WLA2.js +1 -0
- package/dist/chunk-3WV7DQMM.js +12 -0
- package/dist/chunk-46BKAF3F.js +7 -0
- package/dist/chunk-4FCS6PJY.js +1 -0
- package/dist/{chunk-NKBSS7YL.js → chunk-4FI2YBRF.js} +1 -1
- package/dist/{chunk-EZBB2ULE.js → chunk-4I7TUB3K.js} +1 -1
- package/dist/chunk-4NXLDIW5.js +1 -0
- package/dist/chunk-4VJ6YK7U.js +1 -0
- package/dist/chunk-4WGJUVXS.js +20 -0
- package/dist/chunk-53IU36CL.js +1 -0
- package/dist/chunk-5HBIIYSK.js +1 -0
- package/dist/{chunk-NKT5U6IJ.js → chunk-5JW4JQWZ.js} +1 -1
- package/dist/chunk-5MD7GNEY.js +7 -0
- package/dist/chunk-5QZHJCZM.js +1 -0
- package/dist/chunk-5WGT45CO.js +10 -0
- package/dist/chunk-6AV6GX5W.js +2 -0
- package/dist/chunk-6ELAWKMY.js +18 -0
- package/dist/chunk-6G5TDB45.js +1 -0
- package/dist/{chunk-STCLJWHD.js → chunk-6K3AJTNO.js} +1 -1
- package/dist/chunk-6QJIGFQJ.js +6 -0
- package/dist/{chunk-GD5IRJBE.js → chunk-6R62DGJG.js} +1 -1
- package/dist/{chunk-K4M32VKU.js → chunk-6SM4RY3I.js} +1 -1
- package/dist/chunk-76NEIDP5.js +1 -0
- package/dist/chunk-77AC3OJQ.js +25 -0
- package/dist/{chunk-7MD5MIGN.js → chunk-7EUIO4ZO.js} +8 -8
- package/dist/chunk-7JIYJMRN.js +16 -0
- package/dist/chunk-7S73765P.js +5 -0
- package/dist/chunk-7Y7AZRL3.js +10 -0
- package/dist/{chunk-Y2PC2BBJ.js → chunk-AEUCDGTB.js} +4 -4
- package/dist/chunk-AFT6ABDE.js +10 -0
- package/dist/chunk-AIA7JVSJ.js +1 -0
- package/dist/chunk-AWHS336T.js +1 -0
- package/dist/chunk-B4OMIONW.js +5 -0
- package/dist/chunk-BI7LE6CZ.js +1 -0
- package/dist/{chunk-LJZIIURR.js → chunk-CNMJ6QXM.js} +1 -1
- package/dist/chunk-CRP4PQU2.js +1 -0
- package/dist/{chunk-DC7TXY4K.js → chunk-CUUCRIGC.js} +1 -1
- package/dist/chunk-DEMZRLX5.js +7 -0
- package/dist/{chunk-LXOBW4AW.js → chunk-DLSUDLXD.js} +1 -1
- package/dist/chunk-DMFEYI4G.js +1 -0
- package/dist/chunk-DPNZWBT5.js +1 -0
- package/dist/chunk-ELSDVDT7.js +1 -0
- package/dist/chunk-EMETQFFJ.js +7 -0
- package/dist/chunk-ESPT6CGE.js +1 -0
- package/dist/chunk-EULSSTWY.js +4 -0
- package/dist/{chunk-RMF3YNWE.js → chunk-EWS2RNM6.js} +1 -1
- package/dist/chunk-FAXNGDWI.js +11 -0
- package/dist/chunk-FELV7GWY.js +1 -0
- package/dist/chunk-FQQXU5IN.js +2 -0
- package/dist/chunk-GFWXVO72.js +317 -0
- package/dist/chunk-GJ4A4QKE.js +1 -0
- package/dist/chunk-GW4JHUIA.js +6 -0
- package/dist/{chunk-H5I7BSNG.js → chunk-GXOFJIKQ.js} +52 -52
- package/dist/chunk-HCQABTQL.js +1 -0
- package/dist/{chunk-MMP3F6LO.js → chunk-HOVIGRE4.js} +1 -1
- package/dist/chunk-HQUWYKSJ.js +19 -0
- package/dist/chunk-HRHNJFAA.js +8 -0
- package/dist/{chunk-X5RH4ALT.js → chunk-HU4GFVEN.js} +1 -1
- package/dist/{chunk-XZ2KUBFJ.js → chunk-I2LNQKIJ.js} +1 -1
- package/dist/chunk-I6XH7XDX.js +2 -0
- package/dist/{chunk-C7LFLIRT.js → chunk-IA3XNJ56.js} +1 -1
- package/dist/{chunk-WE3VLC2S.js → chunk-IENBHP2S.js} +7 -7
- package/dist/{chunk-UTK6V2NE.js → chunk-IF6EYTHG.js} +8 -8
- package/dist/chunk-IQT6LOA2.js +1 -0
- package/dist/chunk-IX4IGE5H.js +1 -0
- package/dist/{chunk-MY2H5XPY.js → chunk-J2VRPZFC.js} +1 -1
- package/dist/chunk-JD5P5RAJ.js +1 -0
- package/dist/chunk-JJSV7HNM.js +1 -0
- package/dist/{chunk-KRZABRYT.js → chunk-JLGA3B7P.js} +1 -1
- package/dist/chunk-JNIPCLAF.js +1 -0
- package/dist/{chunk-U3P5TIIR.js → chunk-JNVCCE6M.js} +1 -1
- package/dist/chunk-JQUEW7CB.js +3 -0
- package/dist/chunk-K3VLFPPI.js +1 -0
- package/dist/chunk-K63FW7Q7.js +1 -0
- package/dist/{chunk-P2P2MAZQ.js → chunk-KBBITJSF.js} +1 -1
- package/dist/chunk-KDBKEVCF.js +3 -0
- package/dist/chunk-KNVHXIEB.js +3 -0
- package/dist/chunk-KRLEEYLL.js +1 -0
- package/dist/chunk-KT5MDCII.js +6 -0
- package/dist/{chunk-W2357IN2.js → chunk-LBREJXT6.js} +1 -1
- package/dist/chunk-LFOBYEWG.js +1 -0
- package/dist/{chunk-FBVNXRVB.js → chunk-LKQ3EJ6Z.js} +1 -1
- package/dist/chunk-LKZQSER3.js +1 -0
- package/dist/{chunk-XWPPBOGF.js → chunk-LQ7ENG4V.js} +1 -1
- package/dist/chunk-M5Q74UZM.js +3 -0
- package/dist/chunk-MK7MOLLI.js +1 -0
- package/dist/{chunk-PCTVUTV3.js → chunk-MTTBBZSR.js} +1 -1
- package/dist/{chunk-QARALFHD.js → chunk-N4KDWHT2.js} +1 -1
- package/dist/chunk-N7425436.js +3 -0
- package/dist/chunk-NSZHEXZK.js +11 -0
- package/dist/chunk-O4G6TE26.js +16 -0
- package/dist/chunk-O4RHWBBM.js +1 -0
- package/dist/chunk-O53YIDJL.js +4 -0
- package/dist/chunk-OF6CV5R4.js +1 -0
- package/dist/chunk-OJSJWGP2.js +19 -0
- package/dist/chunk-OQWMCJLY.js +3 -0
- package/dist/chunk-P5OQUFH6.js +1 -0
- package/dist/{chunk-LDWMX3KZ.js → chunk-P5WLH64A.js} +1 -1
- package/dist/chunk-PE4TV5IJ.js +4 -0
- package/dist/chunk-PEHLR7XP.js +1 -0
- package/dist/chunk-PK73ZSND.js +836 -0
- package/dist/{chunk-J3D4KQOQ.js → chunk-PQG7XSQP.js} +1 -1
- package/dist/chunk-PS2UVFHP.js +4 -0
- package/dist/chunk-PU3NATV4.js +1 -0
- package/dist/{chunk-YHH3JA36.js → chunk-PV6T52KB.js} +1 -1
- package/dist/chunk-QASOHYDS.js +6 -0
- package/dist/chunk-QHLY2IID.js +2 -0
- package/dist/chunk-QT367CYF.js +32 -0
- package/dist/{chunk-EVIO6OWW.js → chunk-R2RULBBV.js} +1 -1
- package/dist/chunk-R5EGWWZH.js +2 -0
- package/dist/{chunk-NENUUNWB.js → chunk-RA3WWB2S.js} +1 -1
- package/dist/chunk-RM3B7AFT.js +1 -0
- package/dist/chunk-RXUOQZ32.js +1 -0
- package/dist/chunk-RY4MPX5A.js +8 -0
- package/dist/chunk-RY4YUBG3.js +15 -0
- package/dist/chunk-S2WUVD7V.js +1 -0
- package/dist/chunk-SCXL5UQ4.js +28 -0
- package/dist/{chunk-5INBKZRD.js → chunk-SGIMJQEM.js} +1 -1
- package/dist/chunk-SJGPJDGH.js +1 -0
- package/dist/{chunk-7EE7YOCR.js → chunk-SPE2D366.js} +5 -5
- package/dist/chunk-SYF6LGQB.js +1 -0
- package/dist/{chunk-7L5AIZOP.js → chunk-TP4Z5OZT.js} +1 -1
- package/dist/{chunk-5QDM4XIK.js → chunk-U3F6GPCE.js} +1 -1
- package/dist/chunk-U46RPVQA.js +1 -0
- package/dist/{chunk-NVQOAHID.js → chunk-UAJBQEGE.js} +1 -1
- package/dist/{chunk-GJEG7VGX.js → chunk-UK4WXL4G.js} +1 -1
- package/dist/chunk-ULR25PTO.js +15 -0
- package/dist/chunk-USBP7H7J.js +3 -0
- package/dist/chunk-UZV5H2JI.js +8 -0
- package/dist/chunk-UZVON6GP.js +1 -0
- package/dist/chunk-VI5FF6SW.js +1 -0
- package/dist/chunk-VPY47DBW.js +3 -0
- package/dist/chunk-VRH3HWYA.js +1 -0
- package/dist/chunk-VXX4EZ7G.js +2 -0
- package/dist/{chunk-HVMEBH24.js → chunk-VXYABRFY.js} +3 -3
- package/dist/{chunk-7TXWKLPY.js → chunk-WEWLPJK2.js} +1 -1
- package/dist/chunk-WMZS3Y4Z.js +1 -0
- package/dist/chunk-WOIAYH5U.js +1 -0
- package/dist/chunk-WR6LRE4I.js +1 -0
- package/dist/chunk-WSCSFFLH.js +375 -0
- package/dist/chunk-WTES5ZXR.js +1 -0
- package/dist/chunk-WXSDPMIZ.js +5 -0
- package/dist/chunk-X5JQU6T7.js +1 -0
- package/dist/{chunk-BDDROQGK.js → chunk-XMJFT4WP.js} +3 -3
- package/dist/chunk-XMQFQUUK.js +6 -0
- package/dist/chunk-XTXYS7LB.js +5 -0
- package/dist/chunk-Y6UZW73M.js +1 -0
- package/dist/{chunk-WOYI6SDK.js → chunk-YCU7ZCIG.js} +1 -1
- package/dist/chunk-YFKEESYB.js +3 -0
- package/dist/chunk-YXDIHVPY.js +5 -0
- package/dist/chunk-YY6TFARF.js +1 -0
- package/dist/chunk-Z66ZSXKB.js +1 -0
- package/dist/{chunk-M5YGJYNI.js → chunk-ZBSC2KZ7.js} +1 -1
- package/dist/chunk-ZDDLEFVO.js +1 -0
- package/dist/chunk-ZULQKYJ6.js +6 -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/send-analytics.d.ts +5 -0
- package/dist/cli/commands/send-analytics.js +1 -0
- 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/cli/services/doctor-release/theme/tests/init.js +4 -8
- package/dist/cli/services/doctor-release/theme/tests/push.js +3 -4
- package/dist/command-registry.js +1 -1
- package/dist/conf-store-QQ4DOFI3.js +1 -0
- package/dist/custom-oclif-loader-BWAMUFQ4.js +1 -0
- package/dist/deprecations-43ZQ5RCE.js +1 -0
- package/dist/dist-E7EGYE4D.js +1 -0
- package/dist/dist-WRUROUNV.js +1 -0
- package/dist/environments-RG64VB5R.js +1 -0
- package/dist/error-26WTDNKZ.js +1 -0
- package/dist/error-handler-XFH47Y75.js +1 -0
- package/dist/fs-Y7I3Y5IR.js +1 -0
- package/dist/hooks/did-you-mean.js +1 -1
- package/dist/hooks/hydrogen-init.js +1 -1
- package/dist/hooks/postrun.js +1 -1
- package/dist/hooks/prerun.js +2 -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/index.d.ts +1 -1
- package/dist/index.js +15 -15
- package/dist/is-global-WBIBPIVZ.js +1 -0
- package/dist/lib-M72BVWQ3.js +1 -0
- package/dist/local-HF4T3FFE.js +1 -0
- package/dist/metadata-CSQPNQP2.js +1 -0
- package/dist/{morph-ABSWZEVT.js → morph-77RHJICZ.js} +1 -1
- package/dist/node-package-manager-CVEU22N7.js +1 -0
- package/dist/notifications-system-L3FMN6EX.js +1 -0
- package/dist/os-VLZLRAHR.js +1 -0
- package/dist/output-E6OGPGXL.js +1 -0
- package/dist/{prettier-6ZMB2MMO.js → prettier-RVUAAWC7.js} +1 -1
- package/dist/system-ZETSJRKS.js +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui-7TVGGEWJ.js +1 -0
- package/dist/upgrade-F77O4ZDT.js +1 -0
- package/dist/version-3L3ANUTL.js +1 -0
- package/dist/version-DL4Y6DRX.js +1 -0
- package/dist/workerd-EHI5ZCEV.js +18 -0
- package/oclif.manifest.json +146 -120
- package/package.json +7 -8
- package/dist/analytics-3ICKUTK2.js +0 -1
- package/dist/analytics-73NVZI4Z.js +0 -1
- package/dist/chunk-25Z36VJG.js +0 -1
- package/dist/chunk-2AVFG5KT.js +0 -1
- package/dist/chunk-2DMTEIS3.js +0 -2
- package/dist/chunk-2GB3EAD3.js +0 -153
- package/dist/chunk-2NB4P6BB.js +0 -5
- package/dist/chunk-2OYQHHKC.js +0 -3
- package/dist/chunk-2VJKXWLG.js +0 -4
- package/dist/chunk-3Q5ESVIY.js +0 -1
- package/dist/chunk-3XCIUG5P.js +0 -1
- package/dist/chunk-445NFHXL.js +0 -3
- package/dist/chunk-4BPFJDH3.js +0 -1
- package/dist/chunk-4E5RGEJO.js +0 -1
- package/dist/chunk-4IHSAT76.js +0 -2
- package/dist/chunk-4TANJ4JK.js +0 -1
- package/dist/chunk-534U3DKZ.js +0 -6
- package/dist/chunk-56T6YCU2.js +0 -1
- package/dist/chunk-5HJTCBBV.js +0 -317
- package/dist/chunk-5Q4WAGQL.js +0 -3
- package/dist/chunk-65CEF3SM.js +0 -8
- package/dist/chunk-6KAWCN3I.js +0 -10
- package/dist/chunk-6ZPHB5U2.js +0 -3
- package/dist/chunk-7AWKXTNS.js +0 -4
- package/dist/chunk-7US4TVO2.js +0 -32
- package/dist/chunk-A4SBXDZB.js +0 -14
- package/dist/chunk-A7IDVXF7.js +0 -1
- package/dist/chunk-AFM3UZQO.js +0 -684
- package/dist/chunk-AHLNB45E.js +0 -3
- package/dist/chunk-ARCAYYRW.js +0 -1
- package/dist/chunk-B3U6GDHL.js +0 -7
- package/dist/chunk-BCZMDFI2.js +0 -370
- package/dist/chunk-BKJMVAI7.js +0 -1
- package/dist/chunk-BPDUBZMU.js +0 -1
- package/dist/chunk-BQOKTPUU.js +0 -1
- package/dist/chunk-CELVG4AL.js +0 -6
- package/dist/chunk-CNI7ZUST.js +0 -3
- package/dist/chunk-CONJQV7M.js +0 -11
- package/dist/chunk-CV5ELBVU.js +0 -1
- package/dist/chunk-DXUISRMZ.js +0 -2
- package/dist/chunk-EHV7EKB3.js +0 -2
- package/dist/chunk-EJDWYASP.js +0 -1
- package/dist/chunk-EQNJ2NQD.js +0 -3
- package/dist/chunk-FG5QXIQH.js +0 -9
- package/dist/chunk-FGG6HXIZ.js +0 -1
- package/dist/chunk-FJCZ4F6J.js +0 -5
- package/dist/chunk-FKH5ZF2C.js +0 -1
- package/dist/chunk-GT6BJ2GK.js +0 -1
- package/dist/chunk-GWNV44NZ.js +0 -18
- package/dist/chunk-GXO2RRV2.js +0 -1
- package/dist/chunk-H5YC3EP6.js +0 -16
- package/dist/chunk-HY3INWPI.js +0 -1
- package/dist/chunk-I6ST5X56.js +0 -1
- package/dist/chunk-ID6ASBGV.js +0 -15
- package/dist/chunk-IDQT2UY7.js +0 -1
- package/dist/chunk-IIOFR25P.js +0 -3
- package/dist/chunk-IJEDTDSJ.js +0 -25
- package/dist/chunk-ILICQWUF.js +0 -1
- package/dist/chunk-IMWEC6NF.js +0 -16
- package/dist/chunk-ITNFDLZ4.js +0 -1
- package/dist/chunk-IU5U6KKO.js +0 -4
- package/dist/chunk-IXCDFXMB.js +0 -2
- package/dist/chunk-JRTJZAFJ.js +0 -19
- package/dist/chunk-JT7YTXJ7.js +0 -1
- package/dist/chunk-JX4HSDDG.js +0 -28
- package/dist/chunk-K5GJNXDK.js +0 -1
- package/dist/chunk-KCNOFNS5.js +0 -11
- package/dist/chunk-KM2R6O7V.js +0 -6
- package/dist/chunk-KNFDN3AP.js +0 -1
- package/dist/chunk-LEDVV6XK.js +0 -1
- package/dist/chunk-LEEVJH4B.js +0 -1
- package/dist/chunk-MDQHEW7V.js +0 -8
- package/dist/chunk-MPYCIVRA.js +0 -7
- package/dist/chunk-N4RYVOXT.js +0 -2
- package/dist/chunk-NB6HHZ36.js +0 -1
- package/dist/chunk-NEK2KNKR.js +0 -8
- package/dist/chunk-NJONAV7V.js +0 -1
- package/dist/chunk-OHQTOHUX.js +0 -15
- package/dist/chunk-PKR6HS4T.js +0 -6
- package/dist/chunk-PKRDBS7O.js +0 -5
- package/dist/chunk-PMD6S7YG.js +0 -1
- package/dist/chunk-PUOCHFFI.js +0 -1
- package/dist/chunk-Q2DPBMV4.js +0 -1
- package/dist/chunk-Q6XT3YKV.js +0 -3
- package/dist/chunk-QEL3F2NY.js +0 -5
- package/dist/chunk-R2W5B7YI.js +0 -3
- package/dist/chunk-REABQXMP.js +0 -1
- package/dist/chunk-RTPVI7LE.js +0 -3
- package/dist/chunk-SFZQFEZB.js +0 -6
- package/dist/chunk-STJ3LWFL.js +0 -1
- package/dist/chunk-STJWHL36.js +0 -7
- package/dist/chunk-SZJHOXS6.js +0 -6
- package/dist/chunk-TEPMNVJN.js +0 -1
- package/dist/chunk-TNSMROUR.js +0 -1
- package/dist/chunk-UDDJQ34Y.js +0 -1
- package/dist/chunk-UKQ7NE5V.js +0 -1
- package/dist/chunk-UOQBCBKY.js +0 -1
- package/dist/chunk-UQWT2PFO.js +0 -1
- package/dist/chunk-V26QBVCN.js +0 -1
- package/dist/chunk-VVEQ4IHW.js +0 -1
- package/dist/chunk-VXBHTSMX.js +0 -20
- package/dist/chunk-WDCCITSG.js +0 -1
- package/dist/chunk-WGMYSPR2.js +0 -10
- package/dist/chunk-WHT2RCAD.js +0 -11
- package/dist/chunk-WW7TENNA.js +0 -1
- package/dist/chunk-WXJGZGQS.js +0 -1
- package/dist/chunk-X4AZV5A2.js +0 -1
- package/dist/chunk-XBBP5BWC.js +0 -7
- package/dist/chunk-XH32NPYG.js +0 -1
- package/dist/chunk-Y7A7Z2V3.js +0 -1
- package/dist/chunk-YE7XCF44.js +0 -1
- package/dist/chunk-YIFT67BD.js +0 -4
- package/dist/chunk-Z36JS7OX.js +0 -6
- package/dist/chunk-ZHPPBTNE.js +0 -28
- package/dist/chunk-ZMSE5SQB.js +0 -1
- package/dist/conf-store-YW3NWYCN.js +0 -1
- package/dist/custom-oclif-loader-4ZAXX5MR.js +0 -1
- package/dist/deprecations-VW7UIMZX.js +0 -1
- package/dist/dist-I3VCRVOE.js +0 -1
- package/dist/dist-MP4AU5F4.js +0 -1
- package/dist/environments-5P57CTOG.js +0 -1
- package/dist/error-U7DOQOWG.js +0 -1
- package/dist/error-handler-AOEXPYI7.js +0 -1
- package/dist/fs-K5NT4W2Q.js +0 -1
- package/dist/hooks/app-init.d.ts +0 -9
- package/dist/hooks/app-init.js +0 -1
- package/dist/is-global-CFYYUAIJ.js +0 -1
- package/dist/is-wsl-UEMXYJPN.js +0 -1
- package/dist/lib-JKLF33A7.js +0 -1
- package/dist/local-BRRQOCGY.js +0 -1
- package/dist/local-storage-FVSI2IBZ.js +0 -1
- package/dist/metadata-HVSGVFUQ.js +0 -1
- package/dist/node-package-manager-6JURLQKU.js +0 -1
- package/dist/notifications-system-BTEFKXCS.js +0 -1
- package/dist/output-EXMTVS2V.js +0 -1
- package/dist/system-DUJDILSL.js +0 -1
- package/dist/ui-AX6ZMY6P.js +0 -1
- package/dist/upgrade-5TEVQNLY.js +0 -1
- package/dist/version-7LKOAVDW.js +0 -1
- package/dist/version-PRFBZAWQ.js +0 -1
- package/dist/workerd-MFV7EBVM.js +0 -18
- /package/dist/{chunk-VDN6MEYI.js → chunk-NJPL5BTN.js} +0 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{b as S}from"./chunk-U3F6GPCE.js";import{a as A,b as B,c as L,f as I,j as x,k as $,m as N,t as q}from"./chunk-SGIMJQEM.js";import{a as P}from"./chunk-ESPT6CGE.js";import{a as z}from"./chunk-RA3WWB2S.js";import{b as C}from"./chunk-IX4IGE5H.js";import{C as E,V as g}from"./chunk-PK73ZSND.js";import{B as w,G as T,y as u,z as v}from"./chunk-WSCSFFLH.js";import{k as D}from"./chunk-BI7LE6CZ.js";import{a as K}from"./chunk-CTNBSUVU.js";import{Cb as b,ba as k,ga as y,qb as l,sb as d}from"./chunk-HQUWYKSJ.js";import{i as m}from"./chunk-B4OMIONW.js";import{e as _,g as c}from"./chunk-VKWPEFWQ.js";c();c();async function M(e){let{organization:o,storeFqdn:t,operationId:r,remoteApp:a}=e;u({headline:"Checking bulk operation status.",body:[{list:{items:S({organization:o,remoteApp:a,storeFqdn:t})}}]});let s=a.apiSecretKeys[0]?.secret;if(!s)throw new D("No API secret keys found for app");let p=await g(t,a.apiKey,s),i=await x({adminSession:p,operationId:r,version:await I({adminSession:p,minimumDefaultVersion:A})});i?U(i):w({headline:"Bulk operation not found.",body:d`ID: ${l.yellow(r)}`.value})}async function R(e){let{organization:o,storeFqdn:t,remoteApp:r}=e;u({headline:"Listing bulk operations.",body:[{list:{items:S({organization:o,remoteApp:r,storeFqdn:t})}}]});let a=r.apiSecretKeys[0]?.secret;if(!a)throw new D("No API secret keys found for app");let s=await g(t,r.apiKey,a),i=(await $({adminSession:s,version:await I({adminSession:s,minimumDefaultVersion:A})})).map(n=>({id:L(n.id),status:G(n.status),count:H(n.objectCount),dateCreated:k(new Date(String(n.createdAt))),dateFinished:n.completedAt?k(new Date(String(n.completedAt))):"",results:W(n.url??n.partialDataUrl)}));b(),i.length===0?u({body:"No bulk operations found in the last 7 days."}):T({rows:i,columns:{id:{header:"ID",color:"yellow"},status:{header:"STATUS"},count:{header:"COUNT"},dateCreated:{header:"DATE CREATED",color:"cyan"},dateFinished:{header:"DATE FINISHED",color:"cyan"},results:{header:"RESULTS"}}}),b()}function U(e){let{id:o,status:t,createdAt:r,completedAt:a,url:s,partialDataUrl:p}=e,i=N(e).value,n=V(r,a),f=d`ID: ${l.yellow(o)}\n${n}`.value;if(t==="COMPLETED"){let h=s?l.link("Download results",s):"";v({headline:i,body:d`${f}\n${h}`.value})}else if(t==="FAILED"){let h=p?l.link("Download partial results",p):"";w({headline:i,body:d`${f}\n${h}`.value})}else u({headline:i,body:f})}function V(e,o){let t=new Date;return o?`Finished ${y(new Date(String(o)),t)}`:`Started ${y(new Date(String(e)),t)}`}function G(e){return e==="COMPLETED"?m.green(e):e==="FAILED"?m.red(e):m.dim(e)}function H(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function W(e){return e?d`${l.link("download",e)}`.value:""}var F=_(K(),1);var O=class e extends P{static summary="Check the status of bulk operations.";static descriptionWithMarkdown=`Check the status of a specific bulk operation by ID, or list all bulk operations belonging to this app on this store in the last 7 days.
|
|
2
|
+
|
|
3
|
+
Bulk operations allow you to process large amounts of data asynchronously. Learn more about [bulk query operations](https://shopify.dev/docs/api/usage/bulk-operations/queries) and [bulk mutation operations](https://shopify.dev/docs/api/usage/bulk-operations/imports).
|
|
4
|
+
|
|
5
|
+
Use [\`bulk execute\`](https://shopify.dev/docs/api/shopify-cli/app/app-bulk-execute) to start a new bulk operation.`;static description=this.descriptionWithoutMarkdown();static flags={...C,...z,id:F.Flags.string({description:"The bulk operation ID (numeric ID or full GID). If not provided, lists all bulk operations belonging to this app on this store in the last 7 days.",env:"SHOPIFY_FLAG_ID"}),store:F.Flags.string({char:"s",description:"The store domain. Must be an existing dev store.",env:"SHOPIFY_FLAG_STORE",parse:async o=>E(o)})};async run(){let{flags:o}=await this.parse(e),{appContextResult:t,store:r}=await q(o);return o.id?await M({organization:t.organization,storeFqdn:r.shopDomain,operationId:B(o.id),remoteApp:t.remoteApp}):await R({organization:t.organization,storeFqdn:r.shopDomain,remoteApp:t.remoteApp}),{app:t.app}}};export{O as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as V}from"./chunk-
|
|
1
|
+
import{a as V}from"./chunk-CNMJ6QXM.js";import{a as N}from"./chunk-PEHLR7XP.js";import{a as F}from"./chunk-P5WLH64A.js";import{k as q,l as H,n as I}from"./chunk-7EUIO4ZO.js";import{a as Y}from"./chunk-Y6UZW73M.js";import{a as y,c as U}from"./chunk-WEWLPJK2.js";import{b as L}from"./chunk-OJSJWGP2.js";import{a as p,b as w}from"./chunk-YY6TFARF.js";import{b as g,c as x,d as M,f as _,j as R,n as j,p as D}from"./chunk-K63FW7Q7.js";import{r as k}from"./chunk-3KM2GKXH.js";import{aa as B}from"./chunk-TP4Z5OZT.js";import{S as b,wa as a,xa as O}from"./chunk-PK73ZSND.js";import{A as d,B as C,E as P,z as f}from"./chunk-WSCSFFLH.js";import{h as S}from"./chunk-BI7LE6CZ.js";import{wb as $}from"./chunk-HQUWYKSJ.js";import{f as T,q as l}from"./chunk-773TIA5M.js";import{e as z,g as v}from"./chunk-VKWPEFWQ.js";v();var A=z(B(),1);async function Te(e,t,r,o){let n=e.environment?.[0],s=t??await b(k({store:e.store}),e.password);if(e.strict){let m=e.json?"json":"text",{offenses:c}=await L(e.path??l(),m);if(c.length>0&&c.filter(J=>J.severity===A.Severity.ERROR).length>0)throw O(new S(n?`[${n}] Theme check failed. Please fix the errors before pushing.`:"Theme check failed. Please fix the errors before pushing."))}a("theme-service:push:setup"),Y({verbose:e.verbose,noColor:e.noColor});let i=e.force??!1,h=e.path?T(e.path):l();if(!await I(h)&&!await U(i,void 0,n,r))return;e.listing&&await q(h,e.listing);let u=await Z(s,e,r);u&&(a("theme-service:push:setup"),await W(u,s,{allowLive:e.allowLive??!1,environment:n,force:i,ignore:e.ignore??[],json:e.json??!1,multiEnvironment:r,nodelete:e.nodelete??!1,only:e.only??[],path:h,publish:e.publish??!1,listing:e.listing},o))}async function W(e,t,r,o){a("theme-service:push:file-system");let n=await j(e.id,t),s=H(r.path,{filters:r,listing:r.listing});a("theme-service:push:file-system");let{uploadResults:i,renderThemeSyncProgress:h}=V(e,t,n,s,r,o);await h(),r.publish&&await D(e.id,t),await G(i,e,t,r)}function E(e){for(let[t,r]of e.entries())if(!r.success)return!0;return!1}async function G(e,t,r,o){o.json?K(t,r,e,o.environment):o.publish?Q(r,e,o.environment):X(t,r,e,o.environment)}function K(e,t,r,o){let n={environment:o,theme:{id:e.id,name:e.name,role:e.role,shop:t.storeFqdn,editor_url:w(e,t),preview_url:p(e,t)}};if(E(r)){let i=`${o?`[${o}] `:""}The theme '${e.name}' was pushed with errors`;n.theme.warning=i;let h={};for(let[u,m]of r.entries())!m.success&&m.errors?.asset&&(h[u]=m.errors.asset);Object.keys(h).length>0&&(n.theme.errors=h)}$(JSON.stringify(n))}function Q(e,t,r){let o=r?[{subdued:`Environment: ${r}
|
|
2
2
|
|
|
3
3
|
`}]:[];E(t)?d({body:[...o,`Your theme was published with errors and is now live at https://${e.storeFqdn}`]}):f({body:[...o,`Your theme is now live at https://${e.storeFqdn}`]})}function X(e,t,r,o){let n=o?[{subdued:`Environment: ${o}
|
|
4
4
|
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{a as e}from"./chunk-GCN4O7HM.js";import{b as r}from"./chunk-3WV7DQMM.js";import{t}from"./chunk-AFT6ABDE.js";import{y as i}from"./chunk-WSCSFFLH.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();var o=class extends r{static summary="Disable automatic upgrades for Shopify CLI.";static descriptionWithMarkdown=`Disable automatic upgrades for Shopify CLI.
|
|
2
|
+
|
|
3
|
+
When auto-upgrade is disabled, Shopify CLI won't automatically update. Run \`shopify upgrade\` to update manually.
|
|
4
|
+
|
|
5
|
+
To enable auto-upgrade, run \`shopify config autoupgrade on\`.
|
|
6
|
+
`;static description=this.descriptionWithoutMarkdown();async run(){t(!1),i({body:e.off})}};export{o as a};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{b as i}from"./chunk-IX4IGE5H.js";import{b as o}from"./chunk-3WV7DQMM.js";import{N as t}from"./chunk-WSCSFFLH.js";import{a as p}from"./chunk-CTNBSUVU.js";import{e as h,g as a}from"./chunk-VKWPEFWQ.js";a();a();async function c(r){let e=new URLSearchParams;e.append("search",r??""),await t(`https://shopify.dev?${e.toString()}`)}var n=h(p(),1),s=class r extends o{static description="Search shopify.dev for the most relevant content matching a query. Best for discovery \u2014 surfacing the relevant pieces of documentation for a topic, rather than retrieving a whole document. To download a full document verbatim, use `doc fetch`.";static usage="search [query]";static examples=[`# open the search modal on Shopify.dev
|
|
2
|
+
shopify search
|
|
3
|
+
|
|
4
|
+
# search for a term on Shopify.dev
|
|
5
|
+
shopify search <query>
|
|
6
|
+
|
|
7
|
+
# search for a phrase on Shopify.dev
|
|
8
|
+
shopify search "<a search query separated by spaces>"
|
|
9
|
+
`];static args={query:n.Args.string()};static flags={...i};async run(){let{args:e}=await this.parse(r);await c(e.query)}};export{s as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as i}from"./chunk-SPE2D366.js";import{d as r}from"./chunk-IX4IGE5H.js";import{b as t}from"./chunk-3WV7DQMM.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();var e=class extends t{static baseFlags=r;environmentsFilename(){return i.appEnvironments}};export{e as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{h as E}from"./chunk-BI7LE6CZ.js";import{Ab as O,Ta as V,ma as N,qb as $,sb as T}from"./chunk-HQUWYKSJ.js";import{a as g,c as w,e as Y,g as m}from"./chunk-VKWPEFWQ.js";var I=w((z,R)=>{R.exports={name:"dotenv",version:"16.6.1",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard",pretest:"npm run lint && npm run dts-check",test:"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},homepage:"https://github.com/motdotla/dotenv#readme",funding:"https://dotenvx.com",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^18.11.3",decache:"^4.6.2",sinon:"^14.0.1",standard:"^17.0.0","standard-version":"^9.5.0",tap:"^19.2.0",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var K=w((X,d)=>{m();var b=g("fs"),y=g("path"),q=g("os"),F=g("crypto"),P=I(),D=P.version,C=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function S(e){let n={},r=e.toString();r=r.replace(/\r\n?/mg,`
|
|
2
2
|
`);let s;for(;(s=C.exec(r))!=null;){let a=s[1],t=s[2]||"";t=t.trim();let o=t[0];t=t.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),o==='"'&&(t=t.replace(/\\n/g,`
|
|
3
3
|
`),t=t.replace(/\\r/g,"\r")),n[a]=t}return n}function U(e){e=e||{};let n=x(e);e.path=n;let r=l.configDotenv(e);if(!r.parsed){let o=new Error(`MISSING_DATA: Cannot parse ${n} for an unknown reason`);throw o.code="MISSING_DATA",o}let s=A(e).split(","),a=s.length,t;for(let o=0;o<a;o++)try{let i=s[o].trim(),f=M(r,i);t=l.decrypt(f.ciphertext,f.key);break}catch(i){if(o+1>=a)throw i}return l.parse(t)}function B(e){console.log(`[dotenv@${D}][WARN] ${e}`)}function v(e){console.log(`[dotenv@${D}][DEBUG] ${e}`)}function j(e){console.log(`[dotenv@${D}] ${e}`)}function A(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function M(e,n){let r;try{r=new URL(n)}catch(i){if(i.code==="ERR_INVALID_URL"){let f=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw f.code="INVALID_DOTENV_KEY",f}throw i}let s=r.password;if(!s){let i=new Error("INVALID_DOTENV_KEY: Missing key part");throw i.code="INVALID_DOTENV_KEY",i}let a=r.searchParams.get("environment");if(!a){let i=new Error("INVALID_DOTENV_KEY: Missing environment part");throw i.code="INVALID_DOTENV_KEY",i}let t=`DOTENV_VAULT_${a.toUpperCase()}`,o=e.parsed[t];if(!o){let i=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${t} in your .env.vault file.`);throw i.code="NOT_FOUND_DOTENV_ENVIRONMENT",i}return{ciphertext:o,key:s}}function x(e){let n=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let r of e.path)b.existsSync(r)&&(n=r.endsWith(".vault")?r:`${r}.vault`);else n=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else n=y.resolve(process.cwd(),".env.vault");return b.existsSync(n)?n:null}function k(e){return e[0]==="~"?y.join(q.homedir(),e.slice(1)):e}function W(e){let n=!!(e&&e.debug),r=e&&"quiet"in e?e.quiet:!0;(n||!r)&&j("Loading env from encrypted .env.vault");let s=l._parseVault(e),a=process.env;return e&&e.processEnv!=null&&(a=e.processEnv),l.populate(a,s,e),{parsed:s}}function G(e){let n=y.resolve(process.cwd(),".env"),r="utf8",s=!!(e&&e.debug),a=e&&"quiet"in e?e.quiet:!0;e&&e.encoding?r=e.encoding:s&&v("No encoding is specified. UTF-8 is used by default");let t=[n];if(e&&e.path)if(!Array.isArray(e.path))t=[k(e.path)];else{t=[];for(let u of e.path)t.push(k(u))}let o,i={};for(let u of t)try{let c=l.parse(b.readFileSync(u,{encoding:r}));l.populate(i,c,e)}catch(c){s&&v(`Failed to load ${u} ${c.message}`),o=c}let f=process.env;if(e&&e.processEnv!=null&&(f=e.processEnv),l.populate(f,i,e),s||!a){let u=Object.keys(i).length,c=[];for(let p of t)try{let h=y.relative(process.cwd(),p);c.push(h)}catch(h){s&&v(`Failed to load ${p} ${h.message}`),o=h}j(`injecting env (${u}) from ${c.join(",")}`)}return o?{parsed:i,error:o}:{parsed:i}}function J(e){if(A(e).length===0)return l.configDotenv(e);let n=x(e);return n?l._configVault(e):(B(`You set DOTENV_KEY but you are missing a .env.vault file at ${n}. Did you forget to build it?`),l.configDotenv(e))}function Q(e,n){let r=Buffer.from(n.slice(-64),"hex"),s=Buffer.from(e,"base64"),a=s.subarray(0,12),t=s.subarray(-16);s=s.subarray(12,-16);try{let o=F.createDecipheriv("aes-256-gcm",r,a);return o.setAuthTag(t),`${o.update(s)}${o.final()}`}catch(o){let i=o instanceof RangeError,f=o.message==="Invalid key length",u=o.message==="Unsupported state or unable to authenticate data";if(i||f){let c=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw c.code="INVALID_DOTENV_KEY",c}else if(u){let c=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw c.code="DECRYPTION_FAILED",c}else throw o}}function H(e,n,r={}){let s=!!(r&&r.debug),a=!!(r&&r.override);if(typeof n!="object"){let t=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw t.code="OBJECT_REQUIRED",t}for(let t of Object.keys(n))Object.prototype.hasOwnProperty.call(e,t)?(a===!0&&(e[t]=n[t]),s&&v(a===!0?`"${t}" is already defined and WAS overwritten`:`"${t}" is already defined and was NOT overwritten`)):e[t]=n[t]}var l={configDotenv:G,_configVault:W,_parseVault:U,config:J,decrypt:Q,parse:S,populate:H};d.exports.configDotenv=l.configDotenv;d.exports._configVault=l._configVault;d.exports._parseVault=l._parseVault;d.exports.config=l.config;d.exports.decrypt=l.decrypt;d.exports.parse=l.parse;d.exports.populate=l.populate;d.exports=l});m();var L=Y(K());async function oe(e){if(O(T`Reading the .env file at ${$.path(e)}`),!await V(e))throw new E(`The environment file at ${e} does not exist.`);let n=await N(e);return{path:e,variables:(0,L.parse)(n)}}function se(e,n){let r=[],s=e===null?[]:e.split(`
|
|
4
4
|
`),a=[],t;for(let o of s){if(t){if(o.endsWith(t.quote)){let u=_(t.key,t.value+o.slice(0,-1),t.quote),c=n[t.key];c&&(a.push(t.key),u=_(t.key,c)),r.push(u),t=void 0}else t.value+=`${o}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as oe}from"./chunk-PV6T52KB.js";import{d as ie}from"./chunk-IX4IGE5H.js";import{a as ne,b as se}from"./chunk-3WV7DQMM.js";import{Aa as V,C as w,J as C,S as L,a as K,xa as Q,za as U}from"./chunk-PK73ZSND.js";import{e as x}from"./chunk-AFT6ABDE.js";import{A as N,B as I,E as te,a as W,x as ee}from"./chunk-WSCSFFLH.js";import{d as X,e as Z}from"./chunk-6K3AJTNO.js";import{h as F,k as re}from"./chunk-BI7LE6CZ.js";import{a as Ie}from"./chunk-CTNBSUVU.js";import{Ab as h,Fa as J,Ua as _,qb as R,sb as l}from"./chunk-HQUWYKSJ.js";import{d as z,f as k,i as Y,q as $}from"./chunk-773TIA5M.js";import{e as Te,g as f}from"./chunk-VKWPEFWQ.js";f();var T=Te(Ie(),1);var q={path:T.Flags.string({description:"The path where you want to run the command. Defaults to the current working directory.",env:"SHOPIFY_FLAG_PATH",parse:async t=>{let e=k(t);return _(e)?J(e)?e:(I({headline:"The path must be a directory, not a file.",body:[`The provided path is not a directory: ${e}`,`Did you mean: ${Y(e)}`]}),process.exit(1)):(I({headline:"A path was explicitly provided but doesn't exist.",body:[`Please check the path and try again: ${e}`]}),process.exit(1))},default:async()=>$(),noCacheDefault:!0}),password:T.Flags.string({description:"Password generated from the Theme Access app or an Admin API token.",env:"SHOPIFY_CLI_THEME_TOKEN"}),store:T.Flags.string({char:"s",description:"Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).",env:"SHOPIFY_FLAG_STORE",parse:async t=>w(t)}),environment:T.Flags.string({char:"e",description:"The environment to apply to the current command.",env:"SHOPIFY_FLAG_ENVIRONMENT",multiple:!0})},ae="Wrap the value in double quotes if you're using wildcards.",qe=t=>({only:T.Flags.string({char:"o",multiple:!0,description:`${t.charAt(0).toUpperCase()+t.slice(1)} only the specified files (Multiple flags allowed). ${ae}`,env:"SHOPIFY_FLAG_ONLY"}),ignore:T.Flags.string({char:"x",multiple:!0,description:`Skip ${t}ing the specified files (Multiple flags allowed). ${ae}`,env:"SHOPIFY_FLAG_IGNORE"})});f();f();import{AsyncLocalStorage as _e}from"node:async_hooks";var pe=new _e,ce,ue,me,de;function S(){return ce??=new x({projectName:"shopify-cli-theme-conf"}),ce}function O(){return ue??=new x({projectName:"shopify-cli-development-theme-config"}),ue}function j(){return me??=new x({projectName:"shopify-cli-repl-theme-config"}),me}function D(){return de??=new x({projectName:"shopify-cli-theme-store-password"}),de}function M(t=S()){return pe.getStore()?.store??t.get("themeStore")}function fe(t,e=S()){e.set("themeStore",t)}function He(t=S()){return h(l`Getting development theme...`),O().get(v(t))}function ze(t,e=S()){h(l`Setting development theme...`),O().set(v(e),t)}function Ye(t=S()){h(l`Removing development theme...`),O().delete(v(t))}function Je(t=S()){return h(l`Getting REPL theme...`),j().get(v(t))}function We(t,e=S()){h(l`Setting REPL theme to ${t}...`),j().set(v(e),t)}function Ke(t=S()){h(l`Removing REPL theme...`),j().delete(v(t))}function Qe(t=S()){let e=v(t);return h(l`Getting storefront password for shop ${e}...`),D().get(e)}function Ve(t,e=S()){let o=v(e);h(l`Setting storefront password for shop ${o}...`),D().set(o,t)}function Xe(t=S()){let e=v(t);h(l`Removing storefront password for ${e}...`),D().delete(e)}function v(t=S()){let e=M(t);if(!e)throw new re("Theme store is not set. This indicates an unexpected issue with the CLI. Please report this to the Shopify CLI team.",["It may be possible to recover by running",{command:"shopify theme list --store <store>"},"(setting the store flag to the store you wish to use) and then running the command again."]);return e}async function he(t,e){return pe.run({store:t},e)}function le(t){let e=t.store??M();if(!e)throw Q(new F("A store is required",`Specify the store passing ${l`${R.genericShellCommand(`--${q.store.name}=example.myshopify.com`)}`.value} or set the ${l`${R.genericShellCommand(q.store.env)}`.value} environment variable.`));return fe(e),e}f();f();var Se="shopify.theme.toml",ct=new Intl.DateTimeFormat(void 0,{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),ut=["**/.git","**/.vscode","**/.hg","**/.bzr","**/.svn","**/_darcs","**/CVS","**/*.sublime-(project|workspace)","**/.DS_Store","**/.sass-cache","**/Thumbs.db","**/desktop.ini","**/config.yml","**/node_modules/",".prettierrc.json","**/{blocks,layout,snippets}/**/*.liquid.tmp.*","**/{config,locales}/**/*.json.tmp.*","**/{sections,templates}/**/*.{liquid,json}.tmp.*"],mt=50;f();f();var B="7e9cb568cfd431c538f36d1ad3f2b4f6";var Fe="shopify-cli-store",be=240*1e3,ge;function P(){return ge??=new x({projectName:Fe}),ge}function b(t){return`${B}::${Ee(t)}`}function Ee(t){return t.replace(/\\/g,"\\\\").replace(/\./g,"\\.")}function d(t){return typeof t=="string"}function ke(t){if(!t||typeof t!="object")return;let e=t;if(typeof e.id=="number")return{id:e.id,...d(e.email)?{email:e.email}:{},...d(e.firstName)?{firstName:e.firstName}:{},...d(e.lastName)?{lastName:e.lastName}:{},...typeof e.accountOwner=="boolean"?{accountOwner:e.accountOwner}:{}}}function $e(t){if(!t||typeof t!="object")return;let e=t;if(!(!d(e.shopId)||!d(e.name)||!d(e.createdAt)))return{shopId:e.shopId,name:e.name,createdAt:e.createdAt,...d(e.placeholderAccountUuid)?{placeholderAccountUuid:e.placeholderAccountUuid}:{},...d(e.country)?{country:e.country}:{},...d(e.accessUrl)?{accessUrl:e.accessUrl}:{}}}function Pe(t){if(!t||typeof t!="object")return;let e=t;if(!d(e.store)||!d(e.clientId)||!d(e.userId)||!d(e.accessToken)||!Array.isArray(e.scopes)||!e.scopes.every(d)||!d(e.acquiredAt))return;let o=ke(e.associatedUser),r=e.kind==="preview"?"preview":"standard",n=r==="preview"?$e(e.preview):void 0;if(!(r==="preview"&&!n))return{store:e.store,clientId:e.clientId,userId:e.userId,accessToken:e.accessToken,scopes:e.scopes,acquiredAt:e.acquiredAt,...d(e.refreshToken)?{refreshToken:e.refreshToken}:{},...d(e.expiresAt)?{expiresAt:e.expiresAt}:{},...d(e.refreshTokenExpiresAt)?{refreshTokenExpiresAt:e.refreshTokenExpiresAt}:{},...o?{associatedUser:o}:{},...r==="preview"?{kind:r}:{},...n?{preview:n}:{}}}function ye(t,e,o){if(!e||typeof e!="object")return;let{sessionsByUserId:r,currentUserId:n}=e;if(!(r!==void 0||n!==void 0))return;let s=b(t);if(!r||typeof r!="object"||Array.isArray(r)||typeof n!="string"){o.delete(s);return}let a=Object.fromEntries(Object.entries(r).flatMap(([u,c])=>{let p=Pe(c);return p?[[u,p]]:[]}));if(Object.keys(a).length!==Object.keys(r).length)if(a[n])o.set(s,{currentUserId:n,sessionsByUserId:a});else{o.delete(s);return}return{currentUserId:n,sessionsByUserId:a}}function G(t,e){return ye(t,e.get(b(t)),e)}function Ce(t){return t.config?.store??{}}function we(t=P()){let e=[],o=`${B}::`;for(let[r,n]of Object.entries(Ce(t))){if(!r.startsWith(o))continue;let i=ye(r.slice(o.length),n,t),s=i?.sessionsByUserId[i.currentUserId];s&&e.push(s)}return e}function Ae(t,e=P()){let o=w(t),r=G(o,e);if(!r)return;let n=r.sessionsByUserId[r.currentUserId];if(!n){e.delete(b(o));return}return n}function wt(t,e=P()){let o=b(t.store),r=G(t.store,e),n={currentUserId:t.userId,sessionsByUserId:{...r?.sessionsByUserId??{},[t.userId]:t}};e.set(o,n)}function At(t,e,o){let r=w(t),n=typeof e=="string"?e:void 0,i=(typeof e=="string"?o:e)??P(),s=b(r);if(!n){i.delete(s);return}let a=G(r,i);if(!a)return;let{[n]:u,...c}=a.sessionsByUserId,p=Object.keys(c);if(p.length===0){i.delete(s);return}i.set(s,{currentUserId:a.currentUserId===n?p[0]:a.currentUserId,sessionsByUserId:c})}function ve(t){if(!t.expiresAt)return!1;let e=new Date(t.expiresAt).getTime();return Number.isNaN(e)?!0:e-be<Date.now()}var H=class extends se{static baseFlags=ie;environmentsFilename(){return Se}async command(e,o,r=!1,n,i){}async run(e){let o=this.constructor,r=o.multiEnvironmentsFlags,{args:n,flags:i}=await this.parse(o),s="password"in o.flags,a=(Array.isArray(i.environment)?i.environment:[i.environment]).filter(Boolean),u=r!==null&&r.some(m=>Array.isArray(m)?m.includes("store"):m==="store");if(a.length<=1){if(a[0]&&!i.store&&u)throw new F("Please provide a valid environment.");let m=s?await this.createSession(i):void 0,A=this.constructor.name.toLowerCase();if(U(`theme-command:${A}:single-env:authenticated`),i.path&&!_(i.path))throw new F(`Path does not exist: ${i.path}`);try{await this.command(i,m,!1,n)}finally{await this.logAnalyticsData(m)}return}if(r===null){N({body:"This command does not support multiple environments."});return}let{flags:c}=await this.parse(ne(o),this.argv);if("path"in c){this.errorOnGlobalPath();return}let p=await this.loadEnvironments(a,i,c),g=await this.validateEnvironments(p,r,s);"force"in o.flags&&!i.force&&!await this.showConfirmation(this.constructor.name,r,g)||await this.runConcurrent(g.valid)}storeAuthScopes(){}async loadEnvironments(e,o,r){let n=new Map;for(let i of e){let s=await oe(i,"shopify.theme.toml",{from:o.path,silent:!0});s?.store&&typeof s.store=="string"&&(s.store=w(s.store)),s?.path&&typeof s.path=="string"&&(s.path=k(s.path)),n.set(i,{flags:{...o,...s,...r,environment:[i]},validationFlags:{...s,...r}})}return n}async validateEnvironments(e,o,r){let n=[],i=[],s=r?this.storeAuthSessionsForTheme(Array.from(e.values()).map(({validationFlags:u})=>u)):new Map,a=Array.from(e.entries()).map(([u,{flags:c,validationFlags:p}])=>({environmentName:u,flags:c,validationFlags:p,storeAuthSession:this.storeAuthSessionFromCache(p,s)}));for(let{environmentName:u,flags:c,validationFlags:p,storeAuthSession:g}of a){let y=this.validConfig(p,o,u,g);if(y!==!0){let m=y.join(", ");i.push({environment:u,reason:`Missing flags: ${m}`});continue}n.push({environment:u,flags:c,requiresAuth:r,storeAuthSession:g})}return{valid:n,invalid:i}}async showConfirmation(e,o,r){let s={message:[`Run ${e.toLowerCase()} in the following environments?`],confirmationMessage:"Yes, proceed",cancellationMessage:"Cancel"},a=[...r.valid.map(({environment:u,flags:c})=>{let p=o.map(g=>{let y=Array.isArray(g)?g.find(m=>c[m]):g;if(y==="password")return"password";if(y==="path"&&typeof c.path=="string"){let m=c.path.split(/[/\\]/);if(m.length===1)return`path: ${c.path}`;let A=m[0]===""?`/${m[1]}`:m[0],E=m.at(-1);return`path: ${A}/.../${E}`}return y&&`${y}: ${c[y]}`}).join(", ");return[u,{subdued:p||"No flags required"}]}),...r.invalid.map(({environment:u,reason:c})=>[u,{error:`Skipping | ${c}`}])];return s.infoTable={Environment:a},r.invalid.length>0&&(s.confirmationMessage="Proceed anyway (will skip invalid environments)"),te(s)}async runConcurrent(e){let o=new W,r=e.map(s=>s.flags.store),n=new Set(r),i=r.length===n.size?[e]:this.createSequentialGroups(e);for(let s of i)await ee({processes:s.map(({environment:a,flags:u,requiresAuth:c,storeAuthSession:p})=>({prefix:a,action:async(g,y,m)=>{try{let A=u.store;await he(A,async()=>{let E=c?await this.createSession(u,p):void 0,xe=this.constructor.name.toLowerCase();U(`theme-command:${xe}:multi-env:authenticated`);try{await this.command(u,E,!0,{},{stdout:g,stderr:y})}finally{await this.logAnalyticsData(E)}})}catch(A){A instanceof Error&&(A.message=`Environment ${a} failed:
|
|
2
|
+
|
|
3
|
+
${A.message}`,I({body:[A.message]}))}}})),abortSignal:o.signal,showTimestamps:!0,renderOptions:{stdout:process.stderr}})}createSequentialGroups(e){let o=[];return e.forEach(r=>{let n=o.find(i=>!i.some(s=>s.flags.store===r.flags.store));n?n.push(r):o.push([r])}),o}async createSession(e,o){let r=le({store:e.store}),n=e.password;return n?await L(r,n):o??await this.storeAuthSessionForTheme({store:r})??await L(r,n)}async storeAuthSessionForTheme(e){let o=this.storeAuthScopes();if(!o)return;let r=typeof e.store=="string"?e.store:void 0,n=e.password;if(!r||n)return;let i=w(r),s=Ae(i);if(s)return this.adminSessionFromStoreAuthSession(s,i,o)}storeAuthSessionsForTheme(e){let o=this.storeAuthScopes();if(!o)return new Map;let r=new Set(e.filter(({store:n,password:i})=>typeof n=="string"&&!i).map(({store:n})=>w(n)));return r.size===0?new Map:new Map(we().map(n=>{let i=w(n.store);if(!r.has(i))return;let s=this.adminSessionFromStoreAuthSession(n,i,o);return s?[i,s]:void 0}).filter(n=>n!==void 0))}storeAuthSessionFromCache(e,o){let r=typeof e.store=="string"?e.store:void 0,n=e.password;if(!(!r||n))return o.get(w(r))}adminSessionFromStoreAuthSession(e,o,r){if(ve(e)){h(`Ignoring stored store auth session for ${o}: it expired at ${e.expiresAt??"unknown"}.`);return}if(!this.hasRequiredStoreAuthScopes(e.scopes,r)){h(`Ignoring stored store auth session for ${o}: it is missing required scopes (has: ${e.scopes.join(", ")}; needs: ${r.join(", ")}).`);return}return h(`Using stored store auth session for ${o} (scopes: ${e.scopes.join(", ")}).`),C(e.userId),{token:e.accessToken,storeFqdn:o}}expandImpliedStoreAuthScopes(e){let o=new Set(e);for(let r of e){let n=r.match(/^(unauthenticated_)?write_(.*)$/);n&&o.add(`${n[1]??""}read_${n[2]}`)}return o}hasRequiredStoreAuthScopes(e,o){let r=this.expandImpliedStoreAuthScopes(e);return o.every(n=>r.has(n))}validConfig(e,o,r,n){let i=o.filter(s=>Array.isArray(s)?!s.some(a=>this.hasRequiredFlag(e,a,n)):!this.hasRequiredFlag(e,s,n)).map(s=>Array.isArray(s)?s.join(" or "):s);return i.length>0?(N({body:[`Missing required flags in environment configuration${r?` for ${r}`:""}:`,{list:{items:i}}]}),i):!0}hasRequiredFlag(e,o,r){return o==="password"&&r?!0:!!e[o]}errorOnGlobalPath(){let e=z($(),"shopify.theme.toml"),o=_(e);I({body:["Can't use `--path` flag with multiple environments.",...o?["Configure each environment's theme path in your shopify.theme.toml file instead."]:["Run this command from the directory containing shopify.theme.toml.","No shopify.theme.toml found in current directory."]]})}async logAnalyticsData(e){if(!e)return;let o=V();await X(()=>({store_fqdn_hash:K(e.storeFqdn),store_domain:e.storeFqdn,cmd_theme_timings:JSON.stringify(o.timings),cmd_theme_errors:JSON.stringify(o.errors),cmd_theme_retries:JSON.stringify(o.retries),cmd_theme_events:JSON.stringify(o.events)})),await Z(()=>({store_fqdn:e.storeFqdn}))}};export{B as a,we as b,Ae as c,wt as d,At as e,M as f,He as g,ze as h,Ye as i,Je as j,We as k,Ke as l,Qe as m,Ve as n,Xe as o,q as p,qe as q,le as r,ct as s,ut as t,mt as u,H as v};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as n}from"./chunk-3WV7DQMM.js";import{y as t}from"./chunk-WSCSFFLH.js";import{j as r}from"./chunk-4VJ6YK7U.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();var e=class extends n{static description="Run CLI doctor-release tests";static hidden=!0;async run(){r()&&t({headline:"Shopify CLI Doctor Release.",body:["Available doctor-release commands:",""," shopify doctor-release theme -e <environment> Run all theme command tests","","The -e/--environment flag is required to specify the store configuration.","Use --help with any command for more options."]})}};export{e as a};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import{b as N}from"./chunk-LFOBYEWG.js";import{K as E,a as b}from"./chunk-PK73ZSND.js";import{V as O}from"./chunk-WSCSFFLH.js";import{d as _}from"./chunk-6K3AJTNO.js";import{h as f}from"./chunk-BI7LE6CZ.js";import{a as q}from"./chunk-CTNBSUVU.js";import{$ as F,qb as d,sb as g,wb as $}from"./chunk-HQUWYKSJ.js";import{c as P}from"./chunk-4VJ6YK7U.js";import{a as T}from"./chunk-JD5P5RAJ.js";import{e as j,g as w}from"./chunk-VKWPEFWQ.js";w();var u=j(q()),h=class extends u.Command{static baseFlags={};static get requiresSyncAnalytics(){return!1}static nonTTYFlagRequirements(e){return[]}static descriptionWithoutMarkdown(){return(this.descriptionWithMarkdown??"").replace(/(\[)(.*?)(])(\()(.*?)(\))/gm,'"$2" ($5)')}static analyticsNameOverride(){}static analyticsStopCommand(){}async catch(e){e.skipOclifErrorHandling=!0;let{errorHandler:t}=await import("./error-handler-XFH47Y75.js");return await t(e,this.config),u.Errors.handle(e)}async init(){if(this.exitWithTimestampWhenEnvVariablePresent(),N(this.id??""),!P()){let{registerCleanBugsnagErrorsFromWithinPlugins:t}=await import("./error-handler-XFH47Y75.js");await t(this.config)}await M(this.config),this.showNpmFlagWarning();let{showNotificationsIfNeeded:e}=await import("./notifications-system-L3FMN6EX.js");return await e(),super.init()}showNpmFlagWarning(){let e=this.constructor;Object.keys(e.flags||{}).map(r=>`npm_config_${F(r).replace(/^no_/,"")}`).some(r=>process.env[r]!==void 0)&&import("./ui-7TVGGEWJ.js").then(({renderWarning:r})=>{r({body:["NPM scripts require an extra",{command:"--"},"separator to pass the flags. Example:",{command:"npm run dev -- --reset"}]})})}exitWithTimestampWhenEnvVariablePresent(){T(process.env.SHOPIFY_CLI_ENV_STARTUP_PERFORMANCE_RUN)&&($(`
|
|
2
|
+
SHOPIFY_CLI_TIMESTAMP_START
|
|
3
|
+
{ "timestamp": ${Date.now()} }
|
|
4
|
+
SHOPIFY_CLI_TIMESTAMP_END
|
|
5
|
+
`),process.exit(0))}async parse(e,t){let n=await super.parse(e,t);return n=await this.resultWithEnvironment(n,e,t),await E(n.flags["auth-alias"]),await C(n.flags),this.failMissingNonTTYFlagRequirements(n.flags,this.applicableNonTTYFlagRequirements(n.flags)),{...n,argv:n.argv}}environmentsFilename(){}failMissingNonTTYFlags(e,t){this.failMissingNonTTYFlagRequirements(e,t.map(n=>({flags:[n]})))}failMissingNonTTYFlagRequirements(e,t){if(O())return;let n=t.filter(o=>o.flags.every(l=>e[l]===void 0||e[l]===!1));if(n.length===0)return;let r=n.length===1?"Flag not specified":"Flags not specified",i=n.map(o=>o.flags.map(l=>`--${l}`).join(" or ")).join(`
|
|
6
|
+
`),a=n.length===1?"This flag is required":"These flags are required";throw new f(g`${r}:
|
|
7
|
+
|
|
8
|
+
${d.cyan(i)}
|
|
9
|
+
|
|
10
|
+
${a} in non-interactive terminal environments, such as a CI environment, or when piping input from another process.`,"To resolve this, specify the options in the command, or run the command in an interactive environment such as your local terminal.")}applicableNonTTYFlagRequirements(e){let t=this.constructor,n={...t.baseFlags,...t.flags},r=Object.entries(n).filter(([,a])=>!!a.requiredIfNonInteractive).map(([a])=>({flags:[a]})),i=(t.nonTTYFlagRequirements?.(e)??[]).filter(a=>a.when?.(e)??!0);return[...r,...i]}async resultWithEnvironment(e,t,n){let r=e.flags,i=this.environmentsFilename();if(!i)return e;let{environmentFilePath:a}=await import("./environments-RG64VB5R.js"),o=await a(i,{from:r.path}),l=[];r.environment&&(l=Array.isArray(r.environment)?r.environment:[r.environment]);let c=l.length>0;if(!o&&!c||c&&l.length>1)return e;let{environment:m,isDefaultEnvironment:p}=await this.loadEnvironmentForCommand(r.path,i,l[0]);if(!m||p&&!S(t?.flags,"environment"))return e;let v=await super.parse(A(t),n),y=await super.parse(t,[...n??this.argv,...R(m,t,v),...p?["--environment","default"]:[]]);return I(v.flags,y.flags,p?"default":l[0],m),y}async loadEnvironmentForCommand(e,t,n){let{loadEnvironment:r}=await import("./environments-RG64VB5R.js");return n?{environment:await r(n,t,{from:e}),isDefaultEnvironment:!1}:{environment:await r("default",t,{from:e,silent:!0}),isDefaultEnvironment:!0}}};async function C(s){await _(()=>({cmd_all_verbose:s.verbose,cmd_all_path_override:s.path!==void 0,cmd_all_path_override_hash:s.path===void 0?void 0:b(s.path)}))}function I(s,e,t,n){let r={};for(let[a,o]of Object.entries(e)){let l=Object.prototype.hasOwnProperty.call(s,a),c=Object.prototype.hasOwnProperty.call(n,a);if(!l&&c){let m=a==="password"?`********${o.substr(-4)}`:o;r[a]=m}}if(Object.keys(r).length===0)return;let i=Object.entries(r).map(([a,o])=>`${a}: ${o}`);import("./ui-7TVGGEWJ.js").then(({renderInfo:a})=>{a({headline:["Using applicable flags from",{userInput:t},"environment:"],body:[{list:{items:i}}]})})}function A(s){return s?.flags?{...s,flags:Object.fromEntries(Object.entries(s.flags).map(([e,t])=>{let n={...t};return delete n.default,[e,n]}))}:s}function R(s,e,t){let n=[];for(let[r,i]of Object.entries(s)){let a=S(e?.flags,r),o=t.flags&&Object.prototype.hasOwnProperty.call(t.flags,r);if(a&&!o)if(typeof i=="boolean")if(i)n.push(`--${r}`);else throw new f(g`Environments can only specify true for boolean flags. Attempted to set ${d.yellow(r)} to false.`);else Array.isArray(i)?i.forEach(l=>n.push(`--${r}`,`${l}`)):n.push(`--${r}`,`${i}`)}return n}function S(s,e){return!!s&&Object.prototype.hasOwnProperty.call(s,e)}async function M(s){let e=Array.from(s.plugins.values()),t=["@shopify/app","@shopify/plugin-cloudflare"],n=e.filter(i=>t.includes(i.name));if(n.length>0){let i=n.map(o=>` - shopify plugins remove ${o.name}`).join(`
|
|
11
|
+
`),{renderWarning:a}=await import("./ui-7TVGGEWJ.js");a({headline:`Unsupported plugins detected: ${n.map(o=>o.name).join(", ")}`,body:["They are already included in the CLI and installing them as custom plugins can cause conflicts.",`You can fix it by running:
|
|
12
|
+
${i}`]})}let r=e.filter(i=>!t.includes(i.name));s.plugins=new Map(r.map(i=>[i.name,i]))}var z=h;export{A as a,z as b};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{a as D}from"./chunk-PEHLR7XP.js";import{a as _,c as b}from"./chunk-P5WLH64A.js";import{a as h,b as I}from"./chunk-WEWLPJK2.js";import{e as y,q as F}from"./chunk-K63FW7Q7.js";import{i as w,p as g,v as T}from"./chunk-3KM2GKXH.js";import{b as u,f as v}from"./chunk-IX4IGE5H.js";import{E as p,z as d}from"./chunk-WSCSFFLH.js";import{a as C}from"./chunk-CTNBSUVU.js";import{U as c}from"./chunk-HQUWYKSJ.js";import{e as E,g as a}from"./chunk-VKWPEFWQ.js";a();a();async function O(t,e,r){let n=e.themes;e.development&&(n=[(await new D(t).find()).id.toString()]);let m=t.storeFqdn,i=await L(t,{...e,themes:n,development:!1});if(!e.force&&!r&&!await M(i,m))return;await Promise.all(i.map(o=>(y(o)&&w(),F(o.id,t))));let l=e.environment?[{subdued:`Environment: ${e.environment}
|
|
2
|
+
|
|
3
|
+
`}]:[];d({body:c(i,o=>[...l,`The following themes were deleted from ${m}:`,I(o)],o=>[...l,"The theme",...h(o),`was deleted from ${m}.`])})}async function L(t,e){if(e.selectTheme||e.themes.length>0)return b(t,e);let r=t.storeFqdn;return[await _(t,{header:`Select a theme to delete from ${r}`,filter:{development:e.development}})]}async function M(t,e){let n={message:c(t,m=>[`Delete the following themes from ${e}?`],m=>["Delete",...h(m),`from ${e}?`]),confirmationMessage:"Yes, confirm changes",cancellationMessage:"Cancel"};return t.length>1&&(n.infoTable={"":t.map(h)}),p(n)}var s=E(C(),1);var f=class extends T{static summary="Delete remote themes from the connected store. This command can't be undone.";static descriptionWithMarkdown=`Deletes a theme from your store.
|
|
4
|
+
|
|
5
|
+
You can specify multiple themes by ID. If no theme is specified, then you're prompted to select the theme that you want to delete from the list of themes in your store.
|
|
6
|
+
|
|
7
|
+
You're asked to confirm that you want to delete the specified themes before they are deleted. You can skip this confirmation using the \`--force\` flag.`;static description=this.descriptionWithoutMarkdown();static flags={...u,...g,development:s.Flags.boolean({char:"d",description:"Delete your development theme. Use --show-all, --development, or --theme in non-interactive environments.",env:"SHOPIFY_FLAG_DEVELOPMENT"}),"show-all":s.Flags.boolean({char:"a",description:"Include other development themes in the theme list. Use --show-all, --development, or --theme in non-interactive environments.",env:"SHOPIFY_FLAG_SHOW_ALL"}),force:v(s.Flags.boolean({char:"f",description:"Skip confirmation.",env:"SHOPIFY_FLAG_FORCE"})),theme:s.Flags.string({char:"t",description:"Theme ID or name of the remote theme. Use --show-all, --development, or --theme in non-interactive environments.",env:"SHOPIFY_FLAG_THEME_ID",multiple:!0})};static multiEnvironmentsFlags=["store","password",["development","theme","show-all"]];static nonTTYFlagRequirements(){return[{flags:["theme","development","show-all"]}]}async command(e,r,n){let{environment:m,development:i,force:l,theme:o}=e,Y=o??[];await O(r,{selectTheme:e["show-all"],environment:m,development:i,themes:Y,force:l},n)}};export{f as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as C}from"./chunk-ESPT6CGE.js";import{a as y}from"./chunk-RA3WWB2S.js";import{oa as k,qa as w,ra as A,sa as P}from"./chunk-GFWXVO72.js";import{b as h}from"./chunk-IX4IGE5H.js";import{z as g}from"./chunk-WSCSFFLH.js";import{h as u}from"./chunk-BI7LE6CZ.js";import{j as r}from"./chunk-773TIA5M.js";import{g as n}from"./chunk-VKWPEFWQ.js";n();n();async function s(p){let{directory:t,configName:o,configPath:e,configuration:a,remoteApp:i}=p;if(!a.client_id)throw new u("The selected configuration is not linked to a remote app.","Run `shopify app config link` first to link this configuration to a Shopify app.");let c=i.developerPlatformClient,l=await k({developerPlatformClient:c,app:i}),m=i.flags,b={directory:t,configName:o,developerPlatformClient:c,apiKey:a.client_id},d=await w(b,l,m,i.apiKey),v=r(e),x=await A({remoteApp:i,developerPlatformClient:c,specifications:l,flags:m,configFileName:v,appDirectory:d.appDirectory??t,localAppOptions:d});return{configPath:e,configuration:x,remoteApp:i}}var f=class p extends C{static summary="Refresh an already-linked app configuration without prompts.";static descriptionWithMarkdown="Pulls the latest configuration from the already-linked Shopify app and updates the selected configuration file.\n\nThis command reuses the existing linked app and organization and skips all interactive prompts. Use `--config` to target a specific configuration file, or omit it to use the default one.";static description=this.descriptionWithoutMarkdown();static flags={...h,...y};async run(){let{flags:t}=await this.parse(p),{app:o,remoteApp:e}=await P({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config}),{configuration:a,configPath:i}=await s({directory:t.path,configName:t.config,configPath:o.configPath,configuration:o.configuration,remoteApp:e});return g({headline:`Pulled latest configuration for "${a.name}"`,body:`Updated ${r(i)} with the remote data.`}),{app:o}}};export{f as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as w}from"./chunk-
|
|
1
|
+
import{c as w}from"./chunk-N4KDWHT2.js";import{c as F,e as x}from"./chunk-OQWMCJLY.js";import{B as h,m as S,t as L,u as P,v as f,z as N}from"./chunk-GW4JHUIA.js";import{q as $,s as m}from"./chunk-AFT6ABDE.js";import{S as V,W as y,z as R}from"./chunk-WSCSFFLH.js";import{a as c}from"./chunk-76NEIDP5.js";import{Ab as l,Bb as E,gb as A,jb as U,kb as D,qb as u,sb as p,xb as d}from"./chunk-HQUWYKSJ.js";import{c as _}from"./chunk-4VJ6YK7U.js";import{p as C,q as b,r as I}from"./chunk-773TIA5M.js";import{g as v}from"./chunk-VKWPEFWQ.js";v();function M(){let e=U();if(!(!e||e==="unknown"))return e==="homebrew"?"brew upgrade shopify-cli":e==="yarn"?`${e} global add @shopify/cli@latest`:`${e} ${e==="pnpm"?"add":"install"} -g @shopify/cli@latest`}async function re(e={}){let n=I()??b(),o=D(n),t=A();if(_()){d("Skipping upgrade in development mode.");return}if(!(e.autoupgrade&&!t))if(t){let a=M();if(!a)throw new Error("Could not determine the package manager");let[r,...i]=a.split(" ");if(!r)throw new Error("Could not determine the command to run");let s=f("@shopify/cli",c),T=s?`\u2728 New version of Shopify CLI available! (${c} \u2192 ${s})`:"\u2728 New version of Shopify CLI available!";d(p`${T}
|
|
2
2
|
Now upgrading by running: ${u.genericShellCommand(a)}...`),await V(r,i,{stdio:"inherit"}),R({headline:"Shopify CLI upgraded.",body:s?`You're now on version ${s}.`:"You're now on the latest version."})}else if(o)await Y(o,c);else throw new Error("Could not determine the local project directory")}function ie(){let e=c,n=f("@shopify/cli",e);if(!n){l("Auto-upgrade: No newer version available.");return}if(process.env.SHOPIFY_CLI_FORCE_AUTO_UPGRADE==="1")return l("Auto-upgrade: Forcing auto-upgrade because of SHOPIFY_CLI_FORCE_AUTO_UPGRADE."),n;if(!m()){l("Auto-upgrade: Skipping because auto-upgrade is not enabled.");return}if(y()){l("Auto-upgrade: Skipping auto-upgrade in CI.");return}if(w(e)){l("Auto-upgrade: Skipping auto-upgrade for pre-release version.");return}return n}async function se(){try{let{notifications:e}=await F();return x(e,"",["autoupgrade"]).some(o=>o.type==="error")}catch{return!1}}async function ce(){if(y()||w(c)||m())return;let e=f("@shopify/cli",c);e&&await $("warn-on-available-upgrade",{days:1},async()=>{E(G(e))})}function G(e,n=!1){let o=M(),t=o?p`💡 Version ${e} available! Run ${u.genericShellCommand(o)}`.value:p`💡 Version ${e} available!`.value;if(n){let a=`https://github.com/Shopify/cli/releases/tag/${e}`,r=p`⚠️ This is a major version — review breaking changes before upgrading:\n ${u.link(a,a)}`.value;return`${t}
|
|
3
3
|
|
|
4
4
|
${r}`}return t}async function Y(e,n){let o=(await h(e)).content,t=o.dependencies??{},a=o.devDependencies??{},i={...t,...a}[await k()];if(!i){l("Auto-upgrade: CLI dependency not found in project dependencies, skipping local upgrade.");return}i.slice(0,1).match(/[\^~]/)&&(i=n);let s=await P(await k(),i);s?q(i,s):W(i),await J("prod",t,e),await J("dev",a,e)}async function J(e,n,o){let t=[await k(),...await j()].filter(r=>!!n[r]).map(r=>({name:r,version:"latest"})),a=await L(o);t.length>0&&await N(t,{packageManager:await S(o),type:e,directory:o,stdout:process.stdout,stderr:process.stderr,addToRootDirectory:a})}async function k(){return(await O()).name}async function j(){return(await O())?.oclif?.plugins??[]}var g;async function O(){if(!g){let e=await h(C(import.meta.url));g=g??e.content}return g}function W(e){d(p`You're on the latest version, ${u.yellow(e)}, no need to upgrade!`)}function q(e,n){d(p`Upgrading CLI from ${u.yellow(e)} to ${u.yellow(n)}...`)}export{M as a,re as b,ie as c,se as d,ce as e,G as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{I as T,K as b}from"./chunk-GFWXVO72.js";import{X as F,ba as y}from"./chunk-SPE2D366.js";import{a as f}from"./chunk-HU4GFVEN.js";import{C as D,a as S}from"./chunk-PK73ZSND.js";import{H as _,T as m,y as g}from"./chunk-WSCSFFLH.js";import{f as v,h as c}from"./chunk-BI7LE6CZ.js";import{g as d}from"./chunk-VKWPEFWQ.js";d();d();async function l(e,o,n){let i=n.clientName===F.AppManagement,a=await T({onSearchForStoresByName:async r=>n.devStoresForOrg(o.id,r),...e,showDomainOnPrompt:i});if(!a){if(g({body:await n.getCreateDevStoreLink(o)}),await m(5),!await b(o))throw new v;let t=await O(o.id,n);a=await l({stores:t,hasMorePages:!1},o,n)}return p(a),a}async function O(e,o){let s=[];return await _([{title:"Fetching organization data",task:async()=>{for(let r=0;r<10;r++){let{stores:t}=await o.devStoresForOrg(e);if(t.length>0){s=t;return}await m(3)}}}]),s}function p(e){if(!e.transferDisabled)throw!e.transferDisabled&&!e.convertableToPartnerTest?new c(`The store you specified (${e.shopDomain}) is not a dev store`,"Run dev --reset and select an eligible dev store."):new c(`The store you specified (${e.shopDomain}) is not transfer-disabled`,"Run dev --reset and select a transfer-disabled dev store.")}async function W({appContextResult:e,storeFqdn:o,forceReselectStore:n,storeTypes:i=["APP_DEVELOPMENT"]}){let{app:s,organization:a,developerPlatformClient:r}=e,t,P=s.configuration.build?.dev_store_url,h=s.hiddenConfig.dev_store_url,u=P??h,w=o??(n?void 0:u),E=i.length===1&&i[0]==="APP_DEVELOPMENT";if(w)t=await y(a,w,r,i),E&&p(t);else{let M=await r.devStoresForOrg(a.id);t=await l(M,a,r)}return t.shopDomain=D(t.shopDomain),await A(t,n),(t.shopDomain!==u||!h)&&await s.updateHiddenConfig({dev_store_url:t.shopDomain}),await r.ensureUserAccessToStore(a.id,t),t}async function A(e,o){await f.addPublicMetadata(()=>({cmd_app_reset_used:o,store_fqdn_hash:S(e.shopDomain),store_domain:e.shopDomain})),await f.addSensitiveMetadata(()=>({store_fqdn:e.shopDomain}))}export{W as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as o}from"./chunk-2S3GOPRL.js";import{g as e}from"./chunk-VKWPEFWQ.js";e();var t=class extends o{};export{t as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as r,c as u,e as I}from"./chunk-DPNZWBT5.js";import{a as o}from"./chunk-JD5P5RAJ.js";import{g as c}from"./chunk-VKWPEFWQ.js";c();c();function i(t){return!(t===void 0||t.trim()==="")}function s(t,e){switch(t){case"bitbucket":return{branch:e.BITBUCKET_BRANCH,build:e.BITBUCKET_BUILD_NUMBER,commitSha:e.BITBUCKET_COMMIT,run:e.BITBUCKET_BUILD_NUMBER,url:`https://bitbucket.org/${e.BITBUCKET_WORKSPACE}/${e.BITBUCKET_REPO_SLUG}/pipelines/results/${e.BITBUCKET_BUILD_NUMBER}`};case"circleci":return{actor:e.CIRCLE_USERNAME,branch:e.CIRCLE_BRANCH,build:e.CIRCLE_BUILD_NUM,commitSha:e.CIRCLE_SHA1,run:e.CIRCLE_WORKFLOW_ID,url:e.CIRCLE_BUILD_URL};case"github":return{actor:e.GITHUB_ACTOR,attempt:e.GITHUB_RUN_ATTEMPT,branch:e.GITHUB_REF_NAME,build:e.GITHUB_RUN_ID,commitSha:e.GITHUB_SHA,run:e.GITHUB_RUN_ID,runNumber:e.GITHUB_RUN_NUMBER,url:`${e.GITHUB_SERVER_URL}/${e.GITHUB_REPOSITORY}/actions/runs/${e.GITHUB_RUN_ID}`};case"gitlab":return{actor:e.GITLAB_USER_LOGIN,branch:e.CI_COMMIT_REF_NAME,build:e.CI_PIPELINE_ID,commitSha:e.CI_COMMIT_SHA,commitMessage:e.CI_COMMIT_MESSAGE,run:e.CI_RUNNER_ID,url:e.CI_PIPELINE_URL};case"buildkite":return{branch:e.BUILDKITE_BRANCH,build:e.BUILDKITE_BUILD_NUMBER,commitSha:e.BUILDKITE_COMMIT,commitMessage:e.BUILDKITE_MESSAGE,run:e.BUILDKITE_BUILD_NUMBER,url:e.BUILDKITE_BUILD_URL};default:return{}}}import{randomUUID as p}from"crypto";import{homedir as l,networkInterfaces as m}from"os";async function f(t){let{fileExists:e}=await import("./fs-Y7I3Y5IR.js");return e(t)}async function U(t,e){let{exec:a}=await import("./system-ZETSJRKS.js");await a(t,e)}function M(){return!!(process.stdout.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}function x(){return l()}var _,T;function B(t=process.env){return t[r.env]==="development"}function N(t=process.env){return t===process.env?_??=o(t[r.verbose])||process.argv.includes("--verbose"):o(t[r.verbose])||process.argv.includes("--verbose")}async function A(t=process.env){return Object.prototype.hasOwnProperty.call(t,r.runAsUser)?!o(t[r.runAsUser]):await f(I.executables.dev)}function y(t=process.env){return t===process.env?T??=o(t[r.unitTest]):o(t[r.unitTest])}function g(t=process.env){return o(t[r.noAnalytics])||o(t[r.optOutInstrumentation])||B(t)}function S(t=process.env){return o(t[r.alwaysLogAnalytics])}function K(t=process.env){return o(t[r.alwaysLogMetrics])}function G(t=process.env){return o(t[r.doctor])}function O(t=process.env){return t[r.gitpod]}function H(t=process.env){return t[r.codespaceName]}function w(t=process.env){return t[r.codespacePortForwardingDomain]}function P(t=process.env){return d(t).platform!=="localhost"}function k(t=process.env){return t[r.themeToken]}function d(t=process.env){return i(t[r.codespaces])?{platform:"codespaces",editor:!0}:i(t[r.gitpod])?{platform:"gitpod",editor:!0}:i(t[r.cloudShell])?{platform:"cloudShell",editor:!0}:{platform:"localhost",editor:!1}}async function F(){try{return await U("git",["--version"]),!0}catch{return!1}}function z(t=process.env){if(o(t.CI)){let e="unknown";return i(t.BITBUCKET_BUILD_NUMBER)?e="bitbucket":o(t.CIRCLECI)?e="circleci":i(t.GITHUB_ACTION)?e="github":o(t.GITLAB_CI)?e="gitlab":i(t.BUILDKITE)&&(e="buildkite"),{isCI:!0,name:e,metadata:s(e,t)}}else if(o(t.TF_BUILD))return{isCI:!0,name:"azure",metadata:s("azure",t)};return{isCI:!1}}async function $(){let t="00:00:00:00:00:00",e=Object.values(m()).flat().filter(n=>!!(n&&n.mac!==t));return(e.find(n=>!n.internal)??e[0])?.mac??p()}function V(t=process.env){let e=t[r.themeKitAccessDomain];return i(e)?e:u}function W(t=process.env){let e=t[r.otelURL];return i(e)?e:"https://otlp-http-production-cli.shopifysvc.com"}export{M as a,x as b,B as c,N as d,A as e,y as f,g,S as h,K as i,G as j,O as k,H as l,w as m,P as n,k as o,d as p,F as q,z as r,$ as s,V as t,W as u};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import{a as Mt}from"./chunk-UOHNRH6E.js";import{a as Cr}from"./chunk-USBP7H7J.js";import{a as xr}from"./chunk-HRHNJFAA.js";import{a as Er}from"./chunk-DEMZRLX5.js";import{a as Rr}from"./chunk-HCQABTQL.js";import{a as br}from"./chunk-YFKEESYB.js";import{a as Sr}from"./chunk-EMETQFFJ.js";import{b as Tr}from"./chunk-JQUEW7CB.js";import{a as Ar}from"./chunk-SCXL5UQ4.js";import{a as _r}from"./chunk-6QJIGFQJ.js";import{a as pr}from"./chunk-46BKAF3F.js";import{a as dr}from"./chunk-XMJFT4WP.js";import{a as mr}from"./chunk-QT367CYF.js";import{a as fr}from"./chunk-WTES5ZXR.js";import{a as hr}from"./chunk-RY4MPX5A.js";import{a as gr}from"./chunk-GXOFJIKQ.js";import{a as wr,b as yr,c as Pr,d as vr}from"./chunk-DMFEYI4G.js";import{a as Ur}from"./chunk-KDBKEVCF.js";import{g as ur}from"./chunk-7EUIO4ZO.js";import{a as lo,b as po,c as uo,d as mo}from"./chunk-PQG7XSQP.js";import{a as ar}from"./chunk-OJSJWGP2.js";import{a as lr}from"./chunk-RY4YUBG3.js";import{a as Xe}from"./chunk-EWS2RNM6.js";import{a as cr}from"./chunk-ELSDVDT7.js";import{c as Je,m as Ze}from"./chunk-5JW4JQWZ.js";import{b as ir,g as _e,j as Qe}from"./chunk-K63FW7Q7.js";import{a as nr,b as sr,c as ao,d as io,e as rt,f as co,g as fo}from"./chunk-YCU7ZCIG.js";import{a as $,b as Ve}from"./chunk-MTTBBZSR.js";import{a as Xt,b as Zt,d as Te,f as er,m as Ae,n as H,s as q,u as tr,v as rr,w as or}from"./chunk-Q7BOSHWX.js";import{c as kr}from"./chunk-CUUCRIGC.js";import{a as Jt}from"./chunk-I2LNQKIJ.js";import{a as Zr,b as tt,c as ee,d as eo}from"./chunk-XMQFQUUK.js";import{a as ho,f as go,g as wo,h as ot,i as yo,j as Po,k as vo,l as xo,m as Eo,n as bo,o as So,p as Uo,q as Ro,v as To,x as Ao,z as nt}from"./chunk-YXDIHVPY.js";import{a as to,b as ro,c as oo,d as no,e as so}from"./chunk-HOVIGRE4.js";import{a as Lr}from"./chunk-ZBSC2KZ7.js";import{a as Xr}from"./chunk-4I7TUB3K.js";import{a as Jr}from"./chunk-ESPT6CGE.js";import{a as Ir}from"./chunk-RA3WWB2S.js";import{B as Br,D as Kr,F as Z,M as jr,N as Yr,X as Vr,i as $r,j as W,k as Mr,m as Fr,ma as ke,na as Ie,p as et,q as Or,r as Nr,s as qr,sa as Qr,t as Wr,u as Hr,v as Gr}from"./chunk-GFWXVO72.js";import{X as zr,e as Ce,j as ie,p as Dr}from"./chunk-SPE2D366.js";import{c as Vt}from"./chunk-IENBHP2S.js";import{a as K}from"./chunk-HU4GFVEN.js";import{b as Qt,e as Re}from"./chunk-IX4IGE5H.js";import{C as ye,R as kt,a as Ke,ba as J,c as bt,da as It,e as St,g as Ut,k as Rt,o as Tt,q as At,t as _t,va as Lt,w as Ct,x as we}from"./chunk-PK73ZSND.js";import{A as se,H as be,L as Bt,N as Se,S as Ue,T as ae,U as Ye,V as Kt,X as jt,a as Et,d as Pe,e as k,f as L,h as ve,i as xe,j as Dt,k as Ft,l as Ot,m as Nt,n as qt,o as D,p as Wt,q as je,r as ze,s as Ht,t as Gt,y as Ee}from"./chunk-WSCSFFLH.js";import{a as Cn}from"./chunk-7UNQOKZW.js";import{d as $t}from"./chunk-6K3AJTNO.js";import{h as T,k as X}from"./chunk-BI7LE6CZ.js";import{a as _n}from"./chunk-CTNBSUVU.js";import{a as _o}from"./chunk-JNIPCLAF.js";import{$a as vt,Ab as g,Bb as C,Ea as Pt,Na as he,P as Be,Ta as F,Wa as ge,cb as xt,ma as I,qb as v,sb as b,ua as me,wa as fe,xb as B}from"./chunk-HQUWYKSJ.js";import{d as zt,f as Yt}from"./chunk-4VJ6YK7U.js";import{a as ft}from"./chunk-JD5P5RAJ.js";import{d as S,f as Ge,g as ht,i as ue,j as gt,k as de,o as wt,p as yt}from"./chunk-773TIA5M.js";import{e as Q,g as p}from"./chunk-VKWPEFWQ.js";p();p();p();p();p();p();var kn=300*1e3,In='The host theme could not be created to host your theme app extension. Please try again or use the "--theme" flag to use an existing theme as the host theme.';async function Co(t,e,r=Date.now()){for(;await Ln(t,e,r););}async function Ln(t,e,r){let o=await _e(t,e);if(!o||$n(o,r))throw new T(In);return await ae(3),o.processing}function $n(t,e){return t.processing&&Date.now()-e>=kn}var Mn="https://codeload.github.com/Shopify/dawn/zip/refs/tags/v15.0.0",Dn="https://cdn.shopify.com/theme-store/uhrdefhlndzaoyrgylhto59sx2i7.jpg",st=3,Le=class extends cr{context="App Ext. Host";devPreview;constructor(e,r={devPreview:!1}){super(e),this.themeId=wr(e.storeFqdn),this.devPreview=r.devPreview}async findOrCreate(){let e=await this.fetch();return e??=this.devPreview?await this.createHostTheme():await this.create(),e}setTheme(e){yr(this.adminSession.storeFqdn,e)}removeTheme(){Pr(this.adminSession.storeFqdn)}async createHostTheme(){let e={role:ir,name:this.generateThemeName(this.context),src:Mn};for(let o=0;o<st;o++){g(`Attempt ${o}/${st}: Creating theme with name "${e.name}" and role "${e.role}"`);try{let n=await Qe(e,this.adminSession);if(n)return this.setTheme(n.id.toString()),g(`Waiting for theme with id "${n.id}" to be processed`),await Co(n.id,this.adminSession),n;throw new Error}catch{g(`Failed to create theme with name "${e.name}" and role "${e.role}". Retrying...`)}}g(`Theme creation failed after ${st} retries. Creating theme using fallback theme zip`);let r=await Qe({...e,src:Dn},this.adminSession);if(!r)throw g("Theme creation failed. Exiting process."),new X(`Could not create theme with name "${e.name}" and role "${e.role}"`);return r}};p();var Fn={"theme:init":hr,"theme:check":ar,"theme:console":lr,"theme:delete":pr,"theme:dev":dr,"theme:duplicate":mr,"theme:info":fr,"theme:language-server":gr,"theme:list":vr,"theme:metafields:pull":Ur,"theme:open":xr,"theme:package":Er,"theme:profile":br,"theme:publish":Sr,"theme:preview":Rr,"theme:pull":Tr,"theme:push":Ar,"theme:rename":_r,"theme:share":Cr},ka=Fn;async function ko(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([kt(t.storeFqdn),qn(e)]),l=c.storeFqdn,[u,h]=await Promise.all([Ze(c),Je(c)]),w=h?await Xe(t.storePassword,l,u):void 0,m=await Nn(c,t.theme),f=m.id.toString();return Ee({headline:"The theme app extension development server is ready.",orderedNextSteps:!0,nextSteps:[[{link:{label:"Install your app in your development store",url:d}}],[{link:{label:"Setup your theme app extension in the host theme",url:`https://${l}/admin/themes/${f}/editor`}}],["Preview your theme app extension at",{link:{label:`http://127.0.0.1:${i}`,url:`http://127.0.0.1:${i}`}}]]}),{type:"theme-app-extensions",prefix:"theme-extensions",function:On,options:{theme:m,adminSession:c,storefrontPassword:w,crawlerSignatureHeaders:u,themeExtensionDirectory:a,themeExtensionPort:i}}}var On=async(t,{theme:e,adminSession:r,storefrontPassword:o,crawlerSignatureHeaders:n,themeExtensionDirectory:s,themeExtensionPort:a})=>{await(await ur(e,{adminSession:r,storefrontPassword:o,crawlerSignatureHeaders:n,themeExtensionDirectory:s,themeExtensionPort:a})).start()};async function Nn(t,e){let r;if(e)g(`Fetching theme with provided id ${e}`),r=await _e(parseInt(e,10),t);else{let o=new Le(t,{devPreview:!0});await be([{title:"Configuring host theme for theme app extension",task:async()=>{g("Finding or creating host theme for theme app extensions"),r=await o.findOrCreate()}}])}if(!r)throw new T("Could not find or create a host theme for theme app extensions");return r}async function qn(t){return t.developerPlatformClient?.clientName===zr.AppManagement?`https://${await we()}/?organization_id=${t.organizationId}&no_redirect=true&redirect=/oauth/redirect_from_developer_dashboard?client_id%3D${t.apiKey}`:`https://${await Ct()}/${t.organizationId}/apps/${t.id}/test`}p();p();p();p();p();p();async function Wn(t){let e=S(t.directory,"locales");return ge([S(e,"*.json")])}async function Io(t,e){let r=await Wn(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),Hn(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 Hn(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 Error(i)}}p();function $e(t,e){switch(t){case"checkout_ui_extension":return{url:e.checkoutCartUrl};case"checkout_post_purchase":return{url:e.checkoutCartUrl};case"product_subscription":return{url:e.subscriptionProductUrl??""};default:return{url:""}}}var at=".js.map";async function te(t,e,r,o){return D({outputPrefix:t.outputPrefix},async()=>{o?.clear();let n=t.getOutputPathForDirectory(e),s=`${r.url}/extensions/${t.devUUID}`,{localization:a,status:i}=await Io(t,r),c=await Mr(t),d=t.outputRelativePath?ue(n):n,l=await Gn(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:ce(l)&&l[0]?.assets?.main?l[0].assets.main:{name:"main",url:`${s}/assets/${t.outputFileName}`,lastUpdated:await he(n)??0}},supportedFeatures:{runsOffline:t.configuration.supported_features?.runs_offline??!1},capabilities:{blockProgress:t.configuration.capabilities?.block_progress??!1,networkAccess:t.configuration.capabilities?.network_access??!1,apiAccess:t.configuration.capabilities?.api_access??!1,collectBuyerConsent:{smsMarketing:t.configuration.capabilities?.collect_buyer_consent?.sms_marketing??!1,customerPrivacy:t.configuration.capabilities?.collect_buyer_consent?.customer_privacy??!1},iframe:{sources:t.configuration.capabilities?.iframe?.sources??[]}},development:{...r.currentDevelopmentPayload,resource:$e(t.type,r),root:{url:s},hidden:r.currentDevelopmentPayload?.hidden??!1,localizationStatus:i,status:r.currentDevelopmentPayload?.status??"success",...r.currentDevelopmentPayload??{status:"success"}},extensionPoints:l,localization:a??null,metafields:u,type:t.type,externalType:t.externalType,uuid:t.devUUID,surface:t.surface,version:c?.version,title:t.name,handle:t.handle,name:t.name,description:t.configuration.description,apiVersion:t.configuration.api_version,approvalScopes:r.grantedScopes,settings:t.configuration.settings}})}async function Gn(t,e,r,o){let n=t.configuration,s=n.extension_points??n.targeting;if(t.type==="checkout_post_purchase"&&(s=[{target:"purchase.post.render"}]),ce(s)){let a=await Bn(r);return Promise.all(s.map(async i=>{let{target:c,resource:d}=i,l={...i,surface:Ie(c),root:{url:`${e}/${c}`},resource:d||{url:""}},u=a?.[c];if(!u)return l;let w=await Qn(u,{target:c,extensionPoint:i,url:e,extension:t,buildDirectory:r,resolver:o});return{...l,...w}}))}return s}async function Bn(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 Kn({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 Me(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 Me(s,i,l.filepath,r,o,n,l.module);return{assets:{[u.name]:u}}}return{}}async function jn({target:t,url:e,buildDirectory:r,resolver:o},n,s){if(s.length===0)return{};for(let i of s)o?.set(`${t}/${i}`,i);let a=await Promise.all(s.map(async i=>await he(S(r,i))??0));return{assets:{[n]:{name:n,url:`${e}/assets/${t}/`,lastUpdated:Math.max(...a)}}}}async function zn({target:t,extensionPoint:e,url:r,extension:o,resolver:n},s){return e.intents?{intents:await Promise.all(e.intents.map(async(i,c)=>{let d=i.schema,l=s[c]?.schema,u=typeof l=="string"?l:d,h=typeof l=="string"?d:void 0;return{...i,schema:await Me("schema",`${t}/intents/${c}/schema`,u,r,o,n,h)}}))}:{}}async function Yn({target:t,url:e,extension:r,resolver:o},n,s){let a=await Me(n,`${t}/${n}`,s,e,r,o);return await Vn(t,s,r,o),{assets:{[a.name]:a}}}async function Vn(t,e,r,o){if(!o)return;let n=`${e}.map`;n.endsWith(at)&&await F(S(r.directory,n))&&o.set(`${t}/${gt(n)}`,n)}async function Qn(t,e){return(await Promise.all(Object.keys(t).map(async o=>{let n=t[o];return Jn(o,n)?zn(e,n):Xn(o,n)?Yn(e,o,n):Zn(o,n)?jn(e,o,n):Kn(e,o,n)}))).reduce((o,n)=>({...o,...n,assets:{...o.assets,...n.assets}}),{})}function ce(t){return Array.isArray(t)&&t.every(e=>typeof e=="object")}async function Me(t,e,r,o,n,s,a){let i=`${e}${de(r)}`;return s?.set(i,r),{name:t,url:`${o}/assets/${i}`,lastUpdated:await he(S(n.directory,a??r))??0}}function Jn(t,e){return t==="intents"&&Array.isArray(e)}function Xn(t,e){return(t==="main"||t==="should_render")&&typeof e=="string"}function Zn(t,e){return t==="assets"&&Array.isArray(e)&&e.every(r=>typeof r=="string")}import{EventEmitter as es}from"events";var le;(function(t){t.Update="PayloadUpdatedEvent:UPDATE"})(le||(le={}));async function Lo(t,e,r){return{app:{title:t.appName,apiKey:t.apiKey,url:ao(t.storeFqdn,t.apiKey),mobileUrl:co(t.storeFqdn,t.apiKey)},appId:t.id,version:t.manifestVersion,root:{url:new URL("/extensions",t.url).toString()},socket:{url:t.websocketURL},devConsole:{url:new URL("/extensions/dev-console",t.url).toString()},store:t.storeFqdn,extensions:await Promise.all(t.extensions.filter(n=>n.isPreviewable).map(n=>te(n,e,t,r&&it(r,n.devUUID))))}}function it(t,e){let r=t.get(e);return r||(r=new Map,t.set(e,r)),r}var De=class extends es{options;rawPayload;assetResolvers;constructor(e,r,o=new Map){super(),this.rawPayload=e,this.options=r,this.assetResolvers=o}getAssetResolver(e){return this.assetResolvers.get(e)}getConnectedPayload(){let e=this.getRawPayload();return{app:e.app,appId:e.appId,store:e.store,extensions:e.extensions}}getRawPayloadFilteredByExtensionIds(e){return{...this.rawPayload,extensions:this.rawPayload.extensions.filter(r=>e.includes(r.uuid))}}getRawPayload(){return this.rawPayload}updateApp(e){this.rawPayload=J(this.rawPayload,{app:e}),this.emitUpdate([])}updateExtensions(e){let r=this.rawPayload.extensions.map(o=>{let n=e.find(s=>s.uuid===o.uuid);if(n){if(ce(n.extensionPoints)&&ce(o.extensionPoints)){let s=n.extensionPoints.reduce((c,d)=>({...c,[d.target]:d}),{});o.extensionPoints=J(o.extensionPoints,n.extensionPoints,c=>c.map(d=>{let l=s[d.target];return l?J(d,l,(u,h)=>h):d}));let{extensionPoints:a,...i}=n;return J(o,i)}return J(o,n)}return o});this.rawPayload={...this.rawPayload,extensions:r},this.emitUpdate(e.map(o=>o.uuid))}async updateExtension(e,r,o,n){let s=this.rawPayload.extensions,a=s.findIndex(i=>i.uuid===e.devUUID);if(a===-1){g(b`Could not updateExtension() for extension with uuid: ${e.devUUID}`,r.stderr);return}s[a]=await te(e,o,{...this.options,currentDevelopmentPayload:n??{status:s[a]?.development.status},currentLocalizationPayload:s[a]?.localization},it(this.assetResolvers,e.devUUID)),this.rawPayload.extensions=s,this.emitUpdate([e.devUUID])}deleteExtension(e){let r=this.rawPayload.extensions.findIndex(o=>o.uuid===e.devUUID);r!==-1&&(this.rawPayload.extensions.splice(r,1),this.assetResolvers.delete(e.devUUID),this.emitUpdate([e.devUUID]))}async addExtension(e,r){this.rawPayload.extensions.push(await te(e,r,this.options,it(this.assetResolvers,e.devUUID))),this.emitUpdate([e.devUUID])}emitUpdate(e){this.emit(le.Update,e)}};p();p();var j;(function(t){t.Update="update",t.Dispatch="dispatch",t.Log="log"})(j||(j={}));function $o(t,e){return(r,o,n)=>{r.url==="/extensions"&&(g("Upgrading HTTP request to a websocket connection",e.stdout),t.handleUpgrade(r,o,n,ts(t,e)))}}function ts(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",as(t,e))}}function rs(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 os={debug:t=>v.gray(t),warn:t=>v.yellow(t),error:t=>v.errorText(t)};function ns({type:t,message:e}){let r=rs(e);switch(t){case"debug":case"warn":case"error":return b`${os[t](t.toUpperCase())}: ${r}`.value;case"log":case"info":return r;default:return`${t.toUpperCase()}: ${r}`}}function ss(t,e){D({outputPrefix:t.extensionName,stripAnsi:!1},()=>{e.stdout.write(ns(t))})}function as(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===j.Update){let a=e.payloadStore.getRawPayload().app.apiKey,i=s.app?.apiKey;if(s.app){if(a!==i)return;e.payloadStore.updateApp(s.app)}s.extensions&&e.payloadStore.updateExtensions(s.extensions)}else if(n===j.Dispatch){let a=is(o,e);Do(t,a,e)}else n===j.Log&&ss(s,e)}}function Mo(t,e){return r=>{let o={event:j.Update,version:e.manifestVersion,data:{...e.payloadStore.getRawPayloadFilteredByExtensionIds(r)}};g(b`Sending websocket update event to the websocket clients:
|
|
4
|
+
${v.json(o)}
|
|
5
|
+
`,e.stdout),Do(t,o,e)}}function Do(t,e,r){g(b`Sending websocket with event type ${e.event} and data:
|
|
6
|
+
${v.json(e.data)}
|
|
7
|
+
`,r.stdout);let o=JSON.stringify(e);t.clients.forEach(n=>n.send(o))}function is(t,e){let r=e.payloadStore.getRawPayload();return{...t,version:e.manifestVersion,data:{...t.data,extensions:[],store:r.store,app:r.app}}}var cs=10;function Fo(t){let e=new Mt.default({noServer:!0,clientTracking:!0}),r=ls(e);return t.httpServer.on("upgrade",$o(e,t)),t.payloadStore.on(le.Update,Mo(e,t)),{close:()=>{e.close(),clearInterval(r)}}}function ls(t){return setInterval(()=>{t.clients.forEach(e=>{e.readyState<2&&e.ping()})},cs*1e3)}p();p();p();function Oo(t,e){let{url:r}=$e(t.type,e);if(t.surface==="checkout"&&r){let o=new URL(`https://${e.storeFqdn}/`);return o.pathname=r,o.searchParams.append("dev",`${e.url}/extensions`),o.toString()}else{let o=new URL(`https://${e.storeFqdn}/`);return o.pathname="admin/extensions-dev",o.searchParams.append("url",Fe(t,e)),o.toString()}}function No(t,e,r){let o=Ie(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",Fe(e,r)),n.searchParams.append("target",t);break;case"customer-accounts":n=ps(e,r,t);break;default:return}return n.toString()}function ps(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 Fe(t,e){let r=new URL(e.url);return r.pathname=`/extensions/${t.devUUID}`,r.toString()}function O(t,e){Zt(t,Xt(e))}p();var ct=class extends X{constructor(e){super(`Couldn't find template ${e.template} for extension surface ${e.extensionSurface}`)}};async function qo(t){let e=await us(t),r=await I(e);return Jt(r,t.data)}async function us(t){let e=await ds(),r=[];t.extensionSurface&&r.push(S(e,`${t.extensionSurface}/${t.template}.html.liquid`)),r.push(S(e,`${t.template}.html.liquid`));let o=await ge(r);if(o.length===0)throw new ct(t);return o[0]}async function ds(){return await vt("templates/ui-extensions/html",{type:"directory",cwd:yt(import.meta.url)})}var Wo=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")}),Ho=q(t=>{H(t,"Cache-Control","no-cache")}),lt=q(async t=>Ae(t,"/extensions",307));async function ms(t,e){let{filePath:r}=e;if(!await F(r))return O(t,{statusCode:404,statusMessage:`Not Found: ${r}`});if(await Pt(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=de(r),a=n[s]||"text/plain";return H(t,"Content-Type",a),o}function Go({getExtensions:t,payloadStore:e}){return q(async r=>{let{extensionId:o,assetPath:n=""}=Te(r),s=t().find(h=>h.devUUID===o);if(!s)return O(r,{statusCode:404,statusMessage:`Extension with id ${o} not found`});let i=e.getAssetResolver(s.devUUID)?.get(n),c=i??n,d=c.endsWith(at);if(d&&i===void 0)return O(r,{statusCode:404,statusMessage:"Not Found"});let l=Ge(d?s.directory:Fr(s.outputPath)),u=Ge(S(l,c));return wt(l,u)?ms(r,{filePath:u}):O(r,{statusCode:404,statusMessage:"Not Found"})})}function pt({payloadStore:t}){return q(e=>(H(e,"content-type","application/json"),t.getRawPayload()))}function Bo({devOptions:t}){return q(e=>{g(`UI extensions server received a ${e.method} request to URL ${e.path}`,t.stdout)})}function ut({devOptions:t,getExtensions:e}){return q(async r=>{let{extensionId:o}=Te(r),n=e().find(i=>i.devUUID===o);if(!n)return O(r,{statusCode:404,statusMessage:`Extension with id ${o} not found`});if(er(r,"accept")?.startsWith("text/html")){if(n.type==="checkout_post_purchase")return qo({data:{url:Fe(n,t)},template:"index",extensionSurface:"post_purchase"});{let i=Oo(n,t);return Ae(r,i,307)}}let a=t.appWatcher.buildOutputPath;return H(r,"content-type","application/json"),{app:{apiKey:t.apiKey},version:t.manifestVersion,root:{url:new URL("/extensions",t.url).toString()},socket:{url:re(t.url)},devConsole:{url:new URL("/extensions/dev-console",t.url).toString()},store:t.storeFqdn,extension:await te(n,a,t)}})}function Ko({devOptions:t,getExtensions:e}){return q(async r=>{let{extensionId:o,extensionPointTarget:n=""}=Te(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=No(n,s,t);return a?Ae(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 fs}from"http";function jo(t){let e=tr(),r=rr();e.use(Bo(t)),e.use(Wo),e.use(Ho),r.use("/extensions/dev-console",lt),r.use("/extensions/:extensionId",ut(t)),r.use("/extensions/:extensionId/",ut(t)),r.use("/extensions/:extensionId/:extensionPointTarget",Ko(t)),r.use("/extensions/:extensionId/assets/**:assetPath",Go(t)),r.use("/extensions",pt(t)),r.use("/extensions/",pt(t)),r.use("/",lt),e.use(r);let o=fs(or(e));return o.listen(t.devOptions.port,"localhost"),o}async function zo(t){let e={...t,websocketURL:re(t.url)},r=e.appWatcher.buildOutputPath,o=new Map,n=await Lo(e,r,o),s=new De(n,e,o),a=e.extensions.filter(u=>u.isPreviewable),i=()=>a;g("Setting up the UI extensions HTTP server...",e.stdout);let c=jo({devOptions:e,payloadStore:s,getExtensions:i});g("Setting up the UI extensions Websocket server...",e.stdout);let d=Fo({...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 ee.Created:if(e.extensions.push(m.extension),!e.checkoutCartUrl){let E=await ke(e.extensions,e.storeFqdn);e.checkoutCartUrl=E}await s.addExtension(m.extension,r);break;case ee.Updated:await s.updateExtension(m.extension,e,r,{status:f,error:U});break;case ee.Deleted:e.extensions=e.extensions.filter(E=>E.devUUID!==m.extension.devUUID),await s.deleteExtension(m.extension);break}}};e.appWatcher.onEvent(l).onStart(l),e.signal.addEventListener("abort",()=>{g("Closing the UI extensions dev server..."),d.close(),c.close()})}function re(t){let e=new URL("/extensions",t);return e.protocol="wss:",e.toString()}var hs="3",gs=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 zo({appName:l,appDotEnvFile:u,appDirectory:f,id:h,extensions:m,stdout:e,stderr:t,signal:r,url:d,port:i,storeFqdn:ye(n),storeId:s,apiKey:o,grantedScopes:w,checkoutCartUrl:c,subscriptionProductUrl:a,manifestVersion:hs,appWatcher:U})};async function Yo({allExtensions:t,storeFqdn:e,checkoutCartUrl:r,...o}){let n=t.filter(a=>a.isPreviewable),s=await ke(n,e,r);return{prefix:"extensions",type:"previewable-extension",function:gs,options:{pathPrefix:"/extensions",port:-1,storeFqdn:e,allExtensions:t,cartUrl:s,...o}}}p();p();function z(t){let e=t.find(o=>Z(o,W.Frontend)),r=t.find(o=>Z(o,W.Backend));return{frontendConfig:e,backendConfig:r}}p();async function Vo(t){let r={topic:"app/uninstalled",api_version:(await lo(t.developerPlatformClient,t.organizationId))[1],address:t.address,delivery_method:mo.LOCALHOST,shared_secret:t.sharedSecret},o=await po(t.developerPlatformClient,r,t.organizationId);t.stdout.write("Sending APP_UNINSTALLED webhook to app server"),await ae(3);let n=await ws(t,o);return t.stdout.write(n?"APP_UNINSTALLED webhook delivered":"APP_UNINSTALLED webhook delivery failed"),n}async function ws(t,e){let r=0;for(;r<3;){try{return await uo(t.address,e.samplePayload,JSON.stringify({...JSON.parse(e.headers),"X-Shopify-Shop-Domain":t.storeFqdn}))}catch(o){if(o instanceof Tt&&o.code==="ECONNREFUSED")r<3&&(t.stdout.write("App isn't responding yet, retrying in 5 seconds"),await ae(5));else throw o}r++}return t.stdout.write("App hasn't started in time, giving up"),!1}var ys=async({stdout:t},e)=>{await Vo({stdout:t,developerPlatformClient:e.developerPlatformClient,address:`http://localhost:${e.deliveryPort}${e.webhooksPath}`,sharedSecret:e.apiSecret,storeFqdn:e.storeFqdn,organizationId:e.organizationId})};function Qo({webs:t,remoteAppUpdated:e,backendPort:r,frontendPort:o,organizationId:n,...s}){let{backendConfig:a,frontendConfig:i}=z(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:ys,options:{deliveryPort:a?r:o,webhooksPath:c,organizationId:n,...s}}}p();async function Jo(t){return{type:"graphiql",prefix:"graphiql",options:t,function:Ps}}var Ps=async({stdout:t,abortSignal:e},r)=>{let o=fo({apiKey:r.apiKey,apiSecret:r.apiSecret,storeFqdn:r.storeFqdn}),n=sr({stdout:t,port:r.port,storeFqdn:r.storeFqdn,key:r.key,tokenProvider:o,appContext:{appName:r.appName,appUrl:r.appUrl,apiSecret:r.apiSecret}});e.addEventListener("abort",()=>{n.close()})};p();async function Zo({webs:t,proxyUrl:e,frontendPort:r,backendPort:o,apiKey:n,apiSecret:s,scopes:a}){let{frontendConfig:i}=z(t),c=i?.configuration.hmr_server?await $():void 0,d=void 0,l=t.map(async u=>{let h=await vs({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:xs,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 vs({web:t,frontendPort:e,backendPort:r}){return Z(t,W.Frontend)?e:Z(t,W.Backend)?r:$()}async function xs({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 Xo({...E,command:u,showOutput:zt()})),await Xo({...E,command:l,showOutput:!0})}async function Xo({command:t,signal:e,directory:r,port:o,env:n,showOutput:s,stdout:a,stderr:i}){let c=t.split("&&").map(d=>d.trim())??[];for(let d of c){let[l,...u]=d.split(" ");l?.length!==0&&await Ue(l,u,{cwd:r,stdout:s?a:void 0,stderr:i,signal:e,env:{...n,PORT:`${o}`,SERVER_PORT:`${o}`}})}}p();p();p();var Oe=class{stdout;constructor(e){this.stdout=e}async info(e){await this.log(e)}async warning(e){await this.log(b`${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===ee.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 Ne=class{processBatch;queue=[];processingPromise=void 0;constructor(e){this.processBatch=e}enqueue(e){this.queue.push(e),this.processingPromise??=this.startProcessing()}async waitForCompletion(){if(this.processingPromise)return this.processingPromise}async startProcessing(){try{for(;this.queue.length>0;){let e=[...this.queue];this.queue=[],await this.processBatch(e)}}finally{this.processingPromise=void 0}}};var qe=class t{static async start(e,r){let o=new t(e,r);return await o.start(),o}statusManager;logger;options;appWatcher;bundlePath;appEventsProcessor;failedEvents=[];currentSessionState=null;constructor(e,r){this.statusManager=e.devSessionStatusManager,this.logger=new Oe(r),this.options=e,this.appWatcher=e.appWatcher,this.bundlePath=e.appWatcher.buildOutputPath,this.appEventsProcessor=new Ne(o=>this.processEvents(o))}async start(){await this.logger.info(`Preparing dev preview on ${this.options.storeFqdn}`),this.statusManager.setMessage("LOADING"),this.appWatcher.onEvent(async e=>this.onEvent(e)).onStart(async e=>this.onStart(e)).onError(async e=>this.handleDevSessionResult({status:"unknown-error",error:e}))}async onEvent(e){await this.validateAppEvent(e)&&this.appEventsProcessor.enqueue(e)}async processEvents(e){let r=[...this.failedEvents,...e],o=this.consolidateAppEvents(r);if(this.failedEvents=[],!o)return;this.statusManager.setMessage("CHANGE_DETECTED"),this.updatePreviewURL(o),await this.logger.logExtensionEvents(o);let n=Zr(),s=await this.bundleExtensionsAndUpload(o);await this.handleDevSessionResult(s,o),await this.logger.debug(`\u2705 Event handled [Network: ${tt(n)}ms - Total: ${tt(o.startTime)}ms]`)}consolidateAppEvents(e){if(e.length===0)return;if(e.length===1)return e[0];let r=e[0],o=e[e.length-1];if(!r||!o)return;let n=new Map;for(let a of e)for(let i of a.extensionEvents)n.set(i.extension.uid,i);return{app:o.app,path:o.path,extensionEvents:Array.from(n.values()),startTime:r.startTime,appWasReloaded:e.some(a=>a.appWasReloaded)}}async onStart(e){let r=this.parseBuildErrors(e);if(r.length)await this.logger.logMultipleErrors(r),await setImmediate(()=>{let o=r.map(n=>n.prefix);throw new 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&&!Yt()&&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=re(this.options.url);if(this.statusManager.status.isReady){let i={shopFqdn:this.options.storeFqdn,appId:this.options.appId,assetsUrl:s,manifest:r,inheritedModuleUids:o};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 to(n,this.bundlePath),this.statusManager.status.isReady&&(n.modules=n.modules.filter(i=>r.includes(i.uid)));let s=await xt(this.bundlePath),a=n.modules.map(i=>i.assets).filter(i=>s.includes(i));return{manifest:n,inheritedModuleUids:o,assets:a}}async uploadAssetsIfNeeded(e,r){if(!e.length&&!r)return;let o=S(ue(this.bundlePath),`dev-bundle.${this.options.developerPlatformClient.bundleFormat}`),n=[...e.map(a=>`${a}/**`),...ro];r&&n.push("manifest.json"),await oo(this.bundlePath,o,n);let s=await this.getSignedURLWithRetry();return await no(s,o),s}async getSignedURLWithRetry(){return so(this.options.developerPlatformClient,{apiKey:this.options.appId,organizationId:this.options.organizationId,id:this.options.appId})}async devSessionUpdateWithRetry(e){let r=await this.options.developerPlatformClient.devSessionUpdate(e),o=r.devSessionUpdate?.userErrors??[],n=r.devSessionUpdate?.devSession;if(n&&this.currentSessionState){let s=re(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 en({app:t,apiKey:e,developerPlatformClient:r,...o}){return{type:"dev-session",prefix:"app-preview",function:Es,options:{app:t,apiKey:e,developerPlatformClient:r,...o}}}var Es=async({stdout:t},e)=>{await qe.start(e,t)};p();p();p();var tn=async({appLog:t,appLogPayload:e,stdout:r,storeName:o,logsDir:n})=>{let s=bt().substring(0,6),i=`${bs(t.log_timestamp)}_${t.source_namespace}_${t.source}_${s}.json`,c=Ao({appLog:t,appLogPayload:e,prettyPrint:!0,storeName:o}),d=S(n,i);try{return await fe(n),await me(d,c),{fullOutputPath:d,identifier:s}}catch(l){throw r.write(`Error while writing log to file: ${l}
|
|
8
|
+
`),l}};function bs(t){let e=new Date(t),r=e.getUTCFullYear(),o=(e.getUTCMonth()+1).toString().padStart(2,"0"),n=e.getUTCDate().toString().padStart(2,"0"),s=e.getUTCHours().toString().padStart(2,"0"),a=e.getUTCMinutes().toString().padStart(2,"0"),i=e.getUTCSeconds().toString().padStart(2,"0"),c=e.getUTCMilliseconds().toString().padStart(3,"0");return`${r}${o}${n}_${s}${a}${i}_${c}Z`}var We=async({stdout:t,appLogsFetchInput:{jwtToken:e,cursor:r},developerPlatformClient:o,resubscribeCallback:n,storeName:s,organizationId:a,abortSignal:i,logsDir:c,consecutiveResubscribeFailures:d=0})=>{if(!i?.aborted)try{let l=e,u=wo,h=d,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===vo?(Ss(R,x,t),x=new ho(go(x))):R.log_type.startsWith(xo)?Us(R,x,t):t.write(JSON.stringify(x));let _=await tn({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 To({response:E,onThrottle:x=>{C("Request throttled while polling app logs.",t),C(`Retrying in ${x/1e3} seconds.`,t)},onUnknownError:x=>{C("Error while polling app logs.",t),C(`Retrying in ${x/1e3} seconds.`,t)},onResubscribe:()=>n()});if(R.resubscribeResult==="failed"){if(h+=1,h>=yo){C("App log streaming session has expired. Please restart your dev session.",t);return}}else R.resubscribeResult==="succeeded"&&(h=0);R.nextJwtToken&&(l=R.nextJwtToken),u=R.retryIntervalMs}let{cursor:U}=w;setTimeout(()=>{We({stdout:t,appLogsFetchInput:{jwtToken:l,cursor:U??r},developerPlatformClient:o,resubscribeCallback:n,storeName:s,organizationId:a,abortSignal:i,logsDir:c,consecutiveResubscribeFailures:h}).catch(E=>{g(`Unexpected error during polling: ${E}}
|
|
9
|
+
`)})},u)}catch(l){C("Error while polling app logs.",t),C(`Retrying in ${ot/1e3} seconds.`,t),g(`${l}}
|
|
10
|
+
`),setTimeout(()=>{We({stdout:t,appLogsFetchInput:{jwtToken:e,cursor:void 0},developerPlatformClient:o,resubscribeCallback:n,storeName:s,organizationId:a,abortSignal:i,logsDir:c}).catch(u=>{g(`Unexpected error during polling: ${u}}
|
|
11
|
+
`)})},ot)}};function Ss(t,e,r){let o=(e.fuel_consumed/Po).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 Us(t,e,r){t.log_type===Eo?r.write("Function network access response retrieved from cache."):t.log_type===bo?e.reason===Uo?r.write("Function network access request executing in background because there is no cached response."):e.reason===Ro&&r.write("Function network access request executing in background because the cached response is about to expire."):t.log_type===So&&(t.status==="success"?r.write("Function network access request executed successfully."):t.status==="failure"&&r.write(`\u274C Function network access request failed to execute with error: ${e.error}.`))}function Rs(t){return t.allExtensions.some(e=>e.isFunctionExtension)}async function rn({developerPlatformClient:t,subscription:{shopIds:e,apiKey:r},storeName:o,organizationId:n,appWatcher:s,localApp:a}){return{type:"app-logs-subscribe",prefix:"app-logs",function:Ts,options:{developerPlatformClient:t,appLogsSubscribeVariables:{shopIds:e,apiKey:r},storeName:o,organizationId:n,appWatcher:s,localApp:a}}}var Ts=async({stdout:t,stderr:e,abortSignal:r},{developerPlatformClient:o,appLogsSubscribeVariables:n,storeName:s,organizationId:a,appWatcher:i,localApp:c})=>{async function d(l){let u=await nt(o,n,a,t),h=c.getLogsDir();await fe(h),await We({stdout:t,appLogsFetchInput:{jwtToken:u},resubscribeCallback:()=>nt(o,n,a),developerPlatformClient:o,storeName:s,organizationId:a,abortSignal:l,logsDir:h})}try{let l=!1,u,h=async w=>{let m=Rs(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 on(t){return{type:"app-watcher",prefix:"app-preview",options:t,function:As}}var As=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 _s}from"events";var Cs={BUILD_ERROR:{message:"Build error. Please review your code and try again",type:"error"},READY:{message:"Ready, watching for changes in your app",type:"success"},LOADING:{message:"Preparing dev preview",type:"loading"},UPDATED:{message:"Updated",type:"success"},VALIDATION_ERROR:{message:"Validation error in your app configuration",type:"error"},REMOTE_ERROR:{message:"Error updating dev preview",type:"error"},CHANGE_DETECTED:{message:"Change detected, updating dev preview",type:"loading"}},He=class extends _s{currentStatus={isReady:!1,previewURL:void 0,graphiqlURL:void 0,statusMessage:void 0};constructor(e){super(),e&&(this.currentStatus=e)}updateStatus(e){let r={...this.currentStatus,...e};It(this.currentStatus,r)||(this.currentStatus=r,this.emit("dev-session-update",r))}setMessage(e){this.updateStatus({statusMessage:Cs[e]})}get status(){return this.currentStatus}reset(){this.currentStatus={isReady:!1,previewURL:void 0,graphiqlURL:void 0,statusMessage:void 0}}};p();import*as nn from"http";import*as sn from"https";function an(t){return"errors"in t&&Array.isArray(t.errors)}async function cn(t,e,r,o){let s=(await import("./http-proxy-node16-A6AKKRQH.js")).default.createProxyServer(),a=Is(t,s,o),i=r?sn.createServer(r,a):nn.createServer(a);return i.on("upgrade",ks(t,s,o)),e.addEventListener("abort",()=>{g("Closing reverse HTTP proxy"),i.close()}),{server:i}}function ks(t,e,r){return function(o,n,s){let a=ln(t,o,!0);if(a)return e.ws(o,n,s,{target:a},i=>{D({outputPrefix:"proxy",stripAnsi:!1},()=>{let d=(an(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 Is(t,e,r){return function(o,n){let s=ln(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=(an(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 ln(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 pn({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=St(),w=!ft(h[Ce.disableGraphiQLExplorer]),m=await Kr(t),f=new eo(m,i.proxyUrl),U=await we(),E=io(n,l,U),R=E,x=nr(d,u,n),_=w?`http://localhost:${c}/graphiql?key=${encodeURIComponent(x)}`:void 0,ne=m.configuration.embedded,V=m.nonConfigExtensions.length>0,N=new He({isReady:!1,previewURL:R,graphiqlURL:_,appEmbedded:ne,hasExtensions:V}),G=[...await Zo({webs:m.webs,proxyUrl:i.proxyUrl,frontendPort:i.frontendPort,backendPort:i.backendPort,apiKey:l,apiSecret:u,scopes:$r(m.configuration)}),w?await Jo({appName:o.title,appUrl:E,port:c,apiKey:l,apiSecret:u,key:x,storeFqdn:n}):void 0,await Yo({allExtensions:m.realExtensions,storeFqdn:n,storeId:s,apiKey:l,subscriptionProductUrl:a.subscriptionProductUrl,checkoutCartUrl:a.checkoutCartUrl,proxyUrl:i.proxyUrl,appName:m.name,appDotEnvFile:m.dotenv,grantedScopes:o.grantedScopes,appId:o.id,appDirectory:m.directory,appWatcher:f}),await en({app:m,apiKey:l,developerPlatformClient:r,url:i.proxyUrl,appId:o.id,organizationId:o.organizationId,storeFqdn:n,appWatcher:f,appPreviewURL:E,devSessionStatusManager:N}),await ko({remoteApp:o,localApp:m,storeFqdn:n,theme:a.theme,themeExtensionPort:a.themeExtensionPort,storePassword:a.storePassword}),Qo({webs:m.webs,backendPort:i.backendPort,frontendPort:i.frontendPort,organizationId:o.organizationId,developerPlatformClient:r,storeFqdn:n,apiSecret:u,remoteAppUpdated:e}),await rn({developerPlatformClient:r,subscription:{shopIds:[Number(s)],apiKey:l},storeName:n,organizationId:o.organizationId,localApp:t,appWatcher:f}),await on({appWatcher:f})].filter(Ls);return{processes:await $s(G,i.proxyPort,i.reverseProxyCert),previewUrl:R,graphiqlUrl:_,devSessionStatusManager:N}}var Ls=t=>t!==void 0&&t!==!1;async function $s(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:Ms,options:{port:e,rules:s,localhostCert:r}}),n}var Ms=async({abortSignal:t,stdout:e},{port:r,rules:o,localhostCert:n})=>{let{server:s}=await cn(o,t,n,e);B(`Proxy server started on port ${r} ${n?`with certificate ${n.certPath}`:""}`,e),await s.listen(r,"localhost")};p();p();p();var oe=Q(Pe(),1);var un=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];function dn(){let[t,e]=(0,oe.useState)(0);return(0,oe.useEffect)(()=>{let r=setInterval(()=>{e(o=>(o+1)%un.length)},70);return()=>clearInterval(r)},[]),oe.default.createElement(L,null,un[t])}p();var A=Q(Pe(),1);var mn=.9,fn=({tabs:t,initialActiveTab:e})=>{let{stdout:r}=Dt(),{isRawModeSupported:o}=ve(),[n,s]=(0,A.useState)(e),[a,i]=(0,A.useState)(Math.floor(r.columns*mn)),[c,d]=(0,A.useState)(!0),l=(0,A.useRef)(null);if(!n)throw new Error("No tabs provided");xe((m,f)=>{(async()=>{if(f?.leftArrow||f?.rightArrow||f?.tab){let x=Object.entries(t).filter(([G,P])=>P.content),_=x.findIndex(([G])=>G===n);if(_===-1)return;let ne=f?.leftArrow?-1:1,V=(_+ne+x.length)%x.length,N=x[V];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*mn)),!l.current)return;let f=Ft(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=Q(Pe(),1);var hn=({abortController:t,processes:e,devSessionStatusManager:r,shopFqdn:o,appURL:n,appName:s,organizationName:a,configPath:i,localURL:c,onAbort:d})=>{let{isRawModeSupported:l}=ve(),[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}=Gt(t.signal,async P=>{P&&m(typeof P=="string"?P:P.message),r.status.isReady?R(!0):(h("Shutting down dev ..."),await d()),_o()}),_=(0,y.useMemo)(()=>e.map(P=>({...P,action:async(pe,Rn,Tn)=>{try{return await P.action(pe,Rn,Tn)}catch(An){t.abort(An)}}})),[e,t]);(0,y.useEffect)(()=>(r.on("dev-session-update",U),()=>{r.off("dev-session-update",U)}),[]),xe((P,pe)=>{Nt(P,pe,()=>t.abort())},{isActive:!!l});let ne=P=>{switch(P){case"loading":return y.default.createElement(dn,null);case"success":return"\u2705";case"error":return"\u274C"}},V=[{key:"p",shortcutLabel:"Open app preview",linkLabel:"Preview",url:f.previewURL,condition:()=>!!(f.isReady&&f.previewURL),action:async()=>{await K.addPublicMetadata(()=>({cmd_dev_preview_url_opened:!0})),f.previewURL&&await Se(f.previewURL)}},{key:"c",shortcutLabel:"Open Dev Console for extension previews",linkLabel:"Dev Console",url:rt(o),condition:()=>!!(f.isReady&&f.appEmbedded===!1&&f.hasExtensions),action:async()=>{await K.addPublicMetadata(()=>({cmd_dev_preview_url_opened:!0})),await Se(rt(o))}},{key:"g",shortcutLabel:"Open GraphiQL (Admin API)",linkLabel:"GraphiQL",url:f.graphiqlURL,condition:()=>!!(f.isReady&&f.graphiqlURL),action:async()=>{await K.addPublicMetadata(()=>({cmd_dev_graphiql_opened:!0})),f.graphiqlURL&&await Se(f.graphiqlURL)}}],N=V.filter(P=>P.condition?.()??!0),G={d:{label:"Dev status",shortcuts:V,content:y.default.createElement(y.default.Fragment,null,f.statusMessage&&y.default.createElement(L,null,ne(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},qt.pointerSmall," ",y.default.createElement(L,{bold:!0},"(",P.key,")")," ",Ye()&&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&&Ye())&&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(ze,{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(ze,{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(Wt,{processes:_,prefixColumnSize:Dr,abortSignal:t.signal,keepRunningAfterProcessesResolve:!0,useAlternativeColorPalette:!0}),E&&y.default.createElement(k,{marginTop:1,flexDirection:"column"},y.default.createElement(Ht,{type:"info",headline:`A preview of your development changes is still available on ${o}.`,body:["Run",{command:"shopify app dev clean"},"to restore the latest released version of your app."],link:{label:"Learn more about dev previews",url:"https://shopify.dev/beta/developer-dashboard/shopify-app-dev"}})),x?null:y.default.createElement(k,{paddingTop:1,flexDirection:"column",flexGrow:1},l?y.default.createElement(fn,{tabs:G,initialActiveTab:"d"}):y.default.createElement(k,{marginY:1,paddingTop:0,flexDirection:"column",flexGrow:1,borderStyle:"single",borderBottom:!1,borderLeft:!1,borderRight:!1,borderTop:!0},G.d?.content)),w?y.default.createElement(k,{marginTop:1,flexDirection:"column"},y.default.createElement(L,{color:"red"},w)):null)};var gn=Q(Pe(),1);async function wn({processes:t,previewUrl:e,app:r,abortController:o,graphiqlUrl:n,shopFqdn:s,devSessionStatusManager:a,appURL:i,appName:c,organizationName:d,configPath:l,localURL:u}){if(Kt())return Ot(gn.default.createElement(hn,{processes:t,abortController:o,devSessionStatusManager:a,shopFqdn:s,appURL:i,appName:c,organizationName:d,configPath:l,localURL:u,onAbort:async()=>{await r.developerPlatformClient.devSessionDelete({appId:r.id,shopFqdn:s})}}),{exitOnCtrlC:!1});await Ds({processes:t,previewUrl:e,graphiqlUrl:n,abortController:o})}async function Ds({processes:t,previewUrl:e,graphiqlUrl:r,abortController:o}){return process.stdout.write(`
|
|
18
|
+
Preview URL: ${e}
|
|
19
|
+
`),r&&process.stdout.write(`GraphiQL URL (Admin API): ${r}
|
|
20
|
+
`),Promise.all(t.map(async n=>{await n.action(process.stdout,process.stderr,o.signal)}))}p();function yn(t){if(!t.length)return;let e=t.filter(n=>n.requested!==n.actual);if(e.length===0)return;if(e.length===1&&e[0]){let n=e[0];se({headline:[`A random port will be used for ${n.for} because ${n?.requested} is not available.`],body:["If you want to use a specific port, you can choose a different one by setting the ",{command:n?.flagToRemedy}," flag."]});return}let r=Be(e.map(n=>n.for)).join(" "),o=Be(e.map(n=>({command:n.flagToRemedy})));se({headline:[`Random ports will be used for ${r} because the requested ports are not available.`],body:["If you want to use specific ports, you can choose different ports using the",...o,"flags."]})}p();async function Pn(t,e){return e?e.includes("localhost")?"localhost":(await _t(t)).plugins.find(o=>e?.includes(o))??"custom":void 0}p();var vn=Q(Cn(),1);var Y="v1.4.4",xn="FiloSottile/mkcert",dt=v.genericShellCommand("mkcert");async function Fs(t,e,r,o){let n=e[Ce.mkcertBinaryPath];if(n)return n;let a=S(t,r==="win32"?"mkcert.exe":"mkcert");if(await F(a))return a;let i=await(0,vn.default)("mkcert",{nothrow:!0});return i?(g(b`Found ${dt} at ${v.path(i)}`),i):(await Os(a,r,o),a)}async function Os(t,e,r){let o;switch(e){case"darwin":o=r==="arm64"?`mkcert-${Y}-darwin-arm64`:`mkcert-${Y}-darwin-amd64`;break;case"linux":o=r==="arm64"?`mkcert-${Y}-linux-arm64`:`mkcert-${Y}-linux-amd64`;break;case"win32":o=`mkcert-${Y}-windows-amd64.exe`;break;default:throw new X(`Unsupported platform: ${e}`)}await kr(xn,Y,o,t),g(b`${dt} saved to ${v.path(t)}`)}async function Ns(t){let e=S(t,"mkcert-LICENSE");if(await F(e))return;let r=`https://raw.githubusercontent.com/${xn}/refs/tags/${Y}/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 At(r),!n.ok)return o}catch{return o}let s=await n.text();await me(e,s)}async function En({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 jr()))throw new T(`Localhost certificate and key are required at ${a} and ${s}`);let l="",u;return await be([{title:"Finding or downloading mkcert binary",task:async()=>{let w=S(t,".shopify");l=await Fs(w,r,o,n),u=await Ns(w),g(b`${dt} found at: ${v.path(l)}`)}}]),u&&Ee(u),B(b`Generating self-signed certificate for localhost. You may be prompted for your password.`),await Ue(l,["-install","-key-file",i,"-cert-file",c,"localhost"]),B(b`${v.successIcon()} Certificate generated at ${a}\n`),await jt()&&(se({headline:"It looks like you're using WSL.",body:["Additional steps are required to configure certificate trust in Windows."],link:{label:"See Shopify CLI documentation",url:"https://shopify.dev/docs/apps/build/cli-for-apps/networking-options#localhost-based-development-with-windows-subsystem-for-linux-wsl"}}),B("\u{1F449} Press any key to continue"),await Bt(),B("")),{keyContent:await I(i),certContent:await I(c),certPath:ht(t,c)}}p();function bn(){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 Sn(t){let e=await qs(t);await Ws(e);let{processes:r,graphiqlUrl:o,previewUrl:n,devSessionStatusManager:s}=await pn(e);await Gs(e),await js({processes:r,previewUrl:n,graphiqlUrl:o,config:e,devSessionStatusManager:s})}async function qs(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 Gr(t.commandConfig,E,"cloudflare")}let c=await Yr(r,o,s,r.flags);r.configuration=c,Vr({app:e,remoteApp:r,selectedStore:n,cachedInfo:et(t.directory),organization:t.organization,tunnelMode:a.mode}),e.configuration.build?.dev_store_url&&(e.configuration.build={...e.configuration.build,dev_store_url:n.shopDomain},await(await Vt.read(e.configPath)).patch({build:{dev_store_url:n.shopDomain}})),!t.skipDependenciesInstallation&&!t.project.usesWorkspaces&&await Lr(t.project);let d=t.graphiqlPort??await $(ie.graphiql),l=[{for:"GraphiQL",flagToRemedy:"--graphiql-port",requested:t.graphiqlPort??ie.graphiql,actual:d}];a.mode==="use-localhost"&&l.push({for:"localhost",flagToRemedy:"--localhost-port",requested:a.requestedPort,actual:a.actualPort}),yn(l);let{webs:u,...h}=await Ks(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=et(t.directory)?.previousAppId,f=r.apiKey,U=await Bs(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 Ws(t){await Hs(t)}async function Hs(t){let{developerPlatformClient:e,remoteApp:r}=t;(await e.appExtensionRegistrations(r)).app.extensionRegistrations.filter(n=>n.type.toLowerCase()!=="webhook_subscription").every(n=>n.id)||bn()}async function Gs(t){Or({directory:t.commandOptions.directory,previousAppId:t.remoteApp.apiKey}),await zs({devOptions:t.commandOptions,tunnelUrl:t.network.proxyUrl,shouldUpdateURLs:t.partnerUrlsUpdated,storeFqdn:t.storeFqdn}),await Lt({config:t.commandOptions.commandConfig,exitMode:"ok"})}async function Bs(t,e,r,o,n,s,a){let{backendConfig:i,frontendConfig:c}=z(t),d=!1;if((c??i)&&e){let l=qr(r.proxyUrl,t.map(({configuration:u})=>u.auth_callback_path).find(u=>u),o.configuration.app_proxy);d=await Hr({currentURLs:r.currentUrls,appDirectory:o.directory,cachedUpdateURLs:n,newApp:s.newApp,localApp:o,apiKey:a,newURLs:l}),d&&o.setDevApplicationURLs(l)}return d}async function Ks(t,e,r,o,n,s,a){let{backendConfig:i,frontendConfig:c}=z(e);await Ys(e,r);let d=o.mode==="use-localhost"?{noTunnelUseLocalhost:!0,port:o.actualPort}:{noTunnelUseLocalhost:!1,tunnelUrl:o.mode==="custom"?o.url:void 0,tunnelClient:n},[{frontendUrl:l,frontendPort:u,usingLocalhost:h},w,m]=await Promise.all([Nr(d),Ut()??i?.configuration.port??$(),Wr(s)]),f=h?`${l}:${u}`:l,U=c?.configuration.port;c&&(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 En({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 js({processes:t,previewUrl:e,graphiqlUrl:r,config:o,devSessionStatusManager:n}){let s=new Et,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 wn({processes:a,previewUrl:e,graphiqlUrl:r,app:c,abortController:s,shopFqdn:o.storeFqdn,devSessionStatusManager:n,appURL:o.localApp.devApplicationURLs?.applicationUrl,appName:o.remoteApp.title,organizationName:o.commandOptions.organization.businessName,configPath:o.localApp.configPath,localURL:o.network.proxyUrl})}async function zs(t){let e=await Pn(t.devOptions.commandConfig,t.tunnelUrl);await K.addPublicMetadata(()=>({cmd_dev_tunnel_type:e,cmd_dev_tunnel_custom_hash:e==="custom"?Ke(t.tunnelUrl):void 0,cmd_dev_urls_updated:t.shouldUpdateURLs,store_fqdn_hash:Ke(t.storeFqdn),store_domain:t.storeFqdn,cmd_app_dependency_installation_skipped:t.devOptions.skipDependenciesInstallation})),await K.addSensitiveMetadata(()=>({store_fqdn:t.storeFqdn,cmd_dev_tunnel_custom:e==="custom"?t.tunnelUrl:void 0}))}async function Ys(t,e){let r=t.map(n=>n.configuration.port).filter(n=>n),o=r.find((n,s)=>r.indexOf(n)!==s);if(o)throw new T(`Found port ${o} for multiple webs.`,"Please define a unique port for each web.");await Promise.all([...r.map(async n=>{if(!await Ve(n))throw new T(`Hard-coded port ${n} is not available, please choose a different one.`)}),(async()=>{if(!await Ve(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 Un({useLocalhost:t,localhostPort:e,tunnelUrl:r}){if(r)return{mode:"custom",url:r};if(!t&&!e)return{mode:"auto"};let o=e??ie.localhost,n=await $(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=Q(_n(),1);var mt=class t extends Jr{static get requiresSyncAnalytics(){return!0}static summary="Run the app.";static descriptionWithMarkdown="Builds and previews your app on a dev store, and watches for changes. [Read more about testing apps locally](https://shopify.dev/docs/apps/build/cli-for-apps/test-apps-locally).";static description=this.descriptionWithoutMarkdown();static flags={...Qt,...Ir,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 e=>ye(e)}),"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":Re({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":Re({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":Re({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"})};static analyticsStopCommand(){return"app dev stop"}async run(){let{flags:e}=await this.parse(t),r=await Un({useLocalhost:e["use-localhost"]??!1,tunnelUrl:e["tunnel-url"],localhostPort:e["localhost-port"]});await $t(()=>({cmd_app_dependency_installation_skipped:e["skip-dependencies-installation"],cmd_app_reset_used:e.reset,cmd_dev_tunnel_type:r.mode})),await Br(e.path);let o=await Qr({directory:e.path,clientId:e["client-id"],forceRelink:e.reset,userProvidedConfigName:e.config}),n=await Xr({appContextResult:o,storeFqdn:e.store,forceReselectStore:e.reset}),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 Sn(s),{app:o.app}}};export{ka as a,mt as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as m}from"./chunk-6SM4RY3I.js";import{a as p}from"./chunk-ESPT6CGE.js";import{a as n}from"./chunk-RA3WWB2S.js";import{sa as r}from"./chunk-GFWXVO72.js";import{b as s}from"./chunk-IX4IGE5H.js";import{wb as e}from"./chunk-HQUWYKSJ.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();var i=class d extends p{static summary="Display app and extensions environment variables.";static descriptionWithMarkdown="Displays environment variables that can be used to deploy apps and app extensions.";static description=this.descriptionWithoutMarkdown();static flags={...s,...n};async run(){let{flags:t}=await this.parse(d),{app:a,remoteApp:l,organization:c}=await r({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config});return e(await m(a,l,c)),{app:a}}};export{i as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as h,c as T,g as p}from"./chunk-VKWPEFWQ.js";var b=T((w,I)=>{p();I.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&I.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&I.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var q=T((M,a)=>{p();var e=global.process,u=function(t){return t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function"};u(e)?(C=h("assert"),i=b(),U=/^win/i.test(e.platform),c=h("events"),typeof c!="function"&&(c=c.EventEmitter),e.__signal_exit_emitter__?n=e.__signal_exit_emitter__:(n=e.__signal_exit_emitter__=new c,n.count=0,n.emitted={}),n.infinite||(n.setMaxListeners(1/0),n.infinite=!0),a.exports=function(t,f){if(!u(global.process))return function(){};C.equal(typeof t,"function","a callback must be provided for exit handler"),l===!1&&_();var r="exit";f&&f.alwaysLast&&(r="afterexit");var x=function(){n.removeListener(r,t),n.listeners("exit").length===0&&n.listeners("afterexit").length===0&&S()};return n.on(r,t),x},S=function(){!l||!u(global.process)||(l=!1,i.forEach(function(f){try{e.removeListener(f,v[f])}catch{}}),e.emit=G,e.reallyExit=y,n.count-=1)},a.exports.unload=S,o=function(f,r,x){n.emitted[f]||(n.emitted[f]=!0,n.emit(f,r,x))},v={},i.forEach(function(t){v[t]=function(){if(u(global.process)){var r=e.listeners(t);r.length===n.count&&(S(),o("exit",null,t),o("afterexit",null,t),U&&t==="SIGHUP"&&(t="SIGINT"),e.kill(e.pid,t))}}}),a.exports.signals=function(){return i},l=!1,_=function(){l||!u(global.process)||(l=!0,n.count+=1,i=i.filter(function(f){try{return e.on(f,v[f]),!0}catch{return!1}}),e.emit=k,e.reallyExit=L)},a.exports.load=_,y=e.reallyExit,L=function(f){u(global.process)&&(e.exitCode=f||0,o("exit",e.exitCode,null),o("afterexit",e.exitCode,null),y.call(e,e.exitCode))},G=e.emit,k=function(f,r){if(f==="exit"&&u(global.process)){r!==void 0&&(e.exitCode=r);var x=G.apply(this,arguments);return o("exit",e.exitCode,null),o("afterexit",e.exitCode,null),x}else return G.apply(this,arguments)}):a.exports=function(){return function(){}};var C,i,U,c,n,S,o,v,l,_,y,L,G,k});export{q as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{k as P,t as F}from"./chunk-
|
|
1
|
+
import{k as P,t as F}from"./chunk-K63FW7Q7.js";import{a as N}from"./chunk-Q7BOSHWX.js";import{a as T}from"./chunk-6G5TDB45.js";import{Q as H,S as q,r as $,xa as d,za as h}from"./chunk-PK73ZSND.js";import{B as I,C as L,T as v}from"./chunk-WSCSFFLH.js";import{a as x}from"./chunk-76NEIDP5.js";import{h as l}from"./chunk-BI7LE6CZ.js";import{Ab as c,qb as C,sb as U}from"./chunk-HQUWYKSJ.js";import{t as O}from"./chunk-4VJ6YK7U.js";import{g as p}from"./chunk-VKWPEFWQ.js";p();p();function D(e){let t=new URLSearchParams;for(let[r,o]of Object.entries(e.replaceTemplates??[]))t.append(`replace_templates[${r}]`,o);for(let[r,o]of Object.entries(e.replaceExtensionTemplates??[])){let n=r.split("/")[0];t.append(`replace_extension_templates[${n}][${r}]`,o)}return t.append("_method",e.method),t}function w(){return{"User-Agent":`Shopify CLI; v=${x}`}}function k(e){return delete e.cookie,delete e.authorization,e}p();function S(e){let t={};return e.split(";").forEach(r=>{let o=r.match(/(.*?)=(.*)$/)??[],n=o[1]?.trim(),s=o[2]?.trim()??"";n&&(t[n]=s)}),t}function E(e){return Object.entries(e).map(([t,r])=>`${t}=${r}`).join("; ")}var y=class extends l{};async function Re(e){return F(e)}async function be(e,t,r){let o=M(t),n=new URLSearchParams;n.append("form_type","storefront_password"),n.append("utf8","\u2713"),n.append("password",e??""),h("theme-service:storefront-session:check-storefront-password");let s={"cache-control":"no-cache","content-type":"application/x-www-form-urlencoded",...r},a=await $(`${o}/password`,{headers:s,body:n.toString(),method:"POST",redirect:"manual"});if(a.status===429)throw d(new l(`Too many incorrect password attempts. Please try again after ${a.headers.get("retry-after")} seconds.`));return B(a,o)}async function j(e,t,r,o,n={}){let s={},a=await G(e,r,n),i=M(t);if(s._shopify_essential=a,h(`theme-service:storefront-session:is-password-protected:${!!o}`),!o)return s;let u=await ee(a,e,i,o,n);return{...s,...u}}async function G(e,t,r,o=1){let n=new URLSearchParams({preview_theme_id:t,_fd:"0",pb:"0"}),s=`${e}?${n}`;h("theme-service:storefront-session:get-session-essential-cookie");let a={...r,...w()},i=await $(s,{method:"HEAD",redirect:"manual",headers:a}),u=i.headers.raw()["set-cookie"]??[],f=_(u,"_shopify_essential");if(!f){if(c(`Failed to obtain _shopify_essential cookie.
|
|
2
2
|
|
|
3
3
|
-Request ID: ${i.headers.get("x-request-id")??"unknown"}
|
|
4
4
|
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{a as Q,b as X,c as H}from"./chunk-U3F6GPCE.js";import{a as L,c as M,e as f,f as P,h as T,i as q,m as V,p as U,q as F,r as j,s as z,u as _}from"./chunk-SGIMJQEM.js";import{a as W}from"./chunk-ESPT6CGE.js";import{a as G,b as J}from"./chunk-RA3WWB2S.js";import{b as N}from"./chunk-IX4IGE5H.js";import{A as v,B as E,I as D,a as $,y as g,z as u}from"./chunk-WSCSFFLH.js";import{h as m,k as R}from"./chunk-BI7LE6CZ.js";import{Ta as I,ma as C,qb as r,sb as s,ua as S,wb as x}from"./chunk-HQUWYKSJ.js";import{g as c}from"./chunk-VKWPEFWQ.js";c();c();async function te(t,e){if(t)return t.join(`
|
|
2
|
+
`);if(e){if(!await I(e))throw new m(s`Variable file not found at ${r.path(e)}. Please check the path and try again.`);return C(e,{encoding:"utf8"})}else return}async function Y(t){let{organization:e,remoteApp:i,store:n,query:o,variables:d,variableFile:b,outputFile:O,watch:Z=!1,version:ee}=t,{adminSession:p,version:k}=await D({title:s`Authenticating`,task:async()=>{let a=await Q(i,n.shopDomain),l=await P({adminSession:a,userSpecifiedVersion:ee,minimumDefaultVersion:L});return{adminSession:a,version:l}},renderOptions:{stdout:process.stderr}}),B=await te(d,b);ae(o,B),H(o,n),g({headline:"Starting bulk operation.",body:[{list:{items:X({organization:e,remoteApp:i,storeFqdn:n.shopDomain,version:k})}}]});let w=f(o)?await q({adminSession:p,query:o,variablesJsonl:B,version:k}):await T({adminSession:p,query:o,version:k});if(w?.userErrors?.length){E({headline:"Error creating bulk operation.",body:{list:{items:w.userErrors.map(a=>a.field?`${a.field.join(".")}: ${a.message}`:a.message)}}});return}let y=w?.bulkOperation;if(y)if(Z){let a=new $,l=await F(p,y.id,a.signal,()=>a.abort());a.signal.aborted?g({headline:`Bulk operation ${l.id} is still running in the background.`,body:h(l.id)}):await K(l,O)}else{let a=await U(p,y.id);["FAILED","CANCELED","EXPIRED"].includes(a.status)?await K(a,O):u({headline:"Bulk operation is running.",body:h(a.id),customSections:[{body:[{list:{items:[s`ID: ${r.cyan(a.id)}`.value]}}]}]})}else throw v({headline:"Bulk operation not created successfully.",body:"This is an unexpected error. Please try again later."}),new R("Bulk operation response returned null with no error message.")}async function K(t,e){let i=V(t).value,o=[{body:[{list:{items:[s`ID: ${r.cyan(t.id)}`.value,s`Status: ${r.yellow(t.status)}`.value,s`Created at: ${r.gray(String(t.createdAt))}`.value,...t.completedAt?[s`Completed at: ${r.gray(String(t.completedAt))}`.value]:[]]}}]}];switch(t.status){case"CREATED":u({headline:"Bulk operation started.",body:h(t.id),customSections:o});break;case"RUNNING":u({headline:"Bulk operation is running.",body:h(t.id),customSections:o});break;case"COMPLETED":if(t.url){let d=await j(t.url),b=z(d);e?await S(e,d):x(d),b?v({headline:"Bulk operation completed with errors.",body:e?`Results written to ${e}. Check file for error details.`:"Check results for error details.",customSections:o}):u({headline:i,body:e?[`Results written to ${e}`]:void 0,customSections:o})}else u({headline:i,customSections:o});break;case"CANCELED":case"CANCELING":case"EXPIRED":case"FAILED":E({headline:i,customSections:o});break}}function ae(t,e){if(f(t)&&!e)throw new m(s`Bulk mutations require variables. Provide a JSONL file with ${r.yellow("--variable-file")} or individual JSON objects with ${r.yellow("--variables")}.`);if(!f(t)&&e)throw new m(s`The ${r.yellow("--variables")} and ${r.yellow("--variable-file")} flags can only be used with mutations, not queries.`)}function h(t){return[`Monitor its progress with:
|
|
3
|
+
`,{command:`shopify app bulk status --id=${M(t)}`}]}var A=class t extends W{static summary="Execute bulk operations.";static descriptionWithMarkdown=`Executes an Admin API GraphQL query or mutation on the specified store, as a bulk operation. Mutations are only allowed on dev stores.
|
|
4
|
+
|
|
5
|
+
Bulk operations allow you to process large amounts of data asynchronously. Learn more about [bulk query operations](https://shopify.dev/docs/api/usage/bulk-operations/queries) and [bulk mutation operations](https://shopify.dev/docs/api/usage/bulk-operations/imports).
|
|
6
|
+
|
|
7
|
+
Use [\`bulk status\`](https://shopify.dev/docs/api/shopify-cli/app/app-bulk-status) to check the status of your bulk operations.`;static description=this.descriptionWithoutMarkdown();static flags={...N,...G,...J};async run(){let{flags:e}=await this.parse(t),{query:i,appContextResult:n,store:o}=await _(e);return await Y({organization:n.organization,remoteApp:n.remoteApp,store:o,query:i,variables:e.variables,variableFile:e["variable-file"],watch:e.watch??!1,outputFile:e["output-file"],...e.version&&{version:e.version}}),{app:n.app}}};export{A as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as e}from"./chunk-3WV7DQMM.js";import{ua as r}from"./chunk-PK73ZSND.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();var t=class extends e{static hidden=!0;async run(){await r()}};export{t as a};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{b as ge}from"./chunk-CUUCRIGC.js";import{a as he,c as ye}from"./chunk-M5Q74UZM.js";import{b as ue}from"./chunk-I2LNQKIJ.js";import{a as Te}from"./chunk-ESPT6CGE.js";import{C as ve,H as Pe,J as Ae,L as ke,U as xe,W as Ce,h as we,pa as Fe,sa as Le}from"./chunk-GFWXVO72.js";import{Y as Ie,aa as Re,o as be}from"./chunk-SPE2D366.js";import{b as fe,f as de}from"./chunk-IX4IGE5H.js";import{B as ie,D as re,E as oe,f as C,g as ee,i as te,p as ae}from"./chunk-GW4JHUIA.js";import{e as Q}from"./chunk-AFT6ABDE.js";import{D as $,H as ce,y as le,z as pe}from"./chunk-WSCSFFLH.js";import{c as ne}from"./chunk-XTXYS7LB.js";import{a as z}from"./chunk-76NEIDP5.js";import{d as se}from"./chunk-6K3AJTNO.js";import{h as m}from"./chunk-BI7LE6CZ.js";import{a as He}from"./chunk-CTNBSUVU.js";import{$a as Z,Ca as I,Ja as V,Oa as K,Ta as R,Ua as x,Va as B,Wa as W,_ as H,hb as X,ib as J,ka as q,ma as O,qb as h,rb as F,sa as T,sb as b,ua as _,wa as Y}from"./chunk-HQUWYKSJ.js";import{e as me}from"./chunk-4VJ6YK7U.js";import{d as l,e as k,f as M,p as U,q as D}from"./chunk-773TIA5M.js";import{e as De,g as c}from"./chunk-VKWPEFWQ.js";c();c();var y={reactRouter:{url:"https://github.com/Shopify/shopify-app-template-react-router",label:"Build a React Router app (recommended)",visible:!0,branches:{prompt:"For your React Router template, which language do you want?",options:{javascript:{branch:"javascript-cli",label:"JavaScript"},typescript:{branch:"main-cli",label:"TypeScript"}}}},remix:{url:"https://github.com/Shopify/shopify-app-template-remix",label:"Build a Remix app",visible:!1,branches:{prompt:"For your Remix template, which language do you want?",options:{javascript:{branch:"javascript",label:"JavaScript"},typescript:{branch:"main",label:"TypeScript"}}}},none:{url:"https://github.com/Shopify/shopify-app-template-extension-only",label:"Build an extension-only app",visible:!0},node:{url:"https://github.com/Shopify/shopify-app-template-node",visible:!1},ruby:{url:"https://github.com/Shopify/shopify-app-template-ruby",visible:!1}},S=Object.keys(y),L=S.filter(e=>y[e].visible),qe=["reactRouter","none"],Oe=async e=>{let t=e.template,a=e.flavor,r={template:y.reactRouter.url};t??=await $({choices:qe.map(o=>({label:y[o].label||o,value:o})),message:"Get started building your app:",defaultValue:S.find(o=>y[o].url===r.template)});let i={...e,template:t,templateType:P(t)?t:"custom",globalCLIResult:{install:!1,alreadyInstalled:!1}},n,s;if(i.templateType!=="custom"){let o=y[i.templateType];n=o.url,o.branches&&(a?s=o.branches.options[a]?.branch:s=await $({message:o.branches.prompt||"Choose a flavor:",choices:Object.entries(o.branches.options).map(([f,u])=>({value:u.branch,label:u.label}))}))}return s&&(n=`${n}#${s}`),i.template=n||i.template||r.template,i.globalCLIResult=await J(),i},_e=Oe;function P(e){return S.includes(e)}function $e(e){return e!==void 0&&P(e)&&y[e].branches!==void 0}c();c();import{platform as Ye}from"os";async function Se({packageJSON:e,local:t,useGlobalCLI:a}){if(e.dependencies=e.dependencies??{},a?delete e.dependencies["@shopify/cli"]:e.dependencies["@shopify/cli"]=z,delete e.dependencies["@shopify/app"],t){let r=await Ve("cli");e.dependencies["@shopify/cli"]=r;let i={"@shopify/cli":r};e.overrides=e.overrides?{...e.overrides,...i}:i,e.resolutions=e.resolutions?{...e.resolutions,...i}:i}return e}async function Ve(e){return`file:${await Z(`packages/${e}`,{type:"directory",cwd:U(import.meta.url)})}`}async function Ge({from:e,packageManager:t}){let a=Ye()==="win32"&&t==="yarn"?["--network-concurrency","1"]:[];return ae({directory:k(e),packageManager:t,args:a})}c();async function G(e,t){let r=(await W([l(e,"**",".git"),l(e,"**",".github"),l(e,"**",".gitmodules"),l(e,"**",".cli-liquid-bypass"),l(e,"LICENSE*"),l(e,"**","frontend/LICENSE*"),l(e,"package.json.cli2")],{dot:!0,onlyFiles:!1,onlyDirectories:!1,ignore:["**/node_modules/**"]})).map(s=>I(s,{force:!0})),i=new Set(ee[t]),n=C.filter(s=>!i.has(s)).map(s=>{let o=l(e,s);if(x(o))return V(o)});return Promise.all([...r,...n])}async function Ke(e){let t=e.packageManager,a=H(e.name),r=l(e.directory,a),i=ge(e.template);await Ee(r,a),await Be(r),le({body:["Initializing project with",{command:t},`
|
|
2
|
+
Use the`,{command:"--package-manager"},"flag to select a different package manager."]}),await q(async o=>{let f=l(o,"download"),u=i.filePath?l(f,i.filePath):f,d=l(o,"app"),A=i.branch?`${i.baseURL}#${i.branch}`:i.baseURL;await Y(f);let w=[{title:`Downloading template from ${A}`,task:async()=>{await ye({repoUrl:A,destination:f,shallow:!0})}}];w.push({title:"Parsing liquid",task:async()=>{await ue(u,d,{dependency_manager:t,app_name:e.name})}},{title:"Updating package.json",task:async()=>{let p=(await ie(d)).content;p.name=a,p.author=await ne()??"",p.private=!0;let v=["extensions/*"].concat(We(d));switch(t){case"npm":case"yarn":case"bun":p.workspaces=v;break;case"pnpm":{await Ze(d,v),await T(l(d,".npmrc"),`auto-install-peers=true
|
|
3
|
+
`);break}case"homebrew":case"unknown":throw new te}await Se({packageJSON:p,local:e.local,directory:d,useGlobalCLI:e.useGlobalCLI}),await re(d,p)}}),e.postCloneActions.removeLockfilesFromGitignore&&w.push({title:"Removing lockfiles from .gitignore",task:async()=>{let p=l(d,".gitignore");if(await R(p)){let v=await O(p);C.forEach(Me=>{let Ue=new RegExp(`^${Me.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}$`,"gm");v=v.replace(Ue,"")}),await _(p,v.trim())}}}),await me()&&w.push({title:"[Shopifolks-only] Configuring the project's NPM registry",task:async()=>{let p=l(d,".npmrc");await T(p,`@shopify:registry=https://registry.npmjs.org
|
|
4
|
+
`)}});let N=!1;w.push({title:"Preparing project directory",task:async()=>{await Ee(r,a),N=!0,await K(d,r)}}),w.push({title:`Installing dependencies with ${t}`,task:async()=>{await Ge({from:r,packageManager:t})}},{title:"Cleaning up",task:async()=>{await G(r,t)}},{title:"Initializing a Git repository...",task:async()=>{await he(r)}});try{await ce(w)}catch(p){throw N&&await I(r).catch(()=>{}),p}});let n;if(e.selectedAppOrNameResult.result==="new"){let o=await ve(r,e.name),f=e.selectedAppOrNameResult.org;n=await e.developerPlatformClient.createApp(f,o)}else n=e.selectedAppOrNameResult.app;await Fe({directory:r,apiKey:n.apiKey,appId:n.id,organizationId:n.organizationId,configName:"shopify.app.toml",developerPlatformClient:e.developerPlatformClient,isNewApp:!0},!1);let s=await Le({directory:r,clientId:void 0,forceRelink:!1,userProvidedConfigName:void 0});return pe({headline:[{userInput:a},"is ready for you to build!"],nextSteps:[["Run",{command:`cd ${a}`}],["For extensions, run",{command:F(t,"shopify app generate extension")}],["To see your app, run",{command:F(t,"shopify app dev")}]],reference:[{link:{label:"Shopify docs",url:"https://shopify.dev"}},[{link:{label:"Shopify Dev MCP,",url:"https://shopify.dev/docs/apps/build/devmcp"}},"connect your AI assistant to development resources"],["For an overview of commands, run",{command:F(t,"shopify app","--help")}]]}),{app:s.app}}async function Ee(e,t){if(await R(e))throw new m(`
|
|
5
|
+
A directory with this name (${t}) already exists.
|
|
6
|
+
Choose a new name for your app.`)}async function Be(e){let t=new Q({projectName:"shopify-cli-app"}),a=k(e);t.delete(a)}function We(e){return["web","web/frontend"].filter(t=>x(l(e,t)))}async function Ze(e,t){let a=l(e,"pnpm-workspace.yaml");if(await R(a))return;let r=t.map(i=>` - '${i}'`).join(`
|
|
7
|
+
`);await _(a,`packages:
|
|
8
|
+
${r}`)}var je=Ke;c();c();function E(e){try{return new URL(e)}catch{return}}function Qe(e){if(!e)return;let t=e.toLowerCase();for(let r of[t,`https://${t}`]){let i=E(r)?.hostname;if(i)return i}let a=t.replace(/^https?:\/\//,"").split("/")[0];if(a)return a}function jt(e){let t=Qe(e);if(!t)return;let a=t.match(/^([^.]+)\.myshopify\.com$/);return a?a[1]:void 0}function Ne(e){if(!e)return;let t=E(e);if(t&&t.origin!=="https://github.com")throw new m("Only GitHub repository references are supported, e.g., https://github.com/Shopify/<repository>/[subpath]#[branch]");if(!t&&!P(e))throw new m(b`Only ${L.map(a=>b`${h.yellow(a)}`.value).join(", ")} template aliases are supported, please provide a valid URL`)}function ze(e,t){if(!e){if(t)throw new m(b`The ${h.yellow("--flavor")} flag requires the ${h.yellow("--template")} flag to be set`);return}if(!t)return;if(!P(e))throw new m(b`The ${h.yellow("--flavor")} flag is not supported for custom templates`);let a=y[e];if(!a.branches)throw new m(b`The ${h.yellow(e)} template does not support flavors`);if(!a.branches.options[t])throw new m(b`Invalid option for ${h.yellow("--flavor")}\nThe ${h.yellow("--flavor")} flag for ${h.yellow(e)} accepts only ${Object.keys(a.branches.options).map(r=>b`${h.yellow(r)}`.value).join(", ")}`)}var g=De(He(),1);var j=class e extends Te{static get requiresSyncAnalytics(){return!0}static summary="Create a new app project";static examples=["<%= config.bin %> <%= command.id %> --name my-app --organization-id 123 --template reactRouter --flavor typescript","<%= config.bin %> <%= command.id %> --client-id 123 --template none"];static flags={...fe,name:g.Flags.string({char:"n",env:"SHOPIFY_FLAG_NAME",hidden:!1,description:"The name for the new app. When provided, skips the app selection prompt and creates a new app with this name. Required in non-interactive environments unless --client-id is provided."}),path:g.Flags.string({char:"p",env:"SHOPIFY_FLAG_PATH",parse:async t=>M(t),default:async()=>D(),hidden:!1}),template:de(g.Flags.string({description:`The app template. Accepts one of the following:
|
|
9
|
+
- <${L.join("|")}>
|
|
10
|
+
- Any GitHub repo with optional branch and subpath, e.g., https://github.com/Shopify/<repository>/[subpath]#[branch]`,env:"SHOPIFY_FLAG_TEMPLATE"})),flavor:g.Flags.string({description:"Which flavor of the given template to use. Required in non-interactive environments when the selected template offers multiple flavors.",env:"SHOPIFY_FLAG_TEMPLATE_FLAVOR"}),"package-manager":g.Flags.string({char:"d",env:"SHOPIFY_FLAG_PACKAGE_MANAGER",hidden:!1,options:["npm","yarn","pnpm","bun"]}),local:g.Flags.boolean({char:"l",env:"SHOPIFY_FLAG_LOCAL",default:!1,hidden:!0}),"client-id":g.Flags.string({hidden:!1,description:"The Client ID of your app. Use this to automatically link your new project to an existing app. In non-interactive environments, provide this flag or both --name and --organization-id.",env:"SHOPIFY_FLAG_CLIENT_ID",exclusive:["config"]}),"organization-id":g.Flags.string({hidden:!1,description:"The organization ID. Your organization ID can be found in your Dev Dashboard URL: https://dev.shopify.com/dashboard/<organization-id>. Required in non-interactive environments unless --client-id is provided.",env:"SHOPIFY_FLAG_ORGANIZATION_ID",exclusive:["client-id"]})};static nonTTYFlagRequirements(){return[{flags:["name","client-id"]},{flags:["organization-id","client-id"]},{flags:["flavor"],when:t=>$e(t.template)}]}async run(){let{flags:t}=await this.parse(e);if(Ne(t.template),ze(t.template,t.flavor),t.name!==void 0&&t.name.trim()==="")throw new m("The --name flag can't be empty","Provide a valid app name, for example: --name my-app");let a=oe(t["package-manager"]),r=t.name??await Xe(t.path),i=Ie();await i.session();let n=await _e({template:t.template,flavor:t.flavor}),s,o;if(t["client-id"]){let u=await xe({apiKey:t["client-id"]});o=u.title,s={result:"existing",app:u}}else{let u;t["organization-id"]?u=await Re(t["organization-id"],i):u=await Ce();let{organization:d,apps:A,hasMorePages:w}=await i.orgAndApps(u.id);s=await Je(t.name!==void 0,r,A,w,d,i),o=s.result==="new"?s.name:s.app.title}n.globalCLIResult.install&&await X(a),await se(()=>({cmd_create_app_template:n.templateType,cmd_create_app_template_url:n.template}));let{app:f}=await je({name:o,selectedAppOrNameResult:s,packageManager:a,template:n.template,local:t.local,directory:t.path,useGlobalCLI:n.globalCLIResult.alreadyInstalled||n.globalCLIResult.install,developerPlatformClient:i,postCloneActions:{removeLockfilesFromGitignore:n.templateType!=="custom"}});return{app:f}}};async function Xe(e){for(let t=0;t<3;t++){let a=await B({suffix:"app",directory:e});if(be(a))return a}return""}async function Je(e,t,a,r,i,n){let s=a.length===0||e;if(s||(s=await ke()),s)return{result:"new",name:e?t:await Ae(t),org:i};{let o=await Pe(we(n,i.id),a,r);if(!o)throw new m("Unable to select an app: the selection prompt was interrupted.");let f=await n.appFromIdentifiers(o.apiKey);if(!f)throw new m(`App with id ${o.id} not found`);return{result:"existing",app:f}}}export{Qe as a,jt as b,j as c};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{$ as j,S as X,_ as z,aa as v,ba as J,ca as A,da as W,ea as k,fa as q,ga as N,ha as B,ia as L,ja as K,ka as R,la as Q}from"./chunk-GFWXVO72.js";import{f as T,i as G,p as l}from"./chunk-SPE2D366.js";import{c as H}from"./chunk-IENBHP2S.js";import{D as x,z as U}from"./chunk-WSCSFFLH.js";import{h as C,j as P}from"./chunk-BI7LE6CZ.js";import{Ta as V,X as c,_ as b,qa as F,sb as $,wa as I,ya as D}from"./chunk-HQUWYKSJ.js";import{d as E,j as M}from"./chunk-773TIA5M.js";import{g as s}from"./chunk-VKWPEFWQ.js";s();s();function Y(e){switch(e){case d.Offsite:return v;case d.CreditCard:return L;case d.CustomCreditCard:return N;case d.CustomOnsite:return k;case d.Redeemable:return A;case d.CardPresent:return R}}var d;(function(e){e.Offsite="payments_app",e.CreditCard="payments_app_credit_card",e.CustomCreditCard="payments_app_custom_credit_card",e.CustomOnsite="payments_app_custom_onsite",e.Redeemable="payments_app_redeemable",e.CardPresent="payments_app_card_present"})(d||(d={}));function Z(e,t){let i=e.activeVersion?.context??e.draftVersion?.context??Y(e.type);switch(i){case v:return w(e,t,J);case L:return w(e,t,K);case N:return w(e,t,B);case k:return w(e,t,q);case A:return w(e,t,W);case R:return w(e,t,Q);default:throw new Error(`Unsupported extension: ${i}`)}}function w(e,t,i){let n=(e.activeVersion??e.draftVersion)?.config;if(!n)throw new Error("No config found for extension");let r=JSON.parse(n),p=i(r,t);p&&delete p.api_version;let a=e.activeVersion?.context??e.draftVersion?.context??Y(e.type);return{api_version:r.api_version,extensions:[{name:e.title,type:"payments_extension",handle:c(e.title.substring(0,l)),...p,targeting:[{target:`${a}`}]}]}}s();s();var pe=new Map(j.map(e=>[e[1],e[0]])),fe=(e,t)=>{let i=pe.get(e.uiType);if(!i)throw new C(`Field type ${e.uiType} is not supported`);let o={key:e.name,description:e.description??void 0,type:i};return t==="flow_action_definition"&&(o.name=e.label,o.required=e.required),o},ue=(e,t)=>{let n={type:t==="flow_action_definition"?`${e.name.replace("_id","")}_reference`:`${e.uiType}_reference`};return t==="flow_action_definition"&&(n.required=e.required),e.uiType==="marketing-activity-id"&&(n.marketingActivityCreateUrl=e.marketingActivityCreateUrl,n.marketingActivityDeleteUrl=e.marketingActivityDeleteUrl),n},ee=(e,t)=>t?t.map(o=>o.uiType==="commerce-object-id"||o.uiType==="marketing-activity-id"||z.includes(o.uiType)?ue(o,e):fe(o,e)):[];function te(e){let t=e.activeVersion?.config??e.draftVersion?.config;if(!t)throw new Error("No config found for extension");let i=e.type==="flow_action_definition"?"https://url.com/api/execute":void 0,o;if(e.type==="flow_trigger_discovery_webhook"){let n=JSON.parse(t);o={extensions:[{type:"flow_trigger_lifecycle_callback",name:e.title,handle:c(e.title.substring(0,l)),url:n.url}]}}else{let n=JSON.parse(t),r=ee(e.type,n.fields??[]);o={extensions:[{type:e.type.replace("_definition",""),name:n.title,handle:c(e.title.substring(0,l)),description:n.description,runtime_url:n.url??i,config_page_url:n.custom_configuration_page_url,config_page_preview_url:n.custom_configuration_page_preview_url,validation_url:n.validation_url}],settings:(r?.length??0)>0?{fields:r}:void 0}}return o}s();s();var ie=e=>{let t=e.split("#");if(t.length!==2||t.some(p=>p===""||p===void 0))throw new Error("Invalid context");let i="admin",o=de(t[0]??""),n=me(t[1]??""),r="link";return n==="selection"?[i,`${o}-index`,`${n}-action`,r].join("."):[i,`${o}-${n}`,"action",r].join(".")},me=e=>{switch(e.toLocaleLowerCase()){case"show":return"details";case"index":return"index";case"action":return"selection";case"fulfilled_card":return"fulfilled-card";default:throw new Error(`Invalid context location: ${e}`)}},de=e=>e.toLocaleLowerCase()==="variants"?"product-variant":b(e.toLocaleLowerCase().replace(new RegExp("(s)$"),""));function ne(e,t,i){let o=e.activeVersion?.config??e.draftVersion?.config;if(!o)throw new Error("No config found for extension");let n=e.activeVersion?.context??e.draftVersion?.context;if(!n)throw new Error("No context found for link extension");let r=JSON.parse(o);if(i.embedded)try{let a=new URL(r.url),_=a.pathname.startsWith("/")?a.pathname.substring(1):a.pathname,u=new URL(`app://${_}`);u.search=a.search,u.hash=a.hash,r.url=u.toString()}catch{}return{extensions:[{type:"admin_link",name:r.text,handle:c(e.title.substring(0,l)),targeting:[{url:r.url,target:ie(n)}]}]}}s();var ge={facebook:"social",instagram:"social",google:"search",pinterest:"social",bing:"search",email:"email",snapchat:"social",sms:"sms",verizon_media:"display",ebay:"marketplace",tiktok:"social",flow:"email"},_e={facebook:"facebook.com",instagram:"instagram.com",google:"google.com",pinterest:"pinterest.com",bing:"bing.com",snapchat:"snapchat.com",verizon_media:null,email:null,sms:null,ebay:"ebay.com",tiktok:"tiktok.com",flow:null};function ye(e){let t=new URL(e);return t.pathname+t.search+t.hash}function oe(e){let t=e.activeVersion?.config??e.draftVersion?.config;if(!t)throw new Error("No config found for extension");let i=JSON.parse(t);return{extensions:[{type:"marketing_activity",name:e.title,handle:c(e.title.substring(0,l)),title:i.title,description:i.description,api_path:ye(i.app_api_url),tactic:i.tactic,marketing_channel:ge[i.platform]??"",referring_domain:_e[i.platform]??"",is_automation:i.is_automation,use_external_editor:i.use_external_editor,preview_data:i.preview_data,fields:i.fields.map(({id:n,...r})=>r)}]}}s();function re(e){let t=e.activeVersion?.config??e.draftVersion?.config;if(!t)throw new Error("No config found for extension");let i=JSON.parse(t);return{extensions:[{type:"subscription_link_extension",name:e.title,handle:c(e.title.substring(0,l)),pattern:i.pattern}]}}var O=[{label:"Payments Extensions",value:"payments",extensionTypes:["payments_app","payments_app_credit_card","payments_app_custom_credit_card","payments_app_custom_onsite","payments_app_redeemable","payments_extension"],buildExtensionConfig:Z},{label:"Flow Extensions",value:"flow",extensionTypes:["flow_action_definition","flow_trigger_definition","flow_trigger_discovery_webhook"],buildExtensionConfig:te},{label:"Marketing Activity Extensions",value:"marketing activity",extensionTypes:["marketing_activity_extension"],buildExtensionConfig:oe},{label:"Subscription Link Extensions",value:"subscription link",extensionTypes:["subscription_link","subscription_link_extension"],buildExtensionConfig:re},{label:"Admin Link extensions",value:"link extension",extensionTypes:["app_link","bulk_action"],buildExtensionConfig:ne}];function se(e){return O.filter(t=>t.extensionTypes.some(i=>e.some(o=>o.type.toLowerCase()===i.toLowerCase())))}async function ft(e){if(e.length===1&&e[0])return e[0];let t=e.map(n=>({label:n.label,value:n.value})),i=await x({message:"Extension type to migrate",choices:t}),o=e.find(n=>n.value===i);if(o===void 0)throw new C("Invalid migration choice");return o}s();var vt=O.flatMap(e=>e.extensionTypes),g;(function(e){e.Write="write",e.Skip="skip",e.Cancel="cancel"})(g||(g={}));async function Ee({name:e,app:t}){let i=b(e),o=E(t.directory,G.extensions.directoryName,i);if(await V(o)){let n=[{label:"Overwrite local TOML with remote configuration",value:g.Write},{label:"Keep local TOML",value:g.Skip},{label:"Cancel",value:g.Cancel}],r=await x({message:`Directory "${i}" already exists. What would you like to do?`,choices:n});if(r===g.Cancel)throw new P;return{directory:o,action:r}}return await I(o),await F(E(o,T.lockFile)),{directory:o,action:g.Write}}async function Ce(e){let{app:t,remoteApp:i,extensionTypes:o,extensions:n,buildExtensionConfig:r,all:p}=e,a=n.filter(f=>o.includes(f.type.toLowerCase()));if(a=we(t,a),a.length===0)throw new C("No extensions to migrate");if(!p){let f=a.map(y=>({label:y.title,value:y.uuid}));a.length>1&&f.push({label:"All",value:"All"});let m=await x({message:"Extensions to migrate",choices:f});m!=="All"&&(a=[a.find(y=>y?.uuid===m)])}let _={},u=a.map(async f=>{let{directory:m,action:y}=await Ee({app:t,name:f.title}),ae=c(f.title.substring(0,l));if(_[ae]=f.uuid,y===g.Write){let S=r(f,n,t.configuration),ce=E(m,"shopify.extension.toml");await new H(ce,S).replace(S);let le=E(m,T.lockFile);await D(le)}return{extension:f,directory:E("extensions",M(m))}}),h=await Promise.all(u);xe(h),await X({app:t,appApiKey:i.apiKey,extensionUuids:_,command:"import-extensions"})}function we(e,t){let i=e.dotenv?.variables??{},o=e.allExtensions.map(n=>i[n.idEnvironmentVariableName]);return t.filter(n=>!o.includes(n.uuid))}async function At(e){let t=se(e.extensions);await Promise.all(t.map(async i=>Ce({...e,extensionTypes:i.extensionTypes,buildExtensionConfig:i.buildExtensionConfig,all:!0})))}function xe(e){U({headline:["Imported the following extensions from the dashboard:"],body:e.map(t=>$`• "${t.extension.title}" at: ${t.directory}`.value).join(`
|
|
2
|
+
`)})}s();async function Lt({developerPlatformClient:e,apiKey:t,organizationId:i,extensionTypes:o,onlyDashboardManaged:n=!1}){let r=await e.appExtensionRegistrations({id:t,apiKey:t,organizationId:i}),{dashboardManagedExtensionRegistrations:p,extensionRegistrations:a}=r.app;return(n?p:a.concat(p)).filter(u=>{let h=o.includes(u.type.toLowerCase()),f=u.activeVersion&&u.activeVersion.config,m=u.draftVersion&&u.draftVersion.config;return h&&(f??m)})}export{se as a,ft as b,vt as c,Ce as d,we as e,At as f,Lt as g};
|