in infra/build.ts [52:85]
private _next() {
const project = this._queue.shift();
if (!project) {
if (!this._active) {
this._report();
}
return;
}
console.log(chalk.gray('Executing: ' + project));
const worker = new Worker(join(__dirname, 'build-project.js'), {
workerData: getTestCommand(project)
});
this._active++;
worker.on('message', message => {
this._outputs.push({
project,
message
});
console.log(
'Execution of',
project,
message.success ? chalk.green('successful') : chalk.red('failed')
);
});
worker.on('exit', () => {
this._active--;
this._next();
});
worker.on('error', err => {
console.error(err);
this._active--;
this._next();
});
}