Skip to content

Add typed JSON output to theme publish - #8652

Open
gonzaloriestra wants to merge 1 commit into
gonzalo/json-theme-deletefrom
gonzalo/json-theme-publish
Open

gonzaloriestra wants to merge 1 commit into
gonzalo/json-theme-deletefrom
gonzalo/json-theme-publish

Conversation

@gonzaloriestra

@gonzaloriestra gonzaloriestra commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

theme publish has no JSON result contract, so automation must parse terminal output.

Part of shop/issues-develop#23692.

WHAT is this pull request doing?

Return status: "success" alongside the published theme, using the shared mutation success schema. Multiple environments carry the status inside each successful result, with no overall success claim.

Return the published API theme as typed data and move final output into a presenter. Reuse the environment collector from the preceding PR, retaining prompts and the original terminal wording. Add --json, expose the domain-owned schema, and refresh the manifest, README, and generated docs.

Normal output includes:

The theme 'Original' (#1) is now live at https://example.myshopify.com.

Matching JSON:

{
  "status": "success",
  "theme": {
    "id": 1,
    "name": "Original",
    "role": "live",
    "processing": false,
    "createdAtRuntime": false,
    "shop": "example.myshopify.com"
  }
}

The optional src field is retained when present. Multiple environments return {"environments":[{"environment":"staging","result":...}]} in configured order. Failed or invalid environments are omitted and reported on stderr; total failure returns {"environments":[]}. Existing exit behavior and single-environment presentation are preserved.

How to manually test your changes?

pnpm shopify theme publish --help
pnpm shopify theme publish --json-schema
pnpm shopify theme publish --store "$STORE" --theme "$THEME_ID" --force
pnpm shopify theme publish --store "$STORE" --theme "$THEME_ID" --force --json
pnpm shopify theme publish --environment staging --environment production --theme "$THEME_ID" --force --json

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes
  • I've considered analytics changes to measure impact
  • A single changeset for all theme migrations is added in the last PR, #8682.

@gonzaloriestra
gonzaloriestra added this pull request to stack #8654 September 24, 2026 09:47
@github-actions github-actions Bot added Area: @shopify/cli @shopify/cli package issues shopify.dev preview labels Sep 24, 2026
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-theme-publish branch from d3213d0 to 789a14a Compare September 24, 2026 10:04
@gonzaloriestra
gonzaloriestra removed this pull request from stack #8654 September 24, 2026 10:04
@gonzaloriestra
gonzaloriestra added this pull request to stack #8655 September 24, 2026 10:05
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-theme-publish branch from 789a14a to bcdcb7d Compare September 24, 2026 10:13
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-theme-publish branch from bcdcb7d to 56a75f3 Compare September 24, 2026 10:25
@github-actions github-actions Bot added no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. and removed Area: @shopify/cli @shopify/cli package issues labels Sep 24, 2026
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-theme-publish branch from 56a75f3 to 15a4930 Compare September 24, 2026 11:56
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-theme-publish branch 2 times, most recently from 0adfd99 to 5ba599e Compare September 24, 2026 14:21
@gonzaloriestra
gonzaloriestra marked this pull request as ready for review September 24, 2026 14:34
@gonzaloriestra
gonzaloriestra requested review from a team as code owners September 24, 2026 14:34
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-theme-publish branch from 5ba599e to 51ec362 Compare September 24, 2026 14:36
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-theme-publish branch from 51ec362 to 46ed754 Compare September 25, 2026 12:28
@gonzaloriestra
gonzaloriestra removed this pull request from stack #8655 September 25, 2026 12:28
@gonzaloriestra
gonzaloriestra added this pull request to stack #8673 September 25, 2026 12:29
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-theme-publish branch from 46ed754 to f8d5e61 Compare September 28, 2026 08:20
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-theme-publish branch 2 times, most recently from 493c1ea to 97fc0af Compare September 28, 2026 11:39
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-theme-publish branch from 97fc0af to 2c18dfa Compare September 28, 2026 11:51
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-theme-publish branch from 2c18dfa to bc376f7 Compare September 29, 2026 10:28
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-theme-publish branch from bc376f7 to aa1b9ca Compare September 29, 2026 11:11
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-theme-publish branch 2 times, most recently from cfc35a6 to 7699b97 Compare September 29, 2026 13:44
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-theme-publish branch from 7699b97 to 9921794 Compare September 29, 2026 14:18
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-theme-publish branch from 9921794 to 2a1064f Compare September 29, 2026 14:40
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-theme-publish branch from 2a1064f to 065a1ec Compare October 1, 2026 08:52
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Differences in type declarations

We detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:

  • Some seemingly private modules might be re-exported through public modules.
  • If the branch is behind main you might see odd diffs, rebase main into this branch.

New type declarations

We found no new type declarations in this PR

Existing type declarations

packages/cli-kit/dist/public/node/base-command.d.ts
@@ -35,6 +35,7 @@ declare abstract class BaseCommand extends Command {
         argv: string[];
     }>;
     protected environmentsFilename(): string | undefined;
+    protected validateNonTTYFlags(flags: FlagOutput): void;
     protected failMissingNonTTYFlags(flags: FlagOutput, requiredFlags: string[]): void;
     private failMissingNonTTYFlagRequirements;
     private applicableNonTTYFlagRequirements;

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. shopify.dev preview

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants