Skip to content

owlstronaut/fix min release age zero#9368

Merged
owlstronaut merged 2 commits into
latestfrom
owlstronaut/fix-min-release-age-zero
May 20, 2026
Merged

owlstronaut/fix min release age zero#9368
owlstronaut merged 2 commits into
latestfrom
owlstronaut/fix-min-release-age-zero

Conversation

@owlstronaut
Copy link
Copy Markdown
Contributor

@owlstronaut owlstronaut commented May 18, 2026

overtakes #9292

This pull request updates the handling of the before and min-release-age configuration options in npm's configuration system. Previously, these two options were mutually exclusive, but now they can coexist, with clear precedence rules: within the same configuration source, before (an explicit date) takes precedence over min-release-age (a relative window), and across sources, the standard npm config precedence applies (CLI > env > project > user > global). The documentation, code, and tests have all been updated to reflect and verify this new behavior.

@owlstronaut owlstronaut requested review from a team as code owners May 18, 2026 17:24
When the user has `min-release-age=N` in their `.npmrc`, the config flatten
function derives a `before` date used by pacote. Whenever pacote spawns a
child npm process (e.g. preparing a `git:` or `github:` dep), it forwards
`--before=<date>` to the child. The child then loads the same `.npmrc` and
the previously declared mutual-exclusivity between `before` and
`min-release-age` caused a hard configuration error.

This makes the two options coexist: the `exclusive` constraints are
removed and both flatten functions resolve to the earlier of the two
effective dates, never widening the user's most conservative bound.
The `min-release-age` flatten no longer mutates the per-source config
object (the prior `obj.before = ...` / `delete obj['min-release-age']`
mutations were vestigial and only masked the conflict at the parent
level, not in spawned children).

`min-release-age` is also added to the `params` arrays for `outdated`
and `update` so it remains visible in their command help; it was
previously displayed implicitly via the `before` exclusive grouping.

Fixes: #9291
@owlstronaut owlstronaut force-pushed the owlstronaut/fix-min-release-age-zero branch from 825b126 to da51908 Compare May 18, 2026 17:30
Comment thread workspaces/config/lib/definitions/definitions.js Outdated
Comment thread workspaces/config/lib/definitions/definitions.js
Comment thread workspaces/config/test/index.js
@owlstronaut owlstronaut force-pushed the owlstronaut/fix-min-release-age-zero branch from da51908 to b0ac494 Compare May 20, 2026 16:18
@owlstronaut owlstronaut requested a review from nishantms May 20, 2026 16:19
@owlstronaut owlstronaut merged commit 18ebb0f into latest May 20, 2026
33 checks passed
@owlstronaut owlstronaut deleted the owlstronaut/fix-min-release-age-zero branch May 20, 2026 16:27
@github-actions
Copy link
Copy Markdown
Contributor

🎉 Backport to release/v11 created: #9378

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants