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 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:

{
  "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 an empty array. 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, #8643.

@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

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.

1 participant