diff --git a/e2e/flows/id-with-wildcard.e2e.2.ts b/e2e/flows/id-with-wildcard.e2e.2.ts index 5fd597fc82c2..1a9fe580fa45 100644 --- a/e2e/flows/id-with-wildcard.e2e.2.ts +++ b/e2e/flows/id-with-wildcard.e2e.2.ts @@ -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 () { diff --git a/scopes/component/lister/index.ts b/scopes/component/lister/index.ts index b1a648dd1db7..9ae5db0bb798 100644 --- a/scopes/component/lister/index.ts +++ b/scopes/component/lister/index.ts @@ -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 }; diff --git a/scopes/component/lister/lister.main.runtime.ts b/scopes/component/lister/lister.main.runtime.ts index 34213e4b8cc1..0a2cf2a35664 100644 --- a/scopes/component/lister/lister.main.runtime.ts +++ b/scopes/component/lister/lister.main.runtime.ts @@ -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; diff --git a/scopes/component/lister/no-id-match-wildcard.ts b/scopes/component/lister/no-id-match-wildcard.ts new file mode 100644 index 000000000000..1f5d0a3d5de8 --- /dev/null +++ b/scopes/component/lister/no-id-match-wildcard.ts @@ -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(', ')}`); + } +} diff --git a/src/api/consumer/lib/exceptions/no-id-match-wildcard.ts b/src/api/consumer/lib/exceptions/no-id-match-wildcard.ts deleted file mode 100644 index 0748df09a737..000000000000 --- a/src/api/consumer/lib/exceptions/no-id-match-wildcard.ts +++ /dev/null @@ -1,10 +0,0 @@ -import AbstractError from '../../../../error/abstract-error'; - -export default class NoIdMatchWildcard extends AbstractError { - idsWithWildcards: string[]; - - constructor(idsWithWildcards: string[]) { - super(); - this.idsWithWildcards = idsWithWildcards; - } -} diff --git a/src/cli/default-error-handler.ts b/src/cli/default-error-handler.ts index b37772f2c6a1..e78f9757baae 100644 --- a/src/cli/default-error-handler.ts +++ b/src/cli/default-error-handler.ts @@ -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'; @@ -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)