Skip to content

Conversation

@daniel-graham-amplitude
Copy link
Collaborator

@daniel-graham-amplitude daniel-graham-amplitude commented Jan 1, 2026

Summary

We're migrating from Yarn to PNPM to take advantage of performance and security enhancements that PNPM provides. And because Yarn v1 has been in maintenance mode for ~6 years

Made a test pre-release called @amplitude/[email protected] and tested it locally
Screenshot 2026-01-02 at 5 29 40 PM
Screenshot 2026-01-02 at 5 29 48 PM
Screenshot 2026-01-02 at 5 30 10 PM

Checklist

  • Does your PR title have the correct title format?
  • Does your PR have a breaking change?: No

Note

Migrates the build system to pnpm and aligns CI, publishing, and docs accordingly, with minor code/test adjustments for compatibility.

  • Switches all GitHub Actions, composite actions, and Husky hooks from yarn to pnpm, adds pnpm/action-setup and enables setup-node@v4 caching
  • Updates root package.json scripts (build/test/lint/publish) to pnpm; sets Lerna npmClient to pnpm; adds deploy dry-run/pack helpers
  • Converts internal package dependencies to workspace:* and replaces analytics-types/client-common imports with @amplitude/analytics-core where applicable
  • Code/test changes: export InstanceProxy and new proxy types in analytics-core; broaden tsconfig includes; add Jest transformIgnorePatterns for RN packages; update tests to use core types and mock browser client
  • Session Replay: coerce string sessionId to number in targeting manager and add a unit test; tighten types in helpers
  • Updates docs/templates (README, CONTRIBUTING, AGENTS, issue template) to pnpm instructions
  • Publishing: refactors v2 and single-package workflows to pnpm commands; v1 keeps yarn; adjusts version/publish steps to pnpm

Written by Cursor Bugbot for commit 454f675. This will update automatically on new commits. Configure here.

@macroscopeapp
Copy link
Contributor

macroscopeapp bot commented Jan 1, 2026

Migrate CI workflows, scripts, and workspaces to pnpm and update targeting-manager.evaluateTargetingAndStore in targeting-manager.ts to parse string sessionId values

Switch package management from Yarn to pnpm across CI, Husky hooks, workspace configs, and package scripts; add pnpm lock/workspace files; update inter-package dependencies to workspace:*; introduce core type exports and minor test config changes; and fix string-to-number sessionId handling in targeting.

📍Where to Start

Start with the workflow migration in .github/workflows/ci.yml and then review the sessionId parsing change in targeting-manager.ts.

Changes since #1458 opened

  • Migrated prerelease publishing workflow from npm to pnpm package manager [73f6737]
  • Removed test case verifying sessionId string-to-number parsing [c3e9774]
  • Added test case verifying evaluateTargetingAndStore converts string sessionId to numeric format before calling evaluateTargeting [454f675]

Macroscope summarized d8c094d.

Copy link
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 migrates the repository from Yarn v1 to PNPM to take advantage of performance and security improvements. The migration involves updating package manager references, workspace configurations, CI/CD workflows, and dependency declarations across the monorepo.

Key Changes:

  • Migration from Yarn to PNPM as the package manager with workspace protocol for internal dependencies
  • Updated all GitHub Actions workflows to use PNPM with proper caching setup
  • Converted documentation and scripts to reference PNPM instead of Yarn

Reviewed changes

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

Show a summary per file
File Description
pnpm-workspace.yaml New PNPM workspace configuration with security settings
package.json Updated packageManager field, scripts, and publish commands for PNPM
lerna.json Changed npmClient from yarn to pnpm
packages/*/package.json Converted dependencies to workspace:* protocol and updated scripts to use pnpm
.github/workflows/*.yml Updated CI/CD workflows to use PNPM with setup-node v4 and caching
.husky/* Updated git hooks to use pnpm commands
README.md, CONTRIBUTING.md, AGENTS.md Updated documentation references from yarn to pnpm
test-server/README.md Updated test server instructions to use pnpm
tsconfig.json Removed 'idb' from types array
packages/*/test/tsconfig.json Added test-specific TypeScript configs
packages/*/jest.config.js Added transformIgnorePatterns for PNPM compatibility
packages/analytics-core/src/types/proxy.ts New file exporting InstanceProxy type
packages/session-replay-browser/src/targeting/targeting-manager.ts Bug fix for parsing string sessionId to number
packages/session-replay-browser/src/helpers.ts Added explicit return type annotation
packages/plugin-experiment-browser/package.json Fixed missing && operator in version script
Various test files Updated imports and mocking strategies

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@daniel-graham-amplitude daniel-graham-amplitude force-pushed the pnpm-migration branch 3 times, most recently from c867195 to 5158268 Compare January 1, 2026 00:25
@daniel-graham-amplitude daniel-graham-amplitude force-pushed the pnpm-migration branch 2 times, most recently from a027f2a to a22af1e Compare January 1, 2026 00:31
Copy link
Contributor

@Mercy811 Mercy811 left a comment

Choose a reason for hiding this comment

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

LGTM

 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
Copy link
Contributor

@Mercy811 Mercy811 left a comment

Choose a reason for hiding this comment

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

LGTM!

@daniel-graham-amplitude daniel-graham-amplitude merged commit bcc3bcd into main Jan 5, 2026
11 of 12 checks passed
@daniel-graham-amplitude daniel-graham-amplitude deleted the pnpm-migration branch January 5, 2026 17:54
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.

4 participants