zafarkhaja/jsemver

Not easy to set major, minor, patch of an existing version.

agentgt opened this issue · 4 comments

The API makes it easy to increment a major,minor,patch but does not make it easy to replace any of those with an explicit amount.

That is I would expect the API to have something like:

Version.valueOf("1.0.0") .withPatch(2).toString() == "1.0.2"

And of course if you have build meta data that would be preserved as well and this is of course would be an immutable operation (ie creates another Version).

I don't think this library is maintained any more. You may want to check out https://github.com/asarkar/jsemver.

Hello Adam! Sorry it took me this long to get back to you.

If it's still relevant to you, could you please tell me what use case you had in mind for this feature?

Setting version to an arbitrary number doesn't make a lot of sense to me in the context of software versioning, to be honest. Unless you want some kind of a version builder, maybe? In that case, Version.Builder could be upgraded with new methods.

@zafarkhaja sorry I can't remember exactly. It was so long ago but IIRC had written some custom release plugins and I think I need to basically decrement or increment to test if some version was deployed.

Still think the Version.Builder should be sufficient for this, let me know if I'm wrong.