import{a as k}from"./chunk-YB3SGPFF.js";import{a as g}from"./chunk-MOCD7GFI.js";import{a as y}from"./chunk-7XQDZF73.js";import{Ga as w,g as b}from"./chunk-UZ7U322K.js";import{b as h}from"./chunk-Q6LCSRIW.js";import{O as u,t as m,v as f}from"./chunk-E24W34C4.js";import{d}from"./chunk-3QVXHF6I.js";import{r as S}from"./chunk-T6CC5WUU.js";import{e as A,g as o}from"./chunk-VKWPEFWQ.js";o();o();o();async function r(e,{web:i,stdout:t,stderr:a,signal:s,env:p={}}){let l=i.configuration.commands[e];if(!l)return;let[_,...v]=l.split(" ");await u(_,v,{cwd:i.directory,stdout:t,stderr:a,signal:s,env:p}),t.write("Web successfully built.")}async function P(e){!e.skipDependenciesInstallation&&!e.project.usesWorkspaces&&await g(e.project);let i={};e.apiKey&&(i.SHOPIFY_API_KEY=e.apiKey),await b(e.app),await m({processes:[...e.app.webs.map(t=>({prefix:["web",...t.configuration.roles].join("-"),action:async(a,s,p)=>{await r("build",{web:t,stdout:a,stderr:s,signal:p,env:i})}})),...e.app.allExtensions.map(t=>({prefix:t.localIdentifier,action:async(a,s,p)=>{await t.build({stdout:a,stderr:s,signal:p,app:e.app,environment:"production"})}}))],showTimestamps:!1}),f({headline:[{userInput:e.app.name},"built!"]})}var x=P;var I=A(S(),1);var c,n=class extends k{async run(){let{flags:i}=await this.parse(c),t=i["client-id"];await d(()=>({cmd_app_dependency_installation_skipped:i["skip-dependencies-installation"]}));let{app:a,project:s}=await w({directory:i.path,userProvidedConfigName:i.config});return await x({app:a,project:s,skipDependenciesInstallation:i["skip-dependencies-installation"],apiKey:t}),{app:a}}};c=n;n.summary="Build the app, including extensions.";n.descriptionWithMarkdown="This command executes the build script specified in the element's TOML file. You can specify a custom script in the file. To learn about configuration files in Shopify apps, refer to [App configuration](https://shopify.dev/docs/apps/tools/cli/configuration).\n\n  If you're building a [theme app extension](https://shopify.dev/docs/apps/online-store/theme-app-extensions), then running the `build` command runs [Theme Check](https://shopify.dev/docs/themes/tools/theme-check) against your extension to ensure that it's valid.";n.description=c.descriptionWithoutMarkdown();n.flags={...h,...y,"skip-dependencies-installation":I.Flags.boolean({hidden:!1,description:"Skips the installation of dependencies. Deprecated, use workspaces instead.",env:"SHOPIFY_FLAG_SKIP_DEPENDENCIES_INSTALLATION",default:!1})};var J=n;export{J as a};
