2019-08-09 19:32:00 UTC
On your journey as a developer, you would have been assigned the task of creating a package and putting it out there. Maybe it is an NPM package or a Ruby Gem. Even if you haven't done something of that sort, you might want to extract out things that might be common among multiple projects.
Say you have a few CSS files you want to use across multiple projects and want to follow DRY (Don't repeat yourself) pattern. Or maybe you are a react developer and have a few basic components like buttons or navbar or pills which you want to reuse across other projects. In all these cases, you can extract out these functionalities in a separate library. This blog is not about explaining that process. It is a long one and I would break it down into parts and publish more about it.
This blog post is about SemVer which will help you out when you actually decide to get your hands dirty. The industry follows what is called Semantic Versioning for versioning their software or libraries. You can read about it in-depth in the last link or a google search since there are a lot of resources available.
I will just try to give you a short concise understanding which will help you get started.
If you have used any external library before, you must have seen these. The three numbers separated by dots.
As the pic above illustrates, the leftmost number is for identifying Major Version, the middle one is to identify the minor version and the rightmost is for patches. So what the hell these mean? These are standardized jargon used and agreed upon by developers across the world.
- It signifies a major change. Things might break and the users should be ready for a few/lots of things breaking
- This would be the least used one while updating but signifies considerable changes in your code.
- When you increment this one, you have to reset all others to 0. So minor and patch becomes 0.
- This alpha/beta is used to identify a pre-release. In otherwords, it says the library is still being tested and bugs will happen
- You can add any words you want. Just add a "-" and then add the word after the three version number.
- But do keep in mind everyone knows what alpha/beta means since its standardized.
- Your library users probably won't know what "1.0.0-allhailtheking" mean. So if you want other users to use your library and take pride in the contribution to the open-source, try sticking with the alpha/beta jargon for pre-releases.
Hope this helps! :)
Owned & Maintained by Saurav Prakash
If you like what you see, you can help me cover server costs or buy me a cup of coffee though donation :)