From 5d4ee308d191ab07d87eaeef8eb2136c7fb2c1bc Mon Sep 17 00:00:00 2001 From: Chris Berthe Date: Mon, 23 Jun 2025 10:41:16 -0400 Subject: [PATCH 1/7] Add listing flag to dev, push, and share commands --- .changeset/polite-eyes-warn.md | 7 + .../interfaces/theme-dev.interface.ts | 8 +- .../interfaces/theme-push.interface.ts | 6 + .../interfaces/theme-share.interface.ts | 6 + .../generated/generated_docs_data.json | 29 +- .../cli-kit/src/public/node/themes/types.ts | 3 +- packages/cli/README.md | 14 +- packages/cli/oclif.manifest.json | 877 +++++++----------- packages/theme/package.json | 1 + packages/theme/src/cli/commands/theme/dev.ts | 6 + packages/theme/src/cli/commands/theme/push.ts | 5 + .../theme/src/cli/commands/theme/share.ts | 6 + packages/theme/src/cli/services/dev.ts | 4 +- packages/theme/src/cli/services/push.test.ts | 22 +- packages/theme/src/cli/services/push.ts | 10 +- .../theme/src/cli/utilities/theme-fs.test.ts | 69 ++ packages/theme/src/cli/utilities/theme-fs.ts | 43 +- .../src/cli/utilities/theme-listing.test.ts | 154 +++ .../theme/src/cli/utilities/theme-listing.ts | 42 + pnpm-lock.yaml | 3 + 20 files changed, 741 insertions(+), 574 deletions(-) create mode 100644 .changeset/polite-eyes-warn.md create mode 100644 packages/theme/src/cli/utilities/theme-listing.test.ts create mode 100644 packages/theme/src/cli/utilities/theme-listing.ts diff --git a/.changeset/polite-eyes-warn.md b/.changeset/polite-eyes-warn.md new file mode 100644 index 00000000000..b088f15d4bb --- /dev/null +++ b/.changeset/polite-eyes-warn.md @@ -0,0 +1,7 @@ +--- +'@shopify/cli-kit': patch +'@shopify/theme': patch +'@shopify/cli': patch +--- + +Add --listing flag to theme dev, push, and share commands diff --git a/docs-shopify.dev/commands/interfaces/theme-dev.interface.ts b/docs-shopify.dev/commands/interfaces/theme-dev.interface.ts index 749065eb303..c6b63246909 100644 --- a/docs-shopify.dev/commands/interfaces/theme-dev.interface.ts +++ b/docs-shopify.dev/commands/interfaces/theme-dev.interface.ts @@ -10,7 +10,7 @@ export interface themedev { * 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. - + * @environment SHOPIFY_FLAG_ERROR_OVERLAY */ '--error-overlay '?: string @@ -27,6 +27,12 @@ export interface themedev { */ '-x, --ignore '?: string + /** + * The listing preset to use for multi-preset themes. Applies preset files from listings/[preset-name] directory. + * @environment SHOPIFY_FLAG_LISTING + */ + '--listing '?: string + /** * The live reload mode switches the server behavior when a file is modified: - hot-reload Hot reloads local changes to CSS and sections (default) diff --git a/docs-shopify.dev/commands/interfaces/theme-push.interface.ts b/docs-shopify.dev/commands/interfaces/theme-push.interface.ts index 26d656ce04e..0bdfc8253dd 100644 --- a/docs-shopify.dev/commands/interfaces/theme-push.interface.ts +++ b/docs-shopify.dev/commands/interfaces/theme-push.interface.ts @@ -30,6 +30,12 @@ export interface themepush { */ '-j, --json'?: '' + /** + * The listing preset to use for multi-preset themes. Applies preset files from listings/[preset-name] directory. + * @environment SHOPIFY_FLAG_LISTING + */ + '--listing '?: string + /** * Push theme files from your remote live theme. * @environment SHOPIFY_FLAG_LIVE diff --git a/docs-shopify.dev/commands/interfaces/theme-share.interface.ts b/docs-shopify.dev/commands/interfaces/theme-share.interface.ts index c4ad87bc9e7..ab6c16c9b97 100644 --- a/docs-shopify.dev/commands/interfaces/theme-share.interface.ts +++ b/docs-shopify.dev/commands/interfaces/theme-share.interface.ts @@ -6,6 +6,12 @@ export interface themeshare { */ '-e, --environment '?: string + /** + * The listing preset to use for multi-preset themes. Applies preset files from listings/[preset-name] directory. + * @environment SHOPIFY_FLAG_LISTING + */ + '--listing '?: string + /** * Disable color output. * @environment SHOPIFY_FLAG_NO_COLOR diff --git a/docs-shopify.dev/generated/generated_docs_data.json b/docs-shopify.dev/generated/generated_docs_data.json index e0cfeec8247..b535badbf9a 100644 --- a/docs-shopify.dev/generated/generated_docs_data.json +++ b/docs-shopify.dev/generated/generated_docs_data.json @@ -5144,6 +5144,15 @@ "isOptional": true, "environmentValue": "SHOPIFY_FLAG_HOST" }, + { + "filePath": "docs-shopify.dev/commands/interfaces/theme-dev.interface.ts", + "syntaxKind": "PropertySignature", + "name": "--listing ", + "value": "string", + "description": "The listing preset to use for multi-preset themes. Applies preset files from listings/[preset-name] directory.", + "isOptional": true, + "environmentValue": "SHOPIFY_FLAG_LISTING" + }, { "filePath": "docs-shopify.dev/commands/interfaces/theme-dev.interface.ts", "syntaxKind": "PropertySignature", @@ -6500,6 +6509,15 @@ "name": "themepush", "description": "", "members": [ + { + "filePath": "docs-shopify.dev/commands/interfaces/theme-push.interface.ts", + "syntaxKind": "PropertySignature", + "name": "--listing ", + "value": "string", + "description": "The listing preset to use for multi-preset themes. Applies preset files from listings/[preset-name] directory.", + "isOptional": true, + "environmentValue": "SHOPIFY_FLAG_LISTING" + }, { "filePath": "docs-shopify.dev/commands/interfaces/theme-push.interface.ts", "syntaxKind": "PropertySignature", @@ -6819,6 +6837,15 @@ "name": "themeshare", "description": "", "members": [ + { + "filePath": "docs-shopify.dev/commands/interfaces/theme-share.interface.ts", + "syntaxKind": "PropertySignature", + "name": "--listing ", + "value": "string", + "description": "The listing preset to use for multi-preset themes. Applies preset files from listings/[preset-name] directory.", + "isOptional": true, + "environmentValue": "SHOPIFY_FLAG_LISTING" + }, { "filePath": "docs-shopify.dev/commands/interfaces/theme-share.interface.ts", "syntaxKind": "PropertySignature", @@ -6926,4 +6953,4 @@ "category": "general commands", "related": [] } -] \ No newline at end of file +] diff --git a/packages/cli-kit/src/public/node/themes/types.ts b/packages/cli-kit/src/public/node/themes/types.ts index 39021516d8c..55f4a2ffefe 100644 --- a/packages/cli-kit/src/public/node/themes/types.ts +++ b/packages/cli-kit/src/public/node/themes/types.ts @@ -27,8 +27,9 @@ export type ThemeFSEventPayload = (ThemeFSEv export interface ThemeFileSystemOptions { filters?: {ignore?: string[]; only?: string[]} - notify?: string + listing?: string noDelete?: boolean + notify?: string } /** diff --git a/packages/cli/README.md b/packages/cli/README.md index b07c04cb033..a8ca545d409 100644 --- a/packages/cli/README.md +++ b/packages/cli/README.md @@ -1804,8 +1804,8 @@ Uploads the current theme as a development theme to the connected store, then pr ``` USAGE - $ shopify theme dev [-e ...] [--error-overlay silent|default] [--host ] [-x ...] - [--live-reload hot-reload|full-page|off] [--no-color] [-n] [--notify ] [-o ...] [--open] [--password + $ shopify theme dev [-e ...] [--error-overlay silent|default] [--host ] [-x ...] [--listing + ] [--live-reload hot-reload|full-page|off] [--no-color] [-n] [--notify ] [-o ...] [--open] [--password ] [--path ] [--port ] [-s ] [--store-password ] [-t ] [--theme-editor-sync] [--verbose] @@ -1840,6 +1840,10 @@ FLAGS --host= Set which network interface the web server listens on. The default value is 127.0.0.1. + --listing= + The listing preset to use for multi-preset themes. Applies preset files from listings/[preset-name] + directory. + --live-reload=