shopify 4.9.4 → 5.0.0
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-Q6QDIDYT.js +1 -0
- package/dist/analytics-VKKJNJ62.js +1 -0
- package/dist/assets/hydrogen/starter/CHANGELOG.md +7 -0
- package/dist/assets/hydrogen/starter/package.json +2 -2
- package/dist/assets/hydrogen/vite/package.json +3 -4
- package/dist/assets/hydrogen/vite/vite.config.js +3 -3
- package/dist/bootstrap.js +1 -1
- package/dist/{chunk-LKXFHYLI.js → chunk-24NUJTIH.js} +1 -1
- package/dist/chunk-2CMEKSI7.js +1 -0
- package/dist/chunk-2DID73ML.js +1 -0
- package/dist/chunk-2ORRV7GH.js +1 -0
- package/dist/chunk-2VSNFOKD.js +1 -0
- package/dist/chunk-335BUVBP.js +1 -0
- package/dist/{chunk-UEBUGSBT.js → chunk-3A3DZVEJ.js} +1 -1
- package/dist/chunk-3C6VLJ5D.js +319 -0
- package/dist/{chunk-PB5ZZET5.js → chunk-3G4HJO72.js} +30 -30
- package/dist/chunk-3LVCG4JB.js +1 -0
- package/dist/chunk-43KLFFP7.js +1 -0
- package/dist/chunk-43R5VGKT.js +1 -0
- package/dist/chunk-46MSIQ6Z.js +1 -0
- package/dist/chunk-4ARCB6DT.js +1 -0
- package/dist/chunk-4C2DAX5T.js +1 -0
- package/dist/chunk-4CRBTSVP.js +2 -0
- package/dist/chunk-4GCI2YCZ.js +8 -0
- package/dist/chunk-4GOJQKY5.js +1 -0
- package/dist/chunk-4RDFMBRG.js +9 -0
- package/dist/chunk-4SS6DXC7.js +5 -0
- package/dist/{chunk-J4J2YXH3.js → chunk-4TI7U2PN.js} +1 -1
- package/dist/{chunk-67EBF76X.js → chunk-52FDK2LC.js} +1 -1
- package/dist/chunk-53BG3NLH.js +3 -0
- package/dist/{chunk-LD6ZCTZ3.js → chunk-5B76DT7X.js} +1 -1
- package/dist/{chunk-A2VCTDKH.js → chunk-5NEGOQT6.js} +1 -1
- package/dist/{chunk-MW3JKGJH.js → chunk-5OMJFPQW.js} +1 -1
- package/dist/chunk-5TB52UUV.js +2 -0
- package/dist/chunk-5UWMXOHM.js +7 -0
- package/dist/chunk-6BNKBCCU.js +1 -0
- package/dist/chunk-6DXP7PQ7.js +1 -0
- package/dist/chunk-6PUU6ZNQ.js +1 -0
- package/dist/chunk-7GHSE7SG.js +1 -0
- package/dist/{chunk-7556AIVG.js → chunk-7IFE4UQY.js} +1 -1
- package/dist/chunk-7LAKWAKX.js +25 -0
- package/dist/chunk-7MVWDCI3.js +1 -0
- package/dist/chunk-7NSK77WG.js +3 -0
- package/dist/chunk-7QUZWCJZ.js +3 -0
- package/dist/chunk-7RPFJZLP.js +1 -0
- package/dist/{chunk-LJIJEGND.js → chunk-7UOA4DI7.js} +2 -2
- package/dist/chunk-7WPUV7GY.js +6 -0
- package/dist/chunk-7Y7AZRL3.js +10 -0
- package/dist/{chunk-NGSEF3UX.js → chunk-ACA2BGAD.js} +1 -1
- package/dist/chunk-AJMDF3QC.js +1 -0
- package/dist/{chunk-R7YJNDXW.js → chunk-AXC2MHHO.js} +1 -1
- package/dist/{chunk-DEF2G7S4.js → chunk-AYL6KBPE.js} +1 -1
- package/dist/chunk-BAHIL37I.js +1 -0
- package/dist/{chunk-RSC5NQAT.js → chunk-BCYTZ7LM.js} +1 -1
- package/dist/{chunk-AVMNIZAJ.js → chunk-BJPDJIS4.js} +1 -1
- package/dist/{chunk-7VAKNVFD.js → chunk-BN7ZXAZJ.js} +1 -1
- package/dist/chunk-BVSKBX7T.js +16 -0
- package/dist/chunk-BWRNXCVN.js +4 -0
- package/dist/{chunk-XNPUZRWP.js → chunk-C3KEDG33.js} +1 -1
- package/dist/{chunk-WEXOA4C4.js → chunk-C7V755IT.js} +1 -1
- package/dist/chunk-CCMDZX35.js +7 -0
- package/dist/chunk-CCQNP5YR.js +1 -0
- package/dist/chunk-CEIJKJOF.js +11 -0
- package/dist/chunk-CIK5BF7V.js +1 -0
- package/dist/{chunk-6YDLNP4G.js → chunk-CVVQQLCF.js} +1 -1
- package/dist/chunk-CW2T7EOQ.js +1 -0
- package/dist/chunk-CZ22VZDA.js +376 -0
- package/dist/{chunk-3G2ZQ2EF.js → chunk-D7NB7YR6.js} +1 -1
- package/dist/{chunk-DYPZX7MW.js → chunk-DFQ4WTET.js} +2 -2
- package/dist/chunk-DJAZBPYA.js +3 -0
- package/dist/chunk-DNMXVMJM.js +47 -0
- package/dist/{chunk-CLD3NZYD.js → chunk-EGCWR5AS.js} +1 -1
- package/dist/{chunk-BOE2ST6J.js → chunk-EITIW5OX.js} +1 -1
- package/dist/chunk-EMSF57ZB.js +1 -0
- package/dist/{chunk-ZEBMW5KS.js → chunk-EXFBZPZS.js} +1 -1
- package/dist/chunk-FDXHQZTO.js +26 -0
- package/dist/{chunk-Q2XLIWG4.js → chunk-FFHH5LOR.js} +1 -1
- package/dist/{chunk-MMQZO2W2.js → chunk-FNLECT7B.js} +1 -1
- package/dist/{chunk-PO5T44H3.js → chunk-FWB3GLMW.js} +1 -1
- package/dist/chunk-FZCGRIOM.js +1 -0
- package/dist/{chunk-G7JW4UIM.js → chunk-G6ZMSWEU.js} +1 -1
- package/dist/chunk-GAMC2BNY.js +7 -0
- package/dist/chunk-GB6E3ATN.js +4 -0
- package/dist/chunk-GCNA3HXH.js +8 -0
- package/dist/{chunk-IGDVKRB4.js → chunk-GFVKTWFT.js} +1 -1
- package/dist/chunk-GQNOVEKP.js +2 -0
- package/dist/{chunk-5BTLE67Z.js → chunk-GRGFA26K.js} +1 -1
- package/dist/chunk-GXORLBVN.js +2 -0
- package/dist/{chunk-3V4VL3SD.js → chunk-H4V55Y3Z.js} +118 -118
- package/dist/chunk-HCZG7YJ6.js +16 -0
- package/dist/chunk-HF4NDEX3.js +1 -0
- package/dist/chunk-HIRTL45Q.js +1 -0
- package/dist/chunk-I4OVLRQR.js +1 -0
- package/dist/{chunk-ENQXB532.js → chunk-I6FRVYGE.js} +1 -1
- package/dist/chunk-IEQ4UOH3.js +4 -0
- package/dist/{chunk-PIZDYS7T.js → chunk-IILLQOUC.js} +60 -60
- package/dist/{chunk-45SZ5PSE.js → chunk-IQVRP7CT.js} +1 -1
- package/dist/chunk-IUP7POIE.js +6 -0
- package/dist/chunk-IUTZIN2T.js +10 -0
- package/dist/chunk-IWEKM5Y3.js +1 -0
- package/dist/chunk-IWTNUJGY.js +2 -0
- package/dist/chunk-J6TW43TG.js +1 -0
- package/dist/chunk-JDR6UVZA.js +8 -0
- package/dist/{chunk-CVFPY2SH.js → chunk-JEA3C7ON.js} +1 -1
- package/dist/chunk-JOJV5E2K.js +1 -0
- package/dist/chunk-JYMDWR25.js +1 -0
- package/dist/{chunk-TPHHQAUD.js → chunk-KDPQXURV.js} +1 -1
- package/dist/{chunk-MW3IMZJ5.js → chunk-KGRIYAMA.js} +1 -1
- package/dist/chunk-KJQDS5HI.js +1 -0
- package/dist/chunk-KKPOOIE4.js +2 -0
- package/dist/{chunk-VS7QVU3Z.js → chunk-KSDU4YOB.js} +1 -1
- package/dist/chunk-L7MSPGDS.js +5 -0
- package/dist/{chunk-43URS56H.js → chunk-LDU5T3DN.js} +1 -1
- package/dist/chunk-LHKVXJPX.js +1 -0
- package/dist/{chunk-EO4YJFMY.js → chunk-LMQGNECW.js} +86 -200
- package/dist/{chunk-TQ7URMGS.js → chunk-LQ7ENG4V.js} +1 -1
- package/dist/chunk-LVLAOBJM.js +103 -0
- package/dist/chunk-LWCTKI4Z.js +18 -0
- package/dist/chunk-M3ACZWMR.js +1 -0
- package/dist/chunk-M4BVLMPH.js +31 -0
- package/dist/{chunk-NCRWOW6F.js → chunk-M5TGCSUK.js} +1 -1
- package/dist/chunk-M7LPHCP2.js +274 -0
- package/dist/{chunk-IDKRJ2F4.js → chunk-MDRVCBDO.js} +1 -1
- package/dist/chunk-MR2AUT7Q.js +1 -0
- package/dist/chunk-MXJAH2GW.js +5 -0
- package/dist/{chunk-UU6BRRYS.js → chunk-MYAIWSOO.js} +1 -1
- package/dist/{chunk-NT4A37HG.js → chunk-N2RFDHRY.js} +1 -1
- package/dist/{chunk-GSE6FXZU.js → chunk-NB4BRW3H.js} +1 -1
- package/dist/chunk-NDKSG4CC.js +97 -0
- package/dist/chunk-NK2MGR6A.js +1 -0
- package/dist/chunk-NOH63WC6.js +12 -0
- package/dist/{chunk-BVB3DTNE.js → chunk-OGWPS55W.js} +1 -1
- package/dist/chunk-OQ5CLM2H.js +4 -0
- package/dist/{chunk-PVAZCZSY.js → chunk-OQU3HLAE.js} +1 -1
- package/dist/chunk-OVWUGAEU.js +11 -0
- package/dist/chunk-OX7UVDSU.js +6 -0
- package/dist/chunk-P33TONYG.js +1 -0
- package/dist/chunk-PEVIRAMR.js +6 -0
- package/dist/{chunk-YPCXVZ2N.js → chunk-PGLWZMJU.js} +4 -4
- package/dist/chunk-PIAD3F6M.js +16 -0
- package/dist/chunk-PMHP57MH.js +20 -0
- package/dist/{chunk-F3PZGSOY.js → chunk-POKY4RWR.js} +1 -1
- package/dist/chunk-PSSYLJG4.js +2 -0
- package/dist/chunk-PYIICTLX.js +1 -0
- package/dist/chunk-PZUGDE7N.js +2 -0
- package/dist/{chunk-NU5WLZ6Y.js → chunk-Q2SZCZE7.js} +1 -1
- package/dist/{chunk-MUM34KUM.js → chunk-Q2XRITUG.js} +1 -1
- package/dist/chunk-Q5MEFIMV.js +4 -0
- package/dist/chunk-Q66CI37F.js +7 -0
- package/dist/chunk-QFWWCZOI.js +1 -0
- package/dist/{chunk-TR4OWSEX.js → chunk-QFYLJVJW.js} +1 -1
- package/dist/chunk-QKVVJXWS.js +3 -0
- package/dist/chunk-QN3774QI.js +1 -0
- package/dist/chunk-R2BDABJD.js +213 -0
- package/dist/{chunk-7HWMURCW.js → chunk-R7EMV77H.js} +1 -1
- package/dist/chunk-RFGEM5JC.js +3 -0
- package/dist/{chunk-7A3RW2VM.js → chunk-RVQV6G5M.js} +1 -1
- package/dist/chunk-S67I4E7M.js +5 -0
- package/dist/chunk-SFPXYHHL.js +1 -0
- package/dist/{chunk-4OCVXE5Y.js → chunk-SFQEHDJY.js} +1 -1
- package/dist/chunk-SL3VBI62.js +3 -0
- package/dist/{chunk-LOWSU4BB.js → chunk-SNNZ4U2W.js} +1 -1
- package/dist/chunk-T2IUXXCT.js +1 -0
- package/dist/chunk-TPSA4JN5.js +1 -0
- package/dist/chunk-TTEF7GTX.js +1 -0
- package/dist/{chunk-FQL2WEKX.js → chunk-U25W35TX.js} +1 -1
- package/dist/chunk-UIQL5ZF3.js +1 -0
- package/dist/chunk-UK6576EO.js +1 -0
- package/dist/chunk-ULD7CIOY.js +4 -0
- package/dist/{chunk-D3KFKT4D.js → chunk-UOS2XLGG.js} +1 -1
- package/dist/{chunk-EMH7OHCW.js → chunk-UVRKTMF7.js} +1 -1
- package/dist/{chunk-ZTICX3AO.js → chunk-UWMZ5CSB.js} +1 -1
- package/dist/chunk-UZROQRLX.js +2 -0
- package/dist/{chunk-5BGUKF7L.js → chunk-V75WUEFU.js} +1 -1
- package/dist/chunk-VB7YQMAM.js +5 -0
- package/dist/chunk-VHUD3CBC.js +3 -0
- package/dist/chunk-VMMUJN4T.js +17 -0
- package/dist/{chunk-S36VGP37.js → chunk-VW6QS7DO.js} +1 -1
- package/dist/chunk-VWH3VPYI.js +1 -0
- package/dist/{chunk-4TF7ER72.js → chunk-WBJ6ZHYH.js} +1 -1
- package/dist/chunk-WDFCOZAY.js +16 -0
- package/dist/chunk-WFWISGLS.js +1 -0
- package/dist/chunk-WGUOLSMG.js +1 -0
- package/dist/{chunk-PFXNBHQQ.js → chunk-WJSUIUBW.js} +2 -2
- package/dist/{chunk-TFXUDHCP.js → chunk-WMAFG2JD.js} +1 -1
- package/dist/chunk-X2H6I2WW.js +5 -0
- package/dist/{chunk-DSS4ECIH.js → chunk-X7HVAVSZ.js} +1 -1
- package/dist/{chunk-NYYXH2SX.js → chunk-XBQDMGUN.js} +1 -1
- package/dist/chunk-XITZIDCL.js +18 -0
- package/dist/chunk-XKRJKUA7.js +1 -0
- package/dist/{chunk-FEQHCE2E.js → chunk-XM7YUXTF.js} +2 -2
- package/dist/chunk-XMODGI45.js +1 -0
- package/dist/{chunk-B3M3KIOU.js → chunk-XNNKLUTN.js} +1 -1
- package/dist/chunk-XTREQ4A2.js +1 -0
- package/dist/chunk-YGYEM6QO.js +1 -0
- package/dist/{chunk-LWU5TKNA.js → chunk-YKS7MH3F.js} +9 -6
- package/dist/chunk-YTUDXZLN.js +1 -0
- package/dist/{chunk-I3J63RFV.js → chunk-YTUUU33R.js} +1 -1
- package/dist/chunk-YVVU4J5O.js +3 -0
- package/dist/{chunk-4TZCRMBJ.js → chunk-YVY32DNA.js} +1 -1
- package/dist/chunk-Z5SILNH2.js +7 -0
- package/dist/chunk-ZAA2DXK5.js +5 -0
- package/dist/chunk-ZDQO6CNY.js +1 -0
- package/dist/chunk-ZGV3HNEV.js +1 -0
- package/dist/chunk-ZQDDRIBA.js +22 -0
- package/dist/{chunk-QTLGMJDW.js → chunk-ZT5WFUKJ.js} +4 -4
- package/dist/chunk-ZYQ2XWC5.js +5 -0
- 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/channel-config.js +1 -1
- package/dist/cli/commands/app/import/custom-data-definitions.js +1 -1
- package/dist/cli/commands/app/import/dashboard-extensions.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/security/check.js +1 -1
- package/dist/cli/commands/app/security/clean.js +1 -1
- package/dist/cli/commands/app/security/instructions.js +1 -1
- package/dist/cli/commands/app/security/record.js +1 -1
- package/dist/cli/commands/app/security/review.js +1 -1
- package/dist/cli/commands/app/subscription-migrations/cancel.js +1 -1
- package/dist/cli/commands/app/subscription-migrations/list.js +1 -1
- package/dist/cli/commands/app/subscription-migrations/schedule.js +1 -1
- package/dist/cli/commands/app/subscription-migrations/status.js +1 -1
- package/dist/cli/commands/app/subscription-migrations/unschedule.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.d.ts +34 -1
- package/dist/cli/commands/doc/fetch.js +1 -1
- package/dist/cli/commands/doc/search.d.ts +53 -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.d.ts +6 -6
- 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.js +1 -1
- package/dist/cli/commands/theme/check.js +1 -1
- package/dist/cli/commands/theme/console.js +1 -1
- package/dist/cli/commands/theme/delete.js +1 -1
- package/dist/cli/commands/theme/dev.js +1 -1
- package/dist/cli/commands/theme/duplicate.js +1 -1
- package/dist/cli/commands/theme/info.js +1 -1
- package/dist/cli/commands/theme/init.js +1 -1
- package/dist/cli/commands/theme/language-server.js +1 -1
- package/dist/cli/commands/theme/list.js +1 -1
- package/dist/cli/commands/theme/metafields/pull.js +1 -1
- package/dist/cli/commands/theme/open.js +1 -1
- package/dist/cli/commands/theme/package.js +1 -1
- package/dist/cli/commands/theme/preview.js +1 -1
- package/dist/cli/commands/theme/profile.js +1 -1
- package/dist/cli/commands/theme/publish.js +1 -1
- package/dist/cli/commands/theme/pull.js +1 -1
- package/dist/cli/commands/theme/push.js +1 -1
- package/dist/cli/commands/theme/rename.js +1 -1
- package/dist/cli/commands/theme/share.js +1 -1
- package/dist/cli/commands/upgrade.d.ts +64 -0
- 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/commands/doc/fetch-result.d.ts +2 -0
- package/dist/cli/services/commands/doc/fetch-result.js +22 -0
- package/dist/cli/services/commands/doc/fetch.d.ts +2 -1
- package/dist/cli/services/commands/doc/fetch.js +2 -15
- package/dist/cli/services/commands/doc/search-result.d.ts +2 -0
- package/dist/cli/services/commands/doc/search-result.js +14 -0
- package/dist/cli/services/commands/doc/search.d.ts +9 -1
- package/dist/cli/services/commands/doc/search.js +27 -2
- package/dist/cli/services/commands/doc/types.d.ts +107 -0
- package/dist/cli/services/commands/doc/types.js +47 -0
- package/dist/cli/services/commands/help/types.d.ts +6 -6
- package/dist/command-event-context-LFUZ7UCA.js +1 -0
- package/dist/command-json-schema-2UMKY7MY.js +1 -0
- package/dist/command-registry.js +1 -1
- package/dist/conf-store-RI3TL6I4.js +1 -0
- package/dist/custom-oclif-loader-IZCKN67O.js +1 -0
- package/dist/deprecations-IFVUXXDB.js +1 -0
- package/dist/dist-4H2B7BMN.js +1 -0
- package/dist/dist-QNWOGQN3.js +1 -0
- package/dist/{environment-RSUK27TA.js → environment-O7ECODHU.js} +1 -1
- package/dist/environments-CYMEN7NV.js +1 -0
- package/dist/error-IL6WQMSW.js +1 -0
- package/dist/error-handler-74HKA23T.js +1 -0
- package/dist/fs-AINFLJ2E.js +1 -0
- package/dist/hooks/did-you-mean.js +1 -1
- package/dist/hooks/hydrogen-init.js +1 -1
- package/dist/hooks/plugin-plugins.js +1 -1
- package/dist/hooks/postrun.js +1 -1
- package/dist/hooks/prerun.js +1 -1
- package/dist/hooks/public-metadata.js +1 -1
- package/dist/hooks/sensitive-metadata.js +1 -1
- package/dist/hooks/tunnel-provider.js +1 -1
- package/dist/hooks/tunnel-start.js +1 -1
- package/dist/index.js +13 -13
- package/dist/is-global-2VLKV46Q.js +1 -0
- package/dist/json-error-HZB5YIHV.js +1 -0
- package/dist/{lib-TYM5B75S.js → lib-PJHT4MKY.js} +1 -1
- package/dist/{lib-55QUD4AJ.js → lib-VKSQ65BQ.js} +1 -1
- package/dist/{lib-PH52G55H.js → lib-YEZOHXF3.js} +1 -1
- package/dist/{local-R3UAQN7T.js → local-KOZETREJ.js} +1 -1
- package/dist/{metadata-JWJG4JV4.js → metadata-IBPHZB7N.js} +1 -1
- package/dist/{morph-BABFBRSW.js → morph-CRY35DIK.js} +1 -1
- package/dist/node-package-manager-DXSRNEDC.js +1 -0
- package/dist/notifications-system-XA3EBOGJ.js +1 -0
- package/dist/os-X73O7BAB.js +1 -0
- package/dist/out-B2GISN65.js +1 -0
- package/dist/output-3OYXK3Z5.js +1 -0
- package/dist/{path-CPAYTWQW.js → path-3L2QRACZ.js} +1 -1
- package/dist/system-JWYYT4PM.js +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui-PCG5D6RZ.js +1 -0
- package/dist/upgrade-7U2TUNC4.js +1 -0
- package/dist/version-7DGU2KYH.js +1 -0
- package/dist/version-SXQTRBXB.js +1 -0
- package/dist/workerd-MQZ3NKJI.js +18 -0
- package/oclif.manifest.json +1664 -427
- package/package.json +8 -8
- package/dist/analytics-APDNTBDE.js +0 -1
- package/dist/analytics-LX52KYSE.js +0 -1
- package/dist/chunk-2PDVBGQH.js +0 -7
- package/dist/chunk-2YVSZFXJ.js +0 -4
- package/dist/chunk-35WQTGN3.js +0 -5
- package/dist/chunk-37BGAWAW.js +0 -2
- package/dist/chunk-3C4WVKSO.js +0 -6
- package/dist/chunk-3LHE4GIX.js +0 -1
- package/dist/chunk-47IQIIFX.js +0 -383
- package/dist/chunk-4ES7BJEK.js +0 -1
- package/dist/chunk-4IFY7V7W.js +0 -1
- package/dist/chunk-4JGWKUJN.js +0 -2
- package/dist/chunk-4O5GQ3DS.js +0 -7
- package/dist/chunk-4O7LK5RG.js +0 -26
- package/dist/chunk-4TFJ5RW7.js +0 -8
- package/dist/chunk-4ZNBEMRT.js +0 -20
- package/dist/chunk-5JIJDUXX.js +0 -20
- package/dist/chunk-66YRAUWX.js +0 -3
- package/dist/chunk-6A4H3HPY.js +0 -7
- package/dist/chunk-6HPUOCFF.js +0 -1
- package/dist/chunk-6IDEDOXW.js +0 -2
- package/dist/chunk-6IMHGT7F.js +0 -8
- package/dist/chunk-6MC2BEW4.js +0 -1
- package/dist/chunk-73D5O7A3.js +0 -1
- package/dist/chunk-7E4MJCVE.js +0 -10
- package/dist/chunk-7HNRK2CR.js +0 -1
- package/dist/chunk-7SJHVJ3W.js +0 -5
- package/dist/chunk-ALK66U3O.js +0 -3
- package/dist/chunk-AMLCWRHU.js +0 -4
- package/dist/chunk-AYIU6Z4C.js +0 -1
- package/dist/chunk-BIWG3FQQ.js +0 -5
- package/dist/chunk-BQ3U3CQV.js +0 -1
- package/dist/chunk-C6IBY7NW.js +0 -16
- package/dist/chunk-CQF5NDTJ.js +0 -4
- package/dist/chunk-DMDLJRLW.js +0 -1
- package/dist/chunk-DMNWSUKV.js +0 -5
- package/dist/chunk-FK7GA4QQ.js +0 -1
- package/dist/chunk-FO2R6KHG.js +0 -1
- package/dist/chunk-FOAV642V.js +0 -1
- package/dist/chunk-GE4MLO3C.js +0 -5
- package/dist/chunk-GM4EFJJF.js +0 -7
- package/dist/chunk-GN66BRYF.js +0 -1
- package/dist/chunk-GPRZYFDE.js +0 -1
- package/dist/chunk-GZ7VGCVW.js +0 -3
- package/dist/chunk-HASIOUH2.js +0 -3
- package/dist/chunk-HILYTMVA.js +0 -1
- package/dist/chunk-HJHS23Q3.js +0 -1
- package/dist/chunk-HLPAVELJ.js +0 -1
- package/dist/chunk-HPM3HF7A.js +0 -1
- package/dist/chunk-HQJ62PII.js +0 -3
- package/dist/chunk-HQY6JM6G.js +0 -6
- package/dist/chunk-HSYMUYEZ.js +0 -359
- package/dist/chunk-I5PQZRYM.js +0 -32
- package/dist/chunk-IPZ6LUJV.js +0 -4
- package/dist/chunk-J4NBPC57.js +0 -1
- package/dist/chunk-J6LQR2F6.js +0 -7
- package/dist/chunk-JYGZD4HM.js +0 -1
- package/dist/chunk-K3HUQLIC.js +0 -6
- package/dist/chunk-K7D53KSJ.js +0 -1
- package/dist/chunk-KQFA5YTT.js +0 -97
- package/dist/chunk-KTD7VLHL.js +0 -2
- package/dist/chunk-L4DFMMOI.js +0 -1
- package/dist/chunk-LJZTSQRD.js +0 -11
- package/dist/chunk-LLPB6JN5.js +0 -9
- package/dist/chunk-LYIXRMQJ.js +0 -46
- package/dist/chunk-MCNK5SJ6.js +0 -2
- package/dist/chunk-MJZSSCGD.js +0 -5
- package/dist/chunk-N55MSO3X.js +0 -12
- package/dist/chunk-N5AZZYQA.js +0 -4
- package/dist/chunk-NCVGCVQ5.js +0 -6
- package/dist/chunk-O5FFMTJE.js +0 -25
- package/dist/chunk-OE3HSNSE.js +0 -16
- package/dist/chunk-ONF7XXEL.js +0 -1
- package/dist/chunk-PG4S5HJJ.js +0 -5
- package/dist/chunk-PHG4DASY.js +0 -18
- package/dist/chunk-PP4VCR4Y.js +0 -1
- package/dist/chunk-PWS4VFSD.js +0 -1
- package/dist/chunk-Q37WAD6F.js +0 -1
- package/dist/chunk-Q43LBSPT.js +0 -1
- package/dist/chunk-QAJZUJR5.js +0 -1
- package/dist/chunk-QO5RNGWA.js +0 -1
- package/dist/chunk-QPQS2YU3.js +0 -1
- package/dist/chunk-QUXQM3S3.js +0 -1
- package/dist/chunk-R3KSOCMB.js +0 -6
- package/dist/chunk-R74WHKHH.js +0 -15
- package/dist/chunk-RJSQMKKS.js +0 -1
- package/dist/chunk-RK2V6OIJ.js +0 -2
- package/dist/chunk-RUHQNF2W.js +0 -1
- package/dist/chunk-RXTLNUPF.js +0 -1
- package/dist/chunk-SNE4RHM4.js +0 -1
- package/dist/chunk-SQAS5RVZ.js +0 -10
- package/dist/chunk-SZI6G247.js +0 -103
- package/dist/chunk-TVCWDEVS.js +0 -1
- package/dist/chunk-TYMYIUIQ.js +0 -1
- package/dist/chunk-UIC7K2HX.js +0 -7
- package/dist/chunk-UNHT4ZFP.js +0 -317
- package/dist/chunk-UQ6ALA3Y.js +0 -3
- package/dist/chunk-UWI76E2L.js +0 -18
- package/dist/chunk-VE35YELD.js +0 -1
- package/dist/chunk-VGBUN3CZ.js +0 -17
- package/dist/chunk-VMNOSVPT.js +0 -8
- package/dist/chunk-VNFUCH6T.js +0 -1
- package/dist/chunk-W4KE7AO6.js +0 -1
- package/dist/chunk-WEPO4J2F.js +0 -19
- package/dist/chunk-WLWHCUPZ.js +0 -1
- package/dist/chunk-XGKCPD6W.js +0 -1
- package/dist/chunk-XNVOKAF2.js +0 -1
- package/dist/chunk-XSMCQLJW.js +0 -1
- package/dist/chunk-XUUIBSLW.js +0 -1
- package/dist/chunk-XWQM2NZ2.js +0 -2
- package/dist/chunk-Y3PY5LP7.js +0 -3
- package/dist/chunk-Y62EMOQA.js +0 -1
- package/dist/chunk-Y743UVBS.js +0 -16
- package/dist/chunk-YBSX53QP.js +0 -1
- package/dist/chunk-YHCP326A.js +0 -16
- package/dist/chunk-YHESTFMZ.js +0 -4
- package/dist/chunk-YT27FIQN.js +0 -275
- package/dist/chunk-YTR5JHNJ.js +0 -2
- package/dist/chunk-YYA5VGDW.js +0 -1
- package/dist/chunk-Z6X2GT6Q.js +0 -1
- package/dist/chunk-ZEE32UH6.js +0 -1
- package/dist/cli/commands/app/app-logs/sources.js +0 -1
- package/dist/command-json-schema-SS4GDJTQ.js +0 -1
- package/dist/conf-store-54YJCIDK.js +0 -1
- package/dist/custom-oclif-loader-3UBH7Q7R.js +0 -1
- package/dist/deprecations-ZX7ZKF6L.js +0 -1
- package/dist/dist-JMNE7MP6.js +0 -1
- package/dist/dist-M2AXGBOL.js +0 -1
- package/dist/environments-KD2IDYPG.js +0 -1
- package/dist/error-AA6LW3PN.js +0 -1
- package/dist/error-handler-4VW3AV2G.js +0 -1
- package/dist/fs-4QZCAEP7.js +0 -1
- package/dist/is-global-FKG327CG.js +0 -1
- package/dist/json-error-32ETFU3V.js +0 -1
- package/dist/node-package-manager-M4XHUTQR.js +0 -1
- package/dist/notifications-system-QVM2JWKB.js +0 -1
- package/dist/os-FEHBQQKP.js +0 -1
- package/dist/out-53ABAVL7.js +0 -1
- package/dist/output-2LS5AOAH.js +0 -1
- package/dist/system-TMD2LYZM.js +0 -1
- package/dist/ui-FNPICAAH.js +0 -1
- package/dist/upgrade-YYPP5VZY.js +0 -1
- package/dist/version-OX3MORI6.js +0 -1
- package/dist/version-P7D5ME4Z.js +0 -1
- package/dist/workerd-TKVRZK2F.js +0 -18
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import{a as uo,e as fo,f as po}from"./chunk-XM7YUXTF.js";import{a as ho}from"./chunk-7UOA4DI7.js";import{c as mo,i as go,o as Ur}from"./chunk-YLQ3LNNY.js";import{b as et}from"./chunk-ZQDDRIBA.js";import{Da as oo,M as Yt,O as Jt,R as Wt,ha as Bt,l as qt,la as zt,u as je}from"./chunk-H4V55Y3Z.js";import{B as eo,D as to,l as Kt,m as Xt,p as Zt,x as Ze}from"./chunk-IUP7POIE.js";import{b as lo,c as ce}from"./chunk-Q2SZCZE7.js";import{A as ie,B as Y,D as no,E as G,F as M,I as io,K as se,N as so,z as q}from"./chunk-CZ22VZDA.js";import{a as Mt,c as Vt}from"./chunk-J6TW43TG.js";import{o as Ht}from"./chunk-335BUVBP.js";import{a as re}from"./chunk-BN7ZXAZJ.js";import{h as p,k as Fe}from"./chunk-2VSNFOKD.js";import{Ba as Xe,Bb as I,Da as _e,Sa as w,T as jt,Va as Dt,W as Ft,Y as Nt,_ as Lt,_a as Ut,ib as Qt,la as R,nb as ro,oa as ne,qb as J,rb as ao,sb as ae,ta as C,va as $e,wb as co,xa as Ie,yb as F}from"./chunk-LWCTKI4Z.js";import{i as E}from"./chunk-B4OMIONW.js";import{b as S,h as Gt,j as Te}from"./chunk-FZCGRIOM.js";import{b as ke}from"./chunk-YTUUU33R.js";import{a as Tt}from"./chunk-JD5P5RAJ.js";import{c as g,e as b,f as Q,h as O,i as K,j as Oe,m as Qe,p as Ke}from"./chunk-IWTNUJGY.js";import{b as Dr}from"./chunk-JFBCE4HN.js";import{e as ye,g as l}from"./chunk-VKWPEFWQ.js";l();import{createRequire as Hr}from"node:module";import{pathToFileURL as yo}from"node:url";var wo=Hr(import.meta.url);async function So(e){let t;try{t=wo.resolve("vite",process.env.SHOPIFY_UNIT_TEST?void 0:{paths:[e]})}catch(s){throw s instanceof Error&&s.code==="MODULE_NOT_FOUND"?new p("Could not find the 'vite' package in your project.","Hydrogen uses Vite to run this command.",["Run this command from the root directory of your Hydrogen app.","Install your project dependencies (for example, by running `npm install`) and try again."]):s}let o=await eo(t),r=o.content.exports?.["."];typeof r!="string"&&(r=r?.import),typeof r!="string"&&(r=r.default);let n=g(O(o.path),r);return import(yo(n).href)}function Gr(e,t){let o=wo.resolve(e,process.env.SHOPIFY_UNIT_TEST?void 0:{paths:[t]});return import(yo(o).href)}l();l();import{isAbsolute as Mr,resolve as Vr}from"node:path";var Pi=S.string().refine(Mr,"Expected an absolute native filesystem path").transform(e=>Vr(e)),vo=S.string().datetime({precision:0}),we=S.string().regex(/^gid:\/\/shopify\/HydrogenStorefront\/\d+$/).describe("A Shopify HydrogenStorefront GID."),Ei=S.string().regex(/^gid:\/\/shopify\/HydrogenStorefrontEnvironment\/\d+$/).describe("A Shopify HydrogenStorefrontEnvironment GID."),bo=S.string().regex(/^gid:\/\/shopify\/HydrogenStorefrontDeployment\/\d+$/).describe("A Shopify HydrogenStorefrontDeployment GID."),xo=S.enum(["success","partial","skipped","cancelled"]),tt=S.string().regex(/^[a-z0-9][a-z0-9-]*\.myshopify\.com$/).nullable();function Po(e){return new Date(e).toISOString().replace(/\.\d{3}Z$/,"Z")}function Ne(e){let t=e?.toLowerCase();return t&&/^[a-z0-9][a-z0-9-]*\.myshopify\.com$/.test(t)?t:null}l();import{format as qr}from"node:util";async function Eo(e){if(!X())return e();let t={log:console.log,info:console.info,debug:console.debug},o={...t};for(let r of["log","info","debug"])o[r]=(...n)=>{X()?Mt(["--json"],()=>F(qr(...n))):t[r](...n)},console[r]=o[r];try{return await e()}finally{for(let r of["log","info","debug"])console[r]===o[r]&&(console[r]=t[r])}}function X(){return Te()==="json"||Ht()}function Le(e,t,o=X()){return o?(co(e.encode(t)),!0):!1}l();var Co=S.object({gid:bo,createdAt:vo,commitMessage:S.string().nullable()}).strict(),ot=S.object({gid:we,name:S.string(),productionUrl:S.string().url().nullable()}).strict().describe("All projected fields are present; unavailable productionUrl is null."),Ro=ot.extend({currentProductionDeployment:Co.nullable()}).strict();function rt(e){return{gid:e.id,name:e.title,productionUrl:e.productionUrl||null}}function Ni({shop:e,storefronts:t}){return{storeDomain:Ne(e),storefronts:t.map(o=>({...rt(o),currentProductionDeployment:o.currentProductionDeployment?{gid:o.currentProductionDeployment.id,createdAt:Po(o.currentProductionDeployment.createdAt),commitMessage:o.currentProductionDeployment.commitMessage??null}:null}))}}var Li=re({name:"HydrogenListResult",schema:S.object({storeDomain:tt,storefronts:S.array(Ro)}).strict().describe("The complete list of Hydrogen storefronts for the store."),definitions:{Storefront:Ro,Deployment:Co}}),nt=re({name:"HydrogenLinkResult",schema:S.object({status:xo,changed:S.boolean(),storeDomain:tt,storefront:ot.nullable()}).strict(),definitions:{Storefront:ot}}),Di=re({name:"HydrogenUnlinkResult",schema:S.object({status:S.literal("success"),changed:S.boolean(),storefront:S.object({gid:we,name:S.string()}).strict().nullable()}).strict()});var We=ye(ke(),1);l();var $o=ye(ke(),1);l();import{createRequire as Ao}from"node:module";function ko({id:e,projectPath:t}){if(!(!e||!Yr(t,e)))throw new p(`\`shopify ${e.replace(/:/g," ")}\` is not supported by this version of Hydrogen`,"The installed version of @shopify/hydrogen disables this command.",["Use your framework or package tooling instead."])}function Yr(e,t){try{let n=Ao(g(e,"package.json"))("@shopify/hydrogen/package.json")?.shopify?.cli?.disabledCommands;return Array.isArray(n)&&n.includes(t)}catch{return!1}}function Oo(e){try{let o=Ao(import.meta.url)(g(e,"package.json"));return[o?.dependencies,o?.devDependencies,o?.peerDependencies].some(r=>!!r?.["@shopify/hydrogen"])}catch{return!1}}var le=class extends et{static baseFlags={...et.baseFlags,...lo};async _run(){let t=()=>Eo(()=>super._run()),{flags:o}=await $o.Parser.parse([],{flags:ce});return o.json&&(process.env.SHOPIFY_FLAG_JSON="true"),o.json&&Te()!=="json"?Gt({outputMode:"json",sink:Vt},t):t()}async init(){if(await super.init(),!this.id?.startsWith("hydrogen:")||this.id==="hydrogen:init")return;let t=this.argv.indexOf("--"),o=t<0?this.argv:this.argv.slice(0,t);if(o.some(i=>["--help","-h","--json-schema"].includes(i))||Tt(process.env.SHOPIFY_FLAG_JSON_SCHEMA))return;let r=o.findIndex(i=>/^--path($|=)/.test(i)),n=r<0?process.env.SHOPIFY_HYDROGEN_FLAG_PATH:o[r]?.startsWith("--path=")?o[r].slice(7):o[r+1],s=n&&!n.startsWith("--")?b(Ke(),n):Ke();if(!Oo(s))throw new p("Looks like you're trying to run a Hydrogen command outside of a Hydrogen project.","Run `shopify hydrogen init` to create a new Hydrogen project or use the `--path` flag to specify an existing Hydrogen project.");ko({id:this.id,projectPath:s})}};l();var A=ye(ke(),1);l();l();l();import{fileURLToPath as Io}from"node:url";import{existsSync as Br}from"node:fs";l();import{exec as Jr}from"node:child_process";import{promisify as Wr}from"node:util";var D=Wr(Jr);function ns(){let e=process.listeners("warning")[0];e&&(process.removeAllListeners("warning"),process.prependListener("warning",t=>{t.name!="ExperimentalWarning"&&e(t)}))}var st=new URL("../../..",import.meta.url).pathname,Se=(()=>{try{let e=g(O(st),"templates","skeleton");return Br(e)}catch{return!1}})(),ms=Se?st:void 0,zr="assets/hydrogen",Qr="starter",Z="routes",it;async function Kr(){if(it??=await Ut("package.json",{cwd:Io(import.meta.url),type:"file"}),!it)throw new p("Could not find assets directory","Please report this error.");return it}async function U(e,...t){return g(O(await Kr()),process.env.SHOPIFY_UNIT_TEST?"assets":`dist/${zr}`,e??"",...t)}async function ve(e,t){t??=await at();let o=new URL(`${t}/app${e?`/${e}`:""}`,import.meta.url);return o.protocol==="file:"?Io(o):o.toString()}function at(e=!!process.env.SHOPIFY_UNIT_TEST){return e?De():U(Qr)}function De(){if(!Se)throw new p("Trying to use skeleton source dir outside of Hydrogen monorepo.","Please report this error.");return g(O(st),"templates","skeleton")}function Xr(){return g(De(),"node_modules")}async function _o(){if(Se)return Xr();let{stdout:e}=await D("npm root");return e.trim()}var ct=["tailwind","vanilla-extract","css-modules","postcss"];async function To(e,t,o,r=(n,s)=>n){let n=await U(e);return Promise.all(Object.entries(t).map(async([s,i])=>{let a=await R(g(n,s));await C(g(o,i),r(a,s))}))}async function jo(e,t,o){let r=Object.values(e).map(s=>w(g(t,s)).then(i=>i?s:null)),n=(await Promise.all(r)).filter(Boolean);return!(n.length>0&&!o&&!await M({message:`Some files already exist (${n.join(", ")}). Overwrite?`,defaultValue:!1}))}l();l();import{readdir as Zr}from"node:fs/promises";l();Ur();import*as Fo from"fs/promises";import*as No from"path";var lt={arrowParens:"always",singleQuote:!0,bracketSpacing:!1,trailingComma:"all"};async function V(e=process.cwd()){let t=(await Fo.lstat(e)).isFile()?e:No.resolve(e,"prettier.file");try{return await mo(t)||lt}catch{return lt}}async function ee(e,t=lt,o=""){let r=Oe(o);return go(e,{parser:r===".tsx"||r===".ts"?"typescript":"babel",...t})}async function ue(e,t,o){let r=await o(await R(e));if(typeof r=="string")return t&&(r=await ee(r,t,e)),C(e,r)}var en=["tsx","ts","jsx","js","mjs","cjs"];async function T(e,t,o=en){let r=await Zr(e);if(r.includes(t)){let n=b(e,t);if(!await _e(n))return{filepath:n};for(let s of["ts","js"]){let i=b(e,`${t}/index.${s}`);if(await w(b(e,i)))return{filepath:i,extension:s,astType:s}}}else for(let n of o){let s=`${t}.${n}`;if(r.includes(s)){let i=n==="mjs"||n==="cjs"?"js":n;return{filepath:b(e,s),extension:n,astType:i}}}return{}}var Lo=Object.freeze(["dependencies","devDependencies","peerDependencies"]);async function Ue(e,t,o){let r=await Ze(g(t,"package.json")),n=await Ze(g(e,"package.json")),s=new Set(["comment",...o?.ignoredKeys??[]]),i=Object.keys(n).filter(c=>!Lo.includes(c));for(let c of i){if(s.has(c))continue;let u=n[c],f=r[c],m=Array.isArray(u)&&Array.isArray(f)?[...f,...u]:typeof u=="object"&&typeof f=="object"?{...f,...u}:u;r[c]=m}let a=Object.entries(r.dependencies||{}).find(([c])=>c.startsWith("@remix-run/"))?.[1];for(let c of Lo)s.has(c)||n[c]&&(r[c]=[...new Set([...Object.keys(r[c]??{}),...Object.keys(n[c]??{})])].sort().reduce((u,f)=>{let m=n[c]?.[f]??r[c]?.[f];return f.startsWith("@remix-run/")&&a&&(m=a),u[f]=m,u},{}));await to(t,o?.onResult?.(r)??r)}l();l();async function be(e){let t=await import("@ast-grep/napi");if(!(e in t))throw new Error(`Wrong language for AST: ${e}`);return t[e]}async function Do(e,t,o){let{filepath:r,astType:n}=await T(e,"root");if(!r||!n)throw new p(`Could not find root file in ${e}`);await ue(r,t,async s=>{let i=`import ${o.isDefault?o.name:`{${o.name}}`} from '${(o.isAbsolute?"":"./")+o.path}';`;if(s.includes(i.split("from")[0]))return;let c=(await be(n)).parse(s).root(),u=c.findAll({rule:{kind:"import_statement"}}).reverse(),f=u.find(v=>v.text().includes(".css"))||u.shift(),m=c.find({rule:{kind:"jsx_element",regex:"resetStyles",has:{kind:"jsx_opening_element",has:{kind:"identifier",pattern:"link"}}}});if(!f||!m)throw new p('Could not find a "links" export in root file. Please add one and try again.');let d=f.text(),h=m.text(),x=o.isConditional?`{${o.name} && <link rel="stylesheet" href={${o.name}}></link>}`:`<link rel="stylesheet" href={${o.name}}></link>`;return s.replace(d,d+`
|
|
2
|
+
`+i).replace(h,x+`
|
|
3
|
+
`+h)})}async function He(e,t,o,r){let{filepath:n,astType:s}=await T(e,"vite.config");if(!n||!s)throw new p(`Could not find vite.config file in ${e}`);await ue(n,t,async i=>{let a=`import ${o.isDefault?o.name:`{${o.name}}`} from '${o.path}';`;if(new RegExp(`['"]${o.path.replace("/","\\/")}['"]`).test(i))return;let u=(await be(s)).parse(i).root(),f=u.findAll({rule:{kind:"import_statement"}}).pop(),m=u.find(tn);if(!f||!m)throw new p('Could not find a "plugins" key in Vite config file. Please add one and try again.');let d=f.text(),h=m.text(),x=`${o.name}(${r?JSON.stringify(r):""})`;return i.replace(d,d+`
|
|
4
|
+
`+a).replace(h,h.replace("[",`[${x},`))})}var tn={rule:{pattern:"[$$$]",inside:{kind:"pair",stopBy:"neighbor",has:{field:"key",regex:"^plugins$",stopBy:"neighbor"},inside:{kind:"object",stopBy:"neighbor",all:[{inside:{kind:"export_statement",regex:"export default",stopBy:"end"}},{not:{inside:{kind:"object",stopBy:"end"}}}]}}}};var Uo="styles/tailwind.css";async function Ho({rootDirectory:e,appDirectory:t},o=!1){let r=Q(e,t),n={"tailwind.css":g(r,Uo)};if(!await jo(n,e,o)){F("Skipping CSS setup as some files already exist. You may use `--force` or `-f` to override it.");return}return{workPromise:Promise.all([Ue(await U("tailwind"),e),To("tailwind",n,e),V(e).then(i=>Promise.all([Do(t,i,{name:"tailwindCss",path:`${Uo}?url`,isDefault:!0}),He(e,i,{name:"tailwindcss",path:"@tailwindcss/vite",isDefault:!0})]))]),generatedAssets:Object.values(n),needsInstallDeps:!0}}l();async function Go({rootDirectory:e}){return{workPromise:Promise.all([Ue(await U("vanilla-extract"),e),V(e).then(o=>He(e,o,{path:"@vanilla-extract/vite-plugin",name:"vanillaExtractPlugin",isDefault:!1}))]),generatedAssets:[],needsInstallDeps:!0}}var ut=[...ct,"none"],ft={tailwind:"Tailwind v4","vanilla-extract":"Vanilla Extract","css-modules":"CSS Modules",postcss:"PostCSS"},ia={postcss:"https://vitejs.dev/guide/features.html#postcss","css-modules":"https://vitejs.dev/guide/features.html#css-modules","vanilla-extract":"https://vanilla-extract.style/documentation/styling/",tailwind:"https://tailwindcss.com/docs/configuration"};function Mo(e,t,o){switch(e){case"tailwind":return Ho(t,o);case"vanilla-extract":return Go(t);case"postcss":case"css-modules":return{workPromise:Promise.resolve(),generatedAssets:[],needsInstallDeps:!1};default:throw new Error("Unknown strategy")}}async function Vo(e){let t=Object.entries({...ft,...e?.extraChoices});return G({message:"Select a styling library",...e,choices:t.map(([o,r])=>({value:o,label:r})),defaultValue:"tailwind"})}l();l();l();l();async function te(e,t,o=!0){let{transpileTs:r}=await import("./morph-CRY35DIK.js");return r(e,t,o)}l();var qo={checkJs:!1,target:"ES2022",module:"ES2022",moduleResolution:"bundler",baseUrl:".",paths:{"~/*":["app/*"]}},on=new Set(["noLib","target","module","moduleResolution","checkJs","experimentalDecorators","allowSyntheticDefaultImports","baseUrl","paths",...Object.keys(qo)]);function rn(e,t=!1){let o={compilerOptions:{...qo}};if(e.include&&(o.include=e.include.filter(r=>t||!r.endsWith(".d.ts")).map(r=>r.replace(/(?<!\.d)\.ts(x?)$/,".js$1"))),e.compilerOptions)for(let r of on)e.compilerOptions[r]!==void 0&&(o.compilerOptions[r]=e.compilerOptions[r]);return o}async function pt(e,t=!0){let o=g(e,"app/routes.ts");if(await w(o)){let i=(await R(o)).replace("./layout.tsx","./layout.jsx");await C(o,i)}let r=await Dt("**/*.+(ts|tsx)",{absolute:!0,cwd:e,dot:!0,ignore:["**/node_modules/**"]}),n=await V();for(let s of r){if(s.endsWith(".d.ts")){t||await Ie(s);continue}let i=await R(s),a=await ee(await te(i,s,t),n);await Ie(s),await C(s.replace(/\.ts(x?)$/,".js$1"),a)}try{let s=g(e,"remix.config.js"),i=await R(s);i=i.replace(/\/server\.ts/gim,"/server.js"),await C(s,i)}catch(s){I(`Could not change TS extensions in remix.config.js:
|
|
5
|
+
`+s.stack)}try{let s=g(e,"tsconfig.json"),i=await R(s),a=rn(JSON.parse(i.replace(/^\s*\/\/.*$/gm,"")),t);await Ie(s),await C(g(e,"jsconfig.json"),JSON.stringify(a,null,2))}catch(s){I(`Could not transpile tsconfig.json:
|
|
6
|
+
`+s.stack)}try{let s=JSON.parse(await R(g(e,"package.json")));delete s.scripts.typecheck;let i=/react-router typegen\s*&&\s*/g;for(let[a,c]of Object.entries(s.scripts||{}))typeof c=="string"&&c.includes("react-router typegen")&&(s.scripts[a]=c.replace(i,""));if(!t){delete s.devDependencies.typescript,delete s.devDependencies["@shopify/oxygen-workers-types"];for(let c of Object.keys(s.devDependencies))c.startsWith("@types/")&&delete s.devDependencies[c];let a=/\s*--codegen/;s.scripts?.dev&&(s.scripts.dev=s.scripts.dev.replace(a,"")),s.scripts?.build&&(s.scripts.build=s.scripts.build.replace(a,""))}await C(g(e,"package.json"),JSON.stringify(s,null,2))}catch(s){I(`Could not remove TS dependencies from package.json:
|
|
7
|
+
`+s.stack)}try{let{filepath:s=g(e,".eslintrc.cjs")}=await T(e,".eslintrc",["cjs","js"]),i=await R(s);t||(i=i.replace(/\/\*\*[\s*]+@type.+\s+\*\/\s?/gim,"")),i=i.replace(/\s*,?\s*['"`]plugin:hydrogen\/typescript['"`]/gim,"").replace(/\s+['"`]@typescript-eslint\/.+,/gim,""),await C(s,await ee(i,n))}catch(s){I(`Could not remove TS rules from .eslintrc:
|
|
8
|
+
`+s.stack)}}async function Yo({rootDirectory:e,contextCreate:t=g("app","lib","context.ts")},o,r){let n="createAppLoadContext",{filepath:s,astType:i}=await sn({rootDirectory:e,contextCreate:t}),a=await R(r),c=await nn({rootDirectory:e,contextCreate:t},o,r);await ue(s,o,async u=>{let m=(await be(i)).parse(u).root(),h=m.find({rule:{kind:"identifier",inside:{kind:"formal_parameters",stopBy:"end",inside:{kind:"function_declaration",stopBy:"end",has:{kind:"identifier",regex:`^${n}$`}}}}})?.text()??"request",x=a.match(/^(export )?function (\w+)/m)?.[2];if(!x)throw new Error("Could not find the i18n function name");let v=`${x}(${h})`,y="@shopify/hydrogen",P="createHydrogenContext",k=m.find({rule:{kind:"import_specifier",inside:{kind:"import_statement",stopBy:"end",has:{kind:"string_fragment",stopBy:"end",regex:`^${y}$`}},has:{kind:"identifier",regex:`^${P}`}}}),[$,_]=k?.text().split(/\s+as\s+/)||[];if($=_??$,!$)throw new p(`Could not find a Hydrogen import in ${t}`,`Please import "${P}" from "${y}"`);let H=m.find({rule:{kind:"object",inside:{kind:"arguments",inside:{kind:"call_expression",has:{kind:"identifier",regex:$}}}}});if(!H)throw new p(`Could not find a Hydrogen client instantiation with an inline object as argument in ${t}`,`Please add a call to ${$}({...})`);let z=H.find({rule:{kind:"property_identifier",regex:"^i18n$"}})?.next()?.next();if(z){if(z.text().includes(x))throw new p("An i18n strategy is already set up.",`Remove the existing i18n property in the ${$}({...}) call to set up a new one.`);let{start:Ce,end:Ae}=z.range();u=u.slice(0,Ce.index)+v+u.slice(Ae.index)}else{let{end:Ce}=H.range(),Ae=u.slice(0,Ce.index-1);u=Ae+((/,\s*$/.test(Ae)?"":",")+`i18n: ${v}`)+u.slice(Ce.index-1)}let he=m.findAll({rule:{kind:"import_statement"}}).pop()?.range()??{end:{index:0}},Lr=g("~",Q(g(e,"app"),c.slice(0,-Oe(c).length)));return u=u.slice(0,he.end.index)+`import {getLocaleFromRequest} from "${Lr}";`+u.slice(he.end.index),u})}async function nn({rootDirectory:e,contextCreate:t=g("app","lib","context.ts")},o,r){let n=t?.endsWith(".js")||!1,s=g(e,O(t),n?"i18n.js":"i18n.ts");if(await w(s))throw new p(`${s} already exist. Renamed or remove the existing file before continue.`);return await ne(r,s),await ue(s,o,async i=>(i=i.replace(/\.\/mock-i18n-types\.js/,"@shopify/hydrogen"),n&&(i=await te(i,r)),i)),s}async function sn({rootDirectory:e,contextCreate:t=g("app","lib","context.ts")}){let o=t.match(/\.([jt]sx?)$/)?.[1],{filepath:r,astType:n}=o?{filepath:b(e,t),astType:o}:await T(e,g(t));if(!r||!n)throw new p(`Could not find a context create file at ${b(e,t)}`);return{filepath:r,astType:n}}var an=["subfolders","domains","subdomains"],mt={subfolders:"Subfolders (example.com/fr-ca/...)",subdomains:"Subdomains (de.example.com/...)",domains:"Top-level domains (example.jp/...)"},dt=[...an,"none"];async function Jo(e,t){let o=await U("i18n",`${e}.ts`);if(!await w(o))throw new Error("Unknown strategy");let r=await V(t.rootDirectory);await Yo(t,r,o)}async function Wo(e){let t=Object.entries({...mt,...e?.extraChoices});return G({message:"Select a URL structure to support multiple markets",...e,choices:t.map(([o,r])=>({value:o,label:r}))})}var cn=3e3,ln=9229,fe={path:{path:A.Flags.string({description:"The path to the directory of the Hydrogen storefront. Defaults to the current directory where the command is run.",env:"SHOPIFY_HYDROGEN_FLAG_PATH"})},port:{port:A.Flags.integer({description:`The port to run the server on. Defaults to ${cn}.`,env:"SHOPIFY_HYDROGEN_FLAG_PORT"})},force:{force:A.Flags.boolean({description:"Overwrites the destination directory and files if they already exist.",env:"SHOPIFY_HYDROGEN_FLAG_FORCE",char:"f"})},shop:{shop:A.Flags.string({char:"s",description:"Shop URL. It can be the shop prefix (janes-apparel) or the full myshopify.com URL (janes-apparel.myshopify.com, https://janes-apparel.myshopify.com).",env:"SHOPIFY_SHOP",parse:async e=>je(e)})},installDeps:{"install-deps":A.Flags.boolean({description:"Auto installs dependencies using the active package manager.",env:"SHOPIFY_HYDROGEN_FLAG_INSTALL_DEPS",allowNo:!0})},env:{env:A.Flags.string({description:"Specifies the environment to perform the operation using its handle. Fetch the handle using the `env list` command.",exclusive:["env-branch"]})},envBranch:{"env-branch":A.Flags.string({description:"Specifies the environment to perform the operation using its Git branch name.",env:"SHOPIFY_HYDROGEN_ENVIRONMENT_BRANCH",deprecated:{to:"env",message:"--env-branch is deprecated. Use --env instead."}})},envFile:{"env-file":A.Flags.string({description:"Path to an environment file to override existing environment variables. Defaults to the '.env' located in your project path `--path`.",required:!1,default:".env"})},sourcemap:{sourcemap:A.Flags.boolean({description:"Controls whether server sourcemaps are generated. Default to `true`. Deactivate `--no-sourcemaps`.",env:"SHOPIFY_HYDROGEN_FLAG_SOURCEMAP",default:!0,allowNo:!0})},codegen:{codegen:A.Flags.boolean({description:"Automatically generates GraphQL types for your project\u2019s Storefront API queries.",required:!1}),"codegen-config-path":A.Flags.string({description:"Specifies a path to a codegen configuration file. Defaults to `<root>/codegen.ts` if this file exists.",required:!1,dependsOn:["codegen"]})},styling:{styling:A.Flags.string({description:`Sets the styling strategy to use. One of ${ut.map(e=>`\`${e}\``).join(", ")}.`,choices:ut,env:"SHOPIFY_HYDROGEN_FLAG_STYLING"})},markets:{markets:A.Flags.string({description:`Sets the URL structure to support multiple markets. Must be one of: ${dt.map(e=>`\`${e}\``).join(", ")}. Example: \`--markets subfolders\`.`,choices:dt,env:"SHOPIFY_HYDROGEN_FLAG_I18N"})},shortcut:{shortcut:A.Flags.boolean({description:"Creates a global h2 shortcut for Shopify CLI using shell aliases. Deactivate with `--no-shortcut`.",env:"SHOPIFY_HYDROGEN_FLAG_SHORTCUT",allowNo:!0})},debug:{debug:A.Flags.boolean({description:"Enables inspector connections to the server with a debugger such as Visual Studio Code or Chrome DevTools.",env:"SHOPIFY_HYDROGEN_FLAG_DEBUG"})},inspectorPort:{"inspector-port":A.Flags.integer({description:`The port where the inspector is available. Defaults to ${ln}.`,env:"SHOPIFY_HYDROGEN_FLAG_INSPECTOR_PORT"})},entry:{entry:A.Flags.string({description:"Entry file for the worker. Defaults to `./server`.",env:"SHOPIFY_HYDROGEN_FLAG_ENTRY"})},lockfileCheck:{"lockfile-check":A.Flags.boolean({allowNo:!0,default:!0,description:"Checks that there is exactly one valid lockfile in the project. Defaults to `true`. Deactivate with `--no-lockfile-check`.",env:"SHOPIFY_HYDROGEN_FLAG_LOCKFILE_CHECK"})},disableRouteWarning:{"disable-route-warning":A.Flags.boolean({description:"Disables any warnings about missing standard routes.",env:"SHOPIFY_HYDROGEN_FLAG_DISABLE_ROUTE_WARNING"})},customerAccountPush:{"customer-account-push":A.Flags.boolean({description:"Use tunneling for local development and push the tunneling domain to admin. Required to use Customer Account API's OAuth flow",required:!1,env:"SHOPIFY_HYDROGEN_FLAG_CUSTOMER_ACCOUNT_PUSH"})},verbose:{verbose:A.Flags.boolean({description:"Outputs more information about the command's execution.",required:!1,env:"SHOPIFY_HYDROGEN_FLAG_VERBOSE"})}};function xe(e){return Object.entries(e).reduce((t,[o,r])=>(t[Nt(o)]=r,t),{})}function qa(e,t={}){let[,,...o]=e,r={};for(let n=0;n<o.length;n++){let s=o[n],i=o[n+1];if(s?.startsWith("-")){let a=s.replace(/^\-{1,2}/,""),c=!i||i.startsWith("-")?!0:i;c===!0&&a.startsWith("no-")&&(c=!1,a=a.replace("no-","")),r[t[a]||a]=c}}return xe(r)}function Ya(e,t){return Object.entries(t).reduce((o,[r,n])=>(o[r]={...e[r],...n},o),{...e})}l();l();var un=[{pattern:"app is not installed",abort:["Hydrogen sales channel isn't installed","Install the Hydrogen sales channel on your store to start creating and linking Hydrogen storefronts: https://apps.shopify.com/hydrogen"]},{pattern:"Access denied for hydrogenStorefrontCreate field",abort:["Couldn't connect storefront to Shopify",["Common reasons for this error include:",{list:{items:["The Hydrogen sales channel isn't installed on the store.","You don't have the required account permission to manage apps or channels.","You're trying to connect to an ineligible store type (Trial, Development store)"]}}]]},{pattern:"Access denied for hydrogenStorefronts field",abort:["Couldn't access Hydrogen storefronts",["Common reasons for this error include:",{list:{items:["You don't have full access to apps or access to the Hydrogen channel.","The Hydrogen sales channel isn't installed on the store."]}}]]}];async function N(e,t,o){let r="Admin",n=`https://${t.storeFqdn}/admin/api/unstable/graphql.json`;try{return await Bt({query:e,api:r,url:n,token:t.token,variables:o})}catch(s){let i=s.errors;for(let{pattern:a,abort:c}of un)if(i?.some?.(u=>u.message.includes(a)))throw new p(...c);throw s}}l();var fn=/gid:\/\/shopify\/\w*\/(\d+)/;function Bo(e){let t=fn.exec(e);if(t&&t[1]!==void 0)return t[1];throw new p(`Invalid Global ID: ${e}`)}var pn=`#graphql
|
|
9
|
+
query LinkStorefront {
|
|
10
|
+
hydrogenStorefronts {
|
|
11
|
+
id
|
|
12
|
+
title
|
|
13
|
+
productionUrl
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
`;async function Ge(e){let{hydrogenStorefronts:t}=await N(pn,e);return t.map(o=>({...o,parsedId:Bo(o.id)}))}l();var oe=".shopify",pe="project.json";async function zo(e){let t=b(e,oe,pe);await w(t)&&await C(t,JSON.stringify({}))}async function me(e){let t=b(e,oe,pe);return await w(t)?JSON.parse(await R(t)):{}}async function Qo(e,{shop:t,shopName:o,email:r}){let n=b(e,oe,pe),s={};await w(n)?s=JSON.parse(await R(n)):await $e(O(n));let i={...s,shop:t,shopName:o,email:r};return await C(n,JSON.stringify(i)),await Me(e),i}async function Ko(e,{id:t,title:o}){try{let r=b(e,oe,pe),s={...JSON.parse(await R(r)),storefront:{id:t,title:o}};return await C(r,JSON.stringify(s)),await Me(e),s}catch{throw new p("Project configuration could not be found.")}}async function cc(e){try{let t=b(e,oe,pe),r={...JSON.parse(await R(t)),storefront:void 0};return await C(t,JSON.stringify(r)),await Me(e),r}catch{throw new p("Project configuration could not be found.")}}async function Me(e){try{let t=b(e,".gitignore"),o=await w(t)?await R(t):"";return o.includes(".shopify")?!1:(o.length>0&&(o+=`
|
|
17
|
+
`),o+=`${oe}\r
|
|
18
|
+
`,await C(t,o),!0)}catch{return!1}}async function Xo(e,t){try{let o=b(e,oe,pe),r=JSON.parse(await R(o)),n={...r,storefront:{...r.storefront,customerAccountConfig:t}};return await C(o,JSON.stringify(n)),await Me(e),n}catch{throw new p("Project configuration could not be found.")}}l();var mn=`#graphql
|
|
19
|
+
mutation CreateStorefront($title: String!) {
|
|
20
|
+
hydrogenStorefrontCreate(title: $title) {
|
|
21
|
+
hydrogenStorefront {
|
|
22
|
+
id
|
|
23
|
+
title
|
|
24
|
+
productionUrl
|
|
25
|
+
}
|
|
26
|
+
userErrors {
|
|
27
|
+
code
|
|
28
|
+
field
|
|
29
|
+
message
|
|
30
|
+
}
|
|
31
|
+
jobId
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
`;async function Zo(e,t){let{hydrogenStorefrontCreate:{hydrogenStorefront:o,userErrors:r,jobId:n}}=await N(mn,e,{title:t});if(!o||!n||r.length>0){let s=r.map(({message:i})=>i).join(", ");throw new p("Could not create storefront. "+s)}return{jobId:n,storefront:o}}l();import{setTimeout as dn}from"node:timers/promises";var gn=`#graphql
|
|
35
|
+
query FetchJob($id: ID!) {
|
|
36
|
+
hydrogenStorefrontJob(id: $id) {
|
|
37
|
+
id
|
|
38
|
+
done
|
|
39
|
+
errors {
|
|
40
|
+
code
|
|
41
|
+
message
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
`;async function hn(e,t){let{hydrogenStorefrontJob:o}=await N(gn,e,{id:t});return o}async function er(e,t){for(;;){await dn(500);let o=await hn(e,t);if(o.errors.length>0)throw new p(`Storefront setup failed: ${o.errors.map(({message:r,code:n})=>r||n).join(", ")}`);if(o.done)return}}l();function Ve(e=""){return e.replace(/[\W_]+/g," ").split(" ").filter(t=>t.length>0).map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(" ")}l();import gt from"node:os";var L="h2",ht=()=>gt.platform()==="win32",tr=()=>!!process.env.MINGW_PREFIX;function yt(e){return e[0]==="~"?g(gt.homedir(),e.slice(1)):e}function yn(e){try{return w(yt(e))}catch{return!1}}async function wn(e){try{return await D(`which ${e}`),!0}catch{return!1}}function or(e){return e==="bash"?"~/.bashrc":e==="zsh"?"~/.zshrc":`~/.config/fish/functions/${L}.fish`}async function rr(e,t){let o=or(t);try{return t==="fish"?await yn(o):!!(await D(`grep 'alias ${e}' ${yt(o)}`)).stdout}catch{return!1}}async function Sn(e,t,o=!1){let r=or(e);t=`"${t}"`,t=t.replaceAll(`
|
|
46
|
+
`,"\\n"),ht()||(t=t.replaceAll("$","\\$"));try{return await D(`printf ${t} ${o?">>":">"} ${yt(r)}`),!0}catch(n){return I(`Could not create or modify ${r}:
|
|
47
|
+
`+n.stack),!1}}async function vn(e,t,o){return await wn(e)?await rr(t,e)?"exists":await Sn(e,o,e!=="fish")?"created":!1:!1}async function bn(e,t){try{let{stdout:o}=await D(e,{shell:t});return o.trim()==="created"?"created":"exists"}catch(o){return I(`Could not run shell script for ${t}:
|
|
48
|
+
`+o.stack),!1}}function xn(e){return["zsh","bash","fish"].includes(e)}async function Pn(){try{if(ht()&&!tr())await D(`Get-Alias -Name ${L}`);else{let e=gt.userInfo().shell?.split("/").pop()??"bash";return xn(e)?await rr(L,e):!1}return!0}catch{return!1}}async function nr(){return ht()&&!tr()?await On():await Cn()}var En=`
|
|
49
|
+
# Shopify Hydrogen alias to local projects
|
|
50
|
+
alias ${L}='$(npm prefix -s)/node_modules/.bin/shopify hydrogen'
|
|
51
|
+
`,Rn=`
|
|
52
|
+
function ${L} --wraps='shopify hydrogen' --description 'Shortcut for the Hydrogen CLI'
|
|
53
|
+
set npmPrefix (npm prefix -s)
|
|
54
|
+
$npmPrefix/node_modules/.bin/shopify hydrogen $argv
|
|
55
|
+
end
|
|
56
|
+
`;async function Cn(){let e=[],t=!1;for(let o of["zsh","bash","fish"]){let r=await vn(o,L,o==="fish"?Rn:En);r&&e.push(o),r==="created"&&(t=!0)}return{shells:e,changed:t}}var An=`function Invoke-Local-H2 {$npmPrefix = npm prefix -s; Invoke-Expression "$npmPrefix\\node_modules\\.bin\\shopify.ps1 hydrogen $Args"}; Set-Alias -Name ${L} -Value Invoke-Local-H2`,kn=`
|
|
57
|
+
$ErrorActionPreference = 'Stop'
|
|
58
|
+
if (!(Test-Path -Path $PROFILE)) {
|
|
59
|
+
New-Item -ItemType File -Path $PROFILE -Force | Out-Null
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
$profileContent = Get-Content -Raw -Path $PROFILE
|
|
63
|
+
if (!$profileContent -or $profileContent -NotLike '*Invoke-Local-H2*') {
|
|
64
|
+
Add-Content -Path $PROFILE -Value '${An}'
|
|
65
|
+
Write-Output 'created'
|
|
66
|
+
} else {
|
|
67
|
+
Write-Output 'exists'
|
|
68
|
+
}
|
|
69
|
+
`;async function On(){let e=[],t=!1;for(let[o,r]of[["PowerShell","powershell.exe"],["PowerShell 7+","pwsh.exe"]]){let n=await bn(kn,r);n&&e.push(o),n==="created"&&(t=!0)}return{shells:e,changed:t}}async function qe(e=process.cwd(),t){if(await Pn())return L;let o="npx",r=t??await Xt(e).catch(()=>null);return(r==="bun"||r==="pnpm"||r==="yarn")&&(o=r),`${o} shopify hydrogen`}l();l();var $n=`#graphql
|
|
70
|
+
query currentUserAccount {
|
|
71
|
+
currentUserAccount {
|
|
72
|
+
email
|
|
73
|
+
organizations(first: 100) {
|
|
74
|
+
edges {
|
|
75
|
+
node {
|
|
76
|
+
id
|
|
77
|
+
name
|
|
78
|
+
categories(handles: STORES) {
|
|
79
|
+
destinations(first: 100) {
|
|
80
|
+
edges {
|
|
81
|
+
node {
|
|
82
|
+
...destinationFields
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
pageInfo {
|
|
86
|
+
endCursor
|
|
87
|
+
hasNextPage
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
pageInfo {
|
|
94
|
+
endCursor
|
|
95
|
+
hasNextPage
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
orphanDestinations {
|
|
99
|
+
categories(handles: STORES) {
|
|
100
|
+
destinations(first: 100) {
|
|
101
|
+
edges {
|
|
102
|
+
node {
|
|
103
|
+
...destinationFields
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
pageInfo {
|
|
107
|
+
endCursor
|
|
108
|
+
hasNextPage
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
fragment destinationFields on Destination {
|
|
117
|
+
name
|
|
118
|
+
status
|
|
119
|
+
webUrl
|
|
120
|
+
}
|
|
121
|
+
`;async function ir(e){let{currentUserAccount:t}=await zt($n,e);if(!t)throw new p("Unable to get current user account");return{email:t.email,activeShops:[...t.organizations?.edges?.flatMap(o=>o.node?.categories.flatMap(r=>r?.destinations?.edges?.map(n=>n.node)))??[],...t.orphanDestinations?.categories?.flatMap(o=>o.destinations?.edges?.map(r=>r.node))??[]].filter(({status:o})=>o==="ACTIVE").map(({name:o,webUrl:r})=>({name:o,fqdn:r.replace(/^https?:\/\//,"").replace(/\/admin$/,"")}))}}l();l();function de({host:e="",graphql:t}){let o=`${e.endsWith("/")?e.slice(0,-1):e}/graphiql`;if(t){let{query:r,variables:n}=t;typeof n!="string"&&(n=JSON.stringify(n)),o+=`?query=${encodeURIComponent(r)}${n?`&variables=${encodeURIComponent(n)}`:""}`,t.schema&&(o+=`&schema=${t.schema}`)}return o}var qc={...console},sr=new Set,ar=new Set,cr=[];function Pe(e,...t){ar.has(e)||(ar.add(e),cr.push(...t))}var wt=new Set;function In(e,t){let o=e.map(r=>{let n=r?.message??r;return typeof n=="string"?n:""}).filter(Boolean).join("");return wt.has(o)?!0:(wt.add(o),t!==!0&&setTimeout(()=>wt.delete(o),t??1e3),!1)}function Ee([e]){return typeof e=="string"&&/\[h2:(warn|info):(createStorefrontClient|createCustomerAccountClient)\]/.test(e)?!0:void 0}function W(e,t){if(!sr.has(e)){sr.add(e);let o=console[e];console[e]=(...r)=>{if(t!==!1&&In(r,t?.(r)))return;let n=cr.reduce((i,[a,c])=>(a(r,i.length)&&i.push(c),i),[]);if(n.length===0)return o(...r);let s=n.reduce((i,a)=>i&&a(i),r);if(s)return o(...s)}}}function Yc({workerReload:e}={}){W("log"),W("error"),W("warn",Ee),W("debug",!1);let t=!0;Pe("dev-node",[([i])=>typeof i=="string"&&i.includes("[mf:"),i=>{let a=i[0];if(e!==!1&&a.includes("Worker reloaded")){if(t){t=!1;return}return[a.replace("[mf:inf] ","\u{1F504} ")+`
|
|
122
|
+
`,...i.slice(1)]}a.includes("[mf:err]")}]),Pe("dev-workerd",[([i])=>typeof i=="string"&&/^\x1B\[31m(workerd\/|stack:( (0|[a-f\d]{4,})){3,})/.test(i),()=>{}],[([i])=>typeof i=="string"&&/\$LLVM_SYMBOLIZER|recursive isolate lock/.test(i),()=>{}],[([i])=>typeof i=="string"&&/^A promise rejection/i.test(i),()=>{}],[([i])=>typeof i=="string"&&/resolved to multiple addresses/i.test(i),()=>{}],[([i])=>{let a=i?.message??i;return typeof a=="string"&&/^Network connection lost/i.test(a)},()=>{}]);let o=!1,r=!1;Pe("dev-vite",[([i])=>typeof i=="string"&&/^Sourcemap for .*@remix-run/i.test(i),()=>{}],[([i])=>typeof i=="string"&&/^\[vite\] (connected|program reload)/i.test(i),()=>{}],[([i])=>typeof i=="string"&&/^Re-optimizing dependencies because/i.test(i),()=>{}],[([i])=>{let a=i?.message??i;return/virtual-routes/.test(a)&&/(Failed to load url|Could not resolve module for file)/i.test(a)},()=>{}],[([i])=>typeof i=="string"&&/^Generated an empty chunk:/i.test(i),()=>{}],[([i],a)=>{if(a===0&&typeof i=="string"){let c=/^\s+[A-Z]+\s+\d{3}\s+[a-z]+\s+\//.test(i.replace(/\u001b\[.*?m/g,""));!X()&&!o&&(c&&!r||!c&&r)&&process.stdout.write(`
|
|
123
|
+
`),r=c,o=/\n$/.test(i)}return!1},i=>i]);let n=process.stderr.write,s=setTimeout(()=>{process.stderr.write=n},5e3);process.stderr.write=(...i)=>typeof i[0]=="string"&&i[0].includes("Could not find ts-node")?(clearTimeout(s),process.stderr.write=n,!1):n.apply(process.stderr,i)}function Ye(e=!1){X()||(W("log",Ee),Pe("auth",[([t])=>e&&typeof t=="string"&&t.includes("To run this command,"),([t])=>{}],[([t])=>typeof t=="string"&&t.includes("Logged in."),()=>{process.stdout.write(ro.eraseLines(e?5:6))}]))}function Jc(e){W("error"),W("warn",Ee),W("log",Ee),W("info",Ee),Pe("h2-warn",[([t])=>{let o=t?.message??t;return typeof o=="string"&&o.includes("[h2:")},t=>{let o=t[0],r=typeof o=="object"&&o.stack?o:void 0,n=r?.message??o;n.startsWith("[h2:info:createStorefrontClient]")&&n.includes("defaulting to mock.shop")&&(n+="\nRun `h2 link` to link your store.");let[,s,i,a]=n.match(/\[h2:([^:]+):([^\]]+)\]\s+(.*)$/ims)||[];if(!s||!i||!a)return t;let c=`In Hydrogen's \`${i.trim()}\`:
|
|
124
|
+
|
|
125
|
+
`,u=a.split(`
|
|
126
|
+
`),f=u.at(-1)??"",m=/https?:\/\//.test(f),d=/`h2 [^`]+`/.test(f);if(d&&f&&(f=f.replace(/`(h2) ([^`]+)`/g,E.magentaBright(`\`${e.cliCommand??"$1"} $2\``))),(m||d)&&u.pop(),s==="error"||r){let v=m||d?f:void 0,y=r?.stack,P=r?.cause;if(typeof P=="string")try{P=JSON.parse(P)}catch{}if(typeof P!="string"&&P?.graphql?.query){let z=de({host:e.host,graphql:P.graphql}),[,_t,he]=P.graphql.query.match(/(query|mutation)\s+(\w+)/)||[];v=(v?`${v}
|
|
127
|
+
|
|
128
|
+
`:"")+ae`To debug the ${_t||"query"}${he?` \`${E.whiteBright(he)}\``:""}, try it in ${J.link(E.bold("GraphiQL"),z)}.`.value}let k=y?.split(`
|
|
129
|
+
`)??[],$=z=>z.includes(e.rootDirectory)&&!z.includes("node_modules"),_=k.findIndex($),H=k.length-[...k].reverse().findIndex($);_>0&&H>_&&(y=[k[0],...k.slice(_,H)].join(`
|
|
130
|
+
`).trim()||void 0);let j=new Fe(c+E.bold(u.join(`
|
|
131
|
+
`).replace(" - Request",`
|
|
132
|
+
Request`)),v);j.cause=P,j.stack=y,no(j);return}let h;if(m){h=[];for(let v of f.matchAll(/https?:\/\/[^\s]+/g))h.push(v[0])}(s==="warn"?Y:q)({body:c+E.bold(u.join(`
|
|
133
|
+
`)),reference:h,nextSteps:d?[f]:void 0})}])}function Wc(){!process.env.DEBUG||process.env.DEBUG==="*"?process.env.DEBUG="h2:*,o2:*":process.env.DEBUG+=",h2:*,o2:*"}function Bc(){return!!(process.env.DEBUG==="*"||process.env.DEBUG?.includes("h2:*"))}async function nl(e){await Wt(),await zo(e)}async function B(e,t){Ye(!1);let o=t===!0,r=e?await me(e):{},{email:n,shopName:s}=r;if(typeof t!="string"&&(t=r.shop),t&&(t=await je(t)),!t||!s||!n||o||t!==r.shop){let c=await Jt().catch(()=>{throw new p("Unable to authenticate with Shopify. Please report this issue.")}),u=await ir(c),m=!o&&t&&u.activeShops.find(({fqdn:d})=>t===d)||await G({message:"Select a shop to log in to",choices:u.activeShops.map(({name:d,fqdn:h})=>({label:`${d} (${h})`,value:{name:d,fqdn:h}}))});t=m.fqdn,s=m.name,n=u.email}let i=await Yt(t).catch(()=>{throw new p("Unable to authenticate with Shopify",void 0,[`Ensure the shop that you specified is correct (you are trying to use: ${t})`])}),a=e?await Qo(e,{shop:t,shopName:s,email:n}):{shop:t,shopName:s,email:n};return{session:i,config:a}}function lr(e){ie({headline:"Shopify authentication complete",body:["You are logged in to",{userInput:e.shopName??e.shop??"your store"},...e.email?["as",{userInput:e.email}]:[]]})}l();import{symlink as zn,readdir as Qn}from"node:fs/promises";l();import{readdir as hr}from"node:fs/promises";l();import{createRequire as _n}from"module";function ur(e){return e.replace(/(^|\.)_index$/,"$1index").replace(/\.(?!\w+\])/g,"/")}function cl(){try{return _n(import.meta.url).resolve("@remix-run/v1-route-convention/package.json"),!0}catch{return!1}}l();import{createRequire as Un}from"node:module";import Je from"node:path";l();l();var fr="Classic Remix Compiler projects are no longer supported, please upgrade to Vite by running 'npx shopify hydrogen setup vite'";async function Tn(e){return!!(await T(e,"vite.config")).filepath}async function vt(e){let t=await Tn(e);return t&&await St(e)&&Y({headline:"Both Vite and Remix config files found.",body:"The remix.config.js file is not used in Vite projects. Please remove it to avoid conflicts."}),t}async function pr(e,t){let o=await So(e),r="build",n=process.env.NODE_ENV||"production",s=await o.loadConfigFromFile({command:r,mode:n,isSsrBuild:!0},void 0,e);if(!s||!s.path)throw new Error("No Vite config found");let i=await o.resolveConfig({root:e,build:{ssr:!0}},r,n,n),{appDirectory:a,clientOutDir:c,serverBuildFile:u,serverOutDir:f,routes:m}=Fn(i),d=i.build.rollupOptions.output,{entryFileNames:h}=(Array.isArray(d)?d[0]:d)??{},x=g(f,typeof h=="string"?h:u??"index.js"),v=t??i.build.ssr,y=b(i.root,typeof v=="string"?v:"server");return{clientOutDir:c,serverOutDir:f,serverOutFile:x,resolvedViteConfig:i,userViteConfig:s.config,remixConfig:{routes:m??{},appDirectory:a??g(i.root,"app"),rootDirectory:i.root,serverEntryPoint:(await T(O(y),K(y))).filepath||y}}}function jn({routingBuildDirectory:e,serverEnvironmentOutDir:t,clientEnvironmentOutDir:o,buildOutDir:r}){if(e)return{clientOutDir:g(e,"client"),serverOutDir:g(e,"server")};let n=t??r;return{clientOutDir:o&&o!==n?o:n.replace(/server$/,"client"),serverOutDir:n}}function Fn(e){let t=Nn(e)??Ln(e),{clientOutDir:o,serverOutDir:r}=jn({routingBuildDirectory:t?.buildDirectory,serverEnvironmentOutDir:e.environments?.ssr?.build.outDir,clientEnvironmentOutDir:e.environments?.client?.build.outDir,buildOutDir:e.build.outDir});return{...t,clientOutDir:o,serverOutDir:r}}function Nn(e){if(!e.__reactRouterPluginContext)return;let{appDirectory:t,buildDirectory:o,serverBuildFile:r,routes:n}=e.__reactRouterPluginContext.reactRouterConfig;return{appDirectory:t,buildDirectory:o,serverBuildFile:r,routes:n}}function Ln(e){let{remixConfig:t}=Dn(e)?.api?.getPluginOptions()??{};if(t)return{appDirectory:t.appDirectory,serverBuildFile:t.serverBuildFile,routes:t.routes}}function mr(e,t){return e.plugins.find(o=>o.name===t)}function Dn(e){return mr(e,"hydrogen:main")}function Sl(e){return mr(e,"oxygen:main")}async function St(e){return!!(await T(e,"remix.config")).filepath}async function $l(e){return await vt(e)?!1:St(e)}var Hn="dist",Gn="client",Mn="worker";function Il(e){let t=e??process.cwd(),o=Je.join(t,"public"),r=Je.join(t,Hn),n=Je.join(r,Gn),s=Je.join(r,Mn,"index.js");return{root:t,buildPath:r,buildPathClient:n,buildPathWorkerFile:s,publicPath:o}}function _l(e){return T(e,"remix.config").then(({filepath:t})=>{if(!t)throw new p("No remix.config.js file found.");return Un(import.meta.url)(t)})}async function dr(e,t=process.env.NODE_ENV){if(!await vt(e))throw new p(fr);return(await pr(e)).remixConfig}var Vn=[/robots\.txt/],xt={home:["_index","$"],page:"pages*",cart:["cart","cart.$lines","discount.$code"],products:"products*",collections:"collections*",policies:"policies*",blogs:"blogs*",account:"account*",search:["search","api.predictive-search"],robots:"[robots.txt]",sitemap:["[sitemap.xml]","sitemap.$type.$page[.xml]"]},bt=[];async function gr(e=Object.keys(xt)){bt.length===0&&(bt=(await hr(await ve(Z))).map(r=>r.replace(/\.tsx?$/,"")));let t={},o=[];for(let r of e){t[r]=[];let n=xt[r];if(!n)throw new p(`No route found for ${r}. Try one of ${qn.join()}.`);let s=Array.isArray(n)?n:[n];for(let i of s){let a=i.replace("*","");t[r].push(...bt.filter(c=>c.startsWith(a)))}o.push(...t[r])}return{routeGroups:t,resolvedRouteFiles:o}}var qn=[...Object.keys(xt),"all"];async function yr(e,t){let{routeGroups:o,resolvedRouteFiles:r}=e.routeName==="all"?await gr():await gr([e.routeName]),{rootDirectory:n,appDirectory:s}=t||await dr(e.directory),i=r.flatMap(d=>Z+"/"+d),a=await V(n),c=g(s,Z),u=await Yn(c,e),f=!!(e.typescript??await w(g(n,"tsconfig.json")));if(!e.force&&e.overwriteFileDeps!==!1&&!so())for(let d of i){let h=g(s,Sr(d,u,e)+(f?".tsx":".jsx"));if(await w(h))throw new p("Generating routes requires confirmation before replacing existing files.","Use --force to replace them, or run in an interactive terminal.")}let m=[];for(let d of i)m.push(await Pt(d,{...e,typescript:f,localePrefix:u,rootDirectory:n,appDirectory:s,formatOptions:a}));return u&&m.push(await Wn({typescript:f,localePrefix:u,routesDirectory:c,rootDirectory:n,formatOptions:a,adapter:e.adapter,force:e.force})),{routes:m,routeGroups:o,isTypescript:f,formatOptions:a}}async function Yn(e,{localePrefix:t,routeName:o,v1RouteConvention:r}){if(t)return t;if(t!==void 0||o==="all")return;let n=await hr(e).catch(()=>[]),s=r?/^\(\$(\w+)\)$/:/^\(\$(\w+)\)\.(_index|\$|cart).[jt]sx?$/,i=n.find(a=>s.test(a));if(i)return i.match(s)?.[1]}async function Pt(e,{rootDirectory:t,appDirectory:o,typescript:r,force:n,adapter:s,templatesRoot:i,formatOptions:a,localePrefix:c,v1RouteConvention:u=!1,signal:f,overwriteFileDeps:m=!0}){i??=await at();let d=(e.match(/(\.[jt]sx?)$/)??[])[1]??".tsx";e=e.replace(d,"");let h=g(o,Sr(e,c,{v1RouteConvention:u})+(r?d:d.replace(".ts",".js"))),x=await w(h),v={operation:x?"replaced":"created",sourceRoute:e,destinationRoute:Qe(h,t)};if(!n&&x&&m&&!await M({message:`The file ${v.destinationRoute} already exists. Do you want to replace it?`,defaultValue:!1,confirmationMessage:"Yes",cancellationMessage:"No",abortSignal:f}))return{...v,operation:"skipped",skipReason:"declined"};let y=await ve(e+d,i),P=await Jn(y,await ve("",i));for(let k of P){let $=k.startsWith(Z+"/"),_=$?h:g(o,k.replace(/\.ts(x?)$/,`.${r?"ts$1":"js$1"}`));if(!m&&await w(_)){$&&(v.operation="skipped",v.skipReason="exists");continue}await w(O(_))||await $e(O(_));let H=await ve(k,i);if(!/\.[jt]sx?$/.test(k)){await ne(H,_);continue}let j=await R(H);r||(j=await te(j,H)),s&&(j=wr(j,s)),j=await ee(j,a,_),await C(_,j)}return v}function wr(e,t){return e.replace(/(from\s+['"])react-router(['"])/g,`$1${t}$2`)}function Sr(e,t,o){let r=e.replace(Z+"/",""),n=t&&!Vn.some(s=>s.test(r))?`($${t})`+(o.v1RouteConvention?"/":"."):"";return Z+"/"+n+(o.v1RouteConvention?ur(r):r)}async function Jn(e,t){let o=new Set([e]),r=new Set([Q(t,e)]);for(let n of o){let s=(await R(n,{encoding:"utf8"})).matchAll(/^(import|export)\s+.*?\s+from\s+['"](.*?)['"];?$/gims);for(let[,,i]of s){if(!i||!/^(\.|~)/.test(i)||(i=i.replace(/\?[a-z.]+$/,""),i=i.replace("~",Q(O(n),t)||"."),i.includes("/+types/")))continue;let a=b(O(n),i),c=(await T(O(a),K(a))).filepath||a;c.includes(`/${Z}/`)||(r.add(Q(t,c)),/\.[jt]sx?$/.test(c)&&o.add(c))}}return[...r]}function Wn({typescript:e,localePrefix:t,...o}){return Bn({...o,typescript:e,templateName:"locale-check.ts",routeName:`($${t})${e?".tsx":".jsx"}`})}async function Bn({rootDirectory:e,templateName:t,routeName:o,routesDirectory:r,formatOptions:n,typescript:s,adapter:i,force:a}){let c=g(r,o),u=await w(c),f={sourceRoute:"routes/"+t.replace(/\.tsx?$/,""),destinationRoute:Qe(c,e),operation:u?"replaced":"created"};if(u&&!a)return{...f,operation:"skipped",skipReason:"exists"};let m=await U("routes",t);if(!await w(m))throw new Error("Unknown strategy");let d=await R(m);return i&&(d=wr(d,i)),s||(d=await te(d,m)),d=await ee(d,n,c),await C(c,d),f}var Kn={js:"JavaScript",ts:"TypeScript"};async function wu(e,t,o){let r=o??await Wo({abortSignal:e.signal,extraChoices:{none:"Set up later "+E.dim(`(run \`${t} setup markets\`)`)}}),n=r==="none"?void 0:r;return{i18nStrategy:n,setupI18n:async s=>{n&&await Jo(n,s)}}}function Su(e){return{setupRoutes:async(t,o,r)=>await yr({routeName:"all",directory:t,force:!0,typescript:o==="ts",localePrefix:r?.i18nStrategy==="subfolders"?"locale":!1,signal:e.signal,...r},{rootDirectory:t,appDirectory:g(t,"app")})}}function vu(e){return Promise.all(["routes.ts","root","entry.server","entry.client","../server.ts"].map(t=>Pt(t,e)))}async function bu(e,t,o){return t===L?{}:o??await M({confirmationMessage:"Yes",cancellationMessage:"No",message:["Create a global",{command:L},"alias to run commands instead of",{command:t},"?"],abortSignal:e.signal})?{createShortcut:async()=>{try{let{shells:n}=await nr();return n.length>0}catch(n){return I("Failed to create shortcut."+(n?.stack??n?.message??n)),!1}},showShortcutBanner:()=>q({body:`You'll need to restart your terminal session to make \`${L}\` alias available.`})}:{}}async function xu(e){Ye(!0);let{session:t,config:o}=await B();X()||lr(o);let r=await Ge(t),n=await Et(r),s;return n?s=n.title:s=await se({message:"New storefront name",defaultValue:Ve(o.shopName),abortSignal:e.signal}),{...o,id:n?.id,title:s,session:t}}async function Et(e){let t=[{label:"Create a new storefront",value:null},...e.map(({id:r,title:n,productionUrl:s})=>({label:`${n} (${s})`,value:r}))];if(t.length===1)return;let o=await G({message:"Select a Hydrogen storefront to link",choices:t});return o?e.find(({id:r})=>r===o):void 0}async function Pu({storefrontInfo:e,controller:t,force:o,path:r}){let n=e&&Lt(e.title),s=r??n??await se({message:"Where would you like to create your storefront?",defaultValue:"hydrogen-storefront",abortSignal:t.signal}),i=b(process.cwd(),s);if(await vr(i)){if(!o&&n&&(s=await se({message:`There's already a folder called \`${n}\`. Where do you want to create the app?`,defaultValue:n,abortSignal:t.signal}),i=b(process.cwd(),s),await vr(i)||(o=!0)),!o&&!await M({message:`The directory ${E.cyan(s)} is not empty. Do you want to delete the existing files and continue?`,defaultValue:!1,abortSignal:t.signal})){q({body:`Destination path ${E.cyan(s)} already exists and is not an empty directory. You may use \`--force\` or \`-f\` to override it.`});return}await Xe(i,{force:!0})}return{name:K(s),location:s,directory:i,storefrontTitle:e?.title}}async function Eu(e,t,o){let r=o??await G({message:"Select a language",choices:[{label:"JavaScript",value:"js"},{label:"TypeScript",value:"ts"}],defaultValue:"js",abortSignal:t.signal});return{language:r,async transpileProject(){r!=="ts"&&await pt(e)}}}async function Ru(e,t,o){let r=o??await Vo({abortSignal:t.signal,extraChoices:{none:"Skip and set up later"}}),n=r==="none"?void 0:r;return{cssStrategy:n,async setupCss(){if(n){if(n==="postcss"||n==="css-modules")return;let s=await Mo(n,{rootDirectory:e,appDirectory:g(e,"app")},!0);s&&await s.workPromise}}}}async function Cu(e,t,o,r){let n=o??Kt();n==="homebrew"&&(n="npm");let s="npm";if(r!==!1)if(n==="unknown"){let i=await G({message:"Select package manager to install dependencies",choices:[{label:"NPM",value:"npm"},{label:"PNPM",value:"pnpm"},{label:"Yarn v1",value:"yarn"},{label:"Skip and install later",value:"no"}],defaultValue:"npm",abortSignal:t.signal});i==="no"?r=!1:(s=i,r=!0)}else r===void 0?(s=n,r=await M({message:`Install dependencies with ${n}?`,confirmationMessage:"Yes",cancellationMessage:"No",abortSignal:t.signal})):s=n;return Se&&(await ne(g(De(),".npmrc"),g(e,".npmrc")).catch(()=>{}),r||await zn(await _o(),g(e,"node_modules")).catch(()=>{})),{packageManager:s,shouldInstallDeps:r,installDeps:r?async()=>{await Zt({directory:e,packageManager:s,args:[],signal:t.signal})}:()=>{}}}var Xn=`
|
|
134
|
+
node_modules
|
|
135
|
+
/.cache
|
|
136
|
+
/build
|
|
137
|
+
/dist
|
|
138
|
+
/public/build
|
|
139
|
+
/.mf
|
|
140
|
+
.env
|
|
141
|
+
.shopify
|
|
142
|
+
.react-router
|
|
143
|
+
`.slice(1);async function Au(e){try{return await uo(e),await C(g(e,".gitignore"),Xn),process.env.NODE_ENV==="test"&&process.env.CI&&(await D('git config --global user.name "hydrogen"'),await D('git config --global user.email "hydrogen@shopify.com"')),Zn(e,"Scaffold Storefront")}catch(t){I(`Failed to initialize Git.
|
|
144
|
+
`+(t?.stack??t?.message??t))}}async function Zn(e,t){try{await fo(e),await po(t,{directory:e})}catch(o){I(`Failed to commit code.
|
|
145
|
+
`+(o?.stack??o?.message??o))}}async function ku(e,{language:t,packageManager:o,depsInstalled:r,cssStrategy:n,cliCommand:s,routes:i,i18n:a,depsError:c,i18nError:u,routesError:f}){let m=!!(c||u||f),d=[];e.storefrontTitle&&d.push(["Shopify",e.storefrontTitle]),t&&d.push(["Language",Kn[t]]),n&&n!=="none"&&d.push(["Styling",ft[n]]),!u&&a&&a!=="none"&&d.push(["Markets",mt[a].split(" (")[0]]);let h="";if(!f&&i&&Object.keys(i).length){d.push(["Routes",""]);for(let[y,P]of Object.entries(i)){P=Array.isArray(P)?P:[P];let k=[...new Set(P.map($=>"/"+ei($)))].sort();k.length>2&&(k=[...new Set(k.map(_=>_.split("/")[1]??""))].map(_=>"/"+_+"/*")),h+=`
|
|
146
|
+
\u2022 ${jt(y)} ${E.dim("("+k.join(" & ")+")")}`}}let x=1+d.reduce((y,[P])=>Math.max(y,P.length),0);(m?Y:ie)({headline:"Storefront setup complete"+(m?" with errors (see warnings below).":"!"),body:d.map(([y,P])=>` ${(y+":").padEnd(x," ")} ${E.dim(P)}`).join(`
|
|
147
|
+
`)+h,customSections:[m&&{title:`Warnings
|
|
148
|
+
`,body:[{list:{items:[c&&["Failed to install dependencies:",{subdued:c.message}],u&&["Failed to scaffold Markets:",{subdued:u.message}],f&&["Failed to scaffold routes:",{subdued:f.message}]].filter(y=>!!y)}}]},{title:`Next steps
|
|
149
|
+
`,body:[{list:{items:[["Run",{command:[e.directory===process.cwd()?void 0:`cd ${e.location.replace(/^\.\//,"")}`,r?void 0:`${o} install`,Qt()?"npm run dev":ao(o,"dev")].filter(Boolean).join(" && ")}]].filter(y=>!!y)}}]}].filter(y=>!!y)})}function Ou(e,t){return async function(r){e.abort(),await Promise.resolve(),t?.directory&&await Xe(t.directory,{force:!0}).catch(()=>{});let n=new p("Failed to initialize project: "+(r?.message??""),r?.tryMessage??r?.stack);if(await oo(n),process.env.SHOPIFY_UNIT_TEST&&process.exit.name!=="spy")throw console.error("Error during test before process.exit:",r),r;process.exit(1)}}async function vr(e){return await w(e)&&await _e(e)&&(await Qn(e)).length>0}function ei(e){return e.replace(/(^|\.)_index$/,"").replace(/((^|\.)[^\.]+)_\./g,"$1.").replace(/\.(?!\w+\])/g,"/").replace(/\$$/g,":catchAll").replace(/\$/g,":").replace(/[\[\]]/g,"").replace(/:\w*Handle/i,":handle")}function br(){function e(r){return r[Math.floor(Math.random()*r.length)]}let t=e(["Bay","Bend","Cape","Cliff","Cove","Creek","Dale","Dune","Fjord","Glade","Gulf","Hill","Isle","Knoll","Lake","Loch","Mesa","Peak","Pond","Quay","Reef","Ridge","Rise","River","Road","Shore","Strait","Stream","Vale","Valley","View","Vista"]);return`${e(["Crimson","Azure","Coral","Fuchsia","Indigo","Ivory","Lavender","Lime","Magenta","Maroon","Orchid","Peach","Plum","Quartz","Salmon","Teal","Turquoise","Violet","Yellow","Ebony","Jade","Lilac","Mint","Onyx","Pearl","Ruby","Sapphire","Topaz"])} ${t}`}var xr=class e extends le{static get jsonOutputSchema(){return nt}static descriptionWithMarkdown=`Links your local development environment to a remote Hydrogen storefront. You can link an unlimited number of development environments to a single Hydrogen storefront.
|
|
150
|
+
|
|
151
|
+
Linking to a Hydrogen storefront enables you to run [dev](https://shopify.dev/docs/api/shopify-cli/hydrogen/hydrogen-dev) and automatically inject your linked Hydrogen storefront's environment variables directly into the server runtime.
|
|
152
|
+
|
|
153
|
+
After you run the \`link\` command, you can access the [env list](https://shopify.dev/docs/api/shopify-cli/hydrogen/hydrogen-env-list), [env pull](https://shopify.dev/docs/api/shopify-cli/hydrogen/hydrogen-env-pull), and [unlink](https://shopify.dev/docs/api/shopify-cli/hydrogen/hydrogen-unlink) commands.`;static description=this.descriptionForHelp();static flags={...ce,...fe.force,...fe.path,...fe.shop,storefront:We.Flags.string({description:`The name of a Hydrogen Storefront (e.g. "Jane's Apparel")`,env:"SHOPIFY_HYDROGEN_STOREFRONT",exclusive:["create-storefront","name"]}),"create-storefront":We.Flags.boolean({description:"Create a new Hydrogen storefront.",env:"SHOPIFY_HYDROGEN_FLAG_CREATE_STOREFRONT",exclusive:["storefront"]}),name:We.Flags.string({description:"The name to use when creating a new Hydrogen storefront.",env:"SHOPIFY_HYDROGEN_FLAG_NAME",exclusive:["storefront"]})};async run(){let{flags:t}=await this.parse(e);await ti(xe(t),t.json)}};async function ti({createStorefront:e,force:t,path:o=process.cwd(),shop:r,storefront:n,name:s},i){let[{session:a,config:c},u]=await Promise.all([B(o,r),qe()]),f=await Rt(o,a,c,{force:t,flagCreateStorefront:e,flagStorefront:n,storefrontName:s,cliCommand:u}),m={status:f?"success":"cancelled",changed:!!f,storeDomain:Ne(a.storeFqdn),storefront:f?rt(f):null};return Le(nt,m,i)||!f||ie({body:[{userInput:f.title},"is now linked"],nextSteps:[["Run",{command:`${u} dev`},"to start your local development server and start building"]]}),m}async function Rt(e,t,o,{force:r=!1,flagCreateStorefront:n,flagStorefront:s,storefrontName:i,cliCommand:a,storefronts:c}){if(i=i?.trim()||void 0,s&&(n||i))throw new p("`--storefront` cannot be used with storefront creation flags.","Use `--storefront` to link an existing storefront or `--name` to create a new one.");if(!o.shop)throw new p("No shop found in local config, login first.");if(o.storefront?.id&&!r&&!await M({message:`Your project is currently linked to ${o.storefront.title}. Do you want to link to a different Hydrogen storefront on Shopify?`}))return;c||(c=await Ge(t));let u;if(s){if(u=c.find(({title:f})=>f===s),!u)throw new p(`Couldn't find ${s}`,`No storefront with that name exists on ${o.shop}. Run ${a} list to see available storefronts.`)}else n||i?u=await Pr(e,t,c,i):(u=await Et(c),u||(u=await Pr(e,t,c)));return await Ko(e,u),u}async function Pr(e,t,o,r){let n=K(e),s=Ve(n);o.some(({title:f})=>f===s)&&(s=br());let a=r??await se({message:"New storefront name",defaultValue:s}),c,u;if(await io([{title:"Creating storefront",task:async()=>{let f=await Zo(t,a);c=f.storefront,u=f.jobId}},{title:"Creating API tokens",task:async()=>{await er(t,u)},skip:()=>!u}]),!c)throw new p("Unknown error occurred. Please try again or contact support if the error persists.");return c}l();l();var Be=re({name:"HydrogenCustomerAccountPushResult",schema:S.object({storefrontGid:we,redirectUri:S.string().url(),javascriptOrigin:S.string().url(),logoutUri:S.string().url()}).strict()});var ge=ye(ke(),1);l();var oi=`#graphql
|
|
154
|
+
mutation CustomerApplicationUrlsReplace($storefrontId: ID!, $urlsReplaceInput: HydrogenStorefrontCustomerApplicationUrlsReplaceInput!) {
|
|
155
|
+
hydrogenStorefrontCustomerApplicationUrlsReplace(
|
|
156
|
+
storefrontId: $storefrontId,
|
|
157
|
+
urlsReplaceInput: $urlsReplaceInput,
|
|
158
|
+
) {
|
|
159
|
+
success
|
|
160
|
+
userErrors {
|
|
161
|
+
code
|
|
162
|
+
field
|
|
163
|
+
message
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
`;async function Ct(e,t,o){let{hydrogenStorefrontCustomerApplicationUrlsReplace:{success:r,userErrors:n}}=await N(oi,e,{storefrontId:t,urlsReplaceInput:o});return{success:r,userErrors:n}}var Er=class e extends le{static get jsonOutputSchema(){return Be}static descriptionWithMarkdown="Push project configuration to admin";static description=this.descriptionForHelp();static flags={...ce,...fe.path,"storefront-id":ge.Flags.string({description:"The id of the storefront the configuration should be pushed to. Must start with 'gid://shopify/HydrogenStorefront/'"}),"dev-origin":ge.Flags.string({description:"The development domain of your application.",required:!0}),"javascript-origin":ge.Flags.string({description:"The origin to register as the allowed JavaScript origin for the Customer Account API OAuth flow. Defaults to --dev-origin. Must not include a port (Shopify rejects origins with ports); use this to register a portless origin while keeping a portful --dev-origin."}),"relative-redirect-uri":ge.Flags.string({description:"The relative url of allowed callback url for Customer Account API OAuth flow. Default is '/account/authorize'"}),"relative-logout-uri":ge.Flags.string({description:"The relative url of allowed url that will be redirected to post-logout for Customer Account API OAuth flow. Default to nothing."})};async run(){let{flags:t}=await this.parse(e),o=await Cr({...xe(t),redirectUriRelativeUrl:t["relative-redirect-uri"],logoutUriRelativeUrl:t["relative-logout-uri"]});Le(Be,o.result,t.json)}};async function Rr(e){return(await Cr(e)).cleanup}async function Cr({path:e=process.cwd(),storefrontId:t,devOrigin:o,javascriptOrigin:r,redirectUriRelativeUrl:n="/account/authorize",logoutUriRelativeUrl:s}){let i=await At(e,t);try{if(!i)throw new Error("No storefrontId was found in --storefront-id flag or .shopify/project.json");let a=n?new URL(n,o).toString():o,c=r??o,u=s?new URL(s,o).toString():o,f=Be.validate({storefrontGid:i,redirectUri:a,javascriptOrigin:c,logoutUri:u}),{session:m,config:d}=await B(e),h=d?.storefront?.customerAccountConfig,{success:x,userErrors:v}=await Ct(m,i,{redirectUri:{add:[a],removeRegex:h?.redirectUri},javascriptOrigin:{add:[c],removeRegex:h?.javascriptOrigin},logoutUris:{add:[u],removeRegex:h?.logoutUri}});if(!x||v.length){let y=new Error("Customer Account Application setup update fail.");throw y.userErrors=v,y}return await Xo(e,{redirectUri:a,javascriptOrigin:c,logoutUri:u}),{result:f,cleanup:()=>ri(m,i,{redirectUri:a,javascriptOrigin:c,logoutUri:u})}}catch(a){let c=!1,u=a?.userErrors?.length?a.userErrors.map(m=>(/Javascript origin is not allowed for this application type/i.test(m.message)&&(c=!0),`${m.field}: ${m.message}`)):a.message?[a.message]:[],f=[{link:{label:"Manually update application setup",url:"https://shopify.dev/docs/custom-storefronts/building-with-the-customer-account-api/hydrogen#update-the-application-setup"}}];throw c&&f.unshift({link:{label:"Enable Public access for Hydrogen",url:"https://shopify.dev/docs/custom-storefronts/building-with-the-customer-account-api/getting-started#step-1-enable-customer-account-api-access"}}),new p("Customer Account Application setup update fail.",u.length?[{list:{title:"The following error occurs during update:",items:u.map((m,d)=>`${d!=0?`
|
|
168
|
+
|
|
169
|
+
`:""}${m}`)}}]:void 0,f)}}async function ri(e,t,o={}){Object.values(o).some(Boolean)&&(I(`Cleaning up Customer Application url "${o.redirectUri}"`),await Ct(e,t,{redirectUri:{removeRegex:o?.redirectUri},javascriptOrigin:{removeRegex:o?.javascriptOrigin},logoutUris:{removeRegex:o?.logoutUri}}).catch(r=>{I(`Failed to clean up Customer Application url "${o.redirectUri}":
|
|
170
|
+
${r?.message}`)}))}async function At(e,t){if(t)return t;let{session:o,config:r}=await B(e);if(r.storefront?.id)return r.storefront.id;let n=await qe();return await Rt(e,o,r,{cliCommand:n})?(await me(e)).storefront?.id:void 0}l();l();l();var ni=`#graphql
|
|
171
|
+
query PullVariables($id: ID!, $handle: String) {
|
|
172
|
+
hydrogenStorefront(id: $id) {
|
|
173
|
+
id
|
|
174
|
+
environmentVariables(handle: $handle) {
|
|
175
|
+
id
|
|
176
|
+
isSecret
|
|
177
|
+
readOnly
|
|
178
|
+
key
|
|
179
|
+
value
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
`;async function Ar(e,t,o){let{hydrogenStorefront:r}=await N(ni,e,{id:t,handle:o});return r}l();var ii=`#graphql
|
|
184
|
+
query ListStorefronts($id: ID!) {
|
|
185
|
+
hydrogenStorefront(id: $id) {
|
|
186
|
+
id
|
|
187
|
+
productionUrl
|
|
188
|
+
environments {
|
|
189
|
+
branch
|
|
190
|
+
createdAt
|
|
191
|
+
id
|
|
192
|
+
name
|
|
193
|
+
handle
|
|
194
|
+
type
|
|
195
|
+
url
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
`;async function kr(e,t){let{hydrogenStorefront:o}=await N(ii,e,{id:t});return o}l();function kf(e){return[...e.filter(t=>t.type==="PREVIEW"),...e.filter(t=>t.type==="CUSTOM"),...e.filter(t=>t.type==="PRODUCTION")]}function Of(e,t,o){let r=Object.entries({handle:t,branch:o}).reduce((n,[s,i])=>(i&&n.push(`${s}: ${i}`),n),[]).join(", ");return`${e} ${E.dim(`(${r})`)}`}function $f(e,t){let o=e.find(({handle:r})=>r===t);if(!o)throw $r("handle",t);return o}function Or(e,t){let o=e.find(({branch:r})=>r===t);if(!o)throw $r("branch",t);return o}function $r(e,t){return new p("Environment not found",`We could not find an environment matching the ${e} '${t}'.`,[["Run",{command:"env list"},"to view a list of available environments."]])}var Ir=()=>({remoteVariables:{},remoteSecrets:{}});async function qf({root:e,envHandle:t,envBranch:o,envFile:r,fetchRemote:n=!0,localVariables:s}){let[{remoteVariables:i,remoteSecrets:a},{variables:c}]=await Promise.all([n?si(e,t,o).catch(h=>(Y({headline:"Failed to load environment variables from Shopify. The development server will still start, but the following error occurred:",body:[h.message,h.tryMessage,h.nextSteps].filter(Boolean).join(`
|
|
200
|
+
|
|
201
|
+
`)}),Ir())):Ir(),s?{variables:s}:kt(e,r)]),u=Object.keys(a),f=Object.keys(i),m=Object.keys(c);function d(){(m.length>0||f.length+u.length>0)&&(F(`
|
|
202
|
+
Environment variables injected into MiniOxygen:
|
|
203
|
+
`),F(Ft([...f.filter(h=>!m.includes(h)).map(h=>[h,"from Oxygen"]),...m.map(h=>[h,`from local ${r}`]),...u.filter(h=>!m.includes(h)).map(h=>[E.dim(h),E.dim("from Oxygen (Marked as secret)")])])))}return{logInjectedVariables:d,remoteVariables:i,remoteSecrets:a,localVariables:c,allVariables:{...a,...i,...c}}}async function si(e,t,o){let{session:r,config:n}=await B(e);if(o){let c=(await kr(r,n.storefront.id))?.environments||[];t=Or(c,o).handle}let s=(await Ar(r,n.storefront.id,t))?.environmentVariables||[],i={},a={};for(let{key:c,value:u,isSecret:f}of s)f?a[c]=u:i[c]=u;return{remoteVariables:i,remoteSecrets:a}}async function kt(e,t){let o=b(e,t);return await w(o).then(r=>r?ho(o):{variables:{}})}l();async function _r(e,t,o){let r=await qt(e,"tunnel_start",{port:t,provider:o}),s=Object.values(r).filter(i=>!i?.isErr()||i.error.type!=="invalid-provider")[0];if(!s)throw new Fe(`We couldn't find the ${o} tunnel plugin`);if(s.isErr())throw new p(`${o} failed to start the tunnel.
|
|
204
|
+
${s.error.message}`);return s.value}async function Tr(e){return new Promise((t,o)=>{let r=0,n=async()=>{let i=e.getTunnelStatus();if(I(`Polling tunnel status for ${e.provider} (attempt ${r}): ${i.status}`),i.status==="error")return o(new p(i.message,i.tryMessage));i.status==="connected"?t(i.url):(r+=1,s())},s=()=>{setTimeout(n,500)};n()})}function ai(e){return e.PUBLIC_STORE_DOMAIN==="mock.shop"||e.PUBLIC_STORE_DOMAIN===""}function ap(e){q({headline:"Using mock.shop with `--customer-account-push` flag is not supported",body:"The functionalities of this flag are disabled.",nextSteps:["You may continue knowing Customer Account API (/account) interactions will fail.",["Or run",{command:`${e} env pull`},"to link to your store credentials."]]})}function cp(e,t,o){return kt(e,o).then(async({variables:r})=>{let n=t&&!ai(r);n&&await At(e);let{shop:s,storefront:i}=await me(e),a=i?.id;return{storefrontId:a,customerAccountPush:n,fetchRemote:!!s&&!!a,localVariables:r,storefrontTitle:i?.title}})}var jr=Object.freeze({ORIGINAL:".trycloudflare.com",REBRANDED:".tryhydrogen.dev"});async function lp(e,t,o,r){F(`
|
|
205
|
+
Starting tunnel...
|
|
206
|
+
`);let n=await _r(t,o,"cloudflare"),s=await Tr(n).then(a=>a.replace(jr.ORIGINAL,jr.REBRANDED)),i=await Rr({path:e,devOrigin:s,storefrontId:r}).catch(a=>{a instanceof p&&q({headline:"Customer Account Application setup update fail.",body:a.tryMessage||void 0,nextSteps:a.nextSteps})});return{host:s,cleanup:i}}function up(e){let t=process.env.TERM_PROGRAM==="vscode",o="https://h2o.fyi/debugging/server-code"+(t?"#visual-studio-code":"#step-2-attach-a-debugger");return ae`Debugging enabled on port ${String(e)}.\nAttach a ${J.link(E.yellow(t?"VSCode debugger":"debugger"),o)} or open DevTools in http://127.0.0.1:${String(e)}.`.value}function fp(e,t){e=e.endsWith("/")?e.slice(0,-1):e;let o=t?t.replace(/\/$/,""):e;return[`View GraphiQL API browser:
|
|
207
|
+
${de({host:o})}`,`View server network requests:
|
|
208
|
+
${o}/subrequest-profiler`].map((r,n)=>({subdued:`${n===0?"":`
|
|
209
|
+
|
|
210
|
+
`}${r}`}))}l();import Ot from"node:path";import{EventEmitter as ci}from"node:events";import{ReadableStream as li}from"node:stream/web";var Fr=ye(Dr(),1),wp="H2O_LOG_EVENT",Nr;function Sp(e){Nr=e.Response}var It=new Set(["/graphiql","/graphiql/customer-account.schema.json","/subrequest-profiler","/debug-network-server"]),ui={request:"Request",subrequest:"Sub request"};async function fi(e){let t=await e.json();return{...t,requestId:t.requestId??"",eventType:t.eventType||"unknown",endTime:t.endTime||Date.now(),purpose:t.purpose==="prefetch"?"(prefetch)":"",cacheStatus:t.cacheStatus??"",graphql:t.graphql?JSON.parse(t.graphql):null}}var $t=new ci,Re=[];function ze(e="ok",t){return new Nr(e,t)}function pi(e){return Re.length=0,ze()}function vp(e){return async function(o){let r=new URL(o.url);if(It.has(r.pathname))return ze();let{url:n,displayName:s,eventType:i,purpose:a,graphql:c,stackInfo:u,...f}=await fi(o),m="",d=o.url,h=s;i==="subrequest"&&(h=h||c?.query.match(/(query|mutation)\s+(\w+)/)?.[0]?.replace(/\s+/," "),d=n||o.url,c&&(m=de({graphql:c})));let x=null,v=null;if(u?.file){e?.transformLocation&&(u.file=e.transformLocation(u.file));let{source:P,line:k,column:$}=(0,Fr.mapSourcePosition)({source:u.file,line:u.line??0,column:u.column??0});x=`${P}:${k}:${$+1}`,v=`vscode://${Ot.join("file",x)}`,x=x.split(Ot.sep+"app"+Ot.sep)[1]??x,u.func&&(x=`${u.func.replace(/\d+$/,"")} (${x})`)}let y={event:ui[i]||i,data:JSON.stringify({...f,displayName:h,url:`${a} ${d}`.trim(),graphiqlLink:m,stackLine:x,stackLink:v})};return Re.push(y),Re.length>100&&Re.shift(),$t.emit("request",y),ze()}}function mi(e){let t=new li({start(o){let r=new TextEncoder,n=({event:a="message",data:c})=>{o.enqueue(r.encode(`event: ${a}
|
|
211
|
+
`)),o.enqueue(r.encode(`data: ${c}
|
|
212
|
+
|
|
213
|
+
`))};Re.forEach(n),$t.addListener("request",n);let s=!1;function i(){s||(s=!0,e.signal.removeEventListener("abort",i),$t.removeListener("request",n),o.close())}if(e.signal.addEventListener("abort",i),e.signal.aborted)return i()}});return ze(t,{headers:{"Content-Type":"text/event-stream","Cache-Control":"no-store",Connection:"keep-alive"}})}function bp(e){return e.method==="DELETE"?pi():mi(e)}l();var kp="/debug-network-server";function Op(){throw new p("Could not load MiniOxygen.","Please make sure you have `@shopify/mini-oxygen` installed.")}function $p({request:e,response:t,meta:o}){try{let r=new URL(e.url);if(!o.durationMs&&o.startTimeMs&&o.endTimeMs&&(o.durationMs=o.endTimeMs-o.startTimeMs),It.has(r.pathname)||r.pathname==="/favicon.ico")return;let n=r.searchParams.has("_data"),s=e.url.replace(r.origin,""),i="",a="render";if(n){a=e.method==="GET"?"loader":"action";let u=r.searchParams.get("_data")?.replace("routes/","");s=r.pathname,i=`[${u}]`}let c=t.status<300?J.green:t.status<400?J.cyan:J.errorText;F(ae`${e.method.padStart(6)} ${c(String(t.status))} ${J.italic(a.padEnd(7," "))} ${s} ${o.durationMs&&o.durationMs>0?E.dim(` ${o.durationMs}ms`):""}${i?" "+E.dim(i):""}${e.headers.purpose==="prefetch"?E.italic(E.dim(" prefetch")):""}`)}catch{e&&t?.status&&F(`${e.method} ${t.status} ${e.url}`)}}export{Eo as a,X as b,Le as c,Pi as d,vo as e,we as f,Ei as g,xo as h,tt as i,Po as j,Ne as k,le as l,D as m,ns as n,Se as o,ms as p,U as q,ve as r,at as s,ct as t,V as u,ee as v,ue as w,Ue as x,be as y,ut as z,ft as A,ia as B,Mo as C,Vo as D,an as E,mt as F,dt as G,Jo as H,Wo as I,cn as J,ln as K,fe as L,xe as M,qa as N,Ya as O,So as P,Gr as Q,$l as R,Il as S,_l as T,dr as U,fr as V,Tn as W,vt as X,pr as Y,Dn as Z,Sl as _,Ni as $,Li as aa,Di as ba,N as ca,Bo as da,Ge as ea,me as fa,Qo as ga,Ko as ha,cc as ia,Zo as ja,er as ka,L as la,nr as ma,qe as na,Yc as oa,Ye as pa,Jc as qa,Wc as ra,Bc as sa,nl as ta,B as ua,lr as va,cl as wa,qn as xa,yr as ya,Kn as za,wu as Aa,Su as Ba,vu as Ca,bu as Da,xu as Ea,Pu as Fa,Eu as Ga,Ru as Ha,Cu as Ia,Au as Ja,Zn as Ka,ku as La,Ou as Ma,xr as Na,Rt as Oa,Er as Pa,kf as Qa,Of as Ra,$f as Sa,Or as Ta,Ar as Ua,kr as Va,qf as Wa,ai as Xa,ap as Ya,cp as Za,jr as _a,lp as $a,up as ab,fp as bb,wp as cb,Sp as db,vp as eb,bp as fb,kp as gb,Op as hb,$p as ib};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Bb as ms,Da as cs,Oa as hs,Pa as us,Sa as fs,Va as ds,ab as ps,la as wt,oa as be,qb as kt,sb as gs,ta as ls,va as bt}from"./chunk-LWCTKI4Z.js";import{c as we,f as yt,h as as}from"./chunk-IWTNUJGY.js";import{a as X,c as gi,e as mi,g as ye}from"./chunk-VKWPEFWQ.js";var ui=gi(l=>{"use strict";ye();Object.defineProperty(l,"__esModule",{value:!0});var yi=X("stream"),W=X("path"),G=X("fs"),Es=X("crypto"),O=class{constructor(e,s,i,r,n){this.kind=e,this.input=s,this.begin=i,this.end=r,this.file=n}getText(){return this.input.slice(this.begin,this.end)}getPosition(){let[e,s]=[1,1];for(let i=0;i<this.begin;i++)this.input[i]===`
|
|
2
2
|
`?(e++,s=1):s++;return[e,s]}size(){return this.end-this.begin}},D=class{liquidMethodMissing(e,s){}},wi=Object.prototype.toString,ys=String.prototype.toLowerCase,Qt=Object.hasOwnProperty;function d(t){return typeof t=="string"}function x(t){return typeof t=="function"}function bi(t){return t&&x(t.then)}function _e(t){return t&&x(t.next)&&x(t.throw)&&x(t.return)}function Kt(t){return function(...e){return new Promise((s,i)=>{t(...e,(r,n)=>{r?i(r):s(n)})})}}function h(t){return t=m(t),d(t)?t:k(t)?"":S(t)?t.map(e=>h(e)).join(""):String(t)}function ge(t){return t=m(t),S(t)?t:d(t)&&t.length>0?[t]:Ti(t)?Array.from(t):dt(t)?Object.keys(t).map(e=>[e,t[e]]):[]}function L(t){return t=m(t),k(t)?[]:S(t)?t:[t]}function m(t){return t instanceof D&&x(t.valueOf)?t.valueOf():t}function xt(t){return+m(t)||0}function ft(t){return typeof t=="number"}function Vs(t){return t&&x(t.toLiquid)?Vs(t.toLiquid()):t}function k(t){return t==null}function ki(t){return t===void 0}function S(t){return wi.call(t)==="[object Array]"}function Ps(t){return t&&ft(t.length)}function Ti(t){return dt(t)&&Symbol.iterator in t}function ws(t,e){t=t||{};for(let s in t)if(Qt.call(t,s)&&e(t[s],s,t)===!1)break;return t}function xi(t){return t[t.length-1]}function dt(t){let e=typeof t;return t!==null&&(e==="object"||e==="function")}function Cs(t,e,s=1){let i=[];for(let r=t;r<e;r+=s)i.push(r);return i}function oe(t,e,s=" "){return $s(t,e,s,(i,r)=>r+i)}function Si(t,e,s=" "){return $s(t,e,s,(i,r)=>i+r)}function $s(t,e,s,i){t=String(t);let r=e-t.length;return r<=0?t:i(t,s.repeat(r))}function js(t){return t}function _i(t){return[...t].some(s=>s>="a"&&s<="z")?t.toUpperCase():t.toLowerCase()}function Li(t,e){return t.length>e?t.slice(0,e-3)+"...":t}function Fi(t,e){return k(t)&&k(e)?0:k(t)?1:k(e)||t<e?-1:t>e?1:0}function Oi(t,e){return k(t)&&k(e)?0:k(t)?1:k(e)||(t=ys.call(t),e=ys.call(e),t<e)?-1:t>e?1:0}function pt(t){return function(...e){return t.call(this,...e.map(m))}}function V(t){return function(...e){return t.call(this,...e.map(xt))}}function*ke(t){let e=new Set;for(let s of t){let i=JSON.stringify(s);e.has(i)||(e.add(i),yield s)}}var bs="__liquidClass__",E=class extends Error{constructor(e,s){super(typeof e=="string"?e:e.message),this.context="",typeof e!="string"&&Object.defineProperty(this,"originalError",{value:e,enumerable:!1}),Object.defineProperty(this,"token",{value:s,enumerable:!1}),Object.defineProperty(this,bs,{value:"LiquidError",enumerable:!1})}update(){Object.defineProperty(this,"context",{value:vi(this.token),enumerable:!1}),this.message=zi(this.message,this.token),this.stack=this.message+`
|
|
3
3
|
`+this.context+`
|
|
4
4
|
`+this.stack,this.originalError&&(this.stack+=`
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as P}from"./chunk-6PUU6ZNQ.js";import{a as N}from"./chunk-KSDU4YOB.js";import{a as l}from"./chunk-PSSYLJG4.js";import{a as U}from"./chunk-YY6TFARF.js";import{a as J,b as _}from"./chunk-P33TONYG.js";import{b as E,c as h,e as R,g as C,h as T}from"./chunk-QFWWCZOI.js";import{r as O}from"./chunk-5TB52UUV.js";import{p as c,v as x}from"./chunk-DJAZBPYA.js";import{b as S,c as j,f as F}from"./chunk-Q2SZCZE7.js";import{A as y,C as u,F as D,X as a}from"./chunk-CZ22VZDA.js";import{h as v}from"./chunk-2VSNFOKD.js";import{wb as q}from"./chunk-LWCTKI4Z.js";import{b as t}from"./chunk-FZCGRIOM.js";import{b as k}from"./chunk-YTUUU33R.js";import{e as L,g as i}from"./chunk-VKWPEFWQ.js";i();i();var d=t.object({id:t.number(),name:t.string(),role:t.string()}),G=d.extend({shop:t.string(),preview_url:t.string().optional()}),B=t.object({status:t.literal("failed"),message:t.string(),errors:t.array(t.string()),requestId:t.string().optional()}),z=t.discriminatedUnion("status",[P.extend({originalTheme:d,theme:G}),B]),p=R({name:"ThemeDuplicateResult",schema:t.object({status:t.literal("success"),changed:t.boolean(),originalTheme:h,theme:h.extend({storeDomain:E,previewUrl:t.string().url().nullable()}).strict()}).strict(),definitions:{Theme:h},project(e){let r=z.parse(e);if(r.status==="failed")throw new TypeError("Failed duplications use the shared fatal error document.");return{status:r.status,changed:!0,originalTheme:T(r.originalTheme),theme:{...T(r.theme),storeDomain:C(r.theme.shop),previewUrl:r.theme.preview_url??null}}}}),A=t.discriminatedUnion("status",[t.object({status:t.literal("missing-theme-id")}),t.object({status:t.literal("not-found"),themeId:t.string()}),t.object({status:t.literal("development-theme")}),t.object({status:t.literal("cancelled")}),t.object({status:t.literal("completed"),originalTheme:d.extend({createdAtRuntime:t.boolean().default(!1),processing:t.boolean().default(!1)}),shop:t.string(),previewUrl:t.string().optional(),theme:d.optional(),userErrors:t.array(t.object({field:t.array(t.string()).nullish(),message:t.string()})),requestId:t.string().optional()})]);i();function w(e){if(e.status==="cancelled")return{status:"cancelled"};let r=M(e);if(r.status==="failed"){let o=new v(r.message.trim());throw o.details={errors:r.errors,...r.requestId?{requestId:r.requestId}:{}},o}return r}function Y(e,r){if(r==="json"){q(p.encode(w(e)));return}if(e.status==="cancelled")return;let o=M(e);o.status==="failed"&&(process.exitCode=1),e.status==="completed"?V(e):"message"in o&&u({body:[o.message]})}function M(e){switch(e.status){case"missing-theme-id":return{status:"failed",message:"A theme ID is required to duplicate a theme, specify one with the --theme flag",errors:[]};case"not-found":return{status:"failed",message:`No theme with ID ${e.themeId} could be found. Use shopify theme list to find a theme ID.`,errors:[]};case"development-theme":return{status:"failed",message:"Development themes can't be duplicated. Use shopify theme push to upload it to the store first.",errors:[]};case"completed":{if(e.userErrors.length>0)return{status:"failed",message:`The theme '${e.originalTheme.name}' could not be duplicated due to errors`,errors:e.userErrors.map(r=>r.message),requestId:e.requestId};if(e.theme){let{id:r,name:o,role:s}=e.theme;return{status:"success",originalTheme:e.originalTheme,theme:{id:r,name:o,role:s,shop:e.shop,preview_url:e.previewUrl}}}return{status:"failed",message:`The theme '${e.originalTheme.name}' unexpectedly could not be duplicated `,errors:[],requestId:e.requestId}}}}function V(e){let r=e.originalTheme;if(e.userErrors&&e.userErrors.length>0){let o=e.userErrors.map(s=>s.message).join(", ");u({body:["The theme",...l(r),"could not be duplicated due to errors: ",{subdued:o},{char:"."},...e.requestId?[`
|
|
2
|
+
Request ID: `,{subdued:e.requestId}]:[]]})}else e.theme?y({body:["The theme",...l(r),"has been duplicated",{char:"."}],nextSteps:[[{link:{label:"View the duplicated theme",url:e.previewUrl}}]]}):u({body:["The theme",...l(r),"unexpectedly could not be duplicated",{char:"."},...e.requestId?[`
|
|
3
|
+
Request ID: `,{subdued:e.requestId}]:[]]})}i();async function $(e,r,o,s=!1){let{name:m,force:H}=o,I=a()||!!H||s;if(I&&!r)return{status:"missing-theme-id"};let n=r?await _(e,r):await J(e,{header:"Select a theme to duplicate",filter:{theme:r}});if(!n)return{status:"not-found",themeId:r};if(n?.role==="development")return{status:"development-theme"};if(!I&&!await D({message:`Do you want to duplicate '${n.name}' on ${e.storeFqdn}?`,confirmationMessage:`Yes, duplicate '${n.name}'`,cancellationMessage:"No, cancel duplicate"}))return{status:"cancelled"};let g=await O(n.id,m,e);return A.parse({status:"completed",originalTheme:n,shop:e.storeFqdn,previewUrl:g.theme?U(g.theme,e):void 0,...g})}var f=L(k(),1);var b=class extends x{static get jsonOutputSchema(){return p}static summary="Duplicates a theme from your theme library.";static usage=["theme duplicate","theme duplicate --theme 10 --name 'New Theme'"];static descriptionWithMarkdown="If you want to duplicate your local theme, you need to run `shopify theme push` first.\n\nIf no theme ID is specified, you're prompted to select the theme that you want to duplicate from the list of themes in your store. You're asked to confirm that you want to duplicate the specified theme.\n\nPrompts and confirmations are not shown when duplicate is run in a CI environment or the `--force` flag is used, therefore you must specify a theme ID using the `--theme` flag.\n\nYou can optionally name the duplicated theme using the `--name` flag.\n\nIf you use the `--json` flag, then theme information is returned in JSON format, which can be used as a machine-readable input for scripts or continuous integration.\n\nSuccessful JSON results include `status`, `changed`, and explicit `originalTheme` and `theme` resources with decimal string IDs. Failures use the shared `{error}` document.";static description=this.descriptionForHelp();static flags={...S,...j,password:c.password,theme:F(f.Flags.string({char:"t",description:"Theme ID or name of the remote theme.",env:"SHOPIFY_FLAG_THEME_ID"})),name:f.Flags.string({char:"n",description:"Name of the newly duplicated theme.",env:"SHOPIFY_FLAG_NAME"}),store:c.store,environment:c.environment,force:f.Flags.boolean({char:"f",description:"Force the duplicate operation to run without prompts or confirmations. Required if non interactive outside CI.",env:"SHOPIFY_FLAG_FORCE"})};static multiEnvironmentsFlags=["store","password","theme"];static nonTTYFlagRequirements(){return[{flags:["force"],when:()=>!a()}]}async command(r,o,s=!1){N(r);let m=await $(o,r.theme,r,s);if(r.json&&s)return w(m);Y(m,r.json?"json":"text")}requiresEnvironmentConfirmation(r){return!a()&&super.requiresEnvironmentConfirmation(r)}};export{b as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as c}from"./chunk-
|
|
1
|
+
import{e as c}from"./chunk-OGWPS55W.js";import{S as s}from"./chunk-H4V55Y3Z.js";import{h as p,k as a}from"./chunk-2VSNFOKD.js";import{g as i}from"./chunk-VKWPEFWQ.js";i();async function v(e,t){let o=e.apiSecretKeys[0]?.secret;if(!o)throw new a("No API secret keys found for app");return s(t,e.apiKey,o)}function y(e){let{organization:t,remoteApp:o,storeFqdn:u,version:r}=e,n=[`Organization: ${t.businessName}`,`App: ${o.title}`,`Store: ${u}`];return r&&n.push(`API version: ${r}`),n}function S(e,t){if(c(e)&&t.storeType!=="APP_DEVELOPMENT")throw new p("Mutations can only be executed on dev stores.")}export{v as a,y as b,S as c};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{a as F}from"./chunk-UVRKTMF7.js";import{a as D}from"./chunk-ZGV3HNEV.js";import{a as y}from"./chunk-FWB3GLMW.js";import{Ma as S}from"./chunk-3C6VLJ5D.js";import{D as f,u}from"./chunk-H4V55Y3Z.js";import{b as g,c as C}from"./chunk-Q2SZCZE7.js";import{A as v}from"./chunk-CZ22VZDA.js";import{a as h}from"./chunk-BN7ZXAZJ.js";import{h as c}from"./chunk-2VSNFOKD.js";import{wb as w}from"./chunk-LWCTKI4Z.js";import{b as n}from"./chunk-FZCGRIOM.js";import{b as j}from"./chunk-YTUUU33R.js";import{e as I,g as s}from"./chunk-VKWPEFWQ.js";s();s();async function x(t){let e=t.appContextResult.developerPlatformClient,o=t.appContextResult.remoteApp,i=await e.devSessionDelete({shopFqdn:t.store.shopDomain,appId:o.id}),r=i?.devSessionDelete?.userErrors;if(!Array.isArray(r)||r.some(a=>typeof a?.message!="string")){let a=new c("Failed to stop the dev preview: the server returned an invalid response.");throw a.details={data:i},a}if(r.length){let a=r.map(b=>b.message).join(`
|
|
2
|
+
`),l=new c(`Failed to stop the dev preview: ${a}`);throw l.details={userErrors:r},l}return{status:"success",app:{name:o.title,clientId:o.apiKey},storeHostname:t.store.shopDomain}}s();var A=n.object({name:n.string(),clientId:n.string().min(1)}).strict(),p=h({name:"AppDevCleanResult",schema:n.object({status:n.literal("success"),app:A,storeDomain:n.string().nullable().describe("The canonical *.myshopify.com hostname, or null when unknown.")}).strict(),definitions:{AppDevCleanApp:A}});s();function R(t,e){if(e==="json"){let o={status:t.status,app:t.app,storeDomain:f(t.storeHostname)?t.storeHostname:null};w(p.encode(o));return}v({headline:"Dev preview stopped.",body:[`The dev preview has been stopped on ${t.storeHostname} and the app's active version has been restored.`,"You can start it again with",{command:"shopify app dev"}]})}var m=I(j(),1);var d=class t extends D{static summary="Cleans up the dev preview from the selected store.";static descriptionWithMarkdown=`Stop the dev preview that was started with \`shopify app dev\`.
|
|
3
|
+
|
|
4
|
+
It restores the app's active version to the selected development store.
|
|
5
|
+
`;static jsonOutputSchema=p;static description=this.descriptionForHelp();static flags={...g,...y,...C,"client-id":m.Flags.string({hidden:!1,description:"The Client ID of your app. Use with --config to clean up the dev preview for a different app than the one it is linked to.",env:"SHOPIFY_FLAG_CLIENT_ID"}),store:m.Flags.string({hidden:!1,char:"s",description:"Store URL. Must be an existing development store.",env:"SHOPIFY_FLAG_STORE",parse:async e=>u(e)})};async run(){let{flags:e}=await this.parse(t),o=await S({directory:e.path,clientId:e["client-id"],forceRelink:e.reset,userProvidedConfigName:e.config}),i=await F({appContextResult:o,storeFqdn:e.store,forceReselectStore:e.reset}),r=await x({appContextResult:o,store:i});return R(r,e.json?"json":"text"),{app:o.app}}};export{d as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as N}from"./chunk-EITIW5OX.js";import{a as J,b as L}from"./chunk-YY6TFARF.js";import{a as V}from"./chunk-P33TONYG.js";import{a as O,b as F,d,e as x,f as C,g as a,h as R}from"./chunk-QFWWCZOI.js";import{f as j,g as E,p as w,v as D}from"./chunk-DJAZBPYA.js";import{ua as h,xa as g}from"./chunk-H4V55Y3Z.js";import{b as S,c as b}from"./chunk-Q2SZCZE7.js";import{z as u}from"./chunk-CZ22VZDA.js";import{c as _}from"./chunk-DFQ4WTET.js";import{h as I}from"./chunk-2VSNFOKD.js";import{wb as c}from"./chunk-LWCTKI4Z.js";import{b as o}from"./chunk-FZCGRIOM.js";import{b as U}from"./chunk-YTUUU33R.js";import{e as P,g as i}from"./chunk-VKWPEFWQ.js";i();i();function G(t,e){return{theme:{id:t.id,name:t.name,role:t.role,shop:e.storeFqdn,preview_url:J(t,e),editor_url:L(t,e)}}}function $(t){let{platform:e,arch:n}=_(),r=j(),m=r?E():void 0,s=Number(m)||null;return{result:{store:r??"Not configured",development_theme_id:s,cli_version:t.cliVersion,os:`${e}-${n}`,shell:process.env.SHELL??"unknown",node_version:process.version},developmentTheme:m}}async function y(t,e){let n;if(e.development)n=await new N(t).findOrCreate();else{let r={filter:{theme:e.theme}};n=await V(t,r)}return n?G(n,t):void 0}i();i();var Y=o.object({id:o.number(),name:o.string(),role:o.string(),shop:o.string(),preview_url:o.string(),editor_url:o.string()}),q=o.object({theme:Y}),z=o.object({store:o.string(),development_theme_id:o.number().nullable(),cli_version:o.string(),os:o.string(),shell:o.string(),node_version:o.string()}),K=o.union([q,z]),A=o.object({storeDomain:F,developmentThemeId:O.nullable(),cliVersion:o.string(),os:o.string(),shell:o.string().nullable(),nodeVersion:o.string()}).strict(),l=x({name:"ThemeInfoResult",schema:o.union([o.object({theme:d}).strict(),A]),definitions:{Theme:d,ThemeEnvironmentInfo:A},project(t){let e=K.parse(t);return"theme"in e?{theme:{...R(e.theme),storeDomain:a(e.theme.shop),previewUrl:e.theme.preview_url,editorUrl:e.theme.editor_url}}:{storeDomain:a(e.store),developmentThemeId:e.development_theme_id===null?null:C(e.development_theme_id),cliVersion:e.cli_version,os:e.os,shell:e.shell==="unknown"?null:e.shell,nodeVersion:e.node_version}}});function p(t,e,n={}){if(e==="json"){c(l.encode(t));return}"theme"in t?u(W(t,n)):u({customSections:B(t,n)})}function W(t,e){let n=Object.entries(t.theme).map(([r,m])=>{if(r==="editor_url"||r==="preview_url"){let s=String(m),H=r==="editor_url"?"Open in Theme Editor":"Preview Theme";return[f(r),{link:{url:s,label:H}}]}return r==="id"?[f(r),`#${m}`]:[f(r),`${m}`]});return{customSections:[...e.environment?[{title:"Theme information",body:[{subdued:`Environment name: ${e.environment}`}]}]:[],{title:"Theme Details",body:{tabularData:n,firstColumnSubdued:!0}}]}}function B(t,e){let n=Object.hasOwn(e,"developmentTheme")?e.developmentTheme:t.development_theme_id;return g(`theme-command:info:dev-theme-loaded:${n}`),[M("Theme Configuration",[["Store",t.store],["Development Theme ID",n?`#${n}`:{subdued:"Not set"}]]),M("Tooling and System",[["Shopify CLI",t.cli_version],["OS",t.os],["Shell",t.shell],["Node version",t.node_version]])]}function M(t,e){return{title:t,body:{tabularData:e,firstColumnSubdued:!0}}}function f(t){return t.split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}var v=P(U(),1);var T=class extends D{static get jsonOutputSchema(){return l}static descriptionWithMarkdown="Displays information about your theme environment, including your current store. Can also retrieve information about a specific theme.";static description=this.descriptionForHelp();static flags={...S,...b,...w,development:v.Flags.boolean({char:"d",description:"Retrieve info from your development theme.",env:"SHOPIFY_FLAG_DEVELOPMENT"}),theme:v.Flags.string({char:"t",description:"Theme ID or name of the remote theme.",env:"SHOPIFY_FLAG_THEME_ID"})};static multiEnvironmentsFlags=["store","password"];async command(e,n,r=!1){if(h("theme-command:info"),e.theme||e.development){let m=await y(n,e);if(!m)throw new I("Theme not found!");if(e.json&&r)return h("theme-command:info"),m;p(m,e.json?"json":"text",e)}else{let{result:m,developmentTheme:s}=$({cliVersion:this.config.version});if(e.json&&r)return h("theme-command:info"),m;p(m,e.json?"json":"text",{developmentTheme:s})}h("theme-command:info")}renderEnvironmentResults(e){c(l.encode({environments:e}))}};export{T as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{U as m}from"./chunk-CZ22VZDA.js";import{h as c}from"./chunk-2VSNFOKD.js";import{Bb as a,qb as l,sb as n}from"./chunk-LWCTKI4Z.js";import{g as s}from"./chunk-VKWPEFWQ.js";s();import{createServer as d}from"net";var u=new Set;async function P(o,t){if(o&&await g(o))return a(n`Port ${o.toString()} is free`),o;a(n`Getting a random port...`);let r=await w(()=>f(),t?.maxTries,t?.waitTimeInSeconds);for(let e=0;e<(t?.maxTries??5)&&u.has(r);e++)r=await w(()=>f(),t?.maxTries,t?.waitTimeInSeconds);return a(n`Random port obtained: ${l.raw(`${r}`)}`),u.add(r),r}async function g(o){return new Promise(t=>{let r=d();r.unref(),r.once("error",()=>t(!1));try{r.listen(o,"localhost",()=>{r.close(()=>t(!0))})}catch(e){if(!(e instanceof RangeError))throw e;t(!1)}})}function f(){return new Promise((o,t)=>{let r=d();r.unref(),r.once("error",t),r.listen(0,"localhost",()=>{let e=r.address();if(e&&typeof e=="object"){let i=e.port;r.close(()=>o(i))}else r.close(()=>t(new Error("Unable to determine assigned port")))})})}async function w(o,t=5,r=1){let e=1;for(;;)try{return await o()}catch(i){if(e++<t)a(n`Unknown problem getting a random port: ${i.message}`),await m(r);else throw new c(i.message)}}export{P as a,g as b};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as o,b as p,d as u}from"./chunk-IWEKM5Y3.js";import{p as f,v as c}from"./chunk-DJAZBPYA.js";import{b as d,c as l}from"./chunk-Q2SZCZE7.js";import{h as a}from"./chunk-2VSNFOKD.js";import{wb as m}from"./chunk-LWCTKI4Z.js";import{i as n}from"./chunk-FZCGRIOM.js";import{b as v}from"./chunk-YTUUU33R.js";import{e as F,g as s}from"./chunk-VKWPEFWQ.js";s();var h=F(v(),1),i=class extends c{static get jsonOutputSchema(){return o}static summary="Download metafields definitions from your shop into a local file.";static descriptionWithMarkdown=`Retrieves metafields from Shopify Admin.
|
|
2
|
+
|
|
3
|
+
If the metafields file already exists, it will be overwritten.`;static description=this.descriptionForHelp();static flags={...d,...l,...f,force:h.Flags.boolean({hidden:!0,char:"f",description:"Proceed without confirmation, if current directory does not seem to be theme directory.",env:"SHOPIFY_FLAG_FORCE"})};static multiEnvironmentsFlags=null;async command(e,b,w=!1){let y={path:e.path,password:e.password,store:e.store,force:e.force,verbose:e.verbose,noColor:e["no-color"]},t=await u(y);if(t.status==="failed"){let r=new a("Failed to fetch metafield definitions.","Check your connection and permissions, then try again.");throw r.details={failedOwnerTypes:t.failedOwnerTypes},r}return t.status==="downloaded"&&t.failedOwnerTypes.length>0&&(process.exitCode=1,e.json&&n({type:"diagnostic",level:"error",message:`Failed to fetch metafield definitions for: ${t.failedOwnerTypes.join(", ")}.`})),(!w||!e.json)&&p(t,e.json?"json":"text"),t}renderEnvironmentResults(e){m(o.encode({environments:e}))}};export{i as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as s,c as i,d as p}from"./chunk-
|
|
1
|
+
import{b as s,c as i,d as p}from"./chunk-2ORRV7GH.js";import{b as o}from"./chunk-ZQDDRIBA.js";import{b as e,c as r}from"./chunk-Q2SZCZE7.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();var t=class n extends o{static summary="Enable automatic upgrades for Shopify CLI.";static descriptionWithMarkdown=`Enable automatic upgrades for Shopify CLI.
|
|
2
2
|
|
|
3
3
|
When auto-upgrade is enabled, Shopify CLI automatically updates to the latest version once per day. Major version upgrades are skipped and must be done manually.
|
|
4
4
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as t,ka as r}from"./chunk-3C6VLJ5D.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();async function o(i,e,s){return await r(e,s.source),{variables:[{name:"SHOPIFY_API_KEY",value:e.apiKey,isSecret:!1},...e.apiSecretKeys[0]?[{name:"SHOPIFY_API_SECRET",value:e.apiSecretKeys[0].secret,isSecret:!0}]:[],{name:"SCOPES",value:t(i.configuration),isSecret:!1}]}}export{o as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as d}from"./chunk-VB7YQMAM.js";import{a as p,b as m}from"./chunk-GXORLBVN.js";import{d as r,j as c}from"./chunk-NDKSG4CC.js";import{a as s}from"./chunk-ZGV3HNEV.js";import{Ma as a}from"./chunk-3C6VLJ5D.js";import{c as n}from"./chunk-Q2SZCZE7.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();var e=class u extends s{static summary="Reverses app subscription migrations that are still scheduled.";static descriptionWithMarkdown="Reverses scheduled app subscription migrations that have not migrated yet.\n\nWhen `--input` is omitted, the command reads CSV data from stdin. Use `--input <path>` to read from a file. `--input -` is also supported as an explicit stdin path.\n\n- Required CSV header: `shop_id`.\n- Example row: `123456789`.\n\nThe CSV can contain only the `shop_id` header, or it can reuse the complete CSV supplied to `schedule`; schedule-only columns are ignored.\n\nUnscheduling is not a rollback after a subscription has migrated. The command validates the entire CSV before sending any mutation. Use `--force` to skip confirmation and immediately submit every valid row.\n\nOperations are submitted in batches of 250 shops. Preserve every operation GID printed by the command so you can check or cancel the submitted operations. With `--watch`, human-readable output shows accepted identifiers before polling begins, then displays operation progress and the final outcome. With `--json --watch`, the command outputs one structured JSON document after every operation reaches a terminal status.\n\nRun the command from an app project. By default, it uses the Client ID from the active app configuration. Use `--path` to select an app directory or `--config` to select a configuration. Pass `--client-id` to select a different app within the project. Use `--reset` to relink the app.";static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %> --input migrations.csv --force","cat migrations.csv | <%= config.bin %> <%= command.id %> --force","<%= config.bin %> <%= command.id %> --input migrations.csv --path ../my-app --config staging --force --json","<%= config.bin %> <%= command.id %> --input migrations.csv --client-id <client-id> --force","<%= config.bin %> <%= command.id %> --input - --force --watch"];static flags={...r,...n};static get jsonOutputSchema(){return c}async run(){let{flags:t}=await this.parse(u),{app:h,remoteApp:l}=await a({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config}),f=await d({action:"unschedule",input:t.input??"-",clientId:l.apiKey,skipConfirmation:t.force,watch:t.watch,...t.watch&&!t.json?{onSubmissionAccepted:p}:{}}),i=m(f,{json:t.json,watch:t.watch});return i!==0&&(process.exitCode=i),{app:h}}};export{e as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as f,b as h}from"./chunk-3LVCG4JB.js";import{f as d,k as u,r as l}from"./chunk-NDKSG4CC.js";import{a as m}from"./chunk-ZGV3HNEV.js";import{Ma as c}from"./chunk-3C6VLJ5D.js";import{c as p}from"./chunk-Q2SZCZE7.js";import{h as s}from"./chunk-2VSNFOKD.js";import{g as e}from"./chunk-VKWPEFWQ.js";e();e();async function g({clientId:a,operationIds:t,getOperation:n=l}){return Promise.all(t.map(async i=>{let o=await n({clientId:a,operationId:i});if(!o)throw new s(`Migration operation not found: ${i}`);return o}))}var r=class a extends m{static summary="Checks the status of app subscription migration operations.";static descriptionWithMarkdown="Checks app subscription migration operation status.\n\nRepeat `--id` for every operation GID returned by a multi-batch submission. With `--watch`, the command displays the current state while polling and outputs the final state after all requested operations reach a terminal status.\n\n`RUNNING` means an operation is still processing. `COMPLETED` means processing finished, but you must inspect the per-shop results to confirm each outcome. `FAILED` means the operation failed, and `CANCELED` means cancellation stopped further processing.\n\nUse `--json` to output every operation and its per-shop results as structured JSON.\n\nRun the command from an app project. By default, it uses the Client ID from the active app configuration. Use `--path` to select an app directory or `--config` to select a configuration. Pass `--client-id` to select a different app within the project. Use `--reset` to relink the app.";static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %> --id <operation-id>","<%= config.bin %> <%= command.id %> --path ../my-app --config staging --id <operation-id-1> --id <operation-id-2> --watch","<%= config.bin %> <%= command.id %> --client-id <client-id> --id <operation-id> --json"];static flags={...d,...p};static get jsonOutputSchema(){return u}async run(){let{flags:t}=await this.parse(a),{app:n,remoteApp:i}=await c({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config}),o=t.watch?await h({clientId:i.apiKey,operationIds:t.id}):await g({clientId:i.apiKey,operationIds:t.id});return f(o,t.json),{app:n}}};export{r as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as a}from"./chunk-
|
|
1
|
+
import{j as a}from"./chunk-H4V55Y3Z.js";import{h as s}from"./chunk-2VSNFOKD.js";import{g as i}from"./chunk-VKWPEFWQ.js";i();var n={LOCALHOST:"localhost",HTTP:"http",PUBSUB:"google-pub-sub",EVENTBRIDGE:"event-bridge"},p={LOCALHOST:new RegExp("^http:","i"),HTTP:new RegExp("^https:","i"),PUBSUB:new RegExp("^pubsub:"),EVENTBRIDGE:new RegExp("^arn:aws:events:")};function c(t,e){let r=T(t);return r===n.LOCALHOST&&e===n.HTTP?!0:r===e}function l(t){return p.LOCALHOST.test(t)?new URL(t.toLowerCase()).hostname==="localhost":!1}function d(t,e){if(!c(t,e))throw new s(`Can't deliver your webhook payload to this address using '${e}'`,"Use a valid URL for address",f(e));let r=e;return l(t)&&(r=n.LOCALHOST),[t.trim(),r]}function f(t){return t===n.HTTP?["For remote HTTP testing, use a URL that starts with https://","For local HTTP testing, use http://localhost:{port}/{url-path}"]:t===n.PUBSUB?["For Google Pub/Sub, use pubsub://{project-id}:{topic-id}"]:t===n.EVENTBRIDGE?["For Amazon EventBridge, use an Amazon Resource Name (ARN) starting with arn:aws:events:"]:[]}function g(t,e){if(e.includes(t))return t;throw new s(`Api Version '${t}' does not exist`,`Allowed values: ${e.join(", ")}`,["Try again with a valid api-version value"])}function A(t,e,r){if(r.length===0)throw new s(`No topics found for '${e}'`);let o=h(t.trim(),r);if(o===void 0)throw new s(`Topic '${t}' does not exist for ApiVersion '${e}'`,`Allowed values: ${r.join(", ")}`,["Try again with a valid api-version - topic pair"]);return o}function h(t,e){return e.includes(t)?t:e.find(r=>r.toUpperCase().replace("/","_")===t)}function T(t){if(t){if(t.startsWith("pubsub:"))return n.PUBSUB;if(t.startsWith("arn:aws:events:"))return n.EVENTBRIDGE;if(l(t))return n.LOCALHOST;if(p.HTTP.test(t))return n.HTTP}}i();async function O(t,e,r){let{sendSampleWebhook:o}=await t.sendSampleWebhook(e,r);return o}i();async function H(t,e,r){let o={method:"POST",body:e,headers:{"Content-Type":"application/json",...JSON.parse(r)}},u=await a(t,o);return u.status>=200&&u.status<300}i();async function m(t,e){let{publicApiVersions:r}=await t.apiVersions(e),o=r.indexOf("unstable");return o===-1?r.sort().reverse():(r.splice(o,1),r.sort().reverse(),r.push("unstable")),r}export{m as a,O as b,H as c,n as d,c as e,d as f,g,A as h,T as i};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as l}from"./chunk-7RPFJZLP.js";import{a as n}from"./chunk-FWB3GLMW.js";import{F as s,G as c,H as f,L as m,Na as g,t as p}from"./chunk-3C6VLJ5D.js";import{b as r,c as e}from"./chunk-Q2SZCZE7.js";import{b as F}from"./chunk-YTUUU33R.js";import{e as A,g as a}from"./chunk-VKWPEFWQ.js";a();var u=A(F(),1);var{config:U,...w}=n,o=class d extends l{static summary="Activate an app configuration.";static descriptionWithMarkdown="Sets default configuration when you run app-related CLI commands. If you omit the `config-name` parameter, then you'll be prompted to choose from the configuration files in your project.";static get jsonOutputSchema(){return s}static description=this.descriptionForHelp();static usage="app config use [config] [flags]";static flags={...r,...e,...w};static args={config:u.Args.string({description:"The name of the app configuration. Can be 'shopify.app.staging.toml' or simply 'staging'."})};async run(){let{flags:t,args:i}=await this.parse(d),h=p(t.path)?.configFile??null,{app:y}=await g({directory:t.path,userProvidedConfigName:i.config});await m(t.path);let C=await f({directory:t.path,configName:i.config,reset:t.reset,previousConfigFile:h});return await c(C,t.path,t.json?"json":"text"),{app:y}}};export{o as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as d}from"./chunk-VB7YQMAM.js";import{a as p,b as m}from"./chunk-GXORLBVN.js";import{d as r,j as c}from"./chunk-NDKSG4CC.js";import{a as s}from"./chunk-ZGV3HNEV.js";import{Ma as a}from"./chunk-3C6VLJ5D.js";import{c as n}from"./chunk-Q2SZCZE7.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();var t=class u extends s{static summary="Schedules manual-billing subscriptions to migrate to Shopify-managed app pricing.";static descriptionWithMarkdown="Schedules manual-billing subscriptions to migrate to Shopify-managed app pricing.\n\nWhen `--input` is omitted, the command reads CSV data from stdin. Use `--input <path>` to read from a file. `--input -` is also supported as an explicit stdin path.\n\n- Required CSV columns: `shop_id`, `target_plan_handle`, and `price_behavior`.\n- Optional CSV column: `notification`.\n- Example header: `shop_id,target_plan_handle,price_behavior,notification`.\n- Example row: `123456789,pro,HONOR_BILLING_PRICE,WHEN_REQUIRED`.\n\n`price_behavior` must be `HONOR_BILLING_PRICE` or `PLAN_PRICE`. `notification` can be `OPT_OUT` or `WHEN_REQUIRED` and defaults to `WHEN_REQUIRED` when omitted or blank.\n\nValidation is atomic: the command submits no operations unless the entire CSV is valid. Valid rows are submitted in batches of 250 shops. Preserve every operation GID printed by the command so you can check or cancel the submitted operations.\n\nRun the command from an app project. By default, it uses the Client ID from the active app configuration. Use `--path` to select an app directory or `--config` to select a configuration. Pass `--client-id` to select a different app within the project. Use `--reset` to relink the app.\n\nUse `--force` to skip confirmation and immediately submit every valid row. With `--watch`, human-readable output shows accepted identifiers before polling begins, then displays operation progress and the final outcome. With `--json --watch`, the command outputs one structured JSON document after every operation reaches a terminal status.";static description=this.descriptionForHelp();static examples=["<%= config.bin %> <%= command.id %> --input migrations.csv --force","cat migrations.csv | <%= config.bin %> <%= command.id %> --force","<%= config.bin %> <%= command.id %> --input migrations.csv --path ../my-app --config staging --force --json","<%= config.bin %> <%= command.id %> --input migrations.csv --client-id <client-id> --force","<%= config.bin %> <%= command.id %> --input - --force --watch"];static flags={...r,...n};static get jsonOutputSchema(){return c}async run(){let{flags:i}=await this.parse(u),{app:l,remoteApp:h}=await a({directory:i.path,clientId:i["client-id"],forceRelink:i.reset,userProvidedConfigName:i.config}),f=await d({action:"schedule",input:i.input??"-",clientId:h.apiKey,skipConfirmation:i.force,watch:i.watch,...i.watch&&!i.json?{onSubmissionAccepted:p}:{}}),e=m(f,{json:i.json,watch:i.watch});return e!==0&&(process.exitCode=e),{app:l}}};export{t as a};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{a as D}from"./chunk-ZGV3HNEV.js";import{a as T}from"./chunk-FWB3GLMW.js";import{$ as j,Ma as y,aa as k,ca as V}from"./chunk-3C6VLJ5D.js";import{ba as F}from"./chunk-WDFCOZAY.js";import{b as I,c as S}from"./chunk-Q2SZCZE7.js";import{A as R,C as b,I as A}from"./chunk-CZ22VZDA.js";import{a as h}from"./chunk-BN7ZXAZJ.js";import{d as w}from"./chunk-X7HVAVSZ.js";import{h as v,j as E}from"./chunk-2VSNFOKD.js";import{wb as x}from"./chunk-LWCTKI4Z.js";import{b as n}from"./chunk-FZCGRIOM.js";import{b as U}from"./chunk-YTUUU33R.js";import{e as M,g as i}from"./chunk-VKWPEFWQ.js";i();i();async function O(e){let{developerPlatformClient:s,app:a,remoteApp:r}=e,{extensionIdentifiersBreakdown:o,versionDetails:t}=await j(s,r,e.version),p=k({localApp:a,versionAppModules:t.appModuleVersions,activeAppVersion:await s.activeAppVersion(r)});if(!await V({configExtensionIdentifiersBreakdown:p,extensionIdentifiersBreakdown:o,appTitle:r.title,release:!0,allowUpdates:e.force||e.allowUpdates,allowDeletes:e.force||e.allowDeletes}))return{status:"cancelled"};let m=[{title:"Releasing version",task:async f=>{f.appRelease=await s.release({app:r,version:{versionId:t.uuid,appVersionId:t.id}})}}],{appRelease:{appRelease:l}}=await A(m);return l.userErrors&&l.userErrors.length>0?{status:"failed",version:t,userErrors:l.userErrors}:{status:"success",version:t}}i();var C=n.object({name:n.string(),clientId:n.string().min(1).describe("The client ID of the app receiving the release.")}).strict(),P=n.object({gid:n.string().regex(/^gid:\/\/shopify\/Version\/\d+$/).describe("The Shopify app version GID."),name:n.string().min(1).nullable().describe("The version tag, or null when no tag is available."),message:n.string().min(1).nullable().describe("The version message, or null when no message is available."),url:n.string().url().describe("The Developer Dashboard URL for this version.")}).strict(),L=n.object({version:P}).strict(),d=h({name:"AppReleaseResult",schema:n.discriminatedUnion("status",[n.object({status:n.literal("success"),app:C,release:L}).strict(),n.object({status:n.literal("cancelled")}).strict()]),definitions:{App:C,AppRelease:L,AppReleaseVersion:P}});i();function _(e,s){throw s==="text"&&e instanceof F?new v({bold:"Version couldn't be released."},["Version",{userInput:e.versionTag},"could not be found."]):e}function q(e,s,a){if(a==="json"){if(e.status==="failed"){let o=new v("Version couldn't be released.");throw o.details={userErrors:e.userErrors},o}x(d.encode(B(e,s)));return}if(e.status==="cancelled")throw new E;let r=[{link:{label:e.version.versionTag??void 0,url:e.version.location}},e.version.message?`
|
|
2
|
+
${e.version.message}`:""];if(e.status==="failed"){let o=e.userErrors.map(t=>t.message).join(", ");b({headline:"Version couldn't be released.",body:[...r,`${r.length>0?`
|
|
3
|
+
|
|
4
|
+
`:""}${o}`]})}else R({headline:"Version released to users.",body:r})}function B(e,s){return e.status==="cancelled"?{status:"cancelled"}:{status:"success",app:{name:s.title,clientId:s.apiKey},release:{version:{gid:e.version.uuid,name:e.version.versionTag===""?null:e.version.versionTag??null,message:e.version.message===""?null:e.version.message??null,url:e.version.location}}}}var c=M(U(),1);var g=class e extends D{static summary="Release an app version.";static usage="app release --version <version>";static descriptionWithMarkdown="Releases an existing app version. Pass the name of the version that you want to release using the `--version` flag.";static get jsonOutputSchema(){return d}static description=this.descriptionForHelp();static flags={...I,...T,...S,"allow-updates":c.Flags.boolean({hidden:!1,description:"Allows adding and updating extensions and configuration without requiring user confirmation. Recommended option for CI/CD environments. Required in non-interactive environments unless --allow-deletes is provided.",env:"SHOPIFY_FLAG_ALLOW_UPDATES"}),"allow-deletes":c.Flags.boolean({hidden:!1,description:"Allows removing extensions and configuration without requiring user confirmation. For CI/CD environments, the recommended flag is --allow-updates. Required in non-interactive environments unless --allow-updates is provided.",env:"SHOPIFY_FLAG_ALLOW_DELETES"}),version:c.Flags.string({hidden:!1,description:"The name of the app version to release.",env:"SHOPIFY_FLAG_VERSION",required:!0})};static nonTTYFlagRequirements(){return[{flags:["allow-updates","allow-deletes"]}]}async run(){let{flags:s}=await this.parse(e),a=s["client-id"];await w(()=>({cmd_app_reset_used:s.reset}));let r=s["allow-updates"],o=s["allow-deletes"],t=!!(r&&o),{app:p,remoteApp:u,developerPlatformClient:m}=await y({directory:s.path,clientId:a,forceRelink:s.reset,userProvidedConfigName:s.config}),l=await O({app:p,remoteApp:u,developerPlatformClient:m,force:t,allowUpdates:r,allowDeletes:o,version:s.version}).catch(f=>_(f,s.json?"json":"text"));return q(l,u,s.json?"json":"text"),{app:p}}};export{g as a};
|