-
Notifications
You must be signed in to change notification settings - Fork 36
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
Fix tag prefix #84
base: master
Are you sure you want to change the base?
Fix tag prefix #84
Conversation
@webpro Here's my PR as you suggested, let me know if it makes sense to you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the pull request. Do you have a public repo where we can see this in action? We could maybe create a test, but probably better/easier to have something with only real parts and no mocks.
index.js
Outdated
@@ -35,8 +36,14 @@ class ConventionalChangelog extends Plugin { | |||
const { options } = this; | |||
this.debug({ increment, latestVersion, isPreRelease, preReleaseId }); | |||
this.debug('conventionalRecommendedBump', { options }); | |||
let { tagPrefix } = options | |||
const npmName = this.config?.contextOptions?.npm?.name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use this.config.getContext('npm.name')
a078fb1
to
bc8bb2d
Compare
Sorry @webpro, I'm only using this package in private repositories that can't be shared. |
Addresses the issues raised here.
Two fixes to the functioning of
tagPrefix
:tagPrefix
option is explicitly given in settings, don't override it with the derived prefix fromtagName
.${npm.name}
variable is present intagPrefix
, interpolate it's value before passing through toconventional-recommended-bump
Caveats:
Does not address interpolating any other variable except
npm.name
(which presumably would be much less common intagPrefix
) - I'm not familiar enough with therelease-it
architecture to see how to do this well.These are conservative changes in that they shouldn't affect people not trying to use these options/variables.