UNPKG

@shopify/cli

Version:

A CLI tool to build for the Shopify platform

6 lines (4 loc) 3.79 kB
import{a as v}from"../../../../chunk-TQ6HYDVC.js";import{a as c}from"../../../../chunk-JCL2RRU6.js";import{a as m}from"../../../../chunk-AGNMOFJS.js";import{Ba as l}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{z as n}from"../../../../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 d}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{v as a}from"../../../../chunk-6G6TMKXF.js";import"../../../../chunk-P6XE4MH5.js";import"../../../../chunk-KLMDWDT2.js";import"../../../../chunk-5CH3B62S.js";import"../../../../chunk-QUTQDXSL.js";import"../../../../chunk-WSDN25F5.js";import{d as p}from"../../../../chunk-M56NDIMD.js";import"../../../../chunk-PD5ZHJWI.js";import{r as g}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 C,g as s}from"../../../../chunk-VPRTJUIN.js";s();s();async function f(t){let e=t.appContextResult.developerPlatformClient,o=t.appContextResult.remoteApp;if(!e.supportsDevSessions)throw new p("Dev preview is not supported for this app. It's valid only for apps created on the Next-Gen Dev Platform.");let r=await e.devSessionDelete({shopFqdn:t.store.shopDomain,appId:o.id});if(r.devSessionDelete?.userErrors.length){let u=r.devSessionDelete.userErrors.map(w=>w.message).join(` `);throw new p(`Failed to stop the dev preview: ${u}`)}a({headline:"Dev preview stopped.",body:[`The dev preview has been stopped on ${t.store.shopDomain} and the app's active version has been restored.`,"You can start it again with",{command:"shopify app dev"}]})}var h=C(g(),1);var i=class t extends c{static{this.summary="Cleans up the dev preview from the selected store."}static{this.descriptionWithMarkdown=`Stop the dev preview that was started with \`shopify app dev\`. It restores the app's active version to the selected development store. `}static{this.description=this.descriptionWithoutMarkdown()}static{this.flags={...d,...m,store:h.Flags.string({hidden:!1,char:"s",description:"Store URL. Must be an existing development store.",env:"SHOPIFY_FLAG_STORE",parse:async e=>n(e)})}}async run(){let{flags:e}=await this.parse(t),o=await l({directory:e.path,clientId:e["client-id"],forceRelink:e.reset,userProvidedConfigName:e.config}),r=await v({appContextResult:o,storeFqdn:e.store,forceReselectStore:e.reset});return await f({appContextResult:o,store:r}),{app:o.app}}};export{i as default};