Is there an existing issue for this?
This is a CLI Docs Enhancement, not another kind of Docs Enhancement.
Description of Problem
The documentation for "overrides" explains the different nesting levels, explains the different special values for the key… But it doesn't explain what are the valid values for versions.
Specifically, all the current examples only use explicit versions (in the format 1.2.3). Thus, after (re-)reading the documentation (several times), I'm still not sure if it supports version ranges.
Why would I want that? Because if I want to update something due to a security vulnerability, I could change it to ^2.4.0 instead of 2.4.0. Why? Because in the future I'll wonder why I had overridden to that very specific version. Since package.json doesn't support comments, I won't know. Thus, by using a version range, I'm explaining to my future self that I didn't intend that very specific version, but at least that version.
Potential Solution
Explicitly define the valid values for the overrides. Additionally, add (or modify) some examples showing version ranges, as that helps people reading the documentation in a hurry.
Docs URL
https://docs.npmjs.com/cli/v10/configuring-npm/package-json#overrides
Is there an existing issue for this?
This is a CLI Docs Enhancement, not another kind of Docs Enhancement.
Description of Problem
The documentation for
"overrides"explains the different nesting levels, explains the different special values for the key… But it doesn't explain what are the valid values for versions.Specifically, all the current examples only use explicit versions (in the format
1.2.3). Thus, after (re-)reading the documentation (several times), I'm still not sure if it supports version ranges.Why would I want that? Because if I want to update something due to a security vulnerability, I could change it to
^2.4.0instead of2.4.0. Why? Because in the future I'll wonder why I had overridden to that very specific version. Sincepackage.jsondoesn't support comments, I won't know. Thus, by using a version range, I'm explaining to my future self that I didn't intend that very specific version, but at least that version.Potential Solution
Explicitly define the valid values for the overrides. Additionally, add (or modify) some examples showing version ranges, as that helps people reading the documentation in a hurry.
Docs URL
https://docs.npmjs.com/cli/v10/configuring-npm/package-json#overrides