Closed bronzehedwick closed 1 year ago
There's critical information in that, though - 1.12.x
allows 1.12.13
, and ^1.12.14
means the package will break unless it's at least 1.12.14
.
The ^
is the best choice. The version of the package installed can never be inferred from looking at package.json anyways, you have to look at the lockfile or node_modules.
Also, ^
does NOT correspond to bumping the minor version - you could bump patch and/or minor, or it could be the exact version listed.
There's critical information in that, though - 1.12.x allows 1.12.13, and ^1.12.14 means the package will break unless it's at least 1.12.14.
Also, ^ does NOT correspond to bumping the minor version - you could bump patch and/or minor, or it could be the exact version listed.
Ah I did not know that, thank you for explaining! While I still think the x
is more readable, the difference in meaning makes it a no-go.
Motivation ("The Why")
Prepending the version number with
*
,^
, or~
is more confusing than replacing the semver version places with anx
. The three symbols have no inherent meaning with the version place they allow to be bumped, while placing anx
clearly indicates that that place is variable.An extra layer of confusion with prepending symbols comes from writing a literal number in the version string after it. That exact version number is likely not the version currently installed, decreasing readability.
Example
Reading the version
^1.12.14
I have to remember:^
corresponds to bumping the minor version1.12.14
does not represent the version of the package installed, only the version of the package the last time the version incrementing scheme was changedHow
Current Behaviour
Running
npm install
uses the symbol prepending version incrementing scheme.Desired Behaviour
Running
npm install
uses thex
variable placeholder version incrementing scheme.References