Add typed JSON output to Hydrogen route generation - #4100
Draft
gonzaloriestra wants to merge 1 commit into
Draft
gonzaloriestra wants to merge 1 commit into
gonzaloriestra wants to merge 1 commit into
Conversation
This was referenced Sep 28, 2026
gonzaloriestra
added this pull request to stack #4104
September 28, 2026 15:14
gonzaloriestra
force-pushed
the
gonzalo/hydrogen-json-routes
branch
from
September 28, 2026 15:31
f9b09c9 to
f69ff8a
Compare
Contributor
|
Oxygen deployed a preview of your
Learn more about Hydrogen's GitHub integration. |
gonzaloriestra
force-pushed
the
gonzalo/hydrogen-json-routes
branch
from
September 28, 2026 15:38
f69ff8a to
58b2f56
Compare
gonzaloriestra
force-pushed
the
gonzalo/hydrogen-json-routes
branch
from
September 29, 2026 12:25
58b2f56 to
783de51
Compare
gonzaloriestra
force-pushed
the
gonzalo/hydrogen-json-routes
branch
from
September 29, 2026 14:54
783de51 to
26229df
Compare
fredericoo
approved these changes
Sep 29, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WHY are these changes introduced?
Route generation needs a result that distinguishes created, replaced and skipped files.
WHAT is this pull request doing?
Add a shared route-generation schema and
--jsonsupport togenerate routeandgenerate routes. Return route groups, language and file operations, and forward all-route options directly so false boolean options stay false. Remove the hiddengalias from the shared exception list without adding a JSON contract; a local lint exemption is needed because the current plugin does not skip hidden commands.Without
--json, the existing terminal presentation remains. Example JSON result:{"isTypescript":true,"routeGroups":{"cart":["cart.tsx"]},"routes":[{"sourceRoute":"cart.tsx","destinationRoute":"app/routes/cart.tsx","operation":"created"}]}HOW to test your changes?
pnpm --filter @shopify/cli-hydrogen test src/commands/hydrogen/generate/route.test.tsBuild and typecheck were checked at each layer. The full stack passed 498 tests (6 skipped), lint, and schema discovery for all 22 finite commands. Command-line smoke checks covered a successful unlink result, fatal project errors, watch-mode rejection and schema environment flags. Live authenticated Shopify operations have not been exercised.
Stack
Draft 6 of 9. Previous: #4099. Next: #4101. One changeset is included in #4103.