Skip to content

feat(pm): add --from pnpm migration for install command#2733

Merged
elrrrrrrr merged 1 commit intonextfrom
feat/pm-from-pnpm
Mar 27, 2026
Merged

feat(pm): add --from pnpm migration for install command#2733
elrrrrrrr merged 1 commit intonextfrom
feat/pm-from-pnpm

Conversation

@elrrrrrrr
Copy link
Contributor

@elrrrrrrr elrrrrrrr commented Mar 24, 2026

Summary

  • Add utoo install --from pnpm to migrate pnpm projects to utoo
  • Parses pnpm-workspace.yaml and converts config:
    • packagespackage.json workspaces field
    • overridespackage.json overrides field
    • catalog/catalogs.utoo.toml
  • Zero core logic changes — migration writes files, existing install picks them up natively
  • Added FromPm enum with clap::ValueEnum for type-safe --from flag

Test plan

  • Unit tests: 5 new tests covering YAML parsing, package.json update, .utoo.toml generation, error handling
  • All 234 existing tests pass
  • cargo fmt + clippy clean
  • E2E test: eggjs/egg (next branch) pnpm migration + install

🤖 Generated with Claude Code

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, 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 significantly enhances the utoo package manager by introducing a new migration feature. Users can now seamlessly transition existing pnpm projects to utoo using the utoo install --from pnpm command. The implementation intelligently parses pnpm's workspace configuration, converting it into utoo's native package.json and .utoo.toml formats, thereby streamlining the adoption process for projects previously managed by pnpm.

Highlights

  • Pnpm Migration Command: Introduced utoo install --from pnpm to enable migration of pnpm projects to utoo.
  • Configuration Conversion: Implemented parsing of pnpm-workspace.yaml to automatically convert packages to package.json workspaces, overrides to package.json overrides, and catalog/catalogs to .utoo.toml.
  • Type-Safe Argument: Added a new FromPm enum with clap::ValueEnum for type-safe handling of the --from flag.
  • Testing: Included 5 new unit tests for the migration logic and an end-to-end test using the eggjs/egg project to validate the migration and installation process.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
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 introduces a valuable migration feature from pnpm. The core Rust implementation is well-structured. My feedback focuses on improving the robustness of both the new unit tests and the end-to-end shell script test. Specifically, I've suggested refactoring the tests to avoid panics on error, which will make them more reliable and easier to debug. For the e2e test, I've pointed out several places where adding error handling would prevent the test from incorrectly passing in case of a failure.

@elrrrrrrr elrrrrrrr force-pushed the feat/pm-from-pnpm branch 5 times, most recently from 1d3d918 to 806af26 Compare March 27, 2026 07:13
@zombieJ
Copy link

zombieJ commented Mar 27, 2026

@codex review

@elrrrrrrr elrrrrrrr force-pushed the feat/pm-from-pnpm branch 3 times, most recently from 27d0aa4 to 988ecf0 Compare March 27, 2026 08:09
Reads pnpm-workspace.yaml and converts to utoo config:
- workspaces/overrides → package.json
- catalog/catalogs → .utoo.toml (merged with existing config via
  PNPM_MIGRATE_KEYS whitelist)

Migration runs before init_registry so MERGED_CONFIG picks up the
generated .utoo.toml for catalog: protocol resolution.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@elrrrrrrr elrrrrrrr marked this pull request as ready for review March 27, 2026 08:56
@elrrrrrrr elrrrrrrr added A-Perf Area: Performance A-Pkg Manager Area: Package Manager and removed A-Perf Area: Performance labels Mar 27, 2026
@elrrrrrrr elrrrrrrr merged commit 5a472d5 into next Mar 27, 2026
25 checks passed
@elrrrrrrr elrrrrrrr deleted the feat/pm-from-pnpm branch March 27, 2026 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Pkg Manager Area: Package Manager

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants