shopify 5.0.0 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{analytics-VKKJNJ62.js → analytics-RSUIYNLC.js} +1 -1
- package/dist/analytics-V2SDYXQJ.js +1 -0
- package/dist/bootstrap.js +1 -1
- package/dist/{chunk-NK2MGR6A.js → chunk-2AW3KBTP.js} +1 -1
- package/dist/{chunk-BCYTZ7LM.js → chunk-2CJQQQW4.js} +1 -1
- package/dist/{chunk-EITIW5OX.js → chunk-2M4BKFYF.js} +1 -1
- package/dist/chunk-2M535QQJ.js +6 -0
- package/dist/{chunk-5TB52UUV.js → chunk-2NZ7GDDR.js} +1 -1
- package/dist/{chunk-YVY32DNA.js → chunk-2QQ7EBJD.js} +1 -1
- package/dist/chunk-2RFCYZMG.js +47 -0
- package/dist/{chunk-S67I4E7M.js → chunk-2S5NPJEJ.js} +1 -1
- package/dist/{chunk-YVVU4J5O.js → chunk-2TPLPZA2.js} +1 -1
- package/dist/{chunk-C3KEDG33.js → chunk-2YGPWG3I.js} +1 -1
- package/dist/{chunk-TTEF7GTX.js → chunk-32O27NE3.js} +1 -1
- package/dist/{chunk-24NUJTIH.js → chunk-364BVGRY.js} +1 -1
- package/dist/{chunk-BJPDJIS4.js → chunk-36TZ447N.js} +1 -1
- package/dist/{chunk-5UWMXOHM.js → chunk-37P5YOP2.js} +1 -1
- package/dist/{chunk-4CRBTSVP.js → chunk-3G2PEYPI.js} +1 -1
- package/dist/{chunk-EXFBZPZS.js → chunk-3JACWBUC.js} +1 -1
- package/dist/{chunk-53BG3NLH.js → chunk-43HKFLOU.js} +1 -1
- package/dist/chunk-46JYM3GH.js +1 -0
- package/dist/{chunk-XITZIDCL.js → chunk-4EDE3UH7.js} +1 -1
- package/dist/{chunk-G6ZMSWEU.js → chunk-4GQEXVDT.js} +1 -1
- package/dist/{chunk-SNNZ4U2W.js → chunk-4IUXLUFD.js} +1 -1
- package/dist/{chunk-ULD7CIOY.js → chunk-4QZ6OBXL.js} +1 -1
- package/dist/{chunk-YKS7MH3F.js → chunk-4SDCXKYR.js} +1 -1
- package/dist/{chunk-VB7YQMAM.js → chunk-56GKTWFF.js} +1 -1
- package/dist/{chunk-Q66CI37F.js → chunk-5AQ5JT2V.js} +1 -1
- package/dist/{chunk-Q2SZCZE7.js → chunk-5AWELO3D.js} +1 -1
- package/dist/{chunk-VHUD3CBC.js → chunk-5D4FNAAD.js} +1 -1
- package/dist/{chunk-46MSIQ6Z.js → chunk-5TWYJQQO.js} +1 -1
- package/dist/{chunk-OGWPS55W.js → chunk-5XOEMYEQ.js} +1 -1
- package/dist/{chunk-MR2AUT7Q.js → chunk-5YUDEPEY.js} +1 -1
- package/dist/{chunk-CCQNP5YR.js → chunk-5YXYYQBX.js} +1 -1
- package/dist/{chunk-P33TONYG.js → chunk-63UKZLPC.js} +1 -1
- package/dist/chunk-6JZC6UKY.js +20 -0
- package/dist/{chunk-7QUZWCJZ.js → chunk-6Y6A2QGK.js} +1 -1
- package/dist/{chunk-M7LPHCP2.js → chunk-75LAVRRL.js} +2 -2
- package/dist/{chunk-AJMDF3QC.js → chunk-7AWAOPLA.js} +1 -1
- package/dist/{chunk-AXC2MHHO.js → chunk-7NYCJG2U.js} +1 -1
- package/dist/{chunk-6DXP7PQ7.js → chunk-7U2MTK6I.js} +1 -1
- package/dist/{chunk-JEA3C7ON.js → chunk-7XAEI4XT.js} +1 -1
- package/dist/{chunk-TPSA4JN5.js → chunk-A7LBGXWG.js} +1 -1
- package/dist/{chunk-2CMEKSI7.js → chunk-ADVLRSSO.js} +1 -1
- package/dist/{chunk-3LVCG4JB.js → chunk-AIEVQSI3.js} +1 -1
- package/dist/{chunk-M4BVLMPH.js → chunk-AOBE6HN6.js} +1 -1
- package/dist/{chunk-PSSYLJG4.js → chunk-AQ34X5B3.js} +1 -1
- package/dist/{chunk-43KLFFP7.js → chunk-B2VE7WOX.js} +1 -1
- package/dist/{chunk-L7MSPGDS.js → chunk-B4ISKIXN.js} +1 -1
- package/dist/{chunk-EMSF57ZB.js → chunk-BB7GAZP6.js} +1 -1
- package/dist/chunk-BNTOGZLY.js +1 -0
- package/dist/chunk-BU3JQM3W.js +1 -0
- package/dist/{chunk-LHKVXJPX.js → chunk-C3LL5CZA.js} +1 -1
- package/dist/{chunk-GFVKTWFT.js → chunk-C4EKNOLY.js} +1 -1
- package/dist/{chunk-5NEGOQT6.js → chunk-CFUZ6574.js} +1 -1
- package/dist/{chunk-NB4BRW3H.js → chunk-CKVVJ4XO.js} +1 -1
- package/dist/{chunk-VWH3VPYI.js → chunk-CNPBDSDL.js} +1 -1
- package/dist/{chunk-U25W35TX.js → chunk-CWR3IFXD.js} +1 -1
- package/dist/{chunk-VW6QS7DO.js → chunk-CX3ANDPI.js} +1 -1
- package/dist/{chunk-GB6E3ATN.js → chunk-CXPYOLGM.js} +1 -1
- package/dist/{chunk-FWB3GLMW.js → chunk-D4LFWIFE.js} +1 -1
- package/dist/{chunk-PZUGDE7N.js → chunk-DM7BTMFP.js} +1 -1
- package/dist/{chunk-GRGFA26K.js → chunk-DSKAIC7O.js} +1 -1
- package/dist/{chunk-M5TGCSUK.js → chunk-DTRENW4Q.js} +1 -1
- package/dist/{chunk-EGCWR5AS.js → chunk-DVW7NDVD.js} +1 -1
- package/dist/{chunk-YGYEM6QO.js → chunk-E3CTHNQS.js} +1 -1
- package/dist/{chunk-6BNKBCCU.js → chunk-EA5XVQJT.js} +1 -1
- package/dist/{chunk-XM7YUXTF.js → chunk-EH22T4FI.js} +2 -2
- package/dist/{chunk-XNNKLUTN.js → chunk-ETXBF6Q7.js} +1 -1
- package/dist/{chunk-AYL6KBPE.js → chunk-EXTVC33U.js} +1 -1
- package/dist/{chunk-J6TW43TG.js → chunk-F3OM2YO6.js} +1 -1
- package/dist/{chunk-X7HVAVSZ.js → chunk-FHNJLON5.js} +1 -1
- package/dist/{chunk-SFPXYHHL.js → chunk-FK5OFLSJ.js} +1 -1
- package/dist/{chunk-NDKSG4CC.js → chunk-FNWXMCSD.js} +1 -1
- package/dist/{chunk-KKPOOIE4.js → chunk-FPOZMNT2.js} +1 -1
- package/dist/{chunk-HIRTL45Q.js → chunk-FS5PZCZ3.js} +1 -1
- package/dist/{chunk-Q5MEFIMV.js → chunk-FTHVOIK7.js} +1 -1
- package/dist/chunk-FVRI7ZKE.js +103 -0
- package/dist/{chunk-CIK5BF7V.js → chunk-GCKGQFV7.js} +1 -1
- package/dist/{chunk-PEVIRAMR.js → chunk-GGJUPL4W.js} +1 -1
- package/dist/{chunk-R7EMV77H.js → chunk-GHU6YEXH.js} +1 -1
- package/dist/{chunk-WGUOLSMG.js → chunk-GNPIKPHB.js} +1 -1
- package/dist/{chunk-3A3DZVEJ.js → chunk-GSGCSBRN.js} +1 -1
- package/dist/{chunk-PIAD3F6M.js → chunk-H57KYDEI.js} +1 -1
- package/dist/{chunk-GAMC2BNY.js → chunk-HNU6R7RT.js} +1 -1
- package/dist/{chunk-UOS2XLGG.js → chunk-HP2ZAAY7.js} +1 -1
- package/dist/{chunk-IEQ4UOH3.js → chunk-HPT3UXZ5.js} +1 -1
- package/dist/chunk-HT66BOEC.js +8 -0
- package/dist/{chunk-4ARCB6DT.js → chunk-HXNGLDMU.js} +1 -1
- package/dist/{chunk-BVSKBX7T.js → chunk-IAL6IQYW.js} +1 -1
- package/dist/{chunk-4RDFMBRG.js → chunk-IULZYDCI.js} +1 -1
- package/dist/{chunk-UIQL5ZF3.js → chunk-IWTOC6DG.js} +1 -1
- package/dist/{chunk-2ORRV7GH.js → chunk-IY5EI5V2.js} +1 -1
- package/dist/{chunk-ZT5WFUKJ.js → chunk-J3UXIC23.js} +1 -1
- package/dist/{chunk-Q2XRITUG.js → chunk-J5DUFSR4.js} +1 -1
- package/dist/{chunk-2VSNFOKD.js → chunk-J7BTC45S.js} +1 -1
- package/dist/{chunk-SL3VBI62.js → chunk-JMVK2BIB.js} +1 -1
- package/dist/{chunk-X2H6I2WW.js → chunk-JUTULEWW.js} +1 -1
- package/dist/{chunk-KGRIYAMA.js → chunk-K3YALQBQ.js} +1 -1
- package/dist/{chunk-SFQEHDJY.js → chunk-KGASGUDQ.js} +1 -1
- package/dist/{chunk-LDU5T3DN.js → chunk-KLYGMYXV.js} +1 -1
- package/dist/{chunk-7WPUV7GY.js → chunk-KNQXCU3Y.js} +1 -1
- package/dist/{chunk-C7V755IT.js → chunk-KOTZSPZA.js} +1 -1
- package/dist/{chunk-DJAZBPYA.js → chunk-KT5QQOES.js} +1 -1
- package/dist/{chunk-4SS6DXC7.js → chunk-KVF55INC.js} +1 -1
- package/dist/{chunk-MXJAH2GW.js → chunk-L6VONMA2.js} +1 -1
- package/dist/{chunk-GXORLBVN.js → chunk-LENSEW2F.js} +1 -1
- package/dist/{chunk-7UOA4DI7.js → chunk-LGXNXAQA.js} +1 -1
- package/dist/{chunk-ZYQ2XWC5.js → chunk-LR4J4KYJ.js} +1 -1
- package/dist/{chunk-QN3774QI.js → chunk-LWMKZJ4M.js} +1 -1
- package/dist/{chunk-I4OVLRQR.js → chunk-M2KX3PXA.js} +1 -1
- package/dist/{chunk-D7NB7YR6.js → chunk-M73IECPW.js} +1 -1
- package/dist/{chunk-4TI7U2PN.js → chunk-M7NLCGCP.js} +1 -1
- package/dist/chunk-MHWETFNT.js +1 -0
- package/dist/{chunk-CCMDZX35.js → chunk-MMUGP3WP.js} +1 -1
- package/dist/{chunk-LMQGNECW.js → chunk-MNWT2SQO.js} +1 -1
- package/dist/{chunk-R2BDABJD.js → chunk-MS7DTL4U.js} +1 -1
- package/dist/{chunk-OVWUGAEU.js → chunk-MU2X7NGF.js} +1 -1
- package/dist/{chunk-GCNA3HXH.js → chunk-MXXMIPUN.js} +1 -1
- package/dist/{chunk-POKY4RWR.js → chunk-MZCIRMZJ.js} +1 -1
- package/dist/{chunk-PGLWZMJU.js → chunk-MZWPIFAM.js} +1 -1
- package/dist/{chunk-H4V55Y3Z.js → chunk-NCPZVARH.js} +83 -83
- package/dist/{chunk-3G4HJO72.js → chunk-NJVNGEOU.js} +1 -1
- package/dist/{chunk-CEIJKJOF.js → chunk-NMECLRGK.js} +1 -1
- package/dist/{chunk-UVRKTMF7.js → chunk-NMLLRFZF.js} +1 -1
- package/dist/chunk-NPB753M3.js +1 -0
- package/dist/{chunk-ZAA2DXK5.js → chunk-NUCDRKDW.js} +1 -1
- package/dist/{chunk-UZROQRLX.js → chunk-OH7BQZQ7.js} +1 -1
- package/dist/{chunk-ZQDDRIBA.js → chunk-OLKLHVHA.js} +4 -4
- package/dist/{chunk-7MVWDCI3.js → chunk-OPVXPDOQ.js} +1 -1
- package/dist/{chunk-IWEKM5Y3.js → chunk-OQUXGAF2.js} +1 -1
- package/dist/{chunk-IUTZIN2T.js → chunk-OUMERKRE.js} +1 -1
- package/dist/{chunk-5OMJFPQW.js → chunk-OYGIQDME.js} +1 -1
- package/dist/{chunk-KSDU4YOB.js → chunk-P5W5RVE6.js} +1 -1
- package/dist/{chunk-PYIICTLX.js → chunk-PNZURX3S.js} +1 -1
- package/dist/{chunk-UK6576EO.js → chunk-PRKJVU4Y.js} +1 -1
- package/dist/{chunk-DFQ4WTET.js → chunk-PVASYKSJ.js} +1 -1
- package/dist/{chunk-CW2T7EOQ.js → chunk-PXFPVGWV.js} +1 -1
- package/dist/{chunk-7LAKWAKX.js → chunk-Q2ORJEB2.js} +1 -1
- package/dist/{chunk-XKRJKUA7.js → chunk-QBE6XVU3.js} +1 -1
- package/dist/{chunk-N2RFDHRY.js → chunk-QGWC23HQ.js} +1 -1
- package/dist/{chunk-GQNOVEKP.js → chunk-QVVQUJQL.js} +1 -1
- package/dist/{chunk-WMAFG2JD.js → chunk-QX3T6G5X.js} +1 -1
- package/dist/{chunk-VMMUJN4T.js → chunk-QYFU363G.js} +1 -1
- package/dist/{chunk-7NSK77WG.js → chunk-RDXLDCMI.js} +1 -1
- package/dist/{chunk-JYMDWR25.js → chunk-REDUS6EW.js} +1 -1
- package/dist/{chunk-FNLECT7B.js → chunk-RFZNFTVM.js} +1 -1
- package/dist/{chunk-LWCTKI4Z.js → chunk-RIG66DIQ.js} +3 -3
- package/dist/{chunk-YTUDXZLN.js → chunk-RNUEPPVN.js} +1 -1
- package/dist/{chunk-RFGEM5JC.js → chunk-RWTAPWLJ.js} +1 -1
- package/dist/{chunk-WFWISGLS.js → chunk-T5YVYVSW.js} +1 -1
- package/dist/{chunk-WJSUIUBW.js → chunk-TTBNFGCW.js} +1 -1
- package/dist/{chunk-OQ5CLM2H.js → chunk-UDPYSL3M.js} +1 -1
- package/dist/{chunk-KDPQXURV.js → chunk-ULMNNGGX.js} +1 -1
- package/dist/{chunk-T2IUXXCT.js → chunk-URCH4ITT.js} +1 -1
- package/dist/{chunk-NOH63WC6.js → chunk-UU2R56LN.js} +1 -1
- package/dist/{chunk-CVVQQLCF.js → chunk-V2FCZC7U.js} +1 -1
- package/dist/{chunk-CZ22VZDA.js → chunk-V654BMS7.js} +108 -108
- package/dist/{chunk-7IFE4UQY.js → chunk-V7H7ITCF.js} +1 -1
- package/dist/{chunk-MYAIWSOO.js → chunk-VG2AESTZ.js} +1 -1
- package/dist/{chunk-XTREQ4A2.js → chunk-VXD26GIG.js} +1 -1
- package/dist/{chunk-QKVVJXWS.js → chunk-VXL5FBE7.js} +1 -1
- package/dist/{chunk-I6FRVYGE.js → chunk-W7S6SYBM.js} +1 -1
- package/dist/{chunk-HCZG7YJ6.js → chunk-WAY723TL.js} +1 -1
- package/dist/chunk-WFOU5M4H.js +16 -0
- package/dist/{chunk-BWRNXCVN.js → chunk-WGOSE3RL.js} +1 -1
- package/dist/{chunk-KJQDS5HI.js → chunk-WQ6W725N.js} +1 -1
- package/dist/{chunk-52FDK2LC.js → chunk-WQOPLNDH.js} +1 -1
- package/dist/{chunk-4GCI2YCZ.js → chunk-X4A5D3PZ.js} +1 -1
- package/dist/{chunk-2DID73ML.js → chunk-X7DCL5LT.js} +1 -1
- package/dist/{chunk-RVQV6G5M.js → chunk-XDXHSGDL.js} +1 -1
- package/dist/{chunk-OX7UVDSU.js → chunk-XKKKMV46.js} +1 -1
- package/dist/{chunk-FDXHQZTO.js → chunk-XRVJJG6W.js} +16 -16
- package/dist/chunk-XV6XCOTG.js +319 -0
- package/dist/{chunk-M3ACZWMR.js → chunk-XYFYQWKW.js} +1 -1
- package/dist/{chunk-UWMZ5CSB.js → chunk-XZLM4HLO.js} +1 -1
- package/dist/{chunk-FFHH5LOR.js → chunk-YCUEDZDA.js} +1 -1
- package/dist/{chunk-XBQDMGUN.js → chunk-YFRI75U4.js} +1 -1
- package/dist/{chunk-XMODGI45.js → chunk-YQ63ZFYT.js} +1 -1
- package/dist/{chunk-4GOJQKY5.js → chunk-YXIFSIRX.js} +1 -1
- package/dist/{chunk-MDRVCBDO.js → chunk-ZBVHPC6W.js} +1 -1
- package/dist/{chunk-IQVRP7CT.js → chunk-ZHHTQRWU.js} +1 -1
- package/dist/{chunk-Z5SILNH2.js → chunk-ZTZGDZCE.js} +1 -1
- package/dist/{chunk-OQU3HLAE.js → chunk-ZVEBXHEY.js} +1 -1
- package/dist/cli/commands/app/build.js +1 -1
- package/dist/cli/commands/app/bulk/cancel.js +1 -1
- package/dist/cli/commands/app/bulk/execute.js +1 -1
- package/dist/cli/commands/app/bulk/status.js +1 -1
- package/dist/cli/commands/app/config/link.js +1 -1
- package/dist/cli/commands/app/config/pull.js +1 -1
- package/dist/cli/commands/app/config/use.js +1 -1
- package/dist/cli/commands/app/config/validate.js +1 -1
- package/dist/cli/commands/app/demo/watcher.js +1 -1
- package/dist/cli/commands/app/deploy.js +1 -1
- package/dist/cli/commands/app/dev/clean.js +1 -1
- package/dist/cli/commands/app/dev.js +1 -1
- package/dist/cli/commands/app/env/pull.js +1 -1
- package/dist/cli/commands/app/env/show.js +1 -1
- package/dist/cli/commands/app/execute.js +1 -1
- package/dist/cli/commands/app/function/build.js +1 -1
- package/dist/cli/commands/app/function/info.js +1 -1
- package/dist/cli/commands/app/function/replay.js +1 -1
- package/dist/cli/commands/app/function/run.js +1 -1
- package/dist/cli/commands/app/function/schema.js +1 -1
- package/dist/cli/commands/app/function/typegen.js +1 -1
- package/dist/cli/commands/app/generate/extension.js +1 -1
- package/dist/cli/commands/app/graphiql.js +1 -1
- package/dist/cli/commands/app/import/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.js +1 -1
- package/dist/cli/commands/doc/search.js +1 -1
- package/dist/cli/commands/docs/generate.js +1 -1
- package/dist/cli/commands/doctor-release/doctor-release.js +1 -1
- package/dist/cli/commands/doctor-release/theme/index.js +1 -1
- package/dist/cli/commands/help.js +1 -1
- package/dist/cli/commands/kitchen-sink/async.js +1 -1
- package/dist/cli/commands/kitchen-sink/index.js +1 -1
- package/dist/cli/commands/kitchen-sink/prompts.js +1 -1
- package/dist/cli/commands/kitchen-sink/static.js +1 -1
- package/dist/cli/commands/notifications/generate.js +1 -1
- package/dist/cli/commands/notifications/list.js +1 -1
- package/dist/cli/commands/organization/list.js +1 -1
- package/dist/cli/commands/search.js +1 -1
- package/dist/cli/commands/send-analytics.js +1 -1
- package/dist/cli/commands/theme/check.js +1 -1
- package/dist/cli/commands/theme/console.js +1 -1
- package/dist/cli/commands/theme/delete.js +1 -1
- package/dist/cli/commands/theme/dev.js +1 -1
- package/dist/cli/commands/theme/duplicate.js +1 -1
- package/dist/cli/commands/theme/info.js +1 -1
- package/dist/cli/commands/theme/init.js +1 -1
- package/dist/cli/commands/theme/language-server.js +1 -1
- package/dist/cli/commands/theme/list.js +1 -1
- package/dist/cli/commands/theme/metafields/pull.js +1 -1
- package/dist/cli/commands/theme/open.js +1 -1
- package/dist/cli/commands/theme/package.js +1 -1
- package/dist/cli/commands/theme/preview.js +1 -1
- package/dist/cli/commands/theme/profile.js +1 -1
- package/dist/cli/commands/theme/publish.js +1 -1
- package/dist/cli/commands/theme/pull.js +1 -1
- package/dist/cli/commands/theme/push.js +1 -1
- package/dist/cli/commands/theme/rename.js +1 -1
- package/dist/cli/commands/theme/share.js +1 -1
- package/dist/cli/commands/upgrade.js +1 -1
- package/dist/cli/commands/version.js +1 -1
- package/dist/cli/help.js +1 -1
- package/dist/{command-json-schema-2UMKY7MY.js → command-json-schema-6EGXCM4B.js} +1 -1
- package/dist/command-registry.js +1 -1
- package/dist/{conf-store-RI3TL6I4.js → conf-store-E7ELDWBA.js} +1 -1
- package/dist/{custom-oclif-loader-IZCKN67O.js → custom-oclif-loader-FKFZJPHF.js} +1 -1
- package/dist/{deprecations-IFVUXXDB.js → deprecations-RNGBHZYB.js} +1 -1
- package/dist/dist-VHIZZDYK.js +1 -0
- package/dist/dist-WXI5YQYP.js +1 -0
- package/dist/{environments-CYMEN7NV.js → environments-WZJ6MRTH.js} +1 -1
- package/dist/{error-IL6WQMSW.js → error-IFB626JA.js} +1 -1
- package/dist/error-handler-OVJYVIOZ.js +1 -0
- package/dist/{fs-AINFLJ2E.js → fs-7UOUHJDO.js} +1 -1
- package/dist/hooks/did-you-mean.js +1 -1
- package/dist/hooks/hydrogen-init.js +1 -1
- package/dist/hooks/postrun.js +1 -1
- package/dist/hooks/prerun.js +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 +12 -12
- package/dist/{is-global-2VLKV46Q.js → is-global-XW3CVHLK.js} +1 -1
- package/dist/{json-error-HZB5YIHV.js → json-error-C2U7ZLCG.js} +1 -1
- package/dist/{local-KOZETREJ.js → local-KA3IWOZ6.js} +1 -1
- package/dist/{metadata-IBPHZB7N.js → metadata-6JI7HF5B.js} +1 -1
- package/dist/{node-package-manager-DXSRNEDC.js → node-package-manager-X3QIEMMX.js} +1 -1
- package/dist/{notifications-system-XA3EBOGJ.js → notifications-system-OXGLT2R4.js} +1 -1
- package/dist/{os-X73O7BAB.js → os-NORIEVMI.js} +1 -1
- package/dist/{output-3OYXK3Z5.js → output-K3JTLRJD.js} +1 -1
- package/dist/{system-JWYYT4PM.js → system-LTHR2T7L.js} +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/{ui-PCG5D6RZ.js → ui-MYUBVKCK.js} +1 -1
- package/dist/upgrade-MFTWBXL3.js +1 -0
- package/dist/version-BNGPPAUU.js +1 -0
- package/dist/{version-7DGU2KYH.js → version-RCGFWSB4.js} +1 -1
- package/dist/{workerd-MQZ3NKJI.js → workerd-ISSXMKIH.js} +1 -1
- package/oclif.manifest.json +6 -3
- package/package.json +7 -7
- package/dist/analytics-Q6QDIDYT.js +0 -1
- package/dist/chunk-3C6VLJ5D.js +0 -319
- package/dist/chunk-43R5VGKT.js +0 -1
- package/dist/chunk-4C2DAX5T.js +0 -1
- package/dist/chunk-7RPFJZLP.js +0 -1
- package/dist/chunk-DNMXVMJM.js +0 -47
- package/dist/chunk-IUP7POIE.js +0 -6
- package/dist/chunk-JDR6UVZA.js +0 -8
- package/dist/chunk-JOJV5E2K.js +0 -1
- package/dist/chunk-LVLAOBJM.js +0 -103
- package/dist/chunk-PMHP57MH.js +0 -20
- package/dist/chunk-WDFCOZAY.js +0 -16
- package/dist/chunk-ZGV3HNEV.js +0 -1
- package/dist/dist-4H2B7BMN.js +0 -1
- package/dist/dist-QNWOGQN3.js +0 -1
- package/dist/error-handler-74HKA23T.js +0 -1
- package/dist/upgrade-7U2TUNC4.js +0 -1
- package/dist/version-SXQTRBXB.js +0 -1
package/dist/chunk-43R5VGKT.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as s}from"./chunk-YTUUU33R.js";import{a as o}from"./chunk-JD5P5RAJ.js";import{e as i,g as n}from"./chunk-VKWPEFWQ.js";n();var t=i(s(),1),a={"no-input":t.Flags.boolean({description:"Disable interactive prompts and browser authentication.",env:"SHOPIFY_FLAG_NO_INPUT"})};function u(r=process.argv,e=process.env){return r.includes("--no-input")||o(e.SHOPIFY_FLAG_NO_INPUT)}export{a,u as b};
|
package/dist/chunk-4C2DAX5T.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as I}from"./chunk-VKWPEFWQ.js";I();var o="5.0.0";export{o as a};
|
package/dist/chunk-7RPFJZLP.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as o}from"./chunk-MDRVCBDO.js";import{g as e}from"./chunk-VKWPEFWQ.js";e();var t=class extends o{};export{t as a};
|
package/dist/chunk-DNMXVMJM.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import{k as j,t as M}from"./chunk-5TB52UUV.js";import{a as F}from"./chunk-Q7BOSHWX.js";import{a as _}from"./chunk-AJMDF3QC.js";import{L as I,N as q,k as w,va as f,xa as h}from"./chunk-H4V55Y3Z.js";import{a as x}from"./chunk-4C2DAX5T.js";import{C as L,D as O,U as P}from"./chunk-CZ22VZDA.js";import{h as l,j as U}from"./chunk-2VSNFOKD.js";import{Bb as c,qb as R,sb as D}from"./chunk-LWCTKI4Z.js";import{i as H,j as v}from"./chunk-FZCGRIOM.js";import{u as N}from"./chunk-3A3DZVEJ.js";import{g as p}from"./chunk-VKWPEFWQ.js";p();p();function G(e){let t=new URLSearchParams;for(let[r,o]of Object.entries(e.replaceTemplates??[]))t.append(`replace_templates[${r}]`,o);for(let[r,o]of Object.entries(e.replaceExtensionTemplates??[])){let s=r.split("/")[0];t.append(`replace_extension_templates[${s}][${r}]`,o)}return t.append("_method",e.method),t}function S(){return{"User-Agent":`Shopify CLI; v=${x}`}}function T(e){return delete e.cookie,delete e.authorization,e}p();function y(e){let t={};return e.split(";").forEach(r=>{let o=r.match(/(.*?)=(.*)$/)??[],s=o[1]?.trim(),n=o[2]?.trim()??"";s&&(t[s]=n)}),t}function E(e){return Object.entries(e).map(([t,r])=>`${t}=${r}`).join("; ")}var $=class extends l{};async function Ie(e){return M(e)}async function qe(e,t,r){let o=X(t),s=new URLSearchParams;s.append("form_type","storefront_password"),s.append("utf8","\u2713"),s.append("password",e??""),h("theme-service:storefront-session:check-storefront-password");let n={"cache-control":"no-cache","content-type":"application/x-www-form-urlencoded",...r},a=await w(`${o}/password`,{headers:n,body:s.toString(),method:"POST",redirect:"manual"});if(a.status===429)throw f(new l(`Too many incorrect password attempts. Please try again after ${a.headers.get("retry-after")} seconds.`));return V(a,o)}async function B(e,t,r,o,s={}){let n={},a=await W(e,r,s),i=X(t);if(n._shopify_essential=a,h(`theme-service:storefront-session:is-password-protected:${!!o}`),!o)return n;let u=await se(a,e,i,o,s);return{...n,...u}}var ne=1;async function W(e,t,r,o=1){let s=new URLSearchParams({preview_theme_id:t,_fd:"0",pb:"0"}),n=`${e}?${s}`;h("theme-service:storefront-session:get-session-essential-cookie");let a={...r,...S()},i=await w(n,{method:"HEAD",redirect:"manual",headers:a}),u=i.headers.raw()["set-cookie"]??[],d=C(u,"_shopify_essential");if(!d){if(c(`Failed to obtain _shopify_essential cookie.
|
|
2
|
-
|
|
3
|
-
-Request ID: ${i.headers.get("x-request-id")??"unknown"}
|
|
4
|
-
|
|
5
|
-
-Body: ${await i.text()}
|
|
6
|
-
|
|
7
|
-
-Status: ${i.status}
|
|
8
|
-
`),o>3)throw f(new $('Your development session could not be created because the "_shopify_essential" could not be defined. Please, check your internet connection.'));return c("Retrying to obtain the _shopify_essential cookie..."),await P(o),W(e,t,r,o+1)}return z(i,n,d,a)}async function z(e,t,r,o,s=0){let n=e.headers.get("location");if(!n||s>=ne)return r;let a=new URL(n,t);if(a.origin!==new URL(t).origin||!a.searchParams.has("preview_theme_id"))return r;let i=await w(a.toString(),{method:"HEAD",redirect:"manual",headers:{...o,Cookie:E({_shopify_essential:r})}}),u=i.headers.raw()["set-cookie"]??[],d=C(u,"_shopify_essential");return d||c(`Preview redirect to ${a.pathname} did not set a new _shopify_essential cookie; keeping the previous one.`),z(i,a.toString(),d??r,o,s+1)}async function se(e,t,r,o,s){let n=new URLSearchParams({password:o}),a={...s,...S(),Cookie:E({_shopify_essential:e})},i=await w(`${t}/password`,{method:"POST",redirect:"manual",body:n,headers:a});if(!V(i,r))throw f(new l("Your development session could not be created because the store password is invalid. Please, retry with a different password."));let u=i.headers.raw()["set-cookie"]??[],d=C(u,"storefront_digest"),m=C(u,"_shopify_essential"),g={};return d&&(g.storefront_digest=d),m&&(g._shopify_essential=m),g}function V(e,t){let r=e.headers.get("location")??"",o;try{o=new URL(r,t)}catch(n){if(n instanceof TypeError)return!1;throw n}let s=new URL(t).origin;return e.status===302&&o.origin===s}function C(e,t){let r=e.find(s=>y(s)[t]);return r?y(r)[t]:void 0}function X(e){return`https://${e}`}p();p();function ae(e,t){if(!(t instanceof U)){if(f(t),v()==="json"){H({type:"diagnostic",level:"error",message:`${e}
|
|
9
|
-
${t.message}`});return}t instanceof l?(t.message=`${e}
|
|
10
|
-
${t.message}`,O(t)):(L({headline:e,body:t.message}),c(`${e}
|
|
11
|
-
${t.stack??t.message}`))}}function Me(e,t){let r={delete:`Failed to delete file "${e}" from remote theme.`,upload:`Failed to upload file "${e}" to remote theme.`,default:e}[t??"default"]??e;return o=>{ae(r,o)}}function k(e,t){return F({status:e.status??502,statusText:e.statusText??"Bad Gateway",cause:e,data:{url:(t??e.url)?.toString(),requestId:e.headers?.get("x-request-id")??void 0}})}function Ge(e,t="Unexpected error during fetch"){let r=e,o=r.statusCode??502,s=r.statusMessage??"Bad Gateway",n=`${t.replace(/\.$/,"")} with status ${o} (${s}).`;r.data?.requestId&&(n+=`
|
|
12
|
-
Request ID: ${r.data.requestId}`),r.data?.url&&(n+=`
|
|
13
|
-
URL: ${r.data.url}`);let a=r.cause??e;return{headline:n,body:a.stack??r.stack??r.message??s,status:o,statusText:s,cause:a,requestId:r.data?.requestId,url:r.data?.url}}var ie={_fd:"0",pb:"0"};async function Je(e,t){let r=fe(e,t),s={...await ce(e,t),...S()},n,a=Object.keys({...t.replaceTemplates,...t.replaceExtensionTemplates});if(a.length>0){c(`\u2192 Rendering ${r} (with ${a})...`);let m=G(t);n=await fetch(r,{method:"POST",body:m,redirect:"manual",headers:s}).catch(g=>{throw k(f(g),r)})}else c(`\u2192 Rendering ${r}...`),n=await fetch(r,{method:t.method,redirect:"manual",headers:s}).catch(m=>{throw k(f(m),r)});let i=n.headers.get("x-request-id");c(`\u2190 ${n.status} (request_id: ${i})`);let d=n.headers.get("Content-Type")?.includes("application/json");return n=new Response(n.body,n),d||n.headers.delete("Content-Type"),n}async function ce(e,t){return K(e)?de(e,t):ue(e,t)}async function ue(e,t){let r=await Y(e,t),o=e.storefrontToken;return T({...t.headers,...e.crawlerSignatureHeaders,Authorization:`Bearer ${o}`,Cookie:r})}async function de(e,t){let r=await Y(e,t),o=e.storefrontToken,s={},n=["ACCEPT","CONTENT-TYPE","CONTENT-LENGTH"];for(let[a,i]of Object.entries(t.headers))n.includes(a.toUpperCase())&&(s[a]=i);return T({...s,...pe(e),...e.crawlerSignatureHeaders,Authorization:`Bearer ${o}`,Cookie:r})}function Y(e,t){let r=y(t.headers.cookie??t.headers.Cookie??""),o=e.sessionCookies??{};return E({...r,...o})}function fe(e,{path:t,sectionId:r,appBlockId:o,query:s}){let a=`${b(e)}${t}`,i=new URLSearchParams(ie);for(let[u,d]of s)i.append(u,d);return r?i.append("section_id",r):o&&i.append("app_block_id",o),`${a}?${i}`}function b(e){return K(e)?`https://${N()}/cli/sfr`:`https://${e.storeFqdn}`}function K(e){return e.token.startsWith("shptka_")}function pe(e){return{"X-Shopify-Shop":e.storeFqdn,"X-Shopify-Access-Token":e.token}}p();var A="Shopify CLI",le=720*60*60,Q=["Signature","Signature-Input","Signature-Agent"],J="unstable",me=`
|
|
14
|
-
query StorefrontCrawlerSignatures($first: Int!, $expired: Boolean, $cli: Boolean, $domain: String) {
|
|
15
|
-
storefrontCrawlerSignatures(first: $first, expired: $expired, cli: $cli, domain: $domain) {
|
|
16
|
-
edges {
|
|
17
|
-
node {
|
|
18
|
-
id
|
|
19
|
-
name
|
|
20
|
-
domainHost
|
|
21
|
-
signature
|
|
22
|
-
signatureInput
|
|
23
|
-
signatureAgent
|
|
24
|
-
expiresAt
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
`,he=`
|
|
30
|
-
mutation StorefrontCrawlerSignatureGenerate($timeToLive: Int!, $name: String!, $domainHost: String!, $cli: Boolean) {
|
|
31
|
-
storefrontCrawlerSignatureGenerate(timeToLive: $timeToLive, name: $name, domainHost: $domainHost, cli: $cli) {
|
|
32
|
-
id
|
|
33
|
-
signature
|
|
34
|
-
signatureInput
|
|
35
|
-
signatureAgent
|
|
36
|
-
name
|
|
37
|
-
expiresAt
|
|
38
|
-
domainHost
|
|
39
|
-
userErrors {
|
|
40
|
-
field
|
|
41
|
-
message
|
|
42
|
-
code
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
`;async function te(e,t=e.storeFqdn){try{let o=(await _(me,e,{first:1,expired:!1,cli:!0,domain:t},J)).storefrontCrawlerSignatures;if(!o)throw f(new l("Could not fetch Shopify CLI crawler signatures."));let s=o.edges[0]?.node;if(s){h("theme-service:crawler-signature:reused");let u=ee(s);return c(`Reusing crawler signature "${A}" for ${s.domainHost} (${Z(u)}).`),u}let a=(await _(he,e,{timeToLive:le,name:A,domainHost:t,cli:!0},J)).storefrontCrawlerSignatureGenerate;if(!a)throw f(new l("Could not create a Shopify CLI crawler signature."));if(a.userErrors.length>0){let u=a.userErrors.map(d=>{let m=d.field?.join(".");return m?`${m}: ${d.message}`:d.message}).join(`
|
|
47
|
-
`);throw f(new l("Could not create a Shopify CLI crawler signature.",u))}h("theme-service:crawler-signature:created");let i=ee(a);return c(`Created crawler signature "${A}" for ${a.domainHost} expiring at ${a.expiresAt} (${Z(i)}).`),i}catch(r){let o=r instanceof Error?r.message:String(r);c(`Could not obtain crawler signature headers; continuing without them. ${o}`);return}}function Z(e){let t=Object.keys(e),r=Q.filter(s=>t.some(n=>n.toLowerCase()===s.toLowerCase())),o=Q.filter(s=>!r.includes(s));return`present: ${r.join(", ")||"none"}; missing: ${o.join(", ")||"none"}`}function ee(e){if(!e.signature||!e.signatureInput||!e.signatureAgent)throw f(new l("The Shopify CLI crawler signature response did not include all required headers."));return{Signature:e.signature,"Signature-Input":e.signatureInput,"Signature-Agent":e.signatureAgent}}p();var ge=1800*1e3,re=["layout/theme.liquid","config/settings_schema.json"];async function ht(e,t,r,o,s){let n=await oe(e,t,r,o,s);return n.refresh=async()=>{c("Refreshing theme session...");let a=await oe(e,t,r,o,n.crawlerSignatureHeaders);return h("theme-service:session:refreshed"),Object.assign(n,a),a},setInterval(()=>{n.refresh&&n.refresh().then(()=>c("Refreshed theme session via auto-refresher...")).catch(()=>c("Session could not be refreshed."))},ge),n}async function oe(e,t,r,o,s){let n=b(t),a=s??await te(t),i=await q(t.storeFqdn,r,[],{forceRefresh:!1,noPrompt:!0}),u=await I([],r,{forceRefresh:!1,noPrompt:!0}),d=await we(n,e,t,u,o,a);return{...i,sessionCookies:d,storefrontToken:u,crawlerSignatureHeaders:a}}async function we(e,t,r,o,s,n){try{return await B(e,r.storeFqdn,t,s,{"X-Shopify-Shop":r.storeFqdn,"X-Shopify-Access-Token":r.token,Authorization:`Bearer ${o}`,...n})}catch(a){throw a instanceof $&&await Se(t,r),a}}async function Se(e,t){if(c(`Verifying if theme with id ${e} has required files...`),(await j(Number(e),re,t)).length!==re.length)throw f(new l(D`Theme ${R.cyan(e)} is missing required files. Run ${R.cyan(`shopify theme delete -t ${e}`)} to delete it, then try your command again.`.value));c(`Theme with id ${e} has required files.`)}export{S as a,T as b,Ie as c,qe as d,ae as e,Me as f,k as g,Ge as h,ie as i,Je as j,ce as k,Y as l,b as m,te as n,ht as o,oe as p};
|
package/dist/chunk-IUP7POIE.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{l as O,n as W}from"./chunk-ZT5WFUKJ.js";import{T as v,a as S}from"./chunk-CZ22VZDA.js";import{f as y}from"./chunk-X7HVAVSZ.js";import{h as u,k as L}from"./chunk-2VSNFOKD.js";import{Bb as d,Sa as w,Ta as i,Va as D,_a as F,la as x,lb as B,qb as c,sb as s,ta as _}from"./chunk-LWCTKI4Z.js";import{c as r,h as k}from"./chunk-IWTNUJGY.js";import{a as I}from"./chunk-CX5CC6P5.js";import{e as R,g as f}from"./chunk-VKWPEFWQ.js";f();f();function b(e,n){try{return JSON.parse(e)}catch(a){let t=a instanceof Error?a.message:String(a),o=n?` from ${n}`:"";throw new u(`Failed to parse JSON${o}.
|
|
2
|
-
${t}`)}}var l=R(I(),1),N="yarn.lock",j="package-lock.json",$="pnpm-lock.yaml",C="bun.lockb",J="bun.lock",T="pnpm-workspace.yaml",we=[N,$,j,C,J],ye={yarn:[N],npm:[j],pnpm:[$],bun:[C,J],homebrew:[],unknown:[]},E=["yarn","npm","pnpm","bun","homebrew","unknown"],M=class extends u{constructor(){super("Unknown package manager")}},h=class extends u{constructor(n){super(s`The directory ${c.path(n)} doesn't have a package.json.`)}},P=class extends L{constructor(n){super(s`Couldn't find a a package.json traversing directories from ${c.path(n)}`)}};function V(e=process.env){let n=e.npm_config_user_agent;return["yarn","pnpm","bun","npm"].find(a=>n?.includes(a))??"unknown"}function U(e){return i(r(e,C))||i(r(e,J))}function G(e){switch(e){case"yarn":case"npm":case"pnpm":case"bun":return e;case"homebrew":case"unknown":return"npm"}}function K(e,n,...a){switch(e){case"npm":return{command:"npm",args:["exec","--",n,...a]};case"pnpm":return{command:"pnpm",args:["exec",n,...a]};case"yarn":return{command:"yarn",args:["run",n,...a]};case"bun":return{command:"bun",args:["x",n,...a]}}}async function A(e){let n=e;for(d(s`Looking for a lockfile in ${c.path(n)}...`);;){if(i(r(n,N)))return"yarn";if(i(r(n,$))||i(r(n,T)))return"pnpm";if(U(n))return"bun";if(i(r(n,j)))return"npm";let t=k(n);if(t===n)break;n=t}let a=V();return a!=="unknown"?a:"npm"}async function he(e,n,...a){let t=G(await A(e));return K(t,n,...a)}async function xe(e){let n=await D(r(e.directory,"**/package.json"),{ignore:[r(e.directory,"node_modules/**/package.json")],cwd:e.directory,onlyFiles:!0,deep:e.deep}),a=new S;try{await Promise.all(n.map(async t=>{let o=k(t);await z({directory:o,packageManager:e.packageManager,stdout:void 0,stderr:void 0,signal:a.signal,args:[]})}))}catch(t){throw a.abort(),t}}async function z(e){let n={cwd:e.directory,stdin:void 0,stdout:e.stdout,stderr:e.stderr,signal:e.signal},a=["install"];e.args&&(a=a.concat(e.args)),await y("cmd_all_timing_network_ms")(async()=>{await v(e.packageManager,a,n)})}async function ve(e){return(await m(e)).name}async function be(e){return(await m(e)).version}async function H(e){let n=await m(e),a=n.dependencies??{},t=n.devDependencies??{};return{...a,...t}}async function Me(e){let n=r(e,"package.json"),a=await m(n),t=r(e,T);return!!a.workspaces||w(t)}async function Pe(e,n,{cacheExpiryInHours:a=0}={}){let t=async()=>(d(s`Checking if there's a version of ${e} newer than ${n}`),ne(e)),o=`npm-package-${e}`,p;try{p=await O(o,t,a*3600*1e3)}catch{return}if(p&&new l.SemVer(n).compare(p)<0)return p}function Ne(e,n){let a=`npm-package-${e}`,t=W(a)?.value;if(t&&new l.SemVer(n).compare(t)<0)return t}function je(e,n){return(0,l.satisfies)(e,n)}async function m(e){if(!await w(e))throw new h(k(e));return b(await x(e),e)}async function Y(e,n){d(s`Adding the following dependencies if needed:
|
|
3
|
-
${c.json(e)}
|
|
4
|
-
With options:
|
|
5
|
-
${c.json(n)}
|
|
6
|
-
`);let a=r(n.directory,"package.json");if(!await w(a))throw new h(n.directory);let t=Object.keys(await H(a)),o=e.filter(p=>!t.includes(p.name));o.length!==0&&await q(o,n)}async function q(e,n){let a=e.map(t=>t.version?`${t.name}@${t.version}`:t.name);switch(n.stdout?.write(`Installing ${a.join(" ")} with ${n.packageManager}`),n.packageManager){case"npm":for(let t of a)await g(n,Q(t,n.type));break;case"yarn":await g(n,X(a,n.type,!!n.addToRootDirectory));break;case"pnpm":await g(n,Z(a,n.type,!!n.addToRootDirectory));break;case"bun":await g(n,ee(a,n.type)),await g(n,["install"]);break;case"homebrew":throw new u("Homebrew can't be used to install project dependencies. Use npm, yarn, pnpm, or bun.");case"unknown":throw new M}}async function g(e,n){return y("cmd_all_timing_network_ms")(async()=>v(e.packageManager,n,{cwd:e.directory,stdout:e.stdout,stderr:e.stderr,signal:e.signal}))}async function $e(e,n){await Y(e.map(a=>({name:a,version:void 0})),n)}function Q(e,n){let t=["install",e,{dev:"--save-dev",peer:"--save-peer",prod:"--save-prod"}[n]];return e.match(/@\d/g)&&t.push("--save-exact"),t}function X(e,n,a=!1){let t={dev:"--dev",peer:"--peer",prod:"--prod"};return["add",...a?["-W"]:[],...e,t[n]]}function Z(e,n,a=!1){let t={dev:"--save-dev",peer:"--save-peer",prod:"--save-prod"};return["add",...a?["-w"]:[],...e,t[n]]}function ee(e,n){let t={dev:"--development",peer:"--optional"}[n];return["add",...e,...t?[t]:[]]}async function Ce(e){let n=await F("package.json",{cwd:e,type:"file"});if(n){let a=b(await x(n),n);return{path:n,content:a}}else throw new P(e)}async function Je(e,n){let a=await A(e),t=await m(r(e,"package.json")),o=a==="yarn"?"resolutions":"overrides";t[o]={...t[o],...n},await ae(e,t)}async function ne(e){return d(s`Getting the latest version of NPM package: ${c.raw(e)}`),y("cmd_all_timing_network_ms")(async()=>{let{default:n}=await import("./latest-version-LDWU5F7A.js");return n(e)})}async function ae(e,n){d(s`JSON-encoding and writing content to package.json at ${c.path(e)}...`);let a=r(e,"package.json");await _(a,JSON.stringify(n,null,2))}function _e(e,n=process.env){if(e&&E.includes(e))return e;let a=V(n);if(a!=="unknown")return a;let t=B();return t!=="unknown"?t:"npm"}export{N as a,j as b,$ as c,C as d,T as e,we as f,ye as g,E as h,M as i,h as j,P as k,V as l,A as m,he as n,xe as o,z as p,ve as q,be as r,H as s,Me as t,Pe as u,Ne as v,je as w,m as x,Y as y,q as z,$e as A,Ce as B,Je as C,ae as D,_e as E};
|
package/dist/chunk-JDR6UVZA.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{c as ae}from"./chunk-XM7YUXTF.js";import{b as P}from"./chunk-R7EMV77H.js";import{a as fe}from"./chunk-XBQDMGUN.js";import{a as de}from"./chunk-ZGV3HNEV.js";import{a as ie}from"./chunk-FWB3GLMW.js";import{a as re}from"./chunk-XTREQ4A2.js";import{L as le,Ma as ue,N as me,d as ce,e as pe}from"./chunk-3C6VLJ5D.js";import{s as k,u as oe,v as se}from"./chunk-WDFCOZAY.js";import{a as F}from"./chunk-IQVRP7CT.js";import{C as B,p as O,x as W,y as S}from"./chunk-IUP7POIE.js";import{b as te,c as ne,f as A}from"./chunk-Q2SZCZE7.js";import{A as H,B as z,E as X,G as K,I as R,K as Q}from"./chunk-CZ22VZDA.js";import{e as b}from"./chunk-335BUVBP.js";import{a as G}from"./chunk-BN7ZXAZJ.js";import{h as d}from"./chunk-2VSNFOKD.js";import{Na as Y,Sa as x,Ta as J,Va as V,X as h,_ as U,ja as w,pa as q,rb as T,va as v,wb as ee,xa as E}from"./chunk-LWCTKI4Z.js";import{b as f}from"./chunk-FZCGRIOM.js";import{f as Z}from"./chunk-3A3DZVEJ.js";import{b as Se}from"./chunk-YTUUU33R.js";import{c as m,e as N,g as D,m as L,p as $}from"./chunk-IWTNUJGY.js";import{e as Oe,g as l}from"./chunk-VKWPEFWQ.js";l();l();l();async function he(e,t,r,n={}){let{templates:a,groupOrder:i}=await e.templateSpecifications(t,n);return{templates:a.filter(o=>r.includes(o.identifier)||r.includes(o.type)),groupOrder:i}}l();l();async function ye(e,t){let r=e?.path??"",n=m(t,r);if(!await x(n))throw new d(`
|
|
2
|
-
The extension is not available for ${e?.value}`);return n}async function xe({name:e,app:t}){let r=U(e),n=m(t.directory,se.extensions.directoryName,r);if(await x(n))throw new d(`
|
|
3
|
-
A directory with this name (${r}) already exists.
|
|
4
|
-
Choose a new name for your extension.`);return await v(n),await q(m(n,k.lockFile)),n}function C(e){switch(e){case"vanilla-js":case"preact":case"react":case"typescript":case"typescript-react":return"javascript";case"rust":case"wasm":return e;case void 0:case"liquid":case"config-only":return}}async function ge(e){let t=e.extensionChoices.name,r=e.extensionChoices.flavor,n=e.extensionTemplate.supportedFlavors.find(o=>o.value===r),a=await xe({app:e.app,name:t}),i=e.cloneUrl??e.extensionTemplate.url,s={directory:a,url:i,app:e.app,project:e.project,type:e.extensionTemplate.type,name:t,extensionFlavor:n,onGetTemplateRepository:e.onGetTemplateRepository??(async(o,p)=>{await ae({repoUrl:o,destination:p,shallow:!0})})};return await Re(s),{directory:L(a),extensionTemplate:e.extensionTemplate}}async function Re(e){try{switch(e.type){case"theme":await Ie(e);break;case"function":await je(e);break;default:await Me(e);break}let t=m(e.directory,k.lockFile);await E(t)}catch(t){throw await Ae(e.directory),e.project.packageManager==="pnpm"&&Ce(t)?new d("Your extension couldn't be generated because pnpm blocked the build scripts of some of its dependencies.",null,[["Run",{command:"pnpm approve-builds"},"in your app directory to approve the build scripts."],["Run",{command:T(e.project.packageManager,"shopify app generate extension")},"again."]]):t}}async function Ae(e){try{await E(e,{maxRetries:10,retryDelay:100})}catch{z({headline:["Couldn't remove",{filePath:e},{char:"."}],body:"Delete this directory manually before generating an extension with the same name."})}}function Ce(e){return e instanceof Error&&e.message.includes("ERR_PNPM_IGNORED_BUILDS")}async function Ie({directory:e,url:t,type:r,name:n,extensionFlavor:a,onGetTemplateRepository:i}){return w(async s=>{let o=await I(t,a,s,i);await P(o,e,{name:n,type:r,uid:b(h(n))})})}async function je({directory:e,url:t,app:r,project:n,name:a,extensionFlavor:i,onGetTemplateRepository:s}){let o=C(i?.value),p=[];p.push({title:"Generating function extension",task:async()=>{if(await w(async c=>{let u=await I(t,i,c,s);await P(u,e,{name:a,handle:h(a),flavor:i?.value,uid:b(h(a))})}),o==="javascript"){let c=we(i?.value??"rust");await ve(e,c,"!(*.graphql)")}}}),o==="javascript"&&p.push({title:"Installing additional dependencies",task:async()=>{n.usesWorkspaces&&await O({packageManager:n.packageManager,directory:n.directory});let c=Ge(o);await S(c,{packageManager:n.packageManager,type:"prod",directory:n.usesWorkspaces?e:n.directory})}}),o==="javascript"&&p.push({title:"Building GraphQL types",task:async()=>{let c=re();try{await pe({directory:e,isJavaScript:!0},{...c,app:r})}finally{c.stdout!==process.stdout&&c.stdout.end(),c.stderr!==process.stderr&&c.stderr.end()}}}),await R(p)}async function Me({directory:e,url:t,app:r,project:n,name:a,extensionFlavor:i,onGetTemplateRepository:s}){let o=C(i?.value),p=[{title:"Generating extension",task:async()=>{let c=we(i?.value??"vanilla-js");await w(async u=>{let y=await I(t,i,u,s);await P(y,e,{srcFileExtension:c,name:a,handle:h(a),flavor:i?.value??"",uid:b(h(a))})}),o==="javascript"&&await ve(e,c)}},{title:"Installing dependencies",task:async()=>{let c=n.packageManager;if(n.usesWorkspaces)C(i?.value)==="javascript"&&await O({packageManager:c,directory:n.directory});else{await Ne(n.directory,i?.value);let u=m(e,"package.json"),y=await De(u);await S(y,{packageManager:c,type:"prod",directory:n.directory}),await E(u)}}}];p.push({title:"Update shared type definition",task:async()=>{await me(r)}}),await R(p)}function we(e){return{"vanilla-js":"js",preact:"jsx",react:"jsx",typescript:"ts","typescript-react":"tsx",rust:"rs",wasm:"wasm",liquid:"liquid","config-only":""}[e]??"js"}function Ge(e){let t=[];return e==="javascript"&&t.push({name:"@shopify/shopify_function",version:`~${ce}.0.0`}),t}async function ve(e,t,r="*"){let n=await V(m(e,"src",r)),a=[];for(let i of n)a.push(Y(i,`${i}.${t}`));await Promise.all(a)}async function Ne(e,t){t==="typescript-react"&&await B(e,{"@types/react":oe.reactTypes})}async function De(e){if(!await x(e))return[];let t=await W(e);return Object.entries(t?.dependencies??{}).map(([r,n])=>({name:r,version:n}))}async function I(e,t,r,n){let a=m(r,"download");return await v(a),await n(e,a),ye(t,a)}l();function Le(e,t=[]){let r=[...e.map(a=>({label:a.name,value:a.identifier,group:a.group||"Other",sortPriority:a.sortPriority??Number.MAX_SAFE_INTEGER})),...t.map(a=>({label:`${a.name} (limit reached)`,value:a.identifier,group:a.group||"Other",disabled:!0,sortPriority:a.sortPriority??Number.MAX_SAFE_INTEGER}))],n=(a,i)=>a.sortPriority===i.sortPriority?a.label.localeCompare(i.label):a.sortPriority-i.sortPriority;return r.sort(n)}var $e=async e=>{let t=e.extensionTemplates,r=e.templateType,n=e.extensionFlavor;if(!r){if(n&&(t=t.filter(p=>p.supportedFlavors.map(c=>c.value).includes(n))),t.length===0)throw new d("You have reached the limit for the number of extensions you can create.");r=await K({message:"Type of extension?",choices:Le(t,e.unavailableExtensions),groupOrder:e.groupOrder})}let a=t.find(p=>p.identifier===r),i=e.name||await Ee(e.directory,a.defaultName),s=e.extensionFlavor??await Ue(a);return{extensionTemplate:a,extensionContent:{name:i,flavor:s}}};async function Ee(e,t,r=1){let n=t.includes(" ")?" ":"-",a=r<=1?t:`${t}${n}${r}`,i=m(e,h(a));return J(i)?Ee(e,t,r+1):Q({message:"Name your extension:",defaultValue:a})}async function Ue(e){if(e.supportedFlavors.length!==0)return e.supportedFlavors.length===1&&e.supportedFlavors[0]?e.supportedFlavors[0].value:X({message:"What would you like to work in?",choices:e.supportedFlavors.map(t=>({label:t.name,value:t.value})),defaultValue:"react"})}var be=$e;async function qe(e){let{app:t,developerPlatformClient:r,remoteApp:n,specifications:a,template:i}=e,s=a.map(_e=>_e.identifier),{templates:o,groupOrder:p}=await he(r,n,s,{requestedTemplate:i}),c=await Ye(o,p,a,t,e),u=await be(c);await Ve(u,i);let y=We(u,t,e,r),M=await ge(y);return{status:"success",extension:{directory:M.directory,extensionTemplate:M.extensionTemplate,name:u.extensionContent.name,flavor:u.extensionContent.flavor},packageManager:e.project.packageManager}}async function Ye(e,t,r,n,a){let i=await He(a.template,n,e,r);Be(i,a.flavor);let{validTemplates:s,templatesOverlimit:o}=Je(e,r,n);return{templateType:i?.identifier,name:a.name,extensionFlavor:a.flavor,directory:m(a.directory,"extensions"),app:n,extensionTemplates:s??[],unavailableExtensions:o??[],reset:a.reset,groupOrder:t}}function Je(e,t,r){return fe(e,a=>!Te(r,t,a)?"validTemplates":"templatesOverlimit")}function Te(e,t,r){let n=r.type,a=t.find(s=>s.identifier===n||s.externalIdentifier===n);return e.extensionsForType({identifier:n,externalIdentifier:n}).length>=(a?.registrationLimit??1)}async function Ve(e,t){let{extensionContent:r}=e;return F.addPublicMetadata(()=>({cmd_scaffold_template_flavor:r.flavor,cmd_scaffold_type:e.extensionTemplate.identifier,cmd_scaffold_used_prompts_for_type:!t}))}function We(e,t,r,n){return{app:t,project:r.project,cloneUrl:r.cloneUrl,extensionChoices:e.extensionContent,extensionTemplate:e.extensionTemplate,developerPlatformClient:n}}function Be(e,t){if(!t||!e)return;let r=e.supportedFlavors.map(n=>n.value);if(!r.includes(t))throw new d("Invalid template for extension type",`Expected template to be one of the following: ${r.join(", ")}.`)}async function He(e,t,r,n){if(!e)return;let a=r.find(i=>i.identifier===e);if(!a){let i=await Z(),s=r.map(p=>p.identifier),o=i?"You might need to enable some flags on your Organization or App":void 0;throw new d(`Unknown extension type: ${e}.
|
|
5
|
-
The following extension types are supported: ${s.join(", ")}`,o)}if(Te(t,n,a))throw new d(`Invalid extension type: ${e}`,`You have reached the limit of extension(s) of type ${a.type} per app`);return a}var Pe=qe;l();var ke=f.object({name:f.string().min(1).describe("The name selected for the generated extension."),type:f.string().min(1).describe("The extension type, such as function, theme, or ui_extension."),template:f.string().min(1).describe("The identifier of the selected extension template."),flavor:f.string().nullable().describe("The selected template flavor, or null when the template has no flavors."),directory:f.string().refine(D,"Expected an absolute filesystem path.").describe("The absolute native filesystem path of the generated extension directory.")}).strict(),_=G({name:"AppGenerateExtensionResult",schema:f.object({status:f.literal("success"),extension:ke}).strict(),definitions:{GeneratedExtension:ke}});l();function Fe(e,t=!1){let{extension:r,packageManager:n}=e;if(t){ee(_.encode({status:e.status,extension:{name:r.name,type:r.extensionTemplate.type,template:r.extensionTemplate.identifier,flavor:r.flavor??null,directory:N($(),r.directory)}}));return}H(ze(r.extensionTemplate,r.directory,n))}function ze(e,t,r){let n={headline:["Your extension was created in",{filePath:t},{char:"."}],nextSteps:[],reference:[]};return e.type!=="function"&&n.nextSteps.push(["To preview this extension along with the rest of the project, run",{command:T(r,"shopify app dev")}]),e.supportLinks[0]&&n.reference.push(["For more details, see the",{link:{label:"docs",url:e.supportLinks[0]}}]),n}var g=Oe(Se(),1);var j=class e extends de{static summary="Generate a new app Extension.";static descriptionWithMarkdown=`Generates a new [app extension](https://shopify.dev/docs/apps/build/app-extensions). For a list of app extensions that you can generate using this command, refer to [Supported extensions](https://shopify.dev/docs/apps/build/app-extensions/list-of-app-extensions).
|
|
6
|
-
|
|
7
|
-
Each new app extension is created in a folder under \`extensions/\`. To learn more about the extensions file structure, refer to [App structure](https://shopify.dev/docs/apps/build/cli-for-apps/app-structure) and the documentation for your extension.
|
|
8
|
-
`;static get jsonOutputSchema(){return _}static description=this.descriptionForHelp();static flags={...te,...ie,...ne,template:A(g.Flags.string({char:"t",hidden:!1,description:"Extension template",env:"SHOPIFY_FLAG_EXTENSION_TEMPLATE"})),name:A(g.Flags.string({char:"n",hidden:!1,description:"name of your Extension",env:"SHOPIFY_FLAG_NAME"})),"clone-url":g.Flags.string({hidden:!0,char:"u",description:"The Git URL to clone the function extensions templates from. Defaults to: https://github.com/Shopify/function-examples",env:"SHOPIFY_FLAG_CLONE_URL"}),flavor:g.Flags.string({hidden:!1,description:"Choose a starting template for your extension, where applicable. Required if non interactive when the selected extension template supports multiple flavors.",options:["vanilla-js","react","typescript","typescript-react","wasm","rust"],env:"SHOPIFY_FLAG_FLAVOR"})};async run(){let{flags:t}=await this.parse(e);await F.addPublicMetadata(()=>({cmd_scaffold_required_auth:!0,cmd_scaffold_template_custom:t["clone-url"]!==void 0,cmd_scaffold_type_owner:"@shopify/app"})),await le(t.path);let{app:r,project:n,specifications:a,remoteApp:i,developerPlatformClient:s}=await ue({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config}),o=await Pe({directory:t.path,reset:t.reset,name:t.name,cloneUrl:t["clone-url"],template:t.template,flavor:t.flavor,app:r,project:n,specifications:a,remoteApp:i,developerPlatformClient:s});return Fe(o,t.json),{app:r}}};export{j as a};
|
package/dist/chunk-JOJV5E2K.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as e}from"./chunk-ZQDDRIBA.js";import{sa as r}from"./chunk-H4V55Y3Z.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();var t=class extends e{static hidden=!0;async run(){await r()}};export{t as a};
|
package/dist/chunk-LVLAOBJM.js
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import{a as z,b as $t}from"./chunk-JLGA3B7P.js";import{a as Tt,b as St,f as Ce,g as le,h as O,j as de,l as Pt,o as vt}from"./chunk-DNMXVMJM.js";import{a as J,l as Rt,m as Ft}from"./chunk-5TB52UUV.js";import{s as ce,t as B}from"./chunk-DJAZBPYA.js";import{a as U,b as M,e as dt,g as ut,i as pt,j as mt,k as ft,n as ht,p as gt,q as yt,r as ae,s as I,u as Et,w as wt}from"./chunk-Q7BOSHWX.js";import{da as xt}from"./chunk-M5TGCSUK.js";import{va as q,xa as D}from"./chunk-H4V55Y3Z.js";import{B as L,C as re,D as ct,U as lt,z as at}from"./chunk-CZ22VZDA.js";import{c as it}from"./chunk-335BUVBP.js";import{h as k}from"./chunk-2VSNFOKD.js";import{Bb as v,Cb as W,O as nt,Sa as b,Va as N,Z as _e,ab as qe,la as _,na as Le,qb as C,sb as oe,ta as je,va as rt,xa as ot,yb as ie}from"./chunk-LWCTKI4Z.js";import{c as x,e as et,f as A,h as tt,i as st,j as H,n as Ie}from"./chunk-IWTNUJGY.js";import{e as Ke,g as m}from"./chunk-VKWPEFWQ.js";m();m();m();var ps=".shopifyignore",kt=/templates\/\*(\.(json|liquid))?$/,bt=new Set;function ue(e,t={}){let s=t.ignoreFromFile??[],n=t.ignore??[],r=t.only??[],[o=[],i=[]]=Ae(s),[a=[],u=[]]=Ae(n),[p=[],c=[]]=Ae(r),l=e.filter(G(o,".shopifyignore"));return l=l.filter(G(a,"--ignore")),l=l.filter(G(p,"--only",!0)),i.length>0&&(l=l.concat(e.filter(G(i,".shopifyignore",!0)))),u.length>0&&(l=l.concat(e.filter(G(u,"--ignore",!0)))),c.length>0&&(l=l.filter(G(c,"--only"))),nt(l,w=>w.key)}function G(e,t,s=!1){return({key:n})=>{if(e.length===0)return!0;let r=e.some(i=>ms(n,i)||gs(i)&&hs(n,ys(i)));return(s?!r:r)?(v(`Ignoring theme file ${n} via ${t}...`),!1):!0}}async function It(e){let t=x(e,ps);return await b(t)?(await _(t,{encoding:"utf8"})).split(/(\r\n|\r|\n)/).map(r=>r.trim()).filter(r=>r&&!r.startsWith("#")):[]}function Ae(e){let t=e.filter(n=>n.startsWith("!")).map(n=>n.slice(1));return[e.filter(n=>!n.startsWith("!")),t]}function ms(e,t){let s={matchBase:!0,noglobstar:!0};return qe(e,t,s)?!0:(!t.includes("*")&&t.endsWith("/")&&!bt.has(t)&&(bt.add(t),L({headline:"Directory pattern may be misleading.",body:`For more reliable matching, consider using "${t}*" or "${t}*.<file_extension>" instead.`})),fs(t)?qe(e,t.replace(kt,"templates/**/*$1"),s):!1)}function fs(e){return kt.test(e)}function hs(e,t){return t.test(e)}function gs(e){return e.startsWith("/")&&e.endsWith("/")}function ys(e){return new RegExp(e.slice(1,-1))}m();import _t from"fs/promises";var pe=class{notifyPath;isValidUrl;constructor(t){this.notifyPath=t,this.isValidUrl=this.validateUrl(t),this.notifyPath===""&&W("Notification skipped: notifyPath is an empty string")}async notify(t){if(this.notifyPath!=="")try{v(`Notifying filechange listener at ${this.notifyPath}...`),this.isValidUrl?await this.notifyUrl(t):await this.notifyFile(t)}catch(s){q(s);let n=`Failed to notify filechange listener at ${this.notifyPath}`;s instanceof Error&&(n=n.concat(`: ${s.message}`)),W(n)}}async notifyUrl(t){let s=await fetch(this.notifyPath,{method:"POST",body:JSON.stringify({files:[t]}),headers:{"Content-Type":"application/json"}});if(!s.ok)throw new Error(s.statusText)}async notifyFile(t){await _t.writeFile(this.notifyPath,t),await _t.utimes(this.notifyPath,new Date,new Date)}validateUrl(t){try{let s=new URL(t);return s.protocol==="http:"||s.protocol==="https:"}catch{return!1}}};m();m();m();import Es from"node:events";var Lt=["assets/**/*.*","locales/**/*.json","blocks/**/*.liquid","snippets/**/*.liquid"];function jt(e){let t=new Map,s=new Set,n=new Es,r=(c,l)=>{n.emit(c,l)},o=async c=>{let l=await fe(e,c),f=me(c,l),w=typeof l=="string"?l:"",h=Buffer.isBuffer(l)?l.toString("base64"):"";return t.set(c,J({key:c,checksum:f,value:w,attachment:h})),l},i=N(Lt,{cwd:e,deep:3,ignore:B}).then(c=>Promise.all(c.map(o))),a=(c,l)=>{let f=A(e,l),w=o(f).then(()=>{let h=t.get(f);return s.add(h.key),h.value??h.attachment??""});lt(5).then(()=>{s.delete(f)}).catch(()=>{}),r(c,{fileKey:f,onContent:h=>{w.then(y=>{y&&h(y)}).catch(()=>{})},onSync:h=>{}})},u=c=>{let l=A(e,c);s.delete(l),t.delete(l),r("unlink",{fileKey:l,onSync:f=>f()})},p=new Set(Lt.map(c=>x(e,c.split("/").shift()??"")));return{root:e,files:t,unsyncedFileKeys:s,ready:async()=>i.then(()=>{}),delete:async c=>{t.delete(c)},write:async c=>{t.set(c.key,c)},read:o,addEventListener:(c,l)=>{n.on(c,l)},startWatcher:async()=>{let{default:c}=await import("./chokidar-5RWEYTNQ.js");c.watch([...p],{ignored:B,persistent:!process.env.SHOPIFY_UNIT_TEST,ignoreInitial:!0}).on("add",a.bind(null,"add")).on("change",a.bind(null,"change")).on("unlink",u.bind(null))}}}m();m();var ws="https://unpkg.com/@shopify/polaris@13.9.2/build/esm/styles.css";function qt(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Ct(e){return(0,String.raw)`<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<title>${e.title}</title>
|
|
5
|
-
<link rel="stylesheet" href="${ws}" />
|
|
6
|
-
</head>
|
|
7
|
-
<body>
|
|
8
|
-
<div style="display: flex; justify-content: center; padding-top: 2rem;">
|
|
9
|
-
<div style="width: 80%;">
|
|
10
|
-
<div class="Polaris-Banner Polaris-Banner--withinPage" tabindex="0" role="alert" aria-live="polite">
|
|
11
|
-
<div class="Polaris-Box" style="--pc-box-width:100%">
|
|
12
|
-
<div
|
|
13
|
-
class="Polaris-BlockStack"
|
|
14
|
-
style="--pc-block-stack-align:space-between;--pc-block-stack-order:column"
|
|
15
|
-
>
|
|
16
|
-
<div
|
|
17
|
-
class="Polaris-Box"
|
|
18
|
-
style="--pc-box-color: var(--p-color-text-critical-on-bg-fill); --pc-box-background: var(--p-color-bg-fill-critical); --pc-box-padding-block-start-xs: var(--p-space-300); --pc-box-padding-block-end-xs: var(--p-space-300); --pc-box-padding-inline-start-xs: var(--p-space-300); --pc-box-padding-inline-end-xs: var(--p-space-300); --pc-box-border-start-start-radius: var(--p-border-radius-300); --pc-box-border-start-end-radius: var(--p-border-radius-300);"
|
|
19
|
-
>
|
|
20
|
-
<div
|
|
21
|
-
class="Polaris-InlineStack"
|
|
22
|
-
style="--pc-inline-stack-align:space-between;--pc-inline-stack-block-align:center;--pc-inline-stack-wrap:nowrap;--pc-inline-stack-gap-xs:var(--p-space-200);--pc-inline-stack-flex-direction-xs:row"
|
|
23
|
-
>
|
|
24
|
-
<div
|
|
25
|
-
class="Polaris-InlineStack"
|
|
26
|
-
style="--pc-inline-stack-wrap:nowrap;--pc-inline-stack-gap-xs:var(--p-space-100);--pc-inline-stack-flex-direction-xs:row"
|
|
27
|
-
>
|
|
28
|
-
<span class="Polaris-Banner--textCriticalOnBgFill">
|
|
29
|
-
<span class="Polaris-Icon">
|
|
30
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
|
|
31
|
-
<path d="M10 6a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5a.75.75 0 0 1 .75-.75Z" />
|
|
32
|
-
<path d="M11 13a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z" />
|
|
33
|
-
<path
|
|
34
|
-
fill-rule="evenodd"
|
|
35
|
-
d="M17 10a7 7 0 1 1-14 0 7 7 0 0 1 14 0Zm-1.5 0a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0Z"
|
|
36
|
-
/>
|
|
37
|
-
</svg>
|
|
38
|
-
</span>
|
|
39
|
-
</span>
|
|
40
|
-
<h2 class="Polaris-Text--root Polaris-Text--headingSm Polaris-Text--break">
|
|
41
|
-
${e.header}
|
|
42
|
-
</h2>
|
|
43
|
-
</div>
|
|
44
|
-
</div>
|
|
45
|
-
</div>
|
|
46
|
-
<div
|
|
47
|
-
class="Polaris-Box"
|
|
48
|
-
style="--pc-box-padding-block-start-xs:var(--p-space-300);--pc-box-padding-block-end-xs:var(--p-space-300);--pc-box-padding-block-end-md:var(--p-space-400);--pc-box-padding-inline-start-xs:var(--p-space-300);--pc-box-padding-inline-start-md:var(--p-space-400);--pc-box-padding-inline-end-xs:var(--p-space-300);--pc-box-padding-inline-end-md:var(--p-space-400)"
|
|
49
|
-
>
|
|
50
|
-
<div
|
|
51
|
-
class="Polaris-BlockStack"
|
|
52
|
-
style="--pc-block-stack-order:column;--pc-block-stack-gap-xs:var(--p-space-300)"
|
|
53
|
-
>
|
|
54
|
-
${e.errors.map(s=>`
|
|
55
|
-
<div>
|
|
56
|
-
<span class="Polaris-Text--root Polaris-Text--headingSm">${qt(s.message)}</span>
|
|
57
|
-
<ul class="Polaris-List">
|
|
58
|
-
<li class="Polaris-List__Item">${qt(s.code)}</li>
|
|
59
|
-
</ul>
|
|
60
|
-
</div>`).join("")}
|
|
61
|
-
</div>
|
|
62
|
-
</div>
|
|
63
|
-
</div>
|
|
64
|
-
</div>
|
|
65
|
-
</div>
|
|
66
|
-
</div>
|
|
67
|
-
</div>
|
|
68
|
-
</body>
|
|
69
|
-
</html>`}m();m();var xs=/<head(\s[^>]*)?>/i,Ne="https://cdn.shopify.com/storefront",Ts=`${Ne}/standard-events.js`,Ss=`${Ne}/standard-events.dev.js`,At=`${Ne}/standard-events-inspector.js`,Ht="shopify-cli-standard-events-inspector",Rs=new RegExp(`<script\\b[^>]*(?:\\bid=["']${He(Ht)}["']|\\bsrc=["']${He(At)}["'])[^>]*>`,"i"),Fs=new RegExp(He(Ts),"g");function he(e){return Rs.test(e)?e:e.replace(xs,t=>`${t}<script id="${Ht}" src="${At}" defer></script>`)}function Nt(e){return e.replace(Fs,Ss)}function He(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}m();var Ot=80;function K(e,t,s){if(!Ps(e)||s.type==="theme-extension")return;let n=e.path.length>Ot?`${e.path.substring(0,Ot)}...`:e.path,o=t.headers.get("server-timing")?.match(/cfRequestDuration;dur=([\d.]+)/)?.[1],i=o?`${Math.round(Number(o))}ms`:"",a=vs(t.status),u=e.method.padStart(6);ie(oe`• ${ce.format(new Date)} Request ${C.raw("\xBB")} ${u} ${a(String(t.status))} ${n} ${C.gray(i)}`)}function Ps(e){let t=[V,Y,"/checkouts","/payments"],s=[".js",".css",".json",".map"];if(t.some(o=>e.path.startsWith(o)))return!1;let[n]=e.path.split("?"),r=H(n);return!s.includes(r)}function vs(e){return e<300?C.green:e<400?C.yellow:C.errorText}var Y="/cdn/",V="/ext/cdn/",Oe="/api/collect",$s=/^\/cart\//,bs=/^\/cart(\/|\.js|\.json|$)/,De=/^\/checkouts\/(?!internal\/)/,Dt=/^\/account(\/login\/multipass(\/[^/]+)?|\/logout)?\/?$/,ks=new RegExp(`^${Y}`),Is=new RegExp(`^${V}`),_s=/^\/api\/(unstable|\d{4}-\d{2})\/graphql\.json/,Ls=["/.well-known","/shopify/monorail","/mini-profiler-resources","/web-pixels-manager","/web-pixels@","/wpm","/services/",Oe,"/cdn-cgi/challenge-platform"],Wt="_shopify_essential",js=new RegExp(`${Wt}=([^;]*)(;|$)`);function Ut(e,t){return I(async s=>{if(Ls.some(n=>s.path.startsWith(n)))return null;if(qs(s)){let n=s.path.split("?")[0]??"";return Ue(s,t).then(async r=>{if(K(s,r,t),r.ok){let o=n.split("/").at(-1)??"";if(t.localThemeFileSystem.files.has(`assets/${o}.liquid`)){let i=ee(await r.text(),t);return new Response(i,r)}}return r}).catch(async r=>{let{status:o,statusText:i,...a}=O(r,`Failed to proxy request to ${n}`);return o>=500&&!n.endsWith(".js.map")&&L(a),new Response(r.message,{status:o,statusText:i})})}})}function qs(e){if(e.method!=="GET"||e.path.match($s)||e.path.match(De)||e.path.match(Dt)||e.path.match(ks)||e.path.match(Is))return!0;let[t]=e.path.split("?"),s=H(t),n=e.headers.get("accept")??"*/*";return s===".html"||n.includes("text/html")?!1:!!s||n!=="*/*"}function Cs(e){let[t]=e.split("?");return!(bs.test(t)||De.test(t)||Dt.test(t))}function ge(e){return e.session.storeFqdn.replace(/\\/g,"\\\\").replace(/\./g,"\\.")}function As(e){return _s.test(e.path)}function ee(e,t){let s=e,n=`(data-shs-beacon-endpoint=["'])https://${ge(t)}${Oe}`,r=new RegExp(n,"g");s=s.replace(r,`$1${Oe}`);let o=new RegExp(`(https?:)?//${ge(t)}${Y}`,"g");s=s.replace(o,Y);let i=/(?:https?:)?\/\/cdn\.shopify\.com\/(.*?\/(assets\/[^?#"'`>\s]+))/g,a=c=>c.startsWith("assets/"),u=new Set([...t.localThemeFileSystem.files.keys()].filter(a)),p=new Set([...t.localThemeExtensionFileSystem.files.keys()].filter(a));return s=s.replace(i,(c,l,f)=>{let w=f&&u.has(f),h=f&&p.has(f)&&l.startsWith("extensions/");return z(f).startsWith("image/")?c:h?`${V}${l}`:w?`${Y}${l}`:c}),t.options.standardEventsDevBundle&&(s=Nt(s)),s}function Hs(e,t){let s=`http://${t.options.host}:${t.options.port}`,n=new RegExp(`data-base-url=["']((?:https?:)?//${ge(t)})[^"']*?["']`,"g");return e.replace(n,(r,o)=>r.replace(o,s))}function Ns(e,t){let s=new RegExp(`Domain=${ge(t)};\\s*`,"gi");return e.map(n=>n.replace(s,""))}async function te(e,t,s){let n=Bt(e,t);if(n.status>=300&&n.status<400)return n;t.headers.get("content-type")?.includes("application/json")||n.headers.set("content-type","text/html; charset=utf-8");let i=await n.text();return i=ee(i,e),i=Hs(i,e),e.options.standardEventsInspector&&(i=he(i)),s&&(i=s(i)??i),new Response(i,n)}var Mt=["connection","keep-alive","proxy-authenticate","proxy-authorization","te","trailer","transfer-encoding","upgrade","expect","content-security-policy","host"];function Bt(e,t){let s=new Response(t.body,t);s.headers.delete("content-length"),s.headers.delete("content-encoding");for(let i of Mt)s.headers.delete(i);s.headers.delete("access-control-allow-origin"),s.headers.delete("access-control-allow-credentials"),s.headers.delete("access-control-allow-methods"),s.headers.delete("access-control-allow-headers"),s.headers.delete("access-control-expose-headers"),s.headers.delete("access-control-max-age");let n=s.headers.get("Link");n&&s.headers.set("Link",ee(n,e));let r=s.headers.get("Location");if(r){let i=new URL(r,"https://shopify.dev");De.test(i.pathname)||(i.searchParams.delete("_fd"),i.searchParams.delete("pb"),s.headers.set("Location",i.href.replace(i.origin,"")))}let o=s.headers.getSetCookie();if(o?.length){s.headers.set("Set-Cookie",Ns(o,e).join(","));let i=o.join(",").match(js)?.[1];i&&(e.session.sessionCookies[Wt]=i)}return s}function We(e){let t=dt(e);for(let n of Mt)delete t[n];delete t["upgrade-insecure-requests"];let s=ut(e);return s&&(t["X-Forwarded-For"]=s),t}function Ue(e,t){let s=e.path.replace(new RegExp(V,"g"),"/"),n=e.path.startsWith(V)?"cdn.shopify.com":t.session.storeFqdn,r=new URL(s,`https://${n}`);if(r.hostname!==n)return Promise.reject(new Error(`Request failed: Hostname mismatch. Expected host: ${n}. Resulting URL hostname: ${r.hostname}`));let o=pt(e),i=We(e);return As(e)||(/\/assets\/[^/]+\.(css|js)$/.test(r.pathname)&&/\?\d+$/.test(r.search)&&(r.search=`?v=${Date.now()}`),r.searchParams.set("_fd","0"),r.searchParams.set("pb","0"),i=St({...i,...Tt(),...n===t.session.storeFqdn?t.session.crawlerSignatureHeaders:{},referer:r.origin,Cookie:Pt(t.session,{headers:i}),...t.type==="theme"&&Cs(e.path)?{Authorization:`Bearer ${t.session.storefrontToken}`}:{}})),fetch(r,{method:e.method,body:o,duplex:o?"half":void 0,redirect:"manual",headers:i}).then(a=>Bt(t,a)).catch(a=>{throw le(q(a),r)})}var Me=0,Os=5;function zt(e,t){return I(s=>{let[n="/",r=""]=s.path.split("?");return Ws(s)&&(t.lastRequestedPath=s.path),t.options.errorOverlay!=="silent"&&t.localThemeFileSystem.uploadErrors.size>0?Jt(t,{status:500,statusText:"Internal Server Error"},{title:"Failed to Upload Theme Files",header:"Upload Errors",errors:Array.from(t.localThemeFileSystem.uploadErrors.entries()).map(([i,a])=>({message:i,code:a.join(`
|
|
70
|
-
`)}))}):de(t.session,{method:s.method,path:n,query:[...new URLSearchParams(r)],themeId:String(e.id),sectionId:"",headers:We(s),replaceExtensionTemplates:Ee(t),replaceTemplates:Be(t,n,mt(s,"localization")?.toLowerCase())}).then(async i=>{if(i.status>=400&&i.status<500&&!Ds(s)){let a=await Us(s,t,i);if(a)return K(s,a,t),a}return K(s,i,t),te(t,i,a=>(Ms(i,a,String(e.id)),Me=0,Je(a,t)))}).catch(async i=>{if(i instanceof ye&&(v(`Theme ID mismatch: expected ${i.getExpectedThemeId()} but got ${i.getActualThemeId()}; refreshing session...`),D("theme-service:error-page:theme-id-mismatch"),t.session.refresh)){Me++,Me>Os&&(ct(new k(i.getMessage())),process.exit(1)),await t.session.refresh();let w=new URLSearchParams(r),h=new URLSearchParams([...w].filter(([be])=>!be.startsWith("__sfr"))),y=n+(h.toString()?`?${h}`:"");return new Response(null,{status:302,headers:{Location:y}})}let{status:a,statusText:u,cause:p,...c}=O(i,"Failed to render storefront"),[l,...f]=c.headline.split(`
|
|
71
|
-
`);return re(c),Jt(t,{status:a,statusText:u},{title:l,header:l,errors:[{message:[...f,p.message].join("<br>"),code:p.stack?.replace(`${p.message}
|
|
72
|
-
`,"")??""}]})})})}function Jt(e,t,s){let n=Je(Ct(s),e);return e.options.standardEventsInspector&&(n=he(n)),D("theme-service:error-page:rendered"),new Response(n,{...t,headers:t.headers??{"Content-Type":"text/html; charset=utf-8"}})}function Ds(e){let t=new URLSearchParams(e.path.split("?")[1]);return["section_id","sections","app_block_id"].some(s=>t.has(s))}function Ws(e){return e.headers.get("sec-fetch-mode")==="navigate"}async function Us(e,t,s){v(`Render failed for ${e.path} with ${s.status} (x-request-id: ${s.headers.get("x-request-id")}), trying proxy...`);let n=await Ue(e,t).catch(r=>new Response(null,O(r)));if(n.status<400)return v(`Proxy status: ${n.status}. Returning proxy response.`),t.options.standardEventsInspector&&(n.headers.get("content-type")??"").includes("text/html")?te(t,n):n;v(`Proxy status: ${n.status}. Returning render error.`)}function Ms(e,t,s){let n=t.match(/Shopify\.theme\s*=\s*{[^}]+?"id":\s*"?(\d+)"?(}|,)/)?.[1];if(n&&n!==s)throw new ye(s,n,e)}var ye=class extends Error{response;expectedThemeId;actualThemeId;constructor(t,s,n){super([`Theme ID mismatch: expected ${t} but got ${s}.`,`Request ID: ${n.headers.get("x-request-id")}`,`URL: ${n.url}`,"This is likely related to an issue in upstream Shopify APIs.","Please try again in a few minutes and report this issue:","https://community.shopify.dev/c/shopify-cli-libraries/14"].join(`
|
|
73
|
-
`)),this.response=n,this.expectedThemeId=t,this.actualThemeId=s}getMessage(){return this.message}getResponse(){return this.response}getExpectedThemeId(){return this.expectedThemeId}getActualThemeId(){return this.actualThemeId}};m();m();function we(e,t){let s=new RegExp(`{%-?\\s*${t}\\s*-?%}`),n=new RegExp(`{%-?\\s*end${t}\\s*-?%}`),r=s.exec(e);if(!r)return;let o=r.index+r[0].length;n.lastIndex=o;let i=n.exec(e);if(!i)return;let a=i.index;return e.slice(o,a)}m();function xe(e){let{pathname:t,search:s,searchParams:n}=new URL(e.path,"http://e.c");return{pathname:t,search:s,searchParams:n}}var Bs={stylesheet:new Map,javascript:new Map};function Gt(e,t){return I(async s=>{if(s.method!=="GET")return;if(Ys(s,t))return Vs(s,t);let{file:n,fileKey:r,isUnsynced:o}=Gs(s,t);if(!r)return;let i=z(r);if(i.startsWith("image/")&&s.path.includes("&")&&!o)return;if(ht(s,"X-Local-Asset","true"),!n){o&&M(s,U({statusCode:404,statusMessage:"Not found"}));return}let a=n.value?Buffer.from(ee(n.value,t)):Buffer.from(n.attachment??"","base64");return ae(s,{getContents:()=>a,getMeta:()=>({type:i,size:a.length,mtime:n.stats?.mtime})})})}var Js=/^(?:\/cdn\/(?!extensions\/).*?)?\/assets\/([^?]+)/,zs=/^(?:\/(?:ext\/)?cdn\/extensions\/.*?)?\/assets\/([^?]+)/;function Gs(e,t){let s=(n,r)=>{let o=e.path.match(n)?.[1];if(o){let i=x("assets",o),a=r.files.get(i),u=r.unsyncedFileKeys.has(i);if(a||u)return{file:a,isUnsynced:u,fileKey:i}}};return s(Js,t.localThemeFileSystem)??s(zs,t.localThemeExtensionFileSystem)??{isUnsynced:!1,fileKey:void 0,file:void 0}}function Ys(e,t){return t.type==="theme"&&e.path.includes("/compiled_assets")}function Vs(e,t){switch(xe(e).pathname.split("/").at(-1)){case"styles.css":return Xs(t,e);case"block-scripts.js":return ze(t,e,"block");case"snippet-scripts.js":return ze(t,e,"snippet");case"scripts.js":return ze(t,e,"section");case void 0:break;default:break}}function Xs(e,t){let s=Te(e,"section"),n=Te(e,"block"),r=Te(e,"snippet"),o=[`/*** GENERATED LOCALLY ***/
|
|
74
|
-
`];for(let[,a]of[...s,...n,...r]){let u=Yt(a,"stylesheet");u&&o.push(u)}let i=o.join(`
|
|
75
|
-
`);return ae(t,{getContents:()=>i,getMeta:()=>({type:"text/css",size:Buffer.byteLength(i),mtime:new Date})})}function ze(e,t,s){let n=Te(e,s),r=`${s}s`,o=[`
|
|
76
|
-
/*** GENERATED LOCALLY ***/
|
|
77
|
-
|
|
78
|
-
(function () {
|
|
79
|
-
var __${r}__ = {};
|
|
80
|
-
|
|
81
|
-
(function () {
|
|
82
|
-
var element = document.getElementById("${r}-script");
|
|
83
|
-
var attribute = element ? element.getAttribute("data-${r}") : "";
|
|
84
|
-
var ${r} = attribute.split(",").filter(Boolean);
|
|
85
|
-
|
|
86
|
-
for (var i = 0; i < ${r}.length; i++) {
|
|
87
|
-
__${r}__[${r}[i]] = true;
|
|
88
|
-
}
|
|
89
|
-
})();`];for(let[a,u]of n){let p=a.split("/").pop()?.replace(".liquid",""),c=Yt(u,"javascript")??"";p&&c&&o.push(`
|
|
90
|
-
(function () {
|
|
91
|
-
if (!__${r}__["${p}"] && !Shopify.designMode) return;
|
|
92
|
-
try {
|
|
93
|
-
${c}
|
|
94
|
-
} catch (e) {
|
|
95
|
-
console.error(e);
|
|
96
|
-
}
|
|
97
|
-
})();`)}o.push("})();");let i=o.join(`
|
|
98
|
-
`);return ae(t,{getContents:()=>i,getMeta:()=>({type:"text/javascript",size:Buffer.byteLength(i),mtime:new Date})})}function Te(e,t){return[...e.localThemeFileSystem.files.entries()].filter(([s])=>s.endsWith(".liquid")&&s.startsWith(`${t}s/`)).sort(([s],[n])=>s.localeCompare(n))}function Yt(e,t){let s=Bs[t],n=s.get(e.key);if(n?.checksum===e.checksum)return n.content;if(s.delete(e.key),!e.value)return;let r=[`/* ${e.key} */`],o=we(e.value??"",t)?.trimEnd();if(o&&r.push(o),r.length>1){let i=r.join(`
|
|
99
|
-
`);return s.set(e.key,{checksum:e.checksum,content:i}),i}}m();import*as Vt from"node:os";function Zs(e,t){let s=new Set,n=`:${t}`,r=e.toLowerCase().trim();if(s.add(`${r}${n}`),["localhost","127.0.0.1","::1","0.0.0.0"].includes(r)&&(s.add(`localhost${n}`),s.add(`127.0.0.1${n}`),s.add(`[::1]${n}`)),r==="0.0.0.0"||r==="::")for(let i of Object.values(Vt.networkInterfaces()))for(let a of i??[]){let u=a.address.toLowerCase().split("%")[0],c=a.family==="IPv6"?`[${u}]`:u;s.add(`${c}${n}`)}return s}function Qs(e){if(e)return e.toLowerCase().replace(/\.(?=:\d|$)/,"")}function Xt(e,t){let s=Zs(e,t);return I(n=>{let r=n.node.req.headers.host,o=Qs(r);if(!o||!s.has(o))return M(n,U({statusCode:400,statusMessage:"Bad Request",message:"Invalid Host header"}))})}m();function Zt(){return Qt()}function Br(){return Qt()}function Qt(){return{root:"",files:new Map,unsyncedFileKeys:new Set,uploadErrors:new Map,ready:()=>Promise.resolve(),delete:async e=>{},read:async e=>"",write:async e=>{},stat:async e=>({mtime:new Date,size:1}),addEventListener:()=>{},startWatcher:async()=>{}}}import{createServer as Ks}from"node:http";async function no(e,t){let s=await tn(e,t);return await sn(e,s),en(e,s)}function en(e,t){let s=Et();s.use(Xt(t.options.host,t.options.port)),s.use(Kt(e,t)),s.use(Gt(e,t)),s.use(Ut(e,t)),s.use(zt(e,t));let n=Ks(wt(s));return{dispatch:s.handler.bind(s),start:async()=>new Promise(r=>n.listen({port:t.options.port,host:t.options.host},()=>r({close:async()=>{await Promise.all([new Promise(o=>{n.closeAllConnections(),n.close(o)})])}})))}}async function tn(e,t){let{adminSession:s,storefrontPassword:n,themeExtensionPort:r,themeExtensionDirectory:o,crawlerSignatureHeaders:i}=t,a="127.0.0.1",u=r??9293,p=Zt(),c=jt(o);return await c.ready(),{session:await vt(e.id.toString(),s,void 0,n,i),localThemeFileSystem:p,localThemeExtensionFileSystem:c,directory:o,type:"theme-extension",lastRequestedPath:"",options:{themeEditorSync:!1,noDelete:!1,ignore:[],only:[],host:a,port:u,liveReload:"hot-reload",standardEventsDevBundle:!1,standardEventsInspector:!1,open:!1,errorOverlay:"default"}}}async function sn(e,t){let s=t.localThemeExtensionFileSystem,n=({fileKey:r,onContent:o,onSync:i})=>{o(()=>{Se(e,t,i,{type:"update",key:r,payload:{isThemeExtension:!0}})})};return s.addEventListener("add",n),s.addEventListener("change",n),s.ready().then(async()=>s.startWatcher())}function Ee(e){let t={},s=e.localThemeExtensionFileSystem;for(let n of s.unsyncedFileKeys){let r=s.files.get(n),o=r?.value??r?.attachment;o&&(t[n]=o)}return t}var Pe=Ke(xt(),1);import nn from"node:events";var Ge=new Map,se=new Map;function es(e,t){let s=(0,Pe.parseJSON)(t,null,!0);if(!s)return;let n=s?.sections;n&&!e.startsWith("locales/")?se.set(e,Object.entries(n||{}).map(([r,{type:o}])=>[o,r])):se.delete(e)}function Ye(e){return!e.startsWith("assets/")&&[".liquid",".json"].includes(H(e))}function Be(e,t,s){let n={},r=/^templates\/.+\.json$/,o=t?`${x("templates",t.replace(/^\//,"").replace(/\.html$/,"")||"index")}.json`:"",i=!!t&&e.localThemeFileSystem.files.has(o),a=/^locales\/.+\.json$/,u=!!s&&(e.localThemeFileSystem.files.has(`locales/${s}.json`)||e.localThemeFileSystem.files.has(`locales/${s}.default.json`));for(let p of e.localThemeFileSystem.unsyncedFileKeys)if(Ye(p)){if(i&&r.test(p)){if(p!==o)continue}else if(a.test(p)){if(u){if(!p.startsWith(`locales/${s}.`))continue}else if(!p.includes(".default."))continue}n[p]=e.localThemeFileSystem.files.get(p)?.value??""}return n}function xo(e,t){let s=({fileKey:r,onContent:o,onSync:i})=>{let a=H(r);o(u=>{!ln(r)&&Ye(r)&&a===".json"&&es(r,u),Se(e,t,i,{type:"update",key:r,payload:an(r,t)})})},n=({fileKey:r,onSync:o})=>{se.delete(r),Se(e,t,o,{type:"delete",key:r})};return t.localThemeFileSystem.addEventListener("add",s),t.localThemeFileSystem.addEventListener("change",s),t.localThemeFileSystem.addEventListener("unlink",n),t.localThemeFileSystem.ready().then(async()=>{let r=[...t.localThemeFileSystem.files];return Promise.allSettled(r.map(async([o,i])=>{if(o.endsWith(".json")){let a=i.value??await t.localThemeFileSystem.read(o);a&&typeof a=="string"&&es(o,a)}else o.endsWith(".liquid")&&rs(i)}))})}var rn="1",ss=new nn;function Fe(e){ss.emit("hot-reload",{...e,version:rn})}function Kt(e,t){return I(s=>{let n=s.headers.get("accept")==="text/event-stream",r=xe(s).searchParams;if(n){let o=yt(s);return ss.on("hot-reload",i=>{o.push(JSON.stringify(i)).catch(a=>{L({headline:"Failed to send HotReload event.",body:a.stack})})}),Fe({type:"open",pid:String(process.pid),themeId:String(e.id)}),o.send().then(()=>o.flush())}if(r.has("hr-log")){let o=(0,Pe.parseJSON)(r.get("hr-log")??"",null);return o&&(o.headline=`[HotReload] ${o.headline}`,o.type==="error"?re(o):o.type==="warn"?L(o):o.type==="info"?at(o):L({headline:`Unknown HotReload log type: ${o.type}`})),null}if(s.path===ns)return _(ve()).then(o=>ft(s,o,"application/javascript")).catch(o=>M(s,U({cause:o})));if(r.has("section_id")||r.has("app_block_id")){let o=r.get("section_key")??"",i=r.get("section_id")??"",a=r.get("app_block_id")??"",u=s.path.split("?")[0]??"",p=new URLSearchParams(r);if(p.delete("section_key"),p.delete("section_id"),p.delete("app_block_id"),p.delete("_fd"),p.delete("pb"),i===""&&a==="")return;let c={};if(i){let l=t.localThemeFileSystem.unsyncedFileKeys;if(l.has(o)){let f=t.localThemeFileSystem.files.get(o)?.value;if(!f)return"";c[o]=f}for(let f of l)if(f.endsWith(".json")){for(let[w,h]of se.get(f)??[])if(i.endsWith(`__${h}`)){let y=t.localThemeFileSystem.files.get(f)?.value;y&&(c[f]=y);continue}}}return de(t.session,{method:s.method,path:u??"/",query:[...p.entries()],themeId:String(e.id),sectionId:i,appBlockId:a,replaceTemplates:c,headers:gt(s),replaceExtensionTemplates:Ee(t)}).then(async l=>{if(!l.ok)throw D("theme-service:hot-reload:section:render-failed"),le(l);return te(t,l)}).catch(async l=>{let{status:f,statusText:w,...h}=O(q(l),"Failed to render section on Hot Reload");return D("theme-service:hot-reload:section:render-error"),a||L(h),new Response(null,{status:f,statusText:w})})}})}var ne=(e,t)=>Fe({themeId:String(e),type:"full",key:t});function Se(e,t,s,n){let r=()=>ne(e.id,n.key);if(t.options.liveReload==="off")return;if(t.options.liveReload==="full-page"){s(r);return}let o=String(e.id);Fe({sync:"local",themeId:o,...n}),s(()=>Fe({sync:"remote",themeId:o,...n}),r)}function on(e,t){let s=new Set;if(e.endsWith(".json")){let n=t.localThemeFileSystem.files.get(e)?.value;if(n){let r=(0,Pe.parseJSON)(n,null,!0)?.sections;for(let o of Object.keys(r??{}))s.add(o)}}else{let n=e.match(/^sections\/(.+)\.liquid$/)?.[1];if(n)for(let[r,o]of se)for(let[i,a]of o)i===n&&s.add(a)}return[...s]}function an(e,t){let[s]=e.split("/"),n=t.localThemeFileSystem.files.get(e);return{sectionNames:s==="sections"?on(e,t):[],replaceTemplates:Ye(e)?Be(t):{},updatedFileParts:n&&rs(n)}}var Re="hot-reload-client",cn="/cdn/shopifycloud/theme-hot-reload/theme-hot-reload.js",ts=new RegExp(`<script id="${Re}"[^>]*>[^<]*</script>`),ns="/@shopify/theme-hot-reload";function Je(e,t){return t.options.liveReload==="off"?e.replace(ts,""):process.env.SHOPIFY_CLI_LOCAL_HOT_RELOAD?e.replace(ts,"").replace(/<\/head>/,`<script id="${Re}" src="${ns}" defer></script></head>`):e.includes(`<script id="${Re}"`)?e:e.replace(/<\/head>/,`<script id="${Re}" src="${cn}" defer></script></head>`)}function ln(e){return e.startsWith("assets/")}function rs(e){if(!(["sections/","snippets/","blocks/"].some(c=>e.key.startsWith(c))&&e.key.endsWith(".liquid")))return;let n={stylesheetTag:!1,javascriptTag:!1,schemaTag:!1,liquid:!1},r={checksum:e.checksum,liquid:"",stylesheetTag:"",javascriptTag:"",schemaTag:""},o=Ge.get(e.key);if(o?.checksum===e.checksum||(Ge.delete(e.key),!e.value))return n;let i=["stylesheet","javascript","schema"],a=c=>c?.replace(/\s+/g," ").trim(),u=e.value,p=(c,l)=>{u=u.replace(l,"");let f=a(l),w=`${c}Tag`;n[w]=!o||f!==o[w],r[w]=f};for(let c of i){let l=we(e.value??"",c);l&&p(c,l)}return u=a(u.replace(/<!--[\s\S]*?-->/g,"").replace(/{%\s*comment\s*%}[\s\S]*?{%\s*endcomment\s*%}/g,"").replace(/{%\s*doc\s*%}[\s\S]*?{%\s*enddoc\s*%}/g,"")),r.liquid=u,n.liquid=!o||u!==o.liquid,Ge.set(e.key,r),n}m();m();import{lstat as dn}from"node:fs/promises";async function Ve(e){try{return await dn(e),!0}catch(t){if(t instanceof Error&&"code"in t&&(t.code==="ENOENT"||t.code==="ENOTDIR"))return!1;throw t}}async function os(e,t){return e===t||await Ve(e)?e:os(tt(e),t)}function X(e){if(!e||e==="."||e===".."||/[\\/]/.test(e)||/^[a-z]:/i.test(e))throw new k(`Unsafe listing name: ${e}`)}async function P(e,t){let s=t.replace(/\\/g,"/");if(!t||/^[\\/]/.test(t)||/^[a-z]:/i.test(t)||s.split("/").includes(".."))throw new k(`Unsafe theme file key: ${t}`);let n=et(e),r=x(n,s);if(A(n,r)===""||!Ie(n,r,{native:!0}))throw new k(`Unsafe theme file key: ${t}`);let o=await os(r,n);try{let i=await Le(n),a=await Le(o);if(!Ie(i,a,{native:!0}))throw new k(`Unsafe theme file key: ${t}`)}catch{throw new k(`Unsafe theme file key: ${t}`)}return r}var is=Ke(xt(),1);function un(e){return(e.startsWith("templates/")||e.startsWith("sections/"))&&e.endsWith(".json")}async function as(e,t,s){if(X(t),un(s)){await P(e,s);let n=await P(e,x("listings",t,s));if(await b(n))return n}}async function cs(e,t){X(t);let s=await P(e,"config/settings_data.json"),n=await _(s,{encoding:"utf8"}),r=(0,is.parseJSON)(n,null,!0);return r?(r.current=_e(t),JSON.stringify(r,null,2)):n}async function qo(e,t){X(t);let s=x(e,"listings"),n=x(s,t);if(await Ve(e)&&(await P(e,"listings"),await P(e,x("listings",t))),await b(n))return;let o=[];await b(s)&&(o=await N("*",{cwd:s,onlyDirectories:!0,deep:1}));let i=o.length>0?`Available presets: ${o.map(a=>`"${_e(a)}"`).join(", ")}`:'No presets found under "listings/"';throw new k(`Listing preset "${t}" was not found. ${i}.`,`Add the preset to config/settings_data.json and its corresponding "listings/${t}" folder, or remove the --listing flag to use the default theme settings.`)}import pn from"node:events";import{fileURLToPath as mn}from"node:url";var fn=250,ls=["AGENTS.md","DESIGN.md","assets/**/*.*","config/**/*.json","config/styles.css","layout/**/*.liquid","locales/**/*.json","sections/**/*.{liquid,json}","blocks/**/*.liquid","snippets/**/*.liquid","templates/**/*.{liquid,json}","templates/customers/**/*.{liquid,json}"],$={documentationFilesRegex:/^(AGENTS|DESIGN)\.md$/,layoutLiquidRegex:/^layout\/.+\.liquid$/,sectionLiquidRegex:/^sections\/.+\.liquid$/,blockLiquidRegex:/^blocks\/.+\.liquid$/,configSchemaRegex:/^config\/settings_schema\.json$/,configDataRegex:/^config\/settings_data\.json$/,configStylesheetRegex:/^config\/styles\.css$/,sectionJsonRegex:/^sections\/.+\.json$/,templateJsonRegex:/^templates\/.+\.json$/,jsonRegex:/^(?!config\/).*\.json$/,contextualizedJsonRegex:/\.context\.[^.]+\.json$/i,staticAssetRegex:/^assets\/(?!.*\.liquid$)/};function ei(e,t){t?.listing!==void 0&&X(t.listing);let s=new Map,n=new Map,r=new Set,o={ignoreFromFile:[],ignore:t?.filters?.ignore??[],only:t?.filters?.only??[]},i=new pn,a=(d,E)=>{i.emit(d,E)},u=t?.notify?new pe(t.notify):void 0,p=async d=>{let E=t?.listing?await gn(e,d,t.listing):await fe(e,d),g=me(d,E);return s.set(d,J({key:d,checksum:g,value:typeof E=="string"?E:"",attachment:Buffer.isBuffer(E)?E.toString("base64"):""})),E},c=N(ls,{cwd:e,deep:3,ignore:B}).then(async d=>{o.ignoreFromFile.push(...await It(e));let E=ue(d.map(g=>({key:g})),o);await Promise.all(E.map(({key:g})=>p(g)))}),l=d=>A(e,d),f=d=>ue([{key:d}],o).length===0;function w(d,E,g,T){if(process.env.SHOPIFY_CLI_LOCAL_HOT_RELOAD&&T===ve()){ne(E,T);return}let R=l(T);if(t?.listing&&R.startsWith(`listings/${t.listing}/`)){let S=R.replace(`listings/${t.listing}/`,"");if(S.startsWith("templates/")||S.startsWith("sections/"))R=S;else return}h(R).then(()=>{switch(d){case"add":case"change":return y(d,E,g,R);case"unlink":return be(E,g,R,n)}}).catch(S=>{W(`Error handling file event for ${R}: ${S}`)})}function h(d){return u?.notify(d)??Promise.resolve()}let y=(d,E,g,T)=>{if(f(T))return;let R=s.get(T)?.checksum,S=p(T).then(async()=>{let F=s.get(T);if(F)return F.checksum!==R&&r.add(T),{value:F.value||void 0,attachment:F.attachment}}),j=S.then(F=>{if(F)return hn(r,n,T,E,g)(F)}).catch(Ce(T,"upload"));a(d,{fileKey:T,onContent:F=>{S.then(Z=>{r.has(T)&&F(Z?.value??Z?.attachment??"")}).catch(()=>{})},onSync:(F,Z)=>{j.then(Q=>{Q?F():Z?.()}).catch(()=>{})}})},be=(d,E,g,T)=>{if(f(g))return;T.delete(g),s.delete(g),r.add(g);let R=t?.noDelete?Promise.resolve():Rt(Number(d),[g],E).then(async S=>{if(!S[0]?.success)throw new Error(`Failed to delete file "${g}" from remote theme.`);return r.delete(g),ds("delete",g),!0}).catch(S=>(Ce(g,"delete")(S),!1));a("unlink",{fileKey:g,onSync:S=>{R.then(j=>{j&&S()}).catch(()=>{})}})},ke=new Set(ls.map(d=>x(e,d.split("/").shift()??"")));return t?.listing&&ke.add(x(e,"listings",t.listing)),process.env.SHOPIFY_CLI_LOCAL_HOT_RELOAD&&ke.add(ve()),{root:e,files:s,unsyncedFileKeys:r,uploadErrors:n,ready:()=>c,delete:async d=>{await P(e,d),s.delete(d),await yn(e,d)},write:async d=>{await P(e,d.key);let E=(d.key.startsWith("templates/")||d.key.startsWith("sections/"))&&d.key.endsWith(".json");if(t?.listing&&E){let g=x("listings",t.listing,d.key),T=await P(e,g),R=await b(T);s.set(d.key,J({key:d.key,checksum:d.checksum,value:d.value??"",attachment:d.attachment??""})),R?await Xe(e,{...d,key:g}):await Xe(e,d);return}s.set(d.key,J({key:d.key,checksum:d.checksum,value:d.value??"",attachment:d.attachment??""})),await Xe(e,d)},read:p,applyIgnoreFilters:d=>ue(d,o),addEventListener:(d,E)=>{i.on(d,E)},startWatcher:async(d,E)=>{let{default:g}=await import("./chokidar-5RWEYTNQ.js"),T=g.watch([...ke],{ignored:B,persistent:!process.env.SHOPIFY_UNIT_TEST,ignoreInitial:!0}),R=new Map,S=(j,F)=>{let Q=`${l(F)}:${j}`,Qe=R.get(Q);Qe&&clearTimeout(Qe);let us=setTimeout(()=>{R.delete(Q),w(j,d,E,F)},fn);R.set(Q,us)};T.on("add",S.bind(null,"add")).on("change",S.bind(null,"change")).on("unlink",S.bind(null,"unlink")).on("error",j=>{W(`File watcher error: ${j}`),q("theme-service:file-watcher:error")})}}}function hn(e,t,s,n,r){return async o=>{if(!e.has(s))return!1;let[i]=await Ft(Number(n),[{key:s,...o}],r);if(!i?.success){let a=i?.errors?.asset??["Response was not successful."];throw t.set(s,a),ne(n,s),new Error(a.join(`
|
|
100
|
-
`))}return t.delete(s)&&ne(n,s),e.delete(s),ds("update",s),!0}}async function Xe(e,{key:t,attachment:s,value:n}){let r=await P(e,t);if(await En(r),s){let o=Buffer.from(s,"base64");await je(r,o,{encoding:"base64"})}else await je(r,n??"")}async function fe(e,t){let s=$e(t)?{encoding:"utf8"}:{},n=await P(e,t);if(!await b(n)){v(`File ${n} can't be read because it doesn't exist...`);return}return _(n,s)}async function gn(e,t,s){if(t==="config/settings_data.json")return cs(e,s);let n=await as(e,s,t);if(n){let r=$e(t)?{encoding:"utf8"}:{};return _(n,r)}return fe(e,t)}async function yn(e,t){let s=await P(e,t);if(!await b(s)){v(`File ${s} can't be removed because it doesn't exist...`);return}await ot(s)}function ti(e){let t=[],s=[],n=[],r=[],o=[],i=[],a=[],u=[],p=[],c=[],l=[],f=[],w=[];return e.forEach(h=>{let y=h.key;$.documentationFilesRegex.test(y)?w.push(h):y.endsWith(".liquid")?$.sectionLiquidRegex.test(y)?t.push(h):$.blockLiquidRegex.test(y)?l.push(h):$.layoutLiquidRegex.test(y)?f.push(h):s.push(h):$.configSchemaRegex.test(y)?a.push(h):$.configDataRegex.test(y)?u.push(h):$.configStylesheetRegex.test(y)?p.push(h):$.jsonRegex.test(y)?$.contextualizedJsonRegex.test(y)?i.push(h):$.sectionJsonRegex.test(y)?n.push(h):$.templateJsonRegex.test(y)?r.push(h):o.push(h):$.staticAssetRegex.test(y)&&c.push(h)}),{sectionLiquidFiles:t,otherLiquidFiles:s,sectionJsonFiles:n,templateJsonFiles:r,contextualizedJsonFiles:i,otherJsonFiles:o,configSchemaFile:a,configDataFile:u,configStylesheetFiles:p,staticAssetFiles:c,blockLiquidFiles:l,layoutFiles:f,documentationFiles:w}}function $e(e){return $t({liquid:"application/liquid",sass:"text/x-sass",scss:"text/x-scss"}),["application/javascript","application/json","application/liquid","text/css","text/x-sass","text/x-scss","image/svg+xml","text/markdown"].includes(z(e))}async function si(e){let t=new Set(await N("*",{cwd:e,deep:1,onlyDirectories:!0}));return["config","layout","templates"].every(n=>t.has(n))}async function En(e){let t=wn(e);await b(t)||await rt(t)}function wn(e){let t=st(e),s=e.lastIndexOf(t);return e.substring(0,s)}function ds(e,t){ie(oe`• ${ce.format(new Date)} Synced ${C.raw("\xBB")} ${e} ${t}`)}function ve(){let e=process.env.SHOPIFY_CLI_LOCAL_HOT_RELOAD;return!e||e==="true"?x(mn(import.meta.url.split("/cli/")[0]??""),"theme-hot-reload/dist/theme-hot-reload.js"):e}function me(e,t){return t?Buffer.isBuffer(t)?Ze(t):Rn(e)?xn(t):Tn(e,t):""}function xn(e){let t=e;return t=t.replace(/\r\n/g,`
|
|
101
|
-
`),t=t.replace(/\/\*[\s\S]*?\*\//,""),t=Sn(t),Ze(t)}function Tn(e,t){let s=t;return $e(e)&&(s=s.replace(/\r\n/g,`
|
|
102
|
-
`)),Ze(s)}function Sn(e){let t=!1,s=!1,n="";for(let r of e)r==='"'&&!s&&(t=!t),!(!t&&(r===" "||r===`
|
|
103
|
-
`))&&(n+=r,s=r==="\\"&&!s);return n}function Ze(e){let t=Buffer.isBuffer(e)?e:Buffer.from(e);return it(t)}function ai(e){let t=new Set(e.filter(({key:s})=>s.startsWith("assets/")&&s.endsWith(".liquid")).map(({key:s})=>s));return e.filter(({key:s})=>s.startsWith("assets/")?!t.has(`${s}.liquid`):!0)}function Rn(e){return e.endsWith("/settings_data.json")}export{ai as a,Ut as b,zt as c,Gt as d,Xt as e,Br as f,no as g,xo as h,Kt as i,ne as j,as as k,qo as l,ei as m,ti as n,si as o};
|
package/dist/chunk-PMHP57MH.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import{e as se}from"./chunk-QFWWCZOI.js";import{p as L,v as re}from"./chunk-DJAZBPYA.js";import{ca as Te,da as ie}from"./chunk-M5TGCSUK.js";import{r as X}from"./chunk-IUP7POIE.js";import{b as oe,c as E}from"./chunk-Q2SZCZE7.js";import{A as Z,z as T}from"./chunk-CZ22VZDA.js";import{c as Q}from"./chunk-J6TW43TG.js";import{h as N}from"./chunk-2VSNFOKD.js";import{Bb as ne,Da as D,N as I,Sa as j,_a as M,na as B,ta as A,wb as g,yb as ee,zb as te}from"./chunk-LWCTKI4Z.js";import{b as m,h as V,i as z,j as K}from"./chunk-FZCGRIOM.js";import{b as Oe}from"./chunk-YTUUU33R.js";import{c as O,e as R,g as U,o as q}from"./chunk-IWTNUJGY.js";import{e as b,g as l}from"./chunk-VKWPEFWQ.js";l();l();l();import{AsyncLocalStorage as xe}from"node:async_hooks";import{format as Se}from"node:util";var ce=new xe,x=0,P;async function ae(t){if(K()!=="json")return t();x===0&&(P=console.error,console.error=(...e)=>{ce.getStore()?z({type:"diagnostic",level:"warning",message:Se(...e)}):P(...e)}),x++;try{return await ce.run(!0,t)}finally{Fe()}}function Fe(){x--,x===0&&(console.error=P)}var i=b(ie(),1),k=b(Te(),1);function _e(t,e){return t instanceof Error&&"code"in t&&t.code==="ENOENT"&&"path"in t&&typeof t.path=="string"&&R(t.path)===R(e)}async function Re(t){if(!(t===void 0||i.ModernIdentifiers.some(e=>e===t))&&await j(t)&&await D(await B(t)))throw new N(`Theme Check config must be a file, but ${t} is a directory.`,"Pass the path to a .theme-check.yml file to --config, or omit --config to use the .theme-check.yml in your theme root. To choose the theme directory, use --path.")}async function $(t,e){await Re(t);try{return await e()}catch(r){throw t!==void 0&&_e(r,t)?new N(`Theme Check config file not found: ${t}`):r}}function Ie(t){switch(t){case"error":return i.Severity.ERROR;case"suggestion":case"warning":return i.Severity.WARNING;case"style":case"info":return i.Severity.INFO;case"crash":return}}function ue(t){switch(t){case i.Severity.ERROR:return"error";case i.Severity.WARNING:return"warning";case i.Severity.INFO:return"info"}}function Ae(t){return new Map(t.map(e=>[e.uri,e.source]))}function je(t,e,r){let o=t.split(`
|
|
2
|
-
`).slice(e,r+1),s=o.length===1;return o.map((c,a)=>{let u=e+a+1,h=s?c.trim():c;return`${u} ${h}`}).join(`
|
|
3
|
-
`)}function Ne(t){switch(t){case i.Severity.ERROR:return{error:`
|
|
4
|
-
[error]:`};case i.Severity.WARNING:return{warn:`
|
|
5
|
-
[warning]:`};case i.Severity.INFO:return{info:`
|
|
6
|
-
[info]:`}}}function Ee(t,e){return t.map((n,o)=>{let{message:s,uri:c,start:a,end:u,check:h,severity:y}=n,f=e.get(c),p=f===void 0?[]:[`
|
|
7
|
-
|
|
8
|
-
${je(f,a.line,u.line)}`],v=o===t.length-1?"":`
|
|
9
|
-
|
|
10
|
-
`;return[Ne(y),{bold:h},{subdued:`
|
|
11
|
-
${s}`},...p,v]}).flat()}var Le=(t,e)=>t.severity-e.severity;function G(t){let e=t.reduce((r,n)=>{let{uri:o}=n,s=i.path.fsPath(o);return r[s]??=[],r[s].push(n),r},{});return Object.keys(e).reduce((r,n)=>(r[n]=e[n].sort(Le),r),{})}function me(t){return t.reduce((e,r)=>(e[r.severity]=(e[r.severity]??0)+1,e),{})}function he(t,e,r){let n=[`${r.length} files inspected`];if(t.length===0)n.push("with no offenses found.");else{n.push(`with ${t.length} total offenses found across ${Object.keys(e).length} files.`);let o=me(t);o[i.Severity.ERROR]&&n.push(`
|
|
12
|
-
${o[i.Severity.ERROR]} errors.`),o[i.Severity.WARNING]&&n.push(`
|
|
13
|
-
${o[i.Severity.WARNING]} warnings.`),o[i.Severity.INFO]&&n.push(`
|
|
14
|
-
${o[i.Severity.INFO]} info issues.`)}return n}function fe(t,e,r,n){let o=Ae(r);Object.keys(t).sort().forEach(c=>{let a=c.replace(e,"").slice(1);T({headline:n?`[${n}] ${a}`:a,body:Ee(t[c],o)})})}function Pe(t,e){return Object.entries(t).map(([r,n])=>{let o=n.map(c=>({check:c.check,severity:ue(c.severity),start_row:c.start.line,start_column:c.start.character,end_row:c.end.line,end_column:c.end.character,message:c.message})),s=me(n);return{environment:e,path:r,offenses:o,errorCount:s[i.Severity.ERROR]??0,warningCount:s[i.Severity.WARNING]??0,infoCount:s[i.Severity.INFO]??0}})}function le(t,e){process.exit(H(t,e)?1:0)}function H(t,e){let r=e?Ie(e):void 0;return r!==void 0&&t.some(n=>n.severity<=r)}function $e(t){return t.split(`
|
|
15
|
-
`).map(e=>`# ${e}`).join(`
|
|
16
|
-
`)}async function de(t){let e=".theme-check.yml",r=O(t,e);if(await j(r)){ee(`${e} already exists at ${t}`);return}let{settings:n}=await(0,i.loadConfig)(void 0,t),o=$e(k.default.stringify(n)),s=k.default.stringify({extends:"theme-check:recommended",ignore:["node_modules/**"]});await A(r,`${s}${o}`),te(`Created ${e} at ${t}`)}var Ge=async(t,e)=>{let r=(0,i.applyFixToString)(t.source,e),n=i.path.fsPath(t.uri);await A(n,r)};async function pe(t,e){await(0,i.autofix)(t,e,Ge)}async function ge(t,e,r){let{ignore:n,settings:o,rootUri:s}=await $(e,()=>(0,i.loadConfig)(e,t)),c={extends:[],ignore:I(n??[]),rootUri:s,...o},a=r?{[r]:c}:c;g(k.default.stringify(a))}async function ye(t,e,r){let{settings:n,ignore:o,checks:s}=await $(e,()=>(0,i.loadConfig)(e,t)),c=I(o??[]),u=Object.keys(n).reduce((y,f)=>{let{severity:p,enabled:v,...C}=n[f];if(!v)return y;let Ce=ue(p??i.Severity.INFO),w=s.find(be=>be.meta.code===f),we=w&&w.meta?{description:w.meta.docs.description,doc:w.meta.docs.url}:{};return y[f]={severity:Ce,...we,ignored_patterns:`[${c.join(", ")}]`,...C},y},{}),h=r?{[r]:u}:u;g(k.default.stringify(h))}function ve(t){return"_handle"in t&&typeof t._handle=="object"&&t._handle!==null&&typeof t._handle.setBlocking=="function"}async function W(t,e,r){let{offenses:n,theme:o}=await $(e,()=>ae(()=>(0,i.themeCheckRun)(t,e,c=>{process.env.SHOPIFY_TMP_FLAG_DEBUG&&ne(c)})));return{result:Pe(G(n),r),offenses:n,theme:o}}l();l();import{resolve as He}from"node:path";var ke=m.object({filePath:m.string().refine(U).describe("The absolute native path of the file."),check:m.string(),severity:m.enum(["error","warning","info"]),startRow:m.number().int().positive().describe("The one-based starting line."),startColumn:m.number().int().positive().describe("The one-based starting column."),endRow:m.number().int().positive().describe("The one-based ending line."),endColumn:m.number().int().positive().describe("The one-based ending column."),message:m.string()}).strict(),We=m.object({valid:m.boolean().describe("Whether the validation passes the selected blocking policy."),issues:m.array(ke),errorCount:m.number().int().nonnegative(),warningCount:m.number().int().nonnegative(),infoCount:m.number().int().nonnegative()}).strict(),S=se({name:"ThemeCheckResult",schema:We,definitions:{ThemeCheckIssue:ke},project:t=>{let{files:e,valid:r}=Array.isArray(t)?{files:t,valid:void 0}:t;return{valid:r??e.every(n=>n.errorCount===0),issues:e.flatMap(n=>n.offenses.map(o=>({filePath:He(n.path),check:o.check,severity:o.severity,startRow:o.start_row+1,startColumn:o.start_column+1,endRow:o.end_row+1,endColumn:o.end_column+1,message:o.message}))),errorCount:e.reduce((n,o)=>n+o.errorCount,0),warningCount:e.reduce((n,o)=>n+o.warningCount,0),infoCount:e.reduce((n,o)=>n+o.infoCount,0)}}});function Y(t){return JSON.stringify(JSON.parse(S.encode(t)))}function F({result:t,offenses:e,theme:r,valid:n},o,s,c){let a=G(e);if(o==="text"&&(fe(a,s,r,c),(e.length?T:Z)({headline:c?`[${c}] Theme Check Summary.`:"Theme Check Summary.",body:he(e,a,r)})),o==="json"){let u=process.stdout;ve(u)&&u._handle.setBlocking(!0),g(Y(n===void 0?t:{files:t,valid:n}))}}var d=b(Oe(),1);var J=b(ie(),1);var _=class extends re{static get jsonOutputSchema(){return S}static summary="Validate the theme.";static descriptionWithMarkdown="Calls and runs [Theme Check](https://shopify.dev/docs/themes/tools/theme-check) to analyze your theme code for errors and to ensure that it follows theme and Liquid best practices. [Learn more about the checks that Theme Check runs.](https://shopify.dev/docs/themes/tools/theme-check/checks)";static description=this.descriptionForHelp();static flags={...oe,...E,json:d.Flags.boolean({...E.json,env:"SHOPIFY_FLAG_JSON",exclusive:["init","version","print","list"]}),path:L.path,"auto-correct":d.Flags.boolean({char:"a",required:!1,description:"Automatically fix offenses",env:"SHOPIFY_FLAG_AUTO_CORRECT"}),config:d.Flags.string({char:"C",required:!1,description:`Path to a config file to use, overriding .theme-check.yml if present
|
|
17
|
-
Use --path to set the theme directory
|
|
18
|
-
Supports all theme-check: config values, e.g., theme-check:theme-app-extension,
|
|
19
|
-
theme-check:recommended, theme-check:all
|
|
20
|
-
For backwards compatibility, :theme_app_extension is also supported `,env:"SHOPIFY_FLAG_CONFIG"}),"fail-level":d.Flags.string({required:!1,description:"Minimum severity for exit with error code",env:"SHOPIFY_FLAG_FAIL_LEVEL",options:["crash","error","suggestion","style","warning","info"],default:"error"}),init:d.Flags.boolean({required:!1,description:"Generate a .theme-check.yml file",env:"SHOPIFY_FLAG_INIT"}),list:d.Flags.boolean({required:!1,description:"List enabled checks",env:"SHOPIFY_FLAG_LIST"}),output:d.Flags.string({char:"o",required:!1,description:"The output format to use",env:"SHOPIFY_FLAG_OUTPUT",options:["text","json"],default:"text"}),print:d.Flags.boolean({required:!1,description:"Output active config to STDOUT",env:"SHOPIFY_FLAG_PRINT"}),version:d.Flags.boolean({char:"v",required:!1,description:"Print Theme Check version",env:"SHOPIFY_FLAG_VERSION"}),environment:L.environment};static multiEnvironmentsFlags=["path"];async command(e,r,n){let o=e.path,s=e.environment?.[0],a=e.config?.startsWith(":")&&J.LegacyIdentifiers.has(e.config.slice(1))?J.LegacyIdentifiers.get(e.config.slice(1)):e.config;if(e.init){await de(o);return}if(e.version){let v=await M(O("node_modules","@shopify","theme-check-node","package.json"),{type:"file",cwd:q(import.meta.url)}),C="unknown";v&&(C=await X(v)??"unknown"),g(C);return}if(e.print){await ge(o,a,s);return}if(e.list){await ye(o,a,s);return}let u=await W(o,a,s),{offenses:h,theme:y}=u,f=e.json||e.output==="json",p=!H(h,e["fail-level"]);if(f||F({...u,valid:p},e.output,o,s),e["auto-correct"]&&await pe(y,h),f&&!n&&F({...u,valid:p},"json",o,s),f)return p||(process.exitCode=1),{files:u.result,valid:p};if(!n)return le(h,e["fail-level"])}async _run(){let e=this.argv.indexOf("--"),r=e<0?this.argv:this.argv.slice(0,e),n=Ye(r)==="json";return n&&!r.includes("--json")&&(this.argv=[...r,"--json",...e<0?[]:this.argv.slice(e)]),n?V({outputMode:"json",sink:Q},()=>super._run()):super._run()}collectsEnvironmentResults(e){return!!e.json||e.output==="json"}validateCommandFlags(e){if(!this.collectsEnvironmentResults(e))return;let r=["init","version","print","list"].find(n=>e[n]);r&&this.error(`JSON output can't be used with --${r}.`,{exit:2})}renderEnvironmentResults(e){g(Y({environments:e}))}};function Ye(t){let e=process.env.SHOPIFY_FLAG_OUTPUT,r=Object.entries(_.flags);for(let n=0;n<t.length;n++){let o=t[n];if(o.startsWith("--")){let[s,...c]=o.slice(2).split("=");if(r.find(([h])=>h===s)?.[1]?.type!=="option")continue;let u=c.length?c.join("="):t[++n];s==="output"&&(e=u)}else if(o.startsWith("-"))for(let s=1;s<o.length;s++){let c=r.find(([,u])=>u.char===o[s]);if(!c)break;if(c[1].type!=="option")continue;let a=o.slice(s+1).replace(/^=/,"")||t[++n];c[0]==="output"&&(e=a);break}}return e}async function xt(t,e,r,n){let o=await W(t,r,n);return F(o,e,t,n),{offenses:o.offenses,theme:o.theme}}export{_ as a,xt as b};
|