Skip to content

Commit 6d26ddd

Browse files
Merge pull request #8915 from Shopify/gonzalo/json-theme-rename
Add typed JSON output to theme rename
2 parents 8b9f59c + 8ec2042 commit 6d26ddd

10 files changed

Lines changed: 674 additions & 24 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
@@ -10556,6 +10556,15 @@
1055610556
"isOptional": true,
1055710557
"environmentValue": "SHOPIFY_FLAG_ENVIRONMENT"
1055810558
},
10559+
{
10560+
"filePath": "docs-shopify.dev/commands/interfaces/theme-rename.interface.ts",
10561+
"syntaxKind": "PropertySignature",
10562+
"name": "-j, --json",
10563+
"value": "''",
10564+
"description": "Output the result as JSON. Automatically disables color output.",
10565+
"isOptional": true,
10566+
"environmentValue": "SHOPIFY_FLAG_JSON"
10567+
},
1055910568
{
1056010569
"filePath": "docs-shopify.dev/commands/interfaces/theme-rename.interface.ts",
1056110570
"syntaxKind": "PropertySignature",
@@ -10593,7 +10602,7 @@
1059310602
"environmentValue": "SHOPIFY_FLAG_THEME_ID"
1059410603
}
1059510604
],
10596-
"value": "export interface themerename {\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 * Rename your development theme. Use --development, --live, 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 * Print the command's JSON schemas.\n * @environment SHOPIFY_FLAG_JSON_SCHEMA\n */\n '--json-schema'?: ''\n\n /**\n * Rename your remote live theme. Use --development, --live, or --theme in non-interactive environments.\n * @environment SHOPIFY_FLAG_LIVE\n */\n '-l, --live'?: ''\n\n /**\n * The new name for the theme. Required if non interactive.\n * @environment SHOPIFY_FLAG_NEW_NAME\n */\n '-n, --name <value>'?: string\n\n /**\n * Disable color output.\n * @environment SHOPIFY_FLAG_NO_COLOR\n */\n '--no-color'?: ''\n\n /**\n * Disable interactive prompts and browser authentication.\n * @environment SHOPIFY_FLAG_NO_INPUT\n */\n '--no-input'?: ''\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 * 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 --development, --live, 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}"
10605+
"value": "export interface themerename {\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 * Rename your development theme. Use --development, --live, 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 * 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 * Rename your remote live theme. Use --development, --live, or --theme in non-interactive environments.\n * @environment SHOPIFY_FLAG_LIVE\n */\n '-l, --live'?: ''\n\n /**\n * The new name for the theme. Required if non interactive.\n * @environment SHOPIFY_FLAG_NEW_NAME\n */\n '-n, --name <value>'?: string\n\n /**\n * Disable color output.\n * @environment SHOPIFY_FLAG_NO_COLOR\n */\n '--no-color'?: ''\n\n /**\n * Disable interactive prompts and browser authentication.\n * @environment SHOPIFY_FLAG_NO_INPUT\n */\n '--no-input'?: ''\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 * 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 --development, --live, 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}"
1059710606
}
1059810607
},
1059910608
"themeshare": {

‎packages/cli/README.md‎

Lines changed: 310 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14800,7 +14800,7 @@ Renames an existing theme.
1480014800

1480114801
```
1480214802
USAGE
14803-
$ shopify theme rename [--auth-alias <value>] [-d] [-e <value>...] [--json-schema] [-l] [-n <value>]
14803+
$ shopify theme rename [--auth-alias <value>] [-d] [-e <value>...] [-j] [--json-schema] [-l] [-n <value>]
1480414804
[--no-color] [--no-input] [--password <value>] [--path <value>] [-s <value>] [-t <value>] [--verbose]
1480514805
1480614806
FLAGS
@@ -14812,6 +14812,10 @@ FLAGS
1481214812
The environment to apply to the current command.
1481314813
[env: SHOPIFY_FLAG_ENVIRONMENT]
1481414814
14815+
-j, --json
14816+
Output the result as JSON. Automatically disables color output.
14817+
[env: SHOPIFY_FLAG_JSON]
14818+
1481514819
-l, --live
1481614820
Rename your remote live theme. Use --development, --live, or --theme in non-interactive environments.
1481714821
[env: SHOPIFY_FLAG_LIVE]
@@ -14864,6 +14868,311 @@ DESCRIPTION
1486414868
1486514869
If no theme is specified, then you're prompted to select the theme that you want to rename from the list of themes in
1486614870
your store.
14871+
14872+
14873+
Use `--json-schema` to print the result, error, and event schemas.
14874+
14875+
Output from `--json` conforms to the `ThemeRenameResult` schema.
14876+
14877+
```json
14878+
{
14879+
"anyOf": [
14880+
{
14881+
"$ref": "#/definitions/ThemeEnvironment/anyOf/0/properties/result"
14882+
},
14883+
{
14884+
"type": "object",
14885+
"properties": {
14886+
"environments": {
14887+
"type": "array",
14888+
"items": {
14889+
"$ref": "#/definitions/ThemeEnvironment"
14890+
}
14891+
}
14892+
},
14893+
"required": [
14894+
"environments"
14895+
],
14896+
"additionalProperties": false
14897+
}
14898+
],
14899+
"title": "ThemeRenameResult",
14900+
"definitions": {
14901+
"Theme": {
14902+
"type": "object",
14903+
"properties": {
14904+
"id": {
14905+
"type": "string",
14906+
"pattern": "^\\d+$",
14907+
"description": "The decimal Online Store theme ID, not a Shopify GID."
14908+
},
14909+
"name": {
14910+
"type": "string"
14911+
},
14912+
"role": {
14913+
"type": "string",
14914+
"description": "The upstream theme role; known values include live, unpublished, and development."
14915+
},
14916+
"storeDomain": {
14917+
"anyOf": [
14918+
{
14919+
"type": "string",
14920+
"pattern": "^[a-z0-9][a-z0-9-]*\\.myshopify\\.com$"
14921+
},
14922+
{
14923+
"type": "null"
14924+
}
14925+
]
14926+
},
14927+
"processing": {
14928+
"type": "boolean"
14929+
},
14930+
"sourceUrl": {
14931+
"anyOf": [
14932+
{
14933+
"type": "string",
14934+
"format": "uri"
14935+
},
14936+
{
14937+
"type": "null"
14938+
}
14939+
]
14940+
}
14941+
},
14942+
"required": [
14943+
"id",
14944+
"name",
14945+
"role",
14946+
"storeDomain",
14947+
"processing",
14948+
"sourceUrl"
14949+
],
14950+
"additionalProperties": false,
14951+
"description": "The selected theme projection; sourceUrl is null when the upstream source URL is unavailable."
14952+
},
14953+
"ThemeEnvironment": {
14954+
"anyOf": [
14955+
{
14956+
"type": "object",
14957+
"properties": {
14958+
"environment": {
14959+
"type": "string"
14960+
},
14961+
"result": {
14962+
"anyOf": [
14963+
{
14964+
"type": "object",
14965+
"properties": {
14966+
"status": {
14967+
"type": "string",
14968+
"const": "success"
14969+
},
14970+
"changed": {
14971+
"type": "boolean"
14972+
},
14973+
"originalName": {
14974+
"type": "string"
14975+
},
14976+
"theme": {
14977+
"$ref": "#/definitions/Theme"
14978+
}
14979+
},
14980+
"required": [
14981+
"status",
14982+
"changed",
14983+
"originalName",
14984+
"theme"
14985+
],
14986+
"additionalProperties": false
14987+
},
14988+
{
14989+
"type": "object",
14990+
"properties": {
14991+
"status": {
14992+
"type": "string",
14993+
"const": "cancelled"
14994+
}
14995+
},
14996+
"required": [
14997+
"status"
14998+
],
14999+
"additionalProperties": false
15000+
}
15001+
]
15002+
}
15003+
},
15004+
"required": [
15005+
"environment",
15006+
"result"
15007+
],
15008+
"additionalProperties": false
15009+
},
15010+
{
15011+
"type": "object",
15012+
"properties": {
15013+
"environment": {
15014+
"type": "string"
15015+
},
15016+
"error": {
15017+
"anyOf": [
15018+
{
15019+
"type": "object",
15020+
"properties": {
15021+
"type": {
15022+
"type": "string",
15023+
"const": "abort"
15024+
},
15025+
"message": {
15026+
"type": "string"
15027+
},
15028+
"code": {
15029+
"type": "string",
15030+
"minLength": 1,
15031+
"description": "A stable error code, included only when known."
15032+
},
15033+
"tryMessage": {
15034+
"type": "string"
15035+
},
15036+
"nextSteps": {
15037+
"type": "array",
15038+
"items": {
15039+
"type": "string"
15040+
}
15041+
},
15042+
"customSections": {
15043+
"type": "array",
15044+
"items": {
15045+
"type": "object",
15046+
"properties": {
15047+
"title": {
15048+
"type": "string"
15049+
},
15050+
"body": {
15051+
"anyOf": [
15052+
{
15053+
"type": "string"
15054+
},
15055+
{
15056+
"type": "array",
15057+
"items": {
15058+
"type": "array",
15059+
"items": {
15060+
"type": "string"
15061+
}
15062+
}
15063+
}
15064+
]
15065+
}
15066+
},
15067+
"required": [
15068+
"body"
15069+
],
15070+
"additionalProperties": false
15071+
}
15072+
},
15073+
"details": {
15074+
"description": "Selected domain details, preserving native API payloads such as GraphQL errors, extensions, and data."
15075+
}
15076+
},
15077+
"required": [
15078+
"type",
15079+
"message"
15080+
],
15081+
"additionalProperties": false
15082+
},
15083+
{
15084+
"type": "object",
15085+
"properties": {
15086+
"type": {
15087+
"type": "string",
15088+
"const": "bug"
15089+
},
15090+
"message": {
15091+
"$ref": "#/definitions/ThemeEnvironment/anyOf/1/properties/error/anyOf/0/properties/message"
15092+
},
15093+
"code": {
15094+
"$ref": "#/definitions/ThemeEnvironment/anyOf/1/properties/error/anyOf/0/properties/code"
15095+
},
15096+
"tryMessage": {
15097+
"$ref": "#/definitions/ThemeEnvironment/anyOf/1/properties/error/anyOf/0/properties/tryMessage"
15098+
},
15099+
"nextSteps": {
15100+
"$ref": "#/definitions/ThemeEnvironment/anyOf/1/properties/error/anyOf/0/properties/nextSteps"
15101+
},
15102+
"customSections": {
15103+
"$ref": "#/definitions/ThemeEnvironment/anyOf/1/properties/error/anyOf/0/properties/customSections"
15104+
},
15105+
"details": {
15106+
"$ref": "#/definitions/ThemeEnvironment/anyOf/1/properties/error/anyOf/0/properties/details"
15107+
},
15108+
"stack": {
15109+
"type": "string"
15110+
}
15111+
},
15112+
"required": [
15113+
"type",
15114+
"message"
15115+
],
15116+
"additionalProperties": false
15117+
},
15118+
{
15119+
"type": "object",
15120+
"properties": {
15121+
"type": {
15122+
"type": "string",
15123+
"const": "external"
15124+
},
15125+
"message": {
15126+
"$ref": "#/definitions/ThemeEnvironment/anyOf/1/properties/error/anyOf/0/properties/message"
15127+
},
15128+
"code": {
15129+
"$ref": "#/definitions/ThemeEnvironment/anyOf/1/properties/error/anyOf/0/properties/code"
15130+
},
15131+
"tryMessage": {
15132+
"$ref": "#/definitions/ThemeEnvironment/anyOf/1/properties/error/anyOf/0/properties/tryMessage"
15133+
},
15134+
"nextSteps": {
15135+
"$ref": "#/definitions/ThemeEnvironment/anyOf/1/properties/error/anyOf/0/properties/nextSteps"
15136+
},
15137+
"customSections": {
15138+
"$ref": "#/definitions/ThemeEnvironment/anyOf/1/properties/error/anyOf/0/properties/customSections"
15139+
},
15140+
"details": {
15141+
"$ref": "#/definitions/ThemeEnvironment/anyOf/1/properties/error/anyOf/0/properties/details"
15142+
},
15143+
"command": {
15144+
"type": "string"
15145+
},
15146+
"args": {
15147+
"type": "array",
15148+
"items": {
15149+
"type": "string"
15150+
}
15151+
}
15152+
},
15153+
"required": [
15154+
"type",
15155+
"message",
15156+
"command",
15157+
"args"
15158+
],
15159+
"additionalProperties": false
15160+
}
15161+
]
15162+
}
15163+
},
15164+
"required": [
15165+
"environment",
15166+
"error"
15167+
],
15168+
"additionalProperties": false
15169+
}
15170+
]
15171+
}
15172+
},
15173+
"$schema": "http://json-schema.org/draft-07/schema#"
15174+
}
15175+
```
1486715176
```
1486815177
1486915178
## `shopify theme share`

0 commit comments

Comments
 (0)