-
Notifications
You must be signed in to change notification settings - Fork 332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent updating major for specific dependency #866
Comments
What you need is ncu -p-queue # upgrade all dependencies except p-queue
ncu p-queue --target minor # upgrade p-queue |
OK thanks for the info. Would be a nice feature to have, wouldn't it? i.e. different switches to signify "update at most patch level", "update at most minor level", "update any level", or "don't touch anything!". |
Yes, I agree. It would be a bit too complex for cli options, but it could be supported via the ncurc file.
These are all currently supported via |
I guess I'm expecting the So IMHO it would be nice if there was a CLI option for
Without any flag, it's either updated to the latest version (including at a new major level) or left alone... my knowledge of semantic versioning conventions is totally inadequate but maybe there is an existing flag to convey this distinction? |
I see, that makes sense! As a bit of additional explanation, I would offer that the raison d'être of
There are enough people that prefer the additional control of |
OK thank you for the additional insight, and for reminding me of the raison d'être of
Thanks for your continued efforts with |
I'm in a similar situation and resorting to use
But finer control over target version for specific packages would be nice.
|
As of module.exports = {
/** Custom target that performs minor upgrades for the p-queue package.
@param dependencyName The name of the dependency.
@param parsedVersion A parsed Semver object from semver-utils.
(See https://git.coolaj86.com/coolaj86/semver-utils.js#semverutils-parse-semverstring)
@returns 'latest' | 'newest' | 'greatest' | 'minor' | 'patch'
*/
target: (dependencyName, parsedVersion) => {
return dependencyName === 'p-queue' ? 'minor' : 'latest'
}
} You can hack together your own semver-like target logic with this function, but the intention is to eventually add a |
module.exports = {
target: (dependencyName) => {
if(["node-fetch", "@types/node-fetch", "globby","susy"].includes(dependencyName) ){
const res = "minor"
console.log(`👀 ️${dependencyName} is pinned to ${res}`)
return res;
}
return 'latest'
},
} great! |
Usually I am happy to have the dependencies in my
package.json
to update to a different major version (of course I then test for any breakages). But now I've identified one dependency which breaks things for me with its new major version, so I want to stick to a specific version for just that dependency, but wantncu -u
to carry on updating all other dependencies as per normal across major boundaries. Is this possible? I am presently using the^
switch (e.g."p-queue": "^6.6.2"
) and had hoped that there might be another switch which which tellsncu
to "leave alone".The text was updated successfully, but these errors were encountered: