oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
74.16k stars 2.77k forks source link

Add semver bump functions #12460

Open thewh1teagle opened 4 months ago

thewh1teagle commented 4 months ago

What is the problem this feature would solve?

I would like to bump semantic version string with built in function from Bun in https://bun.sh/docs/api/semver but it's lack of that option.

What is the feature you are proposing to solve the problem?

Provide bump(version: string) -> string function to bumb semantic version. support also beta versioning such as 0.2.0-beta.0

What alternatives have you considered?

No response

dragonflyfree commented 1 month ago

Currently working on an executable package that does these things, relative to tags present within a git repository.

Right now it's specific to just tags in a git repository, as in order for the semver specification to be adhered to, you require a history of all previous tags to prevent duplicate tags from being produced.

I'll post it here once that's ready to go - will also post here once I convert it to work as a normal, importable module as well, so that you can use it similar to how you describe.

I'm considering adding the ability to write a callback function that will go and grab your tag history from your preferred source, like tags on an npm module instead of on a git repository; I'll also post about that here if I get that done.