Skip to content

Commit

Permalink
* Rename --stable to --legacy
Browse files Browse the repository at this point in the history
 * Add warning in the `shopify theme dev` command
 * Add banner mentioning the `--legacy` flag
  • Loading branch information
karreiro committed Sep 16, 2024
1 parent 56c5b46 commit 8ba0ee7
Show file tree
Hide file tree
Showing 18 changed files with 114 additions and 172 deletions.
2 changes: 1 addition & 1 deletion .changeset/pretty-olives-promise.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
'@shopify/cli': minor
---

Default to Typescript implementation for theme commands. Legacy implementation is stil available via the `--stable` flag.
Default to Typescript implementation for theme commands. Legacy implementation is stil available via the `--legacy` flag.
6 changes: 0 additions & 6 deletions docs-shopify.dev/commands/interfaces/app-dev.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,6 @@ export interface appdev {
*/
'--skip-dependencies-installation'?: ''

/**
* Use the legacy Ruby implementation for managing theme app extensions.
* @environment SHOPIFY_FLAG_STABLE
*/
'--stable'?: ''

/**
* Store URL. Must be an existing development or Shopify Plus sandbox store.
* @environment SHOPIFY_FLAG_STORE
Expand Down
6 changes: 0 additions & 6 deletions docs-shopify.dev/commands/interfaces/app-logs.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,6 @@ export interface applogs {
*/
'--source <value>'?: string

/**
* Use the legacy Ruby implementation for managing theme app extensions.
* @environment SHOPIFY_FLAG_STABLE
*/
'--stable'?: ''

/**
* Filters output to the specified status (success or failure).
* @environment SHOPIFY_FLAG_STATUS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@ export interface themeconsole {
*/
'--port <value>'?: string

/**
* Use the legacy Ruby implementation for the `theme console` command.
* @environment SHOPIFY_FLAG_STABLE
*/
'--stable'?: ''

/**
* Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).
* @environment SHOPIFY_FLAG_STORE
Expand Down
6 changes: 0 additions & 6 deletions docs-shopify.dev/commands/interfaces/theme-dev.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,6 @@ export interface themedev {
*/
'--port <value>'?: string

/**
* Use the legacy Ruby implementation for the `theme dev` command.
* @environment SHOPIFY_FLAG_STABLE
*/
'--stable'?: ''

/**
* Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).
* @environment SHOPIFY_FLAG_STORE
Expand Down
44 changes: 4 additions & 40 deletions docs-shopify.dev/generated/generated_docs_data.json

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions packages/app/src/cli/commands/app/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,10 @@ If you're using the PHP or Ruby app template, then you need to complete the foll
'Key used to authenticate GraphiQL requests. Should be specified if exposing GraphiQL on a publicly accessible URL. By default, no key is required.',
env: 'SHOPIFY_FLAG_GRAPHIQL_KEY',
}),
stable: Flags.boolean({
legacy: Flags.boolean({
hidden: true,
description: 'Use the legacy Ruby implementation for managing theme app extensions.',
env: 'SHOPIFY_FLAG_STABLE',
env: 'SHOPIFY_FLAG_LEGACY',
}),
}

Expand Down Expand Up @@ -182,7 +183,7 @@ If you're using the PHP or Ruby app template, then you need to complete the foll
notify: flags.notify,
graphiqlPort: flags['graphiql-port'],
graphiqlKey: flags['graphiql-key'],
devPreview: !flags.stable,
devPreview: !flags.legacy,
}

await dev(devOptions)
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/cli/commands/app/logs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default class Logs extends Command {
'no-tunnel': Dev.flags['no-tunnel'],
'graphiql-port': Dev.flags['graphiql-port'],
'graphiql-key': Dev.flags['graphiql-key'],
stable: Dev.flags.stable,
stable: Dev.flags.legacy,
source: Flags.string({
description: 'Filters output to the specified log source.',
env: 'SHOPIFY_FLAG_SOURCE',
Expand Down
16 changes: 5 additions & 11 deletions packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ Run the app.
```
USAGE
$ shopify app dev [--checkout-cart-url <value>] [--client-id <value> | -c <value>] [--no-color]
[--no-update] [--notify <value>] [--path <value>] [--reset | ] [--skip-dependencies-installation] [--stable] [-s
<value>] [--subscription-product-url <value>] [-t <value>] [--theme-app-extension-port <value>] [--tunnel-url
<value> | | ] [--verbose]
[--no-update] [--notify <value>] [--path <value>] [--reset | ] [--skip-dependencies-installation] [-s <value>]
[--subscription-product-url <value>] [-t <value>] [--theme-app-extension-port <value>] [--tunnel-url <value> | | ]
[--verbose]
FLAGS
-c, --config=<value> The name of the app configuration.
Expand All @@ -221,7 +221,6 @@ FLAGS
--path=<value> The path to your app directory.
--reset Reset all your settings.
--skip-dependencies-installation Skips the installation of dependencies. Deprecated, use workspaces instead.
--stable Use the legacy Ruby implementation for managing theme app extensions.
--subscription-product-url=<value> Resource URL for subscription UI extension. Format: "/products/{productId}"
--theme-app-extension-port=<value> Local port of the theme app extension development server.
--tunnel-url=<value> Use a custom tunnel, it must be running before executing dev. Format:
Expand Down Expand Up @@ -548,7 +547,7 @@ Stream detailed logs for your Shopify app.
```
USAGE
$ shopify app logs [--client-id <value> | -c <value>] [-j] [--no-color] [--path <value>] [--reset | ]
[--source <value>] [--stable] [--status success|failure] [-s <value>] [--verbose]
[--source <value>] [--status success|failure] [-s <value>] [--verbose]
FLAGS
-c, --config=<value> The name of the app configuration.
Expand All @@ -559,7 +558,6 @@ FLAGS
--path=<value> The path to your app directory.
--reset Reset all your settings.
--source=<value>... Filters output to the specified log source.
--stable Use the legacy Ruby implementation for managing theme app extensions.
--status=<option> Filters output to the specified status (success or failure).
<options: success|failure>
--verbose Increase the verbosity of the output.
Expand Down Expand Up @@ -1713,7 +1711,6 @@ FLAGS
--no-color Disable color output.
--password=<value> Password generated from the Theme Access app.
--port=<value> Local port to serve authentication service.
--stable Use the legacy Ruby implementation for the `theme console` command.
--store-password=<value> The password for storefronts with password protection.
--url=<value> [default: /] The url to be used as context
--verbose Increase the verbosity of the output.
Expand Down Expand Up @@ -1768,7 +1765,7 @@ Uploads the current theme as a development theme to the connected store, then pr
USAGE
$ shopify theme dev [-e <value>] [--host <value>] [-x <value>] [--live-reload hot-reload|full-page|off]
[--no-color] [-n] [--notify <value>] [-o <value>] [--open] [--password <value>] [--path <value>] [--poll] [--port
<value>] [--stable] [-s <value>] [--store-password <value>] [-t <value>] [--theme-editor-sync] [--verbose]
<value>] [-s <value>] [--store-password <value>] [-t <value>] [--theme-editor-sync] [--verbose]
FLAGS
-e, --environment=<value>
Expand Down Expand Up @@ -1823,9 +1820,6 @@ FLAGS
--port=<value>
Local port to serve theme preview from.
--stable
Use the legacy Ruby implementation for the `theme dev` command.
--store-password=<value>
The password for storefronts with password protection.
Expand Down
98 changes: 50 additions & 48 deletions packages/cli/oclif.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,14 @@
"name": "graphiql-port",
"type": "option"
},
"legacy": {
"allowNo": false,
"description": "Use the legacy Ruby implementation for managing theme app extensions.",
"env": "SHOPIFY_FLAG_LEGACY",
"hidden": true,
"name": "legacy",
"type": "boolean"
},
"no-color": {
"allowNo": false,
"description": "Disable color output.",
Expand Down Expand Up @@ -476,13 +484,6 @@
"name": "skip-dependencies-installation",
"type": "boolean"
},
"stable": {
"allowNo": false,
"description": "Use the legacy Ruby implementation for managing theme app extensions.",
"env": "SHOPIFY_FLAG_STABLE",
"name": "stable",
"type": "boolean"
},
"store": {
"char": "s",
"description": "Store URL. Must be an existing development or Shopify Plus sandbox store.",
Expand Down Expand Up @@ -1660,7 +1661,8 @@
"stable": {
"allowNo": false,
"description": "Use the legacy Ruby implementation for managing theme app extensions.",
"env": "SHOPIFY_FLAG_STABLE",
"env": "SHOPIFY_FLAG_LEGACY",
"hidden": true,
"name": "stable",
"type": "boolean"
},
Expand Down Expand Up @@ -4781,6 +4783,14 @@
"name": "environment",
"type": "option"
},
"legacy": {
"allowNo": false,
"description": "Use the legacy Ruby implementation for the `shopify theme console` command.",
"env": "SHOPIFY_FLAG_LEGACY",
"hidden": true,
"name": "legacy",
"type": "boolean"
},
"no-color": {
"allowNo": false,
"description": "Disable color output.",
Expand All @@ -4805,13 +4815,6 @@
"name": "port",
"type": "option"
},
"stable": {
"allowNo": false,
"description": "Use the legacy Ruby implementation for the `theme console` command.",
"env": "SHOPIFY_FLAG_STABLE",
"name": "stable",
"type": "boolean"
},
"store": {
"char": "s",
"description": "Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).",
Expand Down Expand Up @@ -4972,7 +4975,6 @@
"nodelete",
"only",
"ignore",
"stable",
"force",
"notify"
],
Expand Down Expand Up @@ -5015,6 +5017,14 @@
"name": "ignore",
"type": "option"
},
"legacy": {
"allowNo": false,
"description": "Use the legacy Ruby implementation for the `shopify theme dev` command.",
"env": "SHOPIFY_FLAG_LEGACY",
"hidden": true,
"name": "legacy",
"type": "boolean"
},
"live-reload": {
"default": "hot-reload",
"description": "The live reload mode switches the server behavior when a file is modified:\n- hot-reload Hot reloads local changes to CSS and sections (default)\n- full-page Always refreshes the entire page\n- off Deactivate live reload",
Expand Down Expand Up @@ -5101,13 +5111,6 @@
"name": "port",
"type": "option"
},
"stable": {
"allowNo": false,
"description": "Use the legacy Ruby implementation for the `theme dev` command.",
"env": "SHOPIFY_FLAG_STABLE",
"name": "stable",
"type": "boolean"
},
"store": {
"char": "s",
"description": "Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).",
Expand Down Expand Up @@ -5718,6 +5721,14 @@
"name": "ignore",
"type": "option"
},
"legacy": {
"allowNo": false,
"description": "Use the legacy Ruby implementation for the `shopify theme pull` command.",
"env": "SHOPIFY_FLAG_LEGACY",
"hidden": true,
"name": "legacy",
"type": "boolean"
},
"live": {
"allowNo": false,
"char": "l",
Expand Down Expand Up @@ -5768,14 +5779,6 @@
"noCacheDefault": true,
"type": "option"
},
"stable": {
"allowNo": false,
"description": "Use the legacy Ruby implementation for the `theme pull` command.",
"env": "SHOPIFY_FLAG_STABLE",
"hidden": true,
"name": "stable",
"type": "boolean"
},
"store": {
"char": "s",
"description": "Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).",
Expand Down Expand Up @@ -5829,7 +5832,6 @@
"json",
"allow-live",
"publish",
"stable",
"force",
"development-theme-id"
],
Expand Down Expand Up @@ -5888,6 +5890,14 @@
"name": "json",
"type": "boolean"
},
"legacy": {
"allowNo": false,
"description": "Use the legacy Ruby implementation for the `shopify theme push` command.",
"env": "SHOPIFY_FLAG_LEGACY",
"hidden": true,
"name": "legacy",
"type": "boolean"
},
"live": {
"allowNo": false,
"char": "l",
Expand Down Expand Up @@ -5946,14 +5956,6 @@
"name": "publish",
"type": "boolean"
},
"stable": {
"allowNo": false,
"description": "Use the legacy Ruby implementation for the `theme push` command.",
"env": "SHOPIFY_FLAG_STABLE",
"hidden": true,
"name": "stable",
"type": "boolean"
},
"store": {
"char": "s",
"description": "Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).",
Expand Down Expand Up @@ -6116,7 +6118,6 @@
"nodelete",
"only",
"ignore",
"stable",
"force",
"notify"
],
Expand Down Expand Up @@ -6159,6 +6160,14 @@
"name": "ignore",
"type": "option"
},
"legacy": {
"allowNo": false,
"description": "Use the legacy Ruby implementation for the `shopify theme dev` command.",
"env": "SHOPIFY_FLAG_LEGACY",
"hidden": true,
"name": "legacy",
"type": "boolean"
},
"live-reload": {
"default": "hot-reload",
"description": "The live reload mode switches the server behavior when a file is modified:\n- hot-reload Hot reloads local changes to CSS and sections (default)\n- full-page Always refreshes the entire page\n- off Deactivate live reload",
Expand Down Expand Up @@ -6245,13 +6254,6 @@
"name": "port",
"type": "option"
},
"stable": {
"allowNo": false,
"description": "Use the legacy Ruby implementation for the `theme dev` command.",
"env": "SHOPIFY_FLAG_STABLE",
"name": "stable",
"type": "boolean"
},
"store": {
"char": "s",
"description": "Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).",
Expand Down
9 changes: 5 additions & 4 deletions packages/theme/src/cli/commands/theme/console.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ export default class Console extends ThemeCommand {
description: 'The password for storefronts with password protection.',
env: 'SHOPIFY_FLAG_STORE_PASSWORD',
}),
stable: Flags.boolean({
description: 'Use the legacy Ruby implementation for the `theme console` command.',
env: 'SHOPIFY_FLAG_STABLE',
legacy: Flags.boolean({
hidden: true,
description: 'Use the legacy Ruby implementation for the `shopify theme console` command.',
env: 'SHOPIFY_FLAG_LEGACY',
}),
}

Expand All @@ -54,7 +55,7 @@ export default class Console extends ThemeCommand {
const adminSession = await ensureAuthenticatedThemes(store, themeAccessPassword, [], true)
const authUrl = `http://localhost:${port ?? '9293'}/password`

if (!flags.stable) {
if (!flags.legacy) {
if (flags.port) {
renderPortDeprecationWarning()
}
Expand Down
Loading

0 comments on commit 8ba0ee7

Please sign in to comment.