fix(route-meta): add order:pre to route-meta plugin hooks#4316
Conversation
|
Someone is attempting to deploy a commit to the Nitro Team on Vercel. A member of the Team first needs to authorize it. |
📝 WalkthroughWalkthroughThe route-meta plugin now sets ChangesRoute-Meta Plugin Hook Ordering
OpenAPI Vite Fixture and Tests
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Thanks for PR and transparency on AI usage. Can you please add a regression test (to the existing main fixture) for this? |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@test/vite/openapi.test.ts`:
- Around line 17-23: Replace the unsafe string-cast port and the unsafe shaped
cast of the HTTP address: call server.listen with the numeric ephemeral port 0
(use server.listen(0)) and obtain the runtime address from
server.httpServer?.address(), treating it as the union type returned by Node
(AddressInfo | string | null) rather than forcing an object shape; then compute
serverURL from that union (handle null, a plain string address, and an
AddressInfo with .address/.port/.family, preserving the IPv6 bracket logic) so
serverURL is correctly derived without unsafe casts (changes affect
server.listen, server.httpServer?.address(), and the serverURL construction).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b8e3de28-7be2-4ed2-811c-ef8375131e4e
📒 Files selected for processing (3)
test/vite/openapi-fixture/api/meta/test.tstest/vite/openapi-fixture/vite.config.tstest/vite/openapi.test.ts
✅ Files skipped from review due to trivial changes (1)
- test/vite/openapi-fixture/api/meta/test.ts
Appreciate the feedback, sir! 🫡 Updated with openapi tests that check that the The Update: I wasn't able to add the test cases to the main fixture because the regression is specific to the native plugin pipeline ordering of |
🔗 Linked issue
Fixes #3899
❓ Type of change
📚 Description
Fixes #3899
The route-meta plugin uses
?metavirtual imports to extractdefineRouteMetametadata from handler files. During Vite Rolldown builds, Rolldown's resolver processed these imports before the plugin could intercept them because the hooks lackedorder: "pre", causing alldefineRouteMetacalls to be silently ignored.Authored in collaboration with DeepSeek V4 Pro
📝 Checklist