Skip to content

Add typed JSON output to Hydrogen project and account commands - #4101

Open
gonzaloriestra wants to merge 3 commits into
gonzalo/hydrogen-json-routesfrom
gonzalo/hydrogen-json-project
Open

gonzaloriestra wants to merge 3 commits into
gonzalo/hydrogen-json-routesfrom
gonzalo/hydrogen-json-project

Conversation

@gonzaloriestra

@gonzaloriestra gonzaloriestra commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

Project and account commands need predictable resource fields and complete initialization outcomes.

Fixes https://github.com/shop/issues-develop/issues/23682

WHAT is this pull request doing?

Expose explicit storefront projections with gid, name, canonical storeDomain, null unavailable fields, and UTC timestamps. Add JSON login, logout, link, and unlink results. Initialization returns {status, project, failures} and preserves completed work while exiting nonzero on partial failure. Add minor changesets for CLI Hydrogen and create-hydrogen.

HOW to test your changes?

shopify hydrogen list --json
shopify hydrogen unlink --json
shopify hydrogen init --path ./json-storefront --quickstart --no-install-deps --json

Checklist

  • I have read the contributing guidelines
  • I have considered cross-platform impacts
  • I have added a changeset for user-facing changes
  • I have added tests
  • I have updated the documentation

@shopify

shopify Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Oxygen deployed a preview of your gonzalo/hydrogen-json-project branch. Details:

Storefront Status Preview link Deployment details Last update (UTC)
Skeleton (skeleton.hydrogen.shop) ✅ Successful (Logs) Preview deployment Inspect deployment October 13, 202611:04 AM

Learn more about Hydrogen's GitHub integration.

@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/hydrogen-json-project branch from d8ae8a8 to 8ee3647 Compare September 28, 2026 15:38
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/hydrogen-json-project branch from 8ee3647 to bb0c78c Compare September 29, 2026 12:25
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/hydrogen-json-project branch from bb0c78c to 7c1c770 Compare September 29, 2026 14:54

@fredericoo fredericoo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Went through this one. It's a clean follow-on from the rest of the stack: same jsonOutputSchema / writeJsonResult / descriptionForHelp pattern as the env and route PRs, results carry no tokens (login just picks shop/shopName/email), and the human-readable output looks unchanged for all six commands. Moving renderProjectReady and the remote-template info into presentTemplateResult is a nice split.

Prompts in --json mode look fine too. When stdout is piped, cli-kit's throwInNonTTY rejects them, so login/link/init fail fast with a JSON error instead of hanging.

Two small comments, neither blocking. Overall LGTM

Comment thread packages/cli/src/commands/hydrogen/link.ts Outdated
Comment thread packages/cli/src/lib/onboarding/common.ts Outdated
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/hydrogen-json-project branch from 7c1c770 to dcdcdc1 Compare October 6, 2026 12:02
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/hydrogen-json-project branch from dcdcdc1 to 1be2ea3 Compare October 6, 2026 12:11
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/hydrogen-json-project branch from 1be2ea3 to cc9bfe3 Compare October 6, 2026 12:12
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/hydrogen-json-project branch from cc9bfe3 to d4bffcb Compare October 6, 2026 13:46
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/hydrogen-json-project branch 2 times, most recently from 77a1bd0 to 3737a05 Compare October 6, 2026 13:55
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/hydrogen-json-project branch from 3737a05 to 47d6014 Compare October 8, 2026 11:37
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/hydrogen-json-project branch from 47d6014 to 5c987d7 Compare October 8, 2026 12:56
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/hydrogen-json-project branch 2 times, most recently from 13a2f13 to 71fe9b6 Compare October 9, 2026 12:25
@gonzaloriestra
gonzaloriestra marked this pull request as ready for review October 9, 2026 12:28
@gonzaloriestra
gonzaloriestra requested a review from a team as a code owner October 9, 2026 12:28
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/hydrogen-json-project branch 2 times, most recently from 5885f8c to e46187f Compare October 9, 2026 13:01
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/hydrogen-json-project branch from e46187f to 84e9347 Compare October 9, 2026 13:02
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/hydrogen-json-project branch from 84e9347 to 012ec34 Compare October 9, 2026 13:30
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/hydrogen-json-project branch 2 times, most recently from 6f3de2d to 573e4a1 Compare October 9, 2026 14:57
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/hydrogen-json-project branch from 573e4a1 to d8a9f53 Compare October 13, 2026 11:03
@gonzaloriestra
gonzaloriestra removed this pull request from stack #4104 October 13, 2026 11:03
@gonzaloriestra
gonzaloriestra added this pull request to stack #4177 October 13, 2026 11:04

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants