-
-
Notifications
You must be signed in to change notification settings - Fork 14
feat: Add dependency resolution logic for plugins #179
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
base: main
Are you sure you want to change the base?
Conversation
|
want to improve the types of it |
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.
Pull Request Overview
This PR adds dependency resolution logic for plugins by introducing a resolveDependencyFromApp function that allows plugins to resolve dependencies from the Fastify application's DI container.
- Added
resolveDependencyFromApphelper function to resolve dependencies from the app's DI container - Included test coverage for the new dependency resolution functionality
- Updated documentation with usage examples for plugin dependency injection
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| lib/fastifyAwilixPlugin.js | Adds the resolveDependencyFromApp helper function and exports it |
| test/fastifyAwilixPlugin.test.js | Adds test coverage for the new dependency resolution functionality |
| README.md | Documents the new plugin dependency resolution feature with examples |
| For this purpose there is a helper class available in `@fastify/awilix`: | ||
|
|
||
| ```ts | ||
| import { FastifyDependencyProvider } from '@fastify/awilix' |
Copilot
AI
Jul 30, 2025
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.
The import statement references FastifyDependencyProvider but the actual exported function is resolveDependencyFromApp. The import should be import { resolveDependencyFromApp } from '@fastify/awilix'.
| import { FastifyDependencyProvider } from '@fastify/awilix' | |
| import { resolveDependencyFromApp } from '@fastify/awilix' |
Co-authored-by: Copilot <[email protected]> Signed-off-by: Frazer Smith <[email protected]>
Checklist
npm run test && npm run benchmark --if-presentand the Code of conduct