Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@fengmk2
Copy link
Member

@fengmk2 fengmk2 commented Oct 9, 2025

Simplify all sub-project tsconfig files to extend from workspace root configuration. This centralizes TypeScript settings and makes maintenance easier.

https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-5.html#the-configdir-template-variable-for-configuration-files

Changes:

  • All packages/*/tsconfig.json now extend from ../../tsconfig.json
  • All packages/*/tsconfig.build.json now extend from ../../tsconfig.build.json
  • All plugins/*/tsconfig.json now extend from ../../tsconfig.json
  • All plugins/*/tsconfig.build.json now extend from ../../tsconfig.build.json
  • All tools/*/tsconfig.json now extend from ../../tsconfig.json
  • Add baseUrl with ${configDir} to root tsconfig.json
  • Create tsconfig.build.json at workspace root for build configuration
  • Update tsdown to 0.15.6 in catalog

This follows the pattern already established in packages/router and ensures consistent TypeScript configuration across all 31 sub-projects.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Refactor
    • Centralized TypeScript configuration: per-package tsconfig files now extend shared root build/base configs; local compiler overrides removed.
  • Chores
    • Added workspace-level tsconfig.build.json and updated a workspace dependency version.
  • Documentation
    • Added guidance formalizing the centralized TypeScript configuration pattern.
  • Tests
    • Adjusted test imports for TS sources; updated a test config to use defineProject and added hookTimeout.
  • Impact
    • More consistent builds; no public API or runtime behavior changes.

Simplify all sub-project tsconfig files to extend from workspace root configuration.
This centralizes TypeScript settings and makes maintenance easier.

Changes:
- All packages/*/tsconfig.json now extend from ../../tsconfig.json
- All packages/*/tsconfig.build.json now extend from ../../tsconfig.build.json
- All plugins/*/tsconfig.json now extend from ../../tsconfig.json
- All plugins/*/tsconfig.build.json now extend from ../../tsconfig.build.json
- All tools/*/tsconfig.json now extend from ../../tsconfig.json
- Add baseUrl with ${configDir} to root tsconfig.json
- Create tsconfig.build.json at workspace root for build configuration
- Update tsdown to 0.15.6 in catalog

This follows the pattern already established in packages/router and ensures
consistent TypeScript configuration across all 31 sub-projects.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Oct 9, 2025

Deploying egg with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5d31575
Status:🚫  Build failed.

View logs

@gemini-code-assist
Copy link

Summary of Changes

Hello @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 significantly refactors the TypeScript configuration across the monorepo by consolidating common settings into root-level tsconfig.json and tsconfig.build.json files. This change aims to improve maintainability and ensure consistent TypeScript compilation behavior across all 31 sub-projects, following an established pattern within the repository.

Highlights

  • Centralized TypeScript Configuration: All sub-project tsconfig.json and tsconfig.build.json files now extend from workspace root configurations, simplifying their content and centralizing TypeScript settings.
  • New Root Build Configuration: A new tsconfig.build.json file has been introduced at the workspace root to define common build-specific TypeScript options, such as rootDir, outDir, and exclude paths.
  • Dependency Update: The tsdown dependency has been updated to version 0.15.6 in the pnpm-workspace.yaml.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 9, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Centralizes TypeScript configuration by adding root tsconfig.json and tsconfig.build.json, and updating per-package and plugin tsconfig(.build).json files to extend the new root configs while removing local compilerOptions (notably baseUrl, rootDir, outDir) and local excludes. Also bumps tsdown in pnpm-workspace.yaml and small test/config edits.

Changes

Cohort / File(s) Summary
Root TS configs
tsconfig.json, tsconfig.build.json
Add root tsconfig.json (adds baseUrl and shared compilerOptions) and tsconfig.build.json (build-specific rootDir/outDir, includes/excludes).
Package build configs (shared inheritance)
packages/*/tsconfig.build.json, plugins/*/tsconfig.build.json, tools/*/tsconfig.build.json
Replace extends: "./tsconfig.json" with extends: "../../tsconfig.build.json" and remove local compilerOptions (baseUrl, rootDir, outDir) and local exclude entries so packages inherit build settings.
Package tsconfig cleanups
packages/*/tsconfig.json, plugins/*/tsconfig.json, tools/*/tsconfig.json
Simplify files to extends: "../../tsconfig.json" and remove local compilerOptions / baseUrl overrides; preserve remaining exclude where present.
Workspace
pnpm-workspace.yaml
Bump tsdown version from ^0.15.4 to ^0.15.6.
Tests / config edits
packages/core/test/egg-ts.test.ts, plugins/schedule/vitest.config.ts
Adjust test import paths to .ts; change Vitest config export from defineConfig to defineProject and add hookTimeout.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Dev as Developer
  participant TSC as tsc
  participant PkgConfig as package tsconfig(.build).json
  participant SharedBuild as ../../tsconfig.build.json
  participant RootConfig as ../../tsconfig.json

  Dev->>TSC: tsc -p packages/{pkg}/tsconfig.build.json
  TSC->>PkgConfig: read package config (extends ../../tsconfig.build.json)
  PkgConfig-->>SharedBuild: inherit build compilerOptions/includes/excludes
  SharedBuild-->>RootConfig: extends root tsconfig.json (baseUrl & shared options)
  Note right of SharedBuild: compile uses inherited rootDir/outDir/includes/excludes
  TSC-->>Dev: compile using combined options
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

I’m a rabbit in the repo, hopping through each file,
I tidy tsconfigs and stack them in a style.
One root to guide imports, builds marching in a line,
A carrot for the compiler — clean builds every time! 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly and accurately describes the primary change of centralizing TypeScript configuration across the monorepo by refactoring tsconfig files to extend shared root configs, matching the PR’s intent and scope.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch share-tsconfig

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f521d1d and 5d31575.

📒 Files selected for processing (1)
  • plugins/schedule/vitest.config.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

**/*.ts: Prefer TypeScript and ESM: write sources and exports in .ts (ESM-first) rather than CommonJS
Use two-space indentation, trailing commas, and semicolons (Prettier/oxlint defaults)
Name files in lowercase with hyphens (e.g., loader-context.ts)
Name classes in PascalCase
Name functions and variables in camelCase
Re-export types thoughtfully to keep the public API stable

Files:

  • plugins/schedule/vitest.config.ts
{packages/!(cookies),plugins}/**/vitest.config.ts

📄 CodeRabbit inference engine (CLAUDE.md)

Packages using Vitest should include a vitest.config.ts (all packages except cookies and egg-bin)

Files:

  • plugins/schedule/vitest.config.ts
plugins/**

📄 CodeRabbit inference engine (CLAUDE.md)

All Egg framework plugins must be placed under the plugins/ directory

Files:

  • plugins/schedule/vitest.config.ts
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
PR: eggjs/egg#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-07T03:38:30.682Z
Learning: Applies to {packages,plugins,tools}/**/tsconfig.json : All sub-project tsconfig.json files MUST extend the root tsconfig.json using "extends": "../../tsconfig.json" and set "compilerOptions.baseUrl": "./"
Learnt from: CR
PR: eggjs/egg#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-07T03:38:30.682Z
Learning: Applies to {packages,plugins,tools}/**/tsdown.config.ts : Each package should use tsdown for TypeScript builds (include a tsdown.config.ts)
Learnt from: CR
PR: eggjs/egg#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-14T08:41:30.618Z
Learning: Applies to packages/*/tsconfig.json : All sub-project tsconfig.json files must extend from the root via "extends": "../../tsconfig.json"
Learnt from: CR
PR: eggjs/egg#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-07T03:38:30.682Z
Learning: Applies to plugins/*/tsdown.config.ts : All future plugins MUST use the standard tsdown configuration template (entry: 'src/**/*.ts', unbundle: true, dts: true, exports.devExports: true, unused.level: 'error')
Learnt from: CR
PR: eggjs/egg#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-07T03:38:30.682Z
Learning: Applies to {packages,plugins,tools}/**/tsconfig.json : Enable TypeScript strict mode in all packages ("compilerOptions.strict": true)
Learnt from: CR
PR: eggjs/egg#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-14T08:41:30.618Z
Learning: Applies to {tsconfig.json,packages/*/tsconfig.json} : Enable strict TypeScript mode across all packages
📚 Learning: 2025-10-07T03:38:30.682Z
Learnt from: CR
PR: eggjs/egg#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-07T03:38:30.682Z
Learning: Applies to {packages/!(cookies),plugins}/**/vitest.config.ts : Packages using Vitest should include a vitest.config.ts (all packages except cookies and egg-bin)

Applied to files:

  • plugins/schedule/vitest.config.ts
📚 Learning: 2025-09-14T08:41:30.618Z
Learnt from: CR
PR: eggjs/egg#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-14T08:41:30.618Z
Learning: Applies to packages/**/test/**/*.test.ts : Use import { describe, it } from 'vitest' in tests

Applied to files:

  • plugins/schedule/vitest.config.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: Test (windows-latest, 24, 4/5)
  • GitHub Check: Test (windows-latest, 22, 4/5)
  • GitHub Check: Test (windows-latest, 24, 5/5)
  • GitHub Check: Test (macos-latest, 22, 2/5)
  • GitHub Check: Test (ubuntu-latest, 24, 3/5)
  • GitHub Check: Test (macos-latest, 24, 3/5)
  • GitHub Check: Test (windows-latest, 22, 5/5)
  • GitHub Check: Test bin (windows-latest, 22, 2/5)
  • GitHub Check: Test bin (windows-latest, 22, 4/5)
  • GitHub Check: Test bin (windows-latest, 22, 3/5)
  • GitHub Check: Test bin (windows-latest, 22, 1/5)
  • GitHub Check: Test bin (ubuntu-latest, 22, 1/5)
  • GitHub Check: Test bin (windows-latest, 22, 0/5)
  • GitHub Check: Test bin (ubuntu-latest, 22, 2/5)
  • GitHub Check: Test scripts (ubuntu-latest, 22, 3/5)
  • GitHub Check: Test scripts (ubuntu-latest, 22, 1/5)
  • GitHub Check: Test scripts (ubuntu-latest, 22, 4/5)
  • GitHub Check: Test bin (ubuntu-latest, 22, 0/5)
  • GitHub Check: Test scripts (ubuntu-latest, 22, 5/5)
  • GitHub Check: typecheck
🔇 Additional comments (2)
plugins/schedule/vitest.config.ts (2)

6-6: Verify the necessity of the hookTimeout addition.

Adding hookTimeout: 20000 to match testTimeout is a good practice for consistency. However, ensure this addition addresses a specific need in the schedule plugin's test hooks (e.g., setup/teardown operations that require more time).

Please confirm:

  1. Was this added to resolve timeout failures in test hooks?
  2. Are similar timeout configurations being standardized across other plugins/packages in the monorepo?

1-3: Migrate all Vitest configs to use defineProject
Replace every remaining import { defineConfig } from 'vitest/config' with import { defineProject } from 'vitest/config' in all vitest.config.ts files to ensure a consistent project-level configuration across the monorepo.

⛔ Skipped due to learnings
Learnt from: CR
PR: eggjs/egg#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-07T03:38:30.682Z
Learning: Applies to {packages/!(cookies),plugins}/**/vitest.config.ts : Packages using Vitest should include a vitest.config.ts (all packages except cookies and egg-bin)

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Oct 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.26%. Comparing base (1b941ff) to head (5d31575).
⚠️ Report is 1 commits behind head on next.

Additional details and impacted files
@@           Coverage Diff           @@
##             next    #5601   +/-   ##
=======================================
  Coverage   81.26%   81.26%           
=======================================
  Files         265      265           
  Lines        6320     6320           
  Branches      965      965           
=======================================
  Hits         5136     5136           
  Misses       1106     1106           
  Partials       78       78           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

@gemini-code-assist gemini-code-assist bot left a 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 is a great initiative to standardize the TypeScript configuration across the monorepo, which will certainly improve maintainability. However, the current implementation seems to have removed some necessary package-specific configurations from the tsconfig.json and tsconfig.build.json files. This could lead to issues like broken type-checking for tests or including unintended files/directories in the compilation. I've left a few specific comments on these issues.

Additionally, the changes to pnpm-lock.yaml are very extensive and seem to indicate a significant dependency cleanup, which wasn't mentioned in the description. Such a large change to dependencies should be carefully tested to ensure no regressions are introduced.

Could you please review the package-specific settings and ensure they are either preserved or correctly handled by the new root configurations?

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 26

♻️ Duplicate comments (6)
plugins/tracer/tsconfig.json (1)

1-3: Same baseUrl requirement applies here

See my comment on packages/koa-static-cache/tsconfig.json; this plugin config needs the local "compilerOptions": { "baseUrl": "./" } restored as well. Based on learnings

plugins/session/tsconfig.json (1)

1-3: Local baseUrl still required

As noted on packages/koa-static-cache/tsconfig.json, please add back "compilerOptions": { "baseUrl": "./" } so this plugin complies with the shared tsconfig contract. Based on learnings

packages/cluster/tsconfig.json (1)

1-3: Needs package-scoped baseUrl

Refer to my earlier comment: this package also has to declare "compilerOptions": { "baseUrl": "./" } locally when extending the root config. Based on learnings

packages/errors/tsconfig.json (1)

1-3: Reintroduce "baseUrl": "./" here too

Following the guidance cited previously, please restore the local baseUrl override in this package tsconfig. Based on learnings

plugins/watcher/tsconfig.json (1)

1-3: Missing required baseUrl override

This plugin config also needs the "compilerOptions": { "baseUrl": "./" } block reinstated to satisfy the shared tsconfig expectations. Based on learnings

packages/supertest/tsconfig.json (1)

1-3: Ensure local baseUrl override is present

Same as the earlier files: please add back "compilerOptions": { "baseUrl": "./" } so this package tsconfig stays compliant. Based on learnings

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1b941ff and 7ee2791.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (60)
  • packages/cluster/tsconfig.build.json (1 hunks)
  • packages/cluster/tsconfig.json (1 hunks)
  • packages/cookies/tsconfig.build.json (1 hunks)
  • packages/cookies/tsconfig.json (1 hunks)
  • packages/core/tsconfig.build.json (1 hunks)
  • packages/core/tsconfig.json (1 hunks)
  • packages/egg/tsconfig.build.json (1 hunks)
  • packages/egg/tsconfig.json (1 hunks)
  • packages/errors/tsconfig.json (1 hunks)
  • packages/extend2/tsconfig.build.json (1 hunks)
  • packages/extend2/tsconfig.json (1 hunks)
  • packages/koa-static-cache/tsconfig.build.json (1 hunks)
  • packages/koa-static-cache/tsconfig.json (1 hunks)
  • packages/koa/tsconfig.build.json (1 hunks)
  • packages/koa/tsconfig.json (1 hunks)
  • packages/path-matching/tsconfig.json (1 hunks)
  • packages/router/tsconfig.build.json (1 hunks)
  • packages/router/tsconfig.json (1 hunks)
  • packages/supertest/tsconfig.build.json (1 hunks)
  • packages/supertest/tsconfig.json (1 hunks)
  • packages/utils/tsconfig.build.json (1 hunks)
  • packages/utils/tsconfig.json (1 hunks)
  • plugins/development/tsconfig.build.json (1 hunks)
  • plugins/development/tsconfig.json (1 hunks)
  • plugins/i18n/tsconfig.build.json (1 hunks)
  • plugins/i18n/tsconfig.json (1 hunks)
  • plugins/jsonp/tsconfig.build.json (1 hunks)
  • plugins/jsonp/tsconfig.json (1 hunks)
  • plugins/logrotator/tsconfig.build.json (1 hunks)
  • plugins/logrotator/tsconfig.json (1 hunks)
  • plugins/mock/tsconfig.build.json (1 hunks)
  • plugins/mock/tsconfig.json (1 hunks)
  • plugins/multipart/tsconfig.build.json (1 hunks)
  • plugins/multipart/tsconfig.json (1 hunks)
  • plugins/onerror/tsconfig.build.json (1 hunks)
  • plugins/onerror/tsconfig.json (1 hunks)
  • plugins/redis/tsconfig.build.json (1 hunks)
  • plugins/redis/tsconfig.json (1 hunks)
  • plugins/schedule/tsconfig.build.json (1 hunks)
  • plugins/schedule/tsconfig.json (1 hunks)
  • plugins/security/tsconfig.build.json (1 hunks)
  • plugins/security/tsconfig.json (1 hunks)
  • plugins/session/tsconfig.build.json (1 hunks)
  • plugins/session/tsconfig.json (1 hunks)
  • plugins/static/tsconfig.build.json (1 hunks)
  • plugins/static/tsconfig.json (1 hunks)
  • plugins/tracer/tsconfig.build.json (1 hunks)
  • plugins/tracer/tsconfig.json (1 hunks)
  • plugins/typebox-validate/tsconfig.build.json (1 hunks)
  • plugins/typebox-validate/tsconfig.json (1 hunks)
  • plugins/view/tsconfig.build.json (1 hunks)
  • plugins/view/tsconfig.json (1 hunks)
  • plugins/watcher/tsconfig.build.json (1 hunks)
  • plugins/watcher/tsconfig.json (1 hunks)
  • pnpm-workspace.yaml (1 hunks)
  • tools/create-egg/tsconfig.json (1 hunks)
  • tools/egg-bin/tsconfig.json (1 hunks)
  • tools/scripts/tsconfig.json (1 hunks)
  • tsconfig.build.json (1 hunks)
  • tsconfig.json (1 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
plugins/**

📄 CodeRabbit inference engine (CLAUDE.md)

All Egg framework plugins must be placed under the plugins/ directory

Files:

  • plugins/view/tsconfig.build.json
  • plugins/redis/tsconfig.build.json
  • plugins/logrotator/tsconfig.json
  • plugins/session/tsconfig.build.json
  • plugins/jsonp/tsconfig.build.json
  • plugins/multipart/tsconfig.build.json
  • plugins/schedule/tsconfig.json
  • plugins/onerror/tsconfig.build.json
  • plugins/i18n/tsconfig.build.json
  • plugins/logrotator/tsconfig.build.json
  • plugins/development/tsconfig.json
  • plugins/static/tsconfig.build.json
  • plugins/development/tsconfig.build.json
  • plugins/typebox-validate/tsconfig.json
  • plugins/redis/tsconfig.json
  • plugins/i18n/tsconfig.json
  • plugins/tracer/tsconfig.build.json
  • plugins/typebox-validate/tsconfig.build.json
  • plugins/watcher/tsconfig.build.json
  • plugins/security/tsconfig.build.json
  • plugins/watcher/tsconfig.json
  • plugins/static/tsconfig.json
  • plugins/schedule/tsconfig.build.json
  • plugins/view/tsconfig.json
  • plugins/jsonp/tsconfig.json
  • plugins/mock/tsconfig.build.json
  • plugins/mock/tsconfig.json
  • plugins/security/tsconfig.json
  • plugins/tracer/tsconfig.json
  • plugins/onerror/tsconfig.json
  • plugins/multipart/tsconfig.json
  • plugins/session/tsconfig.json
{packages,plugins,tools}/**/tsconfig.json

📄 CodeRabbit inference engine (CLAUDE.md)

{packages,plugins,tools}/**/tsconfig.json: All sub-project tsconfig.json files MUST extend the root tsconfig.json using "extends": "../../tsconfig.json" and set "compilerOptions.baseUrl": "./"
Enable TypeScript strict mode in all packages ("compilerOptions.strict": true)

Files:

  • plugins/logrotator/tsconfig.json
  • plugins/schedule/tsconfig.json
  • tools/scripts/tsconfig.json
  • packages/supertest/tsconfig.json
  • packages/cookies/tsconfig.json
  • packages/cluster/tsconfig.json
  • tools/create-egg/tsconfig.json
  • plugins/development/tsconfig.json
  • plugins/typebox-validate/tsconfig.json
  • packages/path-matching/tsconfig.json
  • packages/koa/tsconfig.json
  • plugins/redis/tsconfig.json
  • plugins/i18n/tsconfig.json
  • packages/extend2/tsconfig.json
  • packages/egg/tsconfig.json
  • tools/egg-bin/tsconfig.json
  • plugins/watcher/tsconfig.json
  • plugins/static/tsconfig.json
  • packages/core/tsconfig.json
  • packages/router/tsconfig.json
  • plugins/view/tsconfig.json
  • plugins/jsonp/tsconfig.json
  • plugins/mock/tsconfig.json
  • packages/utils/tsconfig.json
  • plugins/security/tsconfig.json
  • plugins/tracer/tsconfig.json
  • plugins/onerror/tsconfig.json
  • packages/errors/tsconfig.json
  • plugins/multipart/tsconfig.json
  • packages/koa-static-cache/tsconfig.json
  • plugins/session/tsconfig.json
{tsconfig.json,packages/*/tsconfig.json}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Enable strict TypeScript mode across all packages

Files:

  • tsconfig.json
  • packages/supertest/tsconfig.json
  • packages/cookies/tsconfig.json
  • packages/cluster/tsconfig.json
  • packages/path-matching/tsconfig.json
  • packages/koa/tsconfig.json
  • packages/extend2/tsconfig.json
  • packages/egg/tsconfig.json
  • packages/core/tsconfig.json
  • packages/router/tsconfig.json
  • packages/utils/tsconfig.json
  • packages/errors/tsconfig.json
  • packages/koa-static-cache/tsconfig.json
tsconfig.json

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Root tsconfig.json must include all packages in the references array

Files:

  • tsconfig.json
packages/*/tsconfig.json

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

All sub-project tsconfig.json files must extend from the root via "extends": "../../tsconfig.json"

Files:

  • packages/supertest/tsconfig.json
  • packages/cookies/tsconfig.json
  • packages/cluster/tsconfig.json
  • packages/path-matching/tsconfig.json
  • packages/koa/tsconfig.json
  • packages/extend2/tsconfig.json
  • packages/egg/tsconfig.json
  • packages/core/tsconfig.json
  • packages/router/tsconfig.json
  • packages/utils/tsconfig.json
  • packages/errors/tsconfig.json
  • packages/koa-static-cache/tsconfig.json
pnpm-workspace.yaml

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Define dependency versions via the catalog section in pnpm-workspace.yaml and reference them with "catalog:"

Use pnpm catalog mode with dependencies defined once in pnpm-workspace.yaml

Files:

  • pnpm-workspace.yaml
🧠 Learnings (10)
📓 Common learnings
Learnt from: CR
PR: eggjs/egg#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-07T03:38:30.682Z
Learning: Applies to {packages,plugins,tools}/**/tsconfig.json : All sub-project tsconfig.json files MUST extend the root tsconfig.json using "extends": "../../tsconfig.json" and set "compilerOptions.baseUrl": "./"
Learnt from: CR
PR: eggjs/egg#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-07T03:38:30.682Z
Learning: Applies to {packages,plugins,tools}/**/tsdown.config.ts : Each package should use tsdown for TypeScript builds (include a tsdown.config.ts)
Learnt from: CR
PR: eggjs/egg#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-14T08:41:30.618Z
Learning: Applies to packages/*/tsconfig.json : All sub-project tsconfig.json files must extend from the root via "extends": "../../tsconfig.json"
📚 Learning: 2025-09-14T08:41:30.618Z
Learnt from: CR
PR: eggjs/egg#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-14T08:41:30.618Z
Learning: Applies to packages/*/tsconfig.json : All sub-project tsconfig.json files must extend from the root via "extends": "../../tsconfig.json"

Applied to files:

  • plugins/view/tsconfig.build.json
  • plugins/redis/tsconfig.build.json
  • plugins/logrotator/tsconfig.json
  • plugins/session/tsconfig.build.json
  • plugins/jsonp/tsconfig.build.json
  • plugins/multipart/tsconfig.build.json
  • plugins/schedule/tsconfig.json
  • tools/scripts/tsconfig.json
  • plugins/onerror/tsconfig.build.json
  • packages/supertest/tsconfig.json
  • packages/cookies/tsconfig.json
  • packages/cluster/tsconfig.json
  • plugins/i18n/tsconfig.build.json
  • plugins/logrotator/tsconfig.build.json
  • packages/cookies/tsconfig.build.json
  • tools/create-egg/tsconfig.json
  • plugins/development/tsconfig.json
  • plugins/static/tsconfig.build.json
  • plugins/development/tsconfig.build.json
  • plugins/typebox-validate/tsconfig.json
  • packages/path-matching/tsconfig.json
  • packages/koa/tsconfig.json
  • plugins/redis/tsconfig.json
  • plugins/i18n/tsconfig.json
  • plugins/tracer/tsconfig.build.json
  • packages/extend2/tsconfig.json
  • plugins/typebox-validate/tsconfig.build.json
  • plugins/watcher/tsconfig.build.json
  • packages/core/tsconfig.build.json
  • packages/cluster/tsconfig.build.json
  • packages/egg/tsconfig.json
  • plugins/security/tsconfig.build.json
  • packages/koa/tsconfig.build.json
  • tools/egg-bin/tsconfig.json
  • plugins/watcher/tsconfig.json
  • plugins/static/tsconfig.json
  • packages/core/tsconfig.json
  • packages/router/tsconfig.json
  • plugins/schedule/tsconfig.build.json
  • packages/router/tsconfig.build.json
  • plugins/view/tsconfig.json
  • packages/egg/tsconfig.build.json
  • plugins/jsonp/tsconfig.json
  • plugins/mock/tsconfig.build.json
  • packages/extend2/tsconfig.build.json
  • packages/koa-static-cache/tsconfig.build.json
  • plugins/mock/tsconfig.json
  • packages/supertest/tsconfig.build.json
  • packages/utils/tsconfig.json
  • packages/utils/tsconfig.build.json
  • plugins/security/tsconfig.json
  • plugins/tracer/tsconfig.json
  • tsconfig.build.json
  • plugins/onerror/tsconfig.json
  • packages/errors/tsconfig.json
  • plugins/multipart/tsconfig.json
  • packages/koa-static-cache/tsconfig.json
  • plugins/session/tsconfig.json
📚 Learning: 2025-10-07T03:38:30.682Z
Learnt from: CR
PR: eggjs/egg#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-07T03:38:30.682Z
Learning: Applies to {packages,plugins,tools}/**/tsconfig.json : All sub-project tsconfig.json files MUST extend the root tsconfig.json using "extends": "../../tsconfig.json" and set "compilerOptions.baseUrl": "./"

Applied to files:

  • plugins/view/tsconfig.build.json
  • plugins/redis/tsconfig.build.json
  • plugins/logrotator/tsconfig.json
  • plugins/session/tsconfig.build.json
  • plugins/jsonp/tsconfig.build.json
  • plugins/multipart/tsconfig.build.json
  • plugins/schedule/tsconfig.json
  • tsconfig.json
  • tools/scripts/tsconfig.json
  • plugins/onerror/tsconfig.build.json
  • packages/supertest/tsconfig.json
  • packages/cookies/tsconfig.json
  • packages/cluster/tsconfig.json
  • plugins/i18n/tsconfig.build.json
  • plugins/logrotator/tsconfig.build.json
  • packages/cookies/tsconfig.build.json
  • tools/create-egg/tsconfig.json
  • plugins/development/tsconfig.json
  • plugins/static/tsconfig.build.json
  • plugins/development/tsconfig.build.json
  • plugins/typebox-validate/tsconfig.json
  • packages/path-matching/tsconfig.json
  • packages/koa/tsconfig.json
  • plugins/redis/tsconfig.json
  • plugins/i18n/tsconfig.json
  • plugins/tracer/tsconfig.build.json
  • packages/extend2/tsconfig.json
  • plugins/typebox-validate/tsconfig.build.json
  • plugins/watcher/tsconfig.build.json
  • packages/core/tsconfig.build.json
  • packages/cluster/tsconfig.build.json
  • packages/egg/tsconfig.json
  • plugins/security/tsconfig.build.json
  • packages/koa/tsconfig.build.json
  • tools/egg-bin/tsconfig.json
  • plugins/watcher/tsconfig.json
  • plugins/static/tsconfig.json
  • packages/core/tsconfig.json
  • packages/router/tsconfig.json
  • plugins/schedule/tsconfig.build.json
  • packages/router/tsconfig.build.json
  • plugins/view/tsconfig.json
  • packages/egg/tsconfig.build.json
  • plugins/jsonp/tsconfig.json
  • plugins/mock/tsconfig.build.json
  • packages/extend2/tsconfig.build.json
  • packages/koa-static-cache/tsconfig.build.json
  • plugins/mock/tsconfig.json
  • packages/supertest/tsconfig.build.json
  • packages/utils/tsconfig.json
  • packages/utils/tsconfig.build.json
  • plugins/security/tsconfig.json
  • plugins/tracer/tsconfig.json
  • tsconfig.build.json
  • plugins/onerror/tsconfig.json
  • packages/errors/tsconfig.json
  • plugins/multipart/tsconfig.json
  • packages/koa-static-cache/tsconfig.json
  • plugins/session/tsconfig.json
📚 Learning: 2025-10-07T03:38:30.682Z
Learnt from: CR
PR: eggjs/egg#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-07T03:38:30.682Z
Learning: Applies to plugins/*/tsdown.config.ts : All future plugins MUST use the standard tsdown configuration template (entry: 'src/**/*.ts', unbundle: true, dts: true, exports.devExports: true, unused.level: 'error')

Applied to files:

  • plugins/multipart/tsconfig.build.json
  • plugins/schedule/tsconfig.json
  • plugins/onerror/tsconfig.build.json
  • plugins/i18n/tsconfig.build.json
  • plugins/development/tsconfig.json
  • plugins/development/tsconfig.build.json
  • plugins/redis/tsconfig.json
  • plugins/static/tsconfig.json
  • plugins/tracer/tsconfig.json
  • tsconfig.build.json
  • plugins/onerror/tsconfig.json
  • plugins/multipart/tsconfig.json
📚 Learning: 2025-10-07T03:38:30.682Z
Learnt from: CR
PR: eggjs/egg#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-07T03:38:30.682Z
Learning: Applies to packages/egg/src/config/{plugin.ts,config.default.ts} : Maintain built-in plugin configuration in src/config/plugin.ts and default framework configuration in src/config/config.default.ts

Applied to files:

  • plugins/i18n/tsconfig.build.json
  • packages/egg/tsconfig.json
  • packages/egg/tsconfig.build.json
📚 Learning: 2025-10-07T03:38:30.682Z
Learnt from: CR
PR: eggjs/egg#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-07T03:38:30.682Z
Learning: Applies to plugins/**/src/**/*.ts : In plugin TypeScript sources, use ESM-style extensioned imports with .ts in relative imports

Applied to files:

  • plugins/development/tsconfig.json
📚 Learning: 2025-10-07T03:38:30.682Z
Learnt from: CR
PR: eggjs/egg#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-07T03:38:30.682Z
Learning: Applies to {packages/cookies,tools/egg-bin}/**/test/**/*.test.ts : cookies and egg-bin tests should be located at test/**/*.test.ts (Mocha)

Applied to files:

  • packages/egg/tsconfig.json
📚 Learning: 2025-10-07T03:38:30.682Z
Learnt from: CR
PR: eggjs/egg#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-07T03:38:30.682Z
Learning: Applies to {packages/!(cookies),plugins}/**/vitest.config.ts : Packages using Vitest should include a vitest.config.ts (all packages except cookies and egg-bin)

Applied to files:

  • packages/egg/tsconfig.json
📚 Learning: 2025-09-14T08:41:30.618Z
Learnt from: CR
PR: eggjs/egg#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-14T08:41:30.618Z
Learning: Applies to pnpm-workspace.yaml : Define dependency versions via the catalog section in pnpm-workspace.yaml and reference them with "catalog:"

Applied to files:

  • pnpm-workspace.yaml
📚 Learning: 2025-10-07T03:38:30.682Z
Learnt from: CR
PR: eggjs/egg#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-07T03:38:30.682Z
Learning: Applies to {packages,plugins,tools}/**/tsdown.config.ts : Each package should use tsdown for TypeScript builds (include a tsdown.config.ts)

Applied to files:

  • pnpm-workspace.yaml
⏰ 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). (18)
  • GitHub Check: Test (windows-latest, 24, 1/5)
  • GitHub Check: Test (ubuntu-latest, 22, 5/5)
  • GitHub Check: Test (ubuntu-latest, 22, 1/5)
  • GitHub Check: Test (macos-latest, 24, 2/5)
  • GitHub Check: Test (macos-latest, 22, 4/5)
  • GitHub Check: Test (macos-latest, 24, 5/5)
  • GitHub Check: Test (ubuntu-latest, 24, 2/5)
  • GitHub Check: Test (windows-latest, 22, 5/5)
  • GitHub Check: Test (windows-latest, 24, 4/5)
  • GitHub Check: Test (windows-latest, 24, 3/5)
  • GitHub Check: Test (macos-latest, 22, 5/5)
  • GitHub Check: Test bin (windows-latest, 22, 4/5)
  • GitHub Check: Test scripts (ubuntu-latest, 22, 1/5)
  • GitHub Check: Test scripts (ubuntu-latest, 22, 5/5)
  • GitHub Check: Test scripts (ubuntu-latest, 22, 3/5)
  • GitHub Check: Test scripts (ubuntu-latest, 22, 4/5)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Cloudflare Pages: egg-v3

Comment on lines 1 to 3
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"baseUrl": "./"
}
"extends": "../../tsconfig.json"
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Re-add mandated baseUrl setting.

Our TypeScript config guidelines require each package tsconfig to set "compilerOptions.baseUrl": "./" alongside the root extends. Since this file now lacks that block, it’s non-compliant. Please put the baseUrl override back.

 {
-  "extends": "../../tsconfig.json"
+  "extends": "../../tsconfig.json",
+  "compilerOptions": {
+    "baseUrl": "./"
+  }
 }

[Based on learnings]

📝 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.

Suggested change
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"baseUrl": "./"
}
"extends": "../../tsconfig.json"
}
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"baseUrl": "./"
}
}
🤖 Prompt for AI Agents
In packages/cookies/tsconfig.json around lines 1 to 3, the file extends the root
tsconfig but is missing the mandated package-level override for
compilerOptions.baseUrl; re-add a "compilerOptions" block that sets "baseUrl":
"./" (so keep the existing "extends": "../../tsconfig.json" and add the
compilerOptions.baseUrl override directly in this file).

Comment on lines 1 to 3
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"baseUrl": "./"
},
"exclude": ["test/fixtures/**/*.ts"]
"extends": "../../tsconfig.json"
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Reintroduce "baseUrl": "./" per repo standard.

Every {packages,plugins,tools}/**/tsconfig.json must extend the root config and set "compilerOptions.baseUrl": "./". This file currently lacks the baseUrl override, so please add it back to stay compliant. [As per coding guidelines]

🤖 Prompt for AI Agents
In packages/core/tsconfig.json lines 1-3, the config extends the root but is
missing the required override for "compilerOptions.baseUrl"; update the file to
keep "extends": "../../tsconfig.json" and add a "compilerOptions" object that
sets "baseUrl": "./" (preserving any other compilerOptions if present) so the
package complies with the repo standard.

Comment on lines 1 to 3
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"baseUrl": "./"
},
"exclude": ["test/fixtures/**/*.ts"]
"extends": "../../tsconfig.json"
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Reintroduce baseUrl for this package

Our TypeScript guideline requires each package tsconfig.json to extend the root config and set "compilerOptions.baseUrl": "./". With only extends, this package now inherits the root ${configDir} setting, effectively pointing baseUrl at the monorepo root and breaking local path resolution. Add the compilerOptions block with baseUrl: "./" back.

As per coding guidelines

🤖 Prompt for AI Agents
In packages/egg/tsconfig.json around lines 1 to 3, the file currently only
extends the root tsconfig which causes this package to inherit the root
configDir baseUrl; add a compilerOptions block that sets "baseUrl": "./" so the
package resolves local paths correctly while still extending the root
configuration; ensure the compilerOptions object is merged into the existing
JSON and that the file remains valid JSON.

Comment on lines 1 to 3
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"baseUrl": "./"
}
"extends": "../../tsconfig.json"
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Reinstate compilerOptions.baseUrl for package build.

Our config standard requires each package tsconfig to declare "baseUrl": "./" explicitly. Dropping it here conflicts with that policy and could break local module resolution. Please add it back. Based on learnings

 {
-  "extends": "../../tsconfig.json"
+  "extends": "../../tsconfig.json",
+  "compilerOptions": {
+    "baseUrl": "./"
+  }
 }
📝 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.

Suggested change
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"baseUrl": "./"
}
"extends": "../../tsconfig.json"
}
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"baseUrl": "./"
}
}
🤖 Prompt for AI Agents
In packages/extend2/tsconfig.json around lines 1 to 3, the package tsconfig no
longer declares compilerOptions.baseUrl which violates the repo standard and can
break local module resolution; update the file to add a compilerOptions block
with "baseUrl": "./" (e.g. add "compilerOptions": { "baseUrl": "./" }) so the
package explicitly sets baseUrl while preserving the existing "extends"
reference.

Comment on lines 1 to 3
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"baseUrl": "./"
}
"extends": "../../tsconfig.json"
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Restore package-level baseUrl override

Per the workspace guidelines, each sub-project tsconfig must still declare "compilerOptions": { "baseUrl": "./" }. With only the extends, this package now inherits the root baseUrl, which no longer meets that contract and risks path resolution drifting from the package root. Please reintroduce the local baseUrl block. Based on learnings

🤖 Prompt for AI Agents
In packages/koa-static-cache/tsconfig.json around lines 1 to 3, the file
currently only extends the root tsconfig and thus inherits the workspace
baseUrl; restore a package-level override by adding a "compilerOptions" object
with "baseUrl": "./" so the package resolves paths from its own root. Update the
JSON to keep the existing "extends" and add the local "compilerOptions": {
"baseUrl": "./" } entry.

Comment on lines 1 to 3
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"baseUrl": "./"
}
"extends": "../../tsconfig.json"
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Add back the required "baseUrl": "./".

Per the repo’s TypeScript config guidelines, each plugin/package tsconfig must both extend "../../tsconfig.json" and explicitly set "compilerOptions.baseUrl": "./". Please restore that property here. [As per coding guidelines]

🤖 Prompt for AI Agents
In plugins/view/tsconfig.json around lines 1 to 3, the file extends
"../../tsconfig.json" but is missing the required "compilerOptions.baseUrl":
"./". Update the tsconfig to include a "compilerOptions" object with baseUrl set
to "./" (while still extending "../../tsconfig.json") so the plugin adheres to
the repo TypeScript config guidelines.

Comment on lines 1 to 3
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"baseUrl": "./"
}
"extends": "../../tsconfig.json"
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Restore compilerOptions.baseUrl for tool config.

Per the shared tsconfig guidance, each sub-project config must explicitly set "baseUrl": "./". Removing it here breaks that contract and can change module resolution. Please restore the block. Based on learnings

 {
-  "extends": "../../tsconfig.json"
+  "extends": "../../tsconfig.json",
+  "compilerOptions": {
+    "baseUrl": "./"
+  }
 }
📝 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.

Suggested change
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"baseUrl": "./"
}
"extends": "../../tsconfig.json"
}
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"baseUrl": "./"
}
}
🤖 Prompt for AI Agents
In tools/create-egg/tsconfig.json lines 1-3, the compilerOptions.baseUrl was
removed; restore an explicit "compilerOptions": { "baseUrl": "./" } block so
this sub-project explicitly sets baseUrl to "./" per shared tsconfig guidance,
ensuring correct module resolution and preserving the contract with the root
tsconfig.

Comment on lines 1 to 3
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"baseUrl": "./",
"types": ["mocha", "node"]
},
"exclude": ["test/fixtures/**/*.ts"]
"extends": "../../tsconfig.json"
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Add back the mandated baseUrl override.

Tool tsconfig files must explicitly declare "compilerOptions": { "baseUrl": "./" } in addition to extending ../../tsconfig.json. Removing that block breaks the requirement. Please restore it.

 {
-  "extends": "../../tsconfig.json"
+  "extends": "../../tsconfig.json",
+  "compilerOptions": {
+    "baseUrl": "./"
+  }
 }

[Based on learnings]

🤖 Prompt for AI Agents
In tools/egg-bin/tsconfig.json around lines 1 to 3, the mandated override for
compilerOptions.baseUrl was removed; restore a top-level "compilerOptions"
object that sets "baseUrl": "./" while keeping the existing "extends":
"../../tsconfig.json". Add only the minimal override (compilerOptions with
baseUrl "./") so the file extends the root tsconfig but enforces the local
baseUrl requirement.

Comment on lines 1 to 3
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"baseUrl": "./"
},
"exclude": ["test/fixtures/**/*.ts"]
"extends": "../../tsconfig.json"
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Reintroduce the required baseUrl block.

The documented rule for {packages,plugins,tools}/**/tsconfig.json is to extend the root config and explicitly set "compilerOptions.baseUrl": "./". This file currently omits the latter, so please add it back.

 {
-  "extends": "../../tsconfig.json"
+  "extends": "../../tsconfig.json",
+  "compilerOptions": {
+    "baseUrl": "./"
+  }
 }

[Based on learnings]

🤖 Prompt for AI Agents
In tools/scripts/tsconfig.json around lines 1 to 3, the file extends the root
tsconfig but is missing the required compilerOptions.baseUrl setting; update the
JSON to include a compilerOptions block with "baseUrl": "./" (i.e., add
"compilerOptions": { "baseUrl": "./" }) so this package-specific tsconfig
explicitly sets baseUrl while still extending the root config.

