Skip to content

Commit

Permalink
[Fleet] Use TS project references (#87574) (#90748)
Browse files Browse the repository at this point in the history
## 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
<details><summary><code>node --max-old-space-size=4096 ./node_modules/.bin/tsc -p tsconfig.json --extendedDiagnostics --noEmit</code></summary>

```
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
```
</details>
  • Loading branch information
John Schulz committed Feb 9, 2021
1 parent c11a3ac commit d91d299
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 0 deletions.
39 changes: 39 additions & 0 deletions x-pack/plugins/fleet/tsconfig.json
Original file line number Diff line number Diff line change
@@ -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" },
]
}
5 changes: 5 additions & 0 deletions x-pack/test/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
Expand Down
1 change: 1 addition & 0 deletions x-pack/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"plugins/discover_enhanced/**/*",
"plugins/dashboard_mode/**/*",
"plugins/dashboard_enhanced/**/*",
"plugins/fleet/**/*",
"plugins/global_search/**/*",
"plugins/global_search_providers/**/*",
"plugins/graph/**/*",
Expand Down
1 change: 1 addition & 0 deletions x-pack/tsconfig.refs.json
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
Expand Down

0 comments on commit d91d299

Please sign in to comment.