Skip to content

fix: generate commit link for breaking changes - #74

Merged
bluwy merged 5 commits into
vitejs:mainfrom
btea:feat/extend-changelog-mainTemplate
Jul 30, 2025
Merged

fix: generate commit link for breaking changes#74
bluwy merged 5 commits into
vitejs:mainfrom
btea:feat/extend-changelog-mainTemplate

Conversation

@btea

@btea btea commented Jul 19, 2025

Copy link
Copy Markdown
Contributor

There is no corresponding commit link in the breaking changes group of the latest generated changelog, which makes it inconvenient to view.

image

@bluwy

bluwy commented Jul 21, 2025

Copy link
Copy Markdown
Member

Just making sure, can you show how the changelog would look like with this change? I found the original mainTemplate is:

{{> header}}
{{#if noteGroups}}
{{#each noteGroups}}

### ⚠ {{title}}

{{#each notes}}
* {{#if commit.scope}}**{{commit.scope}}:** {{/if}}{{text}}
{{/each}}
{{/each}}
{{/if}}
{{#each commitGroups}}

{{#if title}}
### {{title}}

{{/if}}
{{#each commits}}
{{> commit root=@root}}
{{/each}}
{{/each}}

(Same as this file) which is quite different from the change you're making here.

@btea

btea commented Jul 21, 2025

Copy link
Copy Markdown
Contributor Author

I updated the template and the results are shown below.

before after
image image

@bluwy

bluwy commented Jul 21, 2025

Copy link
Copy Markdown
Member

Thanks! Would it also be possible to generate a link for the PR number? It also looks like it's missing a space between the pr number and commit hash parentheses.

@btea

btea commented Jul 21, 2025

Copy link
Copy Markdown
Contributor Author

The commit object structure is as follows. The PR number cannot be obtained directly, so commit.subject is used instead of text. Although the concatenated path is issue, clicking it will automatically jump to the PR path.

image

Here are the latest build results.

image

@btea

btea commented Jul 23, 2025

Copy link
Copy Markdown
Contributor Author

cc @sapphi-red

Comment thread src/changelog.ts Outdated
btea and others added 2 commits July 24, 2025 16:37
Co-authored-by: 翠 <green@sapphi.red>

@sapphi-red sapphi-red left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This looks good to me

@bluwy bluwy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@bluwy bluwy changed the title feat: extend changelog mainTemplate fix: generate commit link for breaking changes Jul 30, 2025
@bluwy
bluwy merged commit 7ee06d9 into vitejs:main Jul 30, 2025
1 check passed
@btea
btea deleted the feat/extend-changelog-mainTemplate branch July 30, 2025 01:02
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.

3 participants