Skip to content

Commit

Permalink
fix: remove response template context (#285)
Browse files Browse the repository at this point in the history
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Dependency Update**
  - Upgraded `@eggjs/koa` package from version `^2.20.3` to `^2.20.6`

- **Type System Refinements**
  - Simplified `Response` class type definition
- Updated `MiddlewareFunc` type to provide more flexible generic type
handling

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
fengmk2 authored Jan 2, 2025
1 parent 829d5b8 commit 84dc3b3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
},
"homepage": "https://github.com/eggjs/core#readme",
"dependencies": {
"@eggjs/koa": "^2.20.3",
"@eggjs/koa": "^2.20.6",
"@eggjs/router": "^3.0.5",
"@eggjs/utils": "^4.1.5",
"egg-logger": "^3.5.0",
Expand Down
4 changes: 2 additions & 2 deletions src/egg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class Request extends KoaRequest {
declare response: Response;
}

export class Response extends KoaResponse<Context> {
export class Response extends KoaResponse {
declare app: EggCore;
declare request: Request;
}
Expand All @@ -63,7 +63,7 @@ export class Context extends KoaContext {
}

// export @eggjs/core types
export type MiddlewareFunc<T extends Context = Context> = KoaMiddlewareFunc<T>;
export type MiddlewareFunc<T = Context> = KoaMiddlewareFunc<T>;

export class EggCore extends KoaApplication {
options: EggCoreOptions;
Expand Down

0 comments on commit 84dc3b3

Please sign in to comment.