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

Avoid adding unneeded overrides to workspace config upon import #2257

Merged
merged 1 commit into from
Jan 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [unreleased]

- [#2255](https://github.com/teambit/bit/issues/2255) avoid adding unneeded overrides upon import
- [#2247](https://github.com/teambit/bit/issues/2247) improve auto-tag output

## [[14.7.2] - 2020-01-12](https://github.com/teambit/bit/releases/tag/v14.7.2)
Expand Down
15 changes: 15 additions & 0 deletions e2e/functionalities/workspace-config.e2e.3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1717,4 +1717,19 @@ describe('workspace config', function() {
});
});
});
describe('export a component with compiler then import', () => {
before(() => {
helper.scopeHelper.setNewLocalAndRemoteScopes();
helper.fixtures.createComponentBarFoo();
helper.fixtures.addComponentBarFoo();
helper.env.importDummyCompiler();
helper.command.tagAllComponents();
helper.command.exportAllComponents();
helper.command.importComponent('bar/foo');
});
it('should not add the component into the overrides of the workspace because nothing has changed', () => {
const bitJson = helper.bitJson.read();
expect(bitJson).to.not.have.property('overrides');
});
});
});
2 changes: 1 addition & 1 deletion src/consumer/config/consumer-overrides.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export default class ConsumerOverrides {
): boolean {
// seems like R.equals does a great job here. it compares objects by values (not by reference).
// also it disregards the keys order.
return R.equals(overridesA, overridesB);
return R.equals(overridesA || {}, overridesB || {});
}

findExactMatch(bitId: BitId): string | null | undefined {
Expand Down