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

improvement(import), log the scope-name when failed to list components #9487

Merged
merged 1 commit into from
Jan 22, 2025
Merged
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
10 changes: 7 additions & 3 deletions scopes/scope/importer/import-components.ts
Original file line number Diff line number Diff line change
@@ -32,6 +32,7 @@ import { WorkspaceConfigUpdateResult } from '@teambit/config-merger';
import { Logger } from '@teambit/logger';
import { DependentsGetter } from './dependents-getter';
import { ListerMain, NoIdMatchWildcard } from '@teambit/lister';
import { pMapPool } from '@teambit/toolbox.promise.map-pool';

const BEFORE_IMPORT_ACTION = 'importing components';

@@ -424,8 +425,9 @@ if you just want to get a quick look into this snap, create a new workspace and

private async getBitIdsForNonLanes() {
const bitIds: ComponentID[] = [];
await Promise.all(
this.options.ids.map(async (idStr: string) => {
await pMapPool(
this.options.ids,
async (idStr: string) => {
if (hasWildcard(idStr)) {
let ids: ComponentID[] = [];
try {
@@ -434,6 +436,7 @@ if you just want to get a quick look into this snap, create a new workspace and
if (err instanceof NoIdMatchWildcard) {
this.logger.consoleWarning(err.message);
} else {
this.logger.error(`failed getting the list of components by the wildcard ${idStr}`);
throw err;
}
}
@@ -442,7 +445,8 @@ if you just want to get a quick look into this snap, create a new workspace and
const id = await this.getIdFromStr(idStr);
bitIds.push(id);
}
})
},
{ concurrency: 30 }
);

this.logger.setStatusLine(BEFORE_IMPORT_ACTION); // it stops the previous loader of BEFORE_REMOTE_LIST