Skip to content

chore: fix typecheck#5726

Merged
fengmk2 merged 8 commits intonextfrom
fix-typecheck
Dec 12, 2025
Merged

chore: fix typecheck#5726
fengmk2 merged 8 commits intonextfrom
fix-typecheck

Conversation

@fengmk2
Copy link
Member

@fengmk2 fengmk2 commented Dec 11, 2025

Summary by CodeRabbit

  • Chores

    • Updated many dev dependency versions and added a TypeScript preview dev dependency.
    • Consolidated and reorganized dependency declarations across packages.
  • Style / Tooling

    • Broadened lint ignore patterns and tightened the lint command.
    • Standardized type-check workflows to run an extra preflight checker before TypeScript compilation.
  • Tests

    • Skipped or conditionally skipped several flaky Windows tests and added cleanup error handling.
  • Documentation

    • Updated developer guidance to reflect the new type-check workflow.

✏️ Tip: You can customize this high-level summary in your review settings.

@fengmk2 fengmk2 requested a review from Copilot December 11, 2025 14:47
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 11, 2025

Caution

Review failed

The pull request is closed.

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

Bumps workspace catalog deps and adds a new catalog entry; many package.json "typecheck" scripts now run "tsgo --noEmit && tsc --noEmit"; lint ignore patterns expanded; small TypeScript typing tweak in tsdown config; create-egg package.json reorganized; multiple template/config files refactored to export named typed constants.

Changes

Cohort / File(s) Summary
Workspace catalog & root package.json
pnpm-workspace.yaml, package.json
Bumped catalog versions (@types/node, oxlint, oxlint-tsgolint) and added @typescript/native-preview; added @typescript/native-preview to devDependencies; updated root lint script to include --type-check.
Typecheck script updates (many packages & templates)
packages/*/package.json, plugins/*/package.json, tegg/**/package.json, tools/**/package.json, examples/*/package.json, tools/create-egg/src/templates/*/package.json, ...
Replaced "tsc --noEmit" with "tsgo --noEmit && tsc --noEmit" across numerous package.json files and templates.
Lint config
.oxlintrc.json
Expanded ignorePatterns to add several template/test paths and broaden lint exclusions.
tsdown typing change
tools/egg-bin/tsdown.config.ts
Added type UserConfig import and cast ...(baseConfig as UserConfig) for stricter typing; no runtime change.
create-egg package metadata
tools/create-egg/package.json
Reorganized dependency blocks; moved/added devDependencies (e.g., @eggjs/tracer, @eggjs/mock, egg) and consolidated declarations.
Template import/type tweaks
tools/create-egg/src/templates/tegg/app/module/...
Switched logger type imports to type Logger from egg and changed some imports from @eggjs/teggegg; types-only edits.
Config export refactors
multiple config files (examples, packages, plugins, tegg, etc.) e.g. examples/*/config/*.ts, packages/egg/src/config/*.ts, plugins/*/src/config/*.ts, plugins/typebox-validate/test/fixtures/.../config.default.ts, plugins/watcher/src/config/*.ts
Replaced inline default exports with named const config: PartialEggConfig = ...; export default config; or defineConfigFactory(...) wrappers, moving type assertions to explicit const declarations.
Test adjustments (platform skips / flaky tests)
packages/koa-static-cache/test/index.test.ts, plugins/*/test/*.test.ts
Added conditional describe.skipIf / it.skip for Windows in several flaky tests and changed some tests to skipped with FIXME comments.
CI gating
.github/workflows/ci.yml
Example tests step now also guards against Windows (adds OS != windows-latest condition alongside Node != '20').

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Areas to focus:
    • pnpm-workspace.yaml catalog mapping and catalog: resolution for @typescript/native-preview.
    • CI gating change in .github/workflows/ci.yml and platform-skipped tests.
    • Widespread package.json script edits (ensure tsgo availability in CI/tooling).
    • tools/create-egg/package.json reorganization and templates compiling after import/type tweaks.
    • Config export shape changes (named const exports) and any consumers relying on prior inline exports.

Possibly related PRs

Poem

🐇
I nudged a pin in catalogs so bright,
Chained tsgo then tsc—two checks take flight.
Types tidied, templates neat and prim,
Skipped a flaky hop where Windows is grim.
A little carrot patch — a joyful rim. 🥕

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 'chore: fix typecheck' is related to a significant aspect of the changeset—updating typecheck scripts across numerous package.json files and adding tsgo tooling. However, it does not capture the full scope of changes, which also include dependency updates, configuration changes, template refactoring, and test modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

📜 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 0fbbbf6 and 3d3cade.

📒 Files selected for processing (3)
  • .github/workflows/ci.yml (1 hunks)
  • packages/koa-static-cache/test/index.test.ts (3 hunks)
  • plugins/multipart/test/stream-mode-with-filematch-glob.test.ts (1 hunks)

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.

@gemini-code-assist
Copy link
Contributor

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 primarily focuses on routine maintenance by updating various development dependencies and their associated type definitions to their latest versions. It also includes a targeted fix within a tsdown configuration file to enhance type-checking robustness, contributing to overall code quality and ensuring better compatibility with updated tooling.

Highlights

  • Dependency Updates: Several development dependencies and their type definitions have been updated to their latest patch or minor versions, including @types/node, oxlint, oxlint-tsgolint, and expect-type.
  • Type Definition Alignment: The @types/node package has been consistently updated across the project to version 24.10.2 to ensure compatibility and leverage the latest type definitions.
  • Linter Tooling Upgrade: The oxlint and oxlint-tsgolint packages, crucial for code quality and linting, have been upgraded to 1.32.0 and 0.8.5 respectively.
  • Type-Checking Configuration Fix: A specific type assertion was added in tools/egg-bin/tsdown.config.ts to explicitly cast baseConfig to UserConfig, resolving potential type-checking issues with the tsdown configuration.
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.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Dec 11, 2025

Deploying egg with  Cloudflare Pages  Cloudflare Pages

Latest commit: 154a42b
Status: ✅  Deploy successful!
Preview URL: https://8b261274.egg-cci.pages.dev
Branch Preview URL: https://fix-typecheck.egg-cci.pages.dev

View logs

@codecov
Copy link

codecov bot commented Dec 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.61%. Comparing base (c3ecf63) to head (3d3cade).
⚠️ Report is 1 commits behind head on next.

Additional details and impacted files
@@           Coverage Diff           @@
##             next    #5726   +/-   ##
=======================================
  Coverage   87.60%   87.61%           
=======================================
  Files         561      569    +8     
  Lines       10933    10941    +8     
  Branches     1238     1238           
=======================================
+ Hits         9578     9586    +8     
  Misses       1271     1271           
  Partials       84       84           

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

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Dec 11, 2025

Deploying egg-v3 with  Cloudflare Pages  Cloudflare Pages

Latest commit: 3d3cade
Status:⚡️  Build in progress...

View logs

Copy link
Contributor

@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 primarily consists of dependency updates to address type-checking issues, which is a good maintenance practice. The main packages updated are @types/node, oxlint, and oxlint-tsgolint. Additionally, there's a code change in tools/egg-bin/tsdown.config.ts to fix a type error related to a JSON import. I've provided one suggestion on that file to improve type safety by using a const assertion instead of a direct type cast. Overall, the changes are correct and achieve the goal of fixing the typecheck.

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: 0

🧹 Nitpick comments (1)
tools/egg-bin/tsdown.config.ts (1)

1-7: Type cast fixes tsdown config typing; consider explicit typed intermediate for clarity

The UserConfig import plus baseConfig as UserConfig spread is a reasonable way to fix the typecheck and matches tsdown’s expectations. To better align with the guideline for config files, you might optionally introduce an explicitly typed intermediate config object and keep defineConfig just as a wrapper, e.g.:

import { defineConfig, type UserConfig } from 'tsdown';
import baseConfig from '../../tsdown.config.json' with { type: 'json' };

const userConfig: UserConfig = {
  ...baseConfig,
  // MEMO: @oclif/core only work on unbundle mode
  unbundle: true,
  unused: {
    level: 'error',
    ignore: ['utility'],
  },
  copy: [
    {
      from: 'scripts',
      to: 'dist/scripts',
    },
  ],
};

export default defineConfig(userConfig);

This keeps the JSON merge strongly typed and explicit while preserving current behavior. As per coding guidelines for tsdown.config.ts, ...

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c3ecf63 and c6cfd17.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • pnpm-workspace.yaml (2 hunks)
  • tools/egg-bin/tsdown.config.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
**/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.ts: Use explicit return types for all exported functions, methods, and getters to support TypeScript's isolatedDeclarations flag
Use unique symbol type for exported symbol constants
All exported functions in TypeScript files must have explicit return type annotations
Use camelCase for variable and function names in TypeScript
Prefer interfaces over type aliases for object shapes in TypeScript
Use readonly modifiers where appropriate in TypeScript class properties and interfaces
Avoid any type; use unknown when the type is truly unknown in TypeScript
Use weak references for caches when appropriate to prevent memory leaks
Use export statements instead of module.exports in ESM packages
Use import statements instead of require() in ESM packages
Add .ts file extensions in import statements for proper TypeScript resolution
Avoid computed property names with symbols in class declarations to support isolatedDeclarations

