-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: don't override koa Middleware type #271
Conversation
WalkthroughThe changes introduce a GitHub Actions workflow for building and publishing the project upon commits and pull requests. Key dependency versions in Changes
Sequence Diagram(s)sequenceDiagram
participant Developer
participant GitHub
participant GitHubActions as GitHub Actions
participant EggApp as Egg Application
Developer->>GitHub: Push Code/PR
GitHub->>GitHubActions: Trigger Workflow
GitHubActions->>EggApp: Install Dependencies, Build, and Publish
EggApp-->>GitHubActions: Execution Results
GitHubActions-->>GitHub: Report Status
GitHub-->>Developer: Notify Success/Failure
Poem
Tip Early access features: enabledWe are currently testing the following features in early access:
Note:
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Run & review this pull request in StackBlitz Codeflow. commit: @eggjs/core
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #271 +/- ##
==========================================
- Coverage 93.01% 92.99% -0.02%
==========================================
Files 10 10
Lines 3249 3241 -8
Branches 508 508
==========================================
- Hits 3022 3014 -8
Misses 227 227 ☔ View full report in Codecov by Sentry. |
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: npm/eslint-config-egg@13.1.0, npm/urllib@3.26.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- .github/workflows/pkg.pr.new.yml (1 hunks)
- package.json (2 hunks)
- src/egg.ts (3 hunks)
- src/loader/egg_loader.ts (3 hunks)
Files skipped from review due to trivial changes (2)
- .github/workflows/pkg.pr.new.yml
- package.json
Additional context used
Biome
src/egg.ts
[error] 324-324: The assignment should not be in an expression.
The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.(lint/suspicious/noAssignInExpressions)
src/loader/egg_loader.ts
[error] 130-130: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
[error] 803-803: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
[error] 804-804: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
[error] 1578-1582: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
[error] 1640-1641: Do not access Object.prototype method 'hasOwnProperty' from target object.
It's recommended using Object.hasOwn() instead of using Object.hasOwnProperty().
See MDN web docs for more details.(lint/suspicious/noPrototypeBuiltins)
GitHub Check: codecov/patch
src/loader/egg_loader.ts
[warning] 1613-1613: src/loader/egg_loader.ts#L1613
Added line #L1613 was not covered by tests
Additional comments not posted (4)
src/egg.ts (2)
31-31
: Verify necessity of exportingMiddlewareFunc
.Ensure that
MiddlewareFunc
needs to be exported and is used correctly throughout the codebase.Verification successful
Verified necessity of exporting
MiddlewareFunc
.The
MiddlewareFunc
type is used extensively throughout the codebase, confirming that its export is necessary.
src/egg.ts
src/loader/egg_loader.ts
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the necessity of exporting `MiddlewareFunc`. # Test: Search for the usage of `MiddlewareFunc`. Expect: Instances where `MiddlewareFunc` is used and needs to be exported. rg --type-add 'ts' --type-add 'tsx' 'MiddlewareFunc' --glob '!node_modules/*'Length of output: 133
Script:
#!/bin/bash # Description: Verify the necessity of exporting `MiddlewareFunc`. # Test: Search for the usage of `MiddlewareFunc`. Expect: Instances where `MiddlewareFunc` is used and needs to be exported. rg --type-add 'ts:*.ts' --type-add 'tsx:*.tsx' 'MiddlewareFunc' --glob '!node_modules/*'Length of output: 3578
6-6
: Verify consistency of type import change.Ensure that all instances of
Next
have been correctly replaced withMiddlewareFunc
across the codebase to maintain consistency.src/loader/egg_loader.ts (2)
1604-1606
: Verify correctness ofwrapMiddleware
function change.Ensure that the
wrapMiddleware
function correctly usesMiddlewareFunc
and that all references to middleware functions are consistent.Verification successful
The
wrapMiddleware
function correctly usesMiddlewareFunc
and is consistent with the rest of the codebase.
src/loader/egg_loader.ts
: Lines involvingwrapMiddleware
andMiddlewareFunc
are consistent with the overall usage.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the correctness of the `wrapMiddleware` function change. # Test: Search for the usage of `wrapMiddleware` and `MiddlewareFunc`. Expect: Consistent usage of `MiddlewareFunc`. rg --type-add 'ts' --type-add 'tsx' 'wrapMiddleware|MiddlewareFunc' --glob '!node_modules/*'Length of output: 150
Script:
#!/bin/bash # Description: Verify the correctness of the `wrapMiddleware` function change. # Test: Search for the usage of `wrapMiddleware` and `MiddlewareFunc`. Expect: Consistent usage of `MiddlewareFunc`. rg 'wrapMiddleware|MiddlewareFunc' --glob '!node_modules/*'Length of output: 3616
Line range hint
1613-1618
: Verify correctness ofdebugMiddlewareWrapper
function change.Ensure that the
debugMiddlewareWrapper
function correctly usesMiddlewareFunc
and that all references to middleware functions are consistent.Verification successful
Verification successful:
debugMiddlewareWrapper
function change is consistentThe
debugMiddlewareWrapper
function correctly usesMiddlewareFunc
, and all references to middleware functions are consistent across the codebase.
- References to
MiddlewareFunc
anddebugMiddlewareWrapper
are consistent and correctly implemented.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the correctness of the `debugMiddlewareWrapper` function change. # Test: Search for the usage of `debugMiddlewareWrapper` and `MiddlewareFunc`. Expect: Consistent usage of `MiddlewareFunc`. rg --type-add 'ts' --type-add 'tsx' 'debugMiddlewareWrapper|MiddlewareFunc' --glob '!node_modules/*'Length of output: 158
Script:
#!/bin/bash # Description: Verify the correctness of the `debugMiddlewareWrapper` function change. # Test: Search for the usage of `debugMiddlewareWrapper` and `MiddlewareFunc`. Expect: Consistent usage of `MiddlewareFunc`. rg --type-add 'ts:*.ts' --type-add 'tsx:*.tsx' 'debugMiddlewareWrapper|MiddlewareFunc' --glob '!node_modules/*'Length of output: 3930
Tools
GitHub Check: codecov/patch
[warning] 1613-1613: src/loader/egg_loader.ts#L1613
Added line #L1613 was not covered by tests
[skip ci] ## [6.0.2](v6.0.1...v6.0.2) (2024-06-30) ### Bug Fixes * don't override koa Middleware type ([#271](#271)) ([1facf82](1facf82))
Summary by CodeRabbit
New Features
Updates
eslint-config-egg
to version 14.urllib
to version 4.Refactor