Commit cf43c295 authored by nanahira's avatar nanahira

bump and tmp workaround

parent abbf17a3
This diff is collapsed.
...@@ -33,14 +33,14 @@ ...@@ -33,14 +33,14 @@
"peerDependencies": { "peerDependencies": {
"@nestjs/common": "^9.0.3 || ^8.0.0", "@nestjs/common": "^9.0.3 || ^8.0.0",
"@nestjs/core": "^9.0.3 || ^8.0.0", "@nestjs/core": "^9.0.3 || ^8.0.0",
"koishi": "^4.9.4", "koishi": "^4.9.7",
"rxjs": "^7.5.5" "rxjs": "^7.5.5"
}, },
"devDependencies": { "devDependencies": {
"@nestjs/platform-express": "^9.0.3", "@nestjs/platform-express": "^9.0.3",
"@nestjs/platform-fastify": "^9.0.3", "@nestjs/platform-fastify": "^9.0.3",
"@nestjs/testing": "^9.0.3", "@nestjs/testing": "^9.0.3",
"@types/jest": "^27.0.3", "@types/jest": "^29.2.0",
"@types/koa": "^2.13.4", "@types/koa": "^2.13.4",
"@types/koa-bodyparser": "^4.3.7", "@types/koa-bodyparser": "^4.3.7",
"@types/lodash": "^4.14.175", "@types/lodash": "^4.14.175",
...@@ -52,12 +52,12 @@ ...@@ -52,12 +52,12 @@
"eslint-config-prettier": "^8.3.0", "eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^3.4.1", "eslint-plugin-prettier": "^3.4.1",
"express": "^4.17.1", "express": "^4.17.1",
"jest": "^27.4.4", "jest": "^29.2.2",
"prettier": "^2.4.1", "prettier": "^2.4.1",
"reflect-metadata": "^0.1.13", "reflect-metadata": "^0.1.13",
"rimraf": "^3.0.2", "rimraf": "^3.0.2",
"supertest": "^6.1.6", "supertest": "^6.1.6",
"ts-jest": "^27.1.1", "ts-jest": "^29.0.3",
"typescript": "^4.8.2" "typescript": "^4.8.2"
}, },
"dependencies": { "dependencies": {
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
"@types/ws": "^8.5.3", "@types/ws": "^8.5.3",
"koa": "^2.13.4", "koa": "^2.13.4",
"koa-bodyparser": "^4.3.0", "koa-bodyparser": "^4.3.0",
"koishi-thirdeye": "^11.1.3", "koishi-thirdeye": "^11.1.5",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"typed-reflector": "^1.0.11", "typed-reflector": "^1.0.11",
"ws": "^8.7.0" "ws": "^8.7.0"
......
...@@ -62,9 +62,10 @@ export class KoishiService ...@@ -62,9 +62,10 @@ export class KoishiService
this.router._http = httpServer; this.router._http = httpServer;
} else { } else {
this.logger('app').info('No http adapters found from Nest application.'); this.logger('app').info('No http adapters found from Nest application.');
this.router._http = createServer(this._nestKoaTmpInstance.callback()); const tmpServer = createServer(this._nestKoaTmpInstance.callback());
this.router._http = tmpServer;
this.router._ws = new WebSocket.Server({ this.router._ws = new WebSocket.Server({
server: this.router._http, server: tmpServer,
}); });
this.router._ws.on('connection', (socket, request) => { this.router._ws.on('connection', (socket, request) => {
......
...@@ -22,9 +22,11 @@ export class KoishiContextService { ...@@ -22,9 +22,11 @@ export class KoishiContextService {
} }
} }
getModuleCtx(ctx: Context, module: Module) { getModuleCtx(ctx: Context, module: Module): Context {
const moduleSelection = this.moduleSelections.get(module.metatype); const moduleSelection = this.moduleSelections.get(module.metatype);
if (moduleSelection) { if (moduleSelection) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
return selectContext(ctx, moduleSelection); return selectContext(ctx, moduleSelection);
} else { } else {
return ctx; return ctx;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment