Skip to content

Commit 4ddf016

Browse files
Add typed JSON output to theme delete
1 parent d1a063b commit 4ddf016

11 files changed

Lines changed: 427 additions & 22 deletions

File tree

‎docs-shopify.dev/generated/generated_docs_data_v2.json‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6733,6 +6733,15 @@
67336733
"isOptional": true,
67346734
"environmentValue": "SHOPIFY_FLAG_FORCE"
67356735
},
6736+
{
6737+
"filePath": "docs-shopify.dev/commands/interfaces/theme-delete.interface.ts",
6738+
"syntaxKind": "PropertySignature",
6739+
"name": "-j, --json",
6740+
"value": "''",
6741+
"description": "Output the result as JSON. Automatically disables color output.",
6742+
"isOptional": true,
6743+
"environmentValue": "SHOPIFY_FLAG_JSON"
6744+
},
67366745
{
67376746
"filePath": "docs-shopify.dev/commands/interfaces/theme-delete.interface.ts",
67386747
"syntaxKind": "PropertySignature",
@@ -6752,7 +6761,7 @@
67526761
"environmentValue": "SHOPIFY_FLAG_THEME_ID"
67536762
}
67546763
],
6755-
"value": "export interface themedelete {\n /**\n * Alias of the Shopify account to use for authentication.\n * @environment SHOPIFY_FLAG_AUTH_ALIAS\n */\n '--auth-alias <value>'?: string\n\n /**\n * Delete your development theme. Use --show-all, --development, or --theme in non-interactive environments.\n * @environment SHOPIFY_FLAG_DEVELOPMENT\n */\n '-d, --development'?: ''\n\n /**\n * The environment to apply to the current command.\n * @environment SHOPIFY_FLAG_ENVIRONMENT\n */\n '-e, --environment <value>'?: string\n\n /**\n * Skip confirmation. Required if non interactive.\n * @environment SHOPIFY_FLAG_FORCE\n */\n '-f, --force'?: ''\n\n /**\n * Print the command's JSON schemas.\n * @environment SHOPIFY_FLAG_JSON_SCHEMA\n */\n '--json-schema'?: ''\n\n /**\n * Disable color output.\n * @environment SHOPIFY_FLAG_NO_COLOR\n */\n '--no-color'?: ''\n\n /**\n * Password generated from the Theme Access app or an Admin API token.\n * @environment SHOPIFY_CLI_THEME_TOKEN\n */\n '--password <value>'?: string\n\n /**\n * The path where you want to run the command. Defaults to the current working directory.\n * @environment SHOPIFY_FLAG_PATH\n */\n '--path <value>'?: string\n\n /**\n * Include other development themes in the theme list. Use --show-all, --development, or --theme in non-interactive environments.\n * @environment SHOPIFY_FLAG_SHOW_ALL\n */\n '-a, --show-all'?: ''\n\n /**\n * Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).\n * @environment SHOPIFY_FLAG_STORE\n */\n '-s, --store <value>'?: string\n\n /**\n * Theme ID or name of the remote theme. Use --show-all, --development, or --theme in non-interactive environments.\n * @environment SHOPIFY_FLAG_THEME_ID\n */\n '-t, --theme <value>'?: string\n\n /**\n * Increase the verbosity of the output. May include sensitive data.\n * @environment SHOPIFY_FLAG_VERBOSE\n */\n '--verbose'?: ''\n}"
6764+
"value": "export interface themedelete {\n /**\n * Alias of the Shopify account to use for authentication.\n * @environment SHOPIFY_FLAG_AUTH_ALIAS\n */\n '--auth-alias <value>'?: string\n\n /**\n * Delete your development theme. Use --show-all, --development, or --theme in non-interactive environments.\n * @environment SHOPIFY_FLAG_DEVELOPMENT\n */\n '-d, --development'?: ''\n\n /**\n * The environment to apply to the current command.\n * @environment SHOPIFY_FLAG_ENVIRONMENT\n */\n '-e, --environment <value>'?: string\n\n /**\n * Skip confirmation. Required if non interactive.\n * @environment SHOPIFY_FLAG_FORCE\n */\n '-f, --force'?: ''\n\n /**\n * Output the result as JSON. Automatically disables color output.\n * @environment SHOPIFY_FLAG_JSON\n */\n '-j, --json'?: ''\n\n /**\n * Print the command's JSON schemas.\n * @environment SHOPIFY_FLAG_JSON_SCHEMA\n */\n '--json-schema'?: ''\n\n /**\n * Disable color output.\n * @environment SHOPIFY_FLAG_NO_COLOR\n */\n '--no-color'?: ''\n\n /**\n * Password generated from the Theme Access app or an Admin API token.\n * @environment SHOPIFY_CLI_THEME_TOKEN\n */\n '--password <value>'?: string\n\n /**\n * The path where you want to run the command. Defaults to the current working directory.\n * @environment SHOPIFY_FLAG_PATH\n */\n '--path <value>'?: string\n\n /**\n * Include other development themes in the theme list. Use --show-all, --development, or --theme in non-interactive environments.\n * @environment SHOPIFY_FLAG_SHOW_ALL\n */\n '-a, --show-all'?: ''\n\n /**\n * Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).\n * @environment SHOPIFY_FLAG_STORE\n */\n '-s, --store <value>'?: string\n\n /**\n * Theme ID or name of the remote theme. Use --show-all, --development, or --theme in non-interactive environments.\n * @environment SHOPIFY_FLAG_THEME_ID\n */\n '-t, --theme <value>'?: string\n\n /**\n * Increase the verbosity of the output. May include sensitive data.\n * @environment SHOPIFY_FLAG_VERBOSE\n */\n '--verbose'?: ''\n}"
67566765
}
67576766
},
67586767
"themedev": {

‎packages/cli/README.md‎

Lines changed: 102 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7209,8 +7209,8 @@ Delete remote themes from the connected store. This command can't be undone.
72097209
72107210
```
72117211
USAGE
7212-
$ shopify theme delete [--auth-alias <value>] [-d] [-e <value>...] [-f] [--json-schema] [--no-color] [--password
7213-
<value>] [--path <value>] [-a] [-s <value>] [-t <value>...] [--verbose]
7212+
$ shopify theme delete [--auth-alias <value>] [-d] [-e <value>...] [-f] [-j] [--json-schema] [--no-color]
7213+
[--password <value>] [--path <value>] [-a] [-s <value>] [-t <value>...] [--verbose]
72147214

72157215
FLAGS
72167216
-a, --show-all
@@ -7230,6 +7230,10 @@ FLAGS
72307230
Skip confirmation. Required if non interactive.
72317231
[env: SHOPIFY_FLAG_FORCE]
72327232

7233+
-j, --json
7234+
Output the result as JSON. Automatically disables color output.
7235+
[env: SHOPIFY_FLAG_JSON]
7236+
72337237
-s, --store=<value>
72347238
Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com,
72357239
https://example.myshopify.com).
@@ -7273,6 +7277,102 @@ DESCRIPTION
72737277

72747278
You're asked to confirm that you want to delete the specified themes before they are deleted. You can skip this
72757279
confirmation using the `--force` flag.
7280+
7281+
Output from `--json` conforms to the `ThemeDeleteResult` schema.
7282+
7283+
Use `--json-schema` to print the result, error, and event schemas.
7284+
7285+
```json
7286+
{
7287+
"anyOf": [
7288+
{
7289+
"$ref": "#/definitions/ThemeDeleteEnvironment/properties/result"
7290+
},
7291+
{
7292+
"type": "object",
7293+
"properties": {
7294+
"environments": {
7295+
"type": "array",
7296+
"items": {
7297+
"$ref": "#/definitions/ThemeDeleteEnvironment"
7298+
}
7299+
}
7300+
},
7301+
"required": [
7302+
"environments"
7303+
],
7304+
"additionalProperties": false
7305+
}
7306+
],
7307+
"title": "ThemeDeleteResult",
7308+
"definitions": {
7309+
"DeletedTheme": {
7310+
"type": "object",
7311+
"properties": {
7312+
"id": {
7313+
"type": "number"
7314+
},
7315+
"name": {
7316+
"type": "string"
7317+
},
7318+
"role": {
7319+
"type": "string"
7320+
},
7321+
"processing": {
7322+
"type": "boolean"
7323+
},
7324+
"createdAtRuntime": {
7325+
"type": "boolean"
7326+
},
7327+
"src": {
7328+
"type": "string"
7329+
},
7330+
"shop": {
7331+
"type": "string"
7332+
}
7333+
},
7334+
"required": [
7335+
"id",
7336+
"name",
7337+
"role",
7338+
"processing",
7339+
"createdAtRuntime",
7340+
"shop"
7341+
],
7342+
"additionalProperties": false
7343+
},
7344+
"ThemeDeleteEnvironment": {
7345+
"type": "object",
7346+
"properties": {
7347+
"environment": {
7348+
"type": "string"
7349+
},
7350+
"result": {
7351+
"type": "object",
7352+
"properties": {
7353+
"themes": {
7354+
"type": "array",
7355+
"items": {
7356+
"$ref": "#/definitions/DeletedTheme"
7357+
}
7358+
}
7359+
},
7360+
"required": [
7361+
"themes"
7362+
],
7363+
"additionalProperties": false
7364+
}
7365+
},
7366+
"required": [
7367+
"environment",
7368+
"result"
7369+
],
7370+
"additionalProperties": false
7371+
}
7372+
},
7373+
"$schema": "http://json-schema.org/draft-07/schema#"
7374+
}
7375+
```
72767376
```
72777377
72787378
## `shopify theme dev`

‎packages/cli/oclif.manifest.json‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9617,7 +9617,7 @@
96179617
"args": {
96189618
},
96199619
"customPluginName": "@shopify/theme",
9620-
"description": "Deletes a theme from your store.\n\n You can specify multiple themes by ID. If no theme is specified, then you're prompted to select the theme that you want to delete from the list of themes in your store.\n\n You're asked to confirm that you want to delete the specified themes before they are deleted. You can skip this confirmation using the `--force` flag.",
9620+
"description": "Deletes a theme from your store.\n\n You can specify multiple themes by ID. If no theme is specified, then you're prompted to select the theme that you want to delete from the list of themes in your store.\n\n You're asked to confirm that you want to delete the specified themes before they are deleted. You can skip this confirmation using the `--force` flag.\n\nOutput from `--json` conforms to the `ThemeDeleteResult` schema.\n\nUse `--json-schema` to print the result, error, and event schemas.\n\n```json\n{\n \"anyOf\": [\n {\n \"$ref\": \"#/definitions/ThemeDeleteEnvironment/properties/result\"\n },\n {\n \"type\": \"object\",\n \"properties\": {\n \"environments\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/definitions/ThemeDeleteEnvironment\"\n }\n }\n },\n \"required\": [\n \"environments\"\n ],\n \"additionalProperties\": false\n }\n ],\n \"title\": \"ThemeDeleteResult\",\n \"definitions\": {\n \"DeletedTheme\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"number\"\n },\n \"name\": {\n \"type\": \"string\"\n },\n \"role\": {\n \"type\": \"string\"\n },\n \"processing\": {\n \"type\": \"boolean\"\n },\n \"createdAtRuntime\": {\n \"type\": \"boolean\"\n },\n \"src\": {\n \"type\": \"string\"\n },\n \"shop\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"id\",\n \"name\",\n \"role\",\n \"processing\",\n \"createdAtRuntime\",\n \"shop\"\n ],\n \"additionalProperties\": false\n },\n \"ThemeDeleteEnvironment\": {\n \"type\": \"object\",\n \"properties\": {\n \"environment\": {\n \"type\": \"string\"\n },\n \"result\": {\n \"type\": \"object\",\n \"properties\": {\n \"themes\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/definitions/DeletedTheme\"\n }\n }\n },\n \"required\": [\n \"themes\"\n ],\n \"additionalProperties\": false\n }\n },\n \"required\": [\n \"environment\",\n \"result\"\n ],\n \"additionalProperties\": false\n }\n },\n \"$schema\": \"http://json-schema.org/draft-07/schema#\"\n}\n```",
96219621
"descriptionWithMarkdown": "Deletes a theme from your store.\n\n You can specify multiple themes by ID. If no theme is specified, then you're prompted to select the theme that you want to delete from the list of themes in your store.\n\n You're asked to confirm that you want to delete the specified themes before they are deleted. You can skip this confirmation using the `--force` flag.",
96229622
"enableJsonFlag": false,
96239623
"flags": {
@@ -9654,6 +9654,15 @@
96549654
"name": "force",
96559655
"type": "boolean"
96569656
},
9657+
"json": {
9658+
"allowNo": false,
9659+
"char": "j",
9660+
"description": "Output the result as JSON. Automatically disables color output.",
9661+
"env": "SHOPIFY_FLAG_JSON",
9662+
"hidden": false,
9663+
"name": "json",
9664+
"type": "boolean"
9665+
},
96579666
"json-schema": {
96589667
"allowNo": false,
96599668
"description": "Print the command's JSON schemas.",

‎packages/eslint-plugin-cli/rules/json-output-command-exceptions.js‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ const commandExceptions = [
6161
'packages/plugin-did-you-mean/src/commands/config/autocorrect/on.ts',
6262
'packages/plugin-did-you-mean/src/commands/config/autocorrect/status.ts',
6363
'packages/theme/src/cli/commands/theme/check.ts',
64-
'packages/theme/src/cli/commands/theme/delete.ts',
6564
'packages/theme/src/cli/commands/theme/init.ts',
6665
'packages/theme/src/cli/commands/theme/metafields/pull.ts',
6766
'packages/theme/src/cli/commands/theme/package.ts',

0 commit comments

Comments
 (0)