Skip to content

fix(config): preserve min-release-age after flattening#9285

Open
lawrence3699 wants to merge 1 commit intonpm:latestfrom
lawrence3699:fix/preserve-min-release-age
Open

fix(config): preserve min-release-age after flattening#9285
lawrence3699 wants to merge 1 commit intonpm:latestfrom
lawrence3699:fix/preserve-min-release-age

Conversation

@lawrence3699
Copy link
Copy Markdown

Fixes #9199.

min-release-age derives a before date while config is flattened, but the flatten hook also deleted the original min-release-age value from the loaded config data. After anything read config.flat, npm config get min-release-age and npm config ls --long reported null even when the user had configured a value.

This keeps the configured min-release-age value readable while still deriving flat.before for package resolution.

Before this change:

node . config get min-release-age --userconfig "$tmp/npmrc"
# null

After this change:

node . config get min-release-age --userconfig "$tmp/npmrc"
# 5

Validation:

npm test --ignore-scripts
npm run lint --ignore-scripts --workspace @npmcli/config
npm run postlint --ignore-scripts --workspace @npmcli/config
git diff --check

@lawrence3699 lawrence3699 requested a review from a team as a code owner April 27, 2026 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] min-release-age not shown by npm config ls

1 participant