-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
chore(repo): switch package manager references from pnpm to utoo #5959
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
Changes from 14 commits
ab76d57
26b1a40
8a96e3e
a0c2ddf
585d981
80b413b
f88b87b
2a4c085
38ee2ad
e38249c
5f8b4c3
842a307
c522197
5c856b3
2a5ba86
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,30 +6,30 @@ | |
|
|
||
| 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. | ||
|
|
||
| This is a **pnpm monorepo** with multiple packages using pnpm workspaces and catalog mode for centralized dependency management. | ||
| This is a **utoo monorepo** with multiple packages using utoo workspaces and catalog mode for centralized dependency management. | ||
|
|
||
| ## Prerequisites and Environment Setup | ||
|
|
||
| - **Node.js >= 20.19.0 required** - This is a hard requirement | ||
| - Enable pnpm first: `corepack enable pnpm` (installs pnpm v10.16.0) | ||
| - **Node.js >= 22.18.0 required** - This is a hard requirement | ||
| - Enable utoo first: `corepack enable utoo` (installs utoo v1.0.28) | ||
| - **NEVER CANCEL** any build or test commands - they can take several minutes to complete | ||
|
|
||
| ## Bootstrap and Build Process | ||
|
|
||
| **Always run these commands in sequence after fresh clone:** | ||
|
|
||
| ```bash | ||
| # 1. Enable pnpm (required first) | ||
| corepack enable pnpm | ||
| # 1. Enable utoo (required first) | ||
| corepack enable utoo | ||
|
|
||
| # 2. Install all dependencies - takes ~63 seconds. NEVER CANCEL. Set timeout to 120+ seconds. | ||
| pnpm install | ||
| ut install | ||
|
|
||
| # 3. Build all packages - takes ~14 seconds. NEVER CANCEL. Set timeout to 60+ seconds. | ||
| pnpm run build | ||
| ut run build | ||
|
|
||
| # 4. Run linting (optional but recommended) - takes ~2 seconds | ||
| pnpm run lint | ||
| ut run lint | ||
| ``` | ||
|
|
||
| ## Monorepo Structure | ||
|
|
@@ -48,51 +48,51 @@ pnpm run lint | |
| ### Supporting Directories | ||
|
|
||
| - **`examples/`** - Two example apps: `helloworld-commonjs` and `helloworld-typescript` (currently have runtime issues) | ||
| - **`site/`** - Documentation website built with Dumi | ||
| - **`site/`** - Documentation website built with VitePress | ||
|
|
||
| ## Essential Commands and Timing | ||
|
|
||
| ### Build Commands | ||
|
|
||
| - `pnpm run build` - **Build all packages (~14 seconds). NEVER CANCEL. Set timeout to 60+ seconds.** | ||
| - `pnpm run clean` - Clean all dist directories | ||
| - `ut run build` - **Build all packages (~14 seconds). NEVER CANCEL. Set timeout to 60+ seconds.** | ||
| - `ut run clean-dist` - Clean all dist directories | ||
|
|
||
| ### Testing Commands | ||
|
|
||
| - `pnpm run test` - **Run all tests (~2 minutes). NEVER CANCEL. Set timeout to 180+ seconds.** | ||
| - `pnpm run test:cov` - **Run tests with coverage (~2 minutes). NEVER CANCEL. Set timeout to 180+ seconds.** | ||
| - `pnpm run ci` - **Run test coverage + build (~2.1 minutes). NEVER CANCEL. Set timeout to 180+ seconds.** | ||
| - `ut run test` - **Run all tests (~2 minutes). NEVER CANCEL. Set timeout to 180+ seconds.** | ||
| - `ut run test:cov` - **Run tests with coverage (~2 minutes). NEVER CANCEL. Set timeout to 180+ seconds.** | ||
| - `ut run ci` - **Run tests with coverage (~2 minutes). NEVER CANCEL. Set timeout to 180+ seconds.** | ||
|
|
||
| ### Linting Commands | ||
|
|
||
| - `pnpm run lint` - Run oxlint across all packages (~2 seconds) | ||
| - `ut run lint` - Run oxlint across all packages (~2 seconds) | ||
|
|
||
| ### Documentation Commands | ||
|
|
||
| - `pnpm run site:dev` - Start documentation dev server at http://localhost:8000 | ||
| - `cd site && pnpm run build:skip` - **Build documentation site (~24 seconds). NEVER CANCEL. Set timeout to 60+ seconds.** | ||
| - `ut run site:dev` - Start documentation dev server (defaults to VitePress port 5173) | ||
|
Comment on lines
70
to
+72
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in e38249c — site/ description now correctly says VitePress (matches |
||
| - `ut run site:build` - **Build documentation site (~24 seconds). NEVER CANCEL. Set timeout to 60+ seconds.** | ||
|
|
||
| ### Example Applications (Currently Not Working) | ||
|
|
||
| - `pnpm run example:commonjs` - Start CommonJS example (has runtime issues) | ||
| - `pnpm run example:typescript` - Start TypeScript example (has runtime issues) | ||
| - `ut run example:dev:commonjs` - Start CommonJS example (has runtime issues) | ||
| - `ut run example:dev:typescript` - Start TypeScript example (has runtime issues) | ||
|
|
||
| ## Package-Specific Commands | ||
|
|
||
| Run commands for specific packages using `pnpm --filter=<package>`: | ||
| Run commands for specific packages using `ut --filter=<package>`: | ||
|
|
||
| ```bash | ||
| # Examples | ||
| pnpm --filter=egg run test | ||
| pnpm --filter=@eggjs/core run build | ||
| pnpm --filter=site run dev | ||
| ut --filter=egg run test | ||
| ut --filter=@eggjs/core run build | ||
| ut --filter=site run dev | ||
| ``` | ||
|
|
||
| ## Development Workflow | ||
|
|
||
| ### 1. Making Changes | ||
|
|
||
| - Always build packages first: `pnpm run build` | ||
| - Always build packages first: `ut run build` | ||
| - Work primarily in `packages/egg/src/` for core framework features | ||
| - Use TypeScript throughout - all packages are TypeScript-based | ||
| - Follow the existing directory conventions in `packages/egg/src/`: | ||
|
|
@@ -108,16 +108,16 @@ pnpm --filter=site run dev | |
|
|
||
| ```bash | ||
| # 1. Build all packages (required) | ||
| pnpm run build | ||
| ut run build | ||
|
|
||
| # 2. Run linting | ||
| pnpm run lint | ||
| ut run lint | ||
|
|
||
| # 3. Run tests (some failures are expected in fresh environment) | ||
| pnpm run test | ||
| ut run test | ||
|
|
||
| # 4. Test documentation site | ||
| pnpm run site:dev | ||
| ut run site:dev | ||
| ``` | ||
|
|
||
| ### 3. Testing Strategy | ||
|
|
@@ -162,7 +162,7 @@ pnpm run site:dev | |
| - **All sub-project tsconfig.json files MUST extend from root:** `"extends": "../../tsconfig.json"` | ||
| - Root tsconfig.json includes all packages in `references` array | ||
|
|
||
| ## pnpm Workspace & Catalog Dependencies | ||
| ## utoo Workspace & Catalog Dependencies | ||
|
|
||
| - Dependencies defined in `pnpm-workspace.yaml` catalog section | ||
| - Reference catalog entries: `"package-name": "catalog:"` | ||
|
|
@@ -179,7 +179,7 @@ pnpm run site:dev | |
|
|
||
| ### Build Issues | ||
|
|
||
| - Always run `pnpm run build` after making changes | ||
| - Always run `ut run build` after making changes | ||
| - TypeScript compilation errors will show clearly | ||
| - Build warnings are generally acceptable | ||
|
|
||
|
|
@@ -217,10 +217,10 @@ pnpm run site:dev | |
|
|
||
| After making changes, always verify: | ||
|
|
||
| 1. **Build Success**: `pnpm run build` completes without errors | ||
| 2. **Linting Passes**: `pnpm run lint` shows no new errors | ||
| 3. **Documentation Loads**: `pnpm run site:dev` starts successfully and site loads at http://localhost:8000 | ||
| 4. **Tests Run**: `pnpm run test` executes (some failures expected, focus on your changes) | ||
| 1. **Build Success**: `ut run build` completes without errors | ||
| 2. **Linting Passes**: `ut run lint` shows no new errors | ||
| 3. **Documentation Loads**: `ut run site:dev` starts successfully and the printed VitePress URL responds | ||
| 4. **Tests Run**: `ut run test` executes (some failures expected, focus on your changes) | ||
|
|
||
| **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. | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,7 @@ If another agent-specific file exists, it should import or defer to this file fo | |
|
|
||
| ## Project Map | ||
|
|
||
| Egg is maintained as a pnpm monorepo. | ||
| Egg is maintained as a utoo monorepo. | ||
|
|
||
| - `packages/` contains core framework packages and shared internals. | ||
| - `plugins/` contains optional Egg integrations. | ||
|
|
@@ -18,12 +18,13 @@ Egg is maintained as a pnpm monorepo. | |
|
|
||
| ## Core Commands | ||
|
|
||
| - `pnpm install` hydrates the workspace. | ||
| - `pnpm run build` builds all packages. | ||
| - `pnpm run test` runs the main test suite. | ||
| - `pnpm run lint` runs linting. | ||
| - `pnpm run typecheck` runs TypeScript checking. | ||
| - use filtered commands for focused work, for example `pnpm --filter=egg run test` or `pnpm --filter=site run dev`. | ||
| - `corepack enable utoo` enables the pinned utoo version on a clean machine. | ||
| - `ut install` hydrates the workspace. | ||
| - `ut run build` builds all packages. | ||
| - `ut run test` runs the main test suite. | ||
| - `ut run lint` runs linting. | ||
| - `ut run typecheck` runs TypeScript checking. | ||
| - use filtered commands for focused work, for example `ut --filter=egg run test` or `ut --filter=site run dev`. | ||
|
Comment on lines
+21
to
+27
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Document the required validation sequence in the canonical command list.
As per coding guidelines "Run validation steps in sequence after making changes: (1) build all packages with 🧰 Tools🪛 LanguageTool[style] ~26-~26: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym. (ENGLISH_WORD_REPEAT_BEGINNING_RULE) 🤖 Prompt for AI Agents
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Skipping for this PR — adding a mandated
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| ### Local CI | ||
|
|
||
|
|
@@ -65,7 +66,7 @@ Then re-run tests. | |
|
|
||
| - review `SECURITY.md` before handling vulnerability-related work | ||
| - do not commit secrets, credentials, or local-only URLs | ||
| - keep local Node.js and pnpm versions aligned with the repository configuration | ||
| - keep local Node.js and utoo versions aligned with the repository configuration | ||
|
|
||
| ## Shared Knowledge Workflow | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.