npm-check
npm-check copied to clipboard
Update peerDependencies along with devDependencies
I :heart: npm-check, thank you! On a project that listed a package in both devDeps (for CI, local testing) and peerDeps, I noticed that npm-check only bumps the dependency in devDependencies and not in peerDependencies. Would be great to pair, like :chocolate_bar: and :wine_glass:.
Thanks @rgbkrk!
The way the dependencies are updated in the package.json is via --save and --save-dev. Therefore, when using those flags, shouldn't npm be responsible for updating the matching peerDependencies as well?
Sure seems like it!
Generally it seems like with npm3, we definitely need some peer dep saving: https://github.com/npm/npm/pull/3994
It would not make sense for this tool to auto-determine the range of versions supported in package.json.
Imagine a package.json file like this:
"devDependencies": {
"packageA": "^3.2.1"
},
"peerDependencies": {
"packageA": ">=2.0.0<4.0.0"
}
If I update packageA to ^3.8.1 there is no need to update my peerDependencies if my library still works with [email protected] through [email protected].
If anything this tool should just show a warning if the installed devDependencies version falls outside the range specified in peerDependencies.
If anything this tool should just show a warning if the installed devDependencies version falls outside the range specified in peerDependencies.
I would really like to see a flag (e.g. --peers) to include peerDependencies while doing checks (particularly when in interactive mode, i.e.-u). This way it is up to the developer whether to include them in the checks or not —not even seeing them listed can instill false confidence that everything is installed and is up-to-date.