@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,6 @@
|
|
|
1
|
+
import{F as N}from"./chunk-54CAKCYR.js";import{b as A}from"./chunk-7ESSIN27.js";import{a as y,b as H}from"./chunk-WFXRSKRK.js";import{j as D}from"./chunk-GZS44BUW.js";import{a as q}from"./chunk-VBUZWRUL.js";import{b as C,l as k,s as R}from"./chunk-6G6TMKXF.js";import{d as S}from"./chunk-M56NDIMD.js";import{Ca as b,Qb as l,Ta as T,Ua as _,bb as v,na as O,wa as g}from"./chunk-N5PQPIBF.js";import{f as L}from"./chunk-YTNDFQJT.js";import{d as m,e as u,g as w,i as F}from"./chunk-IU2ZQ6TE.js";import{e as X,g as f}from"./chunk-VPRTJUIN.js";f();f();var M=X(q(),1),G=200,K=6e4,U=200,Q=500,I=class{constructor(t,e,n=G){this.currentEvents=[];this.extensionPaths=[];this.ignored={};this.extensionWatchedFiles=new Map;this.emitEvents=()=>{let t=this.currentEvents;this.currentEvents=[];let e=`\u{1F509} ${t.length} EVENTS EMITTED in files: ${t.map(n=>n.path).join(`
|
|
2
|
+
`)}`;l(e,this.options.stdout),this.onChangeCallback?.(t)};this.handleFileEvent=(t,e)=>{let n=y(),i=u(e),s=e===this.app.configPath,r=e.endsWith(".extension.toml");if(l(`\u{1F300}: ${t} ${e.replace(this.app.directory,"")}
|
|
3
|
+
`),s)this.handleEventForExtension(t,e,this.app.directory,n,!1);else{let a=this.extensionWatchedFiles.get(i),p=a===void 0||a.size===0;if(p&&t==="add"&&!r){let d=this.discoverFileOwners(i);d.size>0&&(this.extensionWatchedFiles.set(i,d),a=d,p=!1)}if(p&&!r&&!s){l(`\u{1F300}: File ${e} is not watched by any extension`,this.options.stdout);return}for(let d of a??[]){let c=this.app.realExtensions.find(E=>E.handle===d),h=c?u(c.directory):this.app.directory;this.handleEventForExtension(t,e,h,n,!1,d)}p&&this.handleEventForExtension(t,e,this.app.directory,n,!0)}this.debouncedEmit()};this.close=()=>{this.watcher&&(l("Closing file watcher",this.options.stdout),this.watcher.close().then(()=>l("File watching closed",this.options.stdout)).catch(t=>l(`File watching failed to close: ${t.message}`,this.options.stderr)))};this.app=t,this.options=e,this.debouncedEmit=R(this.emitEvents.bind(this),n,{leading:!0,trailing:!0}),this.updateApp(t)}onChange(t){this.onChangeCallback=t}async start(){let e=[...this.app.configuration.extension_directories??["extensions"]].map(r=>m(this.app.directory,r));await Promise.all(e.map(async r=>{try{await g(r.replace(/\/\*+$/,""))}catch{}}));let n=[this.app.configPath,...e],i=this.getAllWatchedFiles();n.push(...i),this.close();let{default:s}=await import("./chokidar-G4ONJSK4.js");this.watcher=s.watch(n,{ignored:["**/node_modules/**","**/.git/**"],persistent:!0,ignoreInitial:!0}),this.watcher.on("all",this.handleFileEvent),this.addAbortListener(),l(`File watcher started with ${n.length} paths`,this.options.stdout)}updateApp(t){this.app=t,this.extensionPaths=this.app.nonConfigExtensions.map(e=>u(e.directory)).filter(e=>e!==this.app.directory),this.extensionPaths.forEach(e=>{this.ignored[e]??=this.createIgnoreInstance(e)})}addAbortListener(){this.options.signal.removeEventListener("abort",this.close),this.options.signal.addEventListener("abort",this.close)}getAllWatchedFiles(){this.extensionWatchedFiles.clear();let t=this.app.realExtensions.map(n=>({extension:n,watchedFiles:n.watchedFiles()})),e=new Set;for(let{extension:n,watchedFiles:i}of t)for(let s of i){let r=u(s);e.add(r);let a=this.extensionWatchedFiles.get(r)??new Set;a.add(n.handle),this.extensionWatchedFiles.set(r,a)}return Array.from(e)}pushEvent(t){this.shouldIgnoreEvent(t)||(t.type==="extension_folder_created"&&(this.ignored[t.path]=this.createIgnoreInstance(t.path)),!this.currentEvents.some(e=>e.path===t.path&&e.type===t.type&&e.extensionHandle===t.extensionHandle)&&this.currentEvents.push(t))}shouldIgnoreEvent(t){if(t.type==="extension_folder_deleted"||t.type==="extension_folder_created"||t.extensionHandle&&this.extensionWatchedFiles.get(u(t.path))?.has(t.extensionHandle))return!1;let n=(t.extensionHandle?this.app.realExtensions.find(s=>s.handle===t.extensionHandle):void 0)?.watchedFiles(),i=this.ignored[t.extensionPath];if(n)return!n.some(r=>v(t.path,r));if(i){let s=w(t.extensionPath,t.path);return i.ignores(s)}return!1}discoverFileOwners(t){let e=new Set;for(let n of this.app.realExtensions){let i=u(n.directory);i!==this.app.directory&&t.startsWith(`${i}/`)&&this.pathMatchesWatchPatterns(t,n)&&e.add(n.handle)}return e}pathMatchesWatchPatterns(t,e){let{paths:n,ignore:i}=e.watchPatterns(),s=w(u(e.directory),t);return i.some(r=>v(s,r))?!1:n.some(r=>v(s,r))}handleEventForExtension(t,e,n,i,s,r){let a=e.endsWith(".extension.toml"),p=e===this.app.configPath;switch(t){case"change":if(s)break;a||p?this.pushEvent({type:"extensions_config_updated",path:e,extensionPath:n,extensionHandle:r,startTime:i}):this.pushEvent({type:"file_updated",path:e,extensionPath:n,extensionHandle:r,startTime:i});break;case"add":if(!a){this.pushEvent({type:"file_created",path:e,extensionPath:n,extensionHandle:r,startTime:i});break}let d=0,c=F(e),h=setInterval(()=>{_(m(c,A.lockFile))?(l(`Waiting for extension to complete creation: ${e}
|
|
4
|
+
`),d+=U):(clearInterval(h),this.extensionPaths.push(c),this.pushEvent({type:"extension_folder_created",path:c,extensionPath:n,startTime:i}),this.debouncedEmit()),d>=K&&(clearInterval(h),this.options.stderr.write(`Error loading new extension at path: ${e}.
|
|
5
|
+
Please restart the process.`))},U);break;case"unlink":if(e.endsWith(A.lockFile))break;p?this.pushEvent({type:"app_config_deleted",path:e,extensionPath:n,startTime:i}):a?(this.extensionPaths=this.extensionPaths.filter(E=>E!==n),this.pushEvent({type:"extension_folder_deleted",path:n,extensionPath:n,startTime:i})):setTimeout(()=>{this.extensionPaths.includes(n)&&(this.pushEvent({type:"file_deleted",path:e,extensionPath:n,extensionHandle:r,startTime:i}),this.extensionWatchedFiles.delete(u(e)),this.debouncedEmit())},Q);break;case"addDir":case"unlinkDir":break}}createIgnoreInstance(t){let e=m(t,".gitignore");if(!_(e))return;let n=O(e).toString().split(`
|
|
6
|
+
`).map(i=>i.trim()).filter(i=>i!==""&&!i.startsWith("#"));return M.default.default().add(n)}};f();f();function $(o,t,e=!0){let n=o.realExtensions,i=n.map(c=>c.uid),s=t.realExtensions,r=s.map(c=>c.uid),a=s.filter(c=>!i.includes(c.uid)),p=n.filter(c=>!r.includes(c.uid)),d;return e&&(d=s.filter(c=>{let h=n.find(P=>P.uid===c.uid);if(!h)return!1;let E=JSON.stringify(h.configuration)!==JSON.stringify(c.configuration),x=h.configurationPath!==c.configurationPath;return E||x})),{created:a,updated:d??[],deleted:p}}async function z(o,t,e){if(o[0]===void 0)return;let n=o.some(r=>B.includes(r.type)),i=o.filter(r=>!B.includes(r.type));if(n)return te({event:o[0],app:t,options:e,extensions:[]});let s={app:t,extensionEvents:[],path:o[0].path,startTime:o[0].startTime};for(let r of i){let a=r.extensionHandle?t.realExtensions.filter(d=>d.handle===r.extensionHandle):t.realExtensions.filter(d=>d.directory===r.extensionPath),p=Y[r.type]({event:r,app:s.app,extensions:a,options:e});s.extensionEvents.push(...p.extensionEvents)}return s}var B=["extensions_config_updated","extension_folder_created"],Y={extension_folder_deleted:Z,file_created:W,file_deleted:W,file_updated:W,app_config_deleted:ee,extension_folder_created:j,extensions_config_updated:j};function Z({event:o,app:t,extensions:e}){let n=e.map(i=>(t.removeExtension(i.uid),{type:"deleted",extension:i}));return{app:t,extensionEvents:n,startTime:o.startTime,path:o.path}}function W({event:o,app:t,extensions:e}){let n=e.map(i=>({type:"changed",extension:i}));return{app:t,extensionEvents:n,startTime:o.startTime,path:o.path}}function j(o){return{app:o.app,extensionEvents:[],startTime:o.event.startTime,path:o.event.path}}function ee(o){throw new S("The active app.toml was deleted, exiting")}async function te({event:o,app:t}){let e=await ne(t),n=$(t,e,!0),i=n.created.map(p=>({type:"created",extension:p})),s=n.deleted.map(p=>({type:"deleted",extension:p})),r=n.updated.map(p=>({type:"changed",extension:p})),a=[...i,...s,...r];return{app:e,extensionEvents:a,startTime:o.startTime,path:o.path,appWasReloaded:!0}}async function ne(o){let t=y();try{let e=await N(o);return l(`App reloaded [${H(t)}ms]`),e}catch(e){let n=new Error(`Error reloading app: ${e.message}`);throw n.cause="validation-error",n}}import{formatMessagesSync as ie}from"esbuild";import se from"events";var V=class extends se{constructor(e,n,i,s){super();this.started=!1;this.ready=!1;this.initialEvents=[];this.app=e,this.appURL=n,this.buildOutputPath=i??m(e.directory,".shopify","dev-bundle"),this.options={stdout:process.stdout,stderr:process.stderr,signal:new C},this.fileWatcher=s}async start(e,n=!0){this.started||(this.started=!0,this.options=e??this.options,await T(this.buildOutputPath)&&await b(this.buildOutputPath,{force:!0}),await g(this.buildOutputPath),n&&(this.initialEvents=this.app.realExtensions.map(i=>({type:"changed",extension:i})),await this.buildExtensions(this.initialEvents)),this.fileWatcher=this.fileWatcher??new I(this.app,this.options),this.fileWatcher.onChange(i=>{z(i,this.app,this.options).then(async s=>{if(s?.extensionEvents.length===0&&l("Change detected, but no extensions were affected"),!s)return;this.app=s.app,s.appWasReloaded&&this.fileWatcher?.updateApp(this.app),await this.rescanImports(s);let r=s.extensionEvents.filter(a=>a.type!=="deleted");await this.buildExtensions(r),s.appWasReloaded||await this.app.generateExtensionTypes(),await this.deleteExtensionsBuildOutput(s),this.emit("all",s)}).catch(s=>{this.emit("error",s)})}),await this.fileWatcher.start(),this.ready=!0,this.emit("ready",{app:this.app,extensionEvents:this.initialEvents}))}onEvent(e){return this.addListener("all",e),this}onStart(e){if(this.ready){let n={app:this.app,extensionEvents:this.initialEvents,startTime:[0,0],path:""};e(n)?.catch(()=>{})}else this.once("ready",e);return this}onError(e){return this.addListener("error",e),this}async deleteExtensionsBuildOutput(e){let i=e.extensionEvents.filter(s=>s.type==="deleted").map(s=>s.extension).map(async s=>{let r=m(this.buildOutputPath,s.getOutputFolderId());return b(r,{force:!0})});await Promise.all(i)}async buildExtensions(e){let n=D(e,r=>r.extension.uid),i=[];for(let r of Object.values(n))r.length>0&&r[0]&&i.push({extension:r[0].extension,events:r});let s=i.map(async({extension:r,events:a})=>k({outputPrefix:r.handle,stripAnsi:!1},async()=>{try{await this.buildExtension(r);let p={status:"ok",uid:r.uid};a.forEach(d=>{d.buildResult=p})}catch(p){let d=p.errors??[],c=p.message,h;if(d.length){let x=d[0];c=x?.text,h=x?.location?.file,ie(d,{kind:"error",color:!L()}).forEach(J=>{this.options.stderr.write(J)})}else this.options.stderr.write(p.message);let E={status:"error",error:c,file:h,uid:r.uid};a.forEach(x=>{x.buildResult=E})}}));return Promise.all(s)}async buildExtension(e){let n={app:this.app,stdout:this.options.stdout,stderr:this.options.stderr,useTasks:!1,environment:"development",appURL:this.appURL};await e.buildForBundle(n,this.buildOutputPath)}async rescanImports(e){if(e.path.endsWith(".toml"))return;let i=e.extensionEvents.filter(s=>s.type!=="deleted").map(s=>s.extension);i.length>0&&(await Promise.all(i.map(async a=>a.rescanImports()))).some(a=>a)&&await this.fileWatcher?.start()}};export{V as a};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as C}from"./chunk-NF2ABOOU.js";import{a as ce}from"./chunk-JQJBBXMX.js";import{b as te,c as oe,d as re,e as se,f as ie,g as ne,i as ae,j as le,l as me}from"./chunk-OY3PNHPZ.js";import{a as Q}from"./chunk-MWGBTOO3.js";import{c as V,e as P,m as X}from"./chunk-K6CTUBFC.js";import{c as Z,e as ee}from"./chunk-GVQIPEZT.js";import{n as R,p as w}from"./chunk-XITQULK4.js";import{a as z,b as B}from"./chunk-6SF3ZETE.js";import{o as K,s as J,t as Y,u as j,w as N}from"./chunk-IX5ICOBV.js";import{k as v,l as x,n as y}from"./chunk-CBXSPL4W.js";import{ta as L,xa as $}from"./chunk-XONFGLJQ.js";import{a as O}from"./chunk-JUVAGMIH.js";import{J as U,s as M,u as I,v as H,w as T,y as q,z as G}from"./chunk-6G6TMKXF.js";import{d as _,e as W}from"./chunk-WSDN25F5.js";import{d as g}from"./chunk-M56NDIMD.js";import{Gb as k,Ib as b,Nb as S,Qb as f,tb as p}from"./chunk-N5PQPIBF.js";import{g as d}from"./chunk-VPRTJUIN.js";d();d();d();d();var de={workPromise:Promise.resolve()};async function he(e,t,r,o,s){if(r.length===0)return de;f("Initiating theme asset reconciliation process");let{filesOnlyPresentLocally:a,filesOnlyPresentOnRemote:i,filesWithConflictingChecksums:l}=be(r,o),n=a.length===0&&i.length===0&&l.length===0;if($(`theme-service:theme-reconciliation:manual:${n}`),n)return f("Local and remote checksums match - no need to reconcile theme assets"),de;let m=await Re({filesOnlyPresentLocally:a,filesOnlyPresentOnRemote:i,filesWithConflictingChecksums:l},s);return{workPromise:Se(e,t,o,m)}}function be(e,t){let r=new Set,o=[],s=[];for(let i of e){r.add(i.key);let l=t.files.get(i.key);l?i.checksum!==l.checksum&&s.push(i):o.push(i)}let a=Array.from(t.files.values()).filter(i=>!r.has(i.key));return{filesOnlyPresentOnRemote:A(o,t),filesOnlyPresentLocally:A(a,t),filesWithConflictingChecksums:A(s,t)}}function A(e,t){return t.applyIgnoreFilters(e).filter(o=>o.key.endsWith(".json"))}async function E(e,t,r){if(e.length===0)return;I({body:{list:{title:t,items:e.map(s=>s.key)}}}),await G({message:"Reconciliation Strategy",choices:[{label:r.remote.label,value:D},{label:r.local.label,value:ue}]})===D?r.remote.callback(e):r.local.callback(e)}async function Se(e,t,r,o){let{localFilesToDelete:s,filesToDownload:a,remoteFilesToDelete:i}=o,l=s.map(c=>r.delete(c.key)),n=C(a,w,async c=>{let h=await v(e.id,c.map(u=>u.key),t);return Promise.all(h.map(u=>{if(u)return r.write(u)}))}),m=x(e.id,i.map(c=>c.key),t);await Promise.all([...l,...n,m])}async function Re(e,t){let{filesOnlyPresentLocally:r,filesOnlyPresentOnRemote:o,filesWithConflictingChecksums:s}=e,a=[],i=[],l=[];return t.noDelete||await E(r,"The files listed below are only present locally. What would you like to do?",{remote:{label:"Delete files from the local directory",callback:n=>{a.push(...n)}},local:{label:"Upload local files to the remote theme",callback:()=>{}}}),await E(o,"The files listed below are only present on the remote theme. What would you like to do?",{remote:{label:"Download remote files to the local directory",callback:n=>{i.push(...n)}},local:{label:"Delete files from the remote theme",callback:n=>{l.push(...n)}}}),await E(s,"The files listed below differ between the local and remote versions. What would you like to do?",{remote:{label:"Keep the remote version",callback:n=>{i.push(...n)}},local:{label:"Keep the local version",callback:()=>{}}}),{localFilesToDelete:a,filesToDownload:i,remoteFilesToDelete:l}}d();var Ae=3e3,F=class extends Error{};function pe(e,t,r,o,s,a){f("Listening for changes in the theme editor");let i=5,l=0,n="",m=r,c=async()=>{await new Promise(h=>setTimeout(h,Ae)),m=await Ee(e,t,m,o,s).then(h=>(l=0,n="",h)).catch(h=>{if(l++,h.message!==n&&(n=h.message,P("Error while polling for changes.",h)),l>=i){let u=new g("Too many polling errors...","Please check the errors above and ensure you have a stable internet connection.");q(u),a(u)}return m})};setTimeout(async()=>{for(;;)await c()})}async function Ee(e,t,r,o,s){let a=new Set(o.unsyncedFileKeys),i=fe(r,o,a),l=await y(e.id,t).then(c=>fe(c,o,a)),n=Fe(i,l),m=De(l,i);return await $e(o,n),await Oe(e,t,o,n),await Le(o,m,s),l}function De(e,t){let r=new Map(e.map(s=>[s.key,s]));return t.filter(s=>r.get(s.key)===void 0)}function Fe(e,t){let r=new Map(e.map(s=>[s.key,s]));return t.filter(s=>{let a=r.get(s.key);if(!a||a.checksum!==s.checksum)return!0})}async function Oe(e,t,r,o){let s=o.filter(i=>r.files.get(i.key)?.checksum!==i.checksum),a=C(s,w,async i=>v(e.id,i.map(l=>l.key),t).then(l=>Promise.all(l.map(async n=>{n&&(await r.write(n),S(b`• ${R.format(new Date)} Synced ${k.raw("\xBB")} ${k.gray(`download ${n.key} from remote theme`)}`))}))));await Promise.all(a)}async function Le(e,t,r){if(!r.noDelete)return Promise.all(t.map(o=>{if(e.files.get(o.key))return e.delete(o.key).then(()=>{S(b`• ${R.format(new Date)} Synced ${k.raw("\xBB")} ${k.gray(`remove ${o.key} from local theme`)}`)})}))}async function $e(e,t){let r=new Map(e.files);await Promise.all(t.map(o=>e.read(o.key)));for(let o of t){let s=r.get(o.key)?.checksum,a=e.files.get(o.key)?.checksum;if(s!==a)throw new F(`Detected changes to the file '${o.key}' on both local and remote sources. Aborting...`)}}function fe(e,t,r){return t.applyIgnoreFilters(e).filter(s=>s.key.endsWith(".json")).filter(s=>!r.has(s.key))}var ue="local",D="remote";async function ye(e,t,r,o,s,a){f("Initiating theme asset reconciliation process"),await o.ready();let{workPromise:i}=await he(e,t,r,o,s);return{updatedRemoteChecksumsPromise:i.then(async()=>{let n=await y(e.id,t);return pe(e,t,n,o,s,a),n}),workPromise:i}}d();function ke(){if(Promise.withResolvers)return Promise.withResolvers();let e,t;return{promise:new Promise((o,s)=>{e=o,t=s}),resolve:e,reject:t}}import{createServer as _e}from"node:http";function ge(e,t){let{promise:r,resolve:o,reject:s}=ke(),a=ie(e,t),i=We(e,t,s),l=Promise.all([a,i.workPromise]).then(()=>t.localThemeFileSystem.startWatcher(e.id.toString(),t.session)),n=Ie(e,t,l);return{workPromise:l,serverStart:n.start,dispatchEvent:n.dispatch,renderDevSetupProgress:i.renderProgress,backgroundJobPromise:r,resolveBackgroundJob:o}}function We(e,t,r){let o=n=>(P("Failed to perform the initial theme synchronization.",n),r(n),new Promise(()=>{})),a=y(e.id,t.session).then(n=>Me(e,t,n,r)),i=a.then(async({updatedRemoteChecksumsPromise:n})=>{let m=await n;return ce(e,t.session,m,t.localThemeFileSystem,{nodelete:t.options.noDelete,deferPartialWork:!0,backgroundWorkCatch:o})});return{workPromise:i.then(n=>n.workPromise).catch(o),renderProgress:async()=>{if(t.options.themeEditorSync){let{workPromise:m}=await a;await ee([{title:"Performing file synchronization. This may take a while...",task:async()=>{await m}}])}let{renderThemeSyncProgress:n}=await i;await n()}}}function Me(e,t,r,o){return t.options.themeEditorSync?ye(e,t.session,r,t.localThemeFileSystem,{noDelete:t.options.noDelete,ignore:t.options.ignore,only:t.options.only},o):Promise.resolve({updatedRemoteChecksumsPromise:Promise.resolve(r),workPromise:Promise.resolve()})}function Ie(e,t,r){let o=j(),s=[`http://${t.options.host}:${t.options.port}`,`https://${t.session.storeFqdn}`];o.use(Y(async()=>(await r,J(i=>{i.node.req.headers.origin&&K(i,{origin:n=>s.includes(n),credentials:!0,methods:["GET","POST","HEAD","OPTIONS"],preflight:{statusCode:204}})})))),t.options.liveReload!=="off"&&o.use(ne(e,t)),o.use(re(e,t)),o.use(te(e,t)),o.use(oe(e,t));let a=_e(N(o));return{dispatch:o.handler.bind(o),start:async()=>new Promise(i=>a.listen({port:t.options.port,host:t.options.host},()=>i({close:async()=>{await Promise.all([new Promise(l=>{a.closeAllConnections(),a.close(l)})])}})))}}import He from"readline";var qe="127.0.0.1",Ge="9292",ve=!1;async function Bt(e){if(!await me(e.directory)&&!await Z(e.force))return;e.password?.startsWith("shpat_")&&T({headline:"Admin API token missing features:",body:["Directly using an Admin API token will result in some missing features.","We recommend generating a password from the Theme Access app.","Alternatively, you can authenticate normally by not passing the --password flag.",`
|
|
2
|
+
`,{list:{title:"Known limitations:",items:["Hot module reloading","Password protected storefronts"]}}],link:{label:"Theme Access app",url:"https://shopify.dev/docs/storefronts/themes/tools/theme-access"}}),e.listing&&await ae(e.directory,e.listing);let t=await V(e.adminSession).then(Te=>Te?Q(e.storePassword,e.adminSession.storeFqdn):void 0),r=se(),o=le(e.directory,{filters:e,listing:e.listing,noDelete:e.noDelete,notify:e.notify}),s=e.host??qe;if(e.port&&!await B(Number(e.port)))throw new g(`Port ${e.port} is not available. Try a different port or remove the --port flag to use an available port.`);let a=e.port??String(await z(Number(Ge))),i={local:`http://${s}:${a}`,giftCard:`http://${s}:${a}/gift_cards/[store_id]/preview`,themeEditor:`https://${e.store}/admin/themes/${e.theme.id}/editor?hr=${a}`,preview:`https://${e.store}/?preview_theme_id=${e.theme.id}`},l=await t,m={session:await X(e.theme.id.toString(),e.adminSession,e.password,l),localThemeFileSystem:o,localThemeExtensionFileSystem:r,directory:e.directory,type:"theme",lastRequestedPath:"",options:{themeEditorSync:e["theme-editor-sync"],host:s,port:a,open:e.open,liveReload:e["live-reload"],noDelete:e.noDelete,ignore:e.ignore,only:e.only,errorOverlay:e["error-overlay"]}},{serverStart:c,renderDevSetupProgress:h,backgroundJobPromise:u,resolveBackgroundJob:Pe}=ge(e.theme,m);He.emitKeypressEvents(process.stdin);let Ce=xe(i,m,Pe);process.stdin.on("keypress",Ce),await Promise.all([u,h().then(c).then(()=>{process.stdin.isTTY&&process.stdin.setRawMode(!0),Je(i),e.open&&we(i.local,"development server")})]),await Ue(e.commandConfig,e.adminSession),process.exit(0)}async function Ue(e,t){if(!ve){ve=!0;try{await _(()=>({store_fqdn_hash:O(t.storeFqdn)})),await W(()=>({store_fqdn:t.storeFqdn})),await L({config:e,exitMode:"ok"})}catch{}}}function xe(e,t,r){let o=M(we,100,{leading:!0,trailing:!1});return(s,a)=>{if(a.ctrl&&a.name==="c"){r();return}switch(a.name){case void 0:break;case"t":o(e.local,"localhost");break;case"p":o(e.preview,"theme preview");break;case"e":o(t.lastRequestedPath==="/"?e.themeEditor:`${e.themeEditor}&previewPath=${encodeURIComponent(t.lastRequestedPath)}`,"theme editor");break;case"g":o(e.giftCard,"gift card preview");break;default:break}}}function we(e,t){U(e).catch(Ke(t))}function Ke(e){return t=>{T({headline:`Failed to open ${e}.`,body:t.stack??t.message})}}function Je(e){H({body:[{list:{title:p.bold("Preview your theme ")+p.cyan("(t)"),items:[{link:{url:e.local}}]}}],nextSteps:[[{link:{label:`Share your theme preview ${p.cyan("(p)")}`,url:e.preview}},{subdued:e.preview}],[{link:{label:`Customize your theme at the theme editor ${p.cyan("(e)")}`,url:e.themeEditor}}],[{link:{label:`Preview your gift cards ${p.cyan("(g)")}`,url:e.giftCard}}]]})}export{Bt as a,we as b};
|