Skip to content
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

feat: separated type providers #97

Merged
merged 2 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading