Skip to content

Commit cb15fae

Browse files
authored
feat: upgrade koa to v3 (#4396)
* feat: upgrade koa to v3 * fix: lint
1 parent 93d02ef commit cb15fae

File tree

3 files changed

+68
-39
lines changed

3 files changed

+68
-39
lines changed

packages/web-koa/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@
3434
"@koa/router": "^12.0.0",
3535
"@midwayjs/cookies": "^1.3.0",
3636
"@midwayjs/session": "workspace:^",
37-
"@types/koa": "2.15.0",
37+
"@types/koa": "3.0.0",
3838
"@types/qs": "6.9.18",
39-
"koa": "2.16.2",
39+
"koa": "3.0.1",
4040
"koa-bodyparser": "4.4.1",
4141
"qs": "6.14.0"
4242
},

packages/web-koa/src/framework.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,9 @@ export class MidwayKoaFramework extends BaseFramework<
236236
async loadMidwayController() {
237237
await this.generator.loadMidwayController(newRouter => {
238238
const dispatchFn = newRouter.middleware();
239-
dispatchFn._name = `midwayController(${newRouter?.opts?.prefix || '/'})`;
239+
(dispatchFn as any)._name = `midwayController(${
240+
newRouter?.opts?.prefix || '/'
241+
})`;
240242
this.app.use(dispatchFn);
241243
});
242244
}

pnpm-lock.yaml

Lines changed: 63 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)