Files:

  • tools/egg-bin/tsdown.config.ts
{**/tsdown.config.ts,**/vitest.config.ts}

📄 CodeRabbit inference engine (CLAUDE.md)

For TypeScript config files (tsdown.config.ts, vitest.config.ts), use typed intermediate variables with explicit type annotations to support isolatedDeclarations

Files:

  • tools/egg-bin/tsdown.config.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,js,jsx}: Name files in lowercase with hyphens (e.g., loader-context.ts)
Use two-space indentation, trailing commas, and semicolons enforced by Prettier and oxlint

Files:

  • tools/egg-bin/tsdown.config.ts
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,js}: Name classes in PascalCase
Name functions and variables in camelCase

Files:

  • tools/egg-bin/tsdown.config.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Re-export types thoughtfully to keep the public API stable

Files:

  • tools/egg-bin/tsdown.config.ts
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
🧠 Learnings (21)
📓 Common learnings
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:37.671Z
Learning: Applies to {packages/*/package.json,plugins/*/package.json,tools/*/package.json} : Use catalog: for external dependencies defined in pnpm-workspace.yaml
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:*'
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:37.671Z
Learning: Use oxlint with `--type-aware` flag for linting across all packages instead of ESLint
📚 Learning: 2025-11-27T14:38:37.671Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:37.671Z
Learning: Applies to {**/tsdown.config.ts,**/vitest.config.ts} : For TypeScript config files (tsdown.config.ts, vitest.config.ts), use typed intermediate variables with explicit type annotations to support isolatedDeclarations

Applied to files:

  • tools/egg-bin/tsdown.config.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/*/tsdown.config.ts : Use tsdown for unbundled ESM builds that preserves file structure; configure via tsdown.config.ts in each package

Applied to files:

  • tools/egg-bin/tsdown.config.ts
📚 Learning: 2025-11-27T14:38:37.671Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:37.671Z
Learning: Applies to plugins/*/tsdown.config.ts : All plugins MUST use this tsdown configuration template with entry pattern `src/**/*.ts`, `unbundle: true`, `dts: true`, and `exports.devExports: true`

Applied to files:

  • tools/egg-bin/tsdown.config.ts
📚 Learning: 2025-11-27T14:39:09.305Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-27T14:39:09.305Z
Learning: Applies to **/*.{ts,tsx} : Re-export types thoughtfully to keep the public API stable

Applied to files:

  • tools/egg-bin/tsdown.config.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:

  • tools/egg-bin/tsdown.config.ts
📚 Learning: 2025-11-27T14:38:37.671Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:37.671Z
Learning: Applies to tools/egg-bin/tsconfig.json : Set `isolatedDeclarations: false` in tsconfig.json for oclif CLI tools (tools/egg-bin) due to Flags API incompatibility

Applied to files:

  • tools/egg-bin/tsdown.config.ts
📚 Learning: 2025-11-27T14:38:55.513Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:55.513Z
Learning: Applies to tegg/core/*/tsconfig.json : Include tsconfig.json extending eggjs/tsconfig in each core package

Applied to files:

  • tools/egg-bin/tsdown.config.ts
📚 Learning: 2025-11-27T14:38:37.671Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:37.671Z
Learning: Applies to **/*.ts : Use explicit return types for all exported functions, methods, and getters to support TypeScript's isolatedDeclarations flag

Applied to files:

  • tools/egg-bin/tsdown.config.ts
📚 Learning: 2025-11-27T14:38:37.671Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:37.671Z
Learning: Applies to plugins/*/src/types.ts : Module augmentation in plugin types.ts MUST extend the 'egg' module using `declare module 'egg'`

Applied to files:

  • tools/egg-bin/tsdown.config.ts
📚 Learning: 2025-11-27T14:38:37.671Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:37.671Z
Learning: Applies to plugins/*/src/types.ts : Include JSDoc comments for configuration properties in plugin type definitions

Applied to files:

  • tools/egg-bin/tsdown.config.ts
📚 Learning: 2025-11-27T14:38:37.671Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:37.671Z
Learning: Applies to config/*.ts : Use `config/` directory for application configuration files

Applied to files:

  • tools/egg-bin/tsdown.config.ts
📚 Learning: 2025-11-27T14:38:37.671Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:37.671Z
Learning: Applies to tsconfig.json : Use `${configDir}` variable in root TypeScript configurations for per-package path resolution

Applied to files:

  • tools/egg-bin/tsdown.config.ts
📚 Learning: 2025-11-27T14:38:37.671Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:37.671Z
Learning: Applies to {packages/*/package.json,plugins/*/package.json,tools/*/package.json} : Use catalog: for external dependencies defined in pnpm-workspace.yaml

Applied to files:

  • pnpm-workspace.yaml
📚 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-11-27T14:39:09.305Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-27T14:39:09.305Z
Learning: Applies to package.json : Keep local Node.js and pnpm versions aligned with the repo's `packageManager` field in configuration files

Applied to files:

  • pnpm-workspace.yaml
