Skip to content

Conversation

@fengmk2
Copy link
Member

@fengmk2 fengmk2 commented Sep 23, 2025

Summary by CodeRabbit

  • Bug Fixes
    • Background task failures now emit application error events, improving visibility in logs.
  • Improvements
    • More reliable tracer propagation in HTTP client requests with sensible defaults.
  • Style
    • Widespread formatting cleanup (single-line imports, calls, and signatures) without behavior changes.
  • Tests
    • Expanded HTTP client coverage (timeouts, network errors, tracer propagation, overwrite scenarios) and consolidated assertion chains.
  • Chores
    • Updated code style configuration: increased formatter line width to 120 characters.

@fengmk2 fengmk2 requested a review from Copilot September 23, 2025 13:10
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 23, 2025

Important

Review skipped

More than 25% of the files skipped due to max files limit. The review is being skipped to prevent a low-quality review.

103 files out of 210 files are above the max files limit of 100. Please upgrade to Pro plan to get higher limits.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Repository-wide formatting compacted to single-line style and printWidth set to 120. Two behavioral adjustments: background task errors now emit via app in Context._runInBackground, and HttpClient.request assigns tracer with a new fallback chain (ctx.tracer → options.tracer → app.tracer). Tests largely reformatted; httpclient tests significantly expanded.

Changes

Cohort / File(s) Summary
Prettier config
.prettierrc
Added "printWidth": 120.
Background task error emission
packages/egg/src/app/extend/context.ts
Formatting; in _runInBackground catch, now emits this.app.emit('error', err, this). Public signatures unchanged.
HttpClient tracer defaulting
packages/egg/src/lib/core/httpclient.ts
request() now sets tracer via options.ctx?.tracer ?? options.tracer ?? this.#app.tracer. Signatures reformatted single-line.
HTTP client context wrapper formatting
packages/egg/src/lib/core/context_httpclient.ts
Import and method signatures compacted; behavior unchanged.
Core/application formatting
packages/egg/src/lib/application.ts, packages/egg/src/lib/agent.ts, packages/egg/src/lib/core/base_hook_class.ts, packages/egg/src/lib/core/logger.ts, packages/egg/src/lib/core/messenger/*, packages/egg/src/lib/core/utils.ts, packages/egg/src/lib/types.ts, packages/egg/src/lib/egg.ts, packages/egg/src/index.ts, packages/egg/src/config/config.default.ts
Imports, declarations, and inline expressions collapsed to single-line forms. No behavioral changes; some public/type declarations reformatted to single-line.
App extensions formatting
packages/egg/src/app/extend/helper.ts, packages/egg/src/app/extend/request.ts, packages/egg/src/app/middleware/meta.ts
Single-line refactors; no logic changes.
Tests – broad formatting
packages/egg/test/**/*, packages/egg/test/fixtures/**/* (numerous files)
Consolidated imports and chained calls to single lines; minor assertion regex/text adjustments; no functional changes.
Tests – httpclient suite refactor/expansion
packages/egg/test/lib/core/httpclient.test.ts
Reworked setup via utils; added scenarios (timeouts, ENETUNREACH, tracer propagation, agent options, overwrite flows, pre-ready behavior).
Fixtures minor syntax normalization
packages/egg/test/fixtures/custom-egg/index.js
Class extends expression simplified; behavior unchanged.
Vitest config
packages/egg/vitest.config.ts
exclude array compacted to single line.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Ctx as Context
  participant BG as Background Task (async)
  participant App as Application

  User->>Ctx: runInBackground(fn)
  Ctx->>BG: _runInBackground(fn)
  rect rgba(200,230,255,0.2)
    note right of BG: Execute fn(ctx)
    BG-->>BG: await fn(ctx)
  end
  BG-->>Ctx: resolved
  alt task throws
    BG--x Ctx: throw err
    Ctx->>App: emit('error', err, ctx)
  end
Loading
sequenceDiagram
  autonumber
  participant Caller
  participant HC as HttpClient
  participant App as Application
  participant S as Remote Server

  Caller->>HC: request(url, options{ ctx?, tracer? })
  note over HC: Resolve tracer:<br/>options.ctx?.tracer<br/>|| options.tracer<br/>|| app.tracer
  HC->>S: HTTP request (with tracer headers)
  S-->>HC: Response
  HC-->>Caller: HttpClientResponse
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

A bunny with lines neatly tight,
Set printWidth to stretch the night.
If tasks go wrong, we’ll squeak “error!” clear,
And tracers now will persevere.
With tests pruned slim and flows just right,
I thump approval—code in flight! 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 42.86% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "chore: change line width to 120" is concise and directly describes the primary change (adding printWidth: 120 to .prettierrc); the majority of the diff are formatting updates consistent with that change, so the title accurately reflects the main intent of the PR. Although a few incidental edits in the diff appear to include minor behavioral adjustments, those do not undermine that the PR's stated goal is to change line width/formatting. The title is short, specific, and appropriate for project history.

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.

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 changes the line width configuration for code formatting from the default (typically 80 characters) to 120 characters. The change affects code formatting across multiple TypeScript test files and configuration files in the EggJS framework.

Key Changes

  • Updated .prettierrc to set printWidth: 120
  • Reformatted long lines across numerous test files to fit within the 120-character limit
  • Consolidated multi-line function calls, imports, and expressions into single lines where possible

Reviewed Changes

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

Show a summary per file
File Description
.prettierrc Added printWidth: 120 configuration
packages/egg/vitest.config.ts Consolidated exclude array to single line
packages/egg/test/utils.ts Reformatted imports and function signatures
Multiple test files Consolidated method chains, imports, and function calls
Multiple fixture files Reformatted template strings and configuration objects
Source files Reformatted imports, function signatures, and expressions

@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 focuses on a significant code style update, specifically adjusting the maximum line length to 120 characters across the codebase. This change, driven by a Prettier configuration update, aims to improve code readability and consistency by re-wrapping longer lines in various files.

Highlights

  • Code Formatting Standard Update: The Prettier configuration has been updated to increase the printWidth from its default to 120 characters. This change allows for longer lines of code before automatic wrapping occurs.
  • Extensive Code Reformatting: Numerous TypeScript and JavaScript files across the packages/egg directory have been re-formatted to adhere to the new 120-character line width. This includes adjustments to import statements, function signatures, method calls, and other code structures to fit the updated standard.
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

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.

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 updates the Prettier configuration to set the printWidth to 120. The subsequent changes across the codebase are purely stylistic, reflowing code to fit the new line width. The changes are consistent and correct according to the new formatting rule. The review did not find any functional issues or bugs.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Sep 23, 2025

Deploying egg with  Cloudflare Pages  Cloudflare Pages

Latest commit: 95ac0dd
Status:🚫  Build failed.

View logs

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Sep 23, 2025

Deploying egg-v3 with  Cloudflare Pages  Cloudflare Pages

Latest commit: 95ac0dd
Status:🚫  Build failed.

View logs

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 (26)
packages/egg/test/fixtures/apps/multipart/app/controller/upload.js (1)

25-30: Optional: await stream completion to avoid race in tests

Currently responds before the file is fully written. To reduce flakiness, await the write completion.

Apply this diff:

-  const ws = fs.createWriteStream(path.join(this.app.config.logger.dir, 'multipart-test-file'));
-  filePart.pipe(ws);
+  const ws = fs.createWriteStream(path.join(this.app.config.logger.dir, 'multipart-test-file'));
+  await new Promise((resolve, reject) => {
+    filePart.on('error', reject);
+    ws.on('error', reject);
+    ws.on('finish', resolve);
+    filePart.pipe(ws);
+  });
packages/egg/test/fixtures/custom-egg/index.js (1)

4-4: Optional clarity: alias base class before extending

Minor readability: alias module.exports.Application before reassigning to make intent explicit.

const BaseApp = module.exports.Application;
module.exports.Application = class Application extends BaseApp {
  // ...
}
packages/egg/test/app/middleware/site_file.test.ts (2)

117-117: Make assertion style consistent with the rest of the file

Use assert.equal (or assert.strictEqual) instead of a boolean assertion for consistency and clearer diffs on failure.

Apply this diff:

-          assert(res.headers.location === 'https://eggjs.org/function/favicon.ico');
+          assert.equal(res.headers.location, 'https://eggjs.org/function/favicon.ico');

134-134: Prefer assert.match for header directives

This gives a clearer failure message and avoids false positives.

Apply this diff:

-        .expect(res => assert(res.headers['cache-control'].includes('no-store')))
+        .expect(res => assert.match(res.headers['cache-control'], /\bno-store\b/))
packages/egg/test/cluster1/app_worker.test.ts (2)

