A utility to check for outdated dependencies in a pnpm workspace catalog.
npm install workspace-updaterworkspace-updater is a command-line utility for managing dependencies in your pnpm-workspace.yaml catalog. It helps you:
1. Check for outdated dependencies in your catalog and update them
2. Find duplicate dependencies across child packages that could be hoisted to the catalog

``bash`
pnpm add -D workspace-updater
Or run directly with:
`bash`
bunx workspace-updateror
pnpx workspace-updater
Check all dependencies in your pnpm-workspace.yaml catalog against npm registry:
`bash`
workspace-updater
#### Update Dependencies
Automatically update your catalog with latest versions:
`bashUpdate all outdated deps
workspace-updater --update
#### Specify Workspace File
`bash
workspace-updater -w /path/to/pnpm-workspace.yaml
`---
$3
Scan child packages for dependencies that appear in multiple
package.json files but aren't yet in the catalog. This helps you identify opportunities to hoist shared dependencies.`bash
workspace-updater dupes [path]
`#### Output
The command groups duplicates into two categories:
- Ready to Catalog: Dependencies with the same version across all packages
- Needs Resolution: Dependencies with different versions across packages
#### Options
| Flag | Description |
|------|-------------|
|
-y | Automatically hoist ready-to-catalog deps to pnpm-workspace.yaml and update child package.json files to use catalog: |
| --resolve-latest | Pick the latest semver version for conflicting deps. Without -y, moves them to "Ready to Catalog" for preview. With -y, also hoists them. |#### Examples
`bash
Preview duplicates (dry run)
workspace-updater dupesPreview with conflicts resolved to latest version
workspace-updater dupes --resolve-latestHoist all ready-to-catalog deps
workspace-updater dupes -yResolve conflicts to latest AND hoist everything
workspace-updater dupes --resolve-latest -yScan a specific monorepo
workspace-updater dupes /path/to/monorepo --resolve-latest -y
`#### What
-y DoesWhen you run with
-y, the tool will:1. Add each duplicate dependency to the
catalog: section of pnpm-workspace.yaml
2. Update each child package.json to use catalog: instead of the version string
3. Print a summary of changesAfter running, execute
pnpm install to update your lockfile.#### Example Output
`
━━━ READY TO CATALOG (same version across packages) ━━━ zod: ^3.24.1
→ @myorg/api
→ @myorg/webapp
→ @myorg/types
typescript: ^5.3.2 (resolved)
→ docs
→ @myorg/core
→ @myorg/logger
━━━ NEEDS RESOLUTION (different versions) ━━━
react
^18.2.0 → @myorg/webapp
^18.3.1 → @myorg/admin
━━━ SUMMARY ━━━
Ready to catalog (12):
zod ^3.24.1
typescript ^5.3.2 (resolved)
...
Needs resolution (1):
react
`Use in Git Hooks
Add to your pre-commit or post-merge hooks to keep dependencies in sync:
`bash
.husky/post-merge
#!/bin/sh
bunx workspace-updater dupes --resolve-latest -y && pnpm install
``Contributions are welcome! If you have a feature request, bug report, or want to improve the code, please open an issue or submit a pull request.
This utility is licensed under the MIT License.