From 6da8a87df33a36ca861f3aa92b00704e4e290bd5 Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Tue, 10 Mar 2026 09:52:30 +0000 Subject: [PATCH 1/2] docs: clarify typed cors registration --- README.md | 2 ++ types/index.test-d.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b241243..cb2c660 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,8 @@ npm i @fastify/cors ``` +TypeScript note: `@fastify/cors` does not add Fastify decorators, so registering it preserves the existing instance, request, and reply shapes. + ### Compatibility | Plugin version | Fastify version | diff --git a/types/index.test-d.ts b/types/index.test-d.ts index 4040e66..262858a 100644 --- a/types/index.test-d.ts +++ b/types/index.test-d.ts @@ -11,7 +11,7 @@ import fastifyCors, { const app = fastify() -app.register(fastifyCors) +expectType(app.register(fastifyCors)) app.register(fastifyCors, { origin: true, From 93b9a9c9987f29a10f18133d7df67f92f4c25f88 Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Sun, 15 Mar 2026 17:41:12 +0000 Subject: [PATCH 2/2] ci: pin fastify dev dependency to typed-decorators branch --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5553632..2663da2 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "c8": "^11.0.0", "cors": "^2.8.5", "eslint": "^9.17.0", - "fastify": "^5.0.0", + "fastify": "github:fastify/fastify#feat/typed-decorators", "neostandard": "^0.12.0", "tsd": "^0.33.0", "typescript": "~5.9.2"