chore: migrate to utoo CI and fix circular dependencies#5830
chore: migrate to utoo CI and fix circular dependencies#5830
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refactors the project's dependency and workspace management. It transitions from using Highlights
Changelog
Ignored Files
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
All alerts resolved. Learn more about Socket for GitHub. This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. |
There was a problem hiding this comment.
Code Review
This pull request refactors the project's dependency and workspace management by migrating configuration from pnpm-workspace.yaml to a new .utoo.toml file and package.json. My review focuses on the maintainability of the new configuration and the potential impact on the developer workflow. I've suggested sorting the new dependency catalog for better readability and pointed out a potential issue with the removal of the packageManager enforcement that could be addressed with documentation.
| "engines": { | ||
| "node": ">=22.18.0" | ||
| }, | ||
| "packageManager": "pnpm@10.28.0" |
There was a problem hiding this comment.
Removing the packageManager field disables the enforcement of a specific pnpm version for this project. However, the devDependencies still use the pnpm-specific catalog: protocol. This could lead to confusion and issues for developers who might try to use other package managers like npm or yarn, or different versions of pnpm. If the project is intended to be managed exclusively by the utoo tool, it would be helpful to document this requirement in the CONTRIBUTING.md or README.md to ensure a smooth developer experience.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## next #5830 +/- ##
==========================================
+ Coverage 85.28% 85.96% +0.67%
==========================================
Files 666 9 -657
Lines 13247 57 -13190
Branches 1538 11 -1527
==========================================
- Hits 11298 49 -11249
+ Misses 1818 7 -1811
+ Partials 131 1 -130 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- Replace pnpm/action-setup with setup-utoo in all CI jobs - Use ut install --from pnpm for dependency installation - Replace pnpm run/filter commands with ut run equivalents - Use --workspaces --if-present for topological workspace execution - Use --workspace <pkg> for targeted package execution - Use -- passthrough for tsdown args (ut run build -- --workspace) - Remove pnpm dedupe --check step (no longer needed) - Fix tools/scripts ci script to use ut run cov
ut does not install optional peer deps automatically, so unplugin-unused (required by tsdown's unused.level feature) must be declared explicitly. Also includes workspaces/overrides fields auto-resolved from pnpm config by ut install.
publint auto-detects pnpm via pnpm-lock.yaml and calls pnpm pack, but pnpm is not on PATH when using setup-utoo. Set pack: 'npm' explicitly so pnpm binary is not required for publint checks.
- Replace pnpm/action-setup with setup-utoo - Use ut install --from pnpm for dependency installation - Use ut run build for building all packages - Replace pnpm -r pack with npm pack --workspaces - Sync pnpm-lock.yaml to include unplugin-unused
npm pack --workspaces fails on packages without version (e.g. site). Also, pnpm -r pack places tarballs in workspace root, while npm pack places them in each package's own directory. pack-all.mjs replicates pnpm -r pack behavior: - reads workspace patterns from pnpm-workspace.yaml - skips private/unnamed/unversioned packages - packs each with --pack-destination to workspace root
oxfmt reordered imports and placed execSync import inside the JSDoc comment block, making it unavailable at runtime. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
npm does not understand catalog: protocol; ut install handles it correctly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…pack npm pack does not resolve pnpm catalog: or workspace: protocol entries, leaving them raw in the tgz package.json. Downstream npm install then fails with EUNSUPPORTEDPROTOCOL. Pre-resolve these to actual semver versions before packing, then restore the originals. Also revert downstream test commands back to npm install/run since cnpmcore/examples use plain semver and npm can install the cleaned tgzs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
npm pack does not apply publishConfig.exports automatically. Packages use devExports (src/) in exports and dist/ in publishConfig.exports. Without merging publishConfig first, the tgz contains src/ exports and downstream npm install fails to find the source files. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Use import.meta.resolve(specifier, parentUrl) with each caller-provided path to avoid relying on package manager hoisting behavior. Falls back to resolving from the current module context only after all provided paths have been exhausted. Also remove stale @ts-expect-error comments in tegg mcp-proxy and controller plugins where content-type and koa-compose now ship types. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…in pack-all.mjs Named catalogs (pnpm catalogs.<name>) were being looked up in the default catalog instead of the named catalog section. This caused @eggjs/router to be packed with path-to-regexp ^6.3.0 instead of ^1.9.0, breaking the Layer.js constructor which uses the old default export API. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…atalog to ^1.57.0 oxlint 1.57.0 (installed by ut) flags un-exported interfaces inside declare module blocks as no-unused-vars. Add export keyword to interface Application in tegg/plugin/tegg/src/types.ts to fix the typecheck CI failure. Also bump oxlint catalog from ^1.32.0 to ^1.57.0 so pnpm and ut install the same version, preventing future version drift. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…0.21 utoo v1.0.21 was compiled against OpenSSL 1.1 and fails on Ubuntu 24.04 (libssl.so.1.1 not available). Pin to v1.0.20 which works correctly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1. cluster options.test.ts: accept root node_modules/egg as valid framework path under flat hoisting (ut install puts workspace packages at root node_modules instead of package-nested node_modules) 2. utils/import.ts: after import.meta.resolve() returns a path without extension (ESM strict mode doesn't auto-add .js for legacy packages without exports field), fall back to tryToResolveFromFile() to find register.js etc. Fixes ImportResolveError for tsconfig-paths/register 3. ci.yml: remove leading ./ from --workspace ./tools/scripts (ut does not accept ./ prefix in workspace paths) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…wn-context
On Node.js 24, import.meta.resolve('pkg/subpath') throws for CJS packages
without an exports field when the subpath file has no explicit extension
(e.g. tsconfig-paths/register resolves to .../register, not .../register.js).
Node.js 25+ returns the extensionless path; 24 throws. Add require.resolve
as a fallback between the per-path attempts and the own-context fallback.
require.resolve handles CJS packages correctly (auto-adds extensions).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…utput ut run sets FORCE_COLOR which causes cluster master/agent/worker child processes to emit ANSI color codes. Test assertions use regex like /\[master\] agent_worker#1:\d+ started/ which fail when ANSI escape sequences are interspersed (e.g. [master]\x1b[31m agent_worker). Setting NO_COLOR=1 restores the same colorless output as pnpm used. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ut run sets FORCE_COLOR=1 which propagates to forked cluster processes and causes egg-logger to emit ANSI codes that break test regex assertions. ClusterApplication now explicitly sets FORCE_COLOR=0 when NO_COLOR is present, keeping stdout free of escape sequences. Also switch test-egg-bin workspace from path to package name (@eggjs/bin) so ut can find it on Windows (path-based lookup fails on that platform). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Change MockClusterOptions.opt type from object to ForkOptions so the env property is recognized when overriding FORCE_COLOR. - Lift nested describe() blocks out of it() in tegg/plugin/orm test to comply with Vitest 4 which forbids suite functions inside test functions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ForkOptions was too strict — coffee passes non-standard properties like require. Keep opt as object and cast to Record<string, any> when accessing env. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… truncation The outer afterEach truncates all tables after each it(). Using beforeAll only created data once, so the second raw query test found an empty table. Switch to beforeEach so each test gets fresh data. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
These tests were previously unreachable (nested inside an it() block). The apple/banana databases are created empty by prepare.js — tables only exist in the test database. Skip until prepare.js is updated. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ut install resolves a slightly newer typebox version that exports EvaluateUnionFast, IsTemplateLiteralFinite, and IsTemplateLiteralPattern. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add TemplateLiteralDecodeUnsafe, remove TemplateLiteralFinite, and add _Function_/_Object_ exports at the end. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ut flat-hoisting does not link workspace packages under tegg/ into root node_modules, so Node.js ESM resolver cannot find cross-workspace imports like @eggjs/core-decorator from @eggjs/tegg. Add a post-install step that creates the missing symlinks. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ut may copy workspace packages as flat directories rather than creating symlinks. Remove whatever ut created and recreate as proper symlinks so cross-workspace ESM re-exports resolve to live source. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The resolve aliases pointed to non-existent root index.ts files (e.g. ../core-decorator/index.ts) instead of the actual entry points at src/index.ts. Under pnpm the aliases were never needed (symlinks handled resolution), but under ut they take priority and fail. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…modules path Under ut flat hoisting typescript lives at root node_modules, not at packages/tsconfig/node_modules. Use require.resolve for portable lookup. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ut run injects FORCE_COLOR=1 which conflicts with NO_COLOR=1 and causes Node.js to emit a warning on stderr. Tests that assert empty stderr fail. Strip FORCE_COLOR from the fork env to avoid the warning. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ln -sf in Git Bash creates broken symlinks for directory targets on Windows, causing SyntaxError in all tests. Skip the link step on Windows where ut's own workspace handling is sufficient. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…conflicts oxlint@1.58.0 introduced peerOptional oxlint-tsgolint>=0.18.0 which conflicts with cnpmcore's ^0.16.0. Use --force to proceed anyway. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
E2E validates runtime compatibility, not downstream lint compliance. oxlint 1.58.0 flags unused vars in cnpmcore's own code which is not something this repo controls. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove utoo-version pin (1.0.20), use latest which fixes prior bugs - Revert packages/utils/src/import.ts require.resolve fallback - Revert plugins/mock/src/lib/cluster.ts FORCE_COLOR override - Revert packages/cluster/test/options.test.ts flat-hoisting path - Revert packages/logger/test/* FORCE_COLOR stripping - Revert packages/tsconfig/test/index.test.ts require.resolve tsc - Revert ajv snapshot changes Kept (genuine bug fixes independent of ut): - tegg/core/vitest/vitest.config.ts: alias paths were wrong (index.ts → src/index.ts) - tegg/plugin/orm/test/index.test.ts: Vitest 4 forbids describe() inside it() Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Reverted in 675c7f22 to test if latest utoo made them unnecessary. CI proved they are still required: - packages/utils/src/import.ts: require.resolve fallback for CJS packages without exports field (ImportResolveError under flat hoisting) - plugins/mock/src/lib/cluster.ts: override FORCE_COLOR=0 in cluster forks when NO_COLOR is set (ut run injects FORCE_COLOR=1) - packages/cluster/test/options.test.ts: accept root node_modules/egg path under flat hoisting - packages/logger/test/*: strip FORCE_COLOR from coffee.fork env to prevent NO_COLOR/FORCE_COLOR conflict warning on stderr - packages/tsconfig/test/index.test.ts: use require.resolve for tsc instead of hardcoded nested node_modules path - tegg snapshot: updated for different @sinclair/typebox resolution Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
utoo no longer injects FORCE_COLOR=1 into child processes, so these workarounds are no longer needed: - plugins/mock/src/lib/cluster.ts: remove FORCE_COLOR=0 override - packages/logger/test/*: remove FORCE_COLOR stripping from fork env - ci.yml: remove NO_COLOR=1 env from test step Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use --legacy-peer-deps from next branch for cnpmcore E2E install. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
eggfromdevDependenciestopeerDependenciesacross 34+ packages to break workspace-internal dependency cycles detected by utoopnpmcommands withutequivalents in rootpackage.jsonscriptsunplugin-unused: Required peer dependency oftsdownfor theunusedcheck feature-w @eggjs/bin) instead of dir paths (--workspace ./tools/egg-bin) for utoo workspace flag; setNO_COLOR=1to avoid ANSI escape codes in test stdoutApplicationinterface in tegg-plugin types; remove stale@ts-expect-errordirectives[master]/[app_worker]/[agent_worker]and subsequent textKnown issues (pre-existing, not introduced by this PR)
@eggjs/orm-plugintest usesdescribe()insideit()which vitest disallows — skipped@eggjs/developmentfastReadytest is flaky in CI (stdout match intermittently fails) — skippedcnpmcore,examples) fail becausepnpm-workspace.yamldoes not exist on this branch — not addressed (branch-level issue)ut pretest --workspacestriggers@eggjs/orm-pluginpretest which requires MySQL (no MySQL in that CI job)Test plan
ut deps --workspace-onlypasses (no cycles)typecheckCI job passesoxlint --type-awarepasses locallyut pretest --workspacespasses locally🤖 Generated with Claude Code