-
-
Notifications
You must be signed in to change notification settings - Fork 781
build: move hookable to dependencies and fix plugin hook docs
#4014
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: move hookable to dependencies and fix plugin hook docs
#4014
Conversation
`hookable` was listed as a devDependency, so consumers couldn't resolve the `HookableCore` type used in `NitroApp.hooks`, causing it to be typed as `any` in plugin definitions. Closes nitrojs#3809 Co-authored-by: Cursor <cursoragent@cursor.com>
|
@wadefletch is attempting to deploy a commit to the Nitro Team on Vercel. A member of the Team first needs to authorize it. |
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughMoved Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 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 |
commit: |
The `response` hook signature was documented as `(event, { body })` but the
actual type is `(res: Response, event: HTTPEvent)`. Also adds the `close` hook
which was shown in examples but missing from the available hooks list.
Co-authored-by: Cursor <cursoragent@cursor.com>
hookable to dependencies for correct type resolutionhookable to dependencies and fix plugin hook docs
hookable to dependencies and fix plugin hook docshookable to dependencies and fix plugin hook docs
pi0
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thnx!
Linked issue
Resolves #3809
Type of change
Description
Fix
hookabletype resolution (#3809)hookablewas listed as adevDependency, so consumers installingnitrodidn't get it installed. This caused theHookableCoretype (used inNitroApp.hooks) to resolve asany, breaking type inference in plugin definitions:hookableis also imported as a runtime value insrc/runtime/internal/app.ts, so it belongs independenciesregardless.The fix moves
hookablefromdevDependenciestodependencies.Fix plugin runtime hooks documentation
The "Available hooks" list in the plugins docs had two issues:
responsehook signature was documented as(event, { body }) => {}but the actual type is(res, event) => {}(Responsefirst, thenHTTPEvent).closehook was shown in the example code but missing from the available hooks list.Checklist