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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected arrangement of the group headings of the changelog #3

Closed
jrson83 opened this issue Apr 26, 2024 · 3 comments
Closed

Unexpected arrangement of the group headings of the changelog #3

jrson83 opened this issue Apr 26, 2024 · 3 comments

Comments

@jrson83
Copy link

jrson83 commented Apr 26, 2024

Hey it's me again 馃榿

After building the initial changelogs for the single packages in my monorepo, I notice that the arrangement of the group headings is sorted alphabetically. The repo has not enabled Linear History and I used Merge for my PR's.

I have not found any specification related Conventional Commit Changelog heading order, but this issue conventional-changelog/conventional-changelog-config-spec/issues/36, but I also do not know which changelog conventions your generator follows.

When looking at the most changelogs using Conventional Commit format, Features is the most top heading. I wonder if there is a convention for the heading order, or if it has something todo with the repo setup, or commit order, since when looking at your changelog, it has the right order.

@adam-coster
Copy link
Member

I think this is where my sort order is coming from:

const groups = Object.keys(version.groups).sort();

@jrson83
Copy link
Author

jrson83 commented May 1, 2024

Thank you! I just came up with the simple solution:

const sortOrder = [
  'Features',
  'Code Refactoring',
  'Bug Fixes',
  'Reverts',
  'Builds',
  'Performance Improvements',
  'Styles',
  'Documentation',
  'Tests',
]

// ....
const groups = Object.keys(version.groups).sort(
  (a, b) => sortOrder.indexOf(a) - sortOrder.indexOf(b)
)

@jrson83 jrson83 closed this as completed May 1, 2024
@adam-coster
Copy link
Member

Perfect!

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

No branches or pull requests

2 participants