[ts] Check .d.ts files for all projects in typeCheck (#114295)

* enable --skip-lib-check for all projects in typeCheck and fix existing issues

* fix graph types

* transpile TS to ES2019, but not all the way back to es5

Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Spencer 2021-10-13 10:45:27 -05:00 committed by GitHub
parent da8264f26a
commit 6c5dd08712
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 23 deletions

View file

@ -53,23 +53,8 @@ export async function runTypeCheckCli() {
}
}
const nonCompositeProjects = projects.filter((p) => !p.isCompositeProject());
if (!nonCompositeProjects.length) {
if (projectFilter) {
log.success(
`${flags.project} is a composite project so its types are validated by scripts/build_ts_refs`
);
} else {
log.success(
`All projects are composite so their types are validated by scripts/build_ts_refs`
);
}
return;
}
const concurrency = Math.min(4, Math.round((Os.cpus() || []).length / 2) || 1) || 1;
log.info('running type check in', nonCompositeProjects.length, 'non-composite projects');
log.info('running type check in', projects.length, 'projects');
const tscArgs = [
...['--emitDeclarationOnly', 'false'],
@ -81,7 +66,7 @@ export async function runTypeCheckCli() {
];
const failureCount = await lastValueFrom(
Rx.from(nonCompositeProjects).pipe(
Rx.from(projects).pipe(
mergeMap(async (p) => {
const relativePath = Path.relative(process.cwd(), p.tsConfigPath);

View file

@ -5,6 +5,6 @@
* 2.0.
*/
import { Workspace, WorkspaceOptions } from '../types';
import { Workspace, WorkspaceOptions } from '../../types';
declare function createWorkspace(options: WorkspaceOptions): Workspace;

View file

@ -6,7 +6,7 @@
*/
declare module 'puid' {
declare class Puid {
class Puid {
generate(): string;
}

View file

@ -8,15 +8,14 @@
"target/**/*"
],
"compilerOptions": {
"target": "es5",
"lib": ["es5", "dom"],
"target": "ES2019",
"outDir": "target/types",
"types": [
"cypress",
"cypress-pipe",
"node"
"node",
"resize-observer-polyfill",
],
"resolveJsonModule": true,
},
"references": [
{ "path": "../tsconfig.json" }