Skip to content

chore(repo): switch package manager references from pnpm to utoo#5961

Open
killagu wants to merge 14 commits into
eggjs:nextfrom
killagu:chore/migrate-to-utoo
Open

chore(repo): switch package manager references from pnpm to utoo#5961
killagu wants to merge 14 commits into
eggjs:nextfrom
killagu:chore/migrate-to-utoo

Conversation

@killagu
Copy link
Copy Markdown
Contributor

@killagu killagu commented Jun 4, 2026

Summary

  • Replace pnpm with utoo across docs, top-level scripts, and CI workflows so the repo guidance matches the package manager the project actually uses.
  • Update packageManager in package.json to utoo@1.0.28; switch scripts/{publish,version,utils}.js to invoke utoo (and align their comments).
  • In .github/workflows/release.yml and .github/workflows/e2e-test.yml, swap pnpm/action-setup for utooland/setup-utoo and call ut / utoo (mirroring the pattern already used by ci.yml).
  • Preserve filenames (pnpm-lock.yaml, pnpm-workspace.yaml) and the CLI argument value in ut install --from pnpm — those reference real artifacts on disk and a flag value, not tool invocations.
  • Out of scope (intentionally untouched): historical CHANGELOG.md entries, source code that detects pnpm node_modules layouts (packages/core/src/loader/*), and the plugin-pnpm* test fixtures.

Split out of #5959 — this PR contains only the pnpm→utoo migration. The CI test-sharding optimization remains on #5959 and will be rebased onto next once this lands.

Test plan

  • CI green on next for typecheck, build, lint, format check, and tests.
  • release.yml (workflow_dispatch dry-run) completes through install + build using ut install --from pnpm and ut run build.
  • e2e-test.yml succeeds end-to-end; in particular confirm PUBLINT_PACK: utoo is accepted by publint — if not, revert that env var to npm and keep the rest.

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • Chores

    • Migrated monorepo tooling from pnpm to utoo; requires Node.js >= 22.18.0.
    • Updated all development commands and workflows to use ut commands instead of pnpm.
    • Added automatic retry logic to dependency installation in CI workflows.
  • Documentation

    • Updated setup and development instructions across all README files.
    • Revised site documentation build tooling references.

killagu and others added 14 commits June 2, 2026 19:33
Replace `pnpm` with `utoo` across docs, top-level scripts, and CI
workflows. Lockfile / workspace filenames (`pnpm-lock.yaml`,
`pnpm-workspace.yaml`) and the `ut install --from pnpm` flag value
are preserved because they refer to real artifacts on disk and to a
CLI argument, not to a tool invocation.

- AGENTS.md, README.md/README.zh-CN.md, packages/egg/README.md,
  tools/create-egg/README.md, plugins/redis/README.md,
  wiki/concepts/repository-map.md, tegg/CLAUDE.md,
  .github/copilot-instructions.md: rewrite command snippets and prose.
- package.json: bump `packageManager` to `utoo@1.0.28`.
- scripts/{publish,version,utils}.js: invoke `utoo` instead of
  `pnpm` and update comments.
- .github/workflows/release.yml, .github/workflows/e2e-test.yml:
  swap pnpm/action-setup for utooland/setup-utoo and call `ut` / `utoo`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…sions

- E2E `Build all packages` was failing because `PUBLINT_PACK: utoo`
  is not in publint's supported set (`npm | pnpm | yarn | bun`).
  Falling back to the default (`npm`) so publint's per-package pack
  succeeds again, matching the main CI environment.
- Align `.github/copilot-instructions.md` Node and utoo versions with
  the values declared in `package.json` (`engines.node >=22.18.0`,
  `packageManager: utoo@1.0.28`).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- scripts/publish.js: invoke `utoo publish` from each package's own
  directory so utoo's supported flag set works. Drop pnpm-only flags
  (`--filter`, `--no-git-checks`); keep the npm-standard `--access`
  and `--provenance` flags that utoo forwards to npm.
- AGENTS.md: prepend `corepack enable utoo` to the canonical commands
  so a clean machine boots into the pinned utoo version.
- scripts/version.js: print the `ut run version:<type>` alias used by
  the rest of the repo (workflows + package.json scripts).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
utoo doesn't implement pnpm's recursive `-r pack`, so the E2E
"Pack packages into tgz" step was failing with
`error: unexpected argument '-r' found`. Replace it with a small
node script that reuses the publish-script's package discovery and
runs `npm pack --pack-destination <repoRoot>` per publishable
package, matching the tgz layout `ecosystem-ci/patch-project.ts`
expects (repo-root-relative file:// overrides).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
CodeRabbit / Copilot caught that the docs reference \`utoo run …\`
while package.json scripts and CI workflows all use the \`ut\` alias,
and some referenced root scripts (\`clean\`, \`build:skip\`,
\`example:commonjs\`/\`example:typescript\`) don't exist.

- Rewrite \`utoo install/run/create/test/pack/publish/--filter/-r\` to
  the matching \`ut …\` form in README.md, README.zh-CN.md,
  packages/egg/README.md, tools/create-egg/README.md,
  plugins/redis/README.md, tegg/CLAUDE.md, AGENTS.md,
  .github/copilot-instructions.md, scripts/publish.js, and
  scripts/dev-services.js. Keep the \`utoo\` package name (corepack,
  \`packageManager\`, prose) intact.
- Fix script name drift: \`ut run clean\` → \`ut run clean-dist\`,
  \`ut run build:skip\` → \`ut run build\`,
  \`ut run example:{commonjs,typescript}\` → \`ut run example:dev:{commonjs,typescript}\`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
`ut pm-pack` does not yet resolve `workspace:` / `catalog:` protocols
inside the packed manifests, so downstream `npm install` in the
ecosystem-ci projects fails with `EUNSUPPORTEDPROTOCOL`. `npm pack`
has the same limitation, which is why the previous attempt with
scripts/pack-all.js also broke.

Keep pnpm available just for the pack step and drop the unused
scripts/pack-all.js. The rest of the workflow stays on utoo.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Without an explicit \`version\` input, \`pnpm/action-setup\` reads
\`packageManager\` from package.json — which now declares \`utoo@1.0.28\`,
not pnpm — and aborts with \`Invalid packageManager field in
package.json\`. Pin to \`10\` (matches the prior \`pnpm@10.28.0\` we used)
so the pack step bootstraps regardless of the \`packageManager\` value.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- .github/copilot-instructions.md: `ut run ci` actually runs tests
  with coverage only (no build); rewrite description accordingly.
  Site dev server uses VitePress' default port, not :8000; drop the
  hard-coded URL. Replace the `cd site && ut run build` invocation
  with the root `ut run site:build` script.
- scripts/utils.js: clarify the workspace-file comment — utoo reads
  `pnpm-workspace.yaml` as-is, so naming the file matters.
- README.md / README.zh-CN.md / packages/egg/README.md: prepend
  `corepack enable utoo` to the quickstart so clean machines get the
  pinned utoo before `ut create`/`ut install`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
pnpm sees \`packageManager: utoo@1.0.28\` in package.json and refuses
to run with \`This project is configured to use utoo\`. Set
\`PNPM_PACKAGE_MANAGER_STRICT=false\` for just the \`pnpm -r pack\` step
so the workaround until utoo's own pack supports
workspace:/catalog: resolution doesn't get blocked.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- tegg/CLAUDE.md: switch the test command to the script form
  (\`ut run test\`) so it matches the root \`test\` script and the rest
  of the repo guidance.
- .github/copilot-instructions.md: site/ is on VitePress (per
  site/package.json), not Dumi.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
\`pnpm/action-setup\` exports PNPM_HOME, which makes \`ut install
--from pnpm\` read pnpm's config and crash with exit code 141 (SIGPIPE)
right after the workspace summary is printed. Moving the pnpm setup
step until after \`ut install\` / \`ut run build\` keeps PNPM_HOME out of
utoo's environment, while still having pnpm available for the pack
step that follows.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
\`ut install --from pnpm\` intermittently exits with 141 (SIGPIPE)
right after printing the workspace summary — observed on typecheck
and on cnpmcore E2E in the same workflow run while other ubuntu jobs
(\`Test bin\`, \`Test scripts\`, \`Test\`) using the identical command
succeed. Wrap every install invocation in a 3-attempt retry with a
5s / 10s backoff so the workflow absorbs the flake while the upstream
utoo bug is investigated.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The previous env var \`PNPM_PACKAGE_MANAGER_STRICT\` is not recognized
by pnpm, so pnpm kept refusing the pack step with
\`This project is configured to use utoo\`. The actual setting is
\`package-manager-strict\`, exposed via \`NPM_CONFIG_PACKAGE_MANAGER_STRICT\`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ps resolve

\`pnpm -r pack\` needs pnpm's own \`node_modules\` symlink layout to
resolve \`workspace:*\` versions; otherwise it errors with
\`ERR_PNPM_CANNOT_RESOLVE_WORKSPACE_PROTOCOL\`. Run
\`pnpm install --no-frozen-lockfile --ignore-scripts\` first — the
packages are already in the global utoo store, so this is cheap.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 4, 2026 06:22
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 4, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

This PR migrates the entire egg.js monorepo from pnpm to utoo as the primary package manager. Changes span CI/CD workflows, root configuration, user documentation, package-specific guides, and internal build/publish scripts, with consistent command replacements throughout.

Changes

Monorepo Migration to utoo

Layer / File(s) Summary
CI/CD workflow migration
.github/workflows/ci.yml, .github/workflows/e2e-test.yml, .github/workflows/release.yml
All workflows now install dependencies via ut install --from pnpm with retry logic on transient failures. Build commands changed to ut run build. E2E workflow also updates packing pre-steps to support the new packageManager. Release workflow replaces pnpm setup action with utoo setup.
Root configuration and monorepo setup documentation
package.json, .github/copilot-instructions.md
Root packageManager field updated to utoo@1.0.28. Copilot instructions rewritten for Node.js >= 22.18.0, corepack utoo enablement, and all monorepo commands now use ut run ... syntax. VitePress replaces Dumi for documentation site.
User-facing repository documentation
README.md, README.zh-CN.md, AGENTS.md, wiki/concepts/repository-map.md
Quickstart and development workflows updated to use corepack enable utoo and ut commands. Contributor guidance, monorepo descriptions, and development command examples consistently replace pnpm with ut.
Package-specific documentation
packages/egg/README.md, plugins/redis/README.md, tools/create-egg/README.md
Quickstart instructions and test/scaffolding commands in individual package docs updated from pnpm to ut equivalents.
Build, publish, and version scripts
tegg/CLAUDE.md, scripts/publish.js, scripts/version.js, scripts/dev-services.js, scripts/utils.js
Internal developer guide rewritten for utoo workspaces and commands. Publish script refactored to run ut publish per package instead of workspace filtering. Version and dev-services scripts updated with ut command references.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • eggjs/egg#5509: Both PRs update repository contributor guidance in AGENTS.md (retrieved PR initially adds pnpm-based monorepo instructions, while main PR rewrites those same guidelines to use utoo/ut instead).
  • eggjs/egg#5830: Both PRs modify the CI/E2E workflows to migrate tooling from pnpm to utoo/ut (notably .github/workflows/ci.yml and install/build command wiring), so the changes overlap at the same workflow-step/code locations.
  • eggjs/egg#5739: The main PR and #5739 both modify .github/workflows/e2e-test.yml—main PR rewrites its install/build/pack steps to use utoo/ut, while #5739 introduces/adds an E2E test workflow with PNPM-oriented steps—so they are directly related at the workflow level.

Suggested labels

chore: gitAction

Suggested reviewers

  • fengmk2
  • jerryliang64

🐰 From the Burrow

Hop, hop, hooray! The monorepo hops to utoo
From pnpm's nest to swifter skies so new.
Workflows flutter, docs refresh with speed,
A package manager switch is all we need! 📦✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the primary change: migrating package manager references from pnpm to utoo across documentation, workflows, and scripts.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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
Copy Markdown
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 migrates the repository's package manager from pnpm to utoo (v1.0.28). It updates the packageManager configuration in package.json, adapts the helper scripts (such as publish.js and dev-services.js) to run ut commands, and updates all documentation files to reflect the new command syntax. The review feedback recommends changing 'ut test' to 'ut run test' in plugins/redis/README.md to maintain consistency with the rest of the documentation.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread plugins/redis/README.md

```bash
pnpm test
ut test
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To maintain consistency with the rest of the repository's documentation (such as README.md, AGENTS.md, and tegg/CLAUDE.md), it is recommended to use ut run test instead of ut test.

Suggested change
ut test
ut run test

Copy link
Copy Markdown
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 updates the repository’s documented and automated package-manager workflows to use utoo (ut) instead of pnpm, aligning docs, scripts, and GitHub Actions with the repo’s current package manager while intentionally keeping pnpm-specific artifacts (e.g., pnpm-workspace.yaml, pnpm-lock.yaml, and ut install --from pnpm).

Changes:

  • Update user-facing docs (READMEs, wiki, agent docs) to reference corepack enable utoo, ut install, and ut run ....
  • Switch release/e2e/ci workflows to set up utoo and run installs/builds via ut (keeping pnpm only where required for pnpm -r pack in e2e).
  • Update repo tooling scripts (scripts/*) and root packageManager to utoo@1.0.28.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
wiki/concepts/repository-map.md Updates repo description to “utoo monorepo”.
tools/create-egg/README.md Updates create-egg usage examples to ut create.
tegg/CLAUDE.md Updates tegg contributor commands from pnpm to ut.
scripts/version.js Updates dry-run instructions to use ut run version:*.
scripts/utils.js Clarifies workspace parsing comes from pnpm-workspace.yaml while using utoo.
scripts/publish.js Switches publish implementation to invoke ut publish per package.
scripts/dev-services.js Updates user guidance strings to ut run dev:services:*.
README.zh-CN.md Updates quickstart to corepack enable utoo + ut commands.
README.md Updates quickstart and monorepo commands to ut/utoo terminology.
plugins/redis/README.md Updates local dev test command (but currently to a non-working command).
packages/egg/README.md Updates package quickstart instructions to ut commands.
package.json Sets "packageManager": "utoo@1.0.28".
AGENTS.md Updates agent guidance to utoo (ut) commands and adds corepack enable utoo.
.github/workflows/release.yml Replaces pnpm setup/install/build with utoo/ut.
.github/workflows/e2e-test.yml Uses utoo for install/build; keeps pnpm only for packing step with documented rationale.
.github/workflows/ci.yml Adds retry wrapper to ut install --from pnpm and standardizes ut usage.
.github/copilot-instructions.md Updates Copilot guidance to utoo/ut and reflects current Node/site tooling.

Comment on lines 74 to +75
- name: Install dependencies
run: pnpm install --no-frozen-lockfile
run: ut install --from pnpm
Comment thread plugins/redis/README.md
Comment on lines 268 to 272
Run the unit tests

```bash
pnpm test
ut test
```
Copy link
Copy Markdown
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: 1

🧹 Nitpick comments (1)
packages/egg/README.md (1)

26-26: ⚡ Quick win

Consider making utoo the primary scaffolding option.

This line keeps npm init egg as the primary command with ut create egg only as an optional comment. This is inconsistent with the root README.md (line 32) which fully switched to ut create egg@beta, and with the PR's stated objective to replace pnpm references with utoo.

For consistency with the migration, consider either:

  1. Making ut create egg the primary command (recommended), or
  2. Showing both options more explicitly without designating npm as primary.
📝 Proposed alignment with root README
-$ npm init egg --type=simple # Optionally ut create egg --type=simple
+$ ut create egg --type=simple

Or, to show both options explicitly:

-$ npm init egg --type=simple # Optionally ut create egg --type=simple
+$ npm init egg --type=simple
+# Or with utoo:
+$ ut create egg --type=simple
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/egg/README.md` at line 26, Update the example command so it uses the
new utoo scaffolding as the primary option: replace or re-order the existing
"npm init egg --type=simple" line to show "ut create egg@beta" (or "ut create
egg" if not using `@beta`) as the main command and present "npm init egg
--type=simple" as the secondary/optional alternative; ensure the README text
mirrors the root README wording and includes both command strings ("ut create
egg@beta"/"ut create egg" and "npm init egg --type=simple") explicitly if you
prefer showing both options.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/release.yml:
- Line 75: The workflow step currently calls the single-attempt command "ut
install --from pnpm"; make it retry-safe to match other workflows by replacing
that invocation with the retry wrapper used elsewhere (e.g., "ut retry install
--from pnpm" or the project’s standard retry helper), so transient failures are
retried automatically; update the step that runs "ut install --from pnpm" to use
the retry variant.

---

Nitpick comments:
In `@packages/egg/README.md`:
- Line 26: Update the example command so it uses the new utoo scaffolding as the
primary option: replace or re-order the existing "npm init egg --type=simple"
line to show "ut create egg@beta" (or "ut create egg" if not using `@beta`) as the
main command and present "npm init egg --type=simple" as the secondary/optional
alternative; ensure the README text mirrors the root README wording and includes
both command strings ("ut create egg@beta"/"ut create egg" and "npm init egg
--type=simple") explicitly if you prefer showing both options.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d44340e8-7712-4d63-9992-d0545e73b96b

📥 Commits

Reviewing files that changed from the base of the PR and between 7e6be0e and 5c856b3.

📒 Files selected for processing (17)
  • .github/copilot-instructions.md
  • .github/workflows/ci.yml
  • .github/workflows/e2e-test.yml
  • .github/workflows/release.yml
  • AGENTS.md
  • README.md
  • README.zh-CN.md
  • package.json
  • packages/egg/README.md
  • plugins/redis/README.md
  • scripts/dev-services.js
  • scripts/publish.js
  • scripts/utils.js
  • scripts/version.js
  • tegg/CLAUDE.md
  • tools/create-egg/README.md
  • wiki/concepts/repository-map.md


- name: Install dependencies
run: pnpm install --no-frozen-lockfile
run: ut install --from pnpm
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Add retry parity for ut install in release workflow.

Line 75 is a single-attempt install, while the same command was made retry-safe in other workflows for transient failures. This can cause avoidable manual release failures.

Suggested fix
-      - name: Install dependencies
-        run: ut install --from pnpm
+      - name: Install dependencies
+        # Retry to absorb transient `exit 141` (SIGPIPE) from `ut install`.
+        run: ut install --from pnpm || (sleep 5 && ut install --from pnpm) || (sleep 10 && ut install --from pnpm)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/release.yml at line 75, The workflow step currently calls
the single-attempt command "ut install --from pnpm"; make it retry-safe to match
other workflows by replacing that invocation with the retry wrapper used
elsewhere (e.g., "ut retry install --from pnpm" or the project’s standard retry
helper), so transient failures are retried automatically; update the step that
runs "ut install --from pnpm" to use the retry variant.

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.

2 participants