Skip to content

Add typed JSON output to Hydrogen build tooling - #4096

Merged
gonzaloriestra merged 2 commits into
2026-04from
gonzalo/hydrogen-json-build
Oct 15, 2026
Merged

gonzaloriestra merged 2 commits into
2026-04from
gonzalo/hydrogen-json-build

Conversation

@gonzaloriestra

@gonzaloriestra gonzaloriestra commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

Build, route validation, and code generation need typed results that scripts can consume.

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

WHAT is this pull request doing?

Add strict schemas and --json to build, check, and codegen. Return absolute artifact paths, a validation valid field, and named generated files with source patterns. Keep diagnostics on stderr and reject finite JSON output with watch mode.

HOW to test your changes?

shopify hydrogen check routes --json
shopify hydrogen codegen --json
shopify hydrogen build --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-build branch. Details:

Storefront Status Preview link Deployment details Last update (UTC)
Skeleton (skeleton.hydrogen.shop) ✅ Successful (Logs) Preview deployment Inspect deployment October 14, 2026 9:54 AM

Learn more about Hydrogen's GitHub integration.

@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/hydrogen-json-build branch from 7052847 to 43c52f2 Compare September 29, 2026 12:25
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/hydrogen-json-build branch from 43c52f2 to d964345 Compare September 29, 2026 14:53

@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.

nice and tidy - pulling checkRoutes out as a pure function returning the domain result is a good shape, and the human output looks unchanged. A few small comments, mainly Vite's TTY progress output possibly getting into stdout in JSON mode, and codegen detecting --json differently from build/check.

Comment thread packages/cli/src/commands/hydrogen/build.ts Outdated
Comment thread packages/cli/src/commands/hydrogen/codegen.ts Outdated
Comment thread packages/cli/src/commands/hydrogen/build-json.test.ts
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/hydrogen-json-build branch 5 times, most recently from 362712c to fa04237 Compare October 6, 2026 13:52
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/hydrogen-json-build branch from fa04237 to 07dc587 Compare October 6, 2026 13:55
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/hydrogen-json-build branch from 07dc587 to e78f1b7 Compare October 8, 2026 11:36
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/hydrogen-json-build branch 2 times, most recently from b0dead5 to f103f6c Compare October 9, 2026 10:52
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/hydrogen-json-build branch from f103f6c to 0acb4bb 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-build branch from 0acb4bb to b5ba0a9 Compare October 9, 2026 13:01
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/hydrogen-json-build branch from b5ba0a9 to 74a3ae5 Compare October 9, 2026 13:02
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/hydrogen-json-build branch from 74a3ae5 to 5d186d9 Compare October 9, 2026 13:30
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/hydrogen-json-build branch from 5d186d9 to 55b9aae Compare October 9, 2026 14:01
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/hydrogen-json-build branch from 55b9aae to 74ab149 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
Comment thread packages/cli/src/commands/hydrogen/build.ts Outdated
Comment thread packages/cli/src/commands/hydrogen/build.ts
Comment thread packages/cli/src/commands/hydrogen/codegen.ts
Comment thread .changeset/hydrogen-json-build.md Outdated
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/hydrogen-json-build branch 2 times, most recently from 9fcbaf8 to 61a9567 Compare October 14, 2026 09:52
Base automatically changed from gonzalo/hydrogen-json-support to 2026-04 October 15, 2026 09:50
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/hydrogen-json-build branch from 61a9567 to 2d81538 Compare October 15, 2026 09:50
@gonzaloriestra
gonzaloriestra merged commit 884ab8a into 2026-04 Oct 15, 2026
17 of 19 checks passed
@gonzaloriestra
gonzaloriestra deleted the gonzalo/hydrogen-json-build branch October 15, 2026 09:51
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.

3 participants