@shopify/cli 3.94.3 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/bin/run.js +5 -1
- package/dist/analytics-5TEIW43T.js +1 -0
- package/dist/analytics-GG7CYCGL.js +1 -0
- package/dist/bootstrap.d.ts +5 -0
- package/dist/bootstrap.js +3 -0
- package/dist/chunk-2AJ5FI2K.js +7 -0
- package/dist/chunk-2GK56X53.js +1 -0
- package/dist/chunk-3D4JXJPS.js +2 -0
- package/dist/chunk-3NBK56IK.js +1 -0
- package/dist/chunk-3TNEIDOD.js +1 -0
- package/dist/chunk-3VZEETAV.js +1 -0
- package/dist/chunk-4DCQNGUV.js +19 -0
- package/dist/chunk-4IC626OL.js +1 -0
- package/dist/chunk-4LNCYIS3.js +1 -0
- package/dist/chunk-4ZGSSQC6.js +1 -0
- package/dist/chunk-54CAKCYR.js +144 -0
- package/dist/chunk-5CH3B62S.js +2 -0
- package/dist/chunk-5UHQVR2Z.js +1 -0
- package/dist/chunk-5WVAHE5E.js +1 -0
- package/dist/chunk-5Y7GIF2W.js +1 -0
- package/dist/chunk-67MH4AXG.js +1 -0
- package/dist/chunk-6CYMJ76C.js +9 -0
- package/dist/chunk-6G6TMKXF.js +28 -0
- package/dist/chunk-6HBRBQAN.js +6 -0
- package/dist/chunk-6ITDI2SD.js +1 -0
- package/dist/chunk-6M3ZYNGO.js +451 -0
- package/dist/chunk-6RE2SNCU.js +6 -0
- package/dist/chunk-6SF3ZETE.js +1 -0
- package/dist/chunk-6WL4GA2M.js +15 -0
- package/dist/chunk-75VPUOC5.js +1 -0
- package/dist/chunk-76R52ODR.js +1 -0
- package/dist/chunk-7ESSIN27.js +567 -0
- package/dist/chunk-7NH7CHVI.js +6 -0
- package/dist/chunk-7QIOUDCX.js +8 -0
- package/dist/chunk-7UYZQN4V.js +18 -0
- package/dist/chunk-7ZT57XT7.js +2 -0
- package/dist/chunk-AGNMOFJS.js +1 -0
- package/dist/chunk-BS3BKORT.js +16 -0
- package/dist/chunk-C2IK2HY3.js +4 -0
- package/dist/chunk-C7BTJ32Z.js +1 -0
- package/dist/chunk-CBXSPL4W.js +1 -0
- package/dist/chunk-CEIQFLCN.js +1 -0
- package/dist/chunk-CERXUPGC.js +14 -0
- package/dist/chunk-DCPBRWVC.js +1 -0
- package/dist/chunk-DN2IE3VY.js +1 -0
- package/dist/chunk-DRFGABEB.js +1 -0
- package/dist/chunk-E3EMHAJB.js +1 -0
- package/dist/chunk-EKXY5COY.js +1 -0
- package/dist/chunk-EQU4MUQJ.js +1 -0
- package/dist/chunk-F2QU6WWX.js +1 -0
- package/dist/chunk-FFQ5EWII.js +294 -0
- package/dist/chunk-FKMC5OFF.js +1 -0
- package/dist/chunk-FQWB2F75.js +3 -0
- package/dist/chunk-FUOIGXI4.js +1 -0
- package/dist/chunk-FYFNUDOC.js +19 -0
- package/dist/chunk-G4BPGWJC.js +1 -0
- package/dist/chunk-GVQIPEZT.js +1 -0
- package/dist/chunk-GZS44BUW.js +102 -0
- package/dist/chunk-HIBX234C.js +6 -0
- package/dist/chunk-HRUGYZZ4.js +2 -0
- package/dist/chunk-HUIJMGVJ.js +586 -0
- package/dist/chunk-HZA6IAA4.js +1 -0
- package/dist/chunk-IU2ZQ6TE.js +2 -0
- package/dist/chunk-IX5ICOBV.js +7 -0
- package/dist/chunk-IZ3C5J7G.js +5 -0
- package/dist/chunk-JAO53IH2.js +1 -0
- package/dist/chunk-JCL2RRU6.js +1 -0
- package/dist/chunk-JQJBBXMX.js +17 -0
- package/dist/chunk-JUVAGMIH.js +1 -0
- package/dist/chunk-JXW374CL.js +359 -0
- package/dist/chunk-K2WUCOQJ.js +32 -0
- package/dist/chunk-K6CTUBFC.js +12 -0
- package/dist/chunk-KHSYW7I4.js +1 -0
- package/dist/chunk-KHTV6PBV.js +12 -0
- package/dist/chunk-KKTW6ZCA.js +5 -0
- package/dist/chunk-KLMDWDT2.js +1 -0
- package/dist/chunk-KN3WTTHZ.js +1 -0
- package/dist/chunk-KR6QDE7D.js +2 -0
- package/dist/chunk-KZOBF55B.js +1 -0
- package/dist/chunk-L2MGAEV3.js +6 -0
- package/dist/chunk-LDGAHMS7.js +159 -0
- package/dist/chunk-M2D7USAX.js +1 -0
- package/dist/chunk-M2ZHFKPN.js +6 -0
- package/dist/chunk-M3RYUB22.js +1 -0
- package/dist/chunk-M56NDIMD.js +1 -0
- package/dist/chunk-MCVRONUY.js +1 -0
- package/dist/chunk-MHWV5RQV.js +10 -0
- package/dist/chunk-MOA33ZFO.js +1 -0
- package/dist/chunk-MWGBTOO3.js +1 -0
- package/dist/chunk-MWY3A7O3.js +4 -0
- package/dist/chunk-N5PQPIBF.js +374 -0
- package/dist/chunk-NF2ABOOU.js +1 -0
- package/dist/chunk-NMBBTTIH.js +2 -0
- package/dist/chunk-NPEVESCV.js +3 -0
- package/dist/chunk-OBEWZXOQ.js +2 -0
- package/dist/chunk-OCOY5MV2.js +1 -0
- package/dist/chunk-OLZHWPZP.js +1 -0
- package/dist/chunk-OTY24J2W.js +1 -0
- package/dist/chunk-OY3PNHPZ.js +103 -0
- package/dist/chunk-P6XE4MH5.js +1 -0
- package/dist/chunk-PAP22IQO.js +264 -0
- package/dist/chunk-PD5ZHJWI.js +1 -0
- package/dist/chunk-PIBY5DDZ.js +1 -0
- package/dist/chunk-PYVAWAUO.js +5 -0
- package/dist/chunk-Q33IBIVJ.js +1 -0
- package/dist/chunk-Q4T2T2QE.js +15 -0
- package/dist/chunk-QA23HIH4.js +1 -0
- package/dist/chunk-QBSKKQBN.js +1 -0
- package/dist/chunk-QFWIDATO.js +1 -0
- package/dist/chunk-QSTEVZFQ.js +1 -0
- package/dist/chunk-S6EJHWJL.js +1 -0
- package/dist/chunk-SIMFNECG.js +1 -0
- package/dist/chunk-SXTMSGUE.js +1 -0
- package/dist/chunk-T542UQBY.js +1 -0
- package/dist/chunk-TQ6HYDVC.js +1 -0
- package/dist/chunk-TYZXGSHO.js +3 -0
- package/dist/chunk-UHJYPEY2.js +1 -0
- package/dist/chunk-UJVH7FZS.js +1 -0
- package/dist/chunk-UJXUSRQK.js +1 -0
- package/dist/chunk-ULFWK45W.js +64 -0
- package/dist/chunk-ULQG3XQS.js +1 -0
- package/dist/chunk-URZPVSJZ.js +559 -0
- package/dist/chunk-UWJ73J4B.js +1 -0
- package/dist/chunk-UXVZ2P63.js +1411 -0
- package/dist/chunk-UYXEA3Y6.js +1 -0
- package/dist/chunk-VBUZWRUL.js +1 -0
- package/dist/chunk-VICYNG2W.js +1 -0
- package/dist/chunk-WDC3KIZT.js +2 -0
- package/dist/chunk-WFXRSKRK.js +1 -0
- package/dist/chunk-WSDN25F5.js +1 -0
- package/dist/chunk-XEFQQPL4.js +1 -0
- package/dist/chunk-XITQULK4.js +3 -0
- package/dist/chunk-XONFGLJQ.js +847 -0
- package/dist/chunk-XOTA6JTZ.js +11 -0
- package/dist/chunk-XR6GMMEU.js +1 -0
- package/dist/chunk-XULPJ6UG.js +1 -0
- package/dist/chunk-XXVEHDVO.js +1 -0
- package/dist/chunk-Y7JGYGV7.js +1 -0
- package/dist/chunk-YOZNRLFC.js +1 -0
- package/dist/chunk-YTNDFQJT.js +3 -0
- package/dist/chunk-Z35BTAM6.js +2 -0
- package/dist/chunk-ZBRRJDGW.js +1 -0
- package/dist/chunk-ZGK3LGCH.js +4 -0
- package/dist/chunk-ZR76GGZ6.js +5 -0
- package/dist/chunk-ZSBA6VIC.js +1 -0
- package/dist/chunk-ZTMSBSYD.js +1 -0
- package/dist/cli/commands/app/app-logs/sources.js +2 -0
- package/dist/cli/commands/app/build.js +1 -0
- package/dist/cli/commands/app/bulk/cancel.js +1 -0
- package/dist/cli/commands/app/bulk/execute.js +9 -0
- package/dist/cli/commands/app/bulk/status.js +5 -0
- package/dist/cli/commands/app/config/link.js +4 -0
- package/dist/cli/commands/app/config/pull.js +1 -0
- package/dist/cli/commands/app/config/use.js +1 -0
- package/dist/cli/commands/app/config/validate.js +3 -0
- package/dist/cli/commands/app/demo/watcher.js +1 -0
- package/dist/cli/commands/app/deploy.js +22 -0
- package/dist/cli/commands/app/dev/clean.js +5 -0
- package/dist/cli/commands/app/dev.js +320 -0
- package/dist/cli/commands/app/env/pull.js +11 -0
- package/dist/cli/commands/app/env/show.js +1 -0
- package/dist/cli/commands/app/execute.js +1 -0
- package/dist/cli/commands/app/function/build.js +1 -0
- package/dist/cli/commands/app/function/info.js +16 -0
- package/dist/cli/commands/app/function/replay.js +5 -0
- package/dist/cli/commands/app/function/run.js +1 -0
- package/dist/cli/commands/app/function/schema.js +1 -0
- package/dist/cli/commands/app/function/typegen.js +1 -0
- package/dist/cli/commands/app/generate/extension.js +5 -0
- package/dist/cli/commands/app/import-custom-data-definitions.js +4 -0
- package/dist/cli/commands/app/import-extensions.js +1 -0
- package/dist/cli/commands/app/info.js +11 -0
- package/dist/cli/commands/app/init.js +10 -0
- package/dist/cli/commands/app/logs.js +2 -0
- package/dist/cli/commands/app/release.js +4 -0
- package/dist/cli/commands/app/versions/list.js +1 -0
- package/dist/cli/commands/app/webhook/trigger.js +25 -0
- package/dist/cli/commands/auth/login.js +1 -20
- package/dist/cli/commands/auth/logout.js +1 -12
- package/dist/cli/commands/cache/clear.js +1 -11
- package/dist/cli/commands/config/autoupgrade/constants.d.ts +0 -1
- package/dist/cli/commands/config/autoupgrade/constants.js +1 -6
- package/dist/cli/commands/config/autoupgrade/off.js +1 -22
- package/dist/cli/commands/config/autoupgrade/on.js +1 -22
- package/dist/cli/commands/config/autoupgrade/status.js +1 -30
- package/dist/cli/commands/debug/command-flags.js +1 -79
- package/dist/cli/commands/docs/generate.d.ts +0 -8
- package/dist/cli/commands/docs/generate.js +1 -157
- package/dist/cli/commands/doctor-release/doctor-release.js +1 -25
- package/dist/cli/commands/doctor-release/theme/index.js +1 -56
- package/dist/cli/commands/help.js +1 -26
- package/dist/cli/commands/kitchen-sink/async.js +1 -16
- package/dist/cli/commands/kitchen-sink/index.js +1 -21
- package/dist/cli/commands/kitchen-sink/prompts.js +1 -16
- package/dist/cli/commands/kitchen-sink/static.js +1 -16
- package/dist/cli/commands/notifications/generate.js +1 -11
- package/dist/cli/commands/notifications/list.js +1 -33
- package/dist/cli/commands/organization/list.js +1 -0
- package/dist/cli/commands/search.js +1 -27
- package/dist/cli/commands/theme/check.js +1 -0
- package/dist/cli/commands/theme/console.js +15 -0
- package/dist/cli/commands/theme/delete.js +7 -0
- package/dist/cli/commands/theme/dev.js +26 -0
- package/dist/cli/commands/theme/duplicate.js +32 -0
- package/dist/cli/commands/theme/info.js +1 -0
- package/dist/cli/commands/theme/init.js +8 -0
- package/dist/cli/commands/theme/language-server.js +1 -0
- package/dist/cli/commands/theme/list.js +1 -0
- package/dist/cli/commands/theme/metafields/pull.js +3 -0
- package/dist/cli/commands/theme/open.js +8 -0
- package/dist/cli/commands/theme/package.js +7 -0
- package/dist/cli/commands/theme/preview.js +1 -0
- package/dist/cli/commands/theme/profile.js +3 -0
- package/dist/cli/commands/theme/publish.js +7 -0
- package/dist/cli/commands/theme/pull.js +3 -0
- package/dist/cli/commands/theme/push.js +28 -0
- package/dist/cli/commands/theme/rename.js +6 -0
- package/dist/cli/commands/theme/share.js +3 -0
- package/dist/cli/commands/upgrade.js +1 -17
- package/dist/cli/commands/version.js +1 -10
- package/dist/command-registry.d.ts +8 -0
- package/dist/command-registry.js +1 -0
- package/dist/conf-store-BMZFATRQ.js +1 -0
- package/dist/custom-oclif-loader-DVFFWCBV.js +1 -0
- package/dist/deprecations-7LHRXPXU.js +1 -0
- package/dist/dist-LDXPBYSZ.js +1 -0
- package/dist/dist-V63ILV6L.js +1 -0
- package/dist/environments-5X7S2O5U.js +1 -0
- package/dist/error-ZRLNNGIQ.js +1 -0
- package/dist/error-handler-PRZFHPRG.js +1 -0
- package/dist/fs-H7V6IRSH.js +1 -0
- package/dist/hooks/app-init.d.ts +9 -0
- package/dist/hooks/app-init.js +1 -0
- package/dist/hooks/did-you-mean.d.ts +1 -0
- package/dist/hooks/did-you-mean.js +1 -0
- package/dist/hooks/hydrogen-init.d.ts +7 -0
- package/dist/hooks/hydrogen-init.js +1 -0
- package/dist/hooks/plugin-plugins.d.ts +1 -0
- package/dist/hooks/plugin-plugins.js +1 -0
- package/dist/hooks/postrun.js +1 -1
- package/dist/hooks/prerun.js +1 -1
- package/dist/hooks/public-metadata.d.ts +1 -0
- package/dist/hooks/public-metadata.js +1 -0
- package/dist/hooks/sensitive-metadata.d.ts +1 -0
- package/dist/hooks/sensitive-metadata.js +1 -0
- package/dist/hooks/tunnel-provider.d.ts +1 -0
- package/dist/hooks/tunnel-provider.js +1 -0
- package/dist/hooks/tunnel-start.d.ts +1 -0
- package/dist/hooks/tunnel-start.js +1 -0
- package/dist/http-proxy-node16-Q5DZMBHC.js +38 -0
- package/dist/index.js +254 -3668
- package/dist/is-global-IOWPCT2U.js +1 -0
- package/dist/latest-version-EFWBOTWM.js +49 -0
- package/dist/lib-5L7UKDEK.js +1 -0
- package/dist/lib-C3VO2BQW.js +1 -0
- package/dist/lib-QB6I6CTC.js +1 -0
- package/dist/local-MTKXSZ3I.js +1 -0
- package/dist/local-storage-CYEL4MXF.js +1 -0
- package/dist/metadata-NOVBMKLM.js +1 -0
- package/dist/{morph-DQREIZD2.js → morph-EMYAITFM.js} +1 -1
- package/dist/node-package-manager-N5CVNHA3.js +1 -0
- package/dist/notifications-system-YX2GPLDW.js +1 -0
- package/dist/npa-ICFSA3NL.js +1 -0
- package/dist/output-Q46DT46U.js +1 -0
- package/dist/{path-HUAU3YBW.js → path-CWUNINMX.js} +1 -1
- package/dist/{prettier-PGDJ5B7I.js → prettier-NVRHEAFO.js} +1 -1
- package/dist/system-E6Q3OBX3.js +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/typescript-K5CWIA4V.js +1 -0
- package/dist/ui-WRS2IDPP.js +1 -0
- package/dist/upgrade-TKUN2M5P.js +1 -0
- package/dist/version-5W5RVAPA.js +1 -0
- package/dist/version-BQJ3FPXD.js +1 -0
- package/dist/workerd-GOK6GWEX.js +18 -0
- package/oclif.manifest.json +5136 -5945
- package/package.json +17 -41
- package/dist/chunk-45T5XUIM.js +0 -1
- package/dist/chunk-52KHWFYF.js +0 -1
- package/dist/chunk-66TIGB4U.js +0 -415
- package/dist/chunk-675GKVCB.js +0 -3
- package/dist/chunk-7ES6PV7M.js +0 -847
- package/dist/chunk-BF7JM4FH.js +0 -396
- package/dist/chunk-FU2Y2M3M.js +0 -5
- package/dist/chunk-IDQ4X47Z.js +0 -3
- package/dist/chunk-JBSYWYIP.js +0 -2
- package/dist/chunk-PBKIXB7L.js +0 -63
- package/dist/chunk-SVA22NZQ.js +0 -607
- package/dist/error-handler-LC7FITE7.js +0 -1
- package/dist/http-proxy-node16-TTURN6MD.js +0 -38
- package/dist/lib-3WHF5XD3.js +0 -1
- package/dist/local-TWIGLQ7X.js +0 -1
- package/dist/node-package-manager-3UCLJPGW.js +0 -1
- package/dist/npa-OKDXXRCU.js +0 -1
- package/dist/ui-UYE67X4Y.js +0 -1
- package/dist/workerd-37BZZEVW.js +0 -18
- /package/dist/{chunk-KADPE3PY.js → chunk-7MUKLZOL.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as a}from"./chunk-VPRTJUIN.js";a();function c(e,s,r){let n=[];for(let t=0;t<e.length;t+=s){let o=e.slice(t,t+s);n.push(r(o))}return n}function u(e,s,r){let n=[];for(let t=0;t<e.length;t+=s){let o=e.slice(t,t+s);n.push(r(o,t))}return n}export{c as a,u as b};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b as x,c as D,f as M}from"./chunk-FQWB2F75.js";import{a as o}from"./chunk-F2QU6WWX.js";import{c as w}from"./chunk-JUVAGMIH.js";import{C as h,F as e,v as y,z as s}from"./chunk-6G6TMKXF.js";import{Nb as _,ua as u}from"./chunk-N5PQPIBF.js";import{g as p}from"./chunk-VPRTJUIN.js";p();async function $(){let a=new Date,n=`${a.getFullYear()}-${(a.getMonth()+1).toString().padStart(2,"0")}-${a.getDate().toString().padStart(2,"0")}`,i=w(),t=await s({message:"Type of message?",choices:[{label:"Info",value:"info"},{label:"Warning",value:"warning"},{label:"Error",value:"error"}]}),b=await e({message:"Title"}),E=await e({message:"Message"}),S=await s({message:"Frequency",choices:[{label:"Only once",value:"once"},{label:"Once a week",value:"once_a_week"},{label:"Once a day",value:"once_a_day"},{label:"Always",value:"always"}]}),r=await e({message:"Minimum CLI version (optional)",initialAnswer:o,allowEmpty:!0}),l=await e({message:"Maximum CLI version (optional)",initialAnswer:o,allowEmpty:!0}),m=await e({message:"Minimum date in YYYY-MM-DD format (optional)",initialAnswer:n,allowEmpty:!0}),c=await e({message:"Maximum date in YYYY-MM-DD format (optional)",initialAnswer:n,allowEmpty:!0}),f=await e({message:"Surface. E.g.: app, theme, hydrogen, theme_app_extension... (optional)",allowEmpty:!0}),g=await e({message:"Comma separated list of commands. E.g.: app:generate:extension (optional)",allowEmpty:!0}),T=await e({message:"Slack channel of the team who will own this notification"}),d=await x(),v={id:i,type:t,title:b,frequency:S,message:E,minVersion:r.length===0?void 0:r,maxVersion:l.length===0?void 0:l,minDate:m.length===0?void 0:m,maxDate:c.length===0?void 0:c,surface:f.length===0?void 0:f,commands:g.length===0?void 0:g.split(",").map(N=>N.trim()),ownerChannel:T};d.notifications.push(v),await u("./notifications.json",JSON.stringify(d)),y({headline:"notifications.json file updated successfully."})}async function j(){let a=await D(),n={type:{header:"Type",color:"dim"},title:{header:"Title",color:"dim"},message:{header:"Message",color:"dim"},filters:{header:"Filters",color:"dim"}},i=a.notifications.map(t=>({type:t.type,title:t.title??"",message:t.message,filters:M(t)}));h({rows:i,columns:n}),_(`
|
|
2
|
+
`)}export{$ as a,j as b};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{c as S,d as D}from"./chunk-M3RYUB22.js";import{b}from"./chunk-EKXY5COY.js";import{R as g}from"./chunk-XONFGLJQ.js";import{C as E,u as m,v as w,x as k}from"./chunk-6G6TMKXF.js";import{g as v}from"./chunk-M56NDIMD.js";import{Gb as i,Ib as n,Sb as B,ca as N,ha as O,tb as y}from"./chunk-N5PQPIBF.js";import{g as l}from"./chunk-VPRTJUIN.js";l();l();function A(e){switch(e.status){case"RUNNING":return n`Bulk operation in progress${e.objectCount>0?i.gray(` (${String(e.objectCount)} objects ${e.type==="MUTATION"?"written":"read"})`):""}`;case"CREATED":return n`Starting`;case"COMPLETED":return n`Bulk operation succeeded: ${i.gray(`${String(e.objectCount)} objects`)}`;case"FAILED":return n`Bulk operation failed. ${i.errorText(`Error: ${e.errorCode??"unknown"}`)}`;case"CANCELING":return n`Bulk operation canceling...`;case"CANCELED":return n`Bulk operation canceled.`;case"EXPIRED":return n`Bulk operation expired.`;default:return n`Bulk operation status: ${e.status}`}}function q(e,a){let t=e.map(o=>n`${o.field?.join(".")??"unknown"}: ${o.message}`.value).join(`
|
|
2
|
+
`);k({headline:a,body:t})}function K(e){let a=A(e).value;switch(e.status){case"CANCELING":return{headline:"Bulk operation is being cancelled.",body:[`This may take a few moments. Check the status with:
|
|
3
|
+
`,{command:`shopify app bulk status --id=${T(e.id)}`}],renderType:"success"};case"CANCELED":case"COMPLETED":case"FAILED":{let t=[n`ID: ${i.cyan(e.id)}`.value,n`Status: ${i.yellow(e.status)}`.value,n`Created at: ${i.gray(String(e.createdAt))}`.value,...e.completedAt?[n`Completed at: ${i.gray(String(e.completedAt))}`.value]:[]];return{headline:n`Bulk operation is already ${e.status.toLowerCase()}.`.value,body:n`This operation has already finished and can't be canceled.`.value,customSections:[{body:[{list:{items:t}}]}],renderType:"warning"}}case"CREATED":case"EXPIRED":case"RUNNING":return{headline:a,renderType:"info"}}}l();var I="2026-01";l();var C={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetBulkOperationById"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"bulkOperation"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"completedAt"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"errorCode"}},{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"objectCount"}},{kind:"Field",name:{kind:"Name",value:"partialDataUrl"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var h={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ListBulkOperations"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"query"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"first"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"sortKey"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"BulkOperationsSortKeys"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"bulkOperations"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"Variable",name:{kind:"Name",value:"first"}}},{kind:"Argument",name:{kind:"Name",value:"query"},value:{kind:"Variable",name:{kind:"Name",value:"query"}}},{kind:"Argument",name:{kind:"Name",value:"sortKey"},value:{kind:"Variable",name:{kind:"Name",value:"sortKey"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"status"}},{kind:"Field",name:{kind:"Name",value:"errorCode"}},{kind:"Field",name:{kind:"Name",value:"objectCount"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"completedAt"}},{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"partialDataUrl"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};function ke(e){return e.startsWith("gid://")?e:/^\d+$/.test(e)?`gid://shopify/BulkOperation/${e}`:e}function T(e){return e.match(/^gid:\/\/shopify\/BulkOperation\/(\d+)$/)?.[1]??e}async function ce(e){let{organization:a,storeFqdn:t,operationId:o,remoteApp:s}=e;m({headline:"Checking bulk operation status.",body:[{list:{items:D({organization:a,remoteApp:s,storeFqdn:t})}}]});let u=s.apiSecretKeys[0]?.secret;if(!u)throw new v("No API secret keys found for app");let d=await g(t,s.apiKey,u),p=await b({query:C,session:d,variables:{id:o},version:await S({adminSession:d,minimumDefaultVersion:I})});p.bulkOperation?F(p.bulkOperation):k({headline:"Bulk operation not found.",body:n`ID: ${i.yellow(o)}`.value})}async function ye(e){let{organization:a,storeFqdn:t,remoteApp:o}=e;m({headline:"Listing bulk operations.",body:[{list:{items:D({organization:a,remoteApp:o,storeFqdn:t})}}]});let s=o.apiSecretKeys[0]?.secret;if(!s)throw new v("No API secret keys found for app");let u=await g(t,o.apiKey,s),d=new Date(Date.now()-10080*60*1e3).toISOString().split("T")[0],c=(await b({query:h,session:u,variables:{query:`created_at:>=${d}`,first:100,sortKey:"CREATED_AT"},version:await S({adminSession:u,minimumDefaultVersion:I})})).bulkOperations.nodes.map(r=>({id:T(r.id),status:$(r.status),count:V(r.objectCount),dateCreated:N(new Date(String(r.createdAt))),dateFinished:r.completedAt?N(new Date(String(r.completedAt))):"",results:x(r.url??r.partialDataUrl)}));B(),c.length===0?m({body:"No bulk operations found in the last 7 days."}):E({rows:c,columns:{id:{header:"ID",color:"yellow"},status:{header:"STATUS"},count:{header:"COUNT"},dateCreated:{header:"DATE CREATED",color:"cyan"},dateFinished:{header:"DATE FINISHED",color:"cyan"},results:{header:"RESULTS"}}}),B()}function F(e){let{id:a,status:t,createdAt:o,completedAt:s,url:u,partialDataUrl:d}=e,p=A(e).value,c=L(o,s),r=n`ID: ${i.yellow(a)}\n${c}`.value;if(t==="COMPLETED"){let f=u?i.link("Download results",u):"";w({headline:p,body:n`${r}\n${f}`.value})}else if(t==="FAILED"){let f=d?i.link("Download partial results",d):"";k({headline:p,body:n`${r}\n${f}`.value})}else m({headline:p,body:r})}function L(e,a){let t=new Date;return a?`Finished ${O(new Date(String(a)),t)}`:`Started ${O(new Date(String(e)),t)}`}function $(e){return e==="COMPLETED"?y.green(e):e==="FAILED"?y.red(e):y.dim(e)}function V(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function x(e){return e?n`${i.link("download",e)}`.value:""}export{I as a,C as b,ke as c,T as d,ce as e,ye as f,A as g,q as h,K as i};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Qb as m}from"./chunk-N5PQPIBF.js";import{g as p}from"./chunk-VPRTJUIN.js";p();import{spawn as h}from"child_process";function g(e=process.pid,i="SIGTERM",r=!0,s){k(e,i,r,s??(n=>{n&&m(`Failed to kill process ${e}: ${n}`)}))}function k(e,i,r,s){let t=typeof e=="number"?e.toString():e;if(!/^\d+$/.test(t))if(s){s(new Error("pid must be a number"));return}else throw new Error("pid must be a number");let n={};n[t]=[];let o=new Set;switch(o.add(t),process.platform){case"win32":{h("taskkill",["/pid",t,"/T","/F"]).on("close",u=>{s&&(u===0?s():s(new Error(`taskkill exited with code ${u}`)))});break}case"darwin":l(t,n,o,function(f){return h("pgrep",["-lfP",f])},function(){w(n,i,t,r,s)});break;default:l(t,n,o,function(f){return h("ps",["-o","pid command","--no-headers","--ppid",f])},function(){w(n,i,t,r,s)});break}}function w(e,i,r,s,t){let n=new Set;try{Object.keys(e).forEach(function(o){e[o].forEach(function(f){n.has(f)||(E(f,i),n.add(f))}),o===r&&s&&!n.has(o)&&(E(o,i),n.add(o))})}catch(o){if(t){t(o);return}else throw o}t&&t()}function E(e,i){try{process.kill(parseInt(e,10),i)}catch(r){if(r.code!=="ESRCH")throw r}}function l(e,i,r,s,t){let n=s(e),o="";n.stdout?.on("data",function(u){let a=u.toString("ascii");o+=a});let f=u=>{if(r.delete(e),u!==0){if(r.size===0){t();return}return}o.trim().split(`
|
|
2
|
+
`).forEach(function(a){let d=a.match(/^(\d+)\s(.*)$/);if(d){let c=d[1],$=d[2];i[e].push(c),i[c]=[],m(`Killing process ${c}: ${$}`),r.add(c),l(c,i,r,s,t)}})};n.on("close",f)}export{g as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as a}from"./chunk-VPRTJUIN.js";a();var o={on:"Auto-upgrade on. Shopify CLI will update automatically after each command.",off:"Auto-upgrade off. You'll need to run `shopify upgrade` to update manually."};export{o as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as c,o as m}from"./chunk-CERXUPGC.js";import{g as F}from"./chunk-VPRTJUIN.js";F();F();F();function o(e){return Number.isInteger(e)?e>=4352&&(e<=4447||e===9001||e===9002||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141):!1}var S=/^[\uD800-\uDBFF][\uDC00-\uDFFF]$/,B=["\x1B","\x9B"],E=e=>`${B[0]}[${e}m`,y=(e,t,a)=>{let i=[];e=[...e];for(let f of e){let s=f;f.includes(";")&&(f=f.split(";")[0][0]+"0");let r=m.codes.get(Number.parseInt(f,10));if(r){let n=e.indexOf(r.toString());n===-1?i.push(E(t?r:s)):e.splice(n,1)}else if(t){i.push(E(0));break}else i.push(E(s))}if(t&&(i=i.filter((f,s)=>i.indexOf(f)===s),a!==void 0)){let f=E(m.codes.get(Number.parseInt(a,10)));i=i.reduce((s,r)=>r===f?[r,...s]:[...s,r],[])}return i.join("")};function p(e,t,a){let i=[...e],f=[],s=typeof a=="number"?a:i.length,r=!1,n,u=0,l="";for(let[h,x]of i.entries()){let b=!1;if(B.includes(x)){let A=/\d[^m]*/.exec(e.slice(h,h+18));n=A&&A.length>0?A[0]:void 0,u<s&&(r=!0,n!==void 0&&f.push(n))}else r&&x==="m"&&(r=!1,b=!0);if(!r&&!b&&u++,!S.test(x)&&o(x.codePointAt())&&(u++,typeof a!="number"&&s++),u>t&&u<=s)l+=x;else if(u===t&&!r&&n!==void 0)l=y(f);else if(u>=s){l+=y(f,!0,n);break}}return l}function g(e,t,a){if(e.charAt(t)===" ")return t;let i=a?1:-1;for(let f=0;f<=3;f++){let s=t+f*i;if(e.charAt(s)===" ")return s}return t}function C(e,t,a={}){let{position:i="end",space:f=!1,preferTruncationOnSpace:s=!1}=a,{truncationCharacter:r="\u2026"}=a;if(typeof e!="string")throw new TypeError(`Expected \`input\` to be a string, got ${typeof e}`);if(typeof t!="number")throw new TypeError(`Expected \`columns\` to be a number, got ${typeof t}`);if(t<1)return"";if(t===1)return r;let n=c(e);if(n<=t)return e;if(i==="start"){if(s){let u=g(e,n-t+1,!0);return r+p(e,u,n).trim()}return f===!0&&(r+=" "),r+p(e,n-t+c(r),n)}if(i==="middle"){f===!0&&(r=` ${r} `);let u=Math.floor(t/2);if(s){let l=g(e,u),h=g(e,n-(t-u)+1,!0);return p(e,0,l)+r+p(e,h,n).trim()}return p(e,0,u)+r+p(e,n-(t-u)+c(r),n)}if(i==="end"){if(s){let u=g(e,t-1);return p(e,0,u)+r}return f===!0&&(r=` ${r}`),p(e,0,t-c(r))+r}throw new Error(`Expected \`options.position\` to be either \`start\`, \`middle\` or \`end\`, got ${i}`)}export{o as a,C as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as c,b as d}from"./chunk-ULFWK45W.js";import{m as p,n as f}from"./chunk-XONFGLJQ.js";import{d as n}from"./chunk-M56NDIMD.js";import{Ga as l,na as m}from"./chunk-N5PQPIBF.js";import{d as a}from"./chunk-IU2ZQ6TE.js";import{g as s}from"./chunk-VPRTJUIN.js";s();import{writeFile as E}from"fs/promises";var u=1024*1024,h=100,w=h*u;async function _(r,t){let e=a(t,"manifest.json");await E(e,JSON.stringify(r,null,2))}var S=["!**/*.js.map","!**/*.metafile.json"];async function b(r,t,e){let o=e??["**/*",...S];t.endsWith(".br")?await d({inputDirectory:r,outputPath:t,matchFilePattern:o}):await c({inputDirectory:r,outputZipPath:t,matchFilePattern:o})}async function C(r,t){let e=await l(t);if(e>w){let g=`${(Math.ceil(e/u*100)/100).toFixed(2)} MB`;throw new n(`Your app bundle exceeds the ${h} MB upload limit (it is ${g}).`,"Check the asset paths in your extension configuration \u2014 a misconfigured source can pull in much more than intended. Exclude large files or directories from your bundle, then try again.")}let o=p(),i=m(t);o.append("my_upload",i),await f(r,{method:"put",body:i,headers:o.getHeaders()},"slow-request")}async function N(r,t){let e=await r.generateSignedUploadUrl(t);if(!e.assetUrl||e.userErrors?.length>0){let o=e.userErrors.map(i=>i.message).join(", ");throw new n(o)}return e.assetUrl}export{_ as a,S as b,b as c,C as d,N as e};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import{a as dt,b as pt,f as we,g as ie,h as H,i as oe,k as mt}from"./chunk-K6CTUBFC.js";import{n as ne,o as re}from"./chunk-XITQULK4.js";import{a as O,b as lt}from"./chunk-3VZEETAV.js";import{a as ee,b as te,e as tt,g as st,i as nt,j as rt,k as it,n as ot,p as at,q as ct,r as se,s as I}from"./chunk-IX5ICOBV.js";import{a as J,l as Ke,m as et}from"./chunk-CBXSPL4W.js";import{aa as Qe}from"./chunk-UXVZ2P63.js";import{va as C,xa as q}from"./chunk-XONFGLJQ.js";import{b as Ve}from"./chunk-JUVAGMIH.js";import{u as Xe,w as b,x as X,y as Ze}from"./chunk-6G6TMKXF.js";import{d as Z}from"./chunk-M56NDIMD.js";import{Gb as $,Ib as Q,Nb as K,O as Ge,Qb as R,Rb as j,Ta as F,Wa as L,_ as Re,bb as Pe,ma as k,ua as Fe,wa as ze,ya as Ye}from"./chunk-N5PQPIBF.js";import{d as E,g as Se,j as Je,k as A}from"./chunk-IU2ZQ6TE.js";import{e as Ue,g as u}from"./chunk-VPRTJUIN.js";u();u();u();var qt=".shopifyignore",ht=/templates\/\*(\.(json|liquid))?$/,ut=new Set;function be(e,t={}){let s=t.ignoreFromFile??[],n=t.ignore??[],r=t.only??[],[i=[],o=[]]=ke(s),[a=[],m=[]]=ke(n),[p=[],h=[]]=ke(r),l=e.filter(N(i,".shopifyignore"));return l=l.filter(N(a,"--ignore")),l=l.filter(N(p,"--only",!0)),o.length>0&&(l=l.concat(e.filter(N(o,".shopifyignore",!0)))),m.length>0&&(l=l.concat(e.filter(N(m,"--ignore",!0)))),h.length>0&&(l=l.filter(N(h,"--only"))),Ge(l,f=>f.key)}function N(e,t,s=!1){return({key:n})=>{if(e.length===0)return!0;let r=e.some(o=>jt(n,o)||Wt(o)&&Nt(n,Mt(o)));return(s?!r:r)?(R(`Ignoring theme file ${n} via ${t}...`),!1):!0}}async function ft(e){let t=E(e,qt);return await F(t)?(await k(t,{encoding:"utf8"})).split(/(\r\n|\r|\n)/).map(r=>r.trim()).filter(r=>r&&!r.startsWith("#")):[]}function ke(e){let t=e.filter(n=>n.startsWith("!")).map(n=>n.slice(1));return[e.filter(n=>!n.startsWith("!")),t]}function jt(e,t){let s={matchBase:!0,noglobstar:!0};return Pe(e,t,s)?!0:(!t.includes("*")&&t.endsWith("/")&&!ut.has(t)&&(ut.add(t),b({headline:"Directory pattern may be misleading.",body:`For more reliable matching, consider using "${t}*" or "${t}*.<file_extension>" instead.`})),Ot(t)?Pe(e,t.replace(ht,"templates/**/*$1"),s):!1)}function Ot(e){return ht.test(e)}function Nt(e,t){return t.test(e)}function Wt(e){return e.startsWith("/")&&e.endsWith("/")}function Mt(e){return new RegExp(e.slice(1,-1))}u();import gt from"fs/promises";var ae=class{constructor(t){this.notifyPath=t,this.isValidUrl=this.validateUrl(t),this.notifyPath===""&&j("Notification skipped: notifyPath is an empty string")}async notify(t){if(this.notifyPath!=="")try{R(`Notifying filechange listener at ${this.notifyPath}...`),this.isValidUrl?await this.notifyUrl(t):await this.notifyFile(t)}catch(s){C(s);let n=`Failed to notify filechange listener at ${this.notifyPath}`;s instanceof Error&&(n=n.concat(`: ${s.message}`)),j(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 gt.writeFile(this.notifyPath,t),await gt.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}}};u();u();u();u();u();var Bt="https://unpkg.com/@shopify/polaris@13.9.2/build/esm/styles.css";function yt(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Et(e){return(0,String.raw)`<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>${e.title}</title>
|
|
5
|
+
<link rel="stylesheet" href="${Bt}" />
|
|
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">${yt(s.message)}</span>
|
|
57
|
+
<ul class="Polaris-List">
|
|
58
|
+
<li class="Polaris-List__Item">${yt(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>`}u();u();var Tt=80;function G(e,t,s){if(!Ut(e)||s.type==="theme-extension")return;let n=e.path.length>Tt?`${e.path.substring(0,Tt)}...`:e.path,i=t.headers.get("server-timing")?.match(/cfRequestDuration;dur=([\d.]+)/)?.[1],o=i?`${Math.round(Number(i))}ms`:"",a=Jt(t.status),m=e.method.padStart(6);K(Q`• ${ne.format(new Date)} Request ${$.raw("\xBB")} ${m} ${a(String(t.status))} ${n} ${$.gray(o)}`)}function Ut(e){let t=[M,W,"/checkouts","/payments"],s=[".js",".css",".json",".map"];if(t.some(i=>e.path.startsWith(i)))return!1;let[n]=e.path.split("?"),r=A(n);return!s.includes(r)}function Jt(e){return e<300?$.green:e<400?$.yellow:$.errorText}var W="/cdn/",M="/ext/cdn/",$e="/api/collect",Gt=/^\/cart\//,vt=/^\/checkouts\/(?!internal\/)/,zt=/^\/account(\/login\/multipass(\/[^/]+)?|\/logout)?\/?$/,Yt=new RegExp(`^${W}`),Vt=new RegExp(`^${M}`),Xt=/^\/api\/(unstable|\d{4}-\d{2})\/graphql\.json/,Zt=["/.well-known","/shopify/monorail","/mini-profiler-resources","/web-pixels-manager","/web-pixels@","/wpm","/services/",$e,"/cdn-cgi/challenge-platform"],xt="_shopify_essential",Qt=new RegExp(`${xt}=([^;]*)(;|$)`);function Kt(e,t){return I(async s=>{if(Zt.some(n=>s.path.startsWith(n)))return null;if(es(s)){let n=s.path.split("?")[0]??"";return De(s,t).then(async r=>{if(G(s,r,t),r.ok){let i=n.split("/").at(-1)??"";if(t.localThemeFileSystem.files.has(`assets/${i}.liquid`)){let o=z(await r.text(),t);return new Response(o,r)}}return r}).catch(async r=>{let{status:i,statusText:o,...a}=H(r,`Failed to proxy request to ${n}`);return i>=500&&!n.endsWith(".js.map")&&b(a),new Response(r.message,{status:i,statusText:o})})}})}function es(e){if(e.method!=="GET"||e.path.match(Gt)||e.path.match(vt)||e.path.match(zt)||e.path.match(Yt)||e.path.match(Vt))return!0;let[t]=e.path.split("?"),s=A(t),n=e.headers.get("accept")??"*/*";return s===".html"||n.includes("text/html")?!1:!!s||n!=="*/*"}function ce(e){return e.session.storeFqdn.replace(/\\/g,"\\\\").replace(/\./g,"\\.")}function ts(e){return Xt.test(e.path)}function z(e,t){let s=e,n=`(data-shs-beacon-endpoint=["'])https://${ce(t)}${$e}`,r=new RegExp(n,"g");s=s.replace(r,`$1${$e}`);let i=new RegExp(`(https?:)?//${ce(t)}${W}`,"g");s=s.replace(i,W);let o=/(?:https?:)?\/\/cdn\.shopify\.com\/(.*?\/(assets\/[^?#"'`>\s]+))/g,a=h=>h.startsWith("assets/"),m=new Set([...t.localThemeFileSystem.files.keys()].filter(a)),p=new Set([...t.localThemeExtensionFileSystem.files.keys()].filter(a));return s=s.replace(o,(h,l,d)=>{let f=d&&m.has(d),P=d&&p.has(d)&&l.startsWith("extensions/");return O(d).startsWith("image/")?h:P?`${M}${l}`:f?`${W}${l}`:h}),s}function ss(e,t){let s=`http://${t.options.host}:${t.options.port}`,n=new RegExp(`data-base-url=["']((?:https?:)?//${ce(t)})[^"']*?["']`,"g");return e.replace(n,(r,i)=>r.replace(i,s))}function ns(e,t){let s=new RegExp(`Domain=${ce(t)};\\s*`,"gi");return e.map(n=>n.replace(s,""))}async function le(e,t,s){if(t.status>=300&&t.status<400)return t;let n=Rt(e,t);t.headers.get("content-type")?.includes("application/json")||n.headers.set("content-type","text/html; charset=utf-8");let o=await n.text();return o=z(o,e),o=ss(o,e),s&&(o=s(o)??o),new Response(o,n)}var St=["connection","keep-alive","proxy-authenticate","proxy-authorization","te","trailer","transfer-encoding","upgrade","expect","content-security-policy","host"];function Rt(e,t){let s=new Response(t.body,t);s.headers.delete("content-length"),s.headers.delete("content-encoding");for(let o of St)s.headers.delete(o);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",z(n,e));let r=s.headers.get("Location");if(r){let o=new URL(r,"https://shopify.dev");vt.test(o.pathname)||(o.searchParams.delete("_fd"),o.searchParams.delete("pb"),s.headers.set("Location",o.href.replace(o.origin,"")))}let i=s.headers.getSetCookie();if(i?.length){s.headers.set("Set-Cookie",ns(i,e).join(","));let o=i.join(",").match(Qt)?.[1];o&&(e.session.sessionCookies[xt]=o)}return s}function Ie(e){let t=tt(e);for(let n of St)delete t[n];delete t["upgrade-insecure-requests"];let s=st(e);return s&&(t["X-Forwarded-For"]=s),t}function De(e,t){let s=e.path.replace(new RegExp(M,"g"),"/"),n=e.path.startsWith(M)?"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 i=nt(e),o=Ie(e);return ts(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"),o=pt({...o,...dt(),referer:r.origin,Cookie:mt(t.session,{headers:o}),...t.type==="theme"?{Authorization:`Bearer ${t.session.storefrontToken}`}:{}})),fetch(r,{method:e.method,body:i,duplex:i?"half":void 0,redirect:"manual",headers:o}).then(a=>Rt(t,a)).catch(a=>{throw ie(C(a),r)})}var Ae=0,rs=5;function is(e,t){return I(s=>{let[n="/",r=""]=s.path.split("?");return as(s)&&(t.lastRequestedPath=s.path),t.options.errorOverlay!=="silent"&&t.localThemeFileSystem.uploadErrors.size>0?Ft(t,{status:500,statusText:"Internal Server Error"},{title:"Failed to Upload Theme Files",header:"Upload Errors",errors:Array.from(t.localThemeFileSystem.uploadErrors.entries()).map(([o,a])=>({message:o,code:a.join(`
|
|
70
|
+
`)}))}):oe(t.session,{method:s.method,path:n,query:[...new URLSearchParams(r)],themeId:String(e.id),sectionId:"",headers:Ie(s),replaceExtensionTemplates:pe(t),replaceTemplates:He(t,n,rt(s,"localization")?.toLowerCase())}).then(async o=>{if(o.status>=400&&o.status<500&&!os(s)){let a=await cs(s,t,o);if(a)return G(s,a,t),a}return G(s,o,t),le(t,o,a=>(ls(o,a,String(e.id)),Ae=0,Le(a,t)))}).catch(async o=>{if(o instanceof de&&(R(`Theme ID mismatch: expected ${o.getExpectedThemeId()} but got ${o.getActualThemeId()}; refreshing session...`),q("theme-service:error-page:theme-id-mismatch"),t.session.refresh)){Ae++,Ae>rs&&(Ze(new Z(o.getMessage())),process.exit(1)),await t.session.refresh();let f=new URLSearchParams(r),P=new URLSearchParams([...f].filter(([ve])=>!ve.startsWith("__sfr"))),D=n+(P.toString()?`?${P}`:"");return new Response(null,{status:302,headers:{Location:D}})}let{status:a,statusText:m,cause:p,...h}=H(o,"Failed to render storefront"),[l,...d]=h.headline.split(`
|
|
71
|
+
`);return X(h),Ft(t,{status:a,statusText:m},{title:l,header:l,errors:[{message:[...d,p.message].join("<br>"),code:p.stack?.replace(`${p.message}
|
|
72
|
+
`,"")??""}]})})})}function Ft(e,t,s){let n=Le(Et(s),e);return q("theme-service:error-page:rendered"),new Response(n,{...t,headers:t.headers??{"Content-Type":"text/html; charset=utf-8"}})}function os(e){let t=new URLSearchParams(e.path.split("?")[1]);return["section_id","sections","app_block_id"].some(s=>t.has(s))}function as(e){return e.headers.get("sec-fetch-mode")==="navigate"}async function cs(e,t,s){R(`Render failed for ${e.path} with ${s.status} (x-request-id: ${s.headers.get("x-request-id")}), trying proxy...`);let n=await De(e,t).catch(r=>new Response(null,H(r)));if(n.status<400)return R(`Proxy status: ${n.status}. Returning proxy response.`),n;R(`Proxy status: ${n.status}. Returning render error.`)}function ls(e,t,s){let n=t.match(/Shopify\.theme\s*=\s*{[^}]+?"id":\s*"?(\d+)"?(}|,)/)?.[1];if(n&&n!==s)throw new de(s,n,e)}var de=class extends Error{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}};u();u();function me(e,t){let s=new RegExp(`{%-?\\s*${t}\\s*-?%}`),n=new RegExp(`{%-?\\s*end${t}\\s*-?%}`),r=s.exec(e);if(!r)return;let i=r.index+r[0].length;n.lastIndex=i;let o=n.exec(e);if(!o)return;let a=o.index;return e.slice(i,a)}u();function ue(e){let{pathname:t,search:s,searchParams:n}=new URL(e.path,"http://e.c");return{pathname:t,search:s,searchParams:n}}var ds={stylesheet:new Map,javascript:new Map};function ps(e,t){return I(async s=>{if(s.method!=="GET")return;if(us(s,t))return hs(s,t);let{file:n,fileKey:r,isUnsynced:i}=ms(s,t);if(!r)return;let o=O(r);if(o.startsWith("image/")&&s.path.includes("&")&&!i)return;if(ot(s,"X-Local-Asset","true"),!n){i&&te(s,ee({statusCode:404,statusMessage:"Not found"}));return}let a=n.value?Buffer.from(z(n.value,t)):Buffer.from(n.attachment??"","base64");return se(s,{getContents:()=>a,getMeta:()=>({type:o,size:a.length,mtime:n.stats?.mtime})})})}function ms(e,t){let s=(n,r)=>{let i=e.path.match(n)?.[1];if(i){let o=E("assets",i),a=r.files.get(o),m=r.unsyncedFileKeys.has(o);if(a||m)return{file:a,isUnsynced:m,fileKey:o}}};return s(/^(?:\/cdn\/.*?)?\/assets\/([^?]+)/,t.localThemeFileSystem)??s(/^(?:\/ext\/cdn\/extensions\/.*?)?\/assets\/([^?]+)/,t.localThemeExtensionFileSystem)??{isUnsynced:!1,fileKey:void 0,file:void 0}}function us(e,t){return t.type==="theme"&&e.path.includes("/compiled_assets")}function hs(e,t){switch(ue(e).pathname.split("/").at(-1)){case"styles.css":return fs(t,e);case"block-scripts.js":return qe(t,e,"block");case"snippet-scripts.js":return qe(t,e,"snippet");case"scripts.js":return qe(t,e,"section");case void 0:break;default:break}}function fs(e,t){let s=he(e,"section"),n=he(e,"block"),r=he(e,"snippet"),i=[`/*** GENERATED LOCALLY ***/
|
|
74
|
+
`];for(let[,a]of[...s,...n,...r]){let m=Pt(a,"stylesheet");m&&i.push(m)}let o=i.join(`
|
|
75
|
+
`);return se(t,{getContents:()=>o,getMeta:()=>({type:"text/css",size:Buffer.byteLength(o),mtime:new Date})})}function qe(e,t,s){let n=he(e,s),r=`${s}s`,i=[`
|
|
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,m]of n){let p=a.split("/").pop()?.replace(".liquid",""),h=Pt(m,"javascript")??"";p&&h&&i.push(`
|
|
90
|
+
(function () {
|
|
91
|
+
if (!__${r}__["${p}"] && !Shopify.designMode) return;
|
|
92
|
+
try {
|
|
93
|
+
${h}
|
|
94
|
+
} catch (e) {
|
|
95
|
+
console.error(e);
|
|
96
|
+
}
|
|
97
|
+
})();`)}i.push("})();");let o=i.join(`
|
|
98
|
+
`);return se(t,{getContents:()=>o,getMeta:()=>({type:"text/javascript",size:Buffer.byteLength(o),mtime:new Date})})}function he(e,t){return[...e.localThemeFileSystem.files.entries()].filter(([s])=>s.endsWith(".liquid")&&s.startsWith(`${t}s/`)).sort(([s],[n])=>s.localeCompare(n))}function Pt(e,t){let s=ds[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} */`],i=me(e.value??"",t);if(i&&r.push(i),r.length>1){let o=r.join(`
|
|
99
|
+
`);return s.set(e.key,{checksum:e.checksum,content:o}),o}}u();function Qn(){return gs()}function gs(){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()=>{}}}function pe(e){let t={},s=e.localThemeExtensionFileSystem;for(let n of s.unsyncedFileKeys){let r=s.files.get(n),i=r?.value??r?.attachment;i&&(t[n]=i)}return t}var ye=Ue(Qe(),1);import Es from"node:events";var Oe=new Map,Y=new Map;function wt(e,t){let s=(0,ye.parseJSON)(t,null,!0);if(!s)return;let n=s?.sections;n&&!e.startsWith("locales/")?Y.set(e,Object.entries(n||{}).map(([r,{type:i}])=>[i,r])):Y.delete(e)}function Ne(e){return!e.startsWith("assets/")&&[".liquid",".json"].includes(A(e))}function He(e,t,s){let n={},r=/^templates\/.+\.json$/,i=t?`${E("templates",t.replace(/^\//,"").replace(/\.html$/,"")||"index")}.json`:"",o=!!t&&e.localThemeFileSystem.files.has(i),a=/^locales\/.+\.json$/,m=!!s&&(e.localThemeFileSystem.files.has(`locales/${s}.json`)||e.localThemeFileSystem.files.has(`locales/${s}.default.json`));for(let p of e.localThemeFileSystem.unsyncedFileKeys)if(Ne(p)){if(o&&r.test(p)){if(p!==i)continue}else if(a.test(p)){if(m){if(!p.startsWith(`locales/${s}.`))continue}else if(!p.includes(".default."))continue}n[p]=e.localThemeFileSystem.files.get(p)?.value??""}return n}function wr(e,t){let s=({fileKey:r,onContent:i,onSync:o})=>{let a=A(r);i(m=>{!Rs(r)&&Ne(r)&&a===".json"&&wt(r,m),je(e,t,o,{type:"update",key:r,payload:xs(r,t)})})},n=({fileKey:r,onSync:i})=>{Y.delete(r),je(e,t,i,{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([i,o])=>{if(i.endsWith(".json")){let a=o.value??await t.localThemeFileSystem.read(i);a&&typeof a=="string"&&wt(i,a)}else i.endsWith(".liquid")&&Ct(o)}))})}var Ts="1",bt=new Es;function ge(e){bt.emit("hot-reload",{...e,version:Ts})}function ys(e,t){return I(s=>{let n=s.headers.get("accept")==="text/event-stream",r=ue(s).searchParams;if(n){let i=ct(s);return bt.on("hot-reload",o=>{i.push(JSON.stringify(o)).catch(a=>{b({headline:"Failed to send HotReload event.",body:a.stack})})}),ge({type:"open",pid:String(process.pid),themeId:String(e.id)}),i.send().then(()=>i.flush())}if(r.has("hr-log")){let i=(0,ye.parseJSON)(r.get("hr-log")??"",null);return i&&(i.headline=`[HotReload] ${i.headline}`,i.type==="error"?X(i):i.type==="warn"?b(i):i.type==="info"?Xe(i):b({headline:`Unknown HotReload log type: ${i.type}`})),null}if(s.path===_t)return k(Ee()).then(i=>it(s,i,"application/javascript")).catch(i=>te(s,ee({cause:i})));if(r.has("section_id")||r.has("app_block_id")){let i=r.get("section_key")??"",o=r.get("section_id")??"",a=r.get("app_block_id")??"",m=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"),o===""&&a==="")return;let h={};if(o){let l=t.localThemeFileSystem.unsyncedFileKeys;if(l.has(i)){let d=t.localThemeFileSystem.files.get(i)?.value;if(!d)return"";h[i]=d}for(let d of l)if(d.endsWith(".json")){for(let[f,P]of Y.get(d)??[])if(o.endsWith(`__${P}`)){let D=t.localThemeFileSystem.files.get(d)?.value;D&&(h[d]=D);continue}}}return oe(t.session,{method:s.method,path:m??"/",query:[...p.entries()],themeId:String(e.id),sectionId:o,appBlockId:a,replaceTemplates:h,headers:at(s),replaceExtensionTemplates:pe(t)}).then(async l=>{if(!l.ok)throw q("theme-service:hot-reload:section:render-failed"),ie(l);return le(t,l)}).catch(async l=>{let{status:d,statusText:f,...P}=H(C(l),"Failed to render section on Hot Reload");return q("theme-service:hot-reload:section:render-error"),a||b(P),new Response(null,{status:d,statusText:f})})}})}var V=(e,t)=>ge({themeId:String(e),type:"full",key:t});function je(e,t,s,n){let r=()=>V(e.id,n.key);if(t.options.liveReload==="off")return;if(t.options.liveReload==="full-page"){s(r);return}let i=String(e.id);ge({sync:"local",themeId:i,...n}),s(()=>ge({sync:"remote",themeId:i,...n}),r)}function vs(e,t){let s=new Set;if(e.endsWith(".json")){let n=t.localThemeFileSystem.files.get(e)?.value;if(n){let r=(0,ye.parseJSON)(n,null,!0)?.sections;for(let i of Object.keys(r??{}))s.add(i)}}else{let n=e.match(/^sections\/(.+)\.liquid$/)?.[1];if(n)for(let[r,i]of Y)for(let[o,a]of i)o===n&&s.add(a)}return[...s]}function xs(e,t){let[s]=e.split("/"),n=t.localThemeFileSystem.files.get(e);return{sectionNames:s==="sections"?vs(e,t):[],replaceTemplates:Ne(e)?He(t):{},updatedFileParts:n&&Ct(n)}}var fe="hot-reload-client",Ss="/cdn/shopifycloud/theme-hot-reload/theme-hot-reload.js",kt=new RegExp(`<script id="${fe}"[^>]*>[^<]*</script>`),_t="/@shopify/theme-hot-reload";function Le(e,t){return t.options.liveReload==="off"?e.replace(kt,""):process.env.SHOPIFY_CLI_LOCAL_HOT_RELOAD?e.replace(kt,"").replace(/<\/head>/,`<script id="${fe}" src="${_t}" defer></script></head>`):e.includes(`<script id="${fe}"`)?e:e.replace(/<\/head>/,`<script id="${fe}" src="${Ss}" defer></script></head>`)}function Rs(e){return e.startsWith("assets/")}function Ct(e){if(!(["sections/","snippets/","blocks/"].some(h=>e.key.startsWith(h))&&e.key.endsWith(".liquid")))return;let n={stylesheetTag:!1,javascriptTag:!1,schemaTag:!1,liquid:!1},r={checksum:e.checksum,liquid:"",stylesheetTag:"",javascriptTag:"",schemaTag:""},i=Oe.get(e.key);if(i?.checksum===e.checksum||(Oe.delete(e.key),!e.value))return n;let o=["stylesheet","javascript","schema"],a=h=>h?.replace(/\s+/g," ").trim(),m=e.value,p=(h,l)=>{m=m.replace(l,"");let d=a(l),f=`${h}Tag`;n[f]=!i||d!==i[f],r[f]=d};for(let h of o){let l=me(e.value??"",h);l&&p(h,l)}return m=a(m.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=m,n.liquid=!i||m!==i.liquid,Oe.set(e.key,r),n}u();var $t=Ue(Qe(),1);function Fs(e){return(e.startsWith("templates/")||e.startsWith("sections/"))&&e.endsWith(".json")}async function It(e,t,s){if(Fs(s)){let n=E(e,"listings",t,s);if(await F(n))return n}}async function Dt(e,t){let s=E(e,"config","settings_data.json"),n=await k(s,{encoding:"utf8"}),r=(0,$t.parseJSON)(n,null,!0);return r?(r.current=Re(t),JSON.stringify(r,null,2)):n}async function Dr(e,t){let s=E(e,"listings"),n=E(s,t);if(await F(n))return;let i=[];await F(s)&&(i=await L("*",{cwd:s,onlyDirectories:!0,deep:1}));let o=i.length>0?`Available presets: ${i.map(a=>`"${Re(a)}"`).join(", ")}`:'No presets found under "listings/"';throw new Z(`Listing preset "${t}" was not found. ${o}.`,`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 Ps from"node:events";import{fileURLToPath as ws}from"node:url";var ks=250,At=["assets/**/*.*","config/**/*.json","layout/**/*.liquid","locales/**/*.json","sections/**/*.{liquid,json}","blocks/**/*.liquid","snippets/**/*.liquid","templates/**/*.{liquid,json}","templates/customers/**/*.{liquid,json}"],w={layoutLiquidRegex:/^layout\/.+\.liquid$/,sectionLiquidRegex:/^sections\/.+\.liquid$/,blockLiquidRegex:/^blocks\/.+\.liquid$/,configSchemaRegex:/^config\/settings_schema\.json$/,configDataRegex:/^config\/settings_data\.json$/,sectionJsonRegex:/^sections\/.+\.json$/,templateJsonRegex:/^templates\/.+\.json$/,jsonRegex:/^(?!config\/).*\.json$/,contextualizedJsonRegex:/\.context\.[^.]+\.json$/i,staticAssetRegex:/^assets\/(?!.*\.liquid$)/};function Kr(e,t){let s=new Map,n=new Map,r=new Set,i={ignoreFromFile:[],ignore:t?.filters?.ignore??[],only:t?.filters?.only??[]},o=new Ps,a=(c,g)=>{o.emit(c,g)},m=t?.notify?new ae(t.notify):void 0,p=async c=>{let g=t?.listing?await _s(e,c,t.listing):await Ce(e,c),y=_e(c,g);return s.set(c,J({key:c,checksum:y,value:typeof g=="string"?g:"",attachment:Buffer.isBuffer(g)?g.toString("base64"):""})),g},h=L(At,{cwd:e,deep:3,ignore:re}).then(c=>Promise.all([ft(e),...c.map(p)])).then(([c])=>{Array.isArray(c)&&i.ignoreFromFile.push(...c)}),l=c=>Se(e,c),d=c=>be([{key:c}],i).length===0;function f(c,g,y,T){if(process.env.SHOPIFY_CLI_LOCAL_HOT_RELOAD&&T===Ee()){V(g,T);return}let x=l(T);if(t?.listing&&x.startsWith(`listings/${t.listing}/`)){let v=x.replace(`listings/${t.listing}/`,"");if(v.startsWith("templates/")||v.startsWith("sections/"))x=v;else return}P(x).then(()=>{switch(c){case"add":case"change":return D(c,g,y,x);case"unlink":return ve(g,y,x,n)}}).catch(v=>{j(`Error handling file event for ${x}: ${v}`)})}function P(c){return m?.notify(c)??Promise.resolve()}let D=(c,g,y,T)=>{if(d(T))return;let x=s.get(T)?.checksum,v=p(T).then(async()=>{let S=s.get(T);if(S)return S.checksum!==x&&r.add(T),{value:S.value||void 0,attachment:S.attachment}}),_=v.then(S=>{if(S)return bs(r,n,T,g,y)(S)}).catch(we(T,"upload"));a(c,{fileKey:T,onContent:S=>{v.then(B=>{r.has(T)&&S(B?.value??B?.attachment??"")}).catch(()=>{})},onSync:(S,B)=>{_.then(U=>{U?S():B?.()}).catch(()=>{})}})},ve=(c,g,y,T)=>{if(d(y))return;T.delete(y),s.delete(y),r.add(y);let x=t?.noDelete?Promise.resolve():Ke(Number(c),[y],g).then(async v=>{if(!v[0]?.success)throw new Error(`Failed to delete file "${y}" from remote theme.`);return r.delete(y),Ht("delete",y),!0}).catch(v=>(we(y,"delete")(v),!1));a("unlink",{fileKey:y,onSync:v=>{x.then(_=>{_&&v()}).catch(()=>{})}})},xe=new Set(At.map(c=>E(e,c.split("/").shift()??"")));return t?.listing&&xe.add(E(e,"listings",t.listing)),process.env.SHOPIFY_CLI_LOCAL_HOT_RELOAD&&xe.add(Ee()),{root:e,files:s,unsyncedFileKeys:r,uploadErrors:n,ready:()=>h,delete:async c=>{s.delete(c),await Cs(e,c)},write:async c=>{let g=(c.key.startsWith("templates/")||c.key.startsWith("sections/"))&&c.key.endsWith(".json");if(t?.listing&&g){let y=E("listings",t.listing,c.key),T=E(e,y),x=await F(T);s.set(c.key,J({key:c.key,checksum:c.checksum,value:c.value??"",attachment:c.attachment??""})),x?await We(e,{...c,key:y}):await We(e,c);return}s.set(c.key,J({key:c.key,checksum:c.checksum,value:c.value??"",attachment:c.attachment??""})),await We(e,c)},read:p,applyIgnoreFilters:c=>be(c,i),addEventListener:(c,g)=>{o.on(c,g)},startWatcher:async(c,g)=>{let{default:y}=await import("./chokidar-G4ONJSK4.js"),T=y.watch([...xe],{ignored:re,persistent:!process.env.SHOPIFY_UNIT_TEST,ignoreInitial:!0}),x=new Map,v=(_,S)=>{let U=`${l(S)}:${_}`,Be=x.get(U);Be&&clearTimeout(Be);let Lt=setTimeout(()=>{x.delete(U),f(_,c,g,S)},ks);x.set(U,Lt)};T.on("add",v.bind(null,"add")).on("change",v.bind(null,"change")).on("unlink",v.bind(null,"unlink")).on("error",_=>{j(`File watcher error: ${_}`),C("theme-service:file-watcher:error")})}}}function bs(e,t,s,n,r){return async i=>{if(!e.has(s))return!1;let[o]=await et(Number(n),[{key:s,...i}],r);if(!o?.success){let a=o?.errors?.asset??["Response was not successful."];throw t.set(s,a),V(n,s),new Error(a.join(`
|
|
100
|
+
`))}return t.delete(s)&&V(n,s),e.delete(s),Ht("update",s),!0}}async function We(e,{key:t,attachment:s,value:n}){let r=E(e,t);if(await $s(r),s){let i=Buffer.from(s,"base64");await Fe(r,i,{encoding:"base64"})}else await Fe(r,n??"")}async function Ce(e,t){let s=Te(t)?{encoding:"utf8"}:{},n=E(e,t);if(!await F(n)){R(`File ${n} can't be read because it doesn't exist...`);return}return k(n,s)}async function _s(e,t,s){if(t==="config/settings_data.json")return Dt(e,s);let n=await It(e,s,t);if(n){let r=Te(t)?{encoding:"utf8"}:{};return k(n,r)}return Ce(e,t)}async function Cs(e,t){let s=E(e,t);if(!await F(s)){R(`File ${s} can't be removed because it doesn't exist...`);return}await Ye(s)}function ei(e){let t=[],s=[],n=[],r=[],i=[],o=[],a=[],m=[],p=[],h=[],l=[];return e.forEach(d=>{let f=d.key;f.endsWith(".liquid")?w.sectionLiquidRegex.test(f)?t.push(d):w.blockLiquidRegex.test(f)?h.push(d):w.layoutLiquidRegex.test(f)?l.push(d):s.push(d):w.configSchemaRegex.test(f)?a.push(d):w.configDataRegex.test(f)?m.push(d):w.jsonRegex.test(f)?w.contextualizedJsonRegex.test(f)?o.push(d):w.sectionJsonRegex.test(f)?n.push(d):w.templateJsonRegex.test(f)?r.push(d):i.push(d):w.staticAssetRegex.test(f)&&p.push(d)}),{sectionLiquidFiles:t,otherLiquidFiles:s,sectionJsonFiles:n,templateJsonFiles:r,contextualizedJsonFiles:o,otherJsonFiles:i,configSchemaFile:a,configDataFile:m,staticAssetFiles:p,blockLiquidFiles:h,layoutFiles:l}}function Te(e){return lt({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"].includes(O(e))}async function ti(e){let t=new Set(await L("*",{cwd:e,deep:1,onlyDirectories:!0}));return["config","layout","sections","templates"].every(n=>t.has(n))}async function $s(e){let t=Is(e);await F(t)||await ze(t)}function Is(e){let t=Je(e),s=e.lastIndexOf(t);return e.substring(0,s)}function Ht(e,t){K(Q`• ${ne.format(new Date)} Synced ${$.raw("\xBB")} ${e} ${t}`)}function Ee(){let e=process.env.SHOPIFY_CLI_LOCAL_HOT_RELOAD;return!e||e==="true"?E(ws(import.meta.url.split("/cli/")[0]??""),"theme-hot-reload/dist/theme-hot-reload.js"):e}function _e(e,t){return t?Buffer.isBuffer(t)?Me(t):Ls(e)?Ds(t):As(e,t):""}function Ds(e){let t=e;return t=t.replace(/\r\n/g,`
|
|
101
|
+
`),t=t.replace(/\/\*[\s\S]*?\*\//,""),t=Hs(t),Me(t)}function As(e,t){let s=t;return Te(e)&&(s=s.replace(/\r\n/g,`
|
|
102
|
+
`)),Me(s)}function Hs(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 Me(e){let t=Buffer.isBuffer(e)?e:Buffer.from(e);return Ve(t)}function oi(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 Ls(e){return e.endsWith("/settings_data.json")}export{oi as a,Kt as b,is as c,ps as d,Qn as e,wr as f,ys as g,V as h,Dr as i,Kr as j,ei as k,ti as l};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as P,e as E,g as w}from"./chunk-CERXUPGC.js";import{c as s,g as a}from"./chunk-VPRTJUIN.js";var k=s((ve,W)=>{a();var z=P(),G=function(){return z.Date.now()};W.exports=G});var R=s((be,N)=>{a();var J=/\s/;function K(e){for(var r=e.length;r--&&J.test(e.charAt(r)););return r}N.exports=K});var C=s((Ee,S)=>{a();var Q=R(),V=/^\s+/;function Y(e){return e&&e.slice(0,Q(e)+1).replace(V,"")}S.exports=Y});var _=s((pe,M)=>{a();var Z=C(),A=E(),ee=w(),L=NaN,re=/^[-+]0x[0-9a-f]+$/i,ne=/^0b[01]+$/i,ie=/^0o[0-7]+$/i,te=parseInt;function ae(e){if(typeof e=="number")return e;if(ee(e))return L;if(A(e)){var r=typeof e.valueOf=="function"?e.valueOf():e;e=A(r)?r+"":r}if(typeof e!="string")return e===0?e:+e;e=Z(e);var i=ne.test(e);return i||ie.test(e)?te(e.slice(2),i?2:8):re.test(e)?L:+e}M.exports=ae});var F=s((qe,B)=>{a();var ue=E(),I=k(),j=_(),fe="Expected a function",de=Math.max,ce=Math.min;function oe(e,r,i){var u,f,x,o,t,c,m=0,p=!1,l=!1,T=!0;if(typeof e!="function")throw new TypeError(fe);r=j(r)||0,ue(i)&&(p=!!i.leading,l="maxWait"in i,x=l?de(j(i.maxWait)||0,r):x,T="trailing"in i?!!i.trailing:T);function b(n){var d=u,g=f;return u=f=void 0,m=n,o=e.apply(g,d),o}function U(n){return m=n,t=setTimeout(v,r),p?b(n):o}function X(n){var d=n-c,g=n-m,O=r-d;return l?ce(O,x-g):O}function y(n){var d=n-c,g=n-m;return c===void 0||d>=r||d<0||l&&g>=x}function v(){var n=I();if(y(n))return q(n);t=setTimeout(v,X(n))}function q(n){return t=void 0,T&&u?b(n):(u=f=void 0,o)}function D(){t!==void 0&&clearTimeout(t),m=0,u=c=f=t=void 0}function H(){return t===void 0?o:q(I())}function h(){var n=I(),d=y(n);if(u=arguments,f=this,c=n,d){if(t===void 0)return U(c);if(l)return clearTimeout(t),t=setTimeout(v,r),b(c)}return t===void 0&&(t=setTimeout(v,r)),o}return h.cancel=D,h.flush=H,h}B.exports=oe});var xe=s((We,$)=>{a();var se=F(),me=E(),le="Expected a function";function ge(e,r,i){var u=!0,f=!0;if(typeof e!="function")throw new TypeError(le);return me(i)&&(u="leading"in i?!!i.leading:u,f="trailing"in i?!!i.trailing:f),se(e,r,{leading:u,maxWait:r,trailing:f})}$.exports=ge});export{F as a,xe as b};
|