A powerful CLI tool for managing and checking dependencies across packages in a monorepo. Helps you identify version mismatches, missing dependencies, and maintain consistency across your workspace packages.
- 🔍 Check for version differences across packages
⚠️ Identify missing dependencies between your main app and packages- 🔄 Update dependencies to the highest compatible version
- 🏗️ Full workspace package support
- 📊 Clear, actionable summaries
- 🚀 Fast, zero-config setup
# Global installation
npm install -g @warkypublic/monorepo-dep-checker
# Or locally in your project
npm install --save-dev @warkypublic/monorepo-dep-checkerBasic usage with default paths (assumes ./package.json for main app and ./packages for workspace packages):
dep-checkFind packages using different versions of the same dependency:
dep-check --check-versions
# Output example:
react:
Difference (major):
^17.0.2 vs ^18.0.0
Packages using ^17.0.2:
- my-app (package.json)
- components (packages/components/package.json)
Packages using ^18.0.0:
- new-feature (packages/new-feature/package.json)
Recommended action:
⚠️ Major version difference - Manual review recommendedFind dependencies that exist in packages but are missing from the main app:
dep-check --check-missing
# Output example:
Summary:
Packages with dependency mismatches: 2
Unique dependencies missing from main app: 1
lodash
Unique unused dependencies from main app: 1
axiosUpdate all dependencies to their highest compatible version:
# Dry run - show what would be updated
dep-check --update --dry-run
# Actually perform the updates
dep-check --updateSpecify custom paths for your main app and packages:
dep-check --app ../my-app/package.json --packages ../my-app/packagesGet results in JSON format for further processing:
dep-check --check-versions --format jsonOptions:
--app, -a Path to main app package.json [default: "./package.json"]
--packages, -p Path to packages directory [default: "./packages"]
--update, -u Update dependencies to highest compatible version
--dry-run, -d Show what would be updated without making changes
--check-versions Check for version differences between packages
--check-missing Check for dependencies missing between app and packages
--format Output format (text or json) [default: "text"]
--help Show help
--version Show version number- Automatically detects and handles workspace dependencies
- Ignores
workspace:*protocol dependencies - Properly manages workspace package references
- Supports npm, yarn, and pnpm workspaces
- Identifies major, minor, and patch version differences
- Provides clear upgrade recommendations
- Shows detailed package locations
- Helps prevent dependency conflicts
- Finds dependencies used in packages but missing from main app
- Identifies unused main app dependencies
- Shows unique missing dependencies to avoid duplication
- Excludes workspace packages from analysis
- Run
--check-versionsbefore updates to identify potential breaking changes - Use
--dry-runbefore applying updates - Review major version differences manually
- Keep workspace dependencies consistent across packages
Contributions are welcome! Please read our contributing guidelines for details.
MIT License - see LICENSE file for details