absolute-version / commit-and-tag-version

Fork of the excellent standard-version. Automate versioning and CHANGELOG generation, with semver.org and conventionalcommits.org :trophy:
ISC License
360 stars 33 forks source link

Show changelog only for changes in a subfolder #149

Open davidsneighbour opened 2 months ago

davidsneighbour commented 2 months ago

I have a mono repo which sets up various modules in subfolders:

/modules/module1 /modules/module2 ...

With tags formatted as modules/module1/v1.2.3 and modules/module2/v1.2.3.

Is it possible to enable changelog generation that loads only those changes within one of these folders between tags with that name? I am able to retrieve the current tag and the next tag, so that would probably just be done with CLI parameters, but I am unsure about the changelog generation. Is there a way to "pipe" a custom list of commits into the script?

TimothyJones commented 2 months ago

I don’t believe there currently is an easy way, but I agree, this would be a clearly useful use case

gurukulkarni commented 1 month ago

Exactly, I think there are generally much less tools supporting monorepos this way and makes me think either the tooling has not caught up or I am incapable of finding it. What would be amazing is, not only restrict to subfolders but also only consider commits that change files in given subfolders and only take tags pointing to commits that change said subfolder.

This would allow something like :

repo >
   module-1 >
        m1-1
        m1-2 
   module-2 >
         m2-1
         m2-2

then when run against module-1 just consider commits and tags from that one and bump and create changelog restricting to only that directory. I'm not good with javascript but will try to have a look when I have time if this is possible to do :)