muratgozel / node-calver

Calendar based software versioning library as node.js module and with cli support. 📅
MIT License
29 stars 5 forks source link

Reset increments #3

Closed aazbeltran closed 3 years ago

aazbeltran commented 3 years ago

Exists an issue where when you are using the major, minor and micro, and you increment minor o major (as example), the lower types must be reset to zero, but those types keep their values.

Example:

const calver=new Calver('YYYY.MINOR.MICRO','2020.0.0');
calver.inc('micro');
console.log(calver.get());
// 2020.0.1
calver.inc('minor');
console.log(calver.get());
// 2020.1.1
// In this case must be 2020.1.0
// And the year must be 2021
muratgozel commented 3 years ago

It looks like a bug. However, the year stay same if you specify a semantic tag (such as minor) since the developer may be just patching an existing release. Like patching a software which released on 2011 and then the full version number will be something like 2011.4.26783

Will send a fix soon.

aazbeltran commented 3 years ago

I'm working on it, I'll send you the fix today 😀 Have a nice day!

muratgozel commented 3 years ago

Will be glad for it, thanks. 🎉

aazbeltran commented 3 years ago

The PR is done, I added some fixes and a parameter to keep the specified date, can you check this please?

aazbeltran commented 3 years ago

Hi @muratgozel , how are you? 😀 Do you had the chance to check the code?

muratgozel commented 3 years ago

I'll refactor code shortly. I have to implement the support for some development tags and make to code more maintainable.

muratgozel commented 3 years ago

Shipped. 🐬

aazbeltran commented 3 years ago

Hey dude, good job! Tomorrow I will review the changes in detail, I think there will be breaking changes... Have an excellent week! Respect for the great amount of JS libraries you maintain. Greetings from Mexico 🤟🏿