frinyvonnick / gitmoji-changelog

A changelog generator for gitmoji 😜
https://www.npmjs.com/package/gitmoji-changelog
MIT License
387 stars 48 forks source link

Handle monorepos #158

Open frinyvonnick opened 4 years ago

frinyvonnick commented 4 years ago

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:

There was a discussion on the subject in issue #157

frinyvonnick commented 4 years ago

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

jpggvilaca commented 3 years ago

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?

thlmenezes commented 2 years ago

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
frinyvonnick commented 2 years ago

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

thlmenezes commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

@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