npm-check-updates icon indicating copy to clipboard operation
npm-check-updates copied to clipboard

Feature: --age or --filterMeta

Open wadeharrell opened this issue 3 years ago • 6 comments

Running into a slight challenge when using ncu due to being on a corp registry that only syncs on a cron. Packages that have been published between crons are not available on the corp registry yet. It would be handy to have a flag that would allow us to specify an age in hours for the packages to be updated. Anything younger than that age would be excluded from the update.

I have been using the tool for years and never run into this before, but Babel is doing updates across their packages right now and it has been preventing us from using ncu easily for the past few days. If there was a way to specify "only update packages that were published more than 12 hours ago" it would solve the concern. It might also be a nice "comfort" feature for those concerned about dangerous code updates.

wadeharrell avatar Feb 23 '21 17:02 wadeharrell

Thanks for the suggestion! Maybe something like --filterVersion but for package metadata, i.e. --filterMeta "time > 12hrs".

raineorshine avatar Feb 23 '21 21:02 raineorshine

--filterMeta is a great idea. Additional use-case are packages that need to stay on the same version because they are published from the same monorepo but for some reason filtering by name is not suffice.

In my organization we publish packages within org scope, say @myorg/*. Some of those packages use parallel versioning and some do not, so we would like to be able to filter by meta property like repository url ncu "@myorg/*" --filterMeta "repository.url = https://github.com/myorg/myrepo.git"

kanoshin avatar Jun 28 '21 22:06 kanoshin

Two words about my use case - in our org we have internal npm repo which ignores any packages from npm.org that are younger than 72 hours for security reasons. It means that some of ncu upgrade recommendations cannot be done and it takes time to understand which upgrades are working and which are not.

Litee avatar Jul 28 '21 19:07 Litee

This option could benefit from supporting functions, like the recent enhancement to target: https://github.com/raineorshine/npm-check-updates/pull/1052.

raineorshine avatar Apr 12 '22 22:04 raineorshine

--filterMeta is a nice generalization, though I think a --min-age option would be convenient, even if it was just an alias for --filterMeta "time > 72hrs".

raineorshine avatar Oct 16 '22 11:10 raineorshine

Maybe the naming of the alias could be aligned with Renovate (the only place where I did find this feature!), it's called stabilityDays

Also stabilityDays is mentioned in this RFC: https://github.com/npm/rfcs/issues/549

limonte avatar Oct 17 '22 07:10 limonte