@shopify/cli
Version:
A CLI tool to build for the Shopify platform
5 lines (3 loc) • 4.55 kB
JavaScript
import{a as L}from"../../../chunk-JCL2RRU6.js";import{a as C}from"../../../chunk-AGNMOFJS.js";import{Ba as P,S as I,T as R,U as x}from"../../../chunk-54CAKCYR.js";import"../../../chunk-7ESSIN27.js";import"../../../chunk-GZS44BUW.js";import"../../../chunk-K2WUCOQJ.js";import"../../../chunk-7QIOUDCX.js";import"../../../chunk-7MUKLZOL.js";import"../../../chunk-VBUZWRUL.js";import"../../../chunk-DCPBRWVC.js";import"../../../chunk-KR6QDE7D.js";import"../../../chunk-UXVZ2P63.js";import"../../../chunk-QSTEVZFQ.js";import"../../../chunk-5Y7GIF2W.js";import"../../../chunk-EKXY5COY.js";import"../../../chunk-4DCQNGUV.js";import"../../../chunk-QBSKKQBN.js";import"../../../chunk-FQWB2F75.js";import"../../../chunk-XONFGLJQ.js";import"../../../chunk-4LNCYIS3.js";import"../../../chunk-L2MGAEV3.js";import"../../../chunk-PRKBO42R.js";import"../../../chunk-ZSBA6VIC.js";import"../../../chunk-F2QU6WWX.js";import"../../../chunk-XULPJ6UG.js";import{b as k}from"../../../chunk-XR6GMMEU.js";import"../../../chunk-3TNEIDOD.js";import"../../../chunk-MHWV5RQV.js";import"../../../chunk-XOTA6JTZ.js";import"../../../chunk-MOA33ZFO.js";import"../../../chunk-JUVAGMIH.js";import{D as h,v as w,x as v}from"../../../chunk-6G6TMKXF.js";import"../../../chunk-P6XE4MH5.js";import"../../../chunk-KLMDWDT2.js";import"../../../chunk-5CH3B62S.js";import"../../../chunk-QUTQDXSL.js";import{d as g}from"../../../chunk-WSDN25F5.js";import{f as A}from"../../../chunk-M56NDIMD.js";import"../../../chunk-PD5ZHJWI.js";import{r as F}from"../../../chunk-LDGAHMS7.js";import"../../../chunk-ZR76GGZ6.js";import"../../../chunk-EENHXSWU.js";import"../../../chunk-FUOIGXI4.js";import"../../../chunk-6M3ZYNGO.js";import"../../../chunk-QYR5VPQA.js";import"../../../chunk-OBEWZXOQ.js";import"../../../chunk-N5PQPIBF.js";import"../../../chunk-CERXUPGC.js";import"../../../chunk-T4M5CWAO.js";import"../../../chunk-PRVQAHWI.js";import"../../../chunk-YTNDFQJT.js";import"../../../chunk-ULQG3XQS.js";import"../../../chunk-IU2ZQ6TE.js";import"../../../chunk-PIBY5DDZ.js";import{e as E,g as l}from"../../../chunk-VPRTJUIN.js";l();l();async function O(r){let{developerPlatformClient:e,app:d,remoteApp:o}=r,{extensionIdentifiersBreakdown:a,versionDetails:n}=await I(e,o,r.version),i=await R({developerPlatformClient:e,apiKey:o.apiKey,localApp:d,remoteApp:o,versionAppModules:n.appModuleVersions.map(s=>({...s})),release:!0});if(!await x({configExtensionIdentifiersBreakdown:i,extensionIdentifiersBreakdown:a,appTitle:o.title,release:!0,force:r.force,allowUpdates:r.allowUpdates,allowDeletes:r.allowDeletes}))throw new A;let c=[{title:"Releasing version",task:async s=>{s.appRelease=await e.release({app:o,version:{versionId:n.uuid,appVersionId:n.id}})}}],{appRelease:{appRelease:t}}=await h(c),f=[{link:{label:n.versionTag??void 0,url:n.location}},n.message?`
${n.message}`:""];if(t.userErrors&&t.userErrors.length>0){let s=t.userErrors?.map(b=>b.message).join(", ");v({headline:"Version couldn't be released.",body:[...f,`${f.length>0?`
`:""}${s}`]})}else w({headline:"Version released to users.",body:f})}var p=E(F(),1);var u=class r extends L{static{this.summary="Release an app version."}static{this.usage="app release --version <version>"}static{this.descriptionWithMarkdown="Releases an existing app version. Pass the name of the version that you want to release using the `--version` flag."}static{this.description=this.descriptionWithoutMarkdown()}static{this.flags={...k,...C,"allow-updates":p.Flags.boolean({hidden:!1,description:"Allows adding and updating extensions and configuration without requiring user confirmation. Recommended option for CI/CD environments.",env:"SHOPIFY_FLAG_ALLOW_UPDATES"}),"allow-deletes":p.Flags.boolean({hidden:!1,description:"Allows removing extensions and configuration without requiring user confirmation. For CI/CD environments, the recommended flag is --allow-updates.",env:"SHOPIFY_FLAG_ALLOW_DELETES"}),version:p.Flags.string({hidden:!1,description:"The name of the app version to release.",env:"SHOPIFY_FLAG_VERSION",required:!0})}}async run(){let{flags:e}=await this.parse(r),d=e["client-id"];await g(()=>({cmd_app_reset_used:e.reset}));let o=e["allow-updates"],a=e["allow-deletes"],n=!!(o&&a),i=[];!o&&!a&&i.push("allow-updates"),this.failMissingNonTTYFlags(e,i);let{app:m,remoteApp:c,developerPlatformClient:t}=await P({directory:e.path,clientId:d,forceRelink:e.reset,userProvidedConfigName:e.config});return await O({app:m,remoteApp:c,developerPlatformClient:t,force:n,allowUpdates:o,allowDeletes:a,version:e.version}),{app:m}}};export{u as default};