Semantic Versioning is a formal specification for software versioning that communicates the nature of changes through a three-part version number. It is the industry standard for managing dependency contracts.
The version format is defined as MAJOR.MINOR.PATCH, optionally followed by pre-release or build metadata.
1.0.0-alpha.1). These have lower precedence than the associated normal version.1.0.0+20130313144700). This is ignored when determining version precedence.Manually updating version numbers is error-prone. Modern pipelines automate this using Conventional Commits.
By parsing commit messages, a CI tool can determine the correct version bump:
fix: ... \rightarrow PATCHfeat: ... \rightarrow MINORfeat!: ... or BREAKING CHANGE: ... \rightarrow MAJORpackage.json, pom.xml), and creates a Git tag.CHANGELOG.md is automatically generated from the commit history.Major version zero (0.y.z) is for initial development. Anything may change at any time. The public API should not be considered stable until 1.0.0.
Once you hit 1.0.0, any breaking change—even if it seems "minor" or "obvious"—requires a MAJOR version bump. Violating this destroys trust in your dependency contract.
Use pessimistic versioning in your consumers to balance stability and security:
~1.2.3 (Tilde): Allows patch updates (1.2.x).^1.2.3 (Caret): Allows minor and patch updates (1.x.x).