chore(release): align next with beta.23 release#6032
Conversation
- @eggjs/cluster@4.0.2-beta.21 - @eggjs/cookies@4.0.2-beta.21 - @eggjs/core@7.0.2-beta.21 - egg@4.1.2-beta.21 - @eggjs/errors@3.0.2-beta.21 - @eggjs/extend2@5.0.2-beta.21 - @eggjs/koa@3.1.2-beta.21 - @eggjs/koa-static-cache@7.0.2-beta.21 - @eggjs/loader-fs@1.0.0-beta.21 - @eggjs/logger@4.0.2-beta.21 - @eggjs/path-matching@3.0.2-beta.21 - @eggjs/router@4.0.2-beta.21 - @eggjs/skills@4.1.2-beta.21 - @eggjs/supertest@9.0.2-beta.21 - @eggjs/tsconfig@3.1.2-beta.21 - @eggjs/typings@4.1.2-beta.21 - @eggjs/utils@5.0.2-beta.21 - @eggjs/development@5.0.2-beta.21 - @eggjs/i18n@4.0.2-beta.21 - @eggjs/jsonp@4.0.2-beta.21 - @eggjs/logrotator@5.0.2-beta.21 - @eggjs/mock@7.0.2-beta.21 - @eggjs/multipart@5.0.2-beta.21 - @eggjs/onerror@4.0.2-beta.21 - @eggjs/redis@4.0.2-beta.21 - @eggjs/schedule@6.0.2-beta.21 - @eggjs/security@5.0.2-beta.21 - @eggjs/session@5.0.2-beta.21 - @eggjs/static@4.0.2-beta.21 - @eggjs/tracer@4.0.2-beta.21 - @eggjs/typebox-validate@4.0.2-beta.21 - @eggjs/view@4.0.2-beta.21 - @eggjs/view-nunjucks@3.0.2-beta.21 - @eggjs/watcher@5.0.2-beta.21 - create-egg@4.1.2-beta.21 - @eggjs/bin@8.0.2-beta.21 - @eggjs/egg-bundler@0.0.1-beta.11 - @eggjs/scripts@5.0.2-beta.21 - @eggjs/agent-runtime@4.0.2-beta.21 - @eggjs/ajv-decorator@4.0.2-beta.21 - @eggjs/aop-decorator@4.0.2-beta.21 - @eggjs/aop-runtime@4.0.2-beta.21 - @eggjs/background-task@4.0.2-beta.21 - @eggjs/tegg-common-util@4.0.2-beta.21 - @eggjs/controller-decorator@4.0.2-beta.21 - @eggjs/core-decorator@4.0.2-beta.21 - @eggjs/dal-decorator@4.0.2-beta.21 - @eggjs/dal-runtime@4.0.2-beta.21 - @eggjs/dynamic-inject@4.0.2-beta.21 - @eggjs/dynamic-inject-runtime@4.0.2-beta.21 - @eggjs/eventbus-decorator@4.0.2-beta.21 - @eggjs/eventbus-runtime@4.0.2-beta.21 - @eggjs/langchain-decorator@4.0.2-beta.21 - @eggjs/lifecycle@4.0.2-beta.21 - @eggjs/tegg-loader@4.0.2-beta.21 - @eggjs/mcp-client@4.0.2-beta.21 - @eggjs/metadata@4.0.2-beta.21 - @eggjs/orm-decorator@4.0.2-beta.21 - @eggjs/tegg-runtime@4.0.2-beta.21 - @eggjs/schedule-decorator@4.0.2-beta.21 - @eggjs/standalone-decorator@4.0.2-beta.21 - @eggjs/tegg@4.0.2-beta.21 - @eggjs/transaction-decorator@4.0.2-beta.21 - @eggjs/tegg-types@4.0.2-beta.21 - @eggjs/tegg-vitest@4.0.2-beta.21 - @eggjs/ajv-plugin@4.0.2-beta.21 - @eggjs/aop-plugin@4.0.2-beta.21 - @eggjs/module-common@4.0.2-beta.21 - @eggjs/tegg-config@4.0.2-beta.21 - @eggjs/controller-plugin@4.0.2-beta.21 - @eggjs/dal-plugin@4.0.2-beta.21 - @eggjs/dns-cache-plugin@4.0.2-beta.21 - @eggjs/eventbus-plugin@4.0.2-beta.21 - @eggjs/langchain-plugin@4.0.2-beta.21 - @eggjs/mcp-client-plugin@4.0.2-beta.21 - @eggjs/mcp-proxy-plugin@4.0.2-beta.21 - @eggjs/orm-plugin@4.0.2-beta.21 - @eggjs/schedule-plugin@4.0.2-beta.21 - @eggjs/tegg-plugin@4.0.2-beta.21 - @eggjs/standalone@4.0.2-beta.21
- @eggjs/cluster@4.0.2-beta.22 - @eggjs/cookies@4.0.2-beta.22 - @eggjs/core@7.0.2-beta.22 - egg@4.1.2-beta.22 - @eggjs/errors@3.0.2-beta.22 - @eggjs/extend2@5.0.2-beta.22 - @eggjs/koa@3.1.2-beta.22 - @eggjs/koa-static-cache@7.0.2-beta.22 - @eggjs/loader-fs@1.0.0-beta.22 - @eggjs/logger@4.0.2-beta.22 - @eggjs/path-matching@3.0.2-beta.22 - @eggjs/router@4.0.2-beta.22 - @eggjs/skills@4.1.2-beta.22 - @eggjs/supertest@9.0.2-beta.22 - @eggjs/tsconfig@3.1.2-beta.22 - @eggjs/typings@4.1.2-beta.22 - @eggjs/utils@5.0.2-beta.22 - @eggjs/development@5.0.2-beta.22 - @eggjs/i18n@4.0.2-beta.22 - @eggjs/jsonp@4.0.2-beta.22 - @eggjs/logrotator@5.0.2-beta.22 - @eggjs/mock@7.0.2-beta.22 - @eggjs/multipart@5.0.2-beta.22 - @eggjs/onerror@4.0.2-beta.22 - @eggjs/redis@4.0.2-beta.22 - @eggjs/schedule@6.0.2-beta.22 - @eggjs/security@5.0.2-beta.22 - @eggjs/session@5.0.2-beta.22 - @eggjs/static@4.0.2-beta.22 - @eggjs/tracer@4.0.2-beta.22 - @eggjs/typebox-validate@4.0.2-beta.22 - @eggjs/view@4.0.2-beta.22 - @eggjs/view-nunjucks@3.0.2-beta.22 - @eggjs/watcher@5.0.2-beta.22 - create-egg@4.1.2-beta.22 - @eggjs/bin@8.0.2-beta.22 - @eggjs/egg-bundler@0.0.1-beta.12 - @eggjs/scripts@5.0.2-beta.22 - @eggjs/agent-runtime@4.0.2-beta.22 - @eggjs/ajv-decorator@4.0.2-beta.22 - @eggjs/aop-decorator@4.0.2-beta.22 - @eggjs/aop-runtime@4.0.2-beta.22 - @eggjs/background-task@4.0.2-beta.22 - @eggjs/tegg-common-util@4.0.2-beta.22 - @eggjs/controller-decorator@4.0.2-beta.22 - @eggjs/core-decorator@4.0.2-beta.22 - @eggjs/dal-decorator@4.0.2-beta.22 - @eggjs/dal-runtime@4.0.2-beta.22 - @eggjs/dynamic-inject@4.0.2-beta.22 - @eggjs/dynamic-inject-runtime@4.0.2-beta.22 - @eggjs/eventbus-decorator@4.0.2-beta.22 - @eggjs/eventbus-runtime@4.0.2-beta.22 - @eggjs/langchain-decorator@4.0.2-beta.22 - @eggjs/lifecycle@4.0.2-beta.22 - @eggjs/tegg-loader@4.0.2-beta.22 - @eggjs/mcp-client@4.0.2-beta.22 - @eggjs/metadata@4.0.2-beta.22 - @eggjs/orm-decorator@4.0.2-beta.22 - @eggjs/tegg-runtime@4.0.2-beta.22 - @eggjs/schedule-decorator@4.0.2-beta.22 - @eggjs/standalone-decorator@4.0.2-beta.22 - @eggjs/tegg@4.0.2-beta.22 - @eggjs/transaction-decorator@4.0.2-beta.22 - @eggjs/tegg-types@4.0.2-beta.22 - @eggjs/tegg-vitest@4.0.2-beta.22 - @eggjs/ajv-plugin@4.0.2-beta.22 - @eggjs/aop-plugin@4.0.2-beta.22 - @eggjs/module-common@4.0.2-beta.22 - @eggjs/tegg-config@4.0.2-beta.22 - @eggjs/controller-plugin@4.0.2-beta.22 - @eggjs/dal-plugin@4.0.2-beta.22 - @eggjs/dns-cache-plugin@4.0.2-beta.22 - @eggjs/eventbus-plugin@4.0.2-beta.22 - @eggjs/langchain-plugin@4.0.2-beta.22 - @eggjs/mcp-client-plugin@4.0.2-beta.22 - @eggjs/mcp-proxy-plugin@4.0.2-beta.22 - @eggjs/orm-plugin@4.0.2-beta.22 - @eggjs/schedule-plugin@4.0.2-beta.22 - @eggjs/tegg-plugin@4.0.2-beta.22 - @eggjs/standalone@4.0.2-beta.22
- @eggjs/cluster@4.0.2-beta.23 - @eggjs/cookies@4.0.2-beta.23 - @eggjs/core@7.0.2-beta.23 - egg@4.1.2-beta.23 - @eggjs/errors@3.0.2-beta.23 - @eggjs/extend2@5.0.2-beta.23 - @eggjs/koa@3.1.2-beta.23 - @eggjs/koa-static-cache@7.0.2-beta.23 - @eggjs/loader-fs@1.0.0-beta.23 - @eggjs/logger@4.0.2-beta.23 - @eggjs/path-matching@3.0.2-beta.23 - @eggjs/router@4.0.2-beta.23 - @eggjs/skills@4.1.2-beta.23 - @eggjs/supertest@9.0.2-beta.23 - @eggjs/tsconfig@3.1.2-beta.23 - @eggjs/typings@4.1.2-beta.23 - @eggjs/utils@5.0.2-beta.23 - @eggjs/development@5.0.2-beta.23 - @eggjs/i18n@4.0.2-beta.23 - @eggjs/jsonp@4.0.2-beta.23 - @eggjs/logrotator@5.0.2-beta.23 - @eggjs/mock@7.0.2-beta.23 - @eggjs/multipart@5.0.2-beta.23 - @eggjs/onerror@4.0.2-beta.23 - @eggjs/redis@4.0.2-beta.23 - @eggjs/schedule@6.0.2-beta.23 - @eggjs/security@5.0.2-beta.23 - @eggjs/session@5.0.2-beta.23 - @eggjs/static@4.0.2-beta.23 - @eggjs/tracer@4.0.2-beta.23 - @eggjs/typebox-validate@4.0.2-beta.23 - @eggjs/view@4.0.2-beta.23 - @eggjs/view-nunjucks@3.0.2-beta.23 - @eggjs/watcher@5.0.2-beta.23 - create-egg@4.1.2-beta.23 - @eggjs/bin@8.0.2-beta.23 - @eggjs/egg-bundler@0.0.1-beta.13 - @eggjs/scripts@5.0.2-beta.23 - @eggjs/agent-runtime@4.0.2-beta.23 - @eggjs/ajv-decorator@4.0.2-beta.23 - @eggjs/aop-decorator@4.0.2-beta.23 - @eggjs/aop-runtime@4.0.2-beta.23 - @eggjs/background-task@4.0.2-beta.23 - @eggjs/tegg-common-util@4.0.2-beta.23 - @eggjs/controller-decorator@4.0.2-beta.23 - @eggjs/core-decorator@4.0.2-beta.23 - @eggjs/dal-decorator@4.0.2-beta.23 - @eggjs/dal-runtime@4.0.2-beta.23 - @eggjs/dynamic-inject@4.0.2-beta.23 - @eggjs/dynamic-inject-runtime@4.0.2-beta.23 - @eggjs/eventbus-decorator@4.0.2-beta.23 - @eggjs/eventbus-runtime@4.0.2-beta.23 - @eggjs/langchain-decorator@4.0.2-beta.23 - @eggjs/lifecycle@4.0.2-beta.23 - @eggjs/tegg-loader@4.0.2-beta.23 - @eggjs/mcp-client@4.0.2-beta.23 - @eggjs/metadata@4.0.2-beta.23 - @eggjs/orm-decorator@4.0.2-beta.23 - @eggjs/tegg-runtime@4.0.2-beta.23 - @eggjs/schedule-decorator@4.0.2-beta.23 - @eggjs/standalone-decorator@4.0.2-beta.23 - @eggjs/tegg@4.0.2-beta.23 - @eggjs/transaction-decorator@4.0.2-beta.23 - @eggjs/tegg-types@4.0.2-beta.23 - @eggjs/tegg-vitest@4.0.2-beta.23 - @eggjs/ajv-plugin@4.0.2-beta.23 - @eggjs/aop-plugin@4.0.2-beta.23 - @eggjs/module-common@4.0.2-beta.23 - @eggjs/tegg-config@4.0.2-beta.23 - @eggjs/controller-plugin@4.0.2-beta.23 - @eggjs/dal-plugin@4.0.2-beta.23 - @eggjs/dns-cache-plugin@4.0.2-beta.23 - @eggjs/eventbus-plugin@4.0.2-beta.23 - @eggjs/langchain-plugin@4.0.2-beta.23 - @eggjs/mcp-client-plugin@4.0.2-beta.23 - @eggjs/mcp-proxy-plugin@4.0.2-beta.23 - @eggjs/orm-plugin@4.0.2-beta.23 - @eggjs/schedule-plugin@4.0.2-beta.23 - @eggjs/tegg-plugin@4.0.2-beta.23 - @eggjs/standalone@4.0.2-beta.23
📝 WalkthroughWalkthroughPackage manifests are updated to beta.23, with egg-bundler moving to beta.13. Vitest adds an exported setup module and global ESM/CommonJS importer, egg-bin injects that setup when applicable, and DAL transaction setup skips modules without configured data sources. ChangesRelease metadata and runtime behavior
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related issues
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## next #6032 +/- ##
==========================================
+ Coverage 81.98% 82.18% +0.19%
==========================================
Files 678 678
Lines 20838 20844 +6
Branches 4154 4156 +2
==========================================
+ Hits 17085 17130 +45
+ Misses 3235 3206 -29
+ Partials 518 508 -10 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Superseded by #6033 because beta.24 was published from codex/release-beta24-patchless after this PR was opened. |
There was a problem hiding this comment.
Pull request overview
Realigns next branch source with the already-published v4.1.2-beta.23 beta line by bringing in the intervening beta version bumps plus the specific tegg vitest module-importer setup and DAL transaction hook guard shipped in that beta.
Changes:
- Bump monorepo + package versions from
*-beta.20to*-beta.23(and related tool betas). - Auto-inject
@eggjs/tegg-vitest/setupintoegg-bin testruns when the tegg vitest runner is detected; add a tegg-vitest setup module and wire it into tegg vitest config. - Guard DAL transaction hook when a module has no/empty
dataSourceconfig and add regression tests for that behavior.
Reviewed changes
Copilot reviewed 87 out of 87 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/scripts/package.json | Version bump to match beta.23 line. |
| tools/egg-bundler/package.json | Version bump (beta.10 → beta.13). |
| tools/egg-bin/src/commands/test.ts | Auto-add tegg vitest setup when tegg runner is resolvable. |
| tools/egg-bin/package.json | Version bump to beta.23 line. |
| tools/create-egg/package.json | Version bump to beta.23 line. |
| tegg/standalone/standalone/package.json | Version bump to beta.23 line. |
| tegg/plugin/tegg/package.json | Version bump to beta.23 line. |
| tegg/plugin/schedule/package.json | Version bump to beta.23 line. |
| tegg/plugin/orm/package.json | Version bump to beta.23 line. |
| tegg/plugin/mcp-proxy/package.json | Version bump to beta.23 line. |
| tegg/plugin/mcp-client/package.json | Version bump to beta.23 line. |
| tegg/plugin/langchain/package.json | Version bump to beta.23 line. |
| tegg/plugin/eventbus/package.json | Version bump to beta.23 line. |
| tegg/plugin/dns-cache/package.json | Version bump to beta.23 line. |
| tegg/plugin/dal/test/TransactionPrototypeHook.test.ts | New regression tests for “skip when no/empty dataSource config”. |
| tegg/plugin/dal/src/lib/TransactionPrototypeHook.ts | Skip transaction hook when module has no configured dataSources. |
| tegg/plugin/dal/package.json | Version bump to beta.23 line. |
| tegg/plugin/controller/package.json | Version bump to beta.23 line. |
| tegg/plugin/config/package.json | Version bump to beta.23 line. |
| tegg/plugin/common/package.json | Version bump to beta.23 line. |
| tegg/plugin/aop/package.json | Version bump to beta.23 line. |
| tegg/plugin/ajv/package.json | Version bump to beta.23 line. |
| tegg/core/vitest/vitest.config.ts | Register new tegg-vitest setup file before existing test setup. |
| tegg/core/vitest/test/fixture_app.test.ts | Add assertion that __EGG_MODULE_IMPORTER__ resolves the same module instance. |
| tegg/core/vitest/src/setup.ts | New module-importer setup that switches between import() and require() based on ESM/CJS. |
| tegg/core/vitest/package.json | Version bump and export new ./setup entry. |
| tegg/core/types/package.json | Version bump to beta.23 line. |
| tegg/core/transaction-decorator/package.json | Version bump to beta.23 line. |
| tegg/core/tegg/package.json | Version bump to beta.23 line. |
| tegg/core/standalone-decorator/package.json | Version bump to beta.23 line. |
| tegg/core/schedule-decorator/package.json | Version bump to beta.23 line. |
| tegg/core/runtime/package.json | Version bump to beta.23 line. |
| tegg/core/orm-decorator/package.json | Version bump to beta.23 line. |
| tegg/core/metadata/package.json | Version bump to beta.23 line. |
| tegg/core/mcp-client/package.json | Version bump to beta.23 line. |
| tegg/core/loader/package.json | Version bump to beta.23 line. |
| tegg/core/lifecycle/package.json | Version bump to beta.23 line. |
| tegg/core/langchain-decorator/package.json | Version bump to beta.23 line. |
| tegg/core/eventbus-runtime/package.json | Version bump to beta.23 line. |
| tegg/core/eventbus-decorator/package.json | Version bump to beta.23 line. |
| tegg/core/dynamic-inject/package.json | Version bump to beta.23 line. |
| tegg/core/dynamic-inject-runtime/package.json | Version bump to beta.23 line. |
| tegg/core/dal-runtime/package.json | Version bump to beta.23 line. |
| tegg/core/dal-decorator/package.json | Version bump to beta.23 line. |
| tegg/core/core-decorator/package.json | Version bump to beta.23 line. |
| tegg/core/controller-decorator/package.json | Version bump to beta.23 line. |
| tegg/core/common-util/package.json | Version bump to beta.23 line. |
| tegg/core/background-task/package.json | Version bump to beta.23 line. |
| tegg/core/aop-runtime/package.json | Version bump to beta.23 line. |
| tegg/core/aop-decorator/package.json | Version bump to beta.23 line. |
| tegg/core/ajv-decorator/package.json | Version bump to beta.23 line. |
| tegg/core/agent-runtime/package.json | Version bump to beta.23 line. |
| plugins/watcher/package.json | Version bump to beta.23 line. |
| plugins/view/package.json | Version bump to beta.23 line. |
| plugins/view-nunjucks/package.json | Version bump to beta.23 line. |
| plugins/typebox-validate/package.json | Version bump to beta.23 line. |
| plugins/tracer/package.json | Version bump to beta.23 line. |
| plugins/static/package.json | Version bump to beta.23 line. |
| plugins/session/package.json | Version bump to beta.23 line. |
| plugins/security/package.json | Version bump to beta.23 line. |
| plugins/schedule/package.json | Version bump to beta.23 line. |
| plugins/redis/package.json | Version bump to beta.23 line. |
| plugins/onerror/package.json | Version bump to beta.23 line. |
| plugins/multipart/package.json | Version bump to beta.23 line. |
| plugins/mock/package.json | Version bump to beta.23 line. |
| plugins/logrotator/package.json | Version bump to beta.23 line. |
| plugins/jsonp/package.json | Version bump to beta.23 line. |
| plugins/i18n/package.json | Version bump to beta.23 line. |
| plugins/development/package.json | Version bump to beta.23 line. |
| packages/utils/package.json | Version bump to beta.23 line. |
| packages/typings/package.json | Version bump to beta.23 line. |
| packages/tsconfig/package.json | Version bump to beta.23 line. |
| packages/supertest/package.json | Version bump to beta.23 line. |
| packages/skills/package.json | Version bump to beta.23 line. |
| packages/router/package.json | Version bump to beta.23 line. |
| packages/path-matching/package.json | Version bump to beta.23 line. |
| packages/logger/package.json | Version bump to beta.23 line. |
| packages/loader-fs/package.json | Version bump to beta.23 line. |
| packages/koa/package.json | Version bump to beta.23 line. |
| packages/koa-static-cache/package.json | Version bump to beta.23 line. |
| packages/extend2/package.json | Version bump to beta.23 line. |
| packages/errors/package.json | Version bump to beta.23 line. |
| packages/egg/package.json | Version bump to beta.23 line. |
| packages/core/package.json | Version bump to beta.23 line. |
| packages/cookies/package.json | Version bump to beta.23 line. |
| packages/cluster/package.json | Version bump to beta.23 line. |
| package.json | Monorepo root version bump to beta.23 line. |
| } else { | ||
| const teggSetup = importResolve('@eggjs/tegg-vitest/setup', { | ||
| paths: [flags.base, import.meta.dirname], | ||
| }); | ||
| setupFiles.unshift(teggSetup); | ||
| debug('auto add @eggjs/tegg-vitest/setup: %o', teggSetup); | ||
| } |
|
|
||
| // This setup file runs inside the test ViteVM. CJS files must use Node's | ||
| // require cache, while ESM files stay in Vitest's transformed import graph. | ||
| globalThis.__EGG_MODULE_IMPORTER__ = async (filePath: string) => { |
| }); | ||
|
|
||
| it('injects ctx and getEggObject', async () => { | ||
| const loadedModule = (await globalThis.__EGG_MODULE_IMPORTER__?.( |
There was a problem hiding this comment.
Code Review
This pull request updates package versions across the monorepo and introduces a new setup script for @eggjs/tegg-vitest to handle ESM and CommonJS file imports in Vitest. Additionally, it optimizes the transaction hook in the DAL plugin to skip processing early when no data sources are configured. Feedback on the changes highlights a potential crash in the test runner if an older version of @eggjs/tegg-vitest is installed, suggesting a try-catch block around the setup file resolution to ensure backward compatibility.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| } else { | ||
| const teggSetup = importResolve('@eggjs/tegg-vitest/setup', { | ||
| paths: [flags.base, import.meta.dirname], | ||
| }); | ||
| setupFiles.unshift(teggSetup); | ||
| debug('auto add @eggjs/tegg-vitest/setup: %o', teggSetup); | ||
| } |
There was a problem hiding this comment.
If @eggjs/tegg-vitest/runner is resolved but the installed version of @eggjs/tegg-vitest is older and does not export /setup, importResolve('@eggjs/tegg-vitest/setup') will throw an ImportResolveError. Since there is no try-catch block here, this will crash the test runner. Wrapping this in a try-catch block ensures backward compatibility with older versions of @eggjs/tegg-vitest.
} else {
try {
const teggSetup = importResolve('@eggjs/tegg-vitest/setup', {
paths: [flags.base, import.meta.dirname],
});
setupFiles.unshift(teggSetup);
debug('auto add @eggjs/tegg-vitest/setup: %o', teggSetup);
} catch (err) {
if (!(err instanceof ImportResolveError)) throw err;
debug('skip @eggjs/tegg-vitest/setup: not resolvable');
}
}There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
tegg/plugin/dal/src/lib/TransactionPrototypeHook.ts (1)
31-33: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider logging when the datasource guard skips transaction setup.
When
dataSources.length === 0, the hook returns silently. If a developer misconfigures datasource settings,@Transactionalmethods will silently have no transaction behavior with no diagnostic output. A debug-level log here would aid troubleshooting.💡 Optional: add a debug log
if (dataSources.length === 0) { + this.logger.info(`skip transaction hook for module ${moduleName} because no dataSource config found`); return; }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tegg/plugin/dal/src/lib/TransactionPrototypeHook.ts` around lines 31 - 33, In the dataSources.length === 0 guard within the transaction hook, add a debug-level log before returning to indicate that transaction setup was skipped because no datasources are configured. Keep the existing early-return behavior unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tegg/plugin/dal/test/TransactionPrototypeHook.test.ts`:
- Around line 1-64: Add a MultiApp regression test alongside the existing
`TransactionPrototypeHook` cases, creating two concurrent app/module
configurations with distinct dataSource or transaction settings and invoking
`preCreate` for each. Assert each hook uses only its own app’s configuration and
transaction setup, with no cross-talk, while preserving the existing single-app
skip cases.
In `@tools/egg-bin/src/commands/test.ts`:
- Around line 255-260: Wrap the `@eggjs/tegg-vitest/setup` importResolve call in
the same ImportResolveError handling pattern used by the runner resolution
above. When setup resolution fails, continue without unshifting a setup file,
while preserving the existing successful-resolution behavior and debug logging.
---
Nitpick comments:
In `@tegg/plugin/dal/src/lib/TransactionPrototypeHook.ts`:
- Around line 31-33: In the dataSources.length === 0 guard within the
transaction hook, add a debug-level log before returning to indicate that
transaction setup was skipped because no datasources are configured. Keep the
existing early-return behavior unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 93e180c9-60df-4a4d-a058-b90063b26225
📒 Files selected for processing (87)
package.jsonpackages/cluster/package.jsonpackages/cookies/package.jsonpackages/core/package.jsonpackages/egg/package.jsonpackages/errors/package.jsonpackages/extend2/package.jsonpackages/koa-static-cache/package.jsonpackages/koa/package.jsonpackages/loader-fs/package.jsonpackages/logger/package.jsonpackages/path-matching/package.jsonpackages/router/package.jsonpackages/skills/package.jsonpackages/supertest/package.jsonpackages/tsconfig/package.jsonpackages/typings/package.jsonpackages/utils/package.jsonplugins/development/package.jsonplugins/i18n/package.jsonplugins/jsonp/package.jsonplugins/logrotator/package.jsonplugins/mock/package.jsonplugins/multipart/package.jsonplugins/onerror/package.jsonplugins/redis/package.jsonplugins/schedule/package.jsonplugins/security/package.jsonplugins/session/package.jsonplugins/static/package.jsonplugins/tracer/package.jsonplugins/typebox-validate/package.jsonplugins/view-nunjucks/package.jsonplugins/view/package.jsonplugins/watcher/package.jsontegg/core/agent-runtime/package.jsontegg/core/ajv-decorator/package.jsontegg/core/aop-decorator/package.jsontegg/core/aop-runtime/package.jsontegg/core/background-task/package.jsontegg/core/common-util/package.jsontegg/core/controller-decorator/package.jsontegg/core/core-decorator/package.jsontegg/core/dal-decorator/package.jsontegg/core/dal-runtime/package.jsontegg/core/dynamic-inject-runtime/package.jsontegg/core/dynamic-inject/package.jsontegg/core/eventbus-decorator/package.jsontegg/core/eventbus-runtime/package.jsontegg/core/langchain-decorator/package.jsontegg/core/lifecycle/package.jsontegg/core/loader/package.jsontegg/core/mcp-client/package.jsontegg/core/metadata/package.jsontegg/core/orm-decorator/package.jsontegg/core/runtime/package.jsontegg/core/schedule-decorator/package.jsontegg/core/standalone-decorator/package.jsontegg/core/tegg/package.jsontegg/core/transaction-decorator/package.jsontegg/core/types/package.jsontegg/core/vitest/package.jsontegg/core/vitest/src/setup.tstegg/core/vitest/test/fixture_app.test.tstegg/core/vitest/vitest.config.tstegg/plugin/ajv/package.jsontegg/plugin/aop/package.jsontegg/plugin/common/package.jsontegg/plugin/config/package.jsontegg/plugin/controller/package.jsontegg/plugin/dal/package.jsontegg/plugin/dal/src/lib/TransactionPrototypeHook.tstegg/plugin/dal/test/TransactionPrototypeHook.test.tstegg/plugin/dns-cache/package.jsontegg/plugin/eventbus/package.jsontegg/plugin/langchain/package.jsontegg/plugin/mcp-client/package.jsontegg/plugin/mcp-proxy/package.jsontegg/plugin/orm/package.jsontegg/plugin/schedule/package.jsontegg/plugin/tegg/package.jsontegg/standalone/standalone/package.jsontools/create-egg/package.jsontools/egg-bin/package.jsontools/egg-bin/src/commands/test.tstools/egg-bundler/package.jsontools/scripts/package.json
| import { Transactional } from '@eggjs/transaction-decorator'; | ||
| import { describe, expect, it } from 'vitest'; | ||
|
|
||
| import { TransactionPrototypeHook } from '../src/lib/TransactionPrototypeHook.ts'; | ||
|
|
||
| describe('plugin/dal/test/TransactionPrototypeHook.test.ts', () => { | ||
| const logger = { | ||
| info() {}, | ||
| } as any; | ||
|
|
||
| it('should skip transaction hook when module has no dataSource config', async () => { | ||
| class FooService { | ||
| @Transactional() | ||
| async doSomething() {} | ||
| } | ||
|
|
||
| const hook = new TransactionPrototypeHook( | ||
| { | ||
| foo: { | ||
| config: {}, | ||
| }, | ||
| } as any, | ||
| logger, | ||
| ); | ||
|
|
||
| await expect( | ||
| hook.preCreate({ | ||
| clazz: FooService, | ||
| loadUnit: { | ||
| name: 'foo', | ||
| }, | ||
| } as any), | ||
| ).resolves.toBeUndefined(); | ||
| }); | ||
|
|
||
| it('should skip transaction hook when module has empty dataSource config', async () => { | ||
| class BarService { | ||
| @Transactional({ | ||
| datasourceName: 'foo', | ||
| }) | ||
| async doSomething() {} | ||
| } | ||
|
|
||
| const hook = new TransactionPrototypeHook( | ||
| { | ||
| bar: { | ||
| config: { | ||
| dataSource: {}, | ||
| }, | ||
| }, | ||
| } as any, | ||
| logger, | ||
| ); | ||
|
|
||
| await expect( | ||
| hook.preCreate({ | ||
| clazz: BarService, | ||
| loadUnit: { | ||
| name: 'bar', | ||
| }, | ||
| } as any), | ||
| ).resolves.toBeUndefined(); | ||
| }); | ||
| }); |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check for existing multi-app tests in the DAL plugin
fd -i "MultiApp" tegg/plugin/dal/Repository: eggjs/egg
Length of output: 147
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Map the relevant files and look for multi-app coverage in the DAL plugin and related lifecycle tests.
printf '\n== Files ==\n'
git ls-files 'tegg/plugin/dal/**' | sed -n '1,200p'
printf '\n== MultiApp references under tegg/plugin/dal ==\n'
rg -n --hidden --glob 'tegg/plugin/dal/**' 'MultiApp|multi-app|multi app|multiApp'
printf '\n== TransactionPrototypeHook sources/tests ==\n'
fd -a 'TransactionPrototypeHook' tegg/plugin/dalRepository: eggjs/egg
Length of output: 1889
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '\n== TransactionPrototypeHook ==\n'
sed -n '1,220p' tegg/plugin/dal/src/lib/TransactionPrototypeHook.ts
printf '\n== transaction tests ==\n'
sed -n '1,260p' tegg/plugin/dal/test/transaction.test.ts
printf '\n== dal tests ==\n'
sed -n '1,260p' tegg/plugin/dal/test/dal.test.ts
printf '\n== MultiApp tests in tegg ==\n'
rg -n --hidden --glob 'tegg/**' 'MultiApp|multi-app|multi app|multiApp'Repository: eggjs/egg
Length of output: 10228
Add MultiApp regression coverage for TransactionPrototypeHook
tegg/plugin/dal/test/TransactionPrototypeHook.test.ts only covers single-app cases. Since this changes a lifecycle hook, add a MultiApp test to ensure two concurrent apps don’t cross-talk through module config or transaction setup.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@tegg/plugin/dal/test/TransactionPrototypeHook.test.ts` around lines 1 - 64,
Add a MultiApp regression test alongside the existing `TransactionPrototypeHook`
cases, creating two concurrent app/module configurations with distinct
dataSource or transaction settings and invoking `preCreate` for each. Assert
each hook uses only its own app’s configuration and transaction setup, with no
cross-talk, while preserving the existing single-app skip cases.
Source: Coding guidelines
| } else { | ||
| const teggSetup = importResolve('@eggjs/tegg-vitest/setup', { | ||
| paths: [flags.base, import.meta.dirname], | ||
| }); | ||
| setupFiles.unshift(teggSetup); | ||
| debug('auto add @eggjs/tegg-vitest/setup: %o', teggSetup); |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
Add error handling for @eggjs/tegg-vitest/setup resolution.
The runner resolution above (lines 241–251) wraps importResolve in try/catch for ImportResolveError, but the setup resolution on lines 256–258 does not. If an older @eggjs/tegg-vitest version is cached that has the ./runner export but not the new ./setup export, this will throw unhandled and crash egg-bin test.
🛡️ Proposed fix: mirror the runner resolution pattern
} else {
- const teggSetup = importResolve('`@eggjs/tegg-vitest/setup`', {
- paths: [flags.base, import.meta.dirname],
- });
- setupFiles.unshift(teggSetup);
- debug('auto add `@eggjs/tegg-vitest/setup`: %o', teggSetup);
+ try {
+ const teggSetup = importResolve('`@eggjs/tegg-vitest/setup`', {
+ paths: [flags.base, import.meta.dirname],
+ });
+ setupFiles.unshift(teggSetup);
+ debug('auto add `@eggjs/tegg-vitest/setup`: %o', teggSetup);
+ } catch (err) {
+ if (!(err instanceof ImportResolveError)) throw err;
+ debug('skip `@eggjs/tegg-vitest/setup`: not resolvable');
+ }
}📝 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.
| } else { | |
| const teggSetup = importResolve('@eggjs/tegg-vitest/setup', { | |
| paths: [flags.base, import.meta.dirname], | |
| }); | |
| setupFiles.unshift(teggSetup); | |
| debug('auto add @eggjs/tegg-vitest/setup: %o', teggSetup); | |
| } else { | |
| try { | |
| const teggSetup = importResolve('`@eggjs/tegg-vitest/setup`', { | |
| paths: [flags.base, import.meta.dirname], | |
| }); | |
| setupFiles.unshift(teggSetup); | |
| debug('auto add `@eggjs/tegg-vitest/setup`: %o', teggSetup); | |
| } catch (err) { | |
| if (!(err instanceof ImportResolveError)) throw err; | |
| debug('skip `@eggjs/tegg-vitest/setup`: not resolvable'); | |
| } | |
| } |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@tools/egg-bin/src/commands/test.ts` around lines 255 - 260, Wrap the
`@eggjs/tegg-vitest/setup` importResolve call in the same ImportResolveError
handling pattern used by the runner resolution above. When setup resolution
fails, continue without unshifting a setup file, while preserving the existing
successful-resolution behavior and debug logging.
## What Bring the branch that was used to publish `v4.1.2-beta.24` back into `next` so the source baseline matches the npm beta release. This supersedes #6032 because another manual release has already published beta.24 from `codex/release-beta24-patchless`. This includes: - the beta.21, beta.22, beta.23, and beta.24 release version commits - the beta.23 tegg vitest and dal fixes - the beta.24 tegg loader and dal-runtime fixes ## Why The old manual release workflow allows selecting an arbitrary `branch` input. The beta.24 run published from `codex/release-beta24-patchless`, not from `next`. npm beta now points to `egg@4.1.2-beta.24`, while `next` still contains `4.1.2-beta.20` in package manifests. Merging this PR first realigns `next` with the already-published beta line before moving future releases to the GitHub Release page flow. ## Validation - Confirmed `refs/tags/v4.1.2-beta.24` and `refs/heads/codex/release-beta24-patchless` both point to `1e9757ea` - Confirmed `egg@4.1.2-beta.24` is published on npm and the `beta` dist-tag points to it - Confirmed Git can auto-merge `origin/next` with `origin/codex/release-beta24-patchless` using `git merge-tree --write-tree` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Vitest now supports automatic setup and dynamic loading across ESM and CommonJS modules. * Templates are included automatically in built packages. * **Bug Fixes** * Improved transaction handling when no datasource is configured. * Loader discovery now excludes declaration files and Vitest configuration files. * **Release** * Updated package versions to the latest beta releases, including beta.24 updates across the ecosystem. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: GitHub Action <action@github.com>
What
Bring the branch that was used to publish
v4.1.2-beta.23back intonextso the source baseline matches the npm beta release.This includes:
Why
The successful manual release run checked out
codex/release-beta22-module-importereven though the Actions run page showsheadBranch=next. As a result, npm beta packages advanced to4.1.2-beta.23, butnextstayed behind at4.1.2-beta.20.Merging this PR first realigns
nextwith the already-published beta line before any further beta release is cut.Validation
v4.1.2-beta.23points atorigin/codex/release-beta22-module-importerorigin/nextwithorigin/codex/release-beta22-module-importerusinggit merge-tree --write-treeSummary by CodeRabbit
New Features
Bug Fixes
Chores