Skip to content

Conversation

@kibertoad
Copy link
Member

Checklist

@kibertoad kibertoad requested a review from a team July 29, 2025 14:00
@kibertoad kibertoad marked this pull request as draft July 29, 2025 14:03
@kibertoad
Copy link
Member Author

want to improve the types of it

@Fdawgs Fdawgs requested a review from Copilot July 30, 2025 18:33
Copy link

Copilot AI left a 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 resolveDependencyFromApp helper 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'
Copy link

Copilot AI Jul 30, 2025

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'.

Suggested change
import { FastifyDependencyProvider } from '@fastify/awilix'
import { resolveDependencyFromApp } from '@fastify/awilix'

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <[email protected]>
Signed-off-by: Frazer Smith <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants