Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't access prerelease option when building versioning strategy #2132

Closed
lukekarrys opened this issue Nov 15, 2023 · 1 comment · Fixed by #2133
Closed

Can't access prerelease option when building versioning strategy #2132

lukekarrys opened this issue Nov 15, 2023 · 1 comment · Fixed by #2133
Assignees
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@lukekarrys
Copy link
Contributor

Is your feature request related to a problem? Please describe.

I would like to use the prerelease option to control the versioning strategy used. Currently this isn't possible without some workarounds since prerelease is not part of the VersioningStrategyFactoryOptions interface.

Describe the solution you'd like

Add prerelease to the VersioningStrategyFactoryOptions interface so it is available when buildVersioningStrategy is called. Then in my code I would be able to do:

ReleasePlease.registerVersioningStrategy('default', (options) => {
  if (options.prerelease) {
    return new PrereleaseVersioningStrategy(options)
  } else {
    return new DefaultVersioningStrategy(options)
  }
})

Describe alternatives you've considered

Using the versioning-strategy: "prerelease" config instead. This will work but I would like to only have to set prerelease: true and then use that flag to change the versioning strategy at runtime.

Additional context

This might be considered overloading the prerelease option, since it currently only controls whether the GitHub release is a prerelease or not. But I think making it available to the versioning strategy makes sense outside of my use case as well.

@lukekarrys lukekarrys added priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. labels Nov 15, 2023
@lukekarrys
Copy link
Contributor Author

I also think that a future breaking change could set versioning-strategy: "prerelease" based on the prerelease config. But I can open a future discussion for that based on the result of this feature request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
@chingor13 @lukekarrys and others