Semver Checker & Range Tester · Tutorial
How to choose the next version number for a release
5 min readbeginnerUpdated
You are about to publish a release and need a version number that tells users what changed. You will pick between patch, minor and major, create pre-release versions for testing, and confirm they sort correctly.
What you need
- The Semver Checker
- A list of what changed since the last release
Steps
Enter the current version
Type your latest published version in Current version, for example
0.4.9. The tool splits it into major 0, minor 4 and patch 9 and lists every possible next version.Match the change to the number
Only bug fixes? Choose the patch, 0.4.10. New features that don’t break anything? Minor, 0.5.0. Changes that may break users’ code? Major. Below 1.0, breaking changes go in the minor number.
Make a pre-release first
Set Pre-release tag to
rcand use Pre-release of next minor: 0.5.0-rc.0. Publish it for testers; Next pre-release gives 0.5.0-rc.1, and so on.Check the order
In Compare two versions, compare 0.5.0-rc.1 with 0.5.0. The final release is newer than all its release candidates, so users on the rc automatically move to it.
Check who will get it
Type a typical user range such as
^0.4.2in the range box and add 0.5.0. It doesn’t match: users must opt in to 0.5.0, which is exactly what a breaking minor below 1.0 should do.
Try it yourself
Opens the Semver Checker & Range Tester with this tutorial's sample loaded.
Common mistakes
- Hiding a breaking change in a patch
- Users with
^or~ranges receive patches automatically. If a patch removes or renames something, their next install breaks. When in doubt, release a new major (or minor below 1.0). - Reusing a published number
- Registries don’t let you publish the same version twice. If a release is broken, publish the next patch.
Next steps
Go back to the Semver Checker & Range Tester, or keep going with one of these: