Skip to content

Commit b8eaf30

Browse files
committed
fix(platform-fastify): use new adapter convention introduced in v8.5.2
1 parent 9fb1683 commit b8eaf30

File tree

4 files changed

+16
-52
lines changed

4 files changed

+16
-52
lines changed

packages/platform/platform-cache/test/cache.integration.spec.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import {Controller, Inject} from "@tsed/di";
2+
// @ts-ignore
3+
import {PlatformExpress} from "@tsed/platform-express";
24
import {PlatformTest} from "@tsed/platform-http/testing";
35
import {PathParams, QueryParams} from "@tsed/platform-params";
46
import {Get, Head, Post, Property} from "@tsed/schema";
@@ -84,7 +86,7 @@ class TestCacheController {
8486
describe("Cache", () => {
8587
beforeEach(
8688
PlatformTest.bootstrap(Server, {
87-
logger: {},
89+
adapter: PlatformExpress,
8890
mount: {
8991
"/rest": [TestCacheController]
9092
},

packages/platform/platform-fastify/src/components/PlatformFastify.ts

+10-17
Original file line numberDiff line numberDiff line change
@@ -40,22 +40,6 @@ declare global {
4040

4141
export class PlatformFastify extends PlatformAdapter<FastifyInstance> {
4242
readonly NAME = "fastify";
43-
44-
readonly providers = [
45-
{
46-
token: PlatformHandler
47-
},
48-
{token: PlatformApplication},
49-
{token: Platform},
50-
{
51-
token: PlatformResponse,
52-
useClass: PlatformFastifyResponse
53-
},
54-
{
55-
token: PlatformRequest,
56-
useClass: PlatformFastifyRequest
57-
}
58-
];
5943
private staticsDecorated = false;
6044

6145
/**
@@ -358,4 +342,13 @@ export class PlatformFastify extends PlatformAdapter<FastifyInstance> {
358342
}
359343
}
360344

361-
adapter(PlatformFastify);
345+
adapter(PlatformFastify, [
346+
{
347+
token: PlatformResponse,
348+
useClass: PlatformFastifyResponse
349+
},
350+
{
351+
token: PlatformRequest,
352+
useClass: PlatformFastifyRequest
353+
}
354+
]);

packages/platform/platform-koa/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
"@types/koa-session": "6.4.5",
7676
"@types/koa__router": "12.0.4",
7777
"eslint": "9.12.0",
78-
"koa": "2.15.4",
78+
"koa": "2.15.3",
7979
"koa-bodyparser": "4.4.1",
8080
"koa-compress": "5.1.1",
8181
"koa-override": "4.0.0",

yarn.lock

+2-33
Original file line numberDiff line numberDiff line change
@@ -8043,7 +8043,7 @@ __metadata:
80438043
"@types/koa__router": "npm:12.0.4"
80448044
encodeurl: "npm:^2.0.0"
80458045
eslint: "npm:9.12.0"
8046-
koa: "npm:2.15.4"
8046+
koa: "npm:2.15.3"
80478047
koa-bodyparser: "npm:4.4.1"
80488048
koa-compress: "npm:5.1.1"
80498049
koa-override: "npm:4.0.0"
@@ -20497,38 +20497,7 @@ __metadata:
2049720497
languageName: node
2049820498
linkType: hard
2049920499

20500-
"koa@npm:2.15.4":
20501-
version: 2.15.4
20502-
resolution: "koa@npm:2.15.4"
20503-
dependencies:
20504-
accepts: "npm:^1.3.5"
20505-
cache-content-type: "npm:^1.0.0"
20506-
content-disposition: "npm:~0.5.2"
20507-
content-type: "npm:^1.0.4"
20508-
cookies: "npm:~0.9.0"
20509-
debug: "npm:^4.3.2"
20510-
delegates: "npm:^1.0.0"
20511-
depd: "npm:^2.0.0"
20512-
destroy: "npm:^1.0.4"
20513-
encodeurl: "npm:^1.0.2"
20514-
escape-html: "npm:^1.0.3"
20515-
fresh: "npm:~0.5.2"
20516-
http-assert: "npm:^1.3.0"
20517-
http-errors: "npm:^1.6.3"
20518-
is-generator-function: "npm:^1.0.7"
20519-
koa-compose: "npm:^4.1.0"
20520-
koa-convert: "npm:^2.0.0"
20521-
on-finished: "npm:^2.3.0"
20522-
only: "npm:~0.0.2"
20523-
parseurl: "npm:^1.3.2"
20524-
statuses: "npm:^1.5.0"
20525-
type-is: "npm:^1.6.16"
20526-
vary: "npm:^1.1.2"
20527-
checksum: 10/98de77173822f0a28c0f5d1ebd261ab02f3f905d40602e51957a0c7202122647a60c5b6c59be03361dd24bf6a5685eac97af84b306914efd057751e71f93cb0f
20528-
languageName: node
20529-
linkType: hard
20530-
20531-
"koa@npm:^2.15.3":
20500+
"koa@npm:2.15.3, koa@npm:^2.15.3":
2053220501
version: 2.15.3
2053320502
resolution: "koa@npm:2.15.3"
2053420503
dependencies:

0 commit comments

Comments
 (0)