@shopify/cli
Version:
A CLI tool to build for the Shopify platform
2 lines (1 loc) • 2.61 kB
JavaScript
import{r as C}from"./chunk-LDGAHMS7.js";import{a as i,c as u}from"./chunk-ULQG3XQS.js";import{e as h,g as s}from"./chunk-VPRTJUIN.js";s();s();import{fileURLToPath as L}from"node:url";async function f(e){let{isDevelopment:o}=await import("./local-MTKXSZ3I.js"),{ShopifyConfig:n}=await import("./custom-oclif-loader-DVFFWCBV.js"),t=await import("./lib-C3VO2BQW.js"),{run:a,flush:p,Errors:d,settings:m}=t.default??t;o()&&(m.debug=!0);try{let r=new n({root:L(e.moduleURL)});await r.load(),e.lazyCommandLoader&&r.setLazyCommandLoader(e.lazyCommandLoader),await a(e.argv,r),await p()}catch(r){let{errorHandler:l}=await import("./error-handler-PRZFHPRG.js");return await l(r),d.handle(r)}}var c=h(C());async function y(e=process.versions){let o=e.node,n=Number(o.split(".")[0]);if(n<18){let{renderError:a}=await import("./ui-WRS2IDPP.js");a({headline:"Upgrade to a supported Node version now.",body:[`Node ${n} has reached end-of-life and poses security risks. When you upgrade to a`,{link:{url:"https://nodejs.dev/en/about/previous-releases",label:"supported version"}},{char:","},"you'll be able to use Shopify CLI without interruption."]}),process.exit(1)}}function I(e,o=process.argv,n=process.env){o.includes("--verbose")&&(n.DEBUG=n.DEBUG??"*"),e.development&&(n.SHOPIFY_CLI_ENV=n.SHOPIFY_CLI_ENV??"development")}function O(e=process.argv,o=process.env){(e.includes("--no-color")||e.includes("--json")||e.includes("-j")||i(o.NO_COLOR)||i(o.SHOPIFY_FLAG_NO_COLOR)||i(o[u.json])||o.TERM==="dumb")&&(o.FORCE_COLOR="0")}async function _(e,o=f,n=process.argv,t=process.env,a=process.versions){return I(e,n,t),e.runInCreateMode&&await b(e,n),O(n,t),await y(a),o({moduleURL:e.moduleURL,lazyCommandLoader:e.lazyCommandLoader})}async function b(e,o=process.argv){let{findUpAndReadPackageJson:n}=await import("./node-package-manager-N5CVNHA3.js"),{moduleDirectory:t}=await import("./path-CWUNINMX.js"),d=(await n(t(e.moduleURL))).content.name.replace("@shopify/create-","");if(o.findIndex(r=>r.includes("init"))===-1){let r=o.findIndex(l=>l.match(new RegExp(`bin(\\/|\\\\)+(create-${d}|dev|run)`)))+1;o.splice(r,0,"init")}}var E={"no-color":c.Flags.boolean({hidden:!1,description:"Disable color output.",env:"SHOPIFY_FLAG_NO_COLOR"}),verbose:c.Flags.boolean({hidden:!1,description:"Increase the verbosity of the output.",env:"SHOPIFY_FLAG_VERBOSE"})},F={json:c.Flags.boolean({char:"j",description:"Output the result as JSON. Automatically disables color output.",hidden:!1,default:!1,env:u.json})};async function S(){let{cacheClear:e}=await import("./conf-store-BMZFATRQ.js");e()}export{_ as a,E as b,F as c,S as d};