From d91d299809f33623cc1c6e390160e680c616efbb Mon Sep 17 00:00:00 2001 From: John Schulz Date: Tue, 9 Feb 2021 08:55:42 -0500 Subject: [PATCH] [Fleet] Use TS project references (#87574) (#90748) ## Summary * Added references to all dependencies https://github.com/elastic/kibana/blob/6bc6f3459a120eddfae70ad2fc7e4669e3a996b0/x-pack/plugins/fleet/tsconfig.json#L17-L38 * `node scripts/check_ts_projects` is successful * `node scripts/build_ts_refs` is successful
node --max-old-space-size=4096 ./node_modules/.bin/tsc -p tsconfig.json --extendedDiagnostics --noEmit ``` Files: 1436 Lines: 267372 Nodes: 1016769 Identifiers: 361835 Symbols: 250405 Types: 31105 Instantiations: 57570 Memory used: 347817K Assignability cache size: 5597 Identity cache size: 3073 Subtype cache size: 2140 Strict subtype cache size: 1012 I/O Read time: 0.49s Parse time: 3.84s ResolveModule time: 1.59s ResolveTypeReference time: 0.16s Program time: 7.46s Bind time: 1.87s Check time: 4.02s printTime time: 0.00s Emit time: 0.00s Total time: 13.35s ```
--- x-pack/plugins/fleet/tsconfig.json | 39 ++++++++++++++++++++++++++++++ x-pack/test/tsconfig.json | 5 ++++ x-pack/tsconfig.json | 1 + x-pack/tsconfig.refs.json | 1 + 4 files changed, 46 insertions(+) create mode 100644 x-pack/plugins/fleet/tsconfig.json diff --git a/x-pack/plugins/fleet/tsconfig.json b/x-pack/plugins/fleet/tsconfig.json new file mode 100644 index 00000000000000..3a37b14410424c --- /dev/null +++ b/x-pack/plugins/fleet/tsconfig.json @@ -0,0 +1,39 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "composite": true, + "outDir": "./target/types", + "emitDeclarationOnly": true, + "declaration": true, + "declarationMap": true + }, + "include": [ + // add all the folders containg files to be compiled + "common/**/*", + "public/**/*", + "server/**/*", + "scripts/**/*" + ], + "references": [ + { "path": "../../../src/core/tsconfig.json" }, + // add references to other TypeScript projects the plugin depends on + + // requiredPlugins from ./kibana.json + { "path": "../licensing/tsconfig.json" }, + { "path": "../../../src/plugins/data/tsconfig.json" }, + { "path": "../encrypted_saved_objects/tsconfig.json" }, + + // optionalPlugins from ./kibana.json + { "path": "../security/tsconfig.json" }, + { "path": "../features/tsconfig.json" }, + { "path": "../cloud/tsconfig.json" }, + { "path": "../../../src/plugins/usage_collection/tsconfig.json" }, + { "path": "../../../src/plugins/home/tsconfig.json" }, + + // requiredBundles from ./kibana.json + { "path": "../../../src/plugins/kibana_react/tsconfig.json" }, + { "path": "../../../src/plugins/es_ui_shared/tsconfig.json" }, + { "path": "../infra/tsconfig.json" }, + { "path": "../../../src/plugins/kibana_utils/tsconfig.json" }, + ] +} diff --git a/x-pack/test/tsconfig.json b/x-pack/test/tsconfig.json index 0a7a30f373e07f..468b6fb47781ed 100644 --- a/x-pack/test/tsconfig.json +++ b/x-pack/test/tsconfig.json @@ -45,6 +45,11 @@ { "path": "../plugins/code/tsconfig.json" }, { "path": "../plugins/console_extensions/tsconfig.json" }, { "path": "../plugins/dashboard_mode/tsconfig.json" }, + { "path": "../plugins/enterprise_search/tsconfig.json" }, + { "path": "../plugins/fleet/tsconfig.json" }, + { "path": "../plugins/global_search/tsconfig.json" }, + { "path": "../plugins/global_search_providers/tsconfig.json" }, + { "path": "../plugins/features/tsconfig.json" }, { "path": "../plugins/data_enhanced/tsconfig.json" }, { "path": "../plugins/embeddable_enhanced/tsconfig.json" }, { "path": "../plugins/encrypted_saved_objects/tsconfig.json" }, diff --git a/x-pack/tsconfig.json b/x-pack/tsconfig.json index 5d51c2923abd02..cc95d72d29441b 100644 --- a/x-pack/tsconfig.json +++ b/x-pack/tsconfig.json @@ -14,6 +14,7 @@ "plugins/discover_enhanced/**/*", "plugins/dashboard_mode/**/*", "plugins/dashboard_enhanced/**/*", + "plugins/fleet/**/*", "plugins/global_search/**/*", "plugins/global_search_providers/**/*", "plugins/graph/**/*", diff --git a/x-pack/tsconfig.refs.json b/x-pack/tsconfig.refs.json index ae88ab6486e64c..447b7f5222991b 100644 --- a/x-pack/tsconfig.refs.json +++ b/x-pack/tsconfig.refs.json @@ -18,6 +18,7 @@ { "path": "./plugins/event_log/tsconfig.json" }, { "path": "./plugins/features/tsconfig.json" }, { "path": "./plugins/file_upload/tsconfig.json" }, + { "path": "./plugins/fleet/tsconfig.json" }, { "path": "./plugins/global_search_bar/tsconfig.json" }, { "path": "./plugins/global_search_providers/tsconfig.json" }, { "path": "./plugins/global_search/tsconfig.json" },