PNPM Upgrade Packages
An interactive CLI tool for upgrading npm packages across the pnpm-based monorepo with intelligent workspace filtering.
Install from npm
Install the package as a dev dependency in your monorepo:
npm install -D @uscreen.de/pnpm-upgrade-packages
pnpm add -D @uscreen.de/pnpm-upgrade-packages
Usage
Installed in monorepo (recommended)
upgrade-packages [options]
In this app:
node cli.js [options]
Options
--dry-run - Preview upgrade commands without executing them
Features
- ✅ Interactive Selection - Browse and select packages from a formatted list
- ✅ Workspace Filtering - Filter packages by specific apps/workspaces
- ✅ Smart Detection - Automatically detects root vs workspace packages
- ✅ Version Strategies - Choose between exact (1.2.3) or caret (^1.2.3) versions
- ✅ Selective Upgrades - Choose which workspaces to upgrade for each package
- ✅ Auto-Refresh - Updates package list after each successful upgrade
- ✅ Dry Run Mode - Preview commands before executing
How It Works
- Fetches outdated packages using
pnpm outdated -r
- Separates packages into root and workspace entries
- Presents an interactive list with version info and affected workspaces
- Allows filtering by specific workspaces
- Generates correct pnpm commands (
-w for root, --filter for workspaces)
- Auto-refreshes after successful upgrades
Examples
./upgrade-packages.js
./upgrade-packages.js --dry-run
Interactive Flow
📦 PNPM Monorepo Package Upgrader
🔍 Fetching outdated packages...
Found 15 outdated package(s)
? Select a package to upgrade:
🔍 Filter by workspace...
────────────────────────────────────────────────
prettier (dev) (root) 3.7.3 → 3.7.4 1 monorepo
eslint (dev) 9.1.0 → 9.2.0 8 auth-service, mailer-api, ...
@nx/js 22.1.2 → 22.1.3 1 monorepo
? Select workspaces to upgrade eslint in:
◉ auth-service (@scope/auth-service)
◉ mailer-api (@scope/mailer-api)
? Choose version strategy:
❯ Exact version (9.2.0)
Caret version (^9.2.0)
📦 Upgrade Details:
Package: eslint
Version: 9.1.0 → 9.2.0
Workspaces: auth-service, mailer-api
💻 Command: pnpm add -D eslint@9.2.0 --filter auth-service --filter mailer-api
? Execute this upgrade? (Y/n)
Package Display Format
<name> <(dev)> <(root)> <current> → <latest> <#> <workspaces>
(dev) - Indicates devDependency
(root) - Indicates root package.json
# - Number of workspaces using this package
- Workspaces limited to 5, shows "..." if more