Skip to content

Commit

Permalink
feat: separated type providers (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bram-dc authored Sep 24, 2024
1 parent 375c253 commit 0110eb0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [16, 18, 20, 22]
node-version: [20, 22]
os: [ubuntu-latest, windows-latest]

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [18]
node-version: [22]
os: [ubuntu-latest]

steps:
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "fastify-type-provider-zod",
"version": "2.1.0",
"description": "Zod Type Provider for Fastify@4",
"description": "Zod Type Provider for Fastify@5",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
Expand All @@ -19,7 +19,7 @@
"prepublishOnly": "npm run build"
},
"peerDependencies": {
"fastify": "^4.0.0",
"fastify": "^5.0.0",
"zod": "^3.14.2"
},
"repository": {
Expand All @@ -41,15 +41,15 @@
"zod-to-json-schema": "^3.23.0"
},
"devDependencies": {
"@fastify/swagger": "^8.14.0",
"@fastify/swagger-ui": "^4.0.0",
"@fastify/swagger": "^9.0.0",
"@fastify/swagger-ui": "^5.0.1",
"@types/node": "^20.12.12",
"@typescript-eslint/eslint-plugin": "^7.9.0",
"@typescript-eslint/parser": "^7.9.0",
"@vitest/coverage-v8": "^1.6.0",
"eslint": "^8.57.0",
"eslint-plugin-import": "^2.29.1",
"fastify": "^4.27.0",
"fastify": "^5.0.0",
"fastify-plugin": "^5.0.1",
"oas-validator": "^5.0.8",
"openapi-types": "^12.1.3",
Expand Down
3 changes: 2 additions & 1 deletion src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ const defaultSkipList = [
];

export interface ZodTypeProvider extends FastifyTypeProvider {
output: this['input'] extends z.ZodTypeAny ? z.infer<this['input']> : unknown;
validator: this['schema'] extends z.ZodTypeAny ? z.output<this['schema']> : unknown;
serializer: this['schema'] extends z.ZodTypeAny ? z.input<this['schema']> : unknown;
}

interface Schema extends FastifySchema {
Expand Down

0 comments on commit 0110eb0

Please sign in to comment.