84-84: Avoid log assertion race; add a tiny wait before app.expect

Log flush to stdout can lag the request completion; add a short await to reduce flakiness.

Apply this diff:

-      await assert.rejects(async () => {
-        await app.httpRequest().get('/timeout');
-      }, /socket hang up/);
-      app.expect('stdout', /\[http_server] A request `GET \/timeout` timeout with client/);
+      await assert.rejects(async () => {
+        await app.httpRequest().get('/timeout');
+      }, /socket hang up/);
+      // Give logger a moment to flush to stdout to avoid flakiness
+      await scheduler.wait(50);
+      app.expect('stdout', /\[http_server] A request `GET \/timeout` timeout with client/);

98-100: Tighten Node version parsing and condition readability

Use process.versions.node and explicit majors/minors; simplifies the predicate.

Apply this diff:

-      const version = process.version.split('.').map(a => parseInt(a.replace('v', '')));
+      const [ versionMajor, versionMinor ] = process.versions.node.split('.').map(n => Number(n));
@@
-      if ((version[0] === 8 && version[1] >= 10) || (version[0] === 9 && version[1] >= 4) || version[0] > 9) {
+      if ((versionMajor === 8 && versionMinor >= 10) || (versionMajor === 9 && versionMinor >= 4) || versionMajor >= 10) {
packages/egg/test/lib/core/logger.test.ts (2)

161-161: Optional: assert JSON log structurally for robustness.

Parsing the last log line guards against formatting variance and avoids brittle substring checks.

-    assert(fs.readFileSync(logfile, 'utf8').includes('"message":"json format"'));
+    const last = fs.readFileSync(logfile, 'utf8').trim().split('\n').pop()!;
+    try {
+      const record = JSON.parse(last);
+      assert.equal(record.message, 'json format');
+    } catch {
+      // Fallback if the line isn't pure JSON
+      assert(last.includes('"message":"json format"'));
+    }

Also applies to: 167-167


261-261: Optional: relax regex to avoid hardcoding the IP.

Makes the assertion resilient if the remote address differs.

-    app.expectLog(/ INFO \d+ \[-\/127\.0\.0\.1\/[\d.]+ms GET \/] enableFastContextLogger: true/);
+    app.expectLog(/ INFO \d+ \[\-\/[^/]+\/[\d.]+ms GET \/] enableFastContextLogger: true/);
packages/egg/test/fixtures/apps/app-ts-type-check/normal.ts (1)

200-200: Optional: prefer template literals for readability.
Concise and easier to scan.

Apply this diff:

-    formatter: (meta: any) => meta.date + ' ' + meta.level + ' ' + meta.pid + ' ' + meta.message,
+    formatter: (meta: any) => `${meta.date} ${meta.level} ${meta.pid} ${meta.message}`,
packages/egg/src/app/middleware/meta.ts (1)

22-22: Optional: emit x-readtime as a fixed-precision string.
For consistent header formatting, consider stringifying to 3 decimals.

Apply this diff if you prefer stable formatting:

-      ctx.set('x-readtime', Math.floor((performance.now() - ctx.performanceStarttime) * 1000) / 1000);
+      const readtime = Math.floor((performance.now() - ctx.performanceStarttime) * 1000) / 1000;
+      ctx.set('x-readtime', readtime.toFixed(3));
packages/egg/test/fixtures/apps/subdir-services/app/controller/home.js (1)

11-11: Suspicious self-compare (always true).
this.service.certifyPersonal === this.service.certifyPersonal is tautological in fixtures; rg shows the expression in:

  • packages/egg/test/fixtures/apps/subdir-services/app/controller/home.js:11
  • packages/core/test/fixtures/subdir-services/app/controller/home.js:11
    Tests expect serviceIsSame: true at:
  • packages/core/test/loader/mixin/load_service.test.ts:144
  • packages/egg/test/lib/core/loader/load_service.test.ts:95

Apply one of the following:

Option A (compare across accessors):

-    serviceIsSame: this.service.certifyPersonal === this.service.certifyPersonal,
+    serviceIsSame: this.service.certifyPersonal === this.ctx.service.certifyPersonal,

Option B (keep as-is but silence linter explicitly, if intentional):

-    serviceIsSame: this.service.certifyPersonal === this.service.certifyPersonal,
+    /* biome-ignore lint/suspicious/noSelfCompare: intentional identity check in fixture */
+    serviceIsSame: this.service.certifyPersonal === this.service.certifyPersonal,

Option C (remove if unused):

-    serviceIsSame: this.service.certifyPersonal === this.service.certifyPersonal,
packages/egg/test/lib/core/context_performance_starttime.test.ts (1)

17-17: Remove redundant assertion

Line 17 duplicates the prior type and truthy checks. Trim to keep tests lean.

-    assert(typeof ctx.performanceStarttime === 'number' && ctx.performanceStarttime > 0);
packages/egg/src/app/extend/helper.ts (1)

43-43: Replace deprecated url.resolve with WHATWG URL

Use URL(base, relative) to avoid deprecated node:url.resolve and edge cases. Behavior stays the same.

-    return this.ctx.protocol + '://' + this.ctx.host + url.resolve('/', this.pathFor(name, params));
+    return new URL(this.pathFor(name, params), `${this.ctx.protocol}://${this.ctx.host}`).toString();

Also remove the now-unused import:

-import url from 'node:url';
packages/egg/test/fixtures/apps/helper/app/router.js (1)

19-19: Optional: prefer strict equality in fixtures

=== over == avoids accidental coercion, even for strings. Not required for this PR.

-  this.body = this.helper.shtml('<a href="/">xx</a><h1>a</h1>') == '<a href="/">xx</a>&lt;h1&gt;a&lt;/h1&gt;';
+  this.body = this.helper.shtml('<a href="/">xx</a><h1>a</h1>') === '<a href="/">xx</a>&lt;h1&gt;a&lt;/h1&gt;';

Also applies to: 24-24, 28-28, 32-32

packages/egg/test/lib/plugins/development.test.ts (1)

7-7: Normalize utils import extension for consistency

Other tests use '../../utils.js'. Consider aligning this to avoid mixed .ts/.js specifiers.

Apply:

-import { type MockApplication, createApp, cluster, getFilepath } from '../../utils.ts';
+import { type MockApplication, createApp, cluster, getFilepath } from '../../utils.js';
packages/egg/src/lib/egg.ts (1)

546-546: Fix grammar in startup-timeout error log

Use “is still not ready” for clarity.

Apply this diff:

-      this.coreLogger.error(`${this.type} still doesn't ready after ${this.config.workerStartTimeout} ms.`);
+      this.coreLogger.error(`${this.type} is still not ready after ${this.config.workerStartTimeout} ms.`);
packages/egg/src/lib/core/messenger/local.ts (1)

112-124: Avoid mutating the to parameter (clarity)

Small readability tweak: derive a local target instead of reassigning the parameter.

-      if (!to) {
-        to = egg.type === 'application' ? 'agent' : 'application';
-      }
+      const target = to ?? (egg.type === 'application' ? 'agent' : 'application');

-      if (application && application.messenger && (to === 'application' || to === 'both')) {
+      if (application && application.messenger && (target === 'application' || target === 'both')) {
         application.messenger.onMessage({ action, data });
       }
-      if (agent && agent.messenger && (to === 'agent' || to === 'both')) {
+      if (agent && agent.messenger && (target === 'agent' || target === 'both')) {
         agent.messenger.onMessage({ action, data });
       }
-      if (opposite && opposite.messenger && to === 'opposite') {
+      if (opposite && opposite.messenger && target === 'opposite') {
         opposite.messenger.onMessage({ action, data });
       }
packages/egg/test/app/extend/context.test.ts (3)

230-243: Prefer relying on backgroundTasksFinished over extra waits

Given you already await app.backgroundTasksFinished(), the additional scheduler.wait(100) may be unnecessary and can introduce flakiness.

-      await scheduler.wait(100);
+      // usually unnecessary when backgroundTasksFinished() resolves
+      // await scheduler.wait(100);

273-281: Rename lgoDir → logDir for consistency

Minor typo; align with other blocks using logDir.

-      const lgoDir = app.config.logger.dir;
-      const log = fs.readFileSync(path.join(lgoDir, 'common-error.log'), 'utf8');
+      const logDir = app.config.logger.dir;
+      const log = fs.readFileSync(path.join(logDir, 'common-error.log'), 'utf8');
       assert(/ENOENT: no such file or directory/.test(log));
       assert(
         /\[egg:background] task:mockError fail \([\d.]+ms\)/.test(
-          fs.readFileSync(path.join(lgoDir, 'egg-web.log'), 'utf8')
+          fs.readFileSync(path.join(logDir, 'egg-web.log'), 'utf8')
         )
       );

422-422: Avoid relying on property order in object keys (test robustness)

Ordering of Object.keys can be brittle; consider asserting set inclusion instead.

-        assert.deepEqual(Object.keys(context.state), ['__', 'gettext', 'a', 'b', 'c']);
+        assert.deepEqual(new Set(Object.keys(context.state)), new Set(['__', 'gettext', 'a', 'b', 'c']));
packages/egg/src/app/extend/context.ts (1)

245-249: Consider log level for failure

The failure line currently uses coreLogger.info; warn or error may be more appropriate for failures.

-      this.coreLogger.info('[egg:background] task:%s fail (%dms)', taskName, diff(startTime));
+      this.coreLogger.warn('[egg:background] task:%s fail (%dms)', taskName, diff(startTime));
packages/egg/test/lib/core/httpclient.test.ts (1)

642-676: Deduplicate identical retry tests or vary the code path

Two tests named "should retry when httpclient fail" are functionally identical. Consider converting one to use request() or assert different aspects (e.g., x-retry header) to avoid redundancy.

-    it('should retry when httpclient fail', async () => {
+    it('should retry when httpclient fail via request()', async () => {
       let hasRetry = false;
-      const res = await app.httpclient.curl(`${url}/retry`, {
+      const res = await app.httpclient.request(`${url}/retry`, {
         retry: 1,
         retryDelay: 100,
         isRetry(res) {
           const shouldRetry = res.status >= 500;
           if (shouldRetry) {
             hasRetry = true;
           }
           return shouldRetry;
         },
       });
 
       assert(hasRetry);
       assert(res.status === 200);
     });
packages/egg/test/lib/core/loader/load_plugin.test.ts (2)

151-152: Make the warning assertion less brittle

Exact string equality will flake if prefix/suffix formatting changes. Prefer a regex or substring match.

Apply this diff:

-    assert(message === '[@eggjs/core/egg_loader] pluginName(e) is different from pluginConfigName(wrong-name)');
+    assert.match(
+      String(message),
+      /pluginName\(e\) is different from pluginConfigName\(wrong-name\)/
+    );

232-237: Align with guideline: prefer Node.js assert over Vitest expect in tests

Coding guidelines for packages//test//*.test.ts say to use Node’s assert for assertions. Consider replacing the snapshot expect(...).toMatchSnapshot() with an explicit assert.deepEqual to a stable expected list (or justify the snapshot as an exception).

If you want, I can help derive the current expected plugin order and generate the assert block to replace the snapshot.

packages/egg/test/egg.test.ts (2)

169-183: Consider replacing assert-file with built-in assert + fs for consistency

Repo guidelines prefer Node’s built-in assert; you can replace assert-file usages here with fs + assert while keeping behavior identical.

Apply:

-      assertFile(path.join(baseDir, `run/application_timing_${process.pid}.json`));
-      assertFile(
-        path.join(baseDir, 'logs/dumptiming-timeout/common-error.log'),
-        /unfinished timing item: {"name":"Did Load in app.js:didLoad"/
-      );
+      assert.ok(fs.existsSync(path.join(baseDir, `run/application_timing_${process.pid}.json`)));
+      {
+        const p = path.join(baseDir, 'logs/dumptiming-timeout/common-error.log');
+        const body = fs.readFileSync(p, 'utf8');
+        assert.match(body, /unfinished timing item: {"name":"Did Load in app\.js:didLoad"/);
+      }

185-196: Same suggestion: avoid assert-file in favor of assert + fs

Keeps assertions within Node’s built-in module.

Apply:

-      assertFile(
-        path.join(baseDir, 'logs/dumptiming-slowBootActionMinDuration/egg-web.log'),
-        /\[slow-boot-action] #\d+ \d+ms, name: Did Load in app\.js:didLoad/
-      );
+      {
+        const p = path.join(baseDir, 'logs/dumptiming-slowBootActionMinDuration/egg-web.log');
+        const body = fs.readFileSync(p, 'utf8');
+        assert.match(body, /\[slow-boot-action] #\d+ \d+ms, name: Did Load in app\.js:didLoad/);
+      }

Note: Similarly, later uses (e.g., assertFile.fail in Lines 305–308) can be migrated to assert.ok(!fs.existsSync(...)).

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1f1eddf and e2be220.

📒 Files selected for processing (91)
  • .prettierrc (1 hunks)
  • packages/egg/src/app/extend/context.ts (6 hunks)
  • packages/egg/src/app/extend/helper.ts (1 hunks)
  • packages/egg/src/app/extend/request.ts (2 hunks)
  • packages/egg/src/app/middleware/meta.ts (1 hunks)
  • packages/egg/src/config/config.default.ts (2 hunks)
  • packages/egg/src/index.ts (2 hunks)
  • packages/egg/src/lib/agent.ts (1 hunks)
  • packages/egg/src/lib/application.ts (6 hunks)
  • packages/egg/src/lib/core/base_hook_class.ts (1 hunks)
  • packages/egg/src/lib/core/context_httpclient.ts (2 hunks)
  • packages/egg/src/lib/core/httpclient.ts (2 hunks)
  • packages/egg/src/lib/core/logger.ts (3 hunks)
  • packages/egg/src/lib/core/messenger/base.ts (2 hunks)
  • packages/egg/src/lib/core/messenger/index.ts (1 hunks)
  • packages/egg/src/lib/core/messenger/ipc.ts (6 hunks)
  • packages/egg/src/lib/core/messenger/local.ts (7 hunks)
  • packages/egg/src/lib/core/utils.ts (1 hunks)
  • packages/egg/src/lib/egg.ts (14 hunks)
  • packages/egg/src/lib/types.ts (2 hunks)
  • packages/egg/test/agent.test.ts (5 hunks)
  • packages/egg/test/app/extend/application.test.ts (4 hunks)
  • packages/egg/test/app/extend/context.jsonp.test.ts (1 hunks)
  • packages/egg/test/app/extend/context.test.ts (11 hunks)
  • packages/egg/test/app/extend/helper.test.ts (2 hunks)
  • packages/egg/test/app/extend/request.test.ts (3 hunks)
  • packages/egg/test/app/extend/response.test.ts (3 hunks)
  • packages/egg/test/app/middleware/body_parser.test.ts (3 hunks)
  • packages/egg/test/app/middleware/meta.test.ts (2 hunks)
  • packages/egg/test/app/middleware/notfound.test.ts (2 hunks)
  • packages/egg/test/app/middleware/override_method.test.ts (1 hunks)
  • packages/egg/test/app/middleware/site_file.test.ts (3 hunks)
  • packages/egg/test/application.test.ts (5 hunks)
  • packages/egg/test/asyncSupport.test.ts (1 hunks)
  • packages/egg/test/cluster1/app_worker.test.ts (4 hunks)
  • packages/egg/test/cluster1/cluster-client-error.test.ts (1 hunks)
  • packages/egg/test/cluster1/cluster-client.test.ts (4 hunks)
  • packages/egg/test/cluster1/master.test.ts (1 hunks)
  • packages/egg/test/cluster2/master.test.ts (1 hunks)
  • packages/egg/test/egg.test.ts (13 hunks)
  • packages/egg/test/fixtures/apps/app-enableFastContextLogger/app/controller/home.js (1 hunks)
  • packages/egg/test/fixtures/apps/app-ts-type-check/error.ts (1 hunks)
  • packages/egg/test/fixtures/apps/app-ts-type-check/normal.ts (1 hunks)
  • packages/egg/test/fixtures/apps/app-ts/app/router.ts (1 hunks)
  • packages/egg/test/fixtures/apps/ctx-background/app/controller/app.js (1 hunks)
  • packages/egg/test/fixtures/apps/ctx-background/app/controller/home.js (1 hunks)
  • packages/egg/test/fixtures/apps/helper/app/router.js (1 hunks)
  • packages/egg/test/fixtures/apps/httpclient-next-overwrite/app.js (1 hunks)
  • packages/egg/test/fixtures/apps/httpclient-overwrite/app.js (1 hunks)
  • packages/egg/test/fixtures/apps/i18n/app/controller/message.js (1 hunks)
  • packages/egg/test/fixtures/apps/messenger-broadcast/agent.js (1 hunks)
  • packages/egg/test/fixtures/apps/messenger-broadcast/app.js (1 hunks)
  • packages/egg/test/fixtures/apps/messenger-random/app.js (1 hunks)
  • packages/egg/test/fixtures/apps/middlewares/config/config.default.js (1 hunks)
  • packages/egg/test/fixtures/apps/multipart/app/controller/upload.js (1 hunks)
  • packages/egg/test/fixtures/apps/multipart/app/view/home.html (1 hunks)
  • packages/egg/test/fixtures/apps/multiple-view-engine/app/controller/view.js (1 hunks)
  • packages/egg/test/fixtures/apps/multiple-view-engine/app/router.js (1 hunks)
  • packages/egg/test/fixtures/apps/multiple-view-engine/config/config.default.js (1 hunks)
  • packages/egg/test/fixtures/apps/subdir-services/app/controller/home.js (1 hunks)
  • packages/egg/test/fixtures/apps/tracer-demo/tracer.js (1 hunks)
  • packages/egg/test/fixtures/apps/view-render/app/view/index.html (1 hunks)
  • packages/egg/test/fixtures/apps/view-render/app/view/inject.html (1 hunks)
  • packages/egg/test/fixtures/apps/view-render/app/view/locals.html (1 hunks)
  • packages/egg/test/fixtures/custom-egg/index.js (1 hunks)
  • packages/egg/test/lib/core/context_httpclient.test.ts (1 hunks)
  • packages/egg/test/lib/core/context_performance_starttime.test.ts (1 hunks)
  • packages/egg/test/lib/core/cookies.test.ts (8 hunks)
  • packages/egg/test/lib/core/httpclient.test.ts (1 hunks)
  • packages/egg/test/lib/core/httpclient_tracer_demo.test.ts (1 hunks)
  • packages/egg/test/lib/core/loader/config_loader.test.ts (1 hunks)
  • packages/egg/test/lib/core/loader/load_boot.test.ts (2 hunks)
  • packages/egg/test/lib/core/loader/load_plugin.test.ts (3 hunks)
  • packages/egg/test/lib/core/loader/load_service.test.ts (1 hunks)
  • packages/egg/test/lib/core/logger.test.ts (12 hunks)
  • packages/egg/test/lib/core/messenger/ipc.test.ts (2 hunks)
  • packages/egg/test/lib/core/messenger/local.test.ts (1 hunks)
  • packages/egg/test/lib/core/router.test.ts (3 hunks)
  • packages/egg/test/lib/core/utils.test.ts (3 hunks)
  • packages/egg/test/lib/core/view.test.ts (2 hunks)
  • packages/egg/test/lib/plugins/depd.test.ts (1 hunks)
  • packages/egg/test/lib/plugins/development.test.ts (2 hunks)
  • packages/egg/test/lib/plugins/i18n.test.ts (3 hunks)
  • packages/egg/test/lib/plugins/logrotator.test.ts (1 hunks)
  • packages/egg/test/lib/plugins/onerror.test.ts (1 hunks)
  • packages/egg/test/lib/plugins/schedule.test.ts (1 hunks)
  • packages/egg/test/lib/plugins/security.test.ts (2 hunks)
  • packages/egg/test/lib/plugins/watcher.test.ts (4 hunks)
  • packages/egg/test/typescript.test.ts (1 hunks)
  • packages/egg/test/utils.ts (3 hunks)
  • packages/egg/vitest.config.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (11)
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/egg/test/app/extend/response.test.ts
  • packages/egg/test/app/middleware/body_parser.test.ts
  • packages/egg/test/cluster1/cluster-client-error.test.ts
  • packages/egg/test/typescript.test.ts
  • packages/egg/test/lib/core/cookies.test.ts
  • packages/egg/test/lib/core/loader/load_plugin.test.ts
  • packages/egg/test/lib/core/utils.test.ts
  • packages/egg/test/lib/core/loader/load_service.test.ts
  • packages/egg/test/lib/plugins/schedule.test.ts
  • packages/egg/test/lib/core/router.test.ts
  • packages/egg/test/lib/plugins/watcher.test.ts
  • packages/egg/test/lib/plugins/i18n.test.ts
  • packages/egg/test/app/extend/helper.test.ts
  • packages/egg/test/application.test.ts
  • packages/egg/test/lib/core/context_httpclient.test.ts
  • packages/egg/test/lib/plugins/development.test.ts
  • packages/egg/test/lib/plugins/logrotator.test.ts
  • packages/egg/test/cluster1/master.test.ts
  • packages/egg/test/lib/core/logger.test.ts
  • packages/egg/test/lib/core/view.test.ts
  • packages/egg/test/lib/plugins/security.test.ts
  • packages/egg/test/cluster1/cluster-client.test.ts
  • packages/egg/test/lib/core/messenger/ipc.test.ts
  • packages/egg/test/lib/plugins/onerror.test.ts
  • packages/egg/test/app/extend/request.test.ts
  • packages/egg/test/egg.test.ts
  • packages/egg/test/agent.test.ts
  • packages/egg/test/cluster1/app_worker.test.ts
  • packages/egg/test/app/middleware/override_method.test.ts
  • packages/egg/test/app/extend/context.jsonp.test.ts
  • packages/egg/test/lib/core/context_performance_starttime.test.ts
  • packages/egg/test/app/middleware/notfound.test.ts
  • packages/egg/test/lib/core/messenger/local.test.ts
  • packages/egg/test/cluster2/master.test.ts
  • packages/egg/test/lib/core/loader/load_boot.test.ts
  • packages/egg/test/lib/core/httpclient.test.ts
  • packages/egg/test/app/middleware/site_file.test.ts
  • packages/egg/test/lib/plugins/depd.test.ts
  • packages/egg/test/lib/core/httpclient_tracer_demo.test.ts
  • packages/egg/test/asyncSupport.test.ts
  • packages/egg/test/app/extend/application.test.ts
  • packages/egg/test/app/extend/context.test.ts
  • packages/egg/test/lib/core/loader/config_loader.test.ts
  • packages/egg/test/app/middleware/meta.test.ts
{packages,plugins}/**/test/**/*.test.ts

📄 CodeRabbit inference engine (CLAUDE.md)

{packages,plugins}/**/test/**/*.test.ts: Vitest test files should follow the naming pattern test/**/*.test.ts and import from vitest
Use Node.js built-in assert for assertions in Vitest tests

Files:

  • packages/egg/test/app/extend/response.test.ts
  • packages/egg/test/app/middleware/body_parser.test.ts
  • packages/egg/test/cluster1/cluster-client-error.test.ts
  • packages/egg/test/typescript.test.ts
  • packages/egg/test/lib/core/cookies.test.ts
  • packages/egg/test/lib/core/loader/load_plugin.test.ts
  • packages/egg/test/lib/core/utils.test.ts
  • packages/egg/test/lib/core/loader/load_service.test.ts
  • packages/egg/test/lib/plugins/schedule.test.ts
  • packages/egg/test/lib/core/router.test.ts
  • packages/egg/test/lib/plugins/watcher.test.ts
  • packages/egg/test/lib/plugins/i18n.test.ts
  • packages/egg/test/app/extend/helper.test.ts
  • packages/egg/test/application.test.ts
  • packages/egg/test/lib/core/context_httpclient.test.ts
  • packages/egg/test/lib/plugins/development.test.ts
  • packages/egg/test/lib/plugins/logrotator.test.ts
  • packages/egg/test/cluster1/master.test.ts
  • packages/egg/test/lib/core/logger.test.ts
  • packages/egg/test/lib/core/view.test.ts
  • packages/egg/test/lib/plugins/security.test.ts
  • packages/egg/test/cluster1/cluster-client.test.ts
  • packages/egg/test/lib/core/messenger/ipc.test.ts
  • packages/egg/test/lib/plugins/onerror.test.ts
  • packages/egg/test/app/extend/request.test.ts
  • packages/egg/test/egg.test.ts
  • packages/egg/test/agent.test.ts
  • packages/egg/test/cluster1/app_worker.test.ts
  • packages/egg/test/app/middleware/override_method.test.ts
  • packages/egg/test/app/extend/context.jsonp.test.ts
  • packages/egg/test/lib/core/context_performance_starttime.test.ts
  • packages/egg/test/app/middleware/notfound.test.ts
  • packages/egg/test/lib/core/messenger/local.test.ts
  • packages/egg/test/cluster2/master.test.ts
  • packages/egg/test/lib/core/loader/load_boot.test.ts
  • packages/egg/test/lib/core/httpclient.test.ts
  • packages/egg/test/app/middleware/site_file.test.ts
  • packages/egg/test/lib/plugins/depd.test.ts
  • packages/egg/test/lib/core/httpclient_tracer_demo.test.ts
  • packages/egg/test/asyncSupport.test.ts
  • packages/egg/test/app/extend/application.test.ts
  • packages/egg/test/app/extend/context.test.ts
  • packages/egg/test/lib/core/loader/config_loader.test.ts
  • packages/egg/test/app/middleware/meta.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/egg/test/app/extend/response.test.ts
  • packages/egg/test/app/middleware/body_parser.test.ts
  • packages/egg/test/cluster1/cluster-client-error.test.ts
  • packages/egg/test/typescript.test.ts
  • packages/egg/test/lib/core/cookies.test.ts
  • packages/egg/test/lib/core/loader/load_plugin.test.ts
  • packages/egg/test/lib/core/utils.test.ts
  • packages/egg/test/lib/core/loader/load_service.test.ts
  • packages/egg/test/lib/plugins/schedule.test.ts
  • packages/egg/src/lib/agent.ts
  • packages/egg/src/lib/core/messenger/base.ts
  • packages/egg/src/lib/core/messenger/ipc.ts
  • packages/egg/test/lib/core/router.test.ts
  • packages/egg/test/lib/plugins/watcher.test.ts
  • packages/egg/test/lib/plugins/i18n.test.ts
  • packages/egg/test/app/extend/helper.test.ts
  • packages/egg/src/app/middleware/meta.ts
  • packages/egg/test/application.test.ts
  • packages/egg/test/lib/core/context_httpclient.test.ts
  • packages/egg/test/lib/plugins/development.test.ts
  • packages/egg/test/lib/plugins/logrotator.test.ts
  • packages/egg/vitest.config.ts
  • packages/egg/test/cluster1/master.test.ts
  • packages/egg/test/fixtures/apps/app-ts-type-check/normal.ts
  • packages/egg/test/lib/core/logger.test.ts
  • packages/egg/test/lib/core/view.test.ts
  • packages/egg/test/lib/plugins/security.test.ts
  • packages/egg/test/cluster1/cluster-client.test.ts
  • packages/egg/test/lib/core/messenger/ipc.test.ts
  • packages/egg/test/lib/plugins/onerror.test.ts
  • packages/egg/test/app/extend/request.test.ts
  • packages/egg/src/lib/core/httpclient.ts
  • packages/egg/test/egg.test.ts
  • packages/egg/src/app/extend/helper.ts
  • packages/egg/test/agent.test.ts
  • packages/egg/test/cluster1/app_worker.test.ts
  • packages/egg/src/lib/core/base_hook_class.ts
  • packages/egg/src/lib/core/logger.ts
  • packages/egg/test/app/middleware/override_method.test.ts
  • packages/egg/test/app/extend/context.jsonp.test.ts
  • packages/egg/test/lib/core/context_performance_starttime.test.ts
  • packages/egg/test/app/middleware/notfound.test.ts
  • packages/egg/test/lib/core/messenger/local.test.ts
  • packages/egg/test/cluster2/master.test.ts
  • packages/egg/test/lib/core/loader/load_boot.test.ts
  • packages/egg/src/app/extend/request.ts
  • packages/egg/src/lib/egg.ts
  • packages/egg/test/lib/core/httpclient.test.ts
  • packages/egg/test/app/middleware/site_file.test.ts
  • packages/egg/test/fixtures/apps/app-ts-type-check/error.ts
  • packages/egg/src/lib/core/context_httpclient.ts
  • packages/egg/src/config/config.default.ts
  • packages/egg/test/lib/plugins/depd.test.ts
  • packages/egg/test/lib/core/httpclient_tracer_demo.test.ts
  • packages/egg/src/lib/application.ts
  • packages/egg/test/asyncSupport.test.ts
  • packages/egg/test/app/extend/application.test.ts
  • packages/egg/src/lib/core/messenger/index.ts
  • packages/egg/src/lib/core/utils.ts
  • packages/egg/test/app/extend/context.test.ts
  • packages/egg/src/lib/types.ts
  • packages/egg/test/fixtures/apps/app-ts/app/router.ts
  • packages/egg/src/index.ts
  • packages/egg/test/lib/core/loader/config_loader.test.ts
  • packages/egg/src/lib/core/messenger/local.ts
  • packages/egg/test/utils.ts
  • packages/egg/test/app/middleware/meta.test.ts
  • packages/egg/src/app/extend/context.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/egg/test/app/extend/response.test.ts
  • packages/egg/test/app/middleware/body_parser.test.ts
  • packages/egg/test/cluster1/cluster-client-error.test.ts
  • packages/egg/test/typescript.test.ts
  • packages/egg/test/lib/core/cookies.test.ts
  • packages/egg/test/lib/core/loader/load_plugin.test.ts
  • packages/egg/test/lib/core/utils.test.ts
  • packages/egg/test/lib/core/loader/load_service.test.ts
  • packages/egg/test/lib/plugins/schedule.test.ts
  • packages/egg/test/lib/core/router.test.ts
  • packages/egg/test/lib/plugins/watcher.test.ts
  • packages/egg/test/lib/plugins/i18n.test.ts
  • packages/egg/test/app/extend/helper.test.ts
  • packages/egg/test/application.test.ts
  • packages/egg/test/lib/core/context_httpclient.test.ts
  • packages/egg/test/lib/plugins/development.test.ts
  • packages/egg/test/lib/plugins/logrotator.test.ts
  • packages/egg/test/cluster1/master.test.ts
  • packages/egg/test/lib/core/logger.test.ts
  • packages/egg/test/lib/core/view.test.ts
  • packages/egg/test/lib/plugins/security.test.ts
  • packages/egg/test/cluster1/cluster-client.test.ts
  • packages/egg/test/lib/core/messenger/ipc.test.ts
  • packages/egg/test/lib/plugins/onerror.test.ts
  • packages/egg/test/app/extend/request.test.ts
  • packages/egg/test/egg.test.ts
  • packages/egg/test/agent.test.ts
  • packages/egg/test/cluster1/app_worker.test.ts
  • packages/egg/test/app/middleware/override_method.test.ts
  • packages/egg/test/app/extend/context.jsonp.test.ts
  • packages/egg/test/lib/core/context_performance_starttime.test.ts
  • packages/egg/test/app/middleware/notfound.test.ts
  • packages/egg/test/lib/core/messenger/local.test.ts
  • packages/egg/test/cluster2/master.test.ts
  • packages/egg/test/lib/core/loader/load_boot.test.ts
  • packages/egg/test/lib/core/httpclient.test.ts
  • packages/egg/test/app/middleware/site_file.test.ts
  • packages/egg/test/lib/plugins/depd.test.ts
  • packages/egg/test/lib/core/httpclient_tracer_demo.test.ts
  • packages/egg/test/asyncSupport.test.ts
  • packages/egg/test/app/extend/application.test.ts
  • packages/egg/test/app/extend/context.test.ts
  • packages/egg/test/lib/core/loader/config_loader.test.ts
  • packages/egg/test/app/middleware/meta.test.ts
packages/**/src/**/*.{ts,tsx}

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

Use TypeScript for all source files in packages (no JavaScript source files)

Files:

  • packages/egg/src/lib/agent.ts
  • packages/egg/src/lib/core/messenger/base.ts
  • packages/egg/src/lib/core/messenger/ipc.ts
  • packages/egg/src/app/middleware/meta.ts
  • packages/egg/src/lib/core/httpclient.ts
  • packages/egg/src/app/extend/helper.ts
  • packages/egg/src/lib/core/base_hook_class.ts
  • packages/egg/src/lib/core/logger.ts
  • packages/egg/src/app/extend/request.ts
  • packages/egg/src/lib/egg.ts
  • packages/egg/src/lib/core/context_httpclient.ts
  • packages/egg/src/config/config.default.ts
  • packages/egg/src/lib/application.ts
  • packages/egg/src/lib/core/messenger/index.ts
  • packages/egg/src/lib/core/utils.ts
  • packages/egg/src/lib/types.ts
  • packages/egg/src/index.ts
  • packages/egg/src/lib/core/messenger/local.ts
  • packages/egg/src/app/extend/context.ts
packages/egg/src/lib/core/**

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

Implement core components (httpclient, logger, messenger) under packages/egg/src/lib/core/

Files:

  • packages/egg/src/lib/core/messenger/base.ts
  • packages/egg/src/lib/core/messenger/ipc.ts
  • packages/egg/src/lib/core/httpclient.ts
  • packages/egg/src/lib/core/base_hook_class.ts
  • packages/egg/src/lib/core/logger.ts
  • packages/egg/src/lib/core/context_httpclient.ts
  • packages/egg/src/lib/core/messenger/index.ts
  • packages/egg/src/lib/core/utils.ts
  • packages/egg/src/lib/core/messenger/local.ts
packages/egg/test/fixtures/apps/**

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

Place scenario test fixtures under packages/egg/test/fixtures/apps/

Create test apps under packages/egg/test/fixtures/apps for scenario-based testing

Files:

  • packages/egg/test/fixtures/apps/multiple-view-engine/app/controller/view.js
  • packages/egg/test/fixtures/apps/tracer-demo/tracer.js
  • packages/egg/test/fixtures/apps/i18n/app/controller/message.js
  • packages/egg/test/fixtures/apps/multipart/app/controller/upload.js
  • packages/egg/test/fixtures/apps/ctx-background/app/controller/home.js
  • packages/egg/test/fixtures/apps/multiple-view-engine/config/config.default.js
  • packages/egg/test/fixtures/apps/app-ts-type-check/normal.ts
  • packages/egg/test/fixtures/apps/multiple-view-engine/app/router.js
  • packages/egg/test/fixtures/apps/view-render/app/view/index.html
  • packages/egg/test/fixtures/apps/httpclient-overwrite/app.js
  • packages/egg/test/fixtures/apps/subdir-services/app/controller/home.js
  • packages/egg/test/fixtures/apps/view-render/app/view/locals.html
  • packages/egg/test/fixtures/apps/app-enableFastContextLogger/app/controller/home.js
  • packages/egg/test/fixtures/apps/messenger-broadcast/agent.js
  • packages/egg/test/fixtures/apps/helper/app/router.js
  • packages/egg/test/fixtures/apps/messenger-random/app.js
  • packages/egg/test/fixtures/apps/ctx-background/app/controller/app.js
  • packages/egg/test/fixtures/apps/app-ts-type-check/error.ts
  • packages/egg/test/fixtures/apps/view-render/app/view/inject.html
  • packages/egg/test/fixtures/apps/multipart/app/view/home.html
  • packages/egg/test/fixtures/apps/middlewares/config/config.default.js
  • packages/egg/test/fixtures/apps/messenger-broadcast/app.js
  • packages/egg/test/fixtures/apps/app-ts/app/router.ts
  • packages/egg/test/fixtures/apps/httpclient-next-overwrite/app.js
**/test/fixtures/**

📄 CodeRabbit inference engine (AGENTS.md)

Put reusable test data under test/fixtures/

Files:

  • packages/egg/test/fixtures/apps/multiple-view-engine/app/controller/view.js
  • packages/egg/test/fixtures/apps/tracer-demo/tracer.js
  • packages/egg/test/fixtures/apps/i18n/app/controller/message.js
  • packages/egg/test/fixtures/apps/multipart/app/controller/upload.js
  • packages/egg/test/fixtures/apps/ctx-background/app/controller/home.js
  • packages/egg/test/fixtures/apps/multiple-view-engine/config/config.default.js
  • packages/egg/test/fixtures/apps/app-ts-type-check/normal.ts
  • packages/egg/test/fixtures/apps/multiple-view-engine/app/router.js
  • packages/egg/test/fixtures/apps/view-render/app/view/index.html
  • packages/egg/test/fixtures/custom-egg/index.js
  • packages/egg/test/fixtures/apps/httpclient-overwrite/app.js
  • packages/egg/test/fixtures/apps/subdir-services/app/controller/home.js
  • packages/egg/test/fixtures/apps/view-render/app/view/locals.html
  • packages/egg/test/fixtures/apps/app-enableFastContextLogger/app/controller/home.js
  • packages/egg/test/fixtures/apps/messenger-broadcast/agent.js
  • packages/egg/test/fixtures/apps/helper/app/router.js
  • packages/egg/test/fixtures/apps/messenger-random/app.js
  • packages/egg/test/fixtures/apps/ctx-background/app/controller/app.js
  • packages/egg/test/fixtures/apps/app-ts-type-check/error.ts
  • packages/egg/test/fixtures/apps/view-render/app/view/inject.html
  • packages/egg/test/fixtures/apps/multipart/app/view/home.html
  • packages/egg/test/fixtures/apps/middlewares/config/config.default.js
  • packages/egg/test/fixtures/apps/messenger-broadcast/app.js
  • packages/egg/test/fixtures/apps/app-ts/app/router.ts
  • packages/egg/test/fixtures/apps/httpclient-next-overwrite/app.js
{packages,plugins}/**/vitest.config.ts

📄 CodeRabbit inference engine (CLAUDE.md)

Each non-CLI package must include a vitest.config.ts for test configuration

Files:

  • packages/egg/vitest.config.ts
packages/egg/src/app/extend/**

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

Place framework extensions (context, helper, request, response) under packages/egg/src/app/extend/

Files:

  • packages/egg/src/app/extend/helper.ts
  • packages/egg/src/app/extend/request.ts
  • packages/egg/src/app/extend/context.ts
packages/egg/src/config/**

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

Store default configurations and plugin configs under packages/egg/src/config/

Files:

  • packages/egg/src/config/config.default.ts
🧠 Learnings (13)
📚 Learning: 2025-09-15T01:56:16.297Z
Learnt from: CR
PR: eggjs/egg#0
File: CLAUDE.md:0-0
Timestamp: 2025-09-15T01:56:16.297Z
Learning: Applies to {packages,plugins}/**/test/**/*.test.ts : Use Node.js built-in assert for assertions in Vitest tests

Applied to files:

  • packages/egg/test/app/extend/response.test.ts
  • packages/egg/test/typescript.test.ts
  • packages/egg/test/lib/core/cookies.test.ts
  • packages/egg/test/lib/core/utils.test.ts
  • packages/egg/test/lib/plugins/watcher.test.ts
  • packages/egg/test/app/extend/helper.test.ts
  • packages/egg/test/application.test.ts
  • packages/egg/test/lib/core/context_httpclient.test.ts
  • packages/egg/test/lib/plugins/development.test.ts
  • packages/egg/test/lib/plugins/logrotator.test.ts
  • packages/egg/vitest.config.ts
  • packages/egg/test/lib/core/logger.test.ts
  • packages/egg/test/lib/core/view.test.ts
  • packages/egg/test/lib/plugins/onerror.test.ts
  • packages/egg/test/app/extend/request.test.ts
  • packages/egg/test/egg.test.ts
  • packages/egg/test/agent.test.ts
  • packages/egg/test/cluster1/app_worker.test.ts
  • packages/egg/test/lib/core/context_performance_starttime.test.ts
  • packages/egg/test/app/middleware/notfound.test.ts
  • packages/egg/test/lib/core/messenger/local.test.ts
  • packages/egg/test/app/middleware/site_file.test.ts
  • packages/egg/test/lib/plugins/depd.test.ts
  • packages/egg/test/lib/core/httpclient_tracer_demo.test.ts
  • packages/egg/test/app/extend/application.test.ts
  • packages/egg/test/app/extend/context.test.ts
  • packages/egg/test/app/middleware/meta.test.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 Node.js built-in assert module for test assertions

Applied to files:

  • packages/egg/test/app/extend/response.test.ts
  • packages/egg/test/typescript.test.ts
  • packages/egg/test/lib/core/cookies.test.ts
  • packages/egg/test/lib/core/loader/load_plugin.test.ts
  • packages/egg/test/lib/core/utils.test.ts
  • packages/egg/test/lib/core/loader/load_service.test.ts
  • packages/egg/test/lib/plugins/watcher.test.ts
  • packages/egg/test/app/extend/helper.test.ts
  • packages/egg/test/application.test.ts
  • packages/egg/test/lib/plugins/development.test.ts
  • packages/egg/vitest.config.ts
  • packages/egg/test/lib/core/logger.test.ts
  • packages/egg/test/lib/plugins/onerror.test.ts
  • packages/egg/test/app/extend/request.test.ts
  • packages/egg/test/egg.test.ts
  • packages/egg/test/agent.test.ts
  • packages/egg/test/cluster1/app_worker.test.ts
  • packages/egg/test/lib/core/context_performance_starttime.test.ts
  • packages/egg/test/app/middleware/notfound.test.ts
  • packages/egg/test/lib/core/messenger/local.test.ts
  • packages/egg/test/app/middleware/site_file.test.ts
  • packages/egg/test/lib/plugins/depd.test.ts
  • packages/egg/test/lib/core/httpclient_tracer_demo.test.ts
  • packages/egg/test/asyncSupport.test.ts
  • packages/egg/test/app/extend/application.test.ts
  • packages/egg/test/app/extend/context.test.ts
📚 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: For features affecting HTTP or process orchestration, add regression tests that exercise both the CommonJS and TypeScript example apps

Applied to files:

  • packages/egg/test/app/extend/response.test.ts
  • packages/egg/test/app/middleware/body_parser.test.ts
  • packages/egg/test/typescript.test.ts
  • packages/egg/test/lib/core/router.test.ts
  • packages/egg/test/app/extend/helper.test.ts
  • packages/egg/test/application.test.ts
  • packages/egg/test/lib/core/logger.test.ts
  • packages/egg/test/lib/core/view.test.ts
  • packages/egg/test/lib/plugins/security.test.ts
  • packages/egg/test/cluster1/cluster-client.test.ts
  • packages/egg/test/app/extend/request.test.ts
  • packages/egg/test/egg.test.ts
  • packages/egg/test/agent.test.ts
  • packages/egg/test/cluster1/app_worker.test.ts
  • packages/egg/test/app/middleware/override_method.test.ts
  • packages/egg/test/app/middleware/notfound.test.ts
  • packages/egg/test/lib/core/messenger/local.test.ts
  • packages/egg/test/cluster2/master.test.ts
  • packages/egg/test/lib/core/httpclient.test.ts
  • packages/egg/test/app/middleware/site_file.test.ts
  • packages/egg/test/lib/plugins/depd.test.ts
  • packages/egg/test/lib/core/httpclient_tracer_demo.test.ts
  • packages/egg/test/asyncSupport.test.ts
  • packages/egg/test/app/extend/application.test.ts
  • packages/egg/test/app/extend/context.test.ts
  • packages/egg/test/app/middleware/meta.test.ts
📚 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/egg/test/typescript.test.ts
  • packages/egg/test/fixtures/apps/app-ts-type-check/error.ts
  • packages/egg/src/lib/core/utils.ts
📚 Learning: 2025-09-15T01:56:16.297Z
Learnt from: CR
PR: eggjs/egg#0
File: CLAUDE.md:0-0
Timestamp: 2025-09-15T01:56:16.297Z
Learning: Applies to tools/egg-bin/test/**/*.test.ts : egg-bin (CLI tool) tests must use Mocha

Applied to files:

  • packages/egg/test/typescript.test.ts
  • packages/egg/test/lib/core/cookies.test.ts
  • packages/egg/test/lib/core/loader/load_plugin.test.ts
  • packages/egg/test/lib/core/utils.test.ts
  • packages/egg/test/lib/plugins/watcher.test.ts
  • packages/egg/test/app/extend/helper.test.ts
  • packages/egg/test/application.test.ts
  • packages/egg/test/lib/plugins/development.test.ts
  • packages/egg/vitest.config.ts
  • packages/egg/test/lib/core/logger.test.ts
  • packages/egg/test/app/extend/request.test.ts
  • packages/egg/test/egg.test.ts
  • packages/egg/test/agent.test.ts
  • packages/egg/test/cluster1/app_worker.test.ts
  • packages/egg/test/lib/core/messenger/local.test.ts
  • packages/egg/test/cluster2/master.test.ts
  • packages/egg/test/lib/plugins/depd.test.ts
  • packages/egg/test/asyncSupport.test.ts
  • packages/egg/test/app/extend/application.test.ts
  • packages/egg/test/utils.ts
📚 Learning: 2025-09-15T01:56:16.297Z
Learnt from: CR
PR: eggjs/egg#0
File: CLAUDE.md:0-0
Timestamp: 2025-09-15T01:56:16.297Z
Learning: Applies to plugins/*/package.json : Plugin package.json must include an eggPlugin configuration field

Applied to files:

  • packages/egg/test/lib/core/loader/load_plugin.test.ts
📚 Learning: 2025-09-15T01:56:16.297Z
Learnt from: CR
PR: eggjs/egg#0
File: CLAUDE.md:0-0
Timestamp: 2025-09-15T01:56:16.297Z
Learning: Applies to {packages,plugins}/**/test/**/*.test.ts : Vitest test files should follow the naming pattern test/**/*.test.ts and import from vitest

Applied to files:

  • packages/egg/test/lib/plugins/watcher.test.ts
  • packages/egg/test/application.test.ts
  • packages/egg/test/lib/core/context_httpclient.test.ts
  • packages/egg/test/lib/plugins/development.test.ts
  • packages/egg/test/lib/plugins/logrotator.test.ts
  • packages/egg/vitest.config.ts
  • packages/egg/test/app/extend/request.test.ts
  • packages/egg/test/egg.test.ts
  • packages/egg/test/agent.test.ts
  • packages/egg/test/cluster1/app_worker.test.ts
  • packages/egg/test/app/extend/application.test.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 : Name test files as test/**/*.test.ts and run them with Vitest

Applied to files:

  • packages/egg/test/lib/plugins/watcher.test.ts
  • packages/egg/test/application.test.ts
  • packages/egg/test/lib/plugins/development.test.ts
  • packages/egg/vitest.config.ts
  • packages/egg/test/app/extend/request.test.ts
  • packages/egg/test/agent.test.ts
  • packages/egg/test/app/extend/application.test.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:

  • packages/egg/test/lib/plugins/watcher.test.ts
  • packages/egg/test/application.test.ts
  • packages/egg/test/lib/core/context_httpclient.test.ts
  • packages/egg/test/lib/plugins/development.test.ts
  • packages/egg/test/app/extend/request.test.ts
  • packages/egg/test/egg.test.ts
  • packages/egg/test/agent.test.ts
  • packages/egg/test/cluster1/app_worker.test.ts
  • packages/egg/test/cluster2/master.test.ts
  • packages/egg/test/lib/plugins/depd.test.ts
  • packages/egg/test/lib/core/httpclient_tracer_demo.test.ts
  • packages/egg/test/asyncSupport.test.ts
  • packages/egg/test/lib/core/loader/config_loader.test.ts
  • packages/egg/test/app/middleware/meta.test.ts
📚 Learning: 2025-09-15T01:56:16.297Z
Learnt from: CR
PR: eggjs/egg#0
File: CLAUDE.md:0-0
Timestamp: 2025-09-15T01:56:16.297Z
Learning: Applies to {packages,plugins}/**/vitest.config.ts : Each non-CLI package must include a vitest.config.ts for test configuration

Applied to files:

  • packages/egg/test/application.test.ts
  • packages/egg/test/lib/plugins/development.test.ts
  • packages/egg/vitest.config.ts
📚 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 **/test/**/*.test.ts : Place test suites following Vitest discovery: **/test/**/*.test.ts

Applied to files:

  • packages/egg/test/application.test.ts
📚 Learning: 2025-09-15T01:56:16.297Z
Learnt from: CR
PR: eggjs/egg#0
File: CLAUDE.md:0-0
Timestamp: 2025-09-15T01:56:16.297Z
Learning: Applies to plugins/*/package.json : Plugin package.json must export TS sources in development ("exports": { ".": "./src/index.ts", "./agent": "./src/agent.ts", "./app": "./src/app.ts", "./package.json": "./package.json" })

Applied to files:

  • packages/egg/test/lib/plugins/development.test.ts
📚 Learning: 2025-09-15T01:56:16.297Z
Learnt from: CR
PR: eggjs/egg#0
File: CLAUDE.md:0-0
Timestamp: 2025-09-15T01:56:16.297Z
Learning: Applies to packages/egg/tsconfig.json : packages/egg/tsconfig.json must extend eggjs/tsconfig and enable strict mode

Applied to files:

  • packages/egg/test/egg.test.ts
🧬 Code graph analysis (31)
packages/egg/test/cluster1/cluster-client-error.test.ts (1)
packages/egg/test/utils.ts (1)
  • getFilepath (127-129)
packages/egg/test/typescript.test.ts (2)
packages/egg/test/fixtures/apps/app-ts/app/router.ts (1)
  • app (4-10)
packages/egg/test/utils.ts (1)
  • app (31-36)
packages/egg/test/lib/core/cookies.test.ts (1)
packages/egg/test/utils.ts (1)
  • getFilepath (127-129)
packages/egg/test/lib/plugins/schedule.test.ts (1)
packages/egg/test/utils.ts (1)
  • getFilepath (127-129)
packages/egg/src/lib/core/messenger/ipc.ts (1)
packages/egg/src/lib/core/base_context_logger.ts (1)
  • debug (37-39)
packages/egg/test/lib/plugins/watcher.test.ts (1)
packages/egg/test/utils.ts (1)
  • getFilepath (127-129)
packages/egg/test/application.test.ts (1)
packages/egg/test/utils.ts (1)
  • getFilepath (127-129)
packages/egg/test/fixtures/apps/ctx-background/app/controller/home.js (1)
packages/egg/test/fixtures/apps/ctx-background/app/controller/app.js (1)
  • buf (6-6)
packages/egg/test/lib/plugins/logrotator.test.ts (1)
packages/utils/src/import.ts (1)
  • importResolve (317-448)
packages/egg/test/fixtures/apps/multiple-view-engine/config/config.default.js (1)
packages/egg/src/config/config.default.ts (1)
  • appInfo (14-407)
packages/egg/test/cluster1/master.test.ts (1)
packages/egg/test/utils.ts (1)
  • getFilepath (127-129)
packages/egg/test/fixtures/apps/multiple-view-engine/app/router.js (1)
packages/egg/test/fixtures/apps/app-ts/app/router.ts (1)
  • app (4-10)
packages/egg/test/lib/core/logger.test.ts (1)
packages/egg/test/utils.ts (1)
  • getFilepath (127-129)
packages/egg/test/fixtures/custom-egg/index.js (2)
packages/egg/src/index.ts (1)
  • Application (46-46)
packages/egg/src/lib/application.ts (1)
  • Application (43-299)
packages/egg/test/fixtures/apps/httpclient-overwrite/app.js (1)
packages/egg/test/fixtures/apps/httpclient-next-overwrite/app.js (1)
  • assert (1-1)
packages/egg/test/egg.test.ts (1)
packages/egg/test/utils.ts (4)
  • getFilepath (127-129)
  • app (31-36)
  • createApp (38-38)
  • MockApplication (24-24)
packages/egg/src/lib/core/logger.ts (1)
packages/egg/src/lib/egg.ts (1)
  • loggers (405-410)
packages/egg/test/app/middleware/notfound.test.ts (2)
packages/egg/test/fixtures/apps/app-ts/app/router.ts (1)
  • app (4-10)
packages/egg/test/utils.ts (2)
  • app (31-36)
  • mm (23-23)
packages/egg/test/cluster2/master.test.ts (2)
packages/mock/src/register.ts (3)
  • afterEach (29-36)
  • beforeAll (22-28)
  • afterAll (37-45)
packages/egg/test/utils.ts (4)
  • mm (23-23)
  • app (31-36)
  • MockApplication (24-24)
  • cluster (47-50)
packages/egg/test/fixtures/apps/ctx-background/app/controller/app.js (1)
packages/egg/test/fixtures/apps/ctx-background/app/controller/home.js (3)
  • buf (6-6)
  • buf (10-10)
  • fs (1-1)
packages/egg/src/lib/egg.ts (1)
packages/core/src/egg.ts (4)
  • EggCoreOptions (37-43)
  • MiddlewareFunc (101-102)
  • Context (64-98)
  • url (449-451)
packages/egg/test/lib/core/httpclient.test.ts (5)
packages/egg/src/lib/egg.ts (2)
  • client (590-597)
  • httpclient (396-398)
packages/egg/src/lib/core/context_httpclient.ts (1)
  • ContextHttpClient (4-31)
packages/egg/test/utils.ts (2)
  • startLocalServer (80-125)
  • app (31-36)
packages/egg/src/lib/core/httpclient.ts (3)
  • HttpClient (22-52)
  • HttpClient (55-55)
  • HttpClient (55-55)
packages/egg/src/app/extend/context.ts (1)
  • httpclient (60-65)
packages/egg/src/lib/core/context_httpclient.ts (1)
packages/egg/src/lib/core/httpclient.ts (1)
  • HttpClientRequestOptions (17-20)
packages/egg/test/lib/plugins/depd.test.ts (2)
packages/mock/src/register.ts (3)
  • afterEach (29-36)
  • beforeAll (22-28)
  • afterAll (37-45)
packages/egg/test/utils.ts (4)
  • mm (23-23)
  • app (31-36)
  • MockApplication (24-24)
  • createApp (38-38)
packages/egg/src/lib/application.ts (2)
packages/core/src/loader/file_loader.ts (2)
  • FULLPATH (19-19)
  • FULLPATH (73-75)
packages/egg/src/app/extend/context.ts (1)
  • Context (26-303)
packages/egg/test/asyncSupport.test.ts (2)
packages/mock/src/register.ts (3)
  • afterEach (29-36)
  • beforeAll (22-28)
  • afterAll (37-45)
packages/egg/test/utils.ts (4)
  • restore (29-29)
  • app (31-36)
  • MockApplication (24-24)
  • createApp (38-38)
packages/egg/src/lib/types.ts (1)
packages/core/src/loader/file_loader.ts (1)
  • FileLoaderOptions (36-60)
packages/egg/src/lib/core/messenger/local.ts (1)
packages/egg/src/lib/core/base_context_logger.ts (1)
  • debug (37-39)
packages/egg/test/utils.ts (2)
packages/cluster/test/utils.ts (1)
  • cluster (5-17)
packages/egg/src/lib/start.ts (2)
  • StartEggOptions (10-20)
  • SingleModeApplication (22-24)
packages/egg/src/app/extend/context.ts (1)
packages/egg/src/lib/core/httpclient.ts (4)
  • HttpClientRequestOptions (17-20)
  • HttpClient (22-52)
  • HttpClient (55-55)
  • HttpClient (55-55)
packages/egg/test/fixtures/apps/httpclient-next-overwrite/app.js (1)
packages/egg/test/fixtures/apps/httpclient-overwrite/app.js (1)
  • assert (3-3)
🪛 Biome (2.1.2)
packages/egg/test/fixtures/apps/subdir-services/app/controller/home.js

[error] 11-11: Comparing to itself is potentially pointless.

(lint/suspicious/noSelfCompare)

⏰ 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). (12)
  • GitHub Check: Test egg-bin (windows-latest, 22)
  • GitHub Check: Test egg-bin (macos-latest, 24)
  • GitHub Check: Test egg-bin (windows-latest, 24)
  • GitHub Check: Test egg-bin (macos-latest, 22)
  • GitHub Check: Test egg-bin (ubuntu-latest, 24)
  • GitHub Check: Test egg-bin (ubuntu-latest, 22)
  • GitHub Check: Test packages (windows-latest, 22)
  • GitHub Check: Test packages (windows-latest, 24)
  • GitHub Check: Test packages (macos-latest, 24)
  • GitHub Check: Test packages (ubuntu-latest, 24)
  • GitHub Check: Test packages (macos-latest, 22)
  • GitHub Check: Test packages (ubuntu-latest, 22)

@codecov
Copy link

codecov bot commented Sep 23, 2025

Codecov Report

❌ Patch coverage is 75.41528% with 74 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.93%. Comparing base (1f1eddf) to head (95ac0dd).
⚠️ Report is 3 commits behind head on next.

Files with missing lines Patch % Lines
packages/cluster/src/master.ts 0.00% 24 Missing and 2 partials ⚠️
...ackages/cluster/src/utils/mode/impl/process/app.ts 0.00% 8 Missing ⚠️
...kages/cluster/src/utils/mode/impl/process/agent.ts 0.00% 5 Missing ⚠️
packages/core/src/loader/egg_loader.ts 92.85% 5 Missing ⚠️
...luster/src/utils/mode/impl/worker_threads/agent.ts 0.00% 4 Missing ⚠️
packages/egg/src/lib/core/messenger/ipc.ts 33.33% 4 Missing ⚠️
packages/cluster/src/utils/terminate.ts 0.00% 2 Missing ⚠️
packages/core/src/loader/file_loader.ts 84.61% 2 Missing ⚠️
packages/egg/src/lib/egg.ts 85.71% 2 Missing ⚠️
packages/mock/src/app/extend/agent.ts 0.00% 2 Missing ⚠️
... and 14 more
Additional details and impacted files
@@            Coverage Diff             @@
##             next    #5530      +/-   ##
==========================================
- Coverage   76.31%   75.93%   -0.39%     
==========================================
  Files         113      113              
  Lines        5891     5768     -123     
  Branches     1237     1152      -85     
==========================================
- Hits         4496     4380     -116     
+ Misses       1218     1208      -10     
- Partials      177      180       +3     

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

@fengmk2 fengmk2 merged commit 7371734 into next Sep 23, 2025
20 of 26 checks passed
@fengmk2 fengmk2 deleted the prettierrc-width-120 branch September 23, 2025 13:38
@coderabbitai coderabbitai bot mentioned this pull request Oct 22, 2025
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