Conversation
```ts
declare module 'egg' {
interface Events {
[PACKAGE_ADDED]: (fullname: string) => Promise<void>;
}
}
```
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughAdds new package export entry points (seven in Changes
Sequence Diagram(s)sequenceDiagram
participant Master
participant PortDetector
participant WorkerSelector
participant AgentForker
Note over Master: Old flow (simplified)
Master->>WorkerSelector: select based on startMode
WorkerSelector->>Master: start workers immediately
Master->>PortDetector: detectPorts (async)
PortDetector-->>Master: ports discovered (later)
rect rgb(230, 245, 255)
Note over Master,PortDetector: New flow — await port detection first
Master->>PortDetector: detectPorts()
PortDetector-->>Master: ports (stickyPort assigned)
Master->>WorkerSelector: choose implementation (worker_threads/process) using detected ports
WorkerSelector-->>Master: initialized
Master->>AgentForker: forkAgentWorker()
AgentForker-->>Master: agent started
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
🧰 Additional context used📓 Path-based instructions (3)packages/**/src/**/*.{ts,tsx}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
**/*.ts📄 CodeRabbit inference engine (AGENTS.md)
Files:
{packages/**,plugins/**,tools/!(egg-bin)/**}/**/*.ts📄 CodeRabbit inference engine (CLAUDE.md)
Files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
🔇 Additional comments (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull Request Overview
This PR exports the Events type interface from the main egg package to enable TypeScript module augmentation for custom event types. The PR also adds several missing package.json export entries for internal modules (ajv, aop, dal, helper, orm, transaction, and lib/define) to improve module resolution.
Key changes:
- Exports the
Eventstype from@eggjs/teggto allow consumers to augment event definitions - Adds missing export entries in package.json for various internal modules across both source and dist configurations
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/egg/src/index.ts | Adds export for Events type from @eggjs/tegg |
| packages/egg/package.json | Adds multiple missing export paths for internal modules (ajv, aop, dal, helper, orm, transaction, lib/define) in both source and dist configurations |
| examples/helloworld-tegg/package.json | Adds missing export entry for config/plugin module |
Summary of ChangesHello @fengmk2, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## next #5654 +/- ##
==========================================
- Coverage 87.68% 87.67% -0.01%
==========================================
Files 565 565
Lines 11009 11010 +1
Branches 1243 1243
==========================================
Hits 9653 9653
- Misses 1275 1276 +1
Partials 81 81 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Deploying egg with
|
| Latest commit: |
1bd455e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://32a29ae9.egg-cci.pages.dev |
| Branch Preview URL: | https://export-events.egg-cci.pages.dev |
There was a problem hiding this comment.
Code Review
This pull request focuses on exporting the Events type from the @eggjs/tegg module within the egg package. This change ensures that the Events interface is accessible for external use, enhancing the module's usability and type safety. Additionally, the pull request updates the package.json files in both the examples/helloworld-tegg and packages/egg directories to include new exports for various modules, ensuring that these modules are properly exposed and accessible.
| "./ajv": "./dist/ajv.js", | ||
| "./aop": "./dist/aop.js", |
There was a problem hiding this comment.
Adding ajv and aop to the exports makes these modules available for external use. This can be beneficial for developers who want to leverage these functionalities directly in their applications. However, it's crucial to ensure that these modules are stable and well-documented before exposing them publicly.
| "./ajv": "./dist/ajv.js", | |
| "./aop": "./dist/aop.js", | |
| ".": "./dist/index.js", | |
| "./agent": "./dist/agent.js", | |
| "./ajv": "./dist/ajv.js", | |
| "./aop": "./dist/aop.js", |
| "./dal": "./dist/dal.js", | ||
| "./helper": "./dist/helper.js", |
There was a problem hiding this comment.
Adding dal and helper to the exports makes these modules available for external use. This can be beneficial for developers who want to leverage these functionalities directly in their applications. However, it's crucial to ensure that these modules are stable and well-documented before exposing them publicly.
| "./dal": "./dist/dal.js", | |
| "./helper": "./dist/helper.js", | |
| "./config/config.plugin": "./dist/config/plugin.js", | |
| "./dal": "./dist/dal.js", | |
| "./helper": "./dist/helper.js", |
| "./lib/core/messenger/ipc": "./dist/lib/core/messenger/ipc.js", | ||
| "./lib/core/messenger/local": "./dist/lib/core/messenger/local.js", | ||
| "./lib/core/utils": "./dist/lib/core/utils.js", | ||
| "./lib/define": "./dist/lib/define.js", |
There was a problem hiding this comment.
Adding lib/define to the exports makes this module available for external use. This can be beneficial for developers who want to leverage these functionalities directly in their applications. However, it's crucial to ensure that these modules are stable and well-documented before exposing them publicly.
| "./lib/define": "./dist/lib/define.js", | |
| "./lib/core/messenger/local": "./dist/lib/core/messenger/local.js", | |
| "./lib/core/utils": "./dist/lib/core/utils.js", | |
| "./lib/define": "./dist/lib/define.js", |
Deploying egg-v3 with
|
| Latest commit: |
1bd455e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://da35fd3c.egg-v3.pages.dev |
| Branch Preview URL: | https://export-events.egg-v3.pages.dev |
required eggjs/egg#5654 --------- Signed-off-by: MK (fengmk2) <fengmk2@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Summary by CodeRabbit
New Features
Bug Fixes / Improvements