Script Valley
Open Source Contribution: A Practical Guide
Code Quality and Testing StandardsLesson 4.5

What is semantic versioning and why contributors need to know it

SemVer MAJOR.MINOR.PATCH, breaking vs non-breaking changes, pre-release versions, version bumping responsibility, CHANGELOG driven releases, package.json versioning

Every Version Number Tells a Story

Semantic versioning (SemVer) is a three-number contract: MAJOR.MINOR.PATCH. As a contributor, you need to identify which number your change affects -- that determines what is required before your PR can merge.

The Three Numbers

PATCH -- Bug fixes that do not change the API. Your logout null-check fix is a patch. Safe to ship immediately.

MINOR -- New functionality added in a backward-compatible way. Adding a new function parameter with a default is a minor change.

MAJOR -- Breaking changes. Removing a parameter, renaming a public function, changing return types. Major bumps require migration guides and advance notice to users.

Your Job as a Contributor

Label your PR correctly. Many CONTRIBUTING.md files include instructions like: add [breaking] to PR title if this is a breaking change. Some use Conventional Commits footer: BREAKING CHANGE: removed the --legacy flag.

# In package.json -- version follows SemVer
{
  "version": "2.4.1"
}

# Bump commands
npm version patch  # 2.4.1 becomes 2.4.2
npm version minor  # 2.4.2 becomes 2.5.0
npm version major  # 2.5.0 becomes 3.0.0

Maintainers handle the actual version bump at release time. Your job is to correctly classify your change so they can do it accurately.