chore: migrate to utoo CI (#5830)
Summary
Migrate the main CI workflow from pnpm to utoo (
ut). The E2E workflow keeps pnpm for now — it requirescatalog:/workspace:protocol resolution andpublishConfigoverrides during pack whichut pm-packdoes not yet provide.Install speedup
The direct win of this migration:
ut install --from pnpmis 2.2–3.6× faster thanpnpm installacross all test matrix platforms.
Platform pnpm install ut install Speedup ubuntu-22 16.8s 5.2s 3.2× ubuntu-24 17.7s 4.9s 3.6× macos-22 26.3s 9.5s 2.8× macos-24 30.1s 9.1s 3.3× windows-22 31.1s 12.0s 2.6× windows-24 28.4s 12.7s 2.2× Every test matrix job re-installs from scratch, so this 15–20s savings per job compounds into the per-job reductions below.
Overall CI wall-clock
On a clean run (no reruns), the full workflow shaves ~1 minute off wall-clock (25m34s → 24m32s,
4% faster). The critical path is still bounded by Windows Test (20–24m), so faster jobs elsewhere can’t meaningfully shrink wall-clock. Flaky reruns on the critical path can degrade practical times further.The win of this PR is per-job speedup (especially macOS, where Test jobs drop 6–8 minutes each) and developer-machine ergonomics (
ut installon your laptop is also 3× faster).CI changes
.github/workflows/ci.yml: replacepnpm/action-setup+pnpm installwithutooland/setup-utoo+ut install --from pnpmpackage.json: convert pnpm-specific scripts to ut equivalents (ut run --workspaces,ut run --workspace <name>)site:build/site:devusecd site && npm run build/devso Cloudflare Pages works (its env has neither pnpm nor utoo).gitignore: add.utoo.tomland.claude/.oxfmtrc.json: ignore rootpackage.json(ut rewrites it with npm-styleworkspacesfield)egg-bin fixes
CJS resolution (
baseCommand.ts)
ts-node,tsconfig-pathsare CJS packages withoutexports. On flat-hoisted layouts (npm/utoo),importResolve(which usesimport.meta.resolve) fails because the ESM resolver doesn’t auto-append.jsfor bare subpaths. Fix: usecreateRequirefor these CJS packages.Self-test fixture opt-out (
test.ts+coffee.ts)Under flat-hoisting, egg-bin’s own test fixtures reach
@eggjs/mockand@eggjs/tegg-vitestvia monorepo root hoist even though the fixture projects don’t use them. This caused every test fork to load both frameworks unnecessarily (~90s for mock, ~7s/fork for tegg runner → ~70s for the test-bin suite).Solution: the test harness (
coffee.ts) setsEGG_BIN_SELF_TEST_FIXTURE=1when spawning egg-bin against its own fixtures.test.tschecks this env var and skips both mock and tegg-runner auto-detection.For real projects, behaviour is unchanged: both frameworks are resolve-then-use. The tegg runner also falls back to egg-bin’s own dirname for E2E scenarios (cnpmcore uses tegg transitively via egg without declaring it directly).
Build perf: publint pack
publintrunspnpm packby default against each of ~80 packages. On main CI (utoo env, no pnpm binary) this fails. On E2E (pnpm env, symlinked node_modules) npm pack is ~10× slower per package —create-eggalone took 85s vs 1s under pnpm.Fix:
tsdown.config.tsreadsPUBLINT_PACKenv var, defaulting tonpm(works in main CI). E2E workflow setsPUBLINT_PACK=pnpmso it stays fast there.Dependency fixes
Change Why oxlint-tsgolint: ^0.15.0→^0.18.1Peer requirement of oxlint 1.60.0 Add @types/content-type,@types/koa-composeto root devDepsoxlint type-check needs these at workspace root, not just hoisted from sub-packages Other source adaptations
File What packages/cluster/test/options.test.tsAccept flat-hoisted node_modules/eggpathpackages/tsconfig/test/index.test.tsUse require.resolveinsteadof hardcoded path tegg/plugin/controller,tegg/plugin/mcp-proxyRemove @ts-expect-errorfor types discoverable under flat hoistingPer-job timing (clean run, no reruns)
Job next chore-ut-ci Delta typecheck 2m7s 1m39s -28s Test (ubuntu, 22) 14m52s 15m20s +28s Test (ubuntu, 24) 13m38s 13m28s -10s Test (macos, 22) 21m5s 14m40s -6m25s Test (macos, 24) 18m54s 10m38s -8m16s Test (windows, 22) 25m24s 24m23s -1m1s Test (windows, 24) 23m7s 20m59s -2m8s Test bin (ubuntu) 2m19s 2m2s -17s Test bin (windows) 3m51s 2m56s -55s Test scripts (ubuntu, 22) 1m41s 1m13s -28s Test scripts (ubuntu, 24) 1m36s 1m16s -20s cnpmcore E2E 6m0s 5m58s -2s examples E2E 2m35s 2m25s -10s Almost every job is faster; the small Test (ubuntu 22) +28s regression is within run-to-run variance.
Test plan
- typecheck
- Test matrix (ubuntu/macos/windows × Node 22/24)
- Test bin, Test scripts
- E2E (cnpmcore + examples)
- Cloudflare Pages
🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
- Chores
- Migrated build and dependency management tooling from pnpm to utoo across the monorepo.
- Updated CI workflows, workspace configurations, and npm scripts to support the new tooling.
- Added build configuration for egg-bin TypeScript compilation.
- Enhanced test infrastructure for environment isolation and compatibility.
Co-authored-by: Claude Opus 4.6 (1M context) noreply@anthropic.com
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802032778号
English | 简体中文
Features
Quickstart
Follow the commands listed below.
Monorepo Structure
This project is structured as a pnpm monorepo with the following packages:
packages/egg- Main Eggjs frameworkexamples/helloworld-commonjs- CommonJS example applicationexamples/helloworld-typescript- TypeScript example applicationsite- Documentation websiteThe monorepo uses pnpm catalog mode for centralized dependency management, ensuring consistent versions across all packages.
Development Commands
Documentations
Contributors
How to Contribute
Please let us know how can we help. Do check out issues for bug reports or suggestions first.
To become a contributor, please follow our contributing guide, and review the repository guidelines for day-to-day development tips.
Sponsors and Backers
License
MIT