jsemver icon indicating copy to clipboard operation
jsemver copied to clipboard

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

Open agentgt opened this issue 7 years ago • 1 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).

agentgt avatar Apr 09 '17 15:04 agentgt

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

asarkar avatar Nov 09 '20 07:11 asarkar

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 avatar Apr 15 '23 05:04 zafarkhaja

@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.

agentgt avatar Aug 10 '23 12:08 agentgt

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

zafarkhaja avatar Jan 04 '24 12:01 zafarkhaja