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

Bump Fastify to v5 #14

Merged
merged 4 commits into from
Sep 19, 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
5 changes: 5 additions & 0 deletions .changeset/strange-pianos-give.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@basica/fastify": minor
---

Bump to fastify v5
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
- uses: ./.github/actions/base
- run: pnpm build
- run: pnpm lint
- run: pnpm run test --concurrency=2
- run: pnpm run test --concurrency=1
8 changes: 4 additions & 4 deletions packages/basica/plugins/fastify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
}
},
"engines": {
"node": ">=18.0.0"
"node": ">=20.0.0"
},
"scripts": {
"build": "tsup-node",
Expand All @@ -31,10 +31,10 @@
},
"dependencies": {
"@basica/core": "workspace:^0.0.4",
"@fastify/swagger": "^8.14.0",
"@fastify/swagger-ui": "^2.1.0",
"@fastify/swagger": "^9.0.0",
"@fastify/swagger-ui": "^5.0.1",
"@sinclair/typebox": "^0.32.16",
"fastify": "^4.26.2"
"fastify": "^5.0.0"
},
"devDependencies": {
"@basica/eslint-config": "workspace:^0.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/basica/plugins/fastify/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export type FastifyRuntimeConfig = Required<
/**
* `ignoreTrailingSlash` is `true` by default
*
* `ajv.customOptions.removeAdditional` is `"all"` by default
* `ajv.customOptions.removeAdditional` is `"failing"` by default
* @see {@link FastifyServerOptions}
* */
export type FastifyConfig = FastifyServerOptions &
Expand Down
6 changes: 4 additions & 2 deletions packages/basica/plugins/fastify/src/entrypoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ export class FastifyEntrypoint implements IEntrypoint {
this.#runtimeConfig = { host, port };

this.fastify = fastify({
logger: logger.child({ name: `@basica:entrypoint:fastify:${name}` }),
loggerInstance: logger.child({
name: `@basica:entrypoint:fastify:${name}`,
}),
ajv: {
customOptions: {
removeAdditional: "all",
removeAdditional: "failing",
},
},
ignoreTrailingSlash: true,
Expand Down
4 changes: 2 additions & 2 deletions packages/benchmarks/crud/basica-fastify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
"@basica/fastify": "workspace:^0.0.4",
"@basica/kysely": "workspace:^",
"@basica/pg": "workspace:^",
"@fastify/type-provider-typebox": "^4.0.0",
"@fastify/type-provider-typebox": "^5.0.0",
"@sinclair/typebox": "^0.32.16",
"fastify": "^4.26.2",
"fastify": "^5.0.0",
"kysely": "^0.27.2",
"pg": "^8.11.3"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/benchmarks/crud/fastify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"lint": "tsc --noEmit && eslint \"{src,migrations}/**/*.ts\""
},
"dependencies": {
"@fastify/type-provider-typebox": "^4.0.0",
"fastify": "^4.26.2",
"@fastify/type-provider-typebox": "^5.0.0",
"fastify": "^5.0.0",
"kysely": "^0.27.2",
"pg": "^8.11.3"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/benchmarks/crud/fastify/src/routes.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { TodoService } from "./service";
import {
FastifyPluginAsyncTypebox,
Type,
} from "@fastify/type-provider-typebox";
import { TodoService } from "./service";

const todo = Type.Object({
id: Type.String({ format: "uuid" }),
Expand Down
2 changes: 1 addition & 1 deletion packages/benchmarks/http/basica-fastify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"dependencies": {
"@basica/core": "workspace:^0.0.4",
"@basica/fastify": "workspace:^0.0.4",
"fastify": "^4.26.2"
"fastify": "^5.0.0"
},
"devDependencies": {
"@basica/eslint-config": "workspace:^0.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/benchmarks/http/fastify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"lint": "tsc --noEmit && eslint \"src/**/*.ts\""
},
"dependencies": {
"fastify": "^4.26.2"
"fastify": "^5.0.0"
},
"devDependencies": {
"@basica/eslint-config": "workspace:^0.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/examples/crud/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
"@basica/fastify": "workspace:^0.0.4",
"@basica/kysely": "workspace:^0.0.4",
"@basica/pg": "workspace:^0.0.4",
"@fastify/type-provider-typebox": "^4.0.0",
"@fastify/type-provider-typebox": "^5.0.0",
"@sinclair/typebox": "^0.32.16",
"fastify": "^4.26.2",
"fastify": "^5.0.0",
"kysely": "^0.27.2",
"pg": "^8.11.3"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/examples/telemetry/svc1/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"scripts": {
"start": "node --require ./dist/instrumentation.js dist/index.js",
"dev": "HTTP_PORT=8080 SVC2_URL=http://127.0.0.0:8081 tsx watch --require ./src/instrumentation.ts --inspect src/index.ts | pino-pretty -c -t",
"dev": "HTTP_PORT=8080 SVC2_URL=http://127.0.0.0:8081 tsx watch --require tsx/cjs --require ./src/instrumentation.mts --inspect src/index.ts | pino-pretty -c -t",
"build": "tsup-node src/index.ts src/instrumentation.ts",
"lint": "tsc --noEmit && eslint \"src/**/*.ts\""
},
Expand All @@ -22,7 +22,7 @@
"@opentelemetry/exporter-prometheus": "^0.49.1",
"@opentelemetry/exporter-trace-otlp-grpc": "^0.49.1",
"@sinclair/typebox": "^0.32.16",
"fastify": "^4.26.2",
"fastify": "^5.0.0",
"opentelemetry-instrumentation-fetch-node": "^1.1.2"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/examples/telemetry/svc2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"scripts": {
"start": "node --require ./dist/instrumentation.js dist/index.js",
"dev": "HTTP_PORT=8081 tsx watch --require ./src/instrumentation.ts --inspect src/index.ts | pino-pretty -c -t",
"dev": "HTTP_PORT=8081 tsx watch --require tsx/cjs --require ./src/instrumentation.ts --inspect src/index.ts | pino-pretty -c -t",
"build": "tsup-node src/index.ts src/instrumentation.ts",
"lint": "tsc --noEmit && eslint \"src/**/*.ts\""
},
Expand All @@ -22,7 +22,7 @@
"@opentelemetry/exporter-prometheus": "^0.49.1",
"@opentelemetry/exporter-trace-otlp-grpc": "^0.49.1",
"@sinclair/typebox": "^0.32.16",
"fastify": "^4.26.2"
"fastify": "^5.0.0"
},
"devDependencies": {
"@basica/eslint-config": "workspace:^0.0.0",
Expand Down
Loading
Loading