Skip to content

Convert a prerelease version to stable version #2515

@b0lle

Description

@b0lle

Is your feature request related to a problem? Please describe.
I need to create development versions which indicates that the package version is under development and should be used with care.
So I came up with the "prerelease" version strategy which fits that need pretty nice.
When I finish the development I wanted to change the versioning strategy from "prerelease" to "default", which results in an unexpected behaviour:
v1.0.0-dev.4 (created by 5 runs of "prerelease" version strategy, one commit was "feat!") were bumped to
v2.0.0-dev.4 ("default" version strategy)

What i expected though is the new version v1.0.0

Describe the solution you'd like
The idea I came up with is a new versioning strategy. Lets call it "release-from-prerelease" and its very simple:
While the "prerelease" already handles version bumps very well, the new strategy only needs to get rid of the "build" and "prerelease" property. As a result we can use the "CustomVersionUpdate" updater like this:

    return new CustomVersionUpdate(
      Version.parse(`${version.major}.${version.minor}.${version.patch}`).toString()
    );

Describe alternatives you've considered
A more clean way would be the implement that behaviour in the "prerelease" property - So when the "prerelease" prroperty was set, then use the "prerelease" versioning strategy, otherwise set the new "release-from-prerelease" startegy.
Another way would be to change the "Major/Minor/PatchVersionUpdate" classes, but I think that might have some side-effect

Additional context
I know there are discussions how to handle pre-releases well here, but they are ongoing for four years. I can not understand how release-please took so much hype without pre-release handling. Hope this issue makes a little step to takle this, even if its very simple.

Metadata

Metadata

Assignees

Labels

priority: p3Desirable enhancement or fix. May not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions