Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Themes] - Switch the implementation of theme commands to run the TypeScript by default #4439

Merged
merged 7 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/pretty-olives-promise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@shopify/theme': minor
'@shopify/app': minor
'@shopify/cli': minor
---

Default to Typescript implementation for theme commands. Legacy implementation is stil available via the `--stable` flag.
6 changes: 6 additions & 0 deletions docs-shopify.dev/commands/interfaces/app-dev.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ 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: 6 additions & 0 deletions docs-shopify.dev/commands/interfaces/app-logs.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ 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,6 +24,12 @@ 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: 6 additions & 0 deletions docs-shopify.dev/commands/interfaces/theme-dev.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ 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: 40 additions & 4 deletions docs-shopify.dev/generated/generated_docs_data.json

Large diffs are not rendered by default.

10 changes: 4 additions & 6 deletions packages/app/src/cli/commands/app/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,9 @@ 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',
}),
'dev-preview': Flags.boolean({
hidden: true,
description:
'Enables the developer preview for the upcoming `app dev` implementation for building theme app extensions.',
env: 'SHOPIFY_FLAG_BETA',
stable: Flags.boolean({
description: 'Use the legacy Ruby implementation for managing theme app extensions.',
env: 'SHOPIFY_FLAG_STABLE',
}),
}

Expand Down Expand Up @@ -184,7 +182,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['dev-preview'],
devPreview: !flags.stable,
}

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'],
'dev-preview': Dev.flags['dev-preview'],
stable: Dev.flags.stable,
karreiro marked this conversation as resolved.
Show resolved Hide resolved
source: Flags.string({
description: 'Filters output to the specified log source.',
env: 'SHOPIFY_FLAG_SOURCE',
Expand Down
16 changes: 11 additions & 5 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] [-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] [--stable] [-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,6 +221,7 @@ 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 @@ -547,7 +548,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>] [--status success|failure] [-s <value>] [--verbose]
[--source <value>] [--stable] [--status success|failure] [-s <value>] [--verbose]

FLAGS
-c, --config=<value> The name of the app configuration.
Expand All @@ -558,6 +559,7 @@ 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 @@ -1711,6 +1713,7 @@ 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 @@ -1765,7 +1768,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>] [-s <value>] [--store-password <value>] [-t <value>] [--theme-editor-sync] [--verbose]
<value>] [--stable] [-s <value>] [--store-password <value>] [-t <value>] [--theme-editor-sync] [--verbose]

FLAGS
-e, --environment=<value>
Expand Down Expand Up @@ -1820,6 +1823,9 @@ 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
Loading
Loading