syncpack icon indicating copy to clipboard operation
syncpack copied to clipboard

Feature request: explain which package(s) contains the highest version

Open stevebeauge opened this issue 1 year ago • 0 comments

Description

I'm working a in large monorepo. Sometimes I need to revert some package upgrade for various reasons. When I run syncpack to find dependency mismatch, it shows outdated packages and the highest version found the package:

= Default Version Group ========================================================
✘ @pnp/queryable 3.13.0 → 4.3.0 packages\common\package.json > dependencies [HighestSemverMismatch]
✘ @pnp/sp ^3.24.0 → ^4.3.0 packages\common\package.json > dependencies [HighestSemverMismatch]
✘ @pnp/sp ^3.24.0 → ^4.3.0 apps\web\package.json > dependencies [HighestSemverMismatch]
   980 ✓ already valid
     3 ✓ can be auto-fixed

This is fine when I need to ensure consistency. But in my case, I want to cancel the 4.3.0 upgrade of the packages.

What I would like, is to have in the output which package contains the highest version.

Something like:

= Default Version Group ========================================================
✘ @pnp/queryable 3.13.0 → 4.3.0 packages\common\package.json > dependencies [HighestSemverMismatch], from packages/components/package.json
✘ @pnp/sp ^3.24.0 → ^4.3.0 packages\common\package.json > dependencies [HighestSemverMismatch], from packages/components/package.json
✘ @pnp/sp ^3.24.0 → ^4.3.0 apps\web\package.json > dependencies [HighestSemverMismatch], from packages/components/package.json, packages/another/package.json
   980 ✓ already valid
     3 ✓ can be auto-fixed

Or:

= Default Version Group ========================================================
✘ @pnp/queryable 3.13.0 → 4.3.0 packages\common\package.json > dependencies [HighestSemverMismatch]
✘ @pnp/sp ^3.24.0 → ^4.3.0 packages\common\package.json > dependencies [HighestSemverMismatch]
✘ @pnp/sp ^3.24.0 → ^4.3.0 apps\web\package.json > dependencies [HighestSemverMismatch]

=  Highest semver mismatch origins =================================================
✓ @pnp/sp@^4.3.0 : packages/components/package.json, packages/another/package.json
✓ @pnp/queryable @4.3.0 : packages/components/package.json


   980 ✓ already valid
     3 ✓ can be auto-fixed

Because it's not the most common use case, it couild be an opt-in flag.

One may argue that's source control should be able to handle the use case. It is more complex actually, since the update is part of a large dependency updates which highly coupled 3rd party packages.

Suggested Solution

Help Needed

stevebeauge avatar Jul 22 '24 07:07 stevebeauge