do not throw execa error when building ts refs (#102154)
This commit is contained in:
parent
aea2a384fd
commit
5c90bacce5
|
@ -13,12 +13,20 @@ import { ToolingLog, REPO_ROOT } from '@kbn/dev-utils';
|
|||
|
||||
export const REF_CONFIG_PATHS = [Path.resolve(REPO_ROOT, 'tsconfig.refs.json')];
|
||||
|
||||
export async function buildAllTsRefs(log: ToolingLog) {
|
||||
export async function buildAllTsRefs(log: ToolingLog): Promise<{ failed: boolean }> {
|
||||
for (const path of REF_CONFIG_PATHS) {
|
||||
const relative = Path.relative(REPO_ROOT, path);
|
||||
log.debug(`Building TypeScript projects refs for ${relative}...`);
|
||||
await execa(require.resolve('typescript/bin/tsc'), ['-b', relative, '--pretty'], {
|
||||
cwd: REPO_ROOT,
|
||||
});
|
||||
const { failed, stdout } = await execa(
|
||||
require.resolve('typescript/bin/tsc'),
|
||||
['-b', relative, '--pretty'],
|
||||
{
|
||||
cwd: REPO_ROOT,
|
||||
reject: false,
|
||||
}
|
||||
);
|
||||
log.info(stdout);
|
||||
if (failed) return { failed };
|
||||
}
|
||||
return { failed: false };
|
||||
}
|
||||
|
|
|
@ -69,7 +69,11 @@ export async function runTypeCheckCli() {
|
|||
process.exit();
|
||||
}
|
||||
|
||||
await buildAllTsRefs(log);
|
||||
const { failed } = await buildAllTsRefs(log);
|
||||
if (failed) {
|
||||
log.error('Unable to build TS project refs');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const tscArgs = [
|
||||
// composite project cannot be used with --noEmit
|
||||
|
|
Loading…
Reference in a new issue