gitmoji-changelog icon indicating copy to clipboard operation
gitmoji-changelog copied to clipboard

Handle monorepos

Open frinyvonnick opened this issue 4 years ago • 7 comments

gitmoji-changelog should handle monorepo. Currently we use tags to get a list of versions and commits for those. A monorepo can have multiple packages having independent versions. We need to find a solution so gitmoji-changelog can be called in a package folder and generate a changelog for this particular package that is correct.

Problems:

  • Having multiple tags and get only those related to a package
  • Get commits that affected a particular folder

There was a discussion on the subject in issue #157

frinyvonnick avatar Jan 02 '20 11:01 frinyvonnick

Quick search: semantic-release-monorepo sounds to have good propositions on the subject.

frinyvonnick avatar Jan 02 '20 12:01 frinyvonnick

Any updates on this? Would it be nice to have a changelog for a single package within a monorepo. Any ideas? or other packages that might do this already?

jpggvilaca avatar May 05 '21 08:05 jpggvilaca

Any updates here? About getting commits from a specific folder, there could be some investigation on other tools like standard-version

>>> npx standard-version --help | grep path
    --path  Only populate commits made under this path  [string]

Could not find any doc around the inner workings of this param in a few minutes of research, will edit comment if I do.

But my educated guess would be the usage of git log with the path parameter

>>> git log -- apps/app
# show only commits related to apps/app path

thlmenezes avatar Mar 01 '22 15:03 thlmenezes

I don't have time to work on this right now but if someone is interested in contributing I could give some help 😄

frinyvonnick avatar Mar 01 '22 16:03 frinyvonnick

My other educated guess, by my quick read through the codebase, is that the responsible for selecting the commits to the changelog is getCommits method from packages/gitmoji-changelog-core/src/fromGitFile.js.

I saw that you use git-raw-commits to fetch commits, and they have an option path

I can see a light at the end

thlmenezes avatar Mar 01 '22 16:03 thlmenezes

I don't have time to work on this right now but if someone is interested in contributing I could give some help smile

Thanks for the quick reply, I don't know about the first problem, but I think I can help with the paths; will create a fork and work over the weekend.

Love the work btw, really organized code, and happy to contribute.

thlmenezes avatar Mar 01 '22 16:03 thlmenezes

@frinyvonnick The only thing I'd like to ask right away is if you have any ideia on writing the test case for this scenario, saw packages/gitmoji-changelog-core/src/index.spec.js, and I believe the path is inside the commit hash

thlmenezes avatar Mar 01 '22 16:03 thlmenezes