{
"extends": "@eggjs/tsconfig",
"compilerOptions": {
"baseUrl": "${configDir}",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Invalid baseUrl placeholder breaks module resolution
TypeScript treats "${configDir}" as a literal directory name, not a macro, so every package now points baseUrl to a non-existent ./${configDir} folder. Module resolution will fail as soon as a non-relative import relies on baseUrl. Restore the previous relative path (e.g., ".") so the compiler can resolve modules correctly.

-    "baseUrl": "${configDir}",
+    "baseUrl": ".",
📝 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.

Suggested change
"baseUrl": "${configDir}",
"baseUrl": ".",
🤖 Prompt for AI Agents
In tsconfig.json around line 4, the "baseUrl" is set to the literal placeholder
"${configDir}" which causes TypeScript to resolve imports against a non-existent
"./${configDir}" directory; change the value back to a real relative path (for
example ".") so module resolution works correctly across packages by pointing
baseUrl to the project root or desired folder.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Oct 9, 2025

Deploying egg-v3 with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5d31575
Status:🚫  Build failed.

View logs

@fengmk2 fengmk2 requested a review from Copilot October 9, 2025 14:02
Copy link
Contributor

Copilot AI left a 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 standardizes TypeScript configuration across the entire Eggjs monorepo by centralizing settings at the workspace root. Instead of maintaining individual configuration files with duplicated settings across 31+ sub-projects, all packages, plugins, and tools now extend from shared root configurations.

  • Creates centralized tsconfig.build.json at workspace root with standardized build settings
  • Simplifies all sub-project TypeScript configs to minimal extends-only format
  • Updates tsdown dependency to version 0.15.6 in the catalog

Reviewed Changes

Copilot reviewed 61 out of 63 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tsconfig.build.json New root build configuration using ${configDir} for dynamic path resolution
packages/*/tsconfig.json Simplified to only extend from root configuration
packages/*/tsconfig.build.json Simplified to only extend from root build configuration
plugins/*/tsconfig.json Simplified to only extend from root configuration
plugins/*/tsconfig.build.json Simplified to only extend from root build configuration
tools/*/tsconfig.json Simplified to only extend from root configuration
pnpm-workspace.yaml Updated tsdown catalog version from 0.15.4 to 0.15.6
packages/core/test/egg-ts.test.ts Updated import paths from .js to .ts extensions
CLAUDE.md Updated documentation to reflect new centralized TypeScript configuration pattern
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

import { utils } from '../src/index.js';
import { createApp, getFilepath, type Application } from './helper.js';
import { utils } from '../src/index.ts';
import { createApp, getFilepath, type Application } from './helper.ts';
Copy link

Copilot AI Oct 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Importing with .ts extensions may cause runtime issues. TypeScript imports should typically use .js extensions or no extensions to ensure proper module resolution after compilation.

Suggested change
import { createApp, getFilepath, type Application } from './helper.ts';
import { createApp, getFilepath, type Application } from './helper';

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

♻️ Duplicate comments (27)
plugins/onerror/tsconfig.json (1)

1-3: Restore required compilerOptions.baseUrl override.

Per the repo guidelines every sub-project tsconfig must both extend the root file and keep a local "compilerOptions": { "baseUrl": "./" }. This change drops the mandated override, so please add it back.

 {
   "extends": "../../tsconfig.json"
+  ,
+  "compilerOptions": {
+    "baseUrl": "./"
+  }
 }

As per coding guidelines

plugins/typebox-validate/tsconfig.json (1)

1-3: Reintroduce the mandated baseUrl override.

Each sub-project tsconfig must extend the root config and declare "compilerOptions": { "baseUrl": "./" }. This file now lacks the required override; please restore it.

 {
   "extends": "../../tsconfig.json"
+  ,
+  "compilerOptions": {
+    "baseUrl": "./"
+  }
 }

As per coding guidelines

packages/cluster/tsconfig.json (1)

1-3: Add back the required compilerOptions.baseUrl.

Guidelines insist every package tsconfig both extends "../../tsconfig.json" and sets "compilerOptions": { "baseUrl": "./" }. The override was removed here—please put it back.

 {
   "extends": "../../tsconfig.json"
+  ,
+  "compilerOptions": {
+    "baseUrl": "./"
+  }
 }

As per coding guidelines

plugins/view/tsconfig.json (1)

1-3: Bring back "compilerOptions": { "baseUrl": "./" }.

Our TypeScript config policy requires every plugin tsconfig to keep that local baseUrl override while extending the root config. Please restore it.

 {
   "extends": "../../tsconfig.json"
+  ,
+  "compilerOptions": {
+    "baseUrl": "./"
+  }
 }

As per coding guidelines

packages/cookies/tsconfig.json (1)

1-3: Re-add the local baseUrl override.

Every package tsconfig must extend the root config and declare "compilerOptions": { "baseUrl": "./" }. Since that block was dropped, the file is non-compliant—please restore it.

 {
   "extends": "../../tsconfig.json"
+  ,
+  "compilerOptions": {
+    "baseUrl": "./"
+  }
 }

As per coding guidelines

packages/errors/tsconfig.json (1)

1-3: Restore "compilerOptions.baseUrl": "./" setting.

Per the monorepo TS config rules, each package tsconfig must extend the root file and still declare a "compilerOptions": { "baseUrl": "./" } block. Please add it back.

 {
   "extends": "../../tsconfig.json"
+  ,
+  "compilerOptions": {
+    "baseUrl": "./"
+  }
 }

As per coding guidelines

packages/path-matching/tsconfig.json (1)

1-3: Reintroduce mandatory compilerOptions.baseUrl.

Dropping the local baseUrl breaks the repo rule that every sub-project tsconfig must both extend the root file and pin "baseUrl": "./". Please restore it.

 {
-  "extends": "../../tsconfig.json"
+  "extends": "../../tsconfig.json",
+  "compilerOptions": {
+    "baseUrl": "./"
+  }
 }

As per coding guidelines

plugins/logrotator/tsconfig.json (1)

1-3: Restore required baseUrl override.

Each plugin tsconfig must explicitly set "compilerOptions": { "baseUrl": "./" } while extending the shared config. Add the block back to stay compliant.

 {
-  "extends": "../../tsconfig.json"
+  "extends": "../../tsconfig.json",
+  "compilerOptions": {
+    "baseUrl": "./"
+  }
 }

As per coding guidelines

tools/create-egg/tsconfig.json (1)

1-3: Bring back the tool’s baseUrl setting.

Repository guidance mandates every sub-project tsconfig declare "baseUrl": "./". Reintroduce the compilerOptions block alongside the existing extend.

 {
-  "extends": "../../tsconfig.json"
+  "extends": "../../tsconfig.json",
+  "compilerOptions": {
+    "baseUrl": "./"
+  }
 }

As per coding guidelines

plugins/tracer/tsconfig.json (1)

1-3: Add back the tracer plugin baseUrl.

The shared policy requires "compilerOptions.baseUrl": "./" in every plugin tsconfig. Please restore that block while keeping the root extend.

 {
-  "extends": "../../tsconfig.json"
+  "extends": "../../tsconfig.json",
+  "compilerOptions": {
+    "baseUrl": "./"
+  }
 }

As per coding guidelines

plugins/security/tsconfig.json (1)

1-3: Reinstate the security plugin’s baseUrl.

Per the monorepo standard, every plugin tsconfig must declare "compilerOptions": { "baseUrl": "./" }. Please add the block back.

 {
-  "extends": "../../tsconfig.json"
+  "extends": "../../tsconfig.json",
+  "compilerOptions": {
+    "baseUrl": "./"
+  }
 }

As per coding guidelines

plugins/i18n/tsconfig.json (1)

1-3: Restore the i18n plugin’s baseUrl.

Guidelines demand each plugin tsconfig explicitly set "baseUrl": "./". Please reintroduce the compilerOptions block while extending the root config.

 {
-  "extends": "../../tsconfig.json"
+  "extends": "../../tsconfig.json",
+  "compilerOptions": {
+    "baseUrl": "./"
+  }
 }

As per coding guidelines

plugins/schedule/tsconfig.json (1)

1-3: Put the schedule plugin back in compliance.

This tsconfig must set "compilerOptions": { "baseUrl": "./" } in addition to extending the shared root. Please restore the block.

 {
-  "extends": "../../tsconfig.json"
+  "extends": "../../tsconfig.json",
+  "compilerOptions": {
+    "baseUrl": "./"
+  }
 }

As per coding guidelines

plugins/session/tsconfig.json (1)

1-3: Reintroduce the session plugin baseUrl.

Every sub-project tsconfig must explicitly keep "compilerOptions.baseUrl": "./". Please add the compilerOptions block back.

 {
-  "extends": "../../tsconfig.json"
+  "extends": "../../tsconfig.json",
+  "compilerOptions": {
+    "baseUrl": "./"
+  }
 }

As per coding guidelines

packages/koa-static-cache/tsconfig.json (1)

1-3: Restore the package-local baseUrl.

Repo guidelines require every {packages,plugins,tools}/**/tsconfig.json to both extend the root config and declare "compilerOptions": { "baseUrl": "./" }. Dropping that override here violates the policy and shifts module resolution away from the package root. Please add the compilerOptions.baseUrl block back. Based on learnings

plugins/jsonp/tsconfig.json (1)

1-3: Reinstate compilerOptions.baseUrl for this plugin.

Each plugin tsconfig must extend the root config and set "baseUrl": "./" locally; otherwise imports resolve from the workspace root. Reintroduce the required block. Based on learnings

packages/supertest/tsconfig.json (1)

1-3: Add back the mandated baseUrl override.

Per the monorepo config rules, every package tsconfig must keep "compilerOptions": { "baseUrl": "./" } alongside the extends. Without it, path resolution targets the workspace root instead of the package. Please restore the block. Based on learnings

plugins/watcher/tsconfig.json (1)

1-3: Bring back the watcher plugin’s baseUrl override.

The documented requirement is that every sub-project tsconfig extends the root config and explicitly sets "compilerOptions.baseUrl": "./". Please restore that entry to keep module resolution scoped correctly. Based on learnings

plugins/multipart/tsconfig.json (1)

1-3: Restore the mandatory baseUrl setting.

This plugin tsconfig now violates the standard that mandates "compilerOptions": { "baseUrl": "./" } in addition to the root extends. Please add the block back so paths resolve from the plugin root. Based on learnings

plugins/redis/tsconfig.json (1)

1-3: Reintroduce compilerOptions.baseUrl for the Redis plugin.

Removing the "baseUrl": "./" override conflicts with the enforced configuration contract for {packages,plugins,tools}/**/tsconfig.json and shifts module resolution. Please restore the compilerOptions block. Based on learnings

packages/extend2/tsconfig.json (1)

1-3: Restore package-level baseUrl.

Policy still requires each package tsconfig to declare "compilerOptions.baseUrl": "./"; inheriting ${configDir} from the root resolves to the repo root and breaks local module lookups. Please add back the local compilerOptions block. Based on learnings

 {
-  "extends": "../../tsconfig.json"
+  "extends": "../../tsconfig.json",
+  "compilerOptions": {
+    "baseUrl": "./"
+  }
 }
plugins/static/tsconfig.json (1)

1-3: Keep the plugin baseUrl scoped locally.

Per the repo standard every plugin tsconfig must set "compilerOptions.baseUrl": "./"; relying on the root’s ${configDir} points resolution at the monorepo root and breaks plugin-relative imports. Please reintroduce the local compilerOptions block. Based on learnings

 {
-  "extends": "../../tsconfig.json"
+  "extends": "../../tsconfig.json",
+  "compilerOptions": {
+    "baseUrl": "./"
+  }
 }
packages/router/tsconfig.json (1)

2-2: Reintroduce package-level baseUrl.

Removing the local "compilerOptions": { "baseUrl": "./" } violates our monorepo guideline and now forces this package to inherit the root "baseUrl": "${configDir}", which TypeScript treats as a literal path. That path does not exist, so any non-relative imports relying on the package root will stop resolving. Please restore the explicit baseUrl here.
As per coding guidelines

 {
-  "extends": "../../tsconfig.json"
+  "extends": "../../tsconfig.json",
+  "compilerOptions": {
+    "baseUrl": "./"
+  }
 }
tsconfig.json (1)

4-4: Fix invalid baseUrl.

TypeScript does not interpolate "${configDir}"; it treats it as a literal folder name. This makes the compiler look for ./${configDir} and breaks every non-relative import across the repo. Point baseUrl to a real directory (e.g., ".") instead.
As per coding guidelines

-    "baseUrl": "${configDir}",
+    "baseUrl": ".",
packages/koa/tsconfig.json (1)

1-3: Restore package-local baseUrl.

Dropping the compilerOptions.baseUrl override now inherits the root setting (${configDir}), which resolves to the repo root and breaks this package’s absolute imports. It also violates the documented requirement that every sub-project tsconfig declares "compilerOptions": { "baseUrl": "./" }. Please add it back.

 {
   "extends": "../../tsconfig.json",
+  "compilerOptions": {
+    "baseUrl": "./"
+  }
 }

As per coding guidelines

packages/utils/tsconfig.json (1)

1-3: Reintroduce compilerOptions.baseUrl.

Without the local override this package inherits the root ${configDir} baseUrl, pointing resolution at the workspace root and breaking local absolute imports. Our tsconfig standards also mandate "baseUrl": "./" in every package config. Please restore it.

 {
   "extends": "../../tsconfig.json",
+  "compilerOptions": {
+    "baseUrl": "./"
+  }
 }

As per coding guidelines

plugins/development/tsconfig.json (1)

1-3: Restore plugin-local baseUrl and strict.

Per repo guidelines, every sub-project tsconfig.json must both extend the root config and explicitly set "compilerOptions": { "baseUrl": "./", "strict": true }. Leaving only the extends makes this plugin inherit the root ${configDir} baseUrl, so module resolution will point at the monorepo root instead of plugins/development, and strict mode is no longer enforced locally. Please add back the compilerOptions block with the expected values.
As per coding guidelines

 {
-  "extends": "../../tsconfig.json"
+  "extends": "../../tsconfig.json",
+  "compilerOptions": {
+    "baseUrl": "./",
+    "strict": true
+  }
 }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1b941ff and f521d1d.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (62)
  • CLAUDE.md (3 hunks)
  • packages/cluster/tsconfig.build.json (1 hunks)
  • packages/cluster/tsconfig.json (1 hunks)
  • packages/cookies/tsconfig.build.json (1 hunks)
  • packages/cookies/tsconfig.json (1 hunks)
  • packages/core/test/egg-ts.test.ts (1 hunks)
  • packages/core/tsconfig.build.json (1 hunks)
  • packages/core/tsconfig.json (0 hunks)
  • packages/egg/tsconfig.build.json (1 hunks)
  • packages/egg/tsconfig.json (0 hunks)
  • packages/errors/tsconfig.json (1 hunks)
  • packages/extend2/tsconfig.build.json (1 hunks)
  • packages/extend2/tsconfig.json (1 hunks)
  • packages/koa-static-cache/tsconfig.build.json (1 hunks)
  • packages/koa-static-cache/tsconfig.json (1 hunks)
  • packages/koa/tsconfig.build.json (1 hunks)
  • packages/koa/tsconfig.json (1 hunks)
  • packages/path-matching/tsconfig.json (1 hunks)
  • packages/router/tsconfig.build.json (1 hunks)
  • packages/router/tsconfig.json (1 hunks)
  • packages/supertest/tsconfig.build.json (1 hunks)
  • packages/supertest/tsconfig.json (1 hunks)
  • packages/utils/tsconfig.build.json (1 hunks)
  • packages/utils/tsconfig.json (1 hunks)
  • plugins/development/tsconfig.build.json (1 hunks)
  • plugins/development/tsconfig.json (1 hunks)
  • plugins/i18n/tsconfig.build.json (1 hunks)
  • plugins/i18n/tsconfig.json (1 hunks)
  • plugins/jsonp/tsconfig.build.json (1 hunks)
  • plugins/jsonp/tsconfig.json (1 hunks)
  • plugins/logrotator/tsconfig.build.json (1 hunks)
  • plugins/logrotator/tsconfig.json (1 hunks)
  • plugins/mock/tsconfig.build.json (1 hunks)
  • plugins/mock/tsconfig.json (0 hunks)
  • plugins/multipart/tsconfig.build.json (1 hunks)
  • plugins/multipart/tsconfig.json (1 hunks)
  • plugins/onerror/tsconfig.build.json (1 hunks)
  • plugins/onerror/tsconfig.json (1 hunks)
  • plugins/redis/tsconfig.build.json (1 hunks)
  • plugins/redis/tsconfig.json (1 hunks)
  • plugins/schedule/tsconfig.build.json (1 hunks)
  • plugins/schedule/tsconfig.json (1 hunks)
  • plugins/security/tsconfig.build.json (1 hunks)
  • plugins/security/tsconfig.json (1 hunks)
  • plugins/session/tsconfig.build.json (1 hunks)
  • plugins/session/tsconfig.json (1 hunks)
  • plugins/static/tsconfig.build.json (1 hunks)
  • plugins/static/tsconfig.json (1 hunks)
  • plugins/tracer/tsconfig.build.json (1 hunks)
  • plugins/tracer/tsconfig.json (1 hunks)
  • plugins/typebox-validate/tsconfig.build.json (1 hunks)
  • plugins/typebox-validate/tsconfig.json (1 hunks)
  • plugins/view/tsconfig.build.json (1 hunks)
  • plugins/view/tsconfig.json (1 hunks)
  • plugins/watcher/tsconfig.build.json (1 hunks)
  • plugins/watcher/tsconfig.json (1 hunks)
  • pnpm-workspace.yaml (1 hunks)
  • tools/create-egg/tsconfig.json (1 hunks)
  • tools/egg-bin/tsconfig.json (0 hunks)
  • tools/scripts/tsconfig.json (0 hunks)
  • tsconfig.build.json (1 hunks)
  • tsconfig.json (1 hunks)
💤 Files with no reviewable changes (5)
  • packages/egg/tsconfig.json
  • tools/scripts/tsconfig.json
  • plugins/mock/tsconfig.json
  • packages/core/tsconfig.json
  • tools/egg-bin/tsconfig.json
🧰 Additional context used
📓 Path-based instructions (11)
plugins/**

📄 CodeRabbit inference engine (CLAUDE.md)

All Egg framework plugins must be placed under the plugins/ directory

Files:

  • plugins/security/tsconfig.build.json
  • plugins/onerror/tsconfig.json
  • plugins/onerror/tsconfig.build.json
  • plugins/mock/tsconfig.build.json
  • plugins/watcher/tsconfig.json
  • plugins/static/tsconfig.build.json
  • plugins/static/tsconfig.json
  • plugins/logrotator/tsconfig.json
  • plugins/typebox-validate/tsconfig.build.json
  • plugins/multipart/tsconfig.json
  • plugins/schedule/tsconfig.build.json
  • plugins/view/tsconfig.build.json
  • plugins/watcher/tsconfig.build.json
  • plugins/session/tsconfig.json
  • plugins/typebox-validate/tsconfig.json
  • plugins/i18n/tsconfig.json
  • plugins/i18n/tsconfig.build.json
  • plugins/session/tsconfig.build.json
  • plugins/logrotator/tsconfig.build.json
  • plugins/schedule/tsconfig.json
  • plugins/redis/tsconfig.json
  • plugins/tracer/tsconfig.build.json
  • plugins/jsonp/tsconfig.build.json
  • plugins/multipart/tsconfig.build.json
  • plugins/view/tsconfig.json
  • plugins/jsonp/tsconfig.json
  • plugins/security/tsconfig.json
  • plugins/development/tsconfig.json
  • plugins/tracer/tsconfig.json
  • plugins/development/tsconfig.build.json
  • plugins/redis/tsconfig.build.json
{packages,plugins,tools}/**/tsconfig.json

📄 CodeRabbit inference engine (CLAUDE.md)

{packages,plugins,tools}/**/tsconfig.json: All sub-project tsconfig.json files MUST extend the root tsconfig.json using "extends": "../../tsconfig.json" and set "compilerOptions.baseUrl": "./"
Enable TypeScript strict mode in all packages ("compilerOptions.strict": true)

Files:

  • plugins/onerror/tsconfig.json
  • plugins/watcher/tsconfig.json
  • packages/koa-static-cache/tsconfig.json
  • plugins/static/tsconfig.json
  • packages/router/tsconfig.json
  • plugins/logrotator/tsconfig.json
  • plugins/multipart/tsconfig.json
  • packages/cookies/tsconfig.json
  • packages/extend2/tsconfig.json
  • plugins/session/tsconfig.json
  • plugins/typebox-validate/tsconfig.json
  • plugins/i18n/tsconfig.json
  • plugins/schedule/tsconfig.json
  • plugins/redis/tsconfig.json
  • plugins/view/tsconfig.json
  • plugins/jsonp/tsconfig.json
  • plugins/security/tsconfig.json
  • packages/supertest/tsconfig.json
  • packages/errors/tsconfig.json
  • tools/create-egg/tsconfig.json
  • plugins/development/tsconfig.json
  • plugins/tracer/tsconfig.json
  • packages/koa/tsconfig.json
  • packages/utils/tsconfig.json
  • packages/cluster/tsconfig.json
  • packages/path-matching/tsconfig.json
packages/*/tsconfig.json

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

All sub-project tsconfig.json files must extend from the root via "extends": "../../tsconfig.json"

Files:

  • packages/koa-static-cache/tsconfig.json
  • packages/router/tsconfig.json
  • packages/cookies/tsconfig.json
  • packages/extend2/tsconfig.json
  • packages/supertest/tsconfig.json
  • packages/errors/tsconfig.json
  • packages/koa/tsconfig.json
  • packages/utils/tsconfig.json
  • packages/cluster/tsconfig.json
  • packages/path-matching/tsconfig.json
{tsconfig.json,packages/*/tsconfig.json}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Enable strict TypeScript mode across all packages

Files:

  • packages/koa-static-cache/tsconfig.json
  • packages/router/tsconfig.json
  • packages/cookies/tsconfig.json
  • packages/extend2/tsconfig.json
  • tsconfig.json
  • packages/supertest/tsconfig.json
  • packages/errors/tsconfig.json
  • packages/koa/tsconfig.json
  • packages/utils/tsconfig.json
  • packages/cluster/tsconfig.json
  • packages/path-matching/tsconfig.json
pnpm-workspace.yaml

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Define dependency versions via the catalog section in pnpm-workspace.yaml and reference them with "catalog:"

Use pnpm catalog mode with dependencies defined once in pnpm-workspace.yaml

Files:

  • pnpm-workspace.yaml
tsconfig.json

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Root tsconfig.json must include all packages in the references array

Files:

  • tsconfig.json
packages/**/test/**/*.test.ts

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

packages/**/test/**/*.test.ts: Name test files as test/**/*.test.ts and run them with Vitest
Use import { describe, it } from 'vitest' in tests
Use Node.js built-in assert module for test assertions

Files:

  • packages/core/test/egg-ts.test.ts
**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

**/*.ts: Prefer TypeScript and ESM: write sources and exports in .ts (ESM-first) rather than CommonJS
Use two-space indentation, trailing commas, and semicolons (Prettier/oxlint defaults)
Name files in lowercase with hyphens (e.g., loader-context.ts)
Name classes in PascalCase
Name functions and variables in camelCase
Re-export types thoughtfully to keep the public API stable

Files:

  • packages/core/test/egg-ts.test.ts
**/test/**/*.test.ts

📄 CodeRabbit inference engine (AGENTS.md)

**/test/**/*.test.ts: Place test suites following Vitest discovery: /test//*.test.ts
Mirror the repository test pattern when adding new suites

Files:

  • packages/core/test/egg-ts.test.ts
{packages/!(cookies),plugins}/**/test/**/*.test.ts

📄 CodeRabbit inference engine (CLAUDE.md)

Test files should follow the pattern test/**/*.test.ts and use Vitest APIs (import { describe, it } from 'vitest')

Files:

  • packages/core/test/egg-ts.test.ts
{packages,plugins}/**/test/**/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

Use Node.js built-in assert module for assertions in tests

Files:

  • packages/core/test/egg-ts.test.ts
🧠 Learnings (13)
📓 Common learnings
Learnt from: CR
PR: eggjs/egg#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-07T03:38:30.682Z
Learning: Applies to {packages,plugins,tools}/**/tsdown.config.ts : Each package should use tsdown for TypeScript builds (include a tsdown.config.ts)
Learnt from: CR
PR: eggjs/egg#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-07T03:38:30.682Z
Learning: Applies to {packages,plugins,tools}/**/tsconfig.json : All sub-project tsconfig.json files MUST extend the root tsconfig.json using "extends": "../../tsconfig.json" and set "compilerOptions.baseUrl": "./"
Learnt from: CR
PR: eggjs/egg#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-14T08:41:30.618Z
Learning: Applies to packages/*/tsconfig.json : All sub-project tsconfig.json files must extend from the root via "extends": "../../tsconfig.json"
Learnt from: CR
PR: eggjs/egg#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-07T03:38:30.682Z
Learning: Applies to plugins/*/tsdown.config.ts : All future plugins MUST use the standard tsdown configuration template (entry: 'src/**/*.ts', unbundle: true, dts: true, exports.devExports: true, unused.level: 'error')
Learnt from: CR
PR: eggjs/egg#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-07T03:38:30.682Z
Learning: Applies to {packages,plugins,tools}/**/tsconfig.json : Enable TypeScript strict mode in all packages ("compilerOptions.strict": true)
📚 Learning: 2025-10-07T03:38:30.682Z
Learnt from: CR
PR: eggjs/egg#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-07T03:38:30.682Z
Learning: Applies to {packages,plugins,tools}/**/tsconfig.json : All sub-project tsconfig.json files MUST extend the root tsconfig.json using "extends": "../../tsconfig.json" and set "compilerOptions.baseUrl": "./"

Applied to files:

  • plugins/security/tsconfig.build.json
  • plugins/onerror/tsconfig.json
  • plugins/onerror/tsconfig.build.json
  • plugins/mock/tsconfig.build.json
  • plugins/watcher/tsconfig.json
  • packages/koa/tsconfig.build.json
  • plugins/static/tsconfig.build.json
  • packages/koa-static-cache/tsconfig.json
  • plugins/static/tsconfig.json
  • packages/router/tsconfig.json
  • plugins/logrotator/tsconfig.json
  • plugins/typebox-validate/tsconfig.build.json
  • packages/egg/tsconfig.build.json
  • packages/supertest/tsconfig.build.json
  • plugins/multipart/tsconfig.json
  • packages/cookies/tsconfig.json
  • plugins/schedule/tsconfig.build.json
  • packages/extend2/tsconfig.json
  • plugins/view/tsconfig.build.json
  • plugins/watcher/tsconfig.build.json
  • packages/router/tsconfig.build.json
  • packages/cluster/tsconfig.build.json
  • tsconfig.json
  • plugins/session/tsconfig.json
  • plugins/typebox-validate/tsconfig.json
  • plugins/i18n/tsconfig.json
  • packages/extend2/tsconfig.build.json
  • plugins/i18n/tsconfig.build.json
  • plugins/session/tsconfig.build.json
  • plugins/logrotator/tsconfig.build.json
  • plugins/schedule/tsconfig.json
  • packages/utils/tsconfig.build.json
  • plugins/redis/tsconfig.json
  • plugins/tracer/tsconfig.build.json
  • plugins/jsonp/tsconfig.build.json
  • plugins/multipart/tsconfig.build.json
  • plugins/view/tsconfig.json
  • plugins/jsonp/tsconfig.json
  • plugins/security/tsconfig.json
  • packages/supertest/tsconfig.json
  • packages/errors/tsconfig.json
  • tools/create-egg/tsconfig.json
  • plugins/development/tsconfig.json
  • tsconfig.build.json
  • plugins/tracer/tsconfig.json
  • CLAUDE.md
  • packages/koa/tsconfig.json
  • packages/koa-static-cache/tsconfig.build.json
  • plugins/development/tsconfig.build.json
  • packages/utils/tsconfig.json
  • packages/cluster/tsconfig.json
  • packages/core/tsconfig.build.json
  • packages/cookies/tsconfig.build.json
  • packages/path-matching/tsconfig.json
  • plugins/redis/tsconfig.build.json
📚 Learning: 2025-09-14T08:41:30.618Z
Learnt from: CR
PR: eggjs/egg#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-14T08:41:30.618Z
Learning: Applies to packages/*/tsconfig.json : All sub-project tsconfig.json files must extend from the root via "extends": "../../tsconfig.json"

Applied to files:

  • plugins/security/tsconfig.build.json
  • plugins/onerror/tsconfig.json
  • plugins/onerror/tsconfig.build.json
  • plugins/mock/tsconfig.build.json
  • plugins/watcher/tsconfig.json
  • packages/koa/tsconfig.build.json
  • plugins/static/tsconfig.build.json
  • packages/koa-static-cache/tsconfig.json
  • plugins/static/tsconfig.json
  • packages/router/tsconfig.json
  • plugins/logrotator/tsconfig.json
  • plugins/typebox-validate/tsconfig.build.json
  • packages/egg/tsconfig.build.json
  • packages/supertest/tsconfig.build.json
  • plugins/multipart/tsconfig.json
  • packages/cookies/tsconfig.json
  • plugins/schedule/tsconfig.build.json
  • packages/extend2/tsconfig.json
  • plugins/view/tsconfig.build.json
  • plugins/watcher/tsconfig.build.json
  • packages/router/tsconfig.build.json
  • packages/cluster/tsconfig.build.json
  • plugins/session/tsconfig.json
  • plugins/typebox-validate/tsconfig.json
  • plugins/i18n/tsconfig.json
  • packages/extend2/tsconfig.build.json
  • plugins/i18n/tsconfig.build.json
  • plugins/session/tsconfig.build.json
  • plugins/logrotator/tsconfig.build.json
  • plugins/schedule/tsconfig.json
  • packages/utils/tsconfig.build.json
  • plugins/redis/tsconfig.json
  • plugins/tracer/tsconfig.build.json
  • plugins/jsonp/tsconfig.build.json
  • plugins/multipart/tsconfig.build.json
  • plugins/view/tsconfig.json
  • plugins/jsonp/tsconfig.json
  • plugins/security/tsconfig.json
  • packages/supertest/tsconfig.json
  • packages/errors/tsconfig.json
  • tools/create-egg/tsconfig.json
  • plugins/development/tsconfig.json
  • tsconfig.build.json
  • plugins/tracer/tsconfig.json
  • CLAUDE.md
  • packages/koa/tsconfig.json
  • packages/koa-static-cache/tsconfig.build.json
  • plugins/development/tsconfig.build.json
  • packages/utils/tsconfig.json
  • packages/cluster/tsconfig.json
  • packages/core/tsconfig.build.json
  • packages/cookies/tsconfig.build.json
  • packages/path-matching/tsconfig.json
  • plugins/redis/tsconfig.build.json
📚 Learning: 2025-10-07T03:38:30.682Z
Learnt from: CR
PR: eggjs/egg#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-07T03:38:30.682Z
Learning: Applies to plugins/*/tsdown.config.ts : All future plugins MUST use the standard tsdown configuration template (entry: 'src/**/*.ts', unbundle: true, dts: true, exports.devExports: true, unused.level: 'error')

Applied to files:

  • plugins/onerror/tsconfig.json
  • plugins/onerror/tsconfig.build.json
  • plugins/static/tsconfig.json
  • plugins/logrotator/tsconfig.json
  • plugins/multipart/tsconfig.json
  • plugins/i18n/tsconfig.build.json
  • plugins/schedule/tsconfig.json
  • plugins/multipart/tsconfig.build.json
  • plugins/view/tsconfig.json
  • plugins/development/tsconfig.json
  • tsconfig.build.json
  • plugins/development/tsconfig.build.json
📚 Learning: 2025-09-14T08:41:30.618Z
Learnt from: CR
PR: eggjs/egg#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-14T08:41:30.618Z
Learning: Applies to pnpm-workspace.yaml : Define dependency versions via the catalog section in pnpm-workspace.yaml and reference them with "catalog:"

Applied to files:

  • pnpm-workspace.yaml
📚 Learning: 2025-10-07T03:38:30.682Z
Learnt from: CR
PR: eggjs/egg#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-07T03:38:30.682Z
Learning: Applies to pnpm-workspace.yaml : Use pnpm catalog mode with dependencies defined once in pnpm-workspace.yaml

Applied to files:

  • pnpm-workspace.yaml
📚 Learning: 2025-10-07T03:38:30.682Z
Learnt from: CR
PR: eggjs/egg#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-07T03:38:30.682Z
Learning: Applies to {packages,plugins,tools}/**/tsdown.config.ts : Each package should use tsdown for TypeScript builds (include a tsdown.config.ts)

Applied to files:

  • pnpm-workspace.yaml
📚 Learning: 2025-10-07T03:38:30.682Z
Learnt from: CR
PR: eggjs/egg#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-07T03:38:30.682Z
Learning: Applies to packages/egg/src/config/{plugin.ts,config.default.ts} : Maintain built-in plugin configuration in src/config/plugin.ts and default framework configuration in src/config/config.default.ts

Applied to files:

  • plugins/i18n/tsconfig.build.json
  • CLAUDE.md
  • plugins/development/tsconfig.build.json
📚 Learning: 2025-10-07T03:38:30.682Z
Learnt from: CR
PR: eggjs/egg#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-07T03:38:30.682Z
Learning: Applies to {packages/cookies,tools/egg-bin}/**/test/**/*.test.ts : cookies and egg-bin tests should be located at test/**/*.test.ts (Mocha)

Applied to files:

  • packages/core/test/egg-ts.test.ts
📚 Learning: 2025-10-07T03:38:30.682Z
Learnt from: CR
PR: eggjs/egg#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-07T03:38:30.682Z
Learning: Applies to plugins/**/src/**/*.ts : In plugin TypeScript sources, use ESM-style extensioned imports with .ts in relative imports

Applied to files:

  • packages/core/test/egg-ts.test.ts
  • plugins/development/tsconfig.build.json
📚 Learning: 2025-09-18T07:56:17.417Z
Learnt from: CR
PR: eggjs/egg#0
File: AGENTS.md:0-0
Timestamp: 2025-09-18T07:56:17.417Z
Learning: Applies to **/*.ts : Re-export types thoughtfully to keep the public API stable

Applied to files:

  • packages/core/test/egg-ts.test.ts
📚 Learning: 2025-10-07T03:38:30.682Z
Learnt from: CR
PR: eggjs/egg#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-07T03:38:30.682Z
Learning: Applies to plugins/*/package.json : All plugins must declare peerDependencies: { "egg": "workspace:*" }, include "files": ["dist"], and have scripts: build, typecheck, lint, test, prepublishOnly

Applied to files:

  • CLAUDE.md
📚 Learning: 2025-09-14T08:41:30.618Z
Learnt from: CR
PR: eggjs/egg#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-14T08:41:30.618Z
Learning: Applies to tsconfig.json : Root tsconfig.json must include all packages in the references array

Applied to files:

  • CLAUDE.md
⏰ 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 (macos-latest, 22, 2/5)
  • GitHub Check: Test (macos-latest, 22, 5/5)
  • GitHub Check: Test (windows-latest, 22, 3/5)
  • GitHub Check: Test (windows-latest, 24, 4/5)
  • GitHub Check: Test (ubuntu-latest, 22, 5/5)
  • GitHub Check: Test (windows-latest, 22, 1/5)
  • GitHub Check: Test (macos-latest, 24, 2/5)
  • GitHub Check: Test (ubuntu-latest, 22, 3/5)
  • GitHub Check: Test (macos-latest, 22, 4/5)
  • GitHub Check: Test (macos-latest, 22, 3/5)
  • GitHub Check: Socket Security: Pull Request Alerts
  • GitHub Check: Test bin (windows-latest, 22, 4/5)
  • GitHub Check: Test bin (ubuntu-latest, 22, 1/5)
  • GitHub Check: Test bin (ubuntu-latest, 22, 0/5)
  • GitHub Check: Test bin (ubuntu-latest, 22, 3/5)
  • GitHub Check: Test scripts (ubuntu-latest, 22, 4/5)
  • GitHub Check: Test scripts (ubuntu-latest, 22, 3/5)
  • GitHub Check: Test scripts (ubuntu-latest, 22, 5/5)
  • GitHub Check: typecheck
🔇 Additional comments (1)
tsconfig.build.json (1)

1-14: Confirm TypeScript version supports ${configDir} placeholders.

This config relies on ${configDir} interpolation, which TypeScript introduced in 5.4. Please double-check that the workspace TypeScript (and build tooling like tsdown) resolves these placeholders; otherwise rootDir/outDir will break.
Based on learnings

Comment on lines +521 to +525
// packages/*/tsconfig.build.json, plugins/*/tsconfig.build.json
{
"extends": "../../tsconfig.build.json"
}
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Include tools tsconfig.build.json in the minimal pattern.

The snippet calls out packages and plugins, but this PR also standardizes tools/*/tsconfig.build.json to extend the root build config. Please add tools here so new tool packages follow the same rule.

🤖 Prompt for AI Agents
In CLAUDE.md around lines 521 to 525, the example pattern lists only packages/*
and plugins/* for tsconfig.build.json extension; update the snippet to also
include tools/* so tools/*/tsconfig.build.json extends the root build config.
Replace the snippet with a three-entry pattern (packages/*, plugins/*, tools/*)
so new tool packages inherit "../../tsconfig.build.json".

@fengmk2 fengmk2 merged commit 2864926 into next Oct 10, 2025
56 of 59 checks passed
@fengmk2 fengmk2 deleted the share-tsconfig branch October 10, 2025 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant