Skip to content

Suggestion: Migrate from Yarn to pnpm for better monorepo management #6

Description

@ukeSJTU

Background

I noticed that this project uses Yarn as its package manager. Given that WebTestPilot has a monorepo structure with separate packages (root + webview-ui), I believe migrating to pnpm would bring significant benefits to the project's development workflow.

Current Project Structure

WebTestPilot-extension/
├── package.json          # Root package
└── webview-ui/
    └── package.json      # Webview UI package

Why pnpm is particularly beneficial for this project

1. Superior Monorepo/Workspace Support

  • pnpm has native workspace support that's more efficient than Yarn's
  • Better handling of dependencies between root and webview-ui packages
  • Cleaner dependency isolation between workspace packages

2. Faster CI/CD Pipeline

Your setup scripts (setup.sh, setup.ps1) currently run:

yarn install
cd webview-ui && yarn install

With pnpm, this becomes:

pnpm install  # Installs all workspace dependencies at once
  • 2-3x faster installation speed
  • Reduced CI time for contributors and automated workflows

3. Disk Space Efficiency

  • Uses content-addressable storage with hard links
  • Particularly beneficial for projects with multiple packages sharing dependencies
  • Saves significant disk space across multiple clones/branches

4. Stricter Dependency Management

  • Prevents phantom dependencies (accessing packages not declared in package.json)
  • More reliable builds, especially important for a VS Code extension
  • Better alignment with the project's use of TypeScript strict mode

5. Better Developer Experience

  • Simpler setup scripts for new contributors
  • Consistent with modern tooling (Rsbuild, esbuild already used in this project)
  • Growing adoption in the VS Code extension ecosystem

Migration Impact

Minimal changes needed:

  1. Replace yarn.lock with pnpm-lock.yaml
  2. Update setup.sh and setup.ps1 scripts
  3. Add pnpm-workspace.yaml configuration
  4. Update CONTRIBUTING.md documentation

Setup scripts would become simpler:

# Before (Yarn)
yarn install
cd webview-ui && yarn install

# After (pnpm)
pnpm install  # That's it!

Offer to Help

If the team is interested, I'd be happy to:

  • Create a PR with the complete migration
  • Update all setup scripts (setup.sh, setup.ps1, browser.sh, browser.ps1)
  • Update documentation to reflect the changes

The migration is straightforward and low-risk, with immediate benefits for development velocity and contributor experience.

References

Thank you for building this excellent testing tool!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions