Skip to content

Commit

Permalink
[build_ts_refs] improve caches, allow building a subset of projects (#…
Browse files Browse the repository at this point in the history
…107981)

* [build_ts_refs] improve caches, allow building a subset of projects

* cleanup project def script and update refs in type check script

* rename browser_bazel config to avoid kebab-case

* remove execInProjects() helper

* list references for tsconfig.types.json for api-extractor workload

* disable composite features of tsconfig.types.json for api-extractor

* set declaration: true to avoid weird debug error

* fix jest tests

Co-authored-by: spalger <[email protected]>
  • Loading branch information
Spencer and spalger authored Aug 11, 2021
1 parent 6ed4b4f commit c0395c9
Show file tree
Hide file tree
Showing 338 changed files with 1,165 additions and 1,284 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ report.asciidoc
# TS incremental build cache
*.tsbuildinfo

# Automatically generated and user-modifiable
/tsconfig.refs.json

# Yarn local mirror content
.yarn-local-mirror

Expand Down
2 changes: 2 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
exports_files(
[
"tsconfig.base.json",
"tsconfig.bazel.json",
"tsconfig.browser.json",
"tsconfig.browser_bazel.json",
"tsconfig.json",
"package.json"
],
Expand Down
1 change: 0 additions & 1 deletion docs/developer/best-practices/typescript.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ Additionally, in order to migrate into project refs, you also need to make sure
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"composite": true,
"outDir": "./target/types",
"emitDeclarationOnly": true,
"declaration": true,
Expand Down
5 changes: 3 additions & 2 deletions examples/bfetch_explorer/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./target",
"skipLibCheck": true
"outDir": "./target/types",
},
"include": [
"index.ts",
Expand All @@ -14,6 +13,8 @@
"exclude": [],
"references": [
{ "path": "../../src/core/tsconfig.json" },
{ "path": "../developer_examples/tsconfig.json" },
{ "path": "../../src/plugins/bfetch/tsconfig.json" },
{ "path": "../../src/plugins/kibana_react/tsconfig.json" },
]
}
10 changes: 7 additions & 3 deletions examples/dashboard_embeddable_examples/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./target",
"skipLibCheck": true
"outDir": "./target/types"
},
"include": [
"index.ts",
Expand All @@ -13,6 +12,11 @@
],
"exclude": [],
"references": [
{ "path": "../../src/core/tsconfig.json" }
{ "path": "../../src/core/tsconfig.json" },
{ "path": "../../src/plugins/dashboard/tsconfig.json" },
{ "path": "../../src/plugins/embeddable/tsconfig.json" },
{ "path": "../../src/plugins/es_ui_shared/tsconfig.json" },
{ "path": "../embeddable_examples/tsconfig.json" },
{ "path": "../developer_examples/tsconfig.json" },
]
}
3 changes: 1 addition & 2 deletions examples/developer_examples/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./target",
"skipLibCheck": true
"outDir": "./target/types"
},
"include": [
"index.ts",
Expand Down
9 changes: 7 additions & 2 deletions examples/embeddable_examples/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./target",
"skipLibCheck": true
"outDir": "./target/types"
},
"include": [
"index.ts",
Expand All @@ -15,6 +14,12 @@
"exclude": [],
"references": [
{ "path": "../../src/core/tsconfig.json" },
{ "path": "../../src/plugins/kibana_utils/tsconfig.json" },
{ "path": "../../src/plugins/kibana_react/tsconfig.json" },
{ "path": "../../src/plugins/ui_actions/tsconfig.json" },
{ "path": "../../src/plugins/embeddable/tsconfig.json" },
{ "path": "../../src/plugins/dashboard/tsconfig.json" },
{ "path": "../../src/plugins/saved_objects/tsconfig.json" },
{ "path": "../../src/plugins/presentation_util/tsconfig.json" },
]
}
9 changes: 6 additions & 3 deletions examples/embeddable_explorer/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./target",
"skipLibCheck": true
"outDir": "./target/types"
},
"include": [
"index.ts",
Expand All @@ -14,6 +13,10 @@
"exclude": [],
"references": [
{ "path": "../../src/core/tsconfig.json" },
{ "path": "../../src/plugins/inspector/tsconfig.json" }
{ "path": "../../src/plugins/embeddable/tsconfig.json" },
{ "path": "../../src/plugins/ui_actions/tsconfig.json" },
{ "path": "../../src/plugins/inspector/tsconfig.json" },
{ "path": "../embeddable_examples/tsconfig.json" },
{ "path": "../developer_examples/tsconfig.json" },
]
}
7 changes: 5 additions & 2 deletions examples/expressions_explorer/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./target",
"skipLibCheck": true
"outDir": "./target/types"
},
"include": [
"index.ts",
Expand All @@ -14,5 +13,9 @@
"references": [
{ "path": "../../src/core/tsconfig.json" },
{ "path": "../../src/plugins/kibana_react/tsconfig.json" },
{ "path": "../../src/plugins/expressions/tsconfig.json" },
{ "path": "../../src/plugins/ui_actions/tsconfig.json" },
{ "path": "../../src/plugins/inspector/tsconfig.json" },
{ "path": "../developer_examples/tsconfig.json" },
]
}
6 changes: 5 additions & 1 deletion examples/hello_world/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,9 @@
"server/**/*.ts",
"../../typings/**/*"
],
"exclude": []
"exclude": [],
"references": [
{ "path": "../../src/core/tsconfig.json" },
{ "path": "../developer_examples/tsconfig.json" },
]
}
8 changes: 5 additions & 3 deletions examples/index_pattern_field_editor_example/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./target",
"skipLibCheck": true
"outDir": "./target/types"
},
"include": [
"index.ts",
Expand All @@ -14,5 +13,8 @@
"references": [
{ "path": "../../src/core/tsconfig.json" },
{ "path": "../../src/plugins/kibana_react/tsconfig.json" },
{ "path": "../../src/plugins/data/tsconfig.json" },
{ "path": "../../src/plugins/index_pattern_field_editor/tsconfig.json" },
{ "path": "../developer_examples/tsconfig.json" },
]
}
}
6 changes: 3 additions & 3 deletions examples/locator_examples/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./target",
"skipLibCheck": true
"outDir": "./target/types"
},
"include": [
"index.ts",
Expand All @@ -13,6 +12,7 @@
],
"exclude": [],
"references": [
{ "path": "../../src/core/tsconfig.json" }
{ "path": "../../src/core/tsconfig.json" },
{ "path": "../../src/plugins/share/tsconfig.json" },
]
}
8 changes: 5 additions & 3 deletions examples/locator_explorer/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./target",
"skipLibCheck": true
"outDir": "./target/types"
},
"include": [
"index.ts",
Expand All @@ -13,6 +12,9 @@
],
"exclude": [],
"references": [
{ "path": "../../src/core/tsconfig.json" }
{ "path": "../../src/core/tsconfig.json" },
{ "path": "../../src/plugins/share/tsconfig.json" },
{ "path": "../locator_examples/tsconfig.json" },
{ "path": "../developer_examples/tsconfig.json" },
]
}
1 change: 0 additions & 1 deletion examples/preboot_example/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"composite": true,
"outDir": "./target/types",
"emitDeclarationOnly": true,
"declaration": true,
Expand Down
6 changes: 3 additions & 3 deletions examples/routing_example/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./target",
"skipLibCheck": true
"outDir": "./target/types"
},
"include": [
"index.ts",
Expand All @@ -14,6 +13,7 @@
],
"exclude": [],
"references": [
{ "path": "../../src/core/tsconfig.json" }
{ "path": "../../src/core/tsconfig.json" },
{ "path": "../developer_examples/tsconfig.json" },
]
}
11 changes: 8 additions & 3 deletions examples/screenshot_mode_example/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./target",
"skipLibCheck": true
"outDir": "./target/types"
},
"include": [
"index.ts",
Expand All @@ -13,5 +12,11 @@
"../../typings/**/*"
],
"exclude": [],
"references": [{ "path": "../../src/core/tsconfig.json" }]
"references": [
{ "path": "../../src/core/tsconfig.json" },
{ "path": "../../src/plugins/navigation/tsconfig.json" },
{ "path": "../../src/plugins/screenshot_mode/tsconfig.json" },
{ "path": "../../src/plugins/usage_collection/tsconfig.json" },
{ "path": "../developer_examples/tsconfig.json" },
]
}
11 changes: 8 additions & 3 deletions examples/search_examples/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./target",
"skipLibCheck": true
"outDir": "./target/types"
},
"include": [
"index.ts",
Expand All @@ -14,6 +13,12 @@
],
"exclude": [],
"references": [
{ "path": "../../src/core/tsconfig.json" }
{ "path": "../../src/core/tsconfig.json" },
{ "path": "../../src/plugins/data/tsconfig.json" },
{ "path": "../../src/plugins/kibana_utils/tsconfig.json" },
{ "path": "../../src/plugins/kibana_react/tsconfig.json" },
{ "path": "../../src/plugins/navigation/tsconfig.json" },
{ "path": "../../src/plugins/share/tsconfig.json" },
{ "path": "../developer_examples/tsconfig.json" },
]
}
6 changes: 4 additions & 2 deletions examples/state_containers_examples/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./target",
"skipLibCheck": true
"outDir": "./target/types"
},
"include": [
"index.ts",
Expand All @@ -17,5 +16,8 @@
{ "path": "../../src/core/tsconfig.json" },
{ "path": "../../src/plugins/kibana_utils/tsconfig.json" },
{ "path": "../../src/plugins/kibana_react/tsconfig.json" },
{ "path": "../../src/plugins/navigation/tsconfig.json" },
{ "path": "../../src/plugins/data/tsconfig.json" },
{ "path": "../developer_examples/tsconfig.json" },
]
}
5 changes: 2 additions & 3 deletions examples/ui_action_examples/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./target",
"skipLibCheck": true
"outDir": "./target/types"
},
"include": [
"index.ts",
Expand All @@ -13,7 +12,7 @@
],
"exclude": [],
"references": [
{ "path": "../../src/core/tsconfig.json" },
{ "path": "../../src/plugins/kibana_react/tsconfig.json" },
{ "path": "../../src/plugins/ui_actions/tsconfig.json" },
]
}
6 changes: 4 additions & 2 deletions examples/ui_actions_explorer/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./target",
"skipLibCheck": true
"outDir": "./target/types"
},
"include": [
"index.ts",
Expand All @@ -14,5 +13,8 @@
"references": [
{ "path": "../../src/core/tsconfig.json" },
{ "path": "../../src/plugins/kibana_react/tsconfig.json" },
{ "path": "../../src/plugins/ui_actions/tsconfig.json" },
{ "path": "../ui_action_examples/tsconfig.json" },
{ "path": "../developer_examples/tsconfig.json" },
]
}
2 changes: 1 addition & 1 deletion packages/elastic-datemath/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ ts_config(
src = "tsconfig.json",
deps = [
"//:tsconfig.base.json",
"//:tsconfig.bazel.json",
],
)

Expand All @@ -50,7 +51,6 @@ ts_project(
declaration = True,
declaration_map = True,
emit_declaration_only = True,
incremental = False,
out_dir = "target_types",
source_map = True,
root_dir = "src",
Expand Down
3 changes: 1 addition & 2 deletions packages/elastic-datemath/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
"extends": "../../tsconfig.base.json",
"extends": "../../tsconfig.bazel.json",
"compilerOptions": {
"declaration": true,
"declarationMap": true,
"emitDeclarationOnly": true,
"incremental": false,
"outDir": "target_types",
"rootDir": "src",
"sourceMap": true,
Expand Down
6 changes: 2 additions & 4 deletions packages/elastic-safer-lodash-set/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"incremental": false,
},
"extends": "../../tsconfig.bazel.json",
"compilerOptions": {},
"include": [
"**/*",
],
Expand Down
Loading

0 comments on commit c0395c9

Please sign in to comment.