build: move hookable to dependencies and fix plugin hook docs#4014
Merged
pi0 merged 3 commits intonitrojs:mainfrom Feb 10, 2026
Merged
build: move hookable to dependencies and fix plugin hook docs#4014pi0 merged 3 commits intonitrojs:mainfrom
hookable to dependencies and fix plugin hook docs#4014pi0 merged 3 commits intonitrojs:mainfrom
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
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.
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