@shopify/cli
Version:
A CLI tool to build for the Shopify platform
8 lines (4 loc) • 3.86 kB
JavaScript
import{k as d,q as g}from"../../../chunk-XITQULK4.js";import"../../../chunk-UJVH7FZS.js";import{a as p}from"../../../chunk-ULFWK45W.js";import"../../../chunk-KHTV6PBV.js";import"../../../chunk-NKQBEFPS.js";import{aa as k}from"../../../chunk-UXVZ2P63.js";import"../../../chunk-QSTEVZFQ.js";import"../../../chunk-5Y7GIF2W.js";import"../../../chunk-4DCQNGUV.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 f}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 l}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 a}from"../../../chunk-M56NDIMD.js";import"../../../chunk-PD5ZHJWI.js";import"../../../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{Ta as h,ma as c}from"../../../chunk-N5PQPIBF.js";import"../../../chunk-CERXUPGC.js";import"../../../chunk-T4M5CWAO.js";import"../../../chunk-PRVQAHWI.js";import"../../../chunk-YTNDFQJT.js";import"../../../chunk-ULQG3XQS.js";import{f as r,n as m}from"../../../chunk-IU2ZQ6TE.js";import"../../../chunk-PIBY5DDZ.js";import{e as P,g as o}from"../../../chunk-VPRTJUIN.js";o();o();var u=P(k(),1),_=["assets/**","blocks/**","config/**","layout/**","listings/**/*","locales/**","sections/**","snippets/**","templates/**","templates/customers/**","release-notes.md","update_extension.json"].join("|");async function y(e){let t=await w(e),s=`${e}/${t}`,n=`${e}/(${_})`;await p({inputDirectory:e,outputZipPath:s,matchFilePattern:n}),l({body:["Your local theme was packaged in",{filePath:m(s)}]})}async function w(e){let t=r(e,"config/settings_schema.json");if(!await h(t))throw new a("Provide a config/settings_schema.json to package your theme.");let s=await F(t);if(s===void 0||s.theme_name===void 0)throw new a("Provide a theme_info.theme_name configuration in config/settings_schema.json.");return`${[s.theme_name,s.theme_version].filter(Boolean).join("-")}.zip`}async function F(e){let t=(0,u.parseJSON)(await c(e),null,!0);if(!t)throw new a("The file config/settings_schema.json contains an error. Please check if the file is valid JSON and includes the theme_info.theme_name configuration.");return t.find(s=>s.name==="theme_info")}var i=class extends g{static{this.summary="Package your theme into a .zip file, ready to upload to the Online Store."}static{this.descriptionWithMarkdown=`Packages your local theme files into a ZIP file that can be uploaded to Shopify.
Only folders that match the [default Shopify theme folder structure](https://shopify.dev/docs/storefronts/themes/tools/cli#directory-structure) are included in the package.
The package includes the \`listings\` directory if present (required for multi-preset themes per [Theme Store requirements](https://shopify.dev/docs/storefronts/themes/store/requirements#adding-presets-to-your-theme-zip-submission)).
The ZIP file uses the name \`theme_name-theme_version.zip\`, based on parameters in your [settings_schema.json](https://shopify.dev/docs/storefronts/themes/architecture/config/settings-schema-json) file.`}static{this.description=this.descriptionWithoutMarkdown()}static{this.flags={...f,path:d.path}}static{this.multiEnvironmentsFlags=null}async command(t){await y(t.path)}};export{i as default};