Skip to content

Conversation

christian-bromann
Copy link
Member

Migrate package manager from Yarn to pnpm

This PR migrates the entire LangChain.js monorepo from Yarn to pnpm 10.14.0, providing improved performance, better disk space efficiency, and enhanced security.

🔄 Changes Made

Package Manager Configuration:

  • Updated packageManager field to [email protected] (latest version)
  • Created pnpm-workspace.yaml to replace Yarn workspaces configuration
  • Converted resolutions to pnpm.overrides format
  • Updated all package scripts to use pnpm commands and --filter syntax

CI/CD Updates:

  • Updated 15+ GitHub workflow files to use pnpm
  • Changed cache strategy from yarn to pnpm
  • Updated install commands to use pnpm install --frozen-lockfile
  • Converted workspace commands from yarn workspace to pnpm --filter

Documentation Updates:

  • Updated CONTRIBUTING.md with pnpm instructions
  • Updated README.md to prioritize pnpm in installation instructions
  • Updated examples and API documentation
  • Updated bug report templates to reference pnpm commands

Workspace Dependencies:

  • Fixed @langchain/standard-tests workspace dependency references
  • Updated all package.json files to use workspace:* format for internal dependencies

Cleanup:

  • Removed .yarn/ directory (plugins, patches, releases)
  • Removed yarn.lock files
  • Generated new pnpm-lock.yaml lockfile

🚀 Benefits

  • Performance: Faster installation and build times
  • Disk Space: Significant reduction in node_modules size through hard linking
  • Security: Better dependency resolution and security features
  • Developer Experience: Improved workspace filtering and command consistency

✅ Verification

  • All 45 workspace packages install correctly
  • pnpm install --frozen-lockfile completes successfully
  • Workspace filtering works (pnpm --filter @langchain/core)
  • CI workflows syntax is valid
  • Documentation reflects pnpm usage
  • No breaking changes to existing development workflows

📋 Migration Notes

Developers will need to:

  1. Install pnpm: npm install -g pnpm or use corepack
  2. Run pnpm install instead of yarn
  3. Use pnpm --filter <package> instead of yarn workspace <package>

The migration is fully backward compatible in terms of functionality - all existing scripts and commands work the same way, just with pnpm instead of yarn.

Copy link

vercel bot commented Aug 1, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langchainjs-docs ❌ Failed (Inspect) Aug 3, 2025 11:16pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchainjs-api-refs ⬜️ Ignored (Inspect) Aug 3, 2025 11:16pm

@hntrl hntrl merged commit 9396dd8 into v1 Aug 3, 2025
70 of 111 checks passed
@hntrl hntrl deleted the cb/pnpm branch August 3, 2025 23:17
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