Semantic Versioning
X.Y.Z
- X - major
- Y - minor
- Z - patch
Major version
- Which only gets incremented when you make incompatible API changes.
- Big changes that the previous major version doesn't work properly.
Minor version
- When you add functionality in a backwards compatible manner.
- It MUST be incremented if any public API functionality is marked as deprecated.
Patch version
- When you make backwards compatible bug fixes.
Notes
You must reset patch to 0 when you increment minor. (Ex. 1.2.5 => 1.3.0)
Reset both minor and patch to 0 when you increment major. (Ex. 2.1.4 => 3.0.0)
Specifications
1- Once a versioned package has been released, the contents of that version MUST NOT be modified. Any modifications MUST be released as a new version.
2- Precedence is determined by the first difference when comparing each of these identifiers from left to right as follows: major, minor, and patch versions are always compared numerically. (Ex. 1.0.0 < 2.0.0 < 2.1.0 < 2.1.1)
Advantages
- You can keep track of every transition in the development phase.
- It helps other people who might be using your project as a dependency.
Click here for more details.