Skip to content

Commit

Permalink
refactor, move NoIdMatchWildcard from legacy to teambit/lister (#8994)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidfirst committed Jul 1, 2024
1 parent 7f5db9c commit b7eaeb8
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 18 deletions.
2 changes: 1 addition & 1 deletion e2e/flows/id-with-wildcard.e2e.2.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { NoIdMatchPattern } from '@teambit/scope';
import { expect } from 'chai';

import NoIdMatchWildcard from '../../src/api/consumer/lib/exceptions/no-id-match-wildcard';
import { NoIdMatchWildcard } from '@teambit/lister';
import Helper from '../../src/e2e-helper/e2e-helper';

describe('component id with wildcard', function () {
Expand Down
1 change: 1 addition & 0 deletions scopes/component/lister/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ListerAspect } from './lister.aspect';

export type { ListerMain } from './lister.main.runtime';
export { NoIdMatchWildcard } from './no-id-match-wildcard';
export default ListerAspect;
export { ListerAspect };
4 changes: 2 additions & 2 deletions scopes/component/lister/lister.main.runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import { ConsumerNotFound } from '@teambit/legacy/dist/consumer/exceptions';
import { Remote } from '@teambit/legacy/dist/remotes';
import getRemoteByName from '@teambit/legacy/dist/remotes/get-remote-by-name';
import ComponentsList from '@teambit/legacy/dist/consumer/component/components-list';
import { BitError } from '@teambit/bit-error';
import { ListCmd } from './list.cmd';
import { ListerAspect } from './lister.aspect';
import NoIdMatchWildcard from '@teambit/legacy/dist/api/consumer/lib/exceptions/no-id-match-wildcard';
import { BitError } from '@teambit/bit-error';
import { NoIdMatchWildcard } from './no-id-match-wildcard';

export type ListScopeResult = {
id: ComponentID;
Expand Down
7 changes: 7 additions & 0 deletions scopes/component/lister/no-id-match-wildcard.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { BitError } from '@teambit/bit-error';

export class NoIdMatchWildcard extends BitError {
constructor(public idsWithWildcards: string[]) {
super(`unable to find component ids that match the following: ${idsWithWildcards.join(', ')}`);
}
}
10 changes: 0 additions & 10 deletions src/api/consumer/lib/exceptions/no-id-match-wildcard.ts

This file was deleted.

5 changes: 0 additions & 5 deletions src/cli/default-error-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import chalk from 'chalk';
import { BitError } from '@teambit/bit-error';
import { Analytics, LEVEL } from '@teambit/legacy.analytics';
import NoIdMatchWildcard from '../api/consumer/lib/exceptions/no-id-match-wildcard';
import { BASE_DOCS_DOMAIN } from '../constants';
import { InvalidBitMap, MissingMainFile } from '../consumer/bit-map/exceptions';
import OutsideRootDir from '../consumer/bit-map/exceptions/outside-root-dir';
Expand Down Expand Up @@ -209,10 +208,6 @@ please use "bit remove" to delete the component or "bit add" with "--main" and "
})
.join(' '),
],
[
NoIdMatchWildcard,
(err) => `unable to find component ids that match the following: ${err.idsWithWildcards.join(', ')}`,
],
[
NewerVersionFound,
// err => JSON.stringify(err.newerVersions)
Expand Down

0 comments on commit b7eaeb8

Please sign in to comment.