Skip to content

How to include dynamic link to unreleased features in CHANGELOG header #58

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

Closed
anishkny opened this issue Feb 22, 2023 · 5 comments
Closed
Labels
question Further information is requested

Comments

@anishkny
Copy link

First up thanks for forking standard-version and shepherding it on - cheers! 🎉

I have been trying to figure this out but can't.

I would like to include something like the following in my generated CHANGELOG header:

For unreleased features, see: {{host}}/{{owner}}/{{repository}}/compare/{{currentTag}}...main

So for example, in my project integrify, the link would point to: anishkny/integrify@v4.1.1...main . This lets you see a list of commits landed on main but not released yet.

I need the tags interpolated in the changelog header. Is this possible?

Crossposted for visibility from: #45

@anishkny anishkny added the question Further information is requested label Feb 22, 2023
@TimothyJones
Copy link
Member

Thanks for the kind words!

Interesting use case… the rationale for this tool is to wrap the conventional-commits packages and expose them in an easy-to-use way. If it’s possible to get their packages to do it, it might then be straightforward to expose in this tool.

@TimothyJones
Copy link
Member

I’m travelling at the moment, so it’s not easy to link you to the code, but I think the place to start would be a custom headerPartial sent to conventional-changelog-writer, which I believe this repository calls.

@anishkny
Copy link
Author

Sorry to bother you while you travel - this is not urgent fyi.

So there is already a --header option in commit-and-tag-version. I wonder if it can be enhanced to accept templates.

Something like:

commit-and-tag-version  --header \
  'For unreleased features, see: {{host}}/{{owner}}/{{repository}}/compare/{{currentTag}}...main'

Currently the above does not interpolate but simply outputs the header as is.

I tried looking into conventional-commits to figure out the config but it seems quite convoluted!

@TimothyJones
Copy link
Member

Apologies for the delay in returning to this one.

(As an aside, I think something like "See the commits since the latest release at https://github.com/absolute-version/commit-and-tag-version/commits/master" would do the job almost as well)

It's certainly possible to add a templating engine. I'm not sure it's worth the additional complexity for a fairly niche use case, though.

Relatedly, I think maybe it doesn't fall under the north star for this project, which is:

A utility for versioning using semver and CHANGELOG generation powered by Conventional Commits.

I think probably the "right" place would be to add the ability to template the header in the conventional commits dependency, which then would put it in the realm of things that this tool should support.

If the conventional commits dependencies support this use case, then I'm happy to expose it.

@anishkny
Copy link
Author

"Commits since latest release" link to commits on main is actually not a bad idea all things considered. Thanks for the suggestion!

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

No branches or pull requests

2 participants