@shopify/cli
Version:
A CLI tool to build for the Shopify platform
2 lines (1 loc) • 1.81 kB
JavaScript
import{d as i,i as r,p as s}from"./chunk-IU2ZQ6TE.js";import{g as c}from"./chunk-VPRTJUIN.js";c();import{existsSync as f,readFileSync as u}from"fs";import{fileURLToPath as p,pathToFileURL as g}from"url";var a;function h(){if(!a){let n=i(s(import.meta.url),"..","oclif.manifest.json");a=JSON.parse(u(n,"utf8")).commands}return a}var m=new Map;function y(n){let t=m.get(n);if(!t){for(t=r(p(import.meta.resolve(n)));t!==r(t);){try{if(JSON.parse(u(i(t,"package.json"),"utf8")).name===n)break}catch(o){if(o instanceof SyntaxError){t=r(t);continue}if(o.code==="ENOENT"){t=r(t);continue}throw o}t=r(t)}m.set(n,t)}return t}var P={"app:logs:sources":"dist/cli/commands/app/app-logs/sources.js","demo:watcher":"dist/cli/commands/app/demo/watcher.js","kitchen-sink":"dist/cli/commands/kitchen-sink/index.js","doctor-release":"dist/cli/commands/doctor-release/doctor-release.js","doctor-release:theme":"dist/cli/commands/doctor-release/theme/index.js"};function l(n){return P[n]??`dist/cli/commands/${n.replace(/:/g,"/")}.js`}var C=new Set(["@shopify/cli","@shopify/app","@shopify/theme"]);async function D(n){let o=h()[n];if(!o)return;let e=o.customPluginName??o.pluginName;if(e)return C.has(e)?j(n,e):k(n,e)}var d=i(s(import.meta.url),"..");function w(n,t){let o=l(n),e=i(d,o);return f(e)?d:y(t)}async function j(n,t){let o=l(n),e=w(n,t);return(await import(g(i(e,o)).href)).default}async function k(n,t){if(t==="@shopify/cli-hydrogen"){let{COMMANDS:o}=await import("./dist-V63ILV6L.js");return o?.[n]}if(t==="@oclif/plugin-commands"){let{commands:o}=await import("./lib-5L7UKDEK.js");return o[n]}if(t==="@oclif/plugin-plugins"){let{commands:o}=await import("./lib-QB6I6CTC.js");return o[n]}if(t==="@shopify/plugin-did-you-mean"){let{DidYouMeanCommands:o}=await import("./dist-LDXPBYSZ.js");return o[n]}}export{D as a};