Consolidate changes by affected packages#18
Conversation
We're stripping a fixed-size prefix based on "packages/" being at the beginning of the file path. Better be sure that's where it is.
Dedupe into an object for key collision rather than list scan.
Just need to look at the diff for the single (maybe merge) commit.
|
|
||
| const heading = changedPackages.length > 0 | ||
| ?"* "+changedPackages.map(pkg => "`" + pkg + "`").join(", ") | ||
| :"* Other"; // No changes to packages, but still relevant. |
There was a problem hiding this comment.
This is worth mentioning: Previously changes with no associated packages bumped out to the outer list level. This branch moves them into an "Other" group. These are changes that get assigned to a changelog category but don't affect any packages.
There was a problem hiding this comment.
Good point I just choose to ignore those (top level changes) or manually add it in but it makes sense to have
|
@hzoo - This look okay to you? |
|
hard to say haha - if we had a test or two this would be nice. probably fine. maybe we can split up logic into multiple simpler functions most of this stuff is just data -> string so it shouldn't be too bad |
|
Yeah, I'd like to set up tests with repo fixtures like @thejameskyle suggested. I'd like to use some helpers from lerna's tests (_initFixture, _assertStubbedCalls, ...), but it's a shame to just duplicate them. I half-joked on slack that lerna should be a lerna repo with Anyway, yes: I'll split this up into smaller unit-testable functions. |
|
We can go ahead a merge given it's just us using it atm and we can make quick changes |
This addresses #16.
The diff wound up not so clean here, unfortunately. I also made some changes to to how the list of affected packages is generated. These may be more legible in their logical commits.