Skip to content

Commit 5d5c532

Browse files
killaguclaude
andauthored
chore(repo): switch package manager references from pnpm to utoo (#5963)
## Summary - switch documented repository workflows from pnpm to utoo/ut - update CI/release/E2E workflow commands for utoo install/build paths - address review feedback from #5961 by making release install retry-safe and making `ut create egg@beta` the primary package README quickstart command This supersedes #5961 because the local OAuth git push path cannot update workflow files on the fork branch without `workflow` scope. ## Tests - `ut install --from pnpm` - `ut run fmtcheck -- .github/workflows/release.yml packages/egg/README.md` - `ut run lint` ## Notes - `git commit` used `--no-verify` locally because the repo pre-commit hook runs `oxlint --type-aware --fix` on a Markdown/YAML-only staged set and fails with `No files found to lint`; full `ut run lint` passed. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Updated development and quickstart guides to reflect new monorepo tooling workflow. * Updated CI/CD workflows and build processes for new tooling. * Refreshed command examples across all documentation and guides. * **Chores** * Node.js minimum version requirement increased to 22.18.0+. * Monorepo tooling updated from `pnpm` to `utoo` (`ut` CLI). * Development and build commands updated accordingly. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 3d08163 commit 5d5c532

14 files changed

Lines changed: 125 additions & 111 deletions

File tree

.github/copilot-instructions.md

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,33 @@
66

77
Eggjs is a progressive Node.js framework for building enterprise-class server-side applications. Built on top of Koa.js, it provides a plugin system, conventions over configuration, and enterprise-grade features like clustering, logging, and security.
88

9-
This is a **pnpm monorepo** with multiple packages using pnpm workspaces and catalog mode for centralized dependency management.
9+
This is a **utoo monorepo** with multiple packages using utoo workspaces and catalog mode for centralized dependency management.
1010

1111
## Prerequisites and Environment Setup
1212

1313
- **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)
14+
- Enable utoo first: `corepack enable utoo`
1515
- **NEVER CANCEL** any build or test commands - they can take several minutes to complete
1616

1717
## Bootstrap and Build Process
1818

1919
**Run these commands after a fresh clone:**
2020

2121
```bash
22-
# 1. Enable pnpm (required first)
23-
corepack enable pnpm
22+
# 1. Enable utoo (required first)
23+
corepack enable utoo
2424

2525
# 2. Install all dependencies - takes ~63 seconds. NEVER CANCEL. Set timeout to 120+ seconds.
26-
pnpm install
26+
ut install --from pnpm
2727

28-
# 3. Run pnpm run lint to check code quality across all packages - takes ~2 seconds
29-
pnpm run lint
28+
# 3. Run lint to check code quality across all packages - takes ~2 seconds
29+
ut run lint
3030

3131
# 4. Build all packages when validating build output - takes ~14 seconds. NEVER CANCEL. Set timeout to 60+ seconds.
32-
pnpm run build
32+
ut run build
3333
```
3434

35-
Run unit tests from a clean source tree, not immediately after `pnpm run build`.
35+
Run unit tests from a clean source tree, not immediately after `ut run build`.
3636
The main CI test job installs dependencies with `ut install --from pnpm` and
3737
runs tests with `ut run ci`; it does not run `build` before tests.
3838

@@ -52,44 +52,44 @@ runs tests with `ut run ci`; it does not run `build` before tests.
5252
### Supporting Directories
5353

5454
- **`examples/`** - Two example apps: `helloworld-commonjs` and `helloworld-typescript` (currently have runtime issues)
55-
- **`site/`** - Documentation website built with Dumi
55+
- **`site/`** - Documentation website built with VitePress
5656

5757
## Essential Commands and Timing
5858

5959
### Build Commands
6060

61-
- `pnpm run build` - **Build all packages (~14 seconds). NEVER CANCEL. Set timeout to 60+ seconds.**
62-
- `pnpm run clean` - Clean all dist directories
61+
- `ut run build` - **Build all packages (~14 seconds). NEVER CANCEL. Set timeout to 60+ seconds.**
62+
- `ut run clean-dist` - Clean all dist directories
6363

6464
### Testing Commands
6565

