flaviostutz / monotag

Semantic versioning for monorepos based on tag prefix, path prefix, affected files and conventional commit
MIT License
11 stars 1 forks source link

Release notes structure #28

Open MarcioMeier opened 3 months ago

MarcioMeier commented 3 months ago

Problem being solved

Release notes quality.

This is the release notes generated for the cdk-practical-constructs library. image

It included all the commit messages and don't give a clear idea of what is being changed in the pull requests as it only logs the compare branch name. It also doesn't give a nice link to the pull requests, so I'd need to go through PR list and click on each one to have a better view of the changes...

Proposal

I see that many open source libraries uses the following pattern:

### SCOPE (feat/core/docs/test/ etc...)

- pull request name (#pull request number)

authors: [@githubTag, ...]

So the the given example from cdk-practical-constructs library would have the following release notes:

image

flaviostutz commented 3 months ago

I really see your point! Should we ignore all other commit messages that are not related to a PR then?

MarcioMeier commented 3 months ago

The concern of making this change is that the library will become tied to the github-flow.

With it, people that only commit in the branch, or use another way of merging branches will be impacted.

We could add this behaviour as parameter, so whoever is using it can decide on which pattern to generate the release notes.

flaviostutz commented 3 months ago

You mean we could use a filter regex to define which commit messages would be used on the notes?

MarcioMeier commented 3 months ago

We could add a parameter to define the strategy for the release notes.

e.g.

import { nextTag } from 'monotag';

const nt = await nextTag({
  repoDir: 'repos/myrepo',
  toRef: 'HEAD',
  path: 'modules/mymodule',

  /**
  /* the strategy to generate the release notes content
  /* {'commit' | 'github-flow'} strategy
  /* @default 'commit'
  /**/
  strategy: 'github-flow'
});

This strategy would generate release notes like the one I suggested in the issue description.