Semantic Versioning
Semver is used in popular package managers like npm/yarn. Semantic versioning uses the following formula:
1.2.3
-> MAJOR.MINOR.PATCH
Given a version number MAJOR.MINOR.PATCH, increment the:
MAJOR version when you make incompatible API changes MINOR version when you add functionality in a backwards compatible manner PATCH version when you make backwards compatible bug fixes[1]
Or put another way:
- MAJOR is for any breaking changes
- MINOR is for adding something that doesn't break or change anything else
- PATCH is for fixing something that doesn't break or change anything else
Ranges
- Hyphens specify an inclusive set (
1.2.3 - 2.3.4
). Any missing numbers orx
/*
is essentially replaced by a zero (1.x
===1.0.0
). - A tilde is used if a package manager may install any patch level changes if a minor level is specified. Else, it allows minor level changes below the current major level.
-
A caret means that any changes are allowed that don't modify the left-most non-zero element.
^1.2.3 := >=1.2.3 <2.0.0-0
^0.2.3 := >=0.2.3 <0.3.0-0
^0.0.3 := >=0.0.3 <0.0.4-0
References
Last modified: 202302151616