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

Fix tag prefix #84

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jordanrastrick
Copy link

@jordanrastrick jordanrastrick commented Feb 27, 2024

Addresses the issues raised here.

Two fixes to the functioning of tagPrefix:

  • If the tagPrefix option is explicitly given in settings, don't override it with the derived prefix from tagName.
  • If the ${npm.name} variable is present in tagPrefix, interpolate it's value before passing through to conventional-recommended-bump

Caveats:

  • Does not address interpolating any other variable except npm.name (which presumably would be much less common in tagPrefix) - I'm not familiar enough with the release-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.

@jordanrastrick
Copy link
Author

@webpro Here's my PR as you suggested, let me know if it makes sense to you.

Copy link
Contributor

@webpro webpro left a 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
Copy link
Contributor

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')

@jordanrastrick
Copy link
Author

Sorry @webpro, I'm only using this package in private repositories that can't be shared.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants