-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
deps(typebox): upgrade from @sinclair/typebox to typebox 1.0 #5745
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
Conversation
|
Warning Rate limit exceeded@fengmk2 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 4 minutes and 47 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (2)
WalkthroughThis pull request migrates the codebase from the scoped Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
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 |
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 focuses on upgrading the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. 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
|
Deploying egg with
|
| Latest commit: |
8f0347a
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://d06035f2.egg-cci.pages.dev |
| Branch Preview URL: | https://typebox-1-0.egg-cci.pages.dev |
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.
Code Review
This pull request successfully upgrades typebox from @sinclair/typebox to the new typebox v1.0 package. All changes, including package name updates, import statement adjustments for the new default export pattern, and re-export module modifications, are correctly implemented according to the migration guide. The test snapshots have been updated accordingly, and a notable improvement is the fix in a schema comparison test to use parsed JSON, making it more robust. The changes are thorough and well-executed.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## next #5745 +/- ##
==========================================
- Coverage 87.60% 87.29% -0.32%
==========================================
Files 563 563
Lines 10930 10930
Branches 1239 1239
==========================================
- Hits 9575 9541 -34
- Misses 1271 1298 +27
- Partials 84 91 +7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Deploying egg-v3 with
|
| Latest commit: |
8f0347a
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://18d294e5.egg-v3.pages.dev |
| Branch Preview URL: | https://typebox-1-0.egg-v3.pages.dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
tegg/standalone/standalone/test/fixtures/ajv-module/foo.ts (1)
23-23: Consider explicit test data instead ofas anycast.The
as anycast bypasses type checking. While this appears intentional for testing validation with invalid data, consider using an explicitly typed invalid object to make the test intent clearer.Optional: More explicit test data
- const body: RequestBody = {} as any; + const body = {} as RequestBody; // or explicitly define invalid test dataNote: If the intent is to test validation failures, the current approach works but could be more explicit about which fields are missing.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yamltegg/core/ajv-decorator/test/__snapshots__/index.test.ts.snapis excluded by!**/*.snap
📒 Files selected for processing (13)
packages/egg/src/ajv.ts(1 hunks)plugins/typebox-validate/package.json(1 hunks)plugins/typebox-validate/src/typebox.ts(1 hunks)plugins/typebox-validate/test/fixtures/apps/typebox-validate-test/app/controller/home.ts(1 hunks)plugins/typebox-validate/test/fixtures/apps/typebox-validate-test/app/service/home.ts(1 hunks)pnpm-workspace.yaml(2 hunks)tegg/core/ajv-decorator/package.json(1 hunks)tegg/core/ajv-decorator/src/index.ts(1 hunks)tegg/core/tegg/src/ajv.ts(1 hunks)tegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.ts(1 hunks)tegg/standalone/standalone/test/fixtures/ajv-module-pass/foo.ts(1 hunks)tegg/standalone/standalone/test/fixtures/ajv-module/foo.ts(1 hunks)tegg/standalone/standalone/test/index.test.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (14)
**/*.{ts,tsx,js,mjs}
📄 CodeRabbit inference engine (AGENTS.md)
Use
.tssources over CommonJS and prefer ESM for exports
Files:
tegg/standalone/standalone/test/index.test.tstegg/standalone/standalone/test/fixtures/ajv-module-pass/foo.tstegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.tstegg/core/ajv-decorator/src/index.tsplugins/typebox-validate/test/fixtures/apps/typebox-validate-test/app/controller/home.tsplugins/typebox-validate/src/typebox.tspackages/egg/src/ajv.tstegg/standalone/standalone/test/fixtures/ajv-module/foo.tsplugins/typebox-validate/test/fixtures/apps/typebox-validate-test/app/service/home.tstegg/core/tegg/src/ajv.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx}: Name classes in PascalCase
Name functions and variables in camelCase
**/*.{ts,tsx}: Use explicit return types for all exported functions, methods, and getters to support TypeScript's--isolatedDeclarationsflag
Avoid computed property names with symbols in class declarations; use override methods instead for compatibility with--isolatedDeclarations
Add explicit type annotations for class properties, particularly for exported symbols which should useunique symboltype
Enable strict mode in all TypeScript packages and use explicit return types for public APIs
Prefer interfaces over type aliases for object shapes in TypeScript
Use readonly modifiers where appropriate in TypeScript classes and interfaces
Avoidanytype; useunknownwhen type is truly unknown
Files:
tegg/standalone/standalone/test/index.test.tstegg/standalone/standalone/test/fixtures/ajv-module-pass/foo.tstegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.tstegg/core/ajv-decorator/src/index.tsplugins/typebox-validate/test/fixtures/apps/typebox-validate-test/app/controller/home.tsplugins/typebox-validate/src/typebox.tspackages/egg/src/ajv.tstegg/standalone/standalone/test/fixtures/ajv-module/foo.tsplugins/typebox-validate/test/fixtures/apps/typebox-validate-test/app/service/home.tstegg/core/tegg/src/ajv.ts
**/test/**/*.test.ts
📄 CodeRabbit inference engine (AGENTS.md)
Configure Vitest to discover
**/test/**/*.test.tswithin each package and mirror this pattern when adding test suites
Files:
tegg/standalone/standalone/test/index.test.ts
tegg/**/*.{js,ts,mjs,cjs}
📄 CodeRabbit inference engine (tegg/CLAUDE.md)
Use ESM only (no CommonJS)
Files:
tegg/standalone/standalone/test/index.test.tstegg/standalone/standalone/test/fixtures/ajv-module-pass/foo.tstegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.tstegg/core/ajv-decorator/src/index.tstegg/standalone/standalone/test/fixtures/ajv-module/foo.tstegg/core/tegg/src/ajv.ts
tegg/**/*.{ts,tsx}
📄 CodeRabbit inference engine (tegg/CLAUDE.md)
tegg/**/*.{ts,tsx}: Use decorators (@Inject(),@ContextProto(),@SingletonProto()) to define dependency injection and prototype scoping
ContextProto objects can inject any prototype, but SingletonProto cannot inject ContextProto
Use qualifiers (@InitTypeQualifier,@ModuleQualifier,@EggQualifier) when multiple implementations exist to disambiguate
Do not use circular dependencies between prototypes or modules
Use lifecycle hooks (@LifecyclePostConstruct(),@LifecyclePostInject(),@LifecyclePreDestroy(), etc.) for object initialization and cleanup
All imports should use.jsextensions for ESM files
Files:
tegg/standalone/standalone/test/index.test.tstegg/standalone/standalone/test/fixtures/ajv-module-pass/foo.tstegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.tstegg/core/ajv-decorator/src/index.tstegg/standalone/standalone/test/fixtures/ajv-module/foo.tstegg/core/tegg/src/ajv.ts
**/test/fixtures/**
📄 CodeRabbit inference engine (AGENTS.md)
Place reusable test data under
test/fixtures/
Files:
tegg/standalone/standalone/test/fixtures/ajv-module-pass/foo.tstegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.tsplugins/typebox-validate/test/fixtures/apps/typebox-validate-test/app/controller/home.tstegg/standalone/standalone/test/fixtures/ajv-module/foo.tsplugins/typebox-validate/test/fixtures/apps/typebox-validate-test/app/service/home.ts
plugins/*/package.json
📄 CodeRabbit inference engine (CLAUDE.md)
plugins/*/package.json: All plugins must include egg in peerDependencies and definebuild,clean, andprepublishOnlyscripts in package.json
Plugin packages must configure exports in package.json with both development (./src/*.ts) and published (./dist/*.js) entry points
Files:
plugins/typebox-validate/package.json
pnpm-workspace.yaml
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Define dependencies in pnpm-workspace.yaml catalog section and reference catalog entries with 'package-name': 'catalog:' or internal workspace dependencies with 'package-name': 'workspace:*'
Files:
pnpm-workspace.yaml
tegg/core/*/src/index.ts
📄 CodeRabbit inference engine (tegg/CLAUDE.md)
Core packages should export public API through
src/index.ts
Files:
tegg/core/ajv-decorator/src/index.ts
{packages,plugins}/**/*.{ts,tsx,js,mjs}
📄 CodeRabbit inference engine (AGENTS.md)
Name files in lowercase with hyphens (e.g.
loader-context.ts)
Files:
plugins/typebox-validate/test/fixtures/apps/typebox-validate-test/app/controller/home.tsplugins/typebox-validate/src/typebox.tspackages/egg/src/ajv.tsplugins/typebox-validate/test/fixtures/apps/typebox-validate-test/app/service/home.ts
packages/**/*.ts
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
packages/**/*.ts: Use TypeScript throughout all packages in the Eggjs monorepo
Use strict TypeScript mode in all packages
Files:
packages/egg/src/ajv.ts
packages/egg/src/**
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Work primarily in 'packages/egg/src/' for core framework features, organizing into lib/, app/extend/, config/, and lib/loader/ directories
Files:
packages/egg/src/ajv.ts
tegg/**/package.json
📄 CodeRabbit inference engine (tegg/CLAUDE.md)
tegg/**/package.json: Node.js version must be >= 22.18.0
Egg.js version must be >= 4.1.0
Useworkspace:*protocol for internal monorepo dependencies (both tegg and egg packages)
Files:
tegg/core/ajv-decorator/package.json
tegg/core/*/package.json
📄 CodeRabbit inference engine (tegg/CLAUDE.md)
New core packages should include standard scripts in
package.jsonwithtypecheckscript using tsgo
Files:
tegg/core/ajv-decorator/package.json
🧠 Learnings (38)
📓 Common learnings
Learnt from: CR
Repo: eggjs/egg PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-20T09:24:59.960Z
Learning: Re-export types thoughtfully to keep the public API stable
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-21T03:04:53.982Z
Learning: All packages must use oxlint for linting with the `--type-aware` flag; remove any `.eslintrc` or `.eslintrc.js` files when migrating
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-21T03:04:53.982Z
Learning: Applies to test/**/*.test.ts : Use standard assertions with Node.js built-in `assert` module in test files instead of external assertion libraries
Learnt from: CR
Repo: eggjs/egg PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-27T14:37:59.711Z
Learning: Applies to packages/**/test/**/*.test.ts : Use Node.js built-in 'assert' module for assertions in tests
Learnt from: CR
Repo: eggjs/egg PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-27T14:37:59.711Z
Learning: Applies to packages/**/*.ts : Use TypeScript throughout all packages in the Eggjs monorepo
📚 Learning: 2025-12-21T03:04:53.982Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-21T03:04:53.982Z
Learning: Applies to test/**/*.test.ts : Use standard assertions with Node.js built-in `assert` module in test files instead of external assertion libraries
Applied to files:
tegg/standalone/standalone/test/index.test.tstegg/standalone/standalone/test/fixtures/ajv-module/foo.ts
📚 Learning: 2025-11-27T14:37:59.711Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-27T14:37:59.711Z
Learning: Applies to packages/**/test/**/*.test.ts : Use Node.js built-in 'assert' module for assertions in tests
Applied to files:
tegg/standalone/standalone/test/index.test.tstegg/standalone/standalone/test/fixtures/ajv-module/foo.ts
📚 Learning: 2025-12-20T09:24:59.960Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-20T09:24:59.960Z
Learning: Add regression cases that exercise both CommonJS and TypeScript example apps when features affect HTTP or process orchestration
Applied to files:
tegg/standalone/standalone/test/index.test.ts
📚 Learning: 2025-12-21T03:05:13.313Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-12-21T03:05:13.313Z
Learning: Applies to tegg/**/__tests__/**/*.test.{ts,tsx,js} : Use Vitest for testing all tegg packages
Applied to files:
tegg/standalone/standalone/test/index.test.ts
📚 Learning: 2025-12-21T03:05:13.313Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-12-21T03:05:13.313Z
Learning: Applies to tegg/**/*.{ts,tsx} : Use qualifiers (`InitTypeQualifier`, `ModuleQualifier`, `EggQualifier`) when multiple implementations exist to disambiguate
Applied to files:
tegg/standalone/standalone/test/fixtures/ajv-module-pass/foo.ts
📚 Learning: 2025-12-21T03:04:53.982Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-21T03:04:53.982Z
Learning: All packages must define a `src/types.ts` file that extends the Egg module declarations using `declare module 'egg'` pattern
Applied to files:
tegg/standalone/standalone/test/fixtures/ajv-module-pass/foo.tsplugins/typebox-validate/package.jsontegg/core/ajv-decorator/src/index.tspackages/egg/src/ajv.ts
📚 Learning: 2025-12-20T09:24:59.960Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-20T09:24:59.960Z
Learning: Re-export types thoughtfully to keep the public API stable
Applied to files:
tegg/standalone/standalone/test/fixtures/ajv-module-pass/foo.tstegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.tstegg/core/ajv-decorator/src/index.tsplugins/typebox-validate/test/fixtures/apps/typebox-validate-test/app/controller/home.tsplugins/typebox-validate/src/typebox.tspackages/egg/src/ajv.tstegg/standalone/standalone/test/fixtures/ajv-module/foo.tsplugins/typebox-validate/test/fixtures/apps/typebox-validate-test/app/service/home.ts
📚 Learning: 2025-12-21T03:05:13.313Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-12-21T03:05:13.313Z
Learning: Applies to tegg/**/*.{ts,tsx} : Do not use circular dependencies between prototypes or modules
Applied to files:
tegg/standalone/standalone/test/fixtures/ajv-module-pass/foo.tstegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.ts
📚 Learning: 2025-12-21T03:04:53.982Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-21T03:04:53.982Z
Learning: Applies to **/*.{ts,tsx} : Add explicit type annotations for class properties, particularly for exported symbols which should use `unique symbol` type
Applied to files:
tegg/standalone/standalone/test/fixtures/ajv-module-pass/foo.tstegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.tstegg/core/ajv-decorator/src/index.tsplugins/typebox-validate/test/fixtures/apps/typebox-validate-test/app/controller/home.tsplugins/typebox-validate/src/typebox.tstegg/standalone/standalone/test/fixtures/ajv-module/foo.tsplugins/typebox-validate/test/fixtures/apps/typebox-validate-test/app/service/home.ts
📚 Learning: 2025-12-21T03:05:13.313Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-12-21T03:05:13.313Z
Learning: Applies to tegg/core/*/src/index.ts : Core packages should export public API through `src/index.ts`
Applied to files:
tegg/standalone/standalone/test/fixtures/ajv-module-pass/foo.tstegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.tstegg/core/ajv-decorator/src/index.tsplugins/typebox-validate/test/fixtures/apps/typebox-validate-test/app/controller/home.tsplugins/typebox-validate/src/typebox.tspackages/egg/src/ajv.tstegg/core/tegg/src/ajv.ts
📚 Learning: 2025-12-21T03:04:53.982Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-21T03:04:53.982Z
Learning: Applies to **/*.{ts,tsx} : Use explicit return types for all exported functions, methods, and getters to support TypeScript's `--isolatedDeclarations` flag
Applied to files:
tegg/standalone/standalone/test/fixtures/ajv-module-pass/foo.tstegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.tstegg/core/ajv-decorator/src/index.tsplugins/typebox-validate/test/fixtures/apps/typebox-validate-test/app/controller/home.tsplugins/typebox-validate/src/typebox.tstegg/standalone/standalone/test/fixtures/ajv-module/foo.tsplugins/typebox-validate/test/fixtures/apps/typebox-validate-test/app/service/home.ts
📚 Learning: 2025-11-27T14:37:59.711Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-27T14:37:59.711Z
Learning: Applies to packages/**/*.ts : Use TypeScript throughout all packages in the Eggjs monorepo
Applied to files:
tegg/standalone/standalone/test/fixtures/ajv-module-pass/foo.tsplugins/typebox-validate/package.jsontegg/core/ajv-decorator/src/index.tspackages/egg/src/ajv.ts
📚 Learning: 2025-12-21T03:05:13.313Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-12-21T03:05:13.313Z
Learning: Applies to tegg/**/*.{ts,tsx} : All imports should use `.js` extensions for ESM files
Applied to files:
tegg/standalone/standalone/test/fixtures/ajv-module-pass/foo.tstegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.tstegg/standalone/standalone/test/fixtures/ajv-module/foo.ts
📚 Learning: 2025-12-21T03:05:13.313Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-12-21T03:05:13.313Z
Learning: Applies to tegg/**/*.{js,ts,mjs,cjs} : Use ESM only (no CommonJS)
Applied to files:
tegg/standalone/standalone/test/fixtures/ajv-module-pass/foo.tspackages/egg/src/ajv.tstegg/standalone/standalone/test/fixtures/ajv-module/foo.ts
📚 Learning: 2025-12-21T03:05:13.313Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-12-21T03:05:13.313Z
Learning: Applies to tegg/**/*.{ts,tsx} : Use decorators (`Inject()`, `ContextProto()`, `SingletonProto()`) to define dependency injection and prototype scoping
Applied to files:
tegg/standalone/standalone/test/fixtures/ajv-module-pass/foo.tstegg/core/ajv-decorator/src/index.tstegg/standalone/standalone/test/fixtures/ajv-module/foo.tstegg/core/tegg/src/ajv.ts
📚 Learning: 2025-12-21T03:05:13.313Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-12-21T03:05:13.313Z
Learning: Applies to tegg/**/*.{ts,tsx} : ContextProto objects can inject any prototype, but SingletonProto cannot inject ContextProto
Applied to files:
tegg/standalone/standalone/test/fixtures/ajv-module-pass/foo.tstegg/standalone/standalone/test/fixtures/ajv-module/foo.ts
📚 Learning: 2025-12-21T03:05:13.313Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-12-21T03:05:13.313Z
Learning: Applies to tegg/**/__tests__/**/*.test.{ts,tsx} : Use `MockApplication` from `eggjs/mock` for testing with `mockModuleContextScope()` to create context scope
Applied to files:
tegg/standalone/standalone/test/fixtures/ajv-module-pass/foo.tstegg/standalone/standalone/test/fixtures/ajv-module/foo.ts
📚 Learning: 2025-12-21T03:05:13.313Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-12-21T03:05:13.313Z
Learning: Applies to tegg/**/package.json : Egg.js version must be >= 4.1.0
Applied to files:
tegg/standalone/standalone/test/fixtures/ajv-module-pass/foo.tstegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.tspnpm-workspace.yamlpackages/egg/src/ajv.tstegg/standalone/standalone/test/fixtures/ajv-module/foo.tstegg/core/ajv-decorator/package.json
📚 Learning: 2025-12-21T03:05:13.313Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-12-21T03:05:13.313Z
Learning: Applies to tegg/core/*/package.json : New core packages should include standard scripts in `package.json` with `typecheck` script using tsgo
Applied to files:
plugins/typebox-validate/package.jsontegg/core/ajv-decorator/package.json
📚 Learning: 2025-12-21T03:04:53.982Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-21T03:04:53.982Z
Learning: All packages must include TypeScript type checking with `tsc --noEmit` in the `typecheck` script
Applied to files:
plugins/typebox-validate/package.jsontegg/core/ajv-decorator/package.json
📚 Learning: 2025-12-21T03:05:13.313Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-12-21T03:05:13.313Z
Learning: Applies to tegg/**/package.json : Use `workspace:*` protocol for internal monorepo dependencies (both tegg and egg packages)
Applied to files:
plugins/typebox-validate/package.jsonpackages/egg/src/ajv.ts
📚 Learning: 2025-12-21T03:05:13.313Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-12-21T03:05:13.313Z
Learning: Applies to tegg/**/pnpm-workspace.yaml : Use pnpm workspaces with `catalog:` protocol for shared external dependencies
Applied to files:
plugins/typebox-validate/package.jsonpnpm-workspace.yaml
📚 Learning: 2025-12-21T03:05:13.313Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-12-21T03:05:13.313Z
Learning: Applies to tegg/**/.oxlintrc.json : Run oxlint with `--type-aware` flag for enhanced TypeScript checking on all packages
Applied to files:
plugins/typebox-validate/package.jsontegg/core/ajv-decorator/package.json
📚 Learning: 2025-12-20T09:24:59.960Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-20T09:24:59.960Z
Learning: Applies to **/*.{ts,tsx,js,mjs} : Use `.ts` sources over CommonJS and prefer ESM for exports
Applied to files:
tegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.tstegg/core/ajv-decorator/src/index.tstegg/standalone/standalone/test/fixtures/ajv-module/foo.ts
📚 Learning: 2025-12-21T03:04:53.982Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-21T03:04:53.982Z
Learning: Applies to **/*.{ts,tsx} : Enable strict mode in all TypeScript packages and use explicit return types for public APIs
Applied to files:
tegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.tstegg/core/ajv-decorator/src/index.tsplugins/typebox-validate/test/fixtures/apps/typebox-validate-test/app/controller/home.tsplugins/typebox-validate/src/typebox.tstegg/standalone/standalone/test/fixtures/ajv-module/foo.tsplugins/typebox-validate/test/fixtures/apps/typebox-validate-test/app/service/home.ts
📚 Learning: 2025-11-27T14:37:59.711Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-27T14:37:59.711Z
Learning: Applies to packages/**/test/**/*.test.ts : Use 'import { describe, it } from "vitest"' for test functions in Vitest test files
Applied to files:
tegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.tsplugins/typebox-validate/test/fixtures/apps/typebox-validate-test/app/controller/home.tstegg/standalone/standalone/test/fixtures/ajv-module/foo.ts
📚 Learning: 2025-12-21T03:04:53.982Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-21T03:04:53.982Z
Learning: Applies to **/*.{ts,tsx} : Prefer interfaces over type aliases for object shapes in TypeScript
Applied to files:
tegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.tsplugins/typebox-validate/test/fixtures/apps/typebox-validate-test/app/controller/home.ts
📚 Learning: 2025-11-27T14:37:59.711Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-27T14:37:59.711Z
Learning: Applies to pnpm-workspace.yaml : Define dependencies in pnpm-workspace.yaml catalog section and reference catalog entries with 'package-name': 'catalog:' or internal workspace dependencies with 'package-name': 'workspace:*'
Applied to files:
pnpm-workspace.yaml
📚 Learning: 2025-12-21T03:04:53.982Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-21T03:04:53.982Z
Learning: Applies to package.json : Use `workspace:*` for internal package dependencies and `catalog:` for external dependencies defined in pnpm-workspace.yaml
Applied to files:
pnpm-workspace.yaml
📚 Learning: 2025-12-21T03:05:13.313Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-12-21T03:05:13.313Z
Learning: Applies to tegg/**/pnpm-workspace.yaml : Centralize all shared dependency versions in the root `pnpm-workspace.yaml` rather than in individual tegg package files
Applied to files:
pnpm-workspace.yaml
📚 Learning: 2025-12-21T03:04:53.982Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-21T03:04:53.982Z
Learning: All packages in this monorepo require Node.js >= 22.18.0 - enforce this minimum version across all packages for compatibility with modern JavaScript features and optimal performance
Applied to files:
pnpm-workspace.yaml
📚 Learning: 2025-12-21T03:05:13.313Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-12-21T03:05:13.313Z
Learning: Applies to tegg/**/package.json : Node.js version must be >= 22.18.0
Applied to files:
pnpm-workspace.yamltegg/core/ajv-decorator/package.json
📚 Learning: 2025-12-21T03:05:13.313Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-12-21T03:05:13.313Z
Learning: Applies to tegg/**/tsconfig.json : Use `emitDecoratorMetadata` in TypeScript configuration for type inference in dependency injection
Applied to files:
tegg/core/ajv-decorator/src/index.tstegg/core/ajv-decorator/package.jsontegg/core/tegg/src/ajv.ts
📚 Learning: 2025-12-21T03:04:53.982Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-21T03:04:53.982Z
Learning: Applies to {tsdown,vitest}.config.ts : Use typed intermediate variables for tsdown and vitest config exports with explicit UserConfig/UserWorkspaceConfig type annotations
Applied to files:
plugins/typebox-validate/test/fixtures/apps/typebox-validate-test/app/controller/home.tsplugins/typebox-validate/test/fixtures/apps/typebox-validate-test/app/service/home.ts
📚 Learning: 2025-12-20T09:24:59.960Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-20T09:24:59.960Z
Learning: Applies to **/*.{ts,tsx} : Name classes in PascalCase
Applied to files:
plugins/typebox-validate/test/fixtures/apps/typebox-validate-test/app/controller/home.ts
📚 Learning: 2025-12-21T03:04:53.982Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-21T03:04:53.982Z
Learning: Applies to **/*.{ts,tsx} : Use readonly modifiers where appropriate in TypeScript classes and interfaces
Applied to files:
plugins/typebox-validate/test/fixtures/apps/typebox-validate-test/app/controller/home.ts
📚 Learning: 2025-12-21T03:05:13.313Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-12-21T03:05:13.313Z
Learning: Applies to tegg/core/*/tsconfig.json : Each new core package should include `tsconfig.json` extending `eggjs/tsconfig`
Applied to files:
packages/egg/src/ajv.ts
⏰ 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). (21)
- GitHub Check: Prepare
- GitHub Check: Test (ubuntu-latest, 24, 2/3)
- GitHub Check: Test (windows-latest, 22, 1/3)
- GitHub Check: Test (macos-latest, 24, 2/3)
- GitHub Check: Test (windows-latest, 20, 2/3)
- GitHub Check: Test (windows-latest, 20, 1/3)
- GitHub Check: Test (macos-latest, 24, 3/3)
- GitHub Check: Test (macos-latest, 24, 1/3)
- GitHub Check: Test (windows-latest, 22, 2/3)
- GitHub Check: Test (ubuntu-latest, 22, 1/3)
- GitHub Check: Test (macos-latest, 22, 1/3)
- GitHub Check: Test (macos-latest, 22, 2/3)
- GitHub Check: Test bin (ubuntu-latest, 24, 2/3)
- GitHub Check: Test bin (ubuntu-latest, 24, 0/3)
- GitHub Check: Test bin (windows-latest, 24, 1/3)
- GitHub Check: Test bin (windows-latest, 24, 0/3)
- GitHub Check: Test bin (windows-latest, 24, 2/3)
- GitHub Check: Test bin (ubuntu-latest, 24, 1/3)
- GitHub Check: typecheck
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Cloudflare Pages: egg-v3
🔇 Additional comments (15)
tegg/standalone/standalone/test/fixtures/ajv-module/foo.ts (2)
2-2: LGTM! Import correctly updated to default export pattern.The import statement properly uses the default export for
Typewhile preserving named imports forAjv,Static, andTransformEnum. This aligns with the typebox 1.0 migration strategy.
5-12: Schema definition correctly uses imported Type object.The schema definition seamlessly uses the default-imported
Typeobject with no behavioral changes. The existing usage pattern (Type.Object,Type.String, etc.) remains compatible with the new import style.plugins/typebox-validate/package.json (1)
61-62: LGTM! Dependency migration to typebox is correct.The dependency update from
@sinclair/typeboxtotypeboxusing thecatalog:protocol aligns with the TypeBox 1.0 migration strategy.pnpm-workspace.yaml (2)
227-227: LGTM! Appropriate exclusion for new major version.Adding
typeboxtominimumReleaseAgeExcludeis appropriate since this is a newly released major version that the project needs to adopt immediately.
21-21: Version 1.0.65 of thetypeboxpackage cannot be verified on npm.While TypeBox 1.0 was released around September 2025, the actual
typeboxnpm package with version 1.0.65 does not appear to be publicly available. The official @sinclair/typebox package remains at version 0.34.41. Verify that the correct package name and version are being used, or confirm whether this migration is to an unreleased version.tegg/core/ajv-decorator/package.json (1)
44-45: LGTM! Dependency migration is consistent.The dependency update from
@sinclair/typeboxtotypeboxusing thecatalog:protocol is correct and consistent with the workspace-wide migration.tegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.ts (1)
2-2: LGTM! Import pattern correctly updated for TypeBox 1.0.The import statement correctly adapts to the new default export pattern where
Typeis imported as the default export, while other exports remain as named imports.tegg/standalone/standalone/test/fixtures/ajv-module-pass/foo.ts (1)
2-2: LGTM! Consistent import pattern update.The import statement correctly uses the TypeBox 1.0 default export pattern, consistent with other fixtures in the codebase.
tegg/standalone/standalone/test/index.test.ts (1)
309-317: LGTM! More robust schema comparison.The change from string comparison to parsing and comparing the schema as a JSON object is more resilient to property ordering differences in TypeBox 1.0 and represents a testing best practice.
tegg/core/tegg/src/ajv.ts (1)
2-2: LGTM! Default export re-exported for API completeness.Adding the default export re-export ensures that consumers can access the TypeBox
Typedefault export through@eggjs/tegg/ajv, maintaining a complete and stable public API surface.Based on learnings, this thoughtfully preserves API stability.
plugins/typebox-validate/src/typebox.ts (1)
1-4: LGTM! Re-export pattern maintains API stability.The re-export strategy correctly adapts to TypeBox 1.0's default export pattern while maintaining backward compatibility for existing consumers.
packages/egg/src/ajv.ts (1)
2-2: LGTM! Default export re-export maintains API stability.The addition of the default export re-export alongside the existing star export preserves backward compatibility while enabling the new typebox 1.0 default import pattern. This aligns with the learning to re-export types thoughtfully.
plugins/typebox-validate/test/fixtures/apps/typebox-validate-test/app/service/home.ts (1)
4-4: LGTM! Import correctly updated for typebox 1.0.The change from named import to default import for
Typecorrectly reflects the typebox 1.0 migration pattern, whileStaticremains as a type-only named export. The usage ofType.Pickon line 9 works identically with this import style.plugins/typebox-validate/test/fixtures/apps/typebox-validate-test/app/controller/home.ts (1)
4-4: LGTM! Import pattern correctly migrated.The import statement properly updates to use
Typeas a default import while keepingStatic,TObject, andTPropertiesas named type imports. All usage sites (lines 6-27) work correctly with this import pattern.tegg/core/ajv-decorator/src/index.ts (1)
1-4: Typebox 1.0 default export pattern is correct.The code correctly imports
Typeas the default export fromtypeboxand re-exports it while maintaining all named exports. TypeBox documentation confirms this pattern withimport Type from 'typebox', establishing the proper re-export chain for downstream consumers. The migration assumption is valid.
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 successfully migrates the codebase from @sinclair/typebox v0.34.x to the new typebox v1.0.x package. The migration follows the official typebox v1.0 migration guide, adapting to the package rename and new default export pattern.
Key changes:
- Updated package dependency from
@sinclair/typeboxtotypeboxv1.0.65 across all consuming packages - Converted all Type imports to use default export pattern instead of named exports
- Added default export re-exports in wrapper modules for compatibility
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-workspace.yaml | Updated catalog with new typebox package and added to minimumReleaseAgeExclude |
| pnpm-lock.yaml | Lockfile updates reflecting the dependency migration |
| tegg/core/ajv-decorator/src/index.ts | Added default Type import and export for new package structure |
| tegg/core/ajv-decorator/package.json | Replaced @sinclair/typebox with typebox dependency |
| tegg/core/ajv-decorator/test/snapshots/index.test.ts.snap | Updated snapshot to reflect new typebox v1.0 API exports |
| tegg/core/tegg/src/ajv.ts | Added default export passthrough for Type |
| packages/egg/src/ajv.ts | Added default export passthrough for Type |
| plugins/typebox-validate/src/typebox.ts | Added default Type import and export wrapper |
| plugins/typebox-validate/package.json | Replaced @sinclair/typebox with typebox dependency |
| tegg/standalone/standalone/test/fixtures/ajv-module/foo.ts | Updated import to use default export for Type |
| tegg/standalone/standalone/test/fixtures/ajv-module-pass/foo.ts | Updated import to use default export for Type |
| tegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.ts | Updated import to use default export for Type |
| plugins/typebox-validate/test/fixtures/apps/typebox-validate-test/app/controller/home.ts | Updated import to use default export for Type |
| plugins/typebox-validate/test/fixtures/apps/typebox-validate-test/app/service/home.ts | Updated import to use default export for Type |
| tegg/standalone/standalone/test/index.test.ts | Fixed schema comparison to use JSON.parse for property order independence |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
close #5656 Migrate from @sinclair/typebox v0.34.x to the new typebox v1.0.x package following the official migration guide. Key changes: - Package name changed from @sinclair/typebox to typebox - Type export now uses default export pattern - Updated all import statements to use default export for Type - Added default export re-exports in tegg/ajv and egg/ajv modules - Updated test snapshots for new typebox API exports - Fixed schema comparison test to use parsed JSON (property order changed) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
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: 1
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (3)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yamltegg/core/ajv-decorator/test/__snapshots__/index.test.ts.snapis excluded by!**/*.snaptegg/core/tegg/test/__snapshots__/ajv.test.ts.snapis excluded by!**/*.snap
📒 Files selected for processing (13)
packages/egg/src/ajv.ts(1 hunks)plugins/typebox-validate/package.json(1 hunks)plugins/typebox-validate/src/typebox.ts(1 hunks)plugins/typebox-validate/test/fixtures/apps/typebox-validate-test/app/controller/home.ts(1 hunks)plugins/typebox-validate/test/fixtures/apps/typebox-validate-test/app/service/home.ts(1 hunks)pnpm-workspace.yaml(2 hunks)tegg/core/ajv-decorator/package.json(1 hunks)tegg/core/ajv-decorator/src/index.ts(1 hunks)tegg/core/tegg/src/ajv.ts(1 hunks)tegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.ts(1 hunks)tegg/standalone/standalone/test/fixtures/ajv-module-pass/foo.ts(1 hunks)tegg/standalone/standalone/test/fixtures/ajv-module/foo.ts(1 hunks)tegg/standalone/standalone/test/index.test.ts(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (6)
- pnpm-workspace.yaml
- tegg/standalone/standalone/test/fixtures/ajv-module/foo.ts
- plugins/typebox-validate/test/fixtures/apps/typebox-validate-test/app/controller/home.ts
- tegg/core/ajv-decorator/package.json
- plugins/typebox-validate/test/fixtures/apps/typebox-validate-test/app/service/home.ts
- tegg/standalone/standalone/test/fixtures/ajv-module-pass/foo.ts
🧰 Additional context used
📓 Path-based instructions (11)
packages/**/*.ts
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
packages/**/*.ts: Use TypeScript throughout all packages in the Eggjs monorepo
Use strict TypeScript mode in all packages
Files:
packages/egg/src/ajv.ts
packages/egg/src/**
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Work primarily in 'packages/egg/src/' for core framework features, organizing into lib/, app/extend/, config/, and lib/loader/ directories
Files:
packages/egg/src/ajv.ts
**/*.{ts,tsx,js,mjs}
📄 CodeRabbit inference engine (AGENTS.md)
Use
.tssources over CommonJS and prefer ESM for exports
Files:
packages/egg/src/ajv.tsplugins/typebox-validate/src/typebox.tstegg/standalone/standalone/test/index.test.tstegg/core/tegg/src/ajv.tstegg/core/ajv-decorator/src/index.tstegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.ts
{packages,plugins}/**/*.{ts,tsx,js,mjs}
📄 CodeRabbit inference engine (AGENTS.md)
Name files in lowercase with hyphens (e.g.
loader-context.ts)
Files:
packages/egg/src/ajv.tsplugins/typebox-validate/src/typebox.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx}: Name classes in PascalCase
Name functions and variables in camelCase
**/*.{ts,tsx}: Use explicit return types for all exported functions, methods, and getters to support TypeScript's--isolatedDeclarationsflag
Avoid computed property names with symbols in class declarations; use override methods instead for compatibility with--isolatedDeclarations
Add explicit type annotations for class properties, particularly for exported symbols which should useunique symboltype
Enable strict mode in all TypeScript packages and use explicit return types for public APIs
Prefer interfaces over type aliases for object shapes in TypeScript
Use readonly modifiers where appropriate in TypeScript classes and interfaces
Avoidanytype; useunknownwhen type is truly unknown
Files:
packages/egg/src/ajv.tsplugins/typebox-validate/src/typebox.tstegg/standalone/standalone/test/index.test.tstegg/core/tegg/src/ajv.tstegg/core/ajv-decorator/src/index.tstegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.ts
**/test/**/*.test.ts
📄 CodeRabbit inference engine (AGENTS.md)
Configure Vitest to discover
**/test/**/*.test.tswithin each package and mirror this pattern when adding test suites
Files:
tegg/standalone/standalone/test/index.test.ts
tegg/**/*.{js,ts,mjs,cjs}
📄 CodeRabbit inference engine (tegg/CLAUDE.md)
Use ESM only (no CommonJS)
Files:
tegg/standalone/standalone/test/index.test.tstegg/core/tegg/src/ajv.tstegg/core/ajv-decorator/src/index.tstegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.ts
tegg/**/*.{ts,tsx}
📄 CodeRabbit inference engine (tegg/CLAUDE.md)
tegg/**/*.{ts,tsx}: Use decorators (@Inject(),@ContextProto(),@SingletonProto()) to define dependency injection and prototype scoping
ContextProto objects can inject any prototype, but SingletonProto cannot inject ContextProto
Use qualifiers (@InitTypeQualifier,@ModuleQualifier,@EggQualifier) when multiple implementations exist to disambiguate
Do not use circular dependencies between prototypes or modules
Use lifecycle hooks (@LifecyclePostConstruct(),@LifecyclePostInject(),@LifecyclePreDestroy(), etc.) for object initialization and cleanup
All imports should use.jsextensions for ESM files
Files:
tegg/standalone/standalone/test/index.test.tstegg/core/tegg/src/ajv.tstegg/core/ajv-decorator/src/index.tstegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.ts
plugins/*/package.json
📄 CodeRabbit inference engine (CLAUDE.md)
plugins/*/package.json: All plugins must include egg in peerDependencies and definebuild,clean, andprepublishOnlyscripts in package.json
Plugin packages must configure exports in package.json with both development (./src/*.ts) and published (./dist/*.js) entry points
Files:
plugins/typebox-validate/package.json
tegg/core/*/src/index.ts
📄 CodeRabbit inference engine (tegg/CLAUDE.md)
Core packages should export public API through
src/index.ts
Files:
tegg/core/ajv-decorator/src/index.ts
**/test/fixtures/**
📄 CodeRabbit inference engine (AGENTS.md)
Place reusable test data under
test/fixtures/
Files:
tegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.ts
🧠 Learnings (24)
📓 Common learnings
Learnt from: CR
Repo: eggjs/egg PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-20T09:24:59.960Z
Learning: Re-export types thoughtfully to keep the public API stable
Learnt from: CR
Repo: eggjs/egg PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-27T14:37:59.711Z
Learning: Applies to packages/**/test/**/*.test.ts : Use Node.js built-in 'assert' module for assertions in tests
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-21T03:04:53.982Z
Learning: Applies to test/**/*.test.ts : Use standard assertions with Node.js built-in `assert` module in test files instead of external assertion libraries
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-12-21T03:05:13.313Z
Learning: Applies to tegg/core/*/package.json : New core packages should include standard scripts in `package.json` with `typecheck` script using tsgo
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-21T03:04:53.982Z
Learning: All packages must include TypeScript type checking with `tsc --noEmit` in the `typecheck` script
Learnt from: CR
Repo: eggjs/egg PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-27T14:37:59.711Z
Learning: Applies to packages/**/*.ts : Use TypeScript throughout all packages in the Eggjs monorepo
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-21T03:04:53.982Z
Learning: Applies to **/*.{ts,tsx} : Enable strict mode in all TypeScript packages and use explicit return types for public APIs
Learnt from: CR
Repo: eggjs/egg PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-20T09:24:59.960Z
Learning: Add regression cases that exercise both CommonJS and TypeScript example apps when features affect HTTP or process orchestration
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-21T03:04:53.982Z
Learning: Applies to **/*.{ts,tsx} : Add explicit type annotations for class properties, particularly for exported symbols which should use `unique symbol` type
📚 Learning: 2025-12-21T03:05:13.313Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-12-21T03:05:13.313Z
Learning: Applies to tegg/core/*/src/index.ts : Core packages should export public API through `src/index.ts`
Applied to files:
packages/egg/src/ajv.tsplugins/typebox-validate/src/typebox.tstegg/core/tegg/src/ajv.tstegg/core/ajv-decorator/src/index.tstegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.ts
📚 Learning: 2025-12-21T03:04:53.982Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-21T03:04:53.982Z
Learning: All packages must define a `src/types.ts` file that extends the Egg module declarations using `declare module 'egg'` pattern
Applied to files:
packages/egg/src/ajv.tsplugins/typebox-validate/package.jsontegg/core/ajv-decorator/src/index.tstegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.ts
📚 Learning: 2025-11-27T14:37:59.711Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-27T14:37:59.711Z
Learning: Applies to packages/**/*.ts : Use TypeScript throughout all packages in the Eggjs monorepo
Applied to files:
packages/egg/src/ajv.tsplugins/typebox-validate/package.jsontegg/core/ajv-decorator/src/index.tstegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.ts
📚 Learning: 2025-12-20T09:24:59.960Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-20T09:24:59.960Z
Learning: Re-export types thoughtfully to keep the public API stable
Applied to files:
packages/egg/src/ajv.tsplugins/typebox-validate/src/typebox.tstegg/core/ajv-decorator/src/index.tstegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.ts
📚 Learning: 2025-12-21T03:05:13.313Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-12-21T03:05:13.313Z
Learning: Applies to tegg/**/package.json : Egg.js version must be >= 4.1.0
Applied to files:
packages/egg/src/ajv.tstegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.ts
📚 Learning: 2025-12-21T03:05:13.313Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-12-21T03:05:13.313Z
Learning: Applies to tegg/**/package.json : Use `workspace:*` protocol for internal monorepo dependencies (both tegg and egg packages)
Applied to files:
packages/egg/src/ajv.tsplugins/typebox-validate/package.json
📚 Learning: 2025-12-21T03:05:13.313Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-12-21T03:05:13.313Z
Learning: Applies to tegg/**/*.{js,ts,mjs,cjs} : Use ESM only (no CommonJS)
Applied to files:
packages/egg/src/ajv.tstegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.ts
📚 Learning: 2025-12-21T03:04:53.982Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-21T03:04:53.982Z
Learning: Applies to **/*.{ts,tsx} : Use explicit return types for all exported functions, methods, and getters to support TypeScript's `--isolatedDeclarations` flag
Applied to files:
plugins/typebox-validate/src/typebox.tstegg/core/ajv-decorator/src/index.ts
📚 Learning: 2025-12-21T03:04:53.982Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-21T03:04:53.982Z
Learning: Applies to **/*.{ts,tsx} : Add explicit type annotations for class properties, particularly for exported symbols which should use `unique symbol` type
Applied to files:
plugins/typebox-validate/src/typebox.tstegg/core/ajv-decorator/src/index.ts
📚 Learning: 2025-12-21T03:04:53.982Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-21T03:04:53.982Z
Learning: Applies to **/*.{ts,tsx} : Enable strict mode in all TypeScript packages and use explicit return types for public APIs
Applied to files:
plugins/typebox-validate/src/typebox.tstegg/core/ajv-decorator/src/index.ts
📚 Learning: 2025-12-21T03:04:53.982Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-21T03:04:53.982Z
Learning: Applies to test/**/*.test.ts : Use standard assertions with Node.js built-in `assert` module in test files instead of external assertion libraries
Applied to files:
tegg/standalone/standalone/test/index.test.ts
📚 Learning: 2025-11-27T14:37:59.711Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-27T14:37:59.711Z
Learning: Applies to packages/**/test/**/*.test.ts : Use Node.js built-in 'assert' module for assertions in tests
Applied to files:
tegg/standalone/standalone/test/index.test.ts
📚 Learning: 2025-12-20T09:24:59.960Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-20T09:24:59.960Z
Learning: Add regression cases that exercise both CommonJS and TypeScript example apps when features affect HTTP or process orchestration
Applied to files:
tegg/standalone/standalone/test/index.test.ts
📚 Learning: 2025-12-21T03:05:13.313Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-12-21T03:05:13.313Z
Learning: Applies to tegg/core/*/package.json : New core packages should include standard scripts in `package.json` with `typecheck` script using tsgo
Applied to files:
plugins/typebox-validate/package.json
📚 Learning: 2025-12-21T03:04:53.982Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-21T03:04:53.982Z
Learning: All packages must include TypeScript type checking with `tsc --noEmit` in the `typecheck` script
Applied to files:
plugins/typebox-validate/package.json
📚 Learning: 2025-12-21T03:05:13.313Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-12-21T03:05:13.313Z
Learning: Applies to tegg/**/pnpm-workspace.yaml : Use pnpm workspaces with `catalog:` protocol for shared external dependencies
Applied to files:
plugins/typebox-validate/package.json
📚 Learning: 2025-12-21T03:05:13.313Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-12-21T03:05:13.313Z
Learning: Applies to tegg/**/.oxlintrc.json : Run oxlint with `--type-aware` flag for enhanced TypeScript checking on all packages
Applied to files:
plugins/typebox-validate/package.json
📚 Learning: 2025-12-21T03:05:13.313Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-12-21T03:05:13.313Z
Learning: Applies to tegg/**/tsconfig.json : Use `emitDecoratorMetadata` in TypeScript configuration for type inference in dependency injection
Applied to files:
tegg/core/tegg/src/ajv.tstegg/core/ajv-decorator/src/index.ts
📚 Learning: 2025-12-21T03:05:13.313Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-12-21T03:05:13.313Z
Learning: Applies to tegg/**/*.{ts,tsx} : Use decorators (`Inject()`, `ContextProto()`, `SingletonProto()`) to define dependency injection and prototype scoping
Applied to files:
tegg/core/ajv-decorator/src/index.tstegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.ts
📚 Learning: 2025-12-20T09:24:59.960Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-20T09:24:59.960Z
Learning: Applies to **/*.{ts,tsx,js,mjs} : Use `.ts` sources over CommonJS and prefer ESM for exports
Applied to files:
tegg/core/ajv-decorator/src/index.tstegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.ts
📚 Learning: 2025-12-21T03:05:13.313Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-12-21T03:05:13.313Z
Learning: Applies to tegg/**/*.{ts,tsx} : All imports should use `.js` extensions for ESM files
Applied to files:
tegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.ts
📚 Learning: 2025-12-21T03:05:13.313Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-12-21T03:05:13.313Z
Learning: Applies to tegg/**/*.{ts,tsx} : Use qualifiers (`InitTypeQualifier`, `ModuleQualifier`, `EggQualifier`) when multiple implementations exist to disambiguate
Applied to files:
tegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.ts
📚 Learning: 2025-12-21T03:05:13.313Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-12-21T03:05:13.313Z
Learning: Applies to tegg/**/*.{ts,tsx} : Do not use circular dependencies between prototypes or modules
Applied to files:
tegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.ts
⏰ 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). (19)
- GitHub Check: Test (ubuntu-latest, 20, 2/3)
- GitHub Check: Test (macos-latest, 24, 2/3)
- GitHub Check: Test (macos-latest, 22, 2/3)
- GitHub Check: Test (macos-latest, 20, 2/3)
- GitHub Check: Test (macos-latest, 24, 1/3)
- GitHub Check: Test (ubuntu-latest, 22, 2/3)
- GitHub Check: Test (ubuntu-latest, 24, 3/3)
- GitHub Check: Test (ubuntu-latest, 20, 3/3)
- GitHub Check: Test (macos-latest, 22, 3/3)
- GitHub Check: Test bin (windows-latest, 24, 1/3)
- GitHub Check: Test bin (windows-latest, 24, 0/3)
- GitHub Check: Test bin (ubuntu-latest, 24, 2/3)
- GitHub Check: Test bin (ubuntu-latest, 24, 0/3)
- GitHub Check: Test bin (ubuntu-latest, 24, 1/3)
- GitHub Check: Test bin (windows-latest, 24, 2/3)
- GitHub Check: typecheck
- GitHub Check: cnpmcore E2E test
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Cloudflare Pages: egg-v3
🔇 Additional comments (6)
tegg/standalone/standalone/test/index.test.ts (1)
309-317: Appropriate fix for schema comparison.Using
JSON.parse()withdeepEqualis the correct approach when property ordering may differ between typebox versions. This makes the test resilient to serialization order changes while still validating semantic correctness.packages/egg/src/ajv.ts (1)
1-2: LGTM!The added default export re-export correctly propagates the
Typedefault export from the upstream module, maintaining a stable public API while supporting the new typebox 1.0 import pattern. Based on learnings, this thoughtful re-export approach keeps the public API stable.tegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.ts (1)
2-2: Import pattern correctly updated for typebox 1.0.The migration from named to default import for
Typefollows the typebox 1.0 API change. The usage ofType.Object(),Type.String(), etc. remains unchanged, confirming backward-compatible behavior.plugins/typebox-validate/src/typebox.ts (1)
1-4: Clean re-export module for typebox 1.0.The module correctly bridges the new typebox package by:
- Importing
Typeas the default export fromtypebox- Re-exporting all named exports for type utilities (
Static,TSchema, etc.)- Re-exporting
Typeas the default for schema buildersThis maintains a stable public API for the plugin's consumers. Based on learnings, this re-export pattern is thoughtfully designed.
tegg/core/tegg/src/ajv.ts (1)
2-2: LGTM! Default export re-export completes the migration chain.This re-export enables consumers to access the
Typeobject viaimport Type from '@eggjs/tegg/ajv', maintaining API stability while supporting the typebox 1.0 default export pattern.tegg/core/ajv-decorator/src/index.ts (1)
1-4: typebox dependency verified and properly configured.The
typeboxpackage (v1.0.65) is correctly declared in dependencies via the monorepo catalog. The package configuration meets all requirements: Node.js >=22.18.0, typecheck script with tsgo, ESM-only setup, and proper export pattern for core packages. The migration from@sinclair/typeboxtotypeboxand the default export pattern align with the typebox 1.0 migration guide.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
tegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.ts (1)
2-2: Consider consistent import ordering for Type across fixtures.The
Typeimport is positioned at the end of the import list here, but integg/standalone/standalone/test/fixtures/ajv-module-pass/foo.ts(line 2),Typeis positioned at the beginning. While both orderings are functionally correct, using a consistent pattern across test fixtures would improve code uniformity.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
tegg/core/ajv-decorator/test/__snapshots__/index.test.ts.snapis excluded by!**/*.snaptegg/core/tegg/test/__snapshots__/ajv.test.ts.snapis excluded by!**/*.snap
📒 Files selected for processing (6)
plugins/typebox-validate/src/typebox.ts(1 hunks)plugins/typebox-validate/test/fixtures/apps/typebox-validate-test/app/service/home.ts(1 hunks)tegg/core/ajv-decorator/src/index.ts(1 hunks)tegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.ts(1 hunks)tegg/standalone/standalone/test/fixtures/ajv-module-pass/foo.ts(1 hunks)tegg/standalone/standalone/test/fixtures/ajv-module/foo.ts(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
- plugins/typebox-validate/src/typebox.ts
- tegg/core/ajv-decorator/src/index.ts
- tegg/standalone/standalone/test/fixtures/ajv-module/foo.ts
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{ts,tsx,js,mjs}
📄 CodeRabbit inference engine (AGENTS.md)
Use
.tssources over CommonJS and prefer ESM for exports
Files:
plugins/typebox-validate/test/fixtures/apps/typebox-validate-test/app/service/home.tstegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.tstegg/standalone/standalone/test/fixtures/ajv-module-pass/foo.ts
{packages,plugins}/**/*.{ts,tsx,js,mjs}
📄 CodeRabbit inference engine (AGENTS.md)
Name files in lowercase with hyphens (e.g.
loader-context.ts)
Files:
plugins/typebox-validate/test/fixtures/apps/typebox-validate-test/app/service/home.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx}: Name classes in PascalCase
Name functions and variables in camelCase
**/*.{ts,tsx}: Use explicit return types for all exported functions, methods, and getters to support TypeScript's--isolatedDeclarationsflag
Avoid computed property names with symbols in class declarations; use override methods instead for compatibility with--isolatedDeclarations
Add explicit type annotations for class properties, particularly for exported symbols which should useunique symboltype
Enable strict mode in all TypeScript packages and use explicit return types for public APIs
Prefer interfaces over type aliases for object shapes in TypeScript
Use readonly modifiers where appropriate in TypeScript classes and interfaces
Avoidanytype; useunknownwhen type is truly unknown
Files:
plugins/typebox-validate/test/fixtures/apps/typebox-validate-test/app/service/home.tstegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.tstegg/standalone/standalone/test/fixtures/ajv-module-pass/foo.ts
**/test/fixtures/**
📄 CodeRabbit inference engine (AGENTS.md)
Place reusable test data under
test/fixtures/
Files:
plugins/typebox-validate/test/fixtures/apps/typebox-validate-test/app/service/home.tstegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.tstegg/standalone/standalone/test/fixtures/ajv-module-pass/foo.ts
tegg/**/*.{js,ts,mjs,cjs}
📄 CodeRabbit inference engine (tegg/CLAUDE.md)
Use ESM only (no CommonJS)
Files:
tegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.tstegg/standalone/standalone/test/fixtures/ajv-module-pass/foo.ts
tegg/**/*.{ts,tsx}
📄 CodeRabbit inference engine (tegg/CLAUDE.md)
tegg/**/*.{ts,tsx}: Use decorators (@Inject(),@ContextProto(),@SingletonProto()) to define dependency injection and prototype scoping
ContextProto objects can inject any prototype, but SingletonProto cannot inject ContextProto
Use qualifiers (@InitTypeQualifier,@ModuleQualifier,@EggQualifier) when multiple implementations exist to disambiguate
Do not use circular dependencies between prototypes or modules
Use lifecycle hooks (@LifecyclePostConstruct(),@LifecyclePostInject(),@LifecyclePreDestroy(), etc.) for object initialization and cleanup
All imports should use.jsextensions for ESM files
Files:
tegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.tstegg/standalone/standalone/test/fixtures/ajv-module-pass/foo.ts
🧠 Learnings (16)
📚 Learning: 2025-12-21T03:05:13.313Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-12-21T03:05:13.313Z
Learning: Applies to tegg/**/*.{ts,tsx} : All imports should use `.js` extensions for ESM files
Applied to files:
tegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.ts
📚 Learning: 2025-12-21T03:05:13.313Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-12-21T03:05:13.313Z
Learning: Applies to tegg/**/*.{ts,tsx} : Do not use circular dependencies between prototypes or modules
Applied to files:
tegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.tstegg/standalone/standalone/test/fixtures/ajv-module-pass/foo.ts
📚 Learning: 2025-12-21T03:05:13.313Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-12-21T03:05:13.313Z
Learning: Applies to tegg/core/*/src/index.ts : Core packages should export public API through `src/index.ts`
Applied to files:
tegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.tstegg/standalone/standalone/test/fixtures/ajv-module-pass/foo.ts
📚 Learning: 2025-12-21T03:05:13.313Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-12-21T03:05:13.313Z
Learning: Applies to tegg/**/package.json : Egg.js version must be >= 4.1.0
Applied to files:
tegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.tstegg/standalone/standalone/test/fixtures/ajv-module-pass/foo.ts
📚 Learning: 2025-12-21T03:05:13.313Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-12-21T03:05:13.313Z
Learning: Applies to tegg/**/*.{js,ts,mjs,cjs} : Use ESM only (no CommonJS)
Applied to files:
tegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.ts
📚 Learning: 2025-12-21T03:05:13.313Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-12-21T03:05:13.313Z
Learning: Applies to tegg/**/tsconfig.json : Use `emitDecoratorMetadata` in TypeScript configuration for type inference in dependency injection
Applied to files:
tegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.ts
📚 Learning: 2025-12-20T09:24:59.960Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-20T09:24:59.960Z
Learning: Re-export types thoughtfully to keep the public API stable
Applied to files:
tegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.tstegg/standalone/standalone/test/fixtures/ajv-module-pass/foo.ts
📚 Learning: 2025-12-21T03:04:53.982Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-21T03:04:53.982Z
Learning: Applies to **/*.{ts,tsx} : Add explicit type annotations for class properties, particularly for exported symbols which should use `unique symbol` type
Applied to files:
tegg/standalone/standalone/test/fixtures/ajv-module-pass/foo.ts
📚 Learning: 2025-12-21T03:04:53.982Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-21T03:04:53.982Z
Learning: Applies to **/*.{ts,tsx} : Use explicit return types for all exported functions, methods, and getters to support TypeScript's `--isolatedDeclarations` flag
Applied to files:
tegg/standalone/standalone/test/fixtures/ajv-module-pass/foo.ts
📚 Learning: 2025-12-21T03:04:53.982Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-21T03:04:53.982Z
Learning: Applies to **/*.{ts,tsx} : Prefer interfaces over type aliases for object shapes in TypeScript
Applied to files:
tegg/standalone/standalone/test/fixtures/ajv-module-pass/foo.ts
📚 Learning: 2025-12-20T09:24:59.960Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-20T09:24:59.960Z
Learning: Applies to **/*.{ts,tsx,js,mjs} : Use `.ts` sources over CommonJS and prefer ESM for exports
Applied to files:
tegg/standalone/standalone/test/fixtures/ajv-module-pass/foo.ts
📚 Learning: 2025-12-21T03:04:53.982Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-21T03:04:53.982Z
Learning: Applies to test/**/*.test.ts : Use standard assertions with Node.js built-in `assert` module in test files instead of external assertion libraries
Applied to files:
tegg/standalone/standalone/test/fixtures/ajv-module-pass/foo.ts
📚 Learning: 2025-12-21T03:04:53.982Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-21T03:04:53.982Z
Learning: Applies to **/*.{ts,tsx} : Enable strict mode in all TypeScript packages and use explicit return types for public APIs
Applied to files:
tegg/standalone/standalone/test/fixtures/ajv-module-pass/foo.ts
📚 Learning: 2025-12-21T03:05:13.313Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-12-21T03:05:13.313Z
Learning: Applies to tegg/**/*.{ts,tsx} : Use decorators (`Inject()`, `ContextProto()`, `SingletonProto()`) to define dependency injection and prototype scoping
Applied to files:
tegg/standalone/standalone/test/fixtures/ajv-module-pass/foo.ts
📚 Learning: 2025-12-21T03:05:13.313Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-12-21T03:05:13.313Z
Learning: Applies to tegg/**/*.{ts,tsx} : ContextProto objects can inject any prototype, but SingletonProto cannot inject ContextProto
Applied to files:
tegg/standalone/standalone/test/fixtures/ajv-module-pass/foo.ts
📚 Learning: 2025-12-21T03:05:13.313Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-12-21T03:05:13.313Z
Learning: Applies to tegg/**/__tests__/**/*.test.{ts,tsx} : Use `MockApplication` from `eggjs/mock` for testing with `mockModuleContextScope()` to create context scope
Applied to files:
tegg/standalone/standalone/test/fixtures/ajv-module-pass/foo.ts
⏰ 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)
- GitHub Check: Agent
- GitHub Check: Test (macos-latest, 22, 3/3)
- GitHub Check: Test (ubuntu-latest, 20, 3/3)
- GitHub Check: Test (ubuntu-latest, 24, 1/3)
- GitHub Check: Test (macos-latest, 20, 2/3)
- GitHub Check: Test (ubuntu-latest, 20, 1/3)
- GitHub Check: Test (windows-latest, 20, 2/3)
- GitHub Check: Test (macos-latest, 22, 2/3)
- GitHub Check: Test (ubuntu-latest, 22, 2/3)
- GitHub Check: Test (ubuntu-latest, 22, 1/3)
- GitHub Check: Test (windows-latest, 22, 3/3)
- GitHub Check: Test bin (ubuntu-latest, 24, 2/3)
- GitHub Check: Test bin (windows-latest, 24, 2/3)
- GitHub Check: Test bin (ubuntu-latest, 24, 1/3)
- GitHub Check: Test bin (windows-latest, 24, 1/3)
- GitHub Check: Test bin (windows-latest, 24, 0/3)
- GitHub Check: Test bin (ubuntu-latest, 24, 0/3)
- GitHub Check: typecheck
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Cloudflare Pages: egg-v3
🔇 Additional comments (2)
plugins/typebox-validate/test/fixtures/apps/typebox-validate-test/app/service/home.ts (1)
4-4: LGTM! Import reordering with no functional impact.The import order change is purely cosmetic and does not affect functionality.
tegg/standalone/standalone/test/fixtures/ajv-module-pass/foo.ts (1)
2-2: Import ordering already flagged in FooController.ts.This import ordering (Type at beginning) is the other side of the inconsistency already noted in the review comment for
tegg/plugin/ajv/test/fixtures/apps/ajv-app/modules/demo/FooController.tsline 2.
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
Copilot reviewed 13 out of 15 changed files in this pull request and generated 1 comment.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
| @@ -1,5 +1,5 @@ | |||
| import { HTTPController, HTTPMethod, HTTPMethodEnum, Inject, HTTPBody } from '@eggjs/tegg'; | |||
| import { type Ajv, type Static, Type, TransformEnum, type TSchema } from '@eggjs/tegg/ajv'; | |||
| import { type Ajv, type Static, TransformEnum, type TSchema, Type } from '@eggjs/tegg/ajv'; | |||
Copilot
AI
Dec 21, 2025
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.
The import ordering for Type is inconsistent with other files in this PR. In this file, Type is placed last, but in other files being updated (like tegg/standalone/standalone/test/fixtures/ajv-module/foo.ts and tegg/standalone/standalone/test/fixtures/ajv-module-pass/foo.ts), Type is placed first. Consider standardizing the import order to have Type either consistently first or consistently last across all files.
| import { type Ajv, type Static, TransformEnum, type TSchema, Type } from '@eggjs/tegg/ajv'; | |
| import { Type, type Ajv, type Static, TransformEnum, type TSchema } from '@eggjs/tegg/ajv'; |
close #5656
Migrate from @sinclair/typebox v0.34.x to the new typebox v1.0.x package following the official migration guide. Key changes:
🤖 Generated with Claude Code
Summary by CodeRabbit
@sinclair/typeboxtotypeboxpackage across multiple modules, ensuring consistent package management and dependency resolution.✏️ Tip: You can customize this high-level summary in your review settings.