Skip to content

Instantly share code, notes, and snippets.

@magnetikonline
Last active December 7, 2023 09:18
Show Gist options
  • Save magnetikonline/5c73a35f70a3cdd70e49 to your computer and use it in GitHub Desktop.
Save magnetikonline/5c73a35f70a3cdd70e49 to your computer and use it in GitHub Desktop.
Semver package range definitions cheatsheet.

semver rules

How:

handles semver range definitions.

Given a version number MAJOR.MINOR.PATCH, increment the:

MAJOR version when you make incompatible API changes,
MINOR version when you add functionality in a backwards-compatible manner, and
PATCH version when you make backwards-compatible bug fixes.
Rule example Description Expanded form
0.1.2 An exact version match of MAJOR.MINOR.PATCH. 0.1.2
^0.3.8 A version match of 0.3.8 plus incremental MINOR versions. >= 0.3.8 < 1.0.0
~0.2.5 A version match of 0.2.5 plus incremental PATCH versions. >= 0.2.5 < 0.3.0

Reference

@HugoImaios
Copy link

In PHP ecosystem, Packagist/Composer too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment