Skip to content

Commit

Permalink
fix: update progress bar gradually as plugin run complete
Browse files Browse the repository at this point in the history
  • Loading branch information
vmasek committed Dec 9, 2024
1 parent 37092ab commit 7a592eb
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions packages/core/src/lib/implementation/execute-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,19 +156,15 @@ export async function executePlugins(

const progressBar = progress ? getProgressBar('Run plugins') : null;

const pluginsResult = await plugins.reduce(
async (acc, pluginCfg) => [
...(await acc),
wrapProgress(pluginCfg, plugins.length, progressBar),
],
Promise.resolve([] as Promise<PluginReport>[]),
const pluginsResult = plugins.map(pluginCfg =>
wrapProgress(pluginCfg, plugins.length, progressBar),
);

progressBar?.endProgress('Done running plugins');

const errorsTransform = ({ reason }: PromiseRejectedResult) => String(reason);
const results = await Promise.allSettled(pluginsResult);

progressBar?.endProgress('Done running plugins');

logMultipleResults(results, 'Plugins', undefined, errorsTransform);

const { fulfilled, rejected } = groupByStatus(results);
Expand Down

0 comments on commit 7a592eb

Please sign in to comment.