feat: add min-release-age-exclude with glob pattern support#9175
feat: add min-release-age-exclude with glob pattern support#9175caseyjhol wants to merge 3 commits into
Conversation
|
Hi @wraithgar @owlstronaut @manzoorwanijk 👋 - friendly ping on this one! This PR adds |
|
This is a feature that overlaps with several other things folks want, including allowing dependency types and allowing lifecycle scripts. Because of that we have an rfc discussion ongoing in npm/rfcs#861 to try to come up with something that will work as a pattern for all of these approaches. We don't want to throw quick solutions at this which are hard to maintain or implement. |
| 'global', | ||
| 'workspace', | ||
| 'before', | ||
| 'min-release-age-exclude', |
There was a problem hiding this comment.
You added min-release-age-exclude but not min-release-age here. Intentional?
|
|
||
| const npa = require('npm-package-arg') | ||
| const semver = require('semver') | ||
| const { minimatch } = require('minimatch') |
There was a problem hiding this comment.
This pulls in minimatch, but it's not in npm-pick-manifest's package.json. It resolves right now purely because the root has minimatch@^10.2.5 and Node hoists it. Installed on its own, this throws Cannot find module 'minimatch'. Add it to that package's deps when you move the change upstream.
JamieMagee
left a comment
There was a problem hiding this comment.
Nice work on this, the feature design is solid. One thing blocks it though: the actual exclusion logic is a hand-edit to node_modules/npm-pick-manifest, and that's not a workspace here, it's an external dep. That edit gets blown away the next time the dep is installed or bumped, and it won't be int he published package either. So isExcludedFromTimeFilter needs to go upstream into npm/npm-pick-manifest, get released, and then we bump the version in this repo to pick it up.
Summary
min-release-age-exclude, to exclude selected packages frombefore/min-release-agepublish-time filtering@myorg/*)Motivation
min-release-ageis useful for supply-chain risk reduction, but teams often need fast updates for internal packages or urgent CVE responses. This adds an exclusion mechanism so strict age policies can coexist with targeted exceptions.Changes
flatOptions.minReleaseAgeExcludeTest plan
min-release-age-excludeflatteningbefore+ exclusion behaviorRelated issues