Skip to content

Commit 3acbef1

Browse files
authored
suppress relative-import errors on legacy workspace (#2785)
these errors/warnings should appear only on Harmony when it's easy to fix and continue.
1 parent bae761b commit 3acbef1

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

e2e/commands/import.e2e.1.ts

+1
Original file line numberDiff line numberDiff line change
@@ -843,6 +843,7 @@ describe('bit import', function() {
843843
helper.fixtures.addComponentUtilsIsString();
844844
helper.fixtures.createComponentBarFoo(fixtures.barFooFixture);
845845
helper.fixtures.addComponentBarFoo();
846+
helper.command.expectStatusToNotHaveIssues();
846847
helper.command.tagAllComponents();
847848
helper.command.exportAllComponents();
848849
helper.scopeHelper.reInitLocalScope();

src/api/consumer/lib/status.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import R from 'ramda';
12
import { loadConsumer } from '../../../consumer';
23
import ComponentsList from '../../../consumer/component/components-list';
34
import Component from '../../../consumer/component';
@@ -46,7 +47,10 @@ export default (async function status(): Promise<StatusResult> {
4647
const newAndModified: BitId[] = newComponents.concat(modifiedComponent);
4748
// @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
4849
const componentsWithMissingDeps = newAndModified.filter((component: Component) => {
49-
return Boolean(component.issues);
50+
if (consumer.isLegacy && component.issues) {
51+
delete component.issues.relativeComponentsAuthored;
52+
}
53+
return Boolean(component.issues) && !R.isEmpty(component.issues);
5054
});
5155
Analytics.setExtraData('new_components', newComponents.length);
5256
Analytics.setExtraData('staged_components', stagedComponents.length);

src/e2e-helper/e2e-command-helper.ts

+7
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,13 @@ export default class CommandHelper {
268268
});
269269
}
270270

271+
expectStatusToNotHaveIssues() {
272+
const statusJson = this.statusJson();
273+
['componentsWithMissingDeps', 'invalidComponents'].forEach(key => {
274+
expect(statusJson[key], `status.${key} should be empty`).to.have.lengthOf(0);
275+
});
276+
}
277+
271278
statusComponentIsStaged(id: string): boolean {
272279
const status = this.statusJson();
273280
return status.stagedComponents.includes(id);

0 commit comments

Comments
 (0)