Semantic Versioning (SemVer) is a specification by Tom Preston-Werner for numbering software versions as MAJOR.MINOR.PATCH. MAJOR changes for incompatible API changes, MINOR for backward-compatible features, and PATCH for backward-compatible bug fixes; pre-release identifiers, build metadata, and precedence rules complete the scheme. A version number thus tells consumers how a change affects them.
Semantic Versioning (SemVer)
Details
- Full Name
-
Semantic Versioning Specification
Core Concepts:
- Version format
-
- MAJOR
-
Incompatible API changes (breaking changes)
- MINOR
-
Backward-compatible functionality additions
- PATCH
-
Backward-compatible bug fixes
- Pre-release versions
-
Append hyphen and identifiers (e.g., 1.0.0-alpha.1)
- Build metadata
-
Append plus sign and identifiers (e.g., 1.0.0+20241111)
- Version precedence
-
Clear rules for version comparison
- Initial development
-
0.y.z for initial development (API unstable)
- Public API declaration
-
Once public API declared, version dependencies matter
- Key Proponent
-
Tom Preston-Werner
When to Use:
-
Libraries and APIs consumed by other software
-
Software with defined public interfaces
-
Projects requiring dependency management
-
Communication of change impact to users/consumers