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/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" 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,