-
Notifications
You must be signed in to change notification settings - Fork 60
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
feat: support cjs and esm both by tshy #33
Conversation
BREAKING CHANGE: drop Node.js < 18.19.0 support and only support egg>=4 part of eggjs/egg#3644 eggjs/egg#5257
Caution Review failedThe pull request is closed. WalkthroughThis update removes legacy ESLint and boot hook configurations and introduces a new lint configuration file. The GitHub Actions workflow is adjusted to support Node.js versions 18, 20, and 22. Documentation and package metadata have been updated to reflect the new package name (@eggjs/mysql) and revised API usage. The MySQL integration is restructured with new boot hook and configuration files under the src directory, along with updated TypeScript type extensions. Test fixtures and Docker Compose configurations have also been modified to align with the new asynchronous initialization and overall project restructuring. Changes
Sequence Diagram(s)sequenceDiagram
participant App as Egg Application
participant Boot as MySQLBootHook
participant Client as RDSClient
App->>Boot: Invoke configDidLoad()
Boot->>Client: createMySQLClient(config)
Client-->>Boot: Return MySQL client instance
Boot->>App: Register client as singleton (app.mysql & app.mysqls)
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (22)
✨ Finishing Touches
🪧 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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Pull Request Overview
This PR introduces support for both CommonJS and ESM modules while dropping Node.js versions below 18.19.0 and updating the plugin to support Egg.js version 4 and above. Key changes include:
- A new MySQL boot hook that manages client initialization and logging.
- Updated type definitions and documentation to reflect the new singleton interface.
- Removal of legacy bootstrap files and updates to Docker and CI configurations.
Reviewed Changes
Copilot reviewed 25 out of 29 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
src/boot.ts | Adds a new boot hook to initialize MySQL clients with improved logging. |
src/app.ts | Re-exports the boot hook using ESM conventions. |
docker-compose.yml | Introduces a development MySQL service for local testing. |
src/types.ts | Updates TypeScript module augmentation for Egg.js to include the new singleton types. |
README.md, README.zh-CN.md | Updates documentation, installation instructions, and usage examples. |
Test fixtures and workflow files | Update client initialization and remove legacy bootstrap files. |
Files not reviewed (4)
- .eslintignore: Language not supported
- .eslintrc: Language not supported
- .oxlintrc.json: Language not supported
- package.json: Language not supported
should add a typescript test case |
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: 2
🔭 Outside diff range comments (1)
.oxlintrc.json (1)
1-143
:⚠️ Potential issueInvalid JSON syntax due to comments.
This file is intended to be valid JSON, but it contains single-line comments (
// ...
). JSON does not support comments, leading to parse errors in many tools. Consider removing or converting these comments and, if needed, renaming to a format that supports comments (e.g.,.js
or.jsonc
). Below is an example illustrating removal of comments at two locations; repeat similarly across the file for all//
lines:- // eslint "constructor-super": "error", ... - // maybe warn "no-console": "warn", ...🧰 Tools
🪛 Biome (1.9.4)
[error] 26-26: Expected a property but instead found '// eslint'.
Expected a property here.
(parse)
[error] 27-27: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 27-27: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 27-27: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 27-27: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 28-28: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 28-28: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 28-28: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 28-28: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 29-29: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 29-29: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 29-29: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 29-29: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 30-30: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 30-30: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 30-30: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 30-30: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 31-31: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 31-31: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 31-31: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 31-31: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 32-32: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 32-32: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 32-32: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 32-32: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 33-33: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 33-33: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 33-33: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 33-33: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 34-34: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 34-34: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 34-34: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 34-34: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 35-35: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 35-35: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 35-35: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 35-35: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 36-36: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 36-36: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 36-36: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 36-36: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 37-37: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 37-37: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 37-37: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 37-37: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 38-38: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 38-38: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 38-38: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 38-38: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 39-39: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 39-39: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 39-39: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 39-39: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 40-40: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 40-40: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 40-40: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 40-40: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 41-41: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 41-41: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 41-41: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 41-41: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 42-42: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 42-42: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 42-42: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 42-42: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 43-43: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 43-43: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 43-43: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 43-43: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 44-44: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 44-44: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 44-44: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 44-44: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 45-45: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 45-45: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 45-45: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 45-45: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 46-46: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 46-46: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 46-46: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 46-46: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 47-47: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 47-47: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 47-47: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 47-47: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 48-48: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 48-48: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 48-48: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 48-48: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 49-49: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 49-49: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 49-49: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 49-49: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 50-50: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 50-50: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 50-50: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 50-50: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 51-51: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 51-51: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 51-51: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 51-51: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 52-52: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 52-52: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 52-52: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 52-52: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 53-53: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 53-53: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 53-53: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 53-54: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 55-55: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 55-55: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 55-55: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 55-55: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 56-56: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 56-56: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 56-56: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 56-56: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 57-57: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 57-57: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 57-57: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 57-57: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 58-58: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 58-58: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 58-58: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 58-58: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 59-59: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 59-59: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 59-59: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 59-59: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 60-60: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 60-60: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 60-60: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 60-60: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 61-61: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 61-61: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 61-61: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 61-61: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 62-62: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 62-62: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 62-62: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 62-62: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 63-63: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 63-63: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 63-63: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 63-63: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 64-64: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 64-64: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 64-64: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 64-64: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 65-65: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 65-65: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 65-65: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 65-65: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 66-66: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 66-66: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 66-66: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 66-66: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 67-67: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 67-67: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 67-67: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 67-67: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 68-68: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 68-68: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 68-68: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 68-70: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 71-71: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 71-71: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 71-71: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 71-71: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 72-72: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 72-72: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 72-72: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 72-72: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 73-73: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 73-73: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 73-73: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 73-73: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 74-74: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 74-74: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 74-74: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 74-74: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 75-75: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 75-75: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 75-75: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 75-75: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 76-76: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 76-76: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 76-76: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 76-76: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 77-77: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 77-77: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 77-77: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 77-77: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 78-78: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 78-78: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 78-78: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 78-78: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 79-79: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 79-79: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 79-79: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 79-81: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 82-82: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 82-82: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 82-82: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 82-82: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 83-83: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 83-83: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 83-83: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 83-83: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 84-84: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 84-84: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 84-84: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 84-84: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 85-85: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 85-85: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 85-85: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 85-85: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 86-86: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 86-86: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 86-86: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 86-86: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 87-87: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 87-87: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 87-87: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 87-87: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 88-88: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 88-88: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 88-88: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 88-90: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 91-91: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 91-91: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 91-91: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 91-91: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 92-92: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 92-92: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 92-92: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 92-92: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 93-93: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 93-93: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 93-93: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 93-93: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 94-94: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 94-94: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 94-94: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 94-94: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 95-95: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 95-95: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 95-95: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 95-95: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 96-96: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 96-96: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 96-96: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 96-96: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 97-97: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 97-97: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 97-97: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 97-97: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 98-98: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 98-98: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 98-98: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 98-99: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 100-100: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 100-100: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 100-100: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 100-100: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 101-101: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 101-101: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 101-101: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 101-101: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 102-102: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 102-102: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 102-102: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 102-102: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 103-103: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 103-103: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 103-103: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 103-103: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 104-104: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 104-104: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 104-104: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 104-104: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 105-105: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 105-105: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 105-105: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 105-105: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 106-106: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 106-106: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 106-106: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 106-106: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 107-107: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 107-107: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 107-107: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 107-107: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 108-108: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 108-108: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 108-108: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 108-108: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 109-109: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 109-109: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 109-109: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 109-109: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 110-110: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 110-110: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 110-110: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 110-110: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 111-111: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 111-111: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 111-111: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 111-111: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 112-112: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 112-112: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 112-112: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 112-112: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 113-113: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 113-113: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 113-113: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 113-113: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 114-114: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 114-114: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 114-114: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 114-116: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 117-117: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 117-117: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 117-117: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 117-117: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 118-118: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 118-118: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 118-118: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 118-118: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 119-119: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 119-119: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 119-119: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 119-119: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 120-120: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 120-120: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 120-120: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 120-122: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 123-123: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 123-123: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 123-123: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 123-123: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 124-124: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 124-124: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 124-124: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 124-124: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 125-125: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 125-125: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 125-125: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 125-125: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 126-126: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 126-126: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 126-126: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 126-126: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 127-127: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 127-127: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 127-127: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 127-127: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 128-128: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 128-128: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 128-128: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 128-128: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 129-129: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 129-129: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 129-129: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 129-129: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 130-130: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 130-130: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 130-130: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 130-130: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 131-131: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 131-131: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 131-131: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 131-131: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 132-132: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 132-132: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 132-132: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 132-132: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 133-133: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 133-133: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 133-133: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 133-133: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 134-134: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 134-134: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 134-134: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 134-134: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 135-135: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 135-135: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 135-135: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 135-137: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 138-138: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 138-138: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 138-138: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 138-138: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 139-139: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 139-139: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 139-139: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 140-140: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 141-141: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 141-141: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 141-141: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
[error] 141-142: End of file expected
Use an array for a sequence of values:
[1, 2]
(parse)
♻️ Duplicate comments (1)
docker-compose.yml (1)
5-5
:⚠️ Potential issueThe Docker image tag 'mysql:9' may not correspond to an official MySQL release.
The MySQL version specified may not exist as an official Docker image. MySQL's latest major version is 8.x.
- image: mysql:9 + image: mysql:8
🧹 Nitpick comments (12)
.github/workflows/nodejs.yml (1)
15-15
: Update Node.js Version Specification
The version line now specifies'18, 20, 22'
, which aligns with the breaking change of dropping support for earlier Node.js versions. Please verify that specifying18
indeed uses a runtime version at or above 18.19.0, as required by the PR.test/fixtures/apps/mysqlapp-ts-esm/app/service/user.ts (1)
1-7
:❓ Verification inconclusive
Improve error handling and add type definitions.
The service method correctly retrieves data from the MySQL database, but it lacks error handling and type definitions. Additionally, using
return await
is unnecessary unless you're using a try-catch block.Consider refactoring the code as follows:
import type { Context } from 'egg'; +interface User { + // Define your user fields here +} export default class UserService { - async list(ctx: Context) { - return await ctx.app.mysql.query('select * from npm_auth'); + async list(ctx: Context): Promise<User[]> { + try { + return await ctx.app.mysql.query('select * from npm_auth'); + } catch (error) { + ctx.logger.error('[UserService] list error', error); + throw error; + } } }Consider adding pagination to the query if the
npm_auth
table could potentially contain a large number of records:
🏁 Script executed:
#!/bin/bash # Check if the npm_auth table might have a large number of records rg -A 3 -B 3 "INSERT INTO.*npm_auth" --glob="*.sql"Length of output: 53
Action: Review and Confirm Error Handling and Pagination in UserService
The proposed improvements to add a try/catch block, proper error logging, and precise type definitions for the returned data are solid. In addition, the suggestion to remove the unnecessary
return await
has merit when not wrapping the call in error handling.However, our initial script intended to verify if the
npm_auth
table might contain many records (and thus warrant pagination) did not return any output. To ensure confidence:
- Please manually verify whether the
npm_auth
table is expected to have a large number of records that would benefit from pagination.If pagination is confirmed as necessary, consider altering the query to include limit/offset parameters.
docker-compose.yml (1)
7-9
: Consider using separate environment variables for security settings.While empty passwords are acceptable for development/testing, it's a good practice to separate security settings from other configurations.
- MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-} - MYSQL_ALLOW_EMPTY_PASSWORD: yes + # For development only, use a secure password in production + MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-root} + MYSQL_ALLOW_EMPTY_PASSWORD: ${MYSQL_ALLOW_EMPTY_PASSWORD:-yes}test/fixtures/apps/mysqlapp-ts-esm/agent.ts (1)
12-18
: Add error handling for database operations.The
didReady
method performs file operations and a database query without explicit error handling. If any operation fails, it could affect the agent's startup process.async didReady() { const p = path.join(this.agent.baseDir, 'run/agent_result.json'); - await fs.rm(p, { force: true }); + try { + await fs.rm(p, { force: true }); - const result = await this.agent.mysql.query('select now() as currentTime;'); - await fs.writeFile(p, JSON.stringify(result)); + const result = await this.agent.mysql.query('select now() as currentTime;'); + await fs.writeFile(p, JSON.stringify(result)); + this.agent.logger.info('[agent] Successfully wrote agent_result.json'); + } catch (error) { + this.agent.logger.error('[agent] Failed to write agent_result.json', error); + } }test/fixtures/apps/mysqlapp-dynamic/app.js (2)
1-4
: Consider adding inline documentation for maintainability.
Defining the Boot class and constructor is clear, but adding a brief docstring or comment about its purpose can help future maintainers quickly grasp how this fixture integrates with the overall app lifecycle.
6-8
: Handle potential errors when creating the MySQL instance.
As this is an asynchronous operation, consider adding a try/catch block or a fallback mechanism to gracefully handle errors, especially if the MySQL configuration is missing or the connection fails.async didReady() { - this.app.mysql1 = await this.app.mysql.createInstanceAsync(this.app.config.mysql1); + try { + this.app.mysql1 = await this.app.mysql.createInstanceAsync(this.app.config.mysql1); + } catch (err) { + this.app.logger.warn('[mysqlapp-dynamic] Failed to create mysql1 instance:', err); + } }test/fixtures/apps/mysqlapp-new/agent.js (1)
9-15
: Consider adding error handling for the MySQL query.
A try/catch block or fallback mechanism can improve resilience if the database is unreachable or misconfigured.async didReady() { const p = path.join(__dirname, 'run/agent_result.json'); fs.existsSync(p) && fs.unlinkSync(p); - const result = await this.agent.mysql.query('select now() as currentTime;'); + let result; + try { + result = await this.agent.mysql.query('select now() as currentTime;'); + } catch (err) { + this.agent.logger.error('[mysqlapp-new] MySQL query failed:', err); + result = { error: err.message }; + } fs.writeFileSync(p, JSON.stringify(result)); }test/fixtures/apps/mysqlapp/agent.js (1)
9-15
: Add error handling for the MySQL query.Currently, if the query fails, the error is neither caught nor logged. Consider wrapping it in a try/catch block to ensure issues are properly handled and logged:
async didReady() { const p = path.join(__dirname, 'run/agent_result.json'); fs.existsSync(p) && fs.unlinkSync(p); - const result = await this.agent.mysql.query('select now() as currentTime;'); - fs.writeFileSync(p, JSON.stringify(result)); + try { + const result = await this.agent.mysql.query('select now() as currentTime;'); + fs.writeFileSync(p, JSON.stringify(result)); + } catch (err) { + this.agent.logger.error('Error running MySQL query:', err); + } }test/fixtures/apps/mysqlapp-dynamic/agent.js (1)
9-16
: Add error handling for asynchronous MySQL creation and queries.Here, if
createInstanceAsync
or thequery
call fails, no error is caught or logged. To improve reliability, safely handle potential failures:async didReady() { this.agent.mysql1 = await this.agent.mysql.createInstanceAsync(this.agent.config.mysql1); const p = path.join(__dirname, 'run/agent_result.json'); fs.existsSync(p) && fs.unlinkSync(p); - const result = await this.agent.mysql1.query('select now() as currentTime;'); - fs.writeFileSync(p, JSON.stringify(result)); + try { + const result = await this.agent.mysql1.query('select now() as currentTime;'); + fs.writeFileSync(p, JSON.stringify(result)); + } catch (err) { + this.agent.logger.error('Error initializing MySQL or running query:', err); + } }src/boot.ts (1)
21-36
: Optional: consider refining property definition formysqls
.By default,
Reflect.defineProperty
creates a non-enumerable, non-configurable property. If you want to safeguard against accidental redefinition or iteration issues, ensure you've set the descriptor flags (enumerable
,configurable
) explicitly based on your usage requirements.README.md (2)
26-26
: Fix grammar for clarity.Use “supporting” to align with the subject.
- MySQL Plugin for `egg@4`, support egg application access to MySQL database. + MySQL Plugin for `egg@4`, supporting Egg applications to access the MySQL database.🧰 Tools
🪛 LanguageTool
[uncategorized] ~26-~26: This verb does not appear to agree with the subject. Consider using a different form.
Context: ...js/mysql ``` MySQL Plugin foregg@4
, support egg application access to MySQL databas...(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)
262-262
: Minor grammatical update suggested.Improve the label to read more naturally:
- Stop test mysql service + Stop the test MySQL service🧰 Tools
🪛 LanguageTool
[uncategorized] ~262-~262: This verb may not be in the correct form. Consider using a different form for this context.
Context: ... unit testsbash npm test
Stop test mysql service ```bash docker compose -...(AI_EN_LECTOR_REPLACEMENT_VERB_FORM)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (39)
.eslintignore
(0 hunks).eslintrc
(0 hunks).github/workflows/nodejs.yml
(1 hunks).oxlintrc.json
(1 hunks)README.md
(5 hunks)README.zh-CN.md
(7 hunks)__snapshots__/mysql.test.ts.js
(1 hunks)agent.ts
(0 hunks)app.ts
(0 hunks)docker-compose.yml
(1 hunks)index.d.ts
(0 hunks)index.test-d.ts
(0 hunks)lib/mysql.ts
(0 hunks)package.json
(1 hunks)src/agent.ts
(1 hunks)src/app.ts
(1 hunks)src/boot.ts
(1 hunks)src/config/config.default.ts
(2 hunks)src/index.ts
(1 hunks)src/types.ts
(1 hunks)src/typings/index.d.ts
(1 hunks)test/esm.test.ts
(1 hunks)test/fixtures/apps/mysqlapp-dynamic/agent.js
(1 hunks)test/fixtures/apps/mysqlapp-dynamic/app.js
(1 hunks)test/fixtures/apps/mysqlapp-dynamic/app/router.js
(1 hunks)test/fixtures/apps/mysqlapp-new/agent.js
(1 hunks)test/fixtures/apps/mysqlapp-new/app/router.js
(1 hunks)test/fixtures/apps/mysqlapp-ts-esm/agent.ts
(1 hunks)test/fixtures/apps/mysqlapp-ts-esm/app/controller/home.ts
(1 hunks)test/fixtures/apps/mysqlapp-ts-esm/app/router.ts
(1 hunks)test/fixtures/apps/mysqlapp-ts-esm/app/service/user.ts
(1 hunks)test/fixtures/apps/mysqlapp-ts-esm/config/config.ts
(1 hunks)test/fixtures/apps/mysqlapp-ts-esm/package.json
(1 hunks)test/fixtures/apps/mysqlapp-ts-esm/tsconfig.json
(1 hunks)test/fixtures/apps/mysqlapp-ts-esm/typings/index.d.ts
(1 hunks)test/fixtures/apps/mysqlapp/agent.js
(1 hunks)test/fixtures/apps/mysqlapp/app/router.js
(1 hunks)test/mysql.test.ts
(8 hunks)tsconfig.json
(1 hunks)
💤 Files with no reviewable changes (7)
- .eslintrc
- agent.ts
- .eslintignore
- index.test-d.ts
- app.ts
- lib/mysql.ts
- index.d.ts
🧰 Additional context used
🧬 Code Definitions (8)
src/app.ts (1)
src/boot.ts (1)
MySQLBootHook
(15-37)
test/fixtures/apps/mysqlapp-ts-esm/app/service/user.ts (1)
test/fixtures/apps/mysqlapp-ts-esm/app/controller/home.ts (1)
ctx
(3-10)
src/types.ts (1)
src/config/config.default.ts (1)
MySQLConfig
(9-27)
src/agent.ts (1)
src/boot.ts (1)
MySQLBootHook
(15-37)
test/esm.test.ts (1)
test/fixtures/apps/mysqlapp-ts-esm/app/router.ts (1)
app
(3-5)
test/fixtures/apps/mysqlapp/agent.js (2)
test/fixtures/apps/mysqlapp-dynamic/agent.js (4)
fs
(1-1)path
(2-2)p
(11-11)result
(14-14)test/fixtures/apps/mysqlapp-new/agent.js (4)
fs
(1-1)path
(2-2)p
(10-10)result
(13-13)
test/fixtures/apps/mysqlapp-new/agent.js (2)
test/fixtures/apps/mysqlapp-dynamic/agent.js (4)
fs
(1-1)path
(2-2)p
(11-11)result
(14-14)test/fixtures/apps/mysqlapp/agent.js (4)
fs
(1-1)path
(2-2)p
(10-10)result
(13-13)
test/fixtures/apps/mysqlapp-dynamic/agent.js (2)
test/fixtures/apps/mysqlapp-new/agent.js (4)
fs
(1-1)path
(2-2)p
(10-10)result
(13-13)test/fixtures/apps/mysqlapp/agent.js (4)
fs
(1-1)path
(2-2)p
(10-10)result
(13-13)
🪛 Biome (1.9.4)
.oxlintrc.json
[error] 26-26: Expected a property but instead found '// eslint'.
Expected a property here.
(parse)
[error] 27-27: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 27-27: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 27-27: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 27-27: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 28-28: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 28-28: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 28-28: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 28-28: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 29-29: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 29-29: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 29-29: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 29-29: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 30-30: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 30-30: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 30-30: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 30-30: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 31-31: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 31-31: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 31-31: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 31-31: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 32-32: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 32-32: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 32-32: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 32-32: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 33-33: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 33-33: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 33-33: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 33-33: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 34-34: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 34-34: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 34-34: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 34-34: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 35-35: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 35-35: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 35-35: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 35-35: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 36-36: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 36-36: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 36-36: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 36-36: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 37-37: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 37-37: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 37-37: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 37-37: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 38-38: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 38-38: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 38-38: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 38-38: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 39-39: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 39-39: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 39-39: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 39-39: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 40-40: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 40-40: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 40-40: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 40-40: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 41-41: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 41-41: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 41-41: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 41-41: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 42-42: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 42-42: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 42-42: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 42-42: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 43-43: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 43-43: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 43-43: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 43-43: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 44-44: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 44-44: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 44-44: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 44-44: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 45-45: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 45-45: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 45-45: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 45-45: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 46-46: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 46-46: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 46-46: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 46-46: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 47-47: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 47-47: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 47-47: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 47-47: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 48-48: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 48-48: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 48-48: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 48-48: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 49-49: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 49-49: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 49-49: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 49-49: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 50-50: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 50-50: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 50-50: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 50-50: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 51-51: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 51-51: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 51-51: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 51-51: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 52-52: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 52-52: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 52-52: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 52-52: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 53-53: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 53-53: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 53-53: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 53-54: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 55-55: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 55-55: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 55-55: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 55-55: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 56-56: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 56-56: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 56-56: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 56-56: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 57-57: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 57-57: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 57-57: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 57-57: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 58-58: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 58-58: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 58-58: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 58-58: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 59-59: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 59-59: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 59-59: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 59-59: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 60-60: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 60-60: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 60-60: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 60-60: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 61-61: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 61-61: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 61-61: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 61-61: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 62-62: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 62-62: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 62-62: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 62-62: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 63-63: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 63-63: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 63-63: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 63-63: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 64-64: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 64-64: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 64-64: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 64-64: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 65-65: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 65-65: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 65-65: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 65-65: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 66-66: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 66-66: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 66-66: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 66-66: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 67-67: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 67-67: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 67-67: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 67-67: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 68-68: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 68-68: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 68-68: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 68-70: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 71-71: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 71-71: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 71-71: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 71-71: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 72-72: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 72-72: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 72-72: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 72-72: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 73-73: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 73-73: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 73-73: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 73-73: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 74-74: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 74-74: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 74-74: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 74-74: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 75-75: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 75-75: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 75-75: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 75-75: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 76-76: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 76-76: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 76-76: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 76-76: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 77-77: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 77-77: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 77-77: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 77-77: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 78-78: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 78-78: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 78-78: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 78-78: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 79-79: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 79-79: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 79-79: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 79-81: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 82-82: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 82-82: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 82-82: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 82-82: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 83-83: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 83-83: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 83-83: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 83-83: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 84-84: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 84-84: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 84-84: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 84-84: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 85-85: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 85-85: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 85-85: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 85-85: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 86-86: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 86-86: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 86-86: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 86-86: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 87-87: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 87-87: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 87-87: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 87-87: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 88-88: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 88-88: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 88-88: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 88-90: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 91-91: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 91-91: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 91-91: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 91-91: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 92-92: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 92-92: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 92-92: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 92-92: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 93-93: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 93-93: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 93-93: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 93-93: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 94-94: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 94-94: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 94-94: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 94-94: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 95-95: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 95-95: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 95-95: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 95-95: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 96-96: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 96-96: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 96-96: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 96-96: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 97-97: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 97-97: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 97-97: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 97-97: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 98-98: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 98-98: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 98-98: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 98-99: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 100-100: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 100-100: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 100-100: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 100-100: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 101-101: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 101-101: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 101-101: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 101-101: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 102-102: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 102-102: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 102-102: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 102-102: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 103-103: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 103-103: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 103-103: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 103-103: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 104-104: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 104-104: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 104-104: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 104-104: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 105-105: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 105-105: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 105-105: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 105-105: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 106-106: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 106-106: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 106-106: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 106-106: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 107-107: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 107-107: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 107-107: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 107-107: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 108-108: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 108-108: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 108-108: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 108-108: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 109-109: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 109-109: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 109-109: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 109-109: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 110-110: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 110-110: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 110-110: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 110-110: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 111-111: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 111-111: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 111-111: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 111-111: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 112-112: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 112-112: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 112-112: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 112-112: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 113-113: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 113-113: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 113-113: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 113-113: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 114-114: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 114-114: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 114-114: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 114-116: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 117-117: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 117-117: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 117-117: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 117-117: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 118-118: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 118-118: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 118-118: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 118-118: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 119-119: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 119-119: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 119-119: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 119-119: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 120-120: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 120-120: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 120-120: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 120-122: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 123-123: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 123-123: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 123-123: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 123-123: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 124-124: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 124-124: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 124-124: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 124-124: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 125-125: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 125-125: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 125-125: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 125-125: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 126-126: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 126-126: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 126-126: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 126-126: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 127-127: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 127-127: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 127-127: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 127-127: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 128-128: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 128-128: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 128-128: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 128-128: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 129-129: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 129-129: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 129-129: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 129-129: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 130-130: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 130-130: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 130-130: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 130-130: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 131-131: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 131-131: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 131-131: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 131-131: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 132-132: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 132-132: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 132-132: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 132-132: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 133-133: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 133-133: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 133-133: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 133-133: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 134-134: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 134-134: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 134-134: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 134-134: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 135-135: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 135-135: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 135-135: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 135-137: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 138-138: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 138-138: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 138-138: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 138-138: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 139-139: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 139-139: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 139-139: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 140-140: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 141-141: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 141-141: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 141-141: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 141-142: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
🪛 LanguageTool
README.md
[style] ~3-~3: Using many exclamation marks might seem excessive (in this case: 5 exclamation marks for a text that’s 2536 characters long)
Context: ...l [![NPM version][npm-image]][npm-url] [![Test coverage][codecov-image]][codecov-url] [![npm download][download-image]][download-url]
[
[uncategorized] ~26-~26: This verb does not appear to agree with the subject. Consider using a different form.
Context: ...js/mysql ``` MySQL Plugin for egg@4
, support egg application access to MySQL databas...
(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)
[uncategorized] ~262-~262: This verb may not be in the correct form. Consider using a different form for this context.
Context: ... unit tests bash npm test
Stop test mysql service ```bash docker compose -...
(AI_EN_LECTOR_REPLACEMENT_VERB_FORM)
🔇 Additional comments (51)
src/agent.ts (1)
1-3
: Exporting MySQLBootHook
The code correctly imports and re-exportsMySQLBootHook
as the default export. This cleanly exposes the boot hook functionality for agent usage.src/index.ts (1)
1-1
: Include TypeScript Types
The addition ofimport './types.js';
ensures that type extensions are applied throughout the codebase. Make sure that thetypes.js
file is correctly generated/maintained in your build process, especially in an ESM environment.test/fixtures/apps/mysqlapp-ts-esm/package.json (1)
1-4
: New Package Configuration for ESM Test Application
This newpackage.json
correctly sets the application name and defines"type": "module"
, ensuring that ECMAScript modules are used in this test fixture.src/app.ts (1)
1-3
: Consistent Export of MySQLBootHook
The code mirrors the approach used insrc/agent.ts
, cleanly re-exportingMySQLBootHook
for application usage. This uniformity helps maintain consistency across both contexts (agent and application).test/fixtures/apps/mysqlapp-ts-esm/tsconfig.json (1)
1-3
: TypeScript configuration is properly set up for ESM support.The configuration extends from
@eggjs/tsconfig
which is a good practice for maintaining consistent TypeScript settings across the project. This is appropriate for the new ESM test fixture being added.test/fixtures/apps/mysqlapp-ts-esm/app/router.ts (1)
1-5
: Router implementation looks good for the TypeScript ESM test app.The router correctly imports the Application type from egg and sets up a basic route handler for the root path. This follows the Egg.js routing conventions while using proper TypeScript typing.
test/fixtures/apps/mysqlapp/app/router.js (1)
1-1
: Function naming change improves code readability.Changing from an anonymous function to a named function (
exports
) enhances code readability and debugging without affecting functionality. This is a good practice that makes the code more maintainable.test/fixtures/apps/mysqlapp-ts-esm/typings/index.d.ts (1)
1-1
: Type definitions properly imported for TypeScript ESM test.The import statement correctly references the main TypeScript source file to bring in the necessary type definitions. This ensures that the test fixture inherits all the types defined in the main package.
src/typings/index.d.ts (2)
1-4
: Clear documentation of TypeScript typing approachThe comments provide helpful context about declaration merging and reference relevant resources, which is good practice for maintainers and contributors.
1-4
:✅ Verification successful
Verify type definitions migration
The previous file contained specific MySQL-related type definitions (EggMySQL, EggMySQLClientOption, etc.) that are no longer present.
🏁 Script executed:
#!/bin/bash # Search for the MySQL-related types that were previously defined in index.d.ts echo "Searching for MySQL type definitions..." rg "EggMySQL|EggMySQLClientOption|EggMySQLClientsOption|EggMySqlConfig" --type tsLength of output: 172
MySQL Type Definitions Successfully Removed
- Verified that none of the MySQL-related type definitions (EggMySQL, EggMySQLClientOption, EggMySQLClientsOption, EggMySqlConfig) appear anywhere in the codebase.
- The file
src/typings/index.d.ts
now only importsegg
, which aligns with the intended migration.test/fixtures/apps/mysqlapp-dynamic/app/router.js (1)
3-3
: Improved function naming for better debuggingChanging from an anonymous function to a named function (
exports
) improves stack traces for debugging and follows good practices for function declarations.test/fixtures/apps/mysqlapp-ts-esm/app/controller/home.ts (1)
1-10
: Well-structured TypeScript ESM controller implementationThis controller is correctly implemented with:
- Proper TypeScript type annotations
- ESM import/export syntax
- Asynchronous data fetching from the service layer
- Well-structured response format
This is a good example for testing the TypeScript ESM support.
test/fixtures/apps/mysqlapp-new/app/router.js (1)
1-1
: Consistent naming pattern across router filesThe change from anonymous function to named function (
exports
) maintains consistency with other router files in the codebase and improves debugging capabilities.__snapshots__/mysql.test.ts.js (1)
1-14
: LGTM! The snapshot file looks good for testing purposes.The snapshot correctly captures the MySQL configuration structure for testing. The empty password and use of "test" database are appropriate for a test environment.
docker-compose.yml (1)
12-16
: LGTM! The health check configuration is appropriate.The health check configuration uses correct parameters and timing for ensuring the MySQL service is properly initialized.
test/fixtures/apps/mysqlapp-ts-esm/agent.ts (1)
6-10
: LGTM! The class structure follows Egg.js conventions.The
Boot
class follows the Egg.js lifecycle hooks pattern and properly initializes the agent in the constructor.test/esm.test.ts (1)
1-42
: LGTM! Well-structured ESM integration testThis test properly validates the MySQL plugin functionality with ESM and TypeScript. It follows best practices:
- Uses randomUUID for test data isolation
- Properly sets up and tears down test data
- Tests both query and queryOne methods
- Verifies HTTP response contents
src/config/config.default.ts (2)
3-27
: Configuration interfaces look well-structured.
Defining clear interfaces for single and multiple databases, together with doc comments, improves code clarity and consistency.
63-63
:✅ Verification successful
Verify that TypeScript ≥ 4.9 is used to support the
satisfies
keyword.
Thesatisfies
operator requires TS 4.9 or higher. Let’s confirm the project’s TypeScript version.
🏁 Script executed:
#!/bin/bash # Searching for package.json and verifying "typescript" version fd package.json --exec cat {} | grep '"typescript":'Length of output: 106
Verified TS Version Requirement: The package.json indicates that the project is using TypeScript version 5, which satisfies the requirement of TypeScript ≥ 4.9 for the
satisfies
keyword.No changes are needed for the usage of the
satisfies
operator in this file.test/fixtures/apps/mysqlapp-new/agent.js (1)
4-7
: Constructor usage is clear.
Exporting a class named Boot is consistent with Egg.js conventions. The property injection viathis.agent
is straightforward.README.zh-CN.md (6)
1-16
: Documentation changes look good.The badge URLs and references to
@eggjs/mysql
are correctly updated, and the new CodeRabbit Pull Request Reviews badge is a welcome addition.
25-25
: Command usage confirmed.Replacing
npm i egg-mysql
withnpm i @eggjs/mysql
aligns with the package name change.
36-36
: Package reference update confirmed.Using
package: '@eggjs/mysql'
ensures consistency with the new package name.
125-129
: Usage examples are consistent.The references to
app.mysqls.getSingletonInstance('db1')
match the updated approach insrc/boot.ts
. This clearly reflects multiple database usage.
243-254
: Literal usage documentation is correct.Highlighting
NOW()
andCONCAT
usage withapp.mysql.literals
provides a clear reference for custom expressions.
270-278
: Issue link and contributors badge successfully updated.Directing users to the new repository for issues and acknowledging contributors is well done.
README.md (5)
1-16
: Documentation changes look good.All badges and package references align with
@eggjs/mysql
, reflecting the new namespace and repository.🧰 Tools
🪛 LanguageTool
[style] ~3-~3: Using many exclamation marks might seem excessive (in this case: 5 exclamation marks for a text that’s 2536 characters long)
Context: ...l [![NPM version][npm-image]][npm-url][![Test coverage][codecov-image]][codecov-url] [![npm download][download-image]][download-url]
[
65-68
: Doc note confirmed.Clarifying default behaviors (
app: true
,agent: false
) is helpful for new users.
115-119
: Multiple clients usage is correct.Using
app.mysqls.getSingletonInstance('db1')
or'db2'
is neatly documented and consistent with the underlying code.
247-267
: Local development instructions are comprehensive.The Docker Compose usage is well documented, including test startup and teardown instructions.
🧰 Tools
🪛 LanguageTool
[uncategorized] ~262-~262: This verb may not be in the correct form. Consider using a different form for this context.
Context: ... unit testsbash npm test
Stop test mysql service ```bash docker compose -...(AI_EN_LECTOR_REPLACEMENT_VERB_FORM)
270-278
: Link updates look good.Pointing users to the new repository for issues and contributor info is consistent with the overall changes.
test/mysql.test.ts (9)
1-1
: Import statements are using modern 'node:*' prefixes.The update to use
import assert from 'node:assert/strict'
follows the Node.js recommended practice for built-in modules, improving long-term maintainability.
5-11
: ESM compatibility improvements with proper __dirname/__filename handling.The addition of
fileURLToPath
and the calculation of__dirname
and__filename
are necessary for ESM compatibility, as these globals aren't automatically available in ESM contexts.
48-50
: Good addition of snapshot test for configuration stability.Adding a snapshot test ensures the MySQL configuration remains stable across changes. This helps catch unintended configuration modifications during future updates.
122-122
: Improved string assertion using String.raw for escape sequence handling.Using
String.raw
provides a more precise way to represent strings with escape sequences in test assertions, improving test reliability.
131-137
: Enhanced error property access with Reflect.get.Using
Reflect.get
for accessing error properties is more robust than direct property access. The additional check forerr instanceof Error
also improves type safety.
154-154
: Added explicit type annotation for app variable.Adding the
MockApplication
type improves type safety and code clarity, making the test more maintainable.
171-171
: Added explicit type annotation for app variable.Adding the
MockApplication
type improves type safety and code clarity, making the test more maintainable.
186-186
: Added explicit type annotation for app variable.Adding the
MockApplication
type improves type safety and code clarity, making the test more maintainable.
209-210
: Renamed test block to reflect asynchronous nature and added type annotation.Changing from
createInstance
tocreateInstanceAsync
more accurately describes the test's purpose. The explicit type annotation forapp
improves code clarity.package.json (8)
9-14
: Added multi-format module exports configuration.The export configuration enables the package to support both CommonJS and ESM module systems, as well as TypeScript. This is a key part of the PR objective to support both module formats.
37-37
: Updated dependency to @eggjs/core.Switching from egg-core to @eggjs/core reflects the broader migration to scoped packages in the Egg.js ecosystem.
41-53
: Comprehensive update of development dependencies.The development dependencies have been completely revamped to support modern development tools and the dual CJS/ESM build process. Key additions include:
- tshy for dual module format support
- oxlint for modern linting
- @eggjs/bin and @eggjs/mock for testing
56-64
: Modernized build and test scripts.The scripts have been updated to use modern tools:
- Using oxlint instead of eslint
- Adding a clean step to remove build artifacts
- Using tshy for the build process
- Adding type checking with attw during publishing
65-71
: Added ESM configuration with tshy exports.Setting
"type": "module"
marks this package as an ES module, and the tshy configuration defines the export paths. This is essential for the dual CJS/ESM support goal.
72-84
: Comprehensive package exports configuration.The exports field provides a detailed mapping for different module systems, ensuring proper type definitions and implementations are used for each format. This is crucial for proper dual CJS/ESM support.
85-90
: Updated package files and entry points.The files array now includes the dist and src directories instead of specific files, and the types and main fields are configured for CommonJS compatibility while exports handles the dual format support.
33-35
:❓ Verification inconclusive
Breaking change: Node.js version requirement.
Setting the minimum Node.js version to 18.19.0 is a significant breaking change. This aligns with the PR objective to drop support for earlier Node.js versions.
🌐 Web query:
What Node.js versions are still in active LTS as of March 2025?
💡 Result:
As of March 2025, Node.js v22.x is the only version in Active Long-Term Support (LTS). Here are the key details:
Node.js Active LTS Status
- v22.x (Jod):
- Entered Active LTS on November 8, 2024[1][5]
- Will remain in Active LTS until October 2025, followed by Maintenance LTS until April 2027[1][5]
- Key features include a built-in WebSocket client, enhanced performance, and stability improvements[1][7]
Recent Transitions
- Node.js 20.x transitioned to Maintenance LTS in October 2024[5][6], focusing only on critical security fixes.
- Node.js 18.x remains in Maintenance LTS until its end-of-life on April 30, 2025[2][5], but is no longer in Active LTS.
Production environments should prioritize Node.js v22.x for its extended support window and security updates. The structured release cycle ensures even-numbered versions like v22.x receive 30 months of total LTS coverage, balancing innovation with stability[3][5].
Citations:
- 1: http://nodesource.com/blog/Node.js-v22-Long-Term-Support-LTS/
- 2: https://www.herodevs.com/blog-posts/node-js-18-end-of-life-what-it-means-and-how-to-prepare
- 3: https://nodejs.org/en/about/previous-releases
- 4: http://nodesource.com/blog/Update-nodejs-versions-on-windows/
- 5: https://www.herodevs.com/blog-posts/node-js-end-of-life-dates-you-should-be-aware-of
- 6: https://aws.amazon.com/blogs/devops/announcing-the-end-of-support-for-node-js-14-x-and-16-x-in-aws-cdk/
- 7: https://nodesource.com/blog/State-of-Nodejs-Performance-2024
- 8: https://nodejs.org/en/blog/release
- 9: https://github.com/nodejs/Release
- 10: https://endoflife.date/nodejs
Action Required: Revisit the Node.js Engine Requirement
The current change in package.json (lines 33–35):
"engines": { "node": ">= 18.19.0" },is indeed a breaking change since it drops support for any Node.js version earlier than 18.19.0. However, note that as of March 2025:
- Active LTS is only Node.js v22.x.
- Node.js v18.x is now in maintenance LTS (with end-of-life scheduled for April 30, 2025).
Recommendations:
- Verify the Intent: Confirm if the goal is solely to drop pre-18 versions or if aligning with currently active LTS (v22.x) is preferred.
- Documentation Update: If support for Node.js 18.x is maintained only for transitional reasons, ensure documentation clearly outlines the risks, given its maintenance status.
- Consider Bumping the Requirement: Alternatively, update the minimum engine version to
"node": ">=22.0.0"
to fully align with production readiness on the active LTS release, avoiding potential issues with soon-to-be EOL releases.tsconfig.json (1)
2-2
: Clean and simplified TypeScript configuration.This change simplifies the TypeScript configuration by removing specific compiler options and just extending from a shared configuration, which aligns with the PR objective to support both CommonJS and ESM modules using tshy.
test/fixtures/apps/mysqlapp-ts-esm/config/config.ts (1)
1-15
: Test configuration properly set up for ESM support.The configuration correctly uses TypeScript's
satisfies
operator to ensure type compatibility withPowerPartial<EggAppConfig>
, which is appropriate for ESM modules in TypeScript. The MySQL client configuration is also correctly structured.src/types.ts (1)
1-16
: Type declarations properly extend EggCore interfaces.The module augmentation approach correctly extends the
EggAppConfig
andEggCore
interfaces to add MySQL-specific properties. The use of.js
extension in the import statement is necessary for ESM compatibility, and the types properly leverage theSingleton
pattern for client management.
src/boot.ts
Outdated
async function createMySQLClient(config: RDSClientOptions, app: EggCore, clientName = 'default') { | ||
app.coreLogger.info('[@eggjs/mysql] clientName[%s] connecting %s@%s:%s/%s', | ||
clientName, config.user, config.host, config.port, config.database); | ||
const client = new RDSClient(config); | ||
|
||
const rows = await client.query('select now() as currentTime;'); | ||
app.coreLogger.info('[@eggjs/mysql] clientName[%s] status OK, MySQL Server currentTime: %j', | ||
clientName, rows[0].currentTime); | ||
return client; | ||
} |
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.
🛠️ Refactor suggestion
Consider adding error handling for failed connections.
Currently, if the initial query (or connection) fails, the error will bubble up without being caught or logged (beyond default error behavior). Adding a try/catch block around the query can help provide clearer debugging information and avoid leaving the application in a half-initialized state.
async function createMySQLClient(config: RDSClientOptions, app: EggCore, clientName = 'default') {
app.coreLogger.info('[@eggjs/mysql] clientName[%s] connecting %s@%s:%s/%s',
clientName, config.user, config.host, config.port, config.database);
const client = new RDSClient(config);
- const rows = await client.query('select now() as currentTime;');
- app.coreLogger.info('[@eggjs/mysql] clientName[%s] status OK, MySQL Server currentTime: %j',
- clientName, rows[0].currentTime);
- return client;
+ try {
+ const rows = await client.query('select now() as currentTime;');
+ app.coreLogger.info('[@eggjs/mysql] clientName[%s] status OK, currentTime: %j',
+ clientName, rows[0].currentTime);
+ return client;
+ } catch (err) {
+ app.coreLogger.error('[@eggjs/mysql] clientName[%s] connection failed: %s', clientName, err);
+ throw err;
+ }
}
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
async function createMySQLClient(config: RDSClientOptions, app: EggCore, clientName = 'default') { | |
app.coreLogger.info('[@eggjs/mysql] clientName[%s] connecting %s@%s:%s/%s', | |
clientName, config.user, config.host, config.port, config.database); | |
const client = new RDSClient(config); | |
const rows = await client.query('select now() as currentTime;'); | |
app.coreLogger.info('[@eggjs/mysql] clientName[%s] status OK, MySQL Server currentTime: %j', | |
clientName, rows[0].currentTime); | |
return client; | |
} | |
async function createMySQLClient(config: RDSClientOptions, app: EggCore, clientName = 'default') { | |
app.coreLogger.info('[@eggjs/mysql] clientName[%s] connecting %s@%s:%s/%s', | |
clientName, config.user, config.host, config.port, config.database); | |
const client = new RDSClient(config); | |
try { | |
const rows = await client.query('select now() as currentTime;'); | |
app.coreLogger.info('[@eggjs/mysql] clientName[%s] status OK, currentTime: %j', | |
clientName, rows[0].currentTime); | |
return client; | |
} catch (err) { | |
app.coreLogger.error('[@eggjs/mysql] clientName[%s] connection failed: %s', clientName, err); | |
throw err; | |
} | |
} |
[skip ci] ## [6.0.0](v5.0.0...v6.0.0) (2025-03-23) ### ⚠ BREAKING CHANGES * drop Node.js < 18.19.0 support and only support egg>=4 part of eggjs/egg#3644 eggjs/egg#5257 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Refined MySQL plugin integration with improved lifecycle management and simplified singleton access. - Added a ready-to-use Docker Compose setup for local MySQL development. - **Documentation** - Updated all documentation with the new package name (@eggjs/mysql) and revised usage examples for clarity. - **Chores** - Enhanced package metadata and dependency management. - Updated CI configuration to support Node.js versions 18, 20, and 22. <!-- end of auto-generated comment: release notes by coderabbit.ai --> ### Features * support cjs and esm both by tshy ([#33](#33)) ([dfdaa74](dfdaa74))
BREAKING CHANGE: drop Node.js < 18.19.0 support and only support egg>=4
part of eggjs/egg#3644
eggjs/egg#5257
Summary by CodeRabbit
New Features
Documentation
Chores