Skip to content

Add JSONL output to hydrogen dev - #4273

Open
gonzaloriestra wants to merge 4 commits into
gonzalo/hydrogen-dev-preview-instancesfrom
gonzalo/hydrogen-dev-json
Open

gonzaloriestra wants to merge 4 commits into
gonzalo/hydrogen-dev-preview-instancesfrom
gonzalo/hydrogen-dev-json

Conversation

@gonzaloriestra

@gonzaloriestra gonzaloriestra commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

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

Agents need structured live output from hydrogen dev. This builds on the Dev Instance layer, following Shopify/cli#8996.

WHAT is this pull request doing?

Add --json (-j, SHOPIFY_FLAG_JSON) to stream the same JSONL bytes to stdout and the session log. Reuse CLI Kit's typed log schema for readiness, runtime messages, requests, file changes, codegen output, recoverable errors, and shutdown. CLI diagnostics use stderr; fatal errors use the standard JSON error envelope on stdout. There is no final success result.

Run codegen watchers from the storefront directory so relative schema and document paths work with --path, while preserving explicit config paths.

Keep --no-input independent. Disable terminal shortcuts and banners in JSON mode, keep existing noise filters without debouncing repeated worker messages, capture console methods including dir and table, and expose schemas through --json-schema. Update command help and the manifest, and remove dev's typed JSON lint exception.

Declare the command schema as a static field. Patch the pinned CLI ESLint rule to accept initialized schema fields, matching the rule in Shopify/cli.

How to manually test your changes?

  1. Using this checkout's linked CLI and an existing project, run pnpm shopify hydrogen dev --path /path/to/project --json --no-input > /tmp/hydrogen-dev.jsonl with existing authentication and configuration.
  2. Read readiness URLs from the stream or instance JSON. Change a route and request a page with a query string. Check that each stdout line parses as JSON and requests retain the query string.
  3. Add a temporary worker console.log or console.table, and trigger a recoverable worker error. Confirm messages reach the stream while the session continues.
  4. Press Ctrl+C once and compare /tmp/hydrogen-dev.jsonl with the session's retained logFile; their bytes should match.
  5. Run pnpm shopify hydrogen dev --json-schema to inspect the record, error, event, and runtime-details schemas.

Checklist

  • I've read the Contributing Guidelines
  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've added a changeset if this PR contains user-facing or functional changes
  • I've added tests to cover my changes
  • I've added or updated the documentation

@gonzaloriestra gonzaloriestra changed the title Add typed JSON output to hydrogen dev [Feature] Add JSONL output to hydrogen dev Oct 26, 2026
@shopify

shopify Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

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

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

Learn more about Hydrogen's GitHub integration.

@gonzaloriestra gonzaloriestra changed the title [Feature] Add JSONL output to hydrogen dev Add JSONL output to hydrogen dev Oct 27, 2026
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/hydrogen-dev-json branch from 5c882a2 to a70dc84 Compare October 27, 2026 12:42
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/hydrogen-dev-json branch 2 times, most recently from e98e816 to 25bc0a5 Compare October 27, 2026 13:07
@gonzaloriestra
gonzaloriestra marked this pull request as ready for review October 27, 2026 13:32
@gonzaloriestra
gonzaloriestra requested a review from a team as a code owner October 27, 2026 13:32
@github-actions

This comment has been minimized.

@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/hydrogen-dev-json branch from 25bc0a5 to d30eda3 Compare October 27, 2026 14:04
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/hydrogen-dev-json branch from d30eda3 to adf05a7 Compare October 27, 2026 14:37
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/hydrogen-dev-json branch 2 times, most recently from adf05a7 to ceb6bac Compare October 27, 2026 14:54
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/hydrogen-dev-json branch from ceb6bac to 99d65b9 Compare October 27, 2026 15:15
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/hydrogen-dev-json branch from 99d65b9 to a05dc8c Compare October 27, 2026 15:46
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/hydrogen-dev-json branch from a05dc8c to 8c85ce1 Compare October 27, 2026 16:15
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/hydrogen-dev-json branch from 8c85ce1 to 20d9c6e Compare October 27, 2026 16:40
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/hydrogen-dev-json branch from 20d9c6e to a87fe0e Compare October 27, 2026 17:03

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

thank uuu
left a few blocking comments, pls resolve when u can

Comment thread packages/cli/src/commands/hydrogen/dev.ts
Comment thread packages/cli/src/commands/hydrogen/dev.ts Outdated
Comment thread packages/cli/src/commands/hydrogen/dev.ts Outdated
Comment thread packages/cli/src/commands/hydrogen/dev-json.test.ts Outdated
Comment thread packages/cli/src/commands/hydrogen/dev-startup.test.ts Outdated
Comment thread packages/cli/src/commands/hydrogen/dev.ts
Comment thread packages/cli/docs/dev-sessions.md Outdated
@fredericoo fredericoo mentioned this pull request Oct 27, 2026
5 tasks done
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/hydrogen-dev-json branch from a87fe0e to e86a93c Compare October 28, 2026 10:18
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/hydrogen-dev-json branch from e86a93c to 03a4057 Compare October 28, 2026 10:23
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/hydrogen-dev-json branch from 9e7af72 to 8111c95 Compare October 28, 2026 15:06
@gonzaloriestra
gonzaloriestra added this pull request to the merge queue Oct 28, 2026
@gonzaloriestra
gonzaloriestra removed this pull request from the merge queue due to a manual request Oct 28, 2026
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/hydrogen-dev-json branch 3 times, most recently from 5c46a9a to d8d378c Compare October 28, 2026 16:17
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/hydrogen-dev-json branch from d8d378c to 6bbd062 Compare October 28, 2026 16:38

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