Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consolidate changes by affected packages #18

Merged
merged 5 commits into from
Jun 17, 2016

Conversation

gigabo
Copy link
Contributor

@gigabo gigabo commented May 31, 2016

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.

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.
gigabo added a commit to redfin/react-server that referenced this pull request May 31, 2016

const heading = changedPackages.length > 0
?"* "+changedPackages.map(pkg => "`" + pkg + "`").join(", ")
:"* Other"; // No changes to packages, but still relevant.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point I just choose to ignore those (top level changes) or manually add it in but it makes sense to have

@gigabo
Copy link
Contributor Author

gigabo commented Jun 3, 2016

@hzoo - This look okay to you?

@hzoo
Copy link
Contributor

hzoo commented Jun 3, 2016

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

@gigabo
Copy link
Contributor Author

gigabo commented Jun 3, 2016

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 lerna and lerna-changelog as packages, but that would actually help with sharing stuff like test helpers between projects. It would also allow using lerna-changelog to generate a changelog for lerna itself.

Anyway, yes: I'll split this up into smaller unit-testable functions.

@hzoo
Copy link
Contributor

hzoo commented Jun 17, 2016

We can go ahead a merge given it's just us using it atm and we can make quick changes

@hzoo hzoo merged commit 9da34a6 into lerna:master Jun 17, 2016
davidalber pushed a commit to davidalber/react-server that referenced this pull request Jul 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants