Overview
A version number is a promise to downstream users about what an upgrade breaks. Bump MAJOR for incompatible API changes, MINOR for backward-compatible features, and PATCH for backward-compatible fixes, deciding from the public API diff rather than the size of the change. Use SemVer for any package or library with public consumers. Skip it for an application that ships as one artifact with no public API.
Rules
0.y.zis initial development: anything may change. npm’s caret treats^0.2.3as>=0.2.3 <0.3.0, so every 0.x minor can break consumers.- A pre-release (
1.0.0-rc.1) sorts before its release. Build metadata (+sha.abc123) is ignored for precedence. A released version must never be modified; ship a new one. - Deprecate in a MINOR release before removing in the next MAJOR, so consumers get a warning first.
- npm and Cargo use SemVer. PyPI uses PEP 440, which is similar but not identical.
- With conventional-commits, tooling derives the bump from commit types.
Example: 2.4.7 gets a compatible fix and becomes 2.4.8, then a new optional parameter makes 2.5.0, then removing a deprecated function makes 3.0.0.
Related
- conventional-commits: commit types that automate the bump.
- monorepo: cross-repo coordination relies on SemVer.
- git: tagging releases.
- github-releases: publishing versions.
- python-dependency-management: Python versioning and packaging.