📚 Learning: 2025-11-27T14:38:37.671Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:37.671Z
Learning: Applies to {packages/*/package.json,plugins/*/package.json,tools/*/package.json} : Use workspace:* for internal package dependencies in package.json

Applied to files:

  • pnpm-workspace.yaml
📚 Learning: 2025-11-27T14:38:37.671Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:37.671Z
Learning: All packages in this monorepo require Node.js >= 22.18.0

Applied to files:

  • pnpm-workspace.yaml
📚 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: Node.js >= 20.19.0 is required - this is a hard requirement

Applied to files:

  • pnpm-workspace.yaml
📚 Learning: 2025-11-27T14:38:37.671Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:37.671Z
Learning: Use oxlint with `--type-aware` flag for linting across all packages instead of ESLint

Applied to files:

  • pnpm-workspace.yaml
📚 Learning: 2025-11-27T14:38:37.671Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:37.671Z
Learning: Applies to {.eslintrc,.eslintrc.js,.eslintrc.json} : Remove `.eslintrc`, `.eslintrc.js`, and `.eslintrc.json` files when migrating packages to oxlint

Applied to files:

  • pnpm-workspace.yaml
🧬 Code graph analysis (1)
tools/egg-bin/tsdown.config.ts (1)
packages/egg/src/lib/define.ts (1)
  • defineConfig (29-31)
⏰ 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). (22)
  • GitHub Check: Socket Security: Pull Request Alerts
  • GitHub Check: Test (macos-latest, 24, 2/3)
  • GitHub Check: Test (windows-latest, 20, 1/3)
  • GitHub Check: Test (windows-latest, 22, 2/3)
  • GitHub Check: Test (macos-latest, 20, 2/3)
  • GitHub Check: Test (ubuntu-latest, 24, 1/3)
  • GitHub Check: Test (windows-latest, 22, 3/3)
  • GitHub Check: Test (ubuntu-latest, 20, 2/3)
  • GitHub Check: Test (macos-latest, 20, 3/3)
  • GitHub Check: Test (windows-latest, 20, 2/3)
  • GitHub Check: Test (ubuntu-latest, 24, 3/3)
  • GitHub Check: Test (ubuntu-latest, 22, 1/3)
  • GitHub Check: Test (macos-latest, 22, 3/3)
  • GitHub Check: Test bin (windows-latest, 22, 2/3)
  • GitHub Check: Test bin (ubuntu-latest, 22, 1/3)
  • GitHub Check: Test bin (windows-latest, 22, 0/3)
  • GitHub Check: Test bin (ubuntu-latest, 22, 0/3)
  • GitHub Check: Test bin (windows-latest, 22, 1/3)
  • GitHub Check: Test bin (ubuntu-latest, 22, 2/3)
  • GitHub Check: typecheck
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Cloudflare Pages: egg-v3
🔇 Additional comments (1)
pnpm-workspace.yaml (1)

53-53: Version bumps for types and lint tooling look fine; verify CI passes

The catalog bumps for @types/node, oxlint, and oxlint-tsgolint are consistent with the workspace’s catalog setup; there’s no config smell here. Please just make sure the updated versions run cleanly in CI (typecheck, lint scripts) across all packages, especially given the stricter oxlint releases. Based on learnings about using the catalog for shared tooling, ...

Also applies to: 174-175

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 fixes TypeScript type checking errors by adding explicit type annotations and updating related dependencies. The changes address type compatibility issues when spreading a JSON-imported configuration object.

  • Fix type checking error in tsdown configuration by importing and using the UserConfig type
  • Update development dependencies to latest patch versions (@types/node, oxlint, oxlint-tsgolint)
  • Update lockfile to reflect dependency version changes

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
tools/egg-bin/tsdown.config.ts Add UserConfig type import and explicit type cast for JSON configuration to resolve TypeScript type checking errors
pnpm-workspace.yaml Update catalog dependencies to latest patch versions (@types/node 24.10.1→24.10.2, oxlint 1.31.0→1.32.0, oxlint-tsgolint 0.8.3→0.8.5)
pnpm-lock.yaml Update lockfile to reflect new dependency versions and their transitive dependency changes
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

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: 0

🧹 Nitpick comments (1)
tools/create-egg/src/templates/tegg/app/module/bar/controller/home.ts (1)

1-1: Logger typing update matches new egg Logger type

Using type Logger from 'egg' for the injected logger property brings this controller in line with the updated service templates and should satisfy typecheck without affecting behavior.

If you later tighten template typing (e.g., isolatedDeclarations), consider adding an explicit return type like Promise<string> to index for full consistency, though that’s orthogonal to this PR.

Also applies to: 8-8

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c6cfd17 and 1a3aa6b.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (7)
  • .oxlintrc.json (1 hunks)
  • package.json (2 hunks)
  • pnpm-workspace.yaml (3 hunks)
  • tools/create-egg/package.json (1 hunks)
  • tools/create-egg/src/templates/tegg/app/module/bar/controller/home.ts (1 hunks)
  • tools/create-egg/src/templates/tegg/app/module/bar/controller/user.ts (1 hunks)
  • tools/create-egg/src/templates/tegg/app/module/foo/service/HelloService.ts (2 hunks)
🧰 Additional context used
📓 Path-based instructions (7)
**/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.ts: Use explicit return types for all exported functions, methods, and getters to support TypeScript's isolatedDeclarations flag
Use unique symbol type for exported symbol constants
All exported functions in TypeScript files must have explicit return type annotations
Use camelCase for variable and function names in TypeScript
Prefer interfaces over type aliases for object shapes in TypeScript
Use readonly modifiers where appropriate in TypeScript class properties and interfaces
Avoid any type; use unknown when the type is truly unknown in TypeScript
Use weak references for caches when appropriate to prevent memory leaks
Use export statements instead of module.exports in ESM packages
Use import statements instead of require() in ESM packages
Add .ts file extensions in import statements for proper TypeScript resolution
Avoid computed property names with symbols in class declarations to support isolatedDeclarations

Files:

  • tools/create-egg/src/templates/tegg/app/module/bar/controller/user.ts
  • tools/create-egg/src/templates/tegg/app/module/bar/controller/home.ts
  • tools/create-egg/src/templates/tegg/app/module/foo/service/HelloService.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,js,jsx}: Name files in lowercase with hyphens (e.g., loader-context.ts)
Use two-space indentation, trailing commas, and semicolons enforced by Prettier and oxlint

Files:

  • tools/create-egg/src/templates/tegg/app/module/bar/controller/user.ts
  • tools/create-egg/src/templates/tegg/app/module/bar/controller/home.ts
  • tools/create-egg/src/templates/tegg/app/module/foo/service/HelloService.ts
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,js}: Name classes in PascalCase
Name functions and variables in camelCase

Files:

  • tools/create-egg/src/templates/tegg/app/module/bar/controller/user.ts
  • tools/create-egg/src/templates/tegg/app/module/bar/controller/home.ts
  • tools/create-egg/src/templates/tegg/app/module/foo/service/HelloService.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Re-export types thoughtfully to keep the public API stable

Files:

  • tools/create-egg/src/templates/tegg/app/module/bar/controller/user.ts
  • tools/create-egg/src/templates/tegg/app/module/bar/controller/home.ts
  • tools/create-egg/src/templates/tegg/app/module/foo/service/HelloService.ts
package.json

📄 CodeRabbit inference engine (AGENTS.md)

Keep local Node.js and pnpm versions aligned with the repo's packageManager field in configuration files

Files:

  • package.json
{packages/*/package.json,plugins/*/package.json,tools/*/package.json}

📄 CodeRabbit inference engine (CLAUDE.md)

{packages/*/package.json,plugins/*/package.json,tools/*/package.json}: Use workspace:* for internal package dependencies in package.json
Use catalog: for external dependencies defined in pnpm-workspace.yaml
Set type: module in package.json for ESM packages
Include build, typecheck, lint, test, and prepublishOnly scripts in all package.json files

Files:

  • tools/create-egg/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
🧠 Learnings (43)
📓 Common learnings
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:55.513Z
Learning: Applies to tegg/**/package.json : Use `workspace:*` protocol for internal tegg and egg monorepo dependencies in package.json
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-11-27T14:38:37.671Z
Learning: Applies to plugins/*/package.json : Plugin package.json MUST include egg in peerDependencies to ensure framework compatibility
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:55.513Z
Learning: Applies to tegg/core/*/package.json : Include standard build scripts in package.json: typecheck, clean, and build with tsdown and tsc
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:37.671Z
Learning: Follow standard Egg plugin structure with `src/`, `test/`, `package.json`, and `tsdown.config.ts` files
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:55.513Z
Learning: Applies to tegg/plugin/*/package.json : Define eggPlugin in package.json and create app.ts for initialization in plugin packages
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:37.671Z
Learning: Applies to {packages/*/package.json,plugins/*/package.json,tools/*/package.json} : Use workspace:* for internal package dependencies in package.json
📚 Learning: 2025-11-27T14:38:37.671Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:37.671Z
Learning: Applies to {.eslintrc,.eslintrc.js,.eslintrc.json} : Remove `.eslintrc`, `.eslintrc.js`, and `.eslintrc.json` files when migrating packages to oxlint

Applied to files:

  • .oxlintrc.json
  • pnpm-workspace.yaml
📚 Learning: 2025-11-27T14:38:37.671Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:37.671Z
Learning: Applies to tools/egg-bin/tsconfig.json : Set `isolatedDeclarations: false` in tsconfig.json for oclif CLI tools (tools/egg-bin) due to Flags API incompatibility

Applied to files:

  • .oxlintrc.json
  • package.json
  • tools/create-egg/package.json
📚 Learning: 2025-11-27T14:39:09.305Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-27T14:39:09.305Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use two-space indentation, trailing commas, and semicolons enforced by Prettier and oxlint

Applied to files:

  • .oxlintrc.json
  • package.json
📚 Learning: 2025-11-27T14:38:37.671Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:37.671Z
Learning: Use oxlint with `--type-aware` flag for linting across all packages instead of ESLint

Applied to files:

  • .oxlintrc.json
  • package.json
  • pnpm-workspace.yaml
📚 Learning: 2025-11-27T14:38:55.513Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:55.513Z
Learning: Applies to tegg/core/*/tsconfig.json : Include tsconfig.json extending eggjs/tsconfig in each core package

Applied to files:

  • .oxlintrc.json
  • tools/create-egg/src/templates/tegg/app/module/bar/controller/user.ts
  • package.json
  • tools/create-egg/package.json
📚 Learning: 2025-11-27T14:38:37.671Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:37.671Z
Learning: Applies to {packages/!(egg|cookies)/test/**/*.test.ts,plugins/*/test/**/*.test.ts,tools/!(egg-bin)/test/**/*.test.ts} : All new packages MUST use Vitest for testing (exception: egg-bin and cookies packages use Mocha)

Applied to files:

  • .oxlintrc.json
  • tools/create-egg/package.json
  • pnpm-workspace.yaml
📚 Learning: 2025-11-27T14:38:55.513Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:55.513Z
Learning: Applies to tegg/core/*/package.json : Include standard build scripts in package.json: typecheck, clean, and build with tsdown and tsc

Applied to files:

  • .oxlintrc.json
  • package.json
  • tools/create-egg/package.json
📚 Learning: 2025-11-27T14:38:37.671Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:37.671Z
Learning: Applies to {packages/cookies/test/**/*.test.ts,tools/egg-bin/test/**/*.test.ts} : Use Mocha test framework for egg-bin and cookies packages

Applied to files:

  • .oxlintrc.json
  • tools/create-egg/package.json
📚 Learning: 2025-11-27T14:38:37.671Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:37.671Z
Learning: Follow standard Egg plugin structure with `src/`, `test/`, `package.json`, and `tsdown.config.ts` files

Applied to files:

  • .oxlintrc.json
  • tools/create-egg/package.json
📚 Learning: 2025-11-27T14:38:37.671Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:37.671Z
Learning: Applies to {packages/*/package.json,plugins/*/package.json,tools/*/package.json} : Include `build`, `typecheck`, `lint`, `test`, and `prepublishOnly` scripts in all package.json files

Applied to files:

  • .oxlintrc.json
  • package.json
📚 Learning: 2025-11-27T14:38:37.671Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:37.671Z
Learning: Applies to {packages/*/tsconfig.json,plugins/*/tsconfig.json,tools/*/tsconfig.json} : Enable strict mode in all TypeScript packages

Applied to files:

  • .oxlintrc.json
📚 Learning: 2025-11-27T14:38:55.513Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:55.513Z
Learning: Applies to tegg/**/*.{test,spec}.{ts,tsx} : Use Vitest for testing all tegg packages with configuration from monorepo root vitest.config.ts

Applied to files:

  • .oxlintrc.json
  • package.json
📚 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:

  • .oxlintrc.json
  • tools/create-egg/src/templates/tegg/app/module/bar/controller/user.ts
  • package.json
  • tools/create-egg/src/templates/tegg/app/module/bar/controller/home.ts
  • tools/create-egg/package.json
📚 Learning: 2025-11-27T14:38:55.513Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:55.513Z
Learning: Applies to tegg/**/*.{ts,tsx,js,mjs} : Use `.js` extensions in ESM imports across all tegg packages

Applied to files:

  • tools/create-egg/src/templates/tegg/app/module/bar/controller/user.ts
📚 Learning: 2025-11-27T14:38:37.671Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:37.671Z
Learning: Applies to plugins/*/src/types.ts : Module augmentation in plugin types.ts MUST extend the 'egg' module using `declare module 'egg'`

Applied to files:

  • tools/create-egg/src/templates/tegg/app/module/bar/controller/user.ts
  • tools/create-egg/src/templates/tegg/app/module/bar/controller/home.ts
  • tools/create-egg/package.json
  • tools/create-egg/src/templates/tegg/app/module/foo/service/HelloService.ts
📚 Learning: 2025-11-27T14:38:55.513Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:55.513Z
Learning: Applies to tegg/**/src/index.ts : Export public API through src/index.ts in each package

Applied to files:

  • tools/create-egg/src/templates/tegg/app/module/bar/controller/user.ts
📚 Learning: 2025-11-27T14:38:55.513Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:55.513Z
Learning: Applies to tegg/**/*.ts : Use qualifiers (InitTypeQualifier, ModuleQualifier, EggQualifier) to disambiguate multiple implementations

Applied to files:

  • tools/create-egg/src/templates/tegg/app/module/bar/controller/user.ts
  • tools/create-egg/src/templates/tegg/app/module/bar/controller/home.ts
  • tools/create-egg/src/templates/tegg/app/module/foo/service/HelloService.ts
📚 Learning: 2025-11-27T14:38:55.513Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:55.513Z
Learning: Applies to tegg/**/*.{test,spec}.{ts,tsx} : Use MockApplication from eggjs/mock for testing context-scoped objects with mockModuleContextScope()

Applied to files:

  • tools/create-egg/src/templates/tegg/app/module/bar/controller/user.ts
  • tools/create-egg/package.json
  • tools/create-egg/src/templates/tegg/app/module/foo/service/HelloService.ts
📚 Learning: 2025-11-27T14:38:55.513Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:55.513Z
Learning: Applies to tegg/**/*.ts : Implement EggObjectLifecycle interface or use lifecycle decorators (LifecyclePostConstruct, LifecyclePostInject, LifecycleInit, LifecyclePreDestroy, LifecycleDestroy)

Applied to files:

  • tools/create-egg/src/templates/tegg/app/module/bar/controller/user.ts
  • tools/create-egg/src/templates/tegg/app/module/bar/controller/home.ts
  • tools/create-egg/src/templates/tegg/app/module/foo/service/HelloService.ts
📚 Learning: 2025-11-27T14:38:37.671Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:37.671Z
Learning: Applies to **/*.ts : Use `import` statements instead of `require()` in ESM packages

Applied to files:

  • tools/create-egg/src/templates/tegg/app/module/bar/controller/user.ts
📚 Learning: 2025-11-27T14:38:55.513Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:55.513Z
Learning: Applies to tegg/**/*.ts : Cannot inject ctx/app directly - inject specific services instead

Applied to files:

  • tools/create-egg/src/templates/tegg/app/module/bar/controller/user.ts
  • tools/create-egg/src/templates/tegg/app/module/bar/controller/home.ts
  • tools/create-egg/src/templates/tegg/app/module/foo/service/HelloService.ts
📚 Learning: 2025-11-27T14:38:55.513Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:55.513Z
Learning: Applies to tegg/**/*.ts : Use Inject() decorator for property and constructor dependency injection

Applied to files:

  • tools/create-egg/src/templates/tegg/app/module/bar/controller/user.ts
  • tools/create-egg/src/templates/tegg/app/module/bar/controller/home.ts
  • tools/create-egg/src/templates/tegg/app/module/foo/service/HelloService.ts
📚 Learning: 2025-11-27T14:38:55.513Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:55.513Z
Learning: Applies to tegg/**/*.ts : Use InjectOptional() or Inject({ optional: true }) for optional dependencies

Applied to files:

  • tools/create-egg/src/templates/tegg/app/module/bar/controller/user.ts
📚 Learning: 2025-11-27T14:38:55.513Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:55.513Z
Learning: Applies to tegg/**/*.ts : SingletonProto cannot inject ContextProto - only ContextProto can inject any prototype

Applied to files:

  • tools/create-egg/src/templates/tegg/app/module/bar/controller/user.ts
  • tools/create-egg/src/templates/tegg/app/module/foo/service/HelloService.ts
📚 Learning: 2025-11-27T14:38:55.513Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:55.513Z
Learning: Applies to tegg/**/package.json : Use `catalog:` protocol for shared external dependencies in package.json

Applied to files:

  • package.json
  • tools/create-egg/package.json
📚 Learning: 2025-11-27T14:38:37.671Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:37.671Z
Learning: Applies to {packages/*/package.json,plugins/*/package.json,tools/*/package.json} : Use catalog: for external dependencies defined in pnpm-workspace.yaml

Applied to files:

  • package.json
  • tools/create-egg/package.json
  • pnpm-workspace.yaml
📚 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:

  • package.json
  • tools/create-egg/package.json
  • pnpm-workspace.yaml
📚 Learning: 2025-11-27T14:38:55.513Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:55.513Z
Learning: Applies to tegg/**/package.json : Use `workspace:*` protocol for internal tegg and egg monorepo dependencies in package.json

Applied to files:

  • package.json
  • tools/create-egg/package.json
📚 Learning: 2025-11-27T14:38:37.671Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:37.671Z
Learning: Applies to {packages/*/package.json,plugins/*/package.json,tools/*/package.json} : Use workspace:* for internal package dependencies in package.json

Applied to files:

  • package.json
  • pnpm-workspace.yaml
📚 Learning: 2025-11-27T14:39:09.305Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-27T14:39:09.305Z
Learning: Applies to **/*.{js,jsx,cjs,mjs} : Prefer `.ts` sources and exports over CommonJS in the ESM-first, TypeScript-heavy repository

Applied to files:

  • package.json
📚 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: Build all packages first using 'pnpm run build' before making changes, then validate with lint, tests, and documentation site checks

Applied to files:

  • package.json
📚 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: Run bootstrap and build commands in sequence: corepack enable pnpm → pnpm install → pnpm run build → pnpm run lint

Applied to files:

  • package.json
📚 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: Run 'pnpm run build' after making changes (set timeout to 60+ seconds) and never cancel the command

Applied to files:

  • package.json
📚 Learning: 2025-11-27T14:38:37.671Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:37.671Z
Learning: Use `tsc --noEmit` for pure TypeScript type checking in all packages

Applied to files:

  • package.json
📚 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: Run 'pnpm run test' to validate changes (set timeout to 180+ seconds for all tests, 120+ seconds for coverage) and never cancel the command

Applied to files:

  • package.json
  • pnpm-workspace.yaml
📚 Learning: 2025-11-27T14:38:37.671Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:37.671Z
Learning: Applies to plugins/*/package.json : Plugin package.json MUST include egg in peerDependencies to ensure framework compatibility

Applied to files:

  • tools/create-egg/package.json
📚 Learning: 2025-11-27T14:38:55.513Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:55.513Z
Learning: Applies to tegg/plugin/*/package.json : Define eggPlugin in package.json and create app.ts for initialization in plugin packages

Applied to files:

  • tools/create-egg/package.json
  • tools/create-egg/src/templates/tegg/app/module/foo/service/HelloService.ts
📚 Learning: 2025-11-27T14:38:37.671Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:37.671Z
Learning: Applies to plugins/*/src/types.ts : All plugins MUST include a `src/types.ts` file that extends Egg module declarations using module augmentation

Applied to files:

  • tools/create-egg/package.json
📚 Learning: 2025-11-27T14:38:37.671Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:37.671Z
Learning: All packages in this monorepo require Node.js >= 22.18.0

Applied to files:

  • tools/create-egg/package.json
  • pnpm-workspace.yaml
📚 Learning: 2025-11-27T14:38:55.513Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:55.513Z
Learning: Applies to tegg/**/*.ts : Use ContextProto() for request-scoped instances and SingletonProto() for application-lifecycle instances

Applied to files:

  • tools/create-egg/src/templates/tegg/app/module/foo/service/HelloService.ts
📚 Learning: 2025-11-27T14:39:09.305Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-27T14:39:09.305Z
Learning: Applies to package.json : Keep local Node.js and pnpm versions aligned with the repo's `packageManager` field in configuration files

Applied to files:

  • pnpm-workspace.yaml
📚 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: Node.js >= 20.19.0 is required - this is a hard requirement

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). (22)
  • GitHub Check: Socket Security: Pull Request Alerts
  • GitHub Check: Test (windows-latest, 24, 2/3)
  • GitHub Check: Test (macos-latest, 20, 1/3)
  • GitHub Check: Test (ubuntu-latest, 24, 1/3)
  • GitHub Check: Test (ubuntu-latest, 22, 3/3)
  • GitHub Check: Test (ubuntu-latest, 20, 1/3)
  • GitHub Check: Test (windows-latest, 24, 3/3)
  • GitHub Check: Test (macos-latest, 22, 1/3)
  • GitHub Check: Test (macos-latest, 24, 3/3)
  • GitHub Check: Test (ubuntu-latest, 22, 1/3)
  • GitHub Check: Test (windows-latest, 20, 2/3)
  • GitHub Check: Test (macos-latest, 24, 1/3)
  • GitHub Check: Test (macos-latest, 22, 3/3)
  • GitHub Check: Test (ubuntu-latest, 20, 3/3)
  • GitHub Check: Test bin (windows-latest, 22, 1/3)
  • GitHub Check: Test bin (ubuntu-latest, 22, 0/3)
  • GitHub Check: Test bin (windows-latest, 22, 2/3)
  • GitHub Check: Test bin (ubuntu-latest, 22, 2/3)
  • GitHub Check: Test bin (ubuntu-latest, 22, 1/3)
  • GitHub Check: Test bin (windows-latest, 22, 0/3)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Cloudflare Pages: egg-v3
🔇 Additional comments (6)
tools/create-egg/src/templates/tegg/app/module/foo/service/HelloService.ts (1)

1-1: Logger type import and injection look correct

Importing type Logger from 'egg' and updating the injected logger property to Logger aligns this template with the core egg typings and keeps the injection pattern unchanged.

Also applies to: 10-10

tools/create-egg/src/templates/tegg/app/module/bar/controller/user.ts (1)

1-1: Controller/decorator imports now consistent with egg entrypoint

Switching Inject/HTTPController/HTTPMethod* imports to come from 'egg' matches the other updated templates and keeps the controller wiring intact, with the .ts extension on the local import satisfying the TS import-guideline.

.oxlintrc.json (1)

6-10: Expanded oxlint ignorePatterns are reasonable for templates

Excluding the egg3 tegg/simple-TS template paths (plus existing fixtures) from oxlint makes sense for generated scaffolding and avoids lint/type-check noise in template sources.

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

14-19: Dependencies now follow workspace/catalog conventions

Using catalog: for external tooling libs and workspace:* for internal packages like @eggjs/tracer, @eggjs/mock, and egg matches the monorepo dependency rules and keeps this CLI aligned with the shared catalog.

Also applies to: 21-25

package.json (1)

15-16: Type tooling tightened via @typescript/native-preview and oxlint --type-check

Adding @typescript/native-preview from the catalog and switching the root lint script to oxlint --type-aware --type-check aligns the tooling with stricter TS checks so type issues are caught during lint, consistent with the oxlint-first guidelines.

Also applies to: 39-39

pnpm-workspace.yaml (1)

53-53: Catalog pins updated to match new lint/typecheck tooling

The bumped versions for @types/node, oxlint, and oxlint-tsgolint, plus the new @typescript/native-preview catalog entry, keep the workspace catalog in sync with the root devDependencies and support the stricter oxlint --type-check flow.

Also applies to: 66-66, 175-176

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: 30

Note

Due to the large number of review comments, Critical severity comments were prioritized as inline comments.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
plugins/onerror/package.json (1)

52-58: The tsgo dependency is missing and must be added before the typecheck script can work.

The typecheck script references tsgo --noEmit && tsc --noEmit, but tsgo is not defined in the pnpm-workspace.yaml catalog and does not appear in any package.json dependencies. Add tsgo to the workspace catalog in pnpm-workspace.yaml and reference it with catalog: in this package's devDependencies, or add it directly to devDependencies if it's not a shared dependency.

tegg/plugin/aop/package.json (1)

1-84: Add missing tsgo devDependency for typecheck script.

The typecheck script on line 33 references tsgo --noEmit && tsc --noEmit, but tsgo is not listed in devDependencies. This will cause the script to fail at runtime. Add tsgo: "catalog:" to the devDependencies object.

tegg/standalone/standalone/package.json (1)

58-69: Add tsgo to devDependencies using catalog: protocol.

The script at line 24 uses tsgo but it is not declared in devDependencies. Add "tsgo": "catalog:" to the devDependencies section (lines 58-69) and ensure it is defined in pnpm-workspace.yaml's catalog section.

♻️ Duplicate comments (5)
tegg/core/ajv-decorator/package.json (1)

23-23: Verify tsgo tool availability in monorepo.

The typecheck script references tsgo but this tool is not listed in this package's devDependencies. Confirm that tsgo is available through the workspace root catalog dependencies or root package.json.

examples/helloworld-typescript/package.json (1)

33-33: Verify tsgo tool availability in monorepo.

The typecheck script references tsgo but this tool is not listed in this package's devDependencies. Confirm that tsgo is available through the workspace root catalog dependencies or root package.json. This is particularly important for example files that users may follow.

plugins/view/package.json (1)

75-75: Verify tsgo tool availability in monorepo.

The typecheck script references tsgo but this tool is not listed in this package's devDependencies. Confirm that tsgo is available through the workspace root catalog dependencies or root package.json.

tools/scripts/package.json (1)

61-61: Verify tsgo tool availability in monorepo.

The typecheck script references tsgo but this tool is not listed in this package's devDependencies. Confirm that tsgo is available through the workspace root catalog dependencies or root package.json.

plugins/logrotator/package.json (1)

91-91: Verify tsgo tool availability across monorepo.

The typecheck script references tsgo but this tool is not listed in devDependencies. This appears to be a monorepo-wide issue. Confirm that tsgo is available through the workspace root catalog dependencies or root package.json.

🟠 Major comments (2)
plugins/redis/package.json-54-54 (1)

54-54: Add missing oxlint-tsgolint to devDependencies.

Line 54 uses the tsgo command in the typecheck script, which requires oxlint-tsgolint as a devDependency. Compare with packages/koa-static-cache/package.json, which includes "oxlint-tsgolint": "catalog:" alongside the same typecheck script. Add it to devDependencies:

   "devDependencies": {
     "@eggjs/mock": "workspace:*",
     "@eggjs/tsconfig": "workspace:*",
     "@types/node": "catalog:",
     "detect-port": "^2.1.0",
     "egg": "workspace:*",
     "oxlint": "catalog:",
+    "oxlint-tsgolint": "catalog:",
     "rimraf": "catalog:",
     "tsdown": "catalog:",
     "typescript": "catalog:",
     "vitest": "catalog:"
   },

Committable suggestion skipped: line range outside the PR's diff.

tools/egg-bin/package.json-69-69 (1)

69-69: Remove tsgo from the typecheck script—use only tsc --noEmit.

The typecheck script on line 64 should not include tsgo. According to project guidelines, typecheck scripts should use only tsc --noEmit for pure TypeScript type checking. The current script attempts to invoke a non-existent tool that is not defined anywhere in the monorepo dependencies or tooling.

Apply this correction:

-   "typecheck": "tsc --noEmit",
+   "typecheck": "tsc --noEmit",

(If the proposed change includes tsgo, remove it entirely.)

Committable suggestion skipped: line range outside the PR's diff.

🧹 Nitpick comments (1)
plugins/typebox-validate/test/fixtures/apps/typebox-validate-test/config/config.default.ts (1)

6-38: LGTM! Configuration factory correctly implements test fixture settings.

The typed constant pattern supports isolatedDeclarations and the configuration logic is correct. The custom Ajv formats (byte, json-string, semver) have appropriate validation functions.

For maximum explicitness, consider adding the parameter type annotation:

-const config: EggConfigFactory = defineConfigFactory(() => {
+const config: EggConfigFactory = defineConfigFactory((appInfo) => {

However, since the type is already constrained by EggConfigFactory, this is purely a style preference.

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

🧹 Nitpick comments (1)
packages/koa-static-cache/test/index.test.ts (1)

116-117: describe.skipIf is valid Vitest syntax and correctly used here.
The concern about narrowing the Windows skip scope remains valid—currently, the entire suite is skipped on Windows, losing all Windows signal. A follow-up could isolate the EPERM-prone tests (e.g., those writing to test/a.js) while keeping read-only/static tests running on Windows.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 77eaa99 and 0fbbbf6.

📒 Files selected for processing (5)
  • packages/koa-static-cache/test/index.test.ts (2 hunks)
  • plugins/mock/test/format_options.test.ts (1 hunks)
  • plugins/schedule/test/customTypeParams.test.ts (1 hunks)
  • plugins/schedule/test/safe-timers.test.ts (1 hunks)
  • plugins/schedule/test/schedule-type-worker2.test.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (9)
**/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.ts: Use explicit return types for all exported functions, methods, and getters to support TypeScript's isolatedDeclarations flag
Use unique symbol type for exported symbol constants
All exported functions in TypeScript files must have explicit return type annotations
Use camelCase for variable and function names in TypeScript
Prefer interfaces over type aliases for object shapes in TypeScript
Use readonly modifiers where appropriate in TypeScript class properties and interfaces
Avoid any type; use unknown when the type is truly unknown in TypeScript
Use weak references for caches when appropriate to prevent memory leaks
Use export statements instead of module.exports in ESM packages
Use import statements instead of require() in ESM packages
Add .ts file extensions in import statements for proper TypeScript resolution
Avoid computed property names with symbols in class declarations to support isolatedDeclarations

Files:

  • plugins/mock/test/format_options.test.ts
  • plugins/schedule/test/customTypeParams.test.ts
  • packages/koa-static-cache/test/index.test.ts
  • plugins/schedule/test/schedule-type-worker2.test.ts
  • plugins/schedule/test/safe-timers.test.ts
{packages/!(egg|cookies)/test/**/*.test.ts,plugins/*/test/**/*.test.ts,tools/!(egg-bin)/test/**/*.test.ts}

📄 CodeRabbit inference engine (CLAUDE.md)

All new packages MUST use Vitest for testing (exception: egg-bin and cookies packages use Mocha)

Files:

  • plugins/mock/test/format_options.test.ts
  • plugins/schedule/test/customTypeParams.test.ts
  • packages/koa-static-cache/test/index.test.ts
  • plugins/schedule/test/schedule-type-worker2.test.ts
  • plugins/schedule/test/safe-timers.test.ts
**/*.test.ts

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.test.ts: Import test functions from vitest using import { describe, it } from 'vitest' in Vitest test files
Use Node.js built-in assert module for assertions in Vitest tests

Files:

  • plugins/mock/test/format_options.test.ts
  • plugins/schedule/test/customTypeParams.test.ts
  • packages/koa-static-cache/test/index.test.ts
  • plugins/schedule/test/schedule-type-worker2.test.ts
  • plugins/schedule/test/safe-timers.test.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,js,jsx}: Name files in lowercase with hyphens (e.g., loader-context.ts)
Use two-space indentation, trailing commas, and semicolons enforced by Prettier and oxlint

Files:

  • plugins/mock/test/format_options.test.ts
  • plugins/schedule/test/customTypeParams.test.ts
  • packages/koa-static-cache/test/index.test.ts
  • plugins/schedule/test/schedule-type-worker2.test.ts
  • plugins/schedule/test/safe-timers.test.ts
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,js}: Name classes in PascalCase
Name functions and variables in camelCase

Files:

  • plugins/mock/test/format_options.test.ts
  • plugins/schedule/test/customTypeParams.test.ts
  • packages/koa-static-cache/test/index.test.ts
  • plugins/schedule/test/schedule-type-worker2.test.ts
  • plugins/schedule/test/safe-timers.test.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Re-export types thoughtfully to keep the public API stable

Files:

  • plugins/mock/test/format_options.test.ts
  • plugins/schedule/test/customTypeParams.test.ts
  • packages/koa-static-cache/test/index.test.ts
  • plugins/schedule/test/schedule-type-worker2.test.ts
  • plugins/schedule/test/safe-timers.test.ts
**/test/**/*.test.ts

📄 CodeRabbit inference engine (AGENTS.md)

Mirror the test pattern **/test/**/*.test.ts when adding Vitest suites

Files:

  • plugins/mock/test/format_options.test.ts
  • plugins/schedule/test/customTypeParams.test.ts
  • packages/koa-static-cache/test/index.test.ts
  • plugins/schedule/test/schedule-type-worker2.test.ts
  • plugins/schedule/test/safe-timers.test.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/koa-static-cache/test/index.test.ts
packages/**/test/**/*.test.ts

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

packages/**/test/**/*.test.ts: Use Vitest as the standard test runner for all packages; test files follow pattern 'test/**/*.test.ts'
Use 'import { describe, it } from "vitest"' for test functions in Vitest test files
Use Node.js built-in 'assert' module for assertions in tests

Files:

  • packages/koa-static-cache/test/index.test.ts
🧠 Learnings (13)
📓 Common learnings
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:55.513Z
Learning: Applies to tegg/core/*/package.json : Include standard build scripts in package.json: typecheck, clean, and build with tsdown and tsc
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:55.513Z
Learning: Applies to tegg/**/package.json : Use `catalog:` protocol for shared external dependencies in package.json
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:55.513Z
Learning: Applies to tegg/**/package.json : Use `workspace:*` protocol for internal tegg and egg monorepo dependencies in package.json
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/*/tsdown.config.ts : Use tsdown for unbundled ESM builds that preserves file structure; configure via tsdown.config.ts in each package
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: .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:*'
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:37.671Z
Learning: Applies to {packages/*/package.json,plugins/*/package.json,tools/*/package.json} : Use catalog: for external dependencies defined in pnpm-workspace.yaml
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:37.671Z
Learning: Follow standard Egg plugin structure with `src/`, `test/`, `package.json`, and `tsdown.config.ts` files
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:37.671Z
Learning: Use `tsc --noEmit` for pure TypeScript type checking in all packages
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:55.513Z
Learning: Applies to tegg/plugin/*/package.json : Define eggPlugin in package.json and create app.ts for initialization in plugin packages
📚 Learning: 2025-11-27T14:38:55.513Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:55.513Z
Learning: Applies to tegg/**/*.{test,spec}.{ts,tsx} : Use MockApplication from eggjs/mock for testing context-scoped objects with mockModuleContextScope()

Applied to files:

  • plugins/mock/test/format_options.test.ts
  • plugins/schedule/test/customTypeParams.test.ts
  • plugins/schedule/test/schedule-type-worker2.test.ts
  • plugins/schedule/test/safe-timers.test.ts
📚 Learning: 2025-11-27T14:39:09.305Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-27T14:39:09.305Z
Learning: Add regression test cases that exercise both the CommonJS and TypeScript example apps when updating HTTP or process orchestration features

Applied to files:

  • plugins/mock/test/format_options.test.ts
  • plugins/schedule/test/customTypeParams.test.ts
  • packages/koa-static-cache/test/index.test.ts
  • plugins/schedule/test/schedule-type-worker2.test.ts
  • plugins/schedule/test/safe-timers.test.ts
📚 Learning: 2025-11-27T14:38:37.671Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:37.671Z
Learning: Applies to {packages/cookies/test/**/*.test.ts,tools/egg-bin/test/**/*.test.ts} : Use Mocha test framework for egg-bin and cookies packages

Applied to files:

  • plugins/mock/test/format_options.test.ts
  • plugins/schedule/test/customTypeParams.test.ts
  • packages/koa-static-cache/test/index.test.ts
  • plugins/schedule/test/schedule-type-worker2.test.ts
  • plugins/schedule/test/safe-timers.test.ts
📚 Learning: 2025-11-27T14:38:37.671Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:37.671Z
Learning: Applies to {packages/!(egg|cookies)/test/**/*.test.ts,plugins/*/test/**/*.test.ts,tools/!(egg-bin)/test/**/*.test.ts} : All new packages MUST use Vitest for testing (exception: egg-bin and cookies packages use Mocha)

Applied to files:

  • plugins/mock/test/format_options.test.ts
  • plugins/schedule/test/customTypeParams.test.ts
  • packages/koa-static-cache/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 'import { describe, it } from "vitest"' for test functions in Vitest test files

Applied to files:

  • plugins/mock/test/format_options.test.ts
  • plugins/schedule/test/customTypeParams.test.ts
  • packages/koa-static-cache/test/index.test.ts
  • plugins/schedule/test/schedule-type-worker2.test.ts
  • plugins/schedule/test/safe-timers.test.ts
📚 Learning: 2025-11-27T14:38:37.671Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:37.671Z
Learning: Applies to **/*.test.ts : Import test functions from vitest using `import { describe, it } from 'vitest'` in Vitest test files

Applied to files:

  • plugins/schedule/test/customTypeParams.test.ts
  • packages/koa-static-cache/test/index.test.ts
  • plugins/schedule/test/schedule-type-worker2.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:

  • plugins/schedule/test/customTypeParams.test.ts
  • packages/koa-static-cache/test/index.test.ts
  • plugins/schedule/test/schedule-type-worker2.test.ts
  • plugins/schedule/test/safe-timers.test.ts
📚 Learning: 2025-11-27T14:38:37.671Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:37.671Z
Learning: Applies to **/*.test.ts : Use Node.js built-in `assert` module for assertions in Vitest tests

Applied to files:

  • plugins/schedule/test/customTypeParams.test.ts
  • packages/koa-static-cache/test/index.test.ts
  • plugins/schedule/test/safe-timers.test.ts
📚 Learning: 2025-11-27T14:38:55.513Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: tegg/CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:55.513Z
Learning: Applies to tegg/**/*.{test,spec}.{ts,tsx} : Use Vitest for testing all tegg packages with configuration from monorepo root vitest.config.ts

Applied to files:

  • plugins/schedule/test/customTypeParams.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: Run 'pnpm run test' to validate changes (set timeout to 180+ seconds for all tests, 120+ seconds for coverage) and never cancel the command

Applied to files:

  • packages/koa-static-cache/test/index.test.ts
  • plugins/schedule/test/safe-timers.test.ts
📚 Learning: 2025-11-27T14:38:37.671Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-27T14:38:37.671Z
Learning: Follow test file naming pattern of `test/**/*.test.ts` for all packages

Applied to files:

  • packages/koa-static-cache/test/index.test.ts
📚 Learning: 2025-11-27T14:39:09.305Z
Learnt from: CR
Repo: eggjs/egg PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-27T14:39:09.305Z
Learning: Include integration coverage when touching cluster or agent behavior

Applied to files:

  • plugins/schedule/test/safe-timers.test.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: Cloudflare Pages: egg-v3
  • GitHub Check: Test (windows-latest, 20, 3/3)
  • GitHub Check: Test (windows-latest, 20, 2/3)
  • GitHub Check: Test (windows-latest, 22, 2/3)
  • GitHub Check: Test (macos-latest, 22, 3/3)
  • GitHub Check: Test (ubuntu-latest, 20, 2/3)
  • GitHub Check: Test (ubuntu-latest, 22, 2/3)
  • GitHub Check: Test (windows-latest, 24, 2/3)
  • GitHub Check: Test (windows-latest, 24, 3/3)
  • GitHub Check: Test (macos-latest, 20, 1/3)
  • GitHub Check: Test (ubuntu-latest, 20, 1/3)
  • GitHub Check: Test (macos-latest, 22, 2/3)
  • GitHub Check: Test bin (windows-latest, 22, 1/3)
  • GitHub Check: Test bin (ubuntu-latest, 22, 1/3)
  • GitHub Check: Test bin (ubuntu-latest, 22, 2/3)
  • GitHub Check: Test bin (windows-latest, 22, 2/3)
  • GitHub Check: Test bin (ubuntu-latest, 22, 0/3)
  • GitHub Check: typecheck
  • GitHub Check: Test bin (windows-latest, 22, 0/3)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (4)
packages/koa-static-cache/test/index.test.ts (1)

140-140: Good: re-enabling “abnormal path” test is consistent with suite-level Windows skip.
With describe.skipIf(process.platform === 'win32'), this test will still be skipped on Windows but run elsewhere.

plugins/schedule/test/schedule-type-worker2.test.ts (1)

8-9: LGTM. describe.skipIf is a supported Vitest API for conditional suite skipping. The test file correctly imports from vitest and properly documents the Windows-specific flakiness with the FIXME comment.

plugins/schedule/test/safe-timers.test.ts (1)

8-9: describe.skipIf is fully supported by Vitest 4.0.15.

The code is correct. Vitest has supported describe.skipIf since at least v0.34, and the repository uses v4.0.15, which includes this API. The Windows skip is pragmatic and consistent with the repo's existing pattern for flaky tests on Windows (e.g., similar TODO/FIXME comments appear in multiple test files across packages and plugins).

plugins/schedule/test/customTypeParams.test.ts (1)

8-9: Remove verification request—describe.skipIf is a supported Vitest API.

describe.skipIf has been available in Vitest since v0.x and is documented in current Vitest docs. The code at lines 8-9 correctly uses this API to skip the test suite on Windows. No changes needed.

@fengmk2 fengmk2 merged commit 230b658 into next Dec 12, 2025
38 of 44 checks passed
@fengmk2 fengmk2 deleted the fix-typecheck branch December 12, 2025 16:01
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