From 7c6a40ea34872a1c08ac5c1e01c19c99e1742030 Mon Sep 17 00:00:00 2001 From: restrry Date: Tue, 29 Sep 2020 18:26:26 +0300 Subject: [PATCH] address mistic comments --- src/dev/typescript/build_refs.ts | 8 +++++++- src/dev/typescript/run_type_check_cli.ts | 5 ++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/dev/typescript/build_refs.ts b/src/dev/typescript/build_refs.ts index 4b01bb1f0c04a..de006bd674e87 100644 --- a/src/dev/typescript/build_refs.ts +++ b/src/dev/typescript/build_refs.ts @@ -18,9 +18,15 @@ */ import execa from 'execa'; +import Path from 'path'; import { run, ToolingLog } from '@kbn/dev-utils'; -export async function buildRefs(log: ToolingLog, projectPath: string) { +export async function buildAllRefs(log: ToolingLog) { + await buildRefs(log, 'tsconfig.refs.json'); + await buildRefs(log, Path.join('x-pack', 'tsconfig.refs.json')); +} + +async function buildRefs(log: ToolingLog, projectPath: string) { try { log.debug(`Building TypeScript projects refs for ${projectPath}...`); await execa(require.resolve('typescript/bin/tsc'), ['-b', projectPath]); diff --git a/src/dev/typescript/run_type_check_cli.ts b/src/dev/typescript/run_type_check_cli.ts index 6eb952550ab1f..c52b9454c28be 100644 --- a/src/dev/typescript/run_type_check_cli.ts +++ b/src/dev/typescript/run_type_check_cli.ts @@ -24,7 +24,7 @@ import getopts from 'getopts'; import { execInProjects } from './exec_in_projects'; import { filterProjectsByFlag } from './projects'; -import { buildRefs } from './build_refs'; +import { buildAllRefs } from './build_refs'; export async function runTypeCheckCli() { const extraFlags: string[] = []; @@ -80,8 +80,7 @@ export async function runTypeCheckCli() { process.exit(); } - await buildRefs(log, 'tsconfig.refs.json'); - await buildRefs(log, 'x-pack/tsconfig.refs.json'); + await buildAllRefs(log); const tscArgs = [ // composite project cannot be used with --noEmit