Skip to content

Commit aa8f8e4

Browse files
PuppoCopilot
andauthored
feat!: upgrade Fastify 5 (#343)
* chore: update dependencies and peerDependencies in package.json * chore!: update fastify version in plugin to 5.x * chore: update import path for mercuriusDynamicSchema in test file * chore: simplify module exports in index.js * chore: update CI workflow to use matrix strategy for node versions * Update package.json Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * chore: update mercurius version in package-lock.json to use caret range * chore: refactor CI workflow to use pkgjs action for linting and testing * chore: add engines field to specify required Node.js version * chore: update Node.js engine requirement to >=22 --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent cdf5167 commit aa8f8e4

File tree

6 files changed

+649
-304
lines changed

6 files changed

+649
-304
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,12 @@ on:
99
jobs:
1010
test:
1111
name: Lint and test
12-
runs-on: ubuntu-latest
13-
steps:
14-
- uses: actions/checkout@v4
15-
- uses: actions/setup-node@v4
16-
with:
17-
node-version-file: '.nvmrc'
18-
- run: |
19-
npm ci
20-
npm run lint
21-
npm test
12+
uses: pkgjs/action/.github/workflows/node-test.yaml@v0
13+
with:
14+
strategy-fail-fast: true
15+
test-command: |
16+
npm run lint
17+
npm run test
2218
2319
automerge:
2420
name: Merge dependabot's PRs

index.d.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { FastifyInstance, FastifyRequest } from 'fastify'
1+
import { FastifyPluginAsync, FastifyRequest } from 'fastify'
22
import { IResolvers, MercuriusContext } from 'mercurius'
33

44
/**
@@ -23,12 +23,7 @@ export interface MercuriusDynamicSchemaOptions<TParent = any, TArgs = any, TCont
2323
context?: (arg0: FastifyRequest) => any
2424
}
2525

26-
export default MercuriusDynamicSchema
26+
export default mercuriusDynamicSchema
2727

2828
/** Mercurius Dynamic Schema is a plugin for `mercurius` that allows using separate schemas based on request parameters. */
29-
declare function MercuriusDynamicSchema (
30-
instance: FastifyInstance,
31-
opts: MercuriusDynamicSchemaOptions
32-
): Promise<void>;
33-
34-
declare namespace MercuriusDynamicSchema {}
29+
export declare const mercuriusDynamicSchema: FastifyPluginAsync<MercuriusDynamicSchemaOptions | {}>;

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ async function mercuriusDynamicSchema(fastify, opts) {
5454
}
5555

5656
module.exports = fp(mercuriusDynamicSchema, {
57-
fastify: '4.x',
57+
fastify: '5.x',
5858
name: PLUGIN_NAME
5959
})
6060
module.exports.default = mercuriusDynamicSchema

0 commit comments

Comments
 (0)