66-
- `pnpm run test` - **Run all tests (~2 minutes). NEVER CANCEL. Set timeout to 180+ seconds.**
67-
- `pnpm run test:cov` - **Run tests with coverage (~2 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.**
66+
- `ut run test` - **Run all tests (~2 minutes). NEVER CANCEL. Set timeout to 180+ seconds.**
67+
- `ut run test:cov` - **Run tests with coverage (~2 minutes). NEVER CANCEL. Set timeout to 180+ seconds.**
68+
- `ut run ci` - **Run tests with coverage (~2.1 minutes). NEVER CANCEL. Set timeout to 180+ seconds.**
6969

7070
### Linting Commands
7171

72-
- `pnpm run lint` - Run oxlint across all packages (~2 seconds)
72+
- `ut run lint` - Run oxlint across all packages (~2 seconds)
7373

7474
### Documentation Commands
7575

76-
- `pnpm run site:dev` - Start documentation dev server at http://localhost:8000
77-
- `cd site && pnpm run build:skip` - **Build documentation site (~24 seconds). NEVER CANCEL. Set timeout to 60+ seconds.**
76+
- `ut run site:dev` - Start documentation dev server (defaults to VitePress port 5173)
77+
- `ut run site:build` - **Build documentation site (~24 seconds). NEVER CANCEL. Set timeout to 60+ seconds.**
7878

7979
### Example Applications (Currently Not Working)
8080

81-
- `pnpm run example:commonjs` - Start CommonJS example (has runtime issues)
82-
- `pnpm run example:typescript` - Start TypeScript example (has runtime issues)
81+
- `ut run example:dev:commonjs` - Start CommonJS example (has runtime issues)
82+
- `ut run example:dev:typescript` - Start TypeScript example (has runtime issues)
8383

8484
## Package-Specific Commands
8585

86-
Run commands for specific packages using `pnpm --filter=<package>`:
86+
Run commands for specific packages using `ut --filter=<package>`:
8787

8888
```bash
8989
# Examples
90-
pnpm --filter=egg run test
91-
pnpm --filter=@eggjs/core run build
92-
pnpm --filter=site run dev
90+
ut --filter=egg run test
91+
ut --filter=@eggjs/core run build
92+
ut --filter=site run dev
9393
```
9494

9595
## Development Workflow
@@ -111,17 +111,17 @@ pnpm --filter=site run dev
111111
**Always perform these validation steps after making changes:**
112112

113113
```bash
114-
# 1. Run pnpm run lint to check code quality across all packages
115-
pnpm run lint
114+
# 1. Run lint to check code quality across all packages
115+
ut run lint
116116

117117
# 2. Run tests from a clean tree (some failures are expected in fresh environment)
118-
pnpm run test
118+
ut run test
119119

120120
# 3. Build all packages when build output or packaging behavior is relevant
121-
pnpm run build
121+
ut run build
122122

123123
# 4. Test documentation site when docs changed
124-
pnpm run site:dev
124+
ut run site:dev
125125
```
126126

127127
### 3. Testing Strategy
@@ -166,7 +166,7 @@ pnpm run site:dev
166166
- **All sub-project tsconfig.json files MUST extend from root:** `"extends": "../../tsconfig.json"`
167167
- Root tsconfig.json includes all packages in `references` array
168168

169-
## pnpm Workspace & Catalog Dependencies
169+
## utoo Workspace & Catalog Dependencies
170170

171171
- Dependencies defined in `pnpm-workspace.yaml` catalog section
172172
- Reference catalog entries: `"package-name": "catalog:"`
@@ -187,7 +187,7 @@ pnpm run site:dev
187187

188188
### Build Issues
189189

190-
- Run `pnpm run build` when validating build output, package exports, or changes
190+
- Run `ut run build` when validating build output, package exports, or changes
191191
that affect generated artifacts.
192192
- TypeScript compilation errors will show clearly
193193
- Build warnings are generally acceptable
@@ -226,10 +226,10 @@ pnpm run site:dev
226226

227227
After making changes, always verify:
228228

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
231-
3. **Documentation Loads**: `pnpm run site:dev` starts successfully and site loads at http://localhost:8000
232-
4. **Build Success When Relevant**: `pnpm run build` completes without errors
229+
1. **Linting Passes**: `ut run lint` shows no new errors
230+
2. **Tests Run From Clean Sources**: `ut run test` executes without stale build artifacts interfering
231+
3. **Documentation Loads**: `ut run site:dev` starts successfully and the printed VitePress URL responds
232+
4. **Build Success When Relevant**: `ut run build` completes without errors
233233

234234
**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.
235235

.github/workflows/release.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ jobs:
6262
fetch-depth: 0
6363
token: ${{ secrets.GIT_TOKEN }}
6464

65-
- name: Setup pnpm
66-
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
65+
- name: Setup utoo
66+
uses: utooland/setup-utoo@3a51006d0b66afcc32d1b9177a4b200b74f4a8cb # pinned from main
6767

6868
- name: Setup Node.js
6969
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
@@ -72,7 +72,10 @@ jobs:
7272
registry-url: 'https://registry.npmjs.org'
7373

7474
- name: Install dependencies
75-
run: pnpm install --no-frozen-lockfile
75+
run: |
76+
ut install --from pnpm
77+
git restore package.json
78+
git diff --exit-code -- package.json
7679
7780
- name: Configure Git
7881
run: |
@@ -149,7 +152,7 @@ jobs:
149152
git push origin ${{ github.event.inputs.branch }} --tags
150153
151154
- name: Run build
152-
run: pnpm build
155+
run: ut run build
153156

154157
- name: Publish packages (dry run)
155158
if: ${{ github.event.inputs.dry_run == 'true' }}

AGENTS.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ If another agent-specific file exists, it should import or defer to this file fo
66

77
## Project Map
88

9-
Egg is maintained as a pnpm monorepo.
9+
Egg is maintained as a utoo monorepo.
1010

1111
- `packages/` contains core framework packages and shared internals.
1212
- `plugins/` contains optional Egg integrations.
@@ -20,6 +20,7 @@ Egg is maintained as a pnpm monorepo.
2020

2121
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`.
2222

23+
- `corepack enable utoo` enables utoo on a clean machine.
2324
- `ut install --from pnpm` hydrates the workspace.
2425
- `ut run build` builds all packages.
2526
- `ut run test` runs the main test suite.
@@ -29,7 +30,7 @@ The repository runs on [utoo](https://github.com/utooland/utoo) (`ut`); the work
2930

3031
### Local CI
3132

32-
Run tests **without building first**. The CI workflow (`ut install → ut run ci`) never runs `build` before tests. If `dist/` directories exist from a prior build, tegg plugin tests will fail with `duplicate proto` errors because globby scans both `src/*.ts` and `dist/*.js`, loading the same decorated class twice.
33+
Run tests **without building first**. The CI workflow (`ut install --from pnpm → ut run ci`) never runs `build` before tests. If `dist/` directories exist from a prior build, tegg plugin tests will fail with `duplicate proto` errors because globby scans both `src/*.ts` and `dist/*.js`, loading the same decorated class twice.
3334

3435
When you see `duplicate proto` failures locally:
3536

README.md

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,72 +27,73 @@ English | [简体中文](./README.zh-CN.md)
2727
Follow the commands listed below.
2828

2929
```bash
30+
$ corepack enable utoo
3031
$ mkdir showcase && cd showcase
31-
$ pnpm create egg@beta
32-
$ pnpm install
33-
$ pnpm run dev
32+
$ ut create egg@beta
33+
$ ut install
34+
$ ut run dev
3435
$ open http://localhost:7001
3536
```
3637

37-
> Node.js >= 20.19.0 required, [supports `require(esm)` by default](https://nodejs.org/en/blog/release/v20.19.0).
38+
> Node.js >= 22.18.0 required.
3839
3940
## Monorepo Structure
4041

41-
This project is structured as a pnpm monorepo with the following packages:
42+
This project is structured as a utoo monorepo with the following packages:
4243

4344
- `packages/egg` - Main Eggjs framework
4445
- `examples/helloworld-commonjs` - CommonJS example application
4546
- `examples/helloworld-typescript` - TypeScript example application
4647
- `site` - Documentation website
4748

48-
The monorepo uses **pnpm catalog mode** for centralized dependency management, ensuring consistent versions across all packages.
49+
The monorepo uses **utoo catalog mode** for centralized dependency management, ensuring consistent versions across all packages.
4950

5051
### Development Commands
5152

5253
```bash
5354
# Install dependencies for all packages
54-
pnpm install
55+
ut install --from pnpm
5556

5657
# Build all packages
57-
pnpm run build
58+
ut run build
5859

5960
# Test all packages
60-
pnpm run test
61+
ut run test
6162

6263
# Run specific package commands
63-
pnpm --filter=egg run test
64-
pnpm --filter=@examples/helloworld-typescript run dev
65-
pnpm --filter=site run dev
64+
ut --filter=egg run test
65+
ut --filter=@examples/helloworld-typescript run dev
66+
ut --filter=site run dev
6667
```
6768

6869
### Local External Services
6970

7071
Some DAL, ORM, Redis, and ecosystem benchmark paths need local MySQL and Redis services. Start the repository-aligned Docker services before running those tests on a clean machine:
7172

7273
```bash
73-
utoo run dev:services:start
74+
ut run dev:services:start
7475
```
7576

7677
This starts MySQL 8 and Redis 7, matching the main CI service versions, and creates the databases used by local DAL/ORM/e2e fixtures: `test`, `apple`, `banana`, `test_runtime_datasource`, `test_runtime_dao`, `test_dal_plugin`, `test_dal_standalone`, `cnpmcore`, and `cnpmcore_unittest`.
7778

7879
Useful commands:
7980

8081
```bash
81-
utoo run dev:services:status
82-
utoo run dev:services:stop
83-
utoo run dev:services:reset
82+
ut run dev:services:status
83+
ut run dev:services:stop
84+
ut run dev:services:reset
8485
```
8586

8687
The default host ports are `127.0.0.1:3306` for MySQL and `127.0.0.1:6379` for Redis. If either port is already used, the start command stops before changing containers. Keep using the existing service if it is compatible with CI, or stop it and run the command again. You can change Docker host ports with `EGG_DEV_SERVICES_MYSQL_PORT` and `EGG_DEV_SERVICES_REDIS_PORT`; however, the full DAL/ORM/Redis local test path still expects the default host ports.
8788

8889
Image overrides are available for compatibility checks:
8990

9091
```bash
91-
EGG_DEV_SERVICES_MYSQL_IMAGE=mysql:5.7 utoo run dev:services:start
92-
EGG_DEV_SERVICES_REDIS_IMAGE=redis:7 utoo run dev:services:start
92+
EGG_DEV_SERVICES_MYSQL_IMAGE=mysql:5.7 ut run dev:services:start
93+
EGG_DEV_SERVICES_REDIS_IMAGE=redis:7 ut run dev:services:start
9394
```
9495

95-
Run `utoo run dev:services:reset` before switching MySQL image families, for example between MySQL 8 and MySQL 5.7, because MySQL data directories are not downgrade-compatible across major versions.
96+
Run `ut run dev:services:reset` before switching MySQL image families, for example between MySQL 8 and MySQL 5.7, because MySQL data directories are not downgrade-compatible across major versions.
9697

9798
Current hard-coded service assumptions:
9899

README.zh-CN.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,16 @@
2121
- 深度框架定制
2222
- 丰富的[插件](https://github.com/search?q=topic%3Aegg-plugin&type=Repositories)
2323

24-
> 支持 Node.js >= 20.19.0 及以上版本[默认支持 `require(esm)`](https://nodejs.org/en/blog/release/v20.19.0)
24+
> 支持 Node.js >= 22.18.0 及以上版本。
2525
2626
## 快速开始
2727

2828
```bash
29+
corepack enable utoo
2930
mkdir showcase && cd showcase
30-
pnpm create egg@beta
31-
pnpm install
32-
pnpm run dev
31+
ut create egg@beta
32+
ut install
33+
ut run dev
3334

3435
open http://localhost:7001
3536
```

packages/egg/README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,17 @@
2121
Follow the commands listed below.
2222

2323
```bash
24+
$ corepack enable utoo
2425
$ mkdir showcase && cd showcase
25-
$ npm init egg --type=simple # Optionally pnpm create egg --type=simple
26-
$ pnpm install
27-
$ pnpm run dev
26+
$ ut create egg@beta
27+
# Or with npm:
28+
$ npm init egg --type=simple
29+
$ ut install
30+
$ ut run dev
2831
$ open http://localhost:7001
2932
```
3033

31-
> Node.js >= 20.19.0 required, [supports `require(esm)` by default](https://nodejs.org/en/blog/release/v20.19.0).
34+
> Node.js >= 22.18.0 required.
3235
3336
## Documentations
3437

plugins/redis/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,10 +265,10 @@ Run docker compose to start test redis service
265265
docker compose -f docker-compose.yml up -d
266266
```
267267
268-
Run the unit tests
268+
Run the plugin unit tests from the monorepo root
269269
270270
```bash
271-
pnpm test
271+
ut execute vitest run plugins/redis/test/redis.test.ts --bail 1 --retry 2 --testTimeout 20000 --hookTimeout 20000
272272
```
273273
274274
Stop test redis service

scripts/dev-services.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ async function assertPortAvailable(service, port, containerPort, running) {
131131
throw new Error(
132132
[
133133
`${service} is already running for this compose project on ${current}, but this run requested 127.0.0.1:${port}.`,
134-
'Re-run with the same EGG_DEV_SERVICES_* port override, or use `utoo run dev:services:reset` before changing ports.',
134+
'Re-run with the same EGG_DEV_SERVICES_* port override, or use `ut run dev:services:reset` before changing ports.',
135135
].join('\n'),
136136
);
137137
}
@@ -195,7 +195,7 @@ async function start() {
195195
[
196196
message,
197197
'The compose stack is still running so Docker health status and logs can be inspected.',
198-
'After fixing the issue, run `utoo run dev:services:reset` to clean up before starting again.',
198+
'After fixing the issue, run `ut run dev:services:reset` to clean up before starting again.',
199199
].join('\n'),
200200
{ cause: err },
201201
);

0 commit comments

Comments
 (0)