UNPKG

@shopify/cli

Version:

A CLI tool to build for the Shopify platform

27 lines (17 loc) 8.19 kB
import{a as v}from"../../../chunk-5UHQVR2Z.js";import{a as u}from"../../../chunk-HRUGYZZ4.js";import"../../../chunk-NF2ABOOU.js";import"../../../chunk-JQJBBXMX.js";import"../../../chunk-OY3PNHPZ.js";import"../../../chunk-MWGBTOO3.js";import"../../../chunk-K6CTUBFC.js";import"../../../chunk-Y7JGYGV7.js";import{d as c}from"../../../chunk-GVQIPEZT.js";import{a as p}from"../../../chunk-CEIQFLCN.js";import{a as f}from"../../../chunk-DN2IE3VY.js";import"../../../chunk-JAO53IH2.js";import{k as d,q as m}from"../../../chunk-XITQULK4.js";import"../../../chunk-6SF3ZETE.js";import"../../../chunk-3VZEETAV.js";import"../../../chunk-IX5ICOBV.js";import"../../../chunk-SXTMSGUE.js";import"../../../chunk-QFWIDATO.js";import"../../../chunk-CBXSPL4W.js";import"../../../chunk-UJVH7FZS.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{xa as h}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 l}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"../../../chunk-6G6TMKXF.js";import"../../../chunk-P6XE4MH5.js";import"../../../chunk-KLMDWDT2.js";import"../../../chunk-5CH3B62S.js";import"../../../chunk-QUTQDXSL.js";import"../../../chunk-WSDN25F5.js";import"../../../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 w,g as a}from"../../../chunk-VPRTJUIN.js";a();var t=w(F(),1);var s=class extends m{static{this.summary="Uploads the current theme as a development theme to the connected store, then prints theme editor and preview URLs to your terminal. While running, changes will push to the store in real time."}static{this.descriptionWithMarkdown=` Uploads the current theme as the specified theme, or a [development theme](https://shopify.dev/docs/themes/tools/cli#development-themes), to a store so you can preview it. This command returns the following information: - A link to your development theme at http://127.0.0.1:9292. This URL can hot reload local changes to CSS and sections, or refresh the entire page when a file changes, enabling you to preview changes in real time using the store's data. You can specify a different network interface and port using \`--host\` and \`--port\`. - A link to the [editor](https://shopify.dev/docs/themes/tools/online-editor) for the theme in the Shopify admin. - A [preview link](https://help.shopify.com/manual/online-store/themes/adding-themes#share-a-theme-preview-with-others) that you can share with other developers. If you already have a development theme for your current environment, then this command replaces the development theme with your local theme. You can override this using the \`--theme-editor-sync\` flag. > Note: You can't preview checkout customizations using http://127.0.0.1:9292. Development themes are deleted when you run \`shopify auth logout\`. If you need a preview link that can be used after you log out, then you should [share](https://shopify.dev/docs/api/shopify-cli/theme/theme-share) your theme or [push](https://shopify.dev/docs/api/shopify-cli/theme/theme-push) to an unpublished theme on your store. You can run this command only in a directory that matches the [default Shopify theme folder structure](https://shopify.dev/docs/themes/tools/cli#directory-structure).`}static{this.description=this.descriptionWithoutMarkdown()}static{this.flags={...l,...d,host:t.Flags.string({description:"Set which network interface the web server listens on. The default value is 127.0.0.1.",env:"SHOPIFY_FLAG_HOST"}),"live-reload":t.Flags.string({description:`The live reload mode switches the server behavior when a file is modified: - hot-reload Hot reloads local changes to CSS and sections (default) - full-page Always refreshes the entire page - off Deactivate live reload`,default:"hot-reload",options:["hot-reload","full-page","off"],env:"SHOPIFY_FLAG_LIVE_RELOAD"}),"error-overlay":t.Flags.string({description:`Controls the visibility of the error overlay when an theme asset upload fails: - silent Prevents the error overlay from appearing. - default Displays the error overlay. `,options:["silent","default"],default:"default",env:"SHOPIFY_FLAG_ERROR_OVERLAY"}),poll:t.Flags.boolean({hidden:!0,description:"Force polling to detect file changes.",env:"SHOPIFY_FLAG_POLL"}),"theme-editor-sync":t.Flags.boolean({description:"Synchronize Theme Editor updates in the local theme files.",env:"SHOPIFY_FLAG_THEME_EDITOR_SYNC"}),port:t.Flags.string({description:"Local port to serve theme preview from.",env:"SHOPIFY_FLAG_PORT"}),theme:t.Flags.string({char:"t",description:"Theme ID or name of the remote theme.",env:"SHOPIFY_FLAG_THEME_ID"}),listing:t.Flags.string({description:"The listing preset to use for multi-preset themes. Applies preset files from listings/[preset-name] directory.",env:"SHOPIFY_FLAG_LISTING"}),nodelete:t.Flags.boolean({char:"n",description:"Prevents files from being deleted in the remote theme when a file has been deleted locally. This applies to files that are deleted while the command is running, and files that have been deleted locally before the command is run.",env:"SHOPIFY_FLAG_NODELETE"}),only:t.Flags.string({char:"o",multiple:!0,description:"Hot reload only files that match the specified pattern.",env:"SHOPIFY_FLAG_ONLY"}),ignore:t.Flags.string({char:"x",multiple:!0,description:"Skip hot reloading any files that match the specified pattern.",env:"SHOPIFY_FLAG_IGNORE"}),force:t.Flags.boolean({hidden:!0,char:"f",description:"Proceed without confirmation, if current directory does not seem to be theme directory.",env:"SHOPIFY_FLAG_FORCE"}),notify:t.Flags.string({description:"The file path or URL. The file path is to a file that you want updated on idle. The URL path is where you want a webhook posted to report on file changes.",env:"SHOPIFY_FLAG_NOTIFY"}),open:t.Flags.boolean({description:"Automatically launch the theme preview in your default web browser.",env:"SHOPIFY_FLAG_OPEN",default:!1}),"store-password":t.Flags.string({description:"The password for storefronts with password protection.",env:"SHOPIFY_FLAG_STORE_PASSWORD"}),"allow-live":t.Flags.boolean({description:"Allow development on a live theme.",char:"a",env:"SHOPIFY_FLAG_ALLOW_LIVE",default:!1})}}static{this.multiEnvironmentsFlags=null}async command(o,i){let{ignore:y=[],only:g=[]}=o;h("theme-command:dev:single-env:authenticated");let r,e;if(o.theme){let n={filter:{theme:o.theme}};r=await f(i,n),e={...o,theme:r.id.toString(),store:i.storeFqdn}}else{r=await new p(i).findOrCreate();let n=o["theme-editor-sync"]&&r.createdAtRuntime;e={...o,theme:r.id.toString(),store:i.storeFqdn,"overwrite-json":n}}await c(r,"start development mode",o["allow-live"])&&(await u({adminSession:i,commandConfig:this.config,directory:e.path,store:e.store,password:e.password,storePassword:e["store-password"],theme:r,listing:e.listing,host:e.host,port:e.port,"live-reload":e["live-reload"],"error-overlay":e["error-overlay"],force:e.force,open:e.open,"theme-editor-sync":e["theme-editor-sync"],noDelete:e.nodelete,ignore:y,only:g,notify:e.notify}),await v({path:e.path,password:e.password,store:e.store,force:e.force,verbose:e.verbose,noColor:e["no-color"],silent:!0}))}};export{s as default};