You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Summary
- Align GitHub Copilot instructions with the canonical `AGENTS.md` Local
CI guidance: Node/pnpm versions, `pnpm run ci` meaning, and avoiding
builds immediately before unit tests.
- Add tegg-specific Claude guidance for `duplicate proto` failures after
local builds.
- Add a durable wiki workflow page for local CI artifact cleanup and
link it from the wiki index/log.
## Validation
- `pnpm run fmtcheck` passed.
- `git diff --check` passed.
- Pre-commit hook was bypassed for the commit because `oxlint
--type-aware --fix` fails on a markdown-only staged set with `No files
found to lint`; full repo formatting passed before commit.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Documentation**
* Updated contribution workflow guidance (Node.js minimum bumped to **>=
22.18.0**), including a new explicit lint step and revised build vs.
test ordering.
* Refined CI wording to reflect “tests with coverage” and recommended
working from the source tree first.
* Clarified local validation order (lint → tests from clean sources →
build when needed → docs).
* Expanded local CI instructions and troubleshooting for **duplicate
proto** failures by cleaning stale build artifacts, and added a local CI
workflow entry to the release log.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
-**Node.js >= 22.18.0 required** - This is a hard requirement
14
+
- Enable pnpm first: `corepack enable pnpm` (uses the `packageManager` version from `package.json`, currently pnpm v10.28.0)
15
15
-**NEVER CANCEL** any build or test commands - they can take several minutes to complete
16
16
17
17
## Bootstrap and Build Process
18
18
19
-
**Always run these commands in sequence after fresh clone:**
19
+
**Run these commands after a fresh clone:**
20
20
21
21
```bash
22
22
# 1. Enable pnpm (required first)
@@ -25,13 +25,17 @@ corepack enable pnpm
25
25
# 2. Install all dependencies - takes ~63 seconds. NEVER CANCEL. Set timeout to 120+ seconds.
26
26
pnpm install
27
27
28
-
# 3. Build all packages - takes ~14 seconds. NEVER CANCEL. Set timeout to 60+ seconds.
29
-
pnpm run build
30
-
31
-
# 4. Run linting (optional but recommended) - takes ~2 seconds
28
+
# 3. Run pnpm run lint to check code quality across all packages - takes ~2 seconds
32
29
pnpm run lint
30
+
31
+
# 4. Build all packages when validating build output - takes ~14 seconds. NEVER CANCEL. Set timeout to 60+ seconds.
32
+
pnpm run build
33
33
```
34
34
35
+
Run unit tests from a clean source tree, not immediately after `pnpm run build`.
36
+
The main CI test job installs dependencies with `ut install --from pnpm` and
37
+
runs tests with `ut run ci`; it does not run `build` before tests.
38
+
35
39
## Monorepo Structure
36
40
37
41
### Key Packages (all in `packages/` directory)
@@ -61,7 +65,7 @@ pnpm run lint
61
65
62
66
-`pnpm run test` - **Run all tests (~2 minutes). NEVER CANCEL. Set timeout to 180+ seconds.**
63
67
-`pnpm run test:cov` - **Run tests with coverage (~2 minutes). NEVER CANCEL. Set timeout to 180+ seconds.**
64
-
-`pnpm run ci` - **Run test coverage + build (~2.1 minutes). NEVER CANCEL. Set timeout to 180+ seconds.**
68
+
-`pnpm run ci` - **Run tests with coverage (~2.1 minutes). NEVER CANCEL. Set timeout to 180+ seconds.**
65
69
66
70
### Linting Commands
67
71
@@ -92,7 +96,7 @@ pnpm --filter=site run dev
92
96
93
97
### 1. Making Changes
94
98
95
-
-Always build packages first: `pnpm run build`
99
+
-Work from the source tree first. Build when you need to validate package output, but do not run build immediately before unit tests.
96
100
- Work primarily in `packages/egg/src/` for core framework features
97
101
- Use TypeScript throughout - all packages are TypeScript-based
98
102
- Follow the existing directory conventions in `packages/egg/src/`:
@@ -107,16 +111,16 @@ pnpm --filter=site run dev
107
111
**Always perform these validation steps after making changes:**
108
112
109
113
```bash
110
-
# 1. Build all packages (required)
111
-
pnpm run build
112
-
113
-
# 2. Run linting
114
+
# 1. Run pnpm run lint to check code quality across all packages
114
115
pnpm run lint
115
116
116
-
#3. Run tests (some failures are expected in fresh environment)
117
+
#2. Run tests from a clean tree (some failures are expected in fresh environment)
117
118
pnpm run test
118
119
119
-
# 4. Test documentation site
120
+
# 3. Build all packages when build output or packaging behavior is relevant
121
+
pnpm run build
122
+
123
+
# 4. Test documentation site when docs changed
120
124
pnpm run site:dev
121
125
```
122
126
@@ -176,10 +180,15 @@ pnpm run site:dev
176
180
- Some tests may fail in fresh environments - this is normal
177
181
- Focus on fixing only failures related to your changes
178
182
- Examples may have runtime issues - don't use them for validation
183
+
- If tegg tests fail with `duplicate proto` after a local build, remove stale
184
+
`dist/` directories outside fixtures and re-run tests. Built `dist/*.js`
185
+
files can be scanned alongside `src/*.ts`, loading the same decorated class
186
+
twice.
179
187
180
188
### Build Issues
181
189
182
-
- Always run `pnpm run build` after making changes
190
+
- Run `pnpm run build` when validating build output, package exports, or changes
191
+
that affect generated artifacts.
183
192
- TypeScript compilation errors will show clearly
184
193
- Build warnings are generally acceptable
185
194
@@ -217,12 +226,12 @@ pnpm run site:dev
217
226
218
227
After making changes, always verify:
219
228
220
-
1.**Build Success**: `pnpm run build` completes without errors
221
-
2.**Linting Passes**: `pnpm run lint` shows no new errors
229
+
1.**Linting Passes**: `pnpm run lint` shows no new errors
230
+
2.**Tests Run From Clean Sources**: `pnpm run test` executes without stale build artifacts interfering
222
231
3.**Documentation Loads**: `pnpm run site:dev` starts successfully and site loads at http://localhost:8000
223
-
4.**Tests Run**: `pnpm run test` executes (some failures expected, focus on your changes)
232
+
4.**Build Success When Relevant**: `pnpm run build` completes without errors
224
233
225
-
**Remember**: This is a complex enterprise framework. Always build first, validate incrementally, and focus on the core packages (`egg`, `core`, `utils`) for most development work.
234
+
**Remember**: This is a complex enterprise framework. Validate incrementally, keep unit tests isolated from stale build artifacts, and focus on the core packages (`egg`, `core`, `utils`) for most development work.
Copy file name to clipboardExpand all lines: AGENTS.md
+9-7Lines changed: 9 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,12 +18,14 @@ Egg is maintained as a pnpm monorepo.
18
18
19
19
## Core Commands
20
20
21
-
-`pnpm install` hydrates the workspace.
22
-
-`pnpm run build` builds all packages.
23
-
-`pnpm run test` runs the main test suite.
24
-
-`pnpm run lint` runs linting.
25
-
-`pnpm run typecheck` runs TypeScript checking.
26
-
- use filtered commands for focused work, for example `pnpm --filter=egg run test` or `pnpm --filter=site run dev`.
21
+
The repository runs on [utoo](https://github.com/utooland/utoo) (`ut`); the workspace is still defined in `pnpm-workspace.yaml` (catalog mode), so `ut install` reads it via `--from pnpm`.
22
+
23
+
-`ut install --from pnpm` hydrates the workspace.
24
+
-`ut run build` builds all packages.
25
+
-`ut run test` runs the main test suite.
26
+
-`ut run lint` runs linting.
27
+
-`ut run typecheck` runs TypeScript checking.
28
+
- use filtered commands for focused work, for example `ut run test --workspace @eggjs/bin` or `ut run build -- --workspace ./tools/egg-bin`.
27
29
28
30
### Local CI
29
31
@@ -92,7 +94,7 @@ Then re-run tests.
92
94
93
95
- review `SECURITY.md` before handling vulnerability-related work
94
96
- do not commit secrets, credentials, or local-only URLs
95
-
- keep local Node.jsand pnpm versions aligned with the repository configuration
97
+
- keep local Node.js, utoo, and pnpm versions aligned with the repository configuration (`engines.node`, `packageManager`)
Copy file name to clipboardExpand all lines: tegg/CLAUDE.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,6 +74,11 @@ pnpm run test:cov # Run tests with coverage
74
74
pnpm run ci # Full CI: vitest with coverage and bail on first failure
75
75
```
76
76
77
+
Run tegg tests from clean sources, not immediately after `pnpm run build`. If
78
+
local tests fail with `duplicate proto` after a build, remove stale `dist/`
79
+
directories outside fixtures as described in the root `AGENTS.md` Local CI
80
+
section, then re-run tests.
81
+
77
82
**Note:** Tests are configured in the monorepo root `vitest.config.ts` which includes all tegg packages (`tegg/core/*`, `tegg/plugin/*`, `tegg/standalone/*`).
Copy file name to clipboardExpand all lines: wiki/index.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,7 @@ Read this file before exploring raw sources.
13
13
14
14
-[CI parallel test metrics](./workflows/ci-parallel-test-metrics.md) - How the CI test gate surfaces avg/peak concurrency + parallel-efficiency metrics for the isolate:false suite, and how to read or reproduce them.
15
15
-[Docs and API Updates](./workflows/docs-and-api-updates.md) - How to handle changes that affect user-facing docs or durable project understanding.
16
+
-[Local CI](./workflows/local-ci.md) - Local validation should run tests from clean sources and avoid stale build artifacts before tegg tests.
16
17
-[Egg-bin Windows shell probe hotspot](./workflows/egg-bin-windows-shell-probe.md) - How PR #6014 diagnosed hosted-Windows egg-bin startup slowness and why the final fix only presets SHELL.
- note: Under root `pool:threads` + `isolate:false`, two realm-global leaks caused nondeterministic cross-file/cross-project failures. (1) `setSnapshotModuleLoader` left module-level `_snapshotModuleLoader`/`isESM=false` set (no-op test teardown), poisoning module resolution for later files (`Can not find plugin …`). (2) `mockContext()` reused `currentContext` from a different app, binding helpers to the wrong app config (surl/csrf failures). Fixed both at the source. Full Node-22 suite: 15 → 3 failing files (remaining 2 environmental MySQL/DNS; `multipart/file-mode` is a pre-existing load flake that also fails under `isolate:true`). Reproduce on Node 22/24 with a utoo install — not Node 26 / bare pnpm.
51
51
52
+
## [2026-06-03] workflow | document local CI artifact cleanup
- note: Recorded that local unit tests should run from clean sources, because stale built `dist/` files can be scanned alongside tegg TypeScript sources and trigger `duplicate proto` failures.
0 commit comments