NPM: Semantic Versioning Characters

 

Semantic Versioning

Semantic versioning is a solution for the software management term of "Dependency Hell". A software usually depends on other software. 

But usually the "other" software also depends also on other products.


The illustration above shows a tree of dependencies. Like in the illustration, your software can depend on an other software in different versions.

To resolve issues like not to install same dependency multiple times or install the latest version of a software, there is a need of standardized software dependecy management. Semantic versioning standard offers tools like npm or yarn to resolve such dependencies.

📗 BASICS

A semantic version consists of three numbers seperated by a dot:
  • 1.1.1
  • Major Release.Minor Release.Patch Release

🥇Major Release: 2.1.1

You increase your version to a major release when 
  • your code has breaking changes 
  • the users of your software need to update their code, e.g an API change or sth else which has causes a major effect on the product using your software.

🥈Minor Release: 1.2.0

You increase your version to a minor release when 
  •  you release a new functionality
When you increase the minor version, you must reset the patch version to zero.

🥉Patch Release: 1.1.2

You increase your version to a patch release when 
  • you fix bugs
  • you patch the code
  • you have no changes in functionality

📏Ranges

You can also define that your software depends on a version range. That means e.g.
  • My software depends on a package with version 1.1.0
  • But the version up to version 1.7.5 works also
  • But package version 1.8.0 does not work
In this case you can tell the package manager that your software dependes on versions between 1.1.0 - 1.7.5.


🎯Playground

The npm page offers a really cool tool to test the versioning ranges:

Comments

Popular posts from this blog

What is Base, Local & Remote in Git merge

Asynchronous Nunjucks with Filters and Extensions

Debug Azure Function locally with https on a custom domain