From 79e45f21904b62fe12b9da657ae18d879d022faf Mon Sep 17 00:00:00 2001 From: Spencer Date: Wed, 11 Aug 2021 02:08:54 -0700 Subject: [PATCH] [build_ts_refs] improve caches, allow building a subset of projects (#107981) (#108139) * [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 # Conflicts: # .gitignore # examples/hello_world/tsconfig.json # tsconfig.json # tsconfig.refs.json Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .gitignore | 3 + BUILD.bazel | 2 + .../best-practices/typescript.asciidoc | 1 - examples/bfetch_explorer/tsconfig.json | 5 +- .../tsconfig.json | 10 +- examples/developer_examples/tsconfig.json | 3 +- examples/embeddable_examples/tsconfig.json | 9 +- examples/embeddable_explorer/tsconfig.json | 9 +- examples/expressions_explorer/tsconfig.json | 7 +- .../tsconfig.json | 8 +- examples/locator_examples/tsconfig.json | 6 +- examples/locator_explorer/tsconfig.json | 8 +- examples/preboot_example/tsconfig.json | 1 - examples/routing_example/tsconfig.json | 6 +- .../screenshot_mode_example/tsconfig.json | 11 +- examples/search_examples/tsconfig.json | 11 +- .../state_containers_examples/tsconfig.json | 6 +- examples/ui_action_examples/tsconfig.json | 5 +- examples/ui_actions_explorer/tsconfig.json | 6 +- packages/elastic-datemath/BUILD.bazel | 2 +- packages/elastic-datemath/tsconfig.json | 3 +- .../elastic-safer-lodash-set/tsconfig.json | 6 +- packages/kbn-ace/BUILD.bazel | 2 +- packages/kbn-ace/tsconfig.json | 3 +- packages/kbn-analytics/BUILD.bazel | 3 +- packages/kbn-analytics/tsconfig.json | 3 +- packages/kbn-apm-config-loader/BUILD.bazel | 2 +- packages/kbn-apm-config-loader/tsconfig.json | 3 +- packages/kbn-apm-utils/BUILD.bazel | 2 +- packages/kbn-apm-utils/tsconfig.json | 3 +- packages/kbn-cli-dev-mode/BUILD.bazel | 2 +- packages/kbn-cli-dev-mode/tsconfig.json | 3 +- packages/kbn-config-schema/BUILD.bazel | 2 +- packages/kbn-config-schema/tsconfig.json | 3 +- packages/kbn-config/BUILD.bazel | 2 +- packages/kbn-config/tsconfig.json | 3 +- packages/kbn-crypto/BUILD.bazel | 2 +- packages/kbn-crypto/tsconfig.json | 5 +- packages/kbn-dev-utils/BUILD.bazel | 3 +- packages/kbn-dev-utils/src/extract.ts | 34 +++- .../src/proc_runner/proc_runner.ts | 9 +- packages/kbn-dev-utils/tsconfig.json | 4 +- packages/kbn-docs-utils/BUILD.bazel | 2 +- .../tests/__fixtures__/src/tsconfig.json | 2 +- packages/kbn-docs-utils/tsconfig.json | 6 +- packages/kbn-es-archiver/BUILD.bazel | 2 +- packages/kbn-es-archiver/tsconfig.json | 6 +- packages/kbn-es-query/BUILD.bazel | 2 +- packages/kbn-es-query/tsconfig.json | 3 +- packages/kbn-es/tsconfig.json | 4 +- packages/kbn-expect/tsconfig.json | 4 +- packages/kbn-field-types/BUILD.bazel | 2 +- packages/kbn-field-types/tsconfig.json | 3 +- packages/kbn-i18n/BUILD.bazel | 2 +- packages/kbn-i18n/tsconfig.json | 3 +- packages/kbn-interpreter/BUILD.bazel | 2 +- packages/kbn-interpreter/tsconfig.json | 5 +- packages/kbn-io-ts-utils/BUILD.bazel | 2 +- packages/kbn-io-ts-utils/tsconfig.json | 5 +- packages/kbn-legacy-logging/BUILD.bazel | 2 +- packages/kbn-legacy-logging/tsconfig.json | 3 +- packages/kbn-logging/BUILD.bazel | 2 +- packages/kbn-logging/tsconfig.json | 3 +- packages/kbn-mapbox-gl/BUILD.bazel | 2 +- packages/kbn-mapbox-gl/tsconfig.json | 5 +- packages/kbn-monaco/BUILD.bazel | 2 +- packages/kbn-monaco/tsconfig.json | 3 +- packages/kbn-optimizer/BUILD.bazel | 2 +- packages/kbn-optimizer/tsconfig.json | 5 +- packages/kbn-plugin-generator/BUILD.bazel | 2 +- .../template/tsconfig.json.ejs | 3 +- packages/kbn-plugin-generator/tsconfig.json | 3 +- packages/kbn-plugin-helpers/BUILD.bazel | 2 +- packages/kbn-plugin-helpers/tsconfig.json | 3 +- packages/kbn-pm/tsconfig.json | 4 +- packages/kbn-rule-data-utils/BUILD.bazel | 2 +- packages/kbn-rule-data-utils/tsconfig.json | 5 +- .../BUILD.bazel | 4 +- .../tsconfig.browser.json | 3 +- .../tsconfig.json | 3 +- .../kbn-securitysolution-es-utils/BUILD.bazel | 4 +- .../tsconfig.json | 3 +- .../BUILD.bazel | 4 +- .../tsconfig.json | 3 +- .../BUILD.bazel | 2 +- .../tsconfig.json | 3 +- .../BUILD.bazel | 2 +- .../tsconfig.json | 3 +- .../BUILD.bazel | 2 +- .../tsconfig.json | 3 +- .../BUILD.bazel | 2 +- .../tsconfig.json | 3 +- .../kbn-securitysolution-list-api/BUILD.bazel | 4 +- .../tsconfig.json | 3 +- .../BUILD.bazel | 4 +- .../tsconfig.json | 3 +- .../BUILD.bazel | 4 +- .../tsconfig.json | 3 +- .../BUILD.bazel | 4 +- .../tsconfig.json | 3 +- .../kbn-securitysolution-t-grid/BUILD.bazel | 6 +- .../tsconfig.browser.json | 3 +- .../kbn-securitysolution-t-grid/tsconfig.json | 3 +- .../kbn-securitysolution-utils/BUILD.bazel | 4 +- .../kbn-securitysolution-utils/tsconfig.json | 3 +- packages/kbn-server-http-tools/BUILD.bazel | 2 +- packages/kbn-server-http-tools/tsconfig.json | 5 +- .../kbn-server-route-repository/BUILD.bazel | 2 +- .../kbn-server-route-repository/tsconfig.json | 3 +- packages/kbn-std/BUILD.bazel | 2 +- packages/kbn-std/tsconfig.json | 3 +- packages/kbn-storybook/BUILD.bazel | 2 +- packages/kbn-storybook/tsconfig.json | 2 +- packages/kbn-telemetry-tools/BUILD.bazel | 2 +- packages/kbn-telemetry-tools/tsconfig.json | 3 +- packages/kbn-test-subj-selector/tsconfig.json | 4 +- packages/kbn-test/BUILD.bazel | 2 +- packages/kbn-test/tsconfig.json | 3 +- packages/kbn-tinymath/tsconfig.json | 2 +- .../kbn-typed-react-router-config/BUILD.bazel | 2 +- .../tsconfig.json | 3 +- packages/kbn-ui-shared-deps/BUILD.bazel | 2 +- packages/kbn-ui-shared-deps/tsconfig.json | 5 +- packages/kbn-utility-types/BUILD.bazel | 2 +- packages/kbn-utility-types/tsconfig.json | 3 +- packages/kbn-utils/BUILD.bazel | 2 +- .../kbn-utils/src/package_json/index.test.ts | 9 +- packages/kbn-utils/src/package_json/index.ts | 6 +- packages/kbn-utils/tsconfig.json | 3 +- scripts/convert_ts_projects.js | 10 + src/core/tsconfig.json | 1 - src/dev/build/lib/config.test.ts | 7 +- .../tasks/os_packages/docker_generator/run.ts | 5 +- src/dev/typescript/build_ts_refs.ts | 42 ++-- src/dev/typescript/build_ts_refs_cli.ts | 32 ++- src/dev/typescript/concurrent_map.ts | 4 + .../typescript/convert_all_to_composite.ts | 19 ++ src/dev/typescript/exec_in_projects.ts | 69 ------- src/dev/typescript/index.ts | 2 - src/dev/typescript/project.ts | 169 +++++++++++++--- src/dev/typescript/project_set.ts | 29 +++ src/dev/typescript/projects.ts | 84 ++++---- .../ref_output_cache.test.ts | 55 +++-- .../ref_output_cache/ref_output_cache.ts | 41 +++- .../typescript/ref_output_cache/repo_info.ts | 16 ++ src/dev/typescript/ref_output_cache/zip.ts | 7 - src/dev/typescript/root_refs_config.ts | 61 ++++++ src/dev/typescript/run_type_check_cli.ts | 190 ++++++++++-------- src/plugins/advanced_settings/tsconfig.json | 1 - src/plugins/apm_oss/tsconfig.json | 1 - src/plugins/bfetch/tsconfig.json | 1 - src/plugins/charts/tsconfig.json | 1 - src/plugins/console/tsconfig.json | 1 - src/plugins/dashboard/tsconfig.json | 1 - src/plugins/data/tsconfig.json | 1 - src/plugins/dev_tools/tsconfig.json | 1 - src/plugins/discover/tsconfig.json | 1 - src/plugins/embeddable/tsconfig.json | 1 - src/plugins/es_ui_shared/tsconfig.json | 1 - src/plugins/expression_error/tsconfig.json | 1 - src/plugins/expression_image/tsconfig.json | 1 - src/plugins/expression_metric/tsconfig.json | 1 - .../expression_repeat_image/tsconfig.json | 1 - .../expression_reveal_image/tsconfig.json | 1 - src/plugins/expression_shape/tsconfig.json | 1 - src/plugins/expressions/tsconfig.json | 1 - src/plugins/field_formats/tsconfig.json | 1 - src/plugins/home/tsconfig.json | 1 - .../index_pattern_field_editor/tsconfig.json | 1 - .../index_pattern_management/tsconfig.json | 1 - .../public/input_control_vis_renderer.tsx | 3 +- .../public/vis_controller.tsx | 37 ++-- src/plugins/input_control_vis/tsconfig.json | 1 - src/plugins/inspector/tsconfig.json | 1 - src/plugins/kibana_legacy/tsconfig.json | 1 - src/plugins/kibana_overview/tsconfig.json | 1 - src/plugins/kibana_react/tsconfig.json | 1 - .../kibana_usage_collection/tsconfig.json | 1 - src/plugins/kibana_utils/tsconfig.json | 1 - src/plugins/legacy_export/tsconfig.json | 1 - src/plugins/management/tsconfig.json | 1 - src/plugins/maps_ems/tsconfig.json | 1 - src/plugins/maps_legacy/tsconfig.json | 1 - src/plugins/navigation/tsconfig.json | 1 - src/plugins/newsfeed/tsconfig.json | 1 - src/plugins/presentation_util/tsconfig.json | 1 - src/plugins/region_map/tsconfig.json | 1 - src/plugins/saved_objects/tsconfig.json | 1 - .../saved_objects_management/tsconfig.json | 1 - .../saved_objects_tagging_oss/tsconfig.json | 1 - src/plugins/screenshot_mode/tsconfig.json | 1 - src/plugins/security_oss/tsconfig.json | 1 - src/plugins/share/tsconfig.json | 1 - src/plugins/spaces_oss/tsconfig.json | 1 - src/plugins/telemetry/tsconfig.json | 1 - .../tsconfig.json | 1 - .../tsconfig.json | 1 - src/plugins/tile_map/tsconfig.json | 1 - src/plugins/timelion/tsconfig.json | 1 - src/plugins/ui_actions/tsconfig.json | 1 - src/plugins/url_forwarding/tsconfig.json | 1 - src/plugins/usage_collection/tsconfig.json | 1 - src/plugins/vis_default_editor/tsconfig.json | 1 - src/plugins/vis_type_markdown/tsconfig.json | 1 - src/plugins/vis_type_metric/tsconfig.json | 1 - src/plugins/vis_type_pie/tsconfig.json | 47 +++-- src/plugins/vis_type_table/tsconfig.json | 1 - src/plugins/vis_type_tagcloud/tsconfig.json | 1 - src/plugins/vis_type_timelion/tsconfig.json | 1 - src/plugins/vis_type_timeseries/tsconfig.json | 1 - src/plugins/vis_type_vega/tsconfig.json | 1 - src/plugins/vis_type_vislib/tsconfig.json | 1 - src/plugins/vis_type_xy/tsconfig.json | 1 - src/plugins/visualizations/tsconfig.json | 1 - src/plugins/visualize/tsconfig.json | 1 - .../plugins/kbn_tp_run_pipeline/tsconfig.json | 9 +- .../plugins/app_link_test/tsconfig.json | 5 +- .../plugins/core_app_status/tsconfig.json | 3 +- .../plugins/core_history_block/tsconfig.json | 3 +- .../plugins/core_http/tsconfig.json | 3 +- .../plugins/core_plugin_a/tsconfig.json | 3 +- .../core_plugin_appleave/tsconfig.json | 3 +- .../plugins/core_plugin_b/tsconfig.json | 6 +- .../core_plugin_chromeless/tsconfig.json | 5 +- .../core_plugin_deep_links/tsconfig.json | 3 +- .../core_plugin_deprecations/tsconfig.json | 3 +- .../tsconfig.json | 3 +- .../core_plugin_helpmenu/tsconfig.json | 3 +- .../core_plugin_route_timeouts/tsconfig.json | 3 +- .../core_plugin_static_assets/tsconfig.json | 3 +- .../core_provider_plugin/tsconfig.json | 3 +- .../plugins/data_search/tsconfig.json | 6 +- .../plugins/doc_views_plugin/tsconfig.json | 6 +- .../elasticsearch_client_plugin/tsconfig.json | 3 +- .../plugins/index_patterns/tsconfig.json | 6 +- .../kbn_sample_panel_action/tsconfig.json | 8 +- .../plugins/kbn_top_nav/tsconfig.json | 6 +- .../tsconfig.json | 14 +- .../management_test_plugin/tsconfig.json | 6 +- .../plugins/rendering_plugin/tsconfig.json | 3 +- .../tsconfig.json | 3 +- .../tsconfig.json | 3 +- .../saved_objects_hidden_type/tsconfig.json | 3 +- .../session_notifications/tsconfig.json | 7 +- .../plugins/telemetry/tsconfig.json | 8 +- .../plugins/ui_settings_plugin/tsconfig.json | 3 +- .../plugins/usage_collection/tsconfig.json | 6 +- .../type_check_plugin_public_api_docs.sh | 1 - .../plugins/status_plugin_a/tsconfig.json | 4 +- .../plugins/status_plugin_b/tsconfig.json | 4 +- test/tsconfig.json | 1 - tsconfig.base.json | 2 + tsconfig.bazel.json | 7 + tsconfig.browser_bazel.json | 7 + tsconfig.json | 118 +---------- tsconfig.refs.json | 126 ------------ tsconfig.types.json | 6 +- .../examples/alerting_example/tsconfig.json | 11 +- .../embedded_lens_example/tsconfig.json | 11 +- .../examples/reporting_example/tsconfig.json | 8 +- .../tsconfig.json | 11 +- x-pack/plugins/actions/tsconfig.json | 1 - x-pack/plugins/alerting/tsconfig.json | 1 - x-pack/plugins/apm/e2e/tsconfig.json | 5 +- x-pack/plugins/apm/ftr_e2e/config.ts | 2 - x-pack/plugins/apm/ftr_e2e/tsconfig.json | 18 +- x-pack/plugins/apm/tsconfig.json | 1 - x-pack/plugins/banners/tsconfig.json | 1 - x-pack/plugins/canvas/tsconfig.json | 1 - x-pack/plugins/cases/tsconfig.json | 1 - x-pack/plugins/cloud/tsconfig.json | 1 - x-pack/plugins/code/tsconfig.json | 1 - .../cross_cluster_replication/tsconfig.json | 1 - .../plugins/dashboard_enhanced/tsconfig.json | 1 - x-pack/plugins/dashboard_mode/tsconfig.json | 1 - x-pack/plugins/data_enhanced/tsconfig.json | 1 - x-pack/plugins/data_visualizer/tsconfig.json | 1 - .../plugins/discover_enhanced/tsconfig.json | 1 - .../drilldowns/url_drilldown/tsconfig.json | 1 - .../plugins/embeddable_enhanced/tsconfig.json | 1 - .../encrypted_saved_objects/tsconfig.json | 1 - .../plugins/enterprise_search/tsconfig.json | 1 - x-pack/plugins/event_log/tsconfig.json | 1 - x-pack/plugins/features/tsconfig.json | 1 - x-pack/plugins/file_upload/tsconfig.json | 1 - x-pack/plugins/fleet/tsconfig.json | 1 - x-pack/plugins/global_search/tsconfig.json | 1 - .../plugins/global_search_bar/tsconfig.json | 1 - .../global_search_providers/tsconfig.json | 1 - x-pack/plugins/graph/tsconfig.json | 55 +++-- x-pack/plugins/grokdebugger/tsconfig.json | 1 - .../index_lifecycle_management/tsconfig.json | 1 - x-pack/plugins/index_management/tsconfig.json | 1 - x-pack/plugins/infra/tsconfig.json | 1 - x-pack/plugins/ingest_pipelines/tsconfig.json | 1 - x-pack/plugins/lens/tsconfig.json | 79 ++++---- .../plugins/license_api_guard/tsconfig.json | 1 - .../plugins/license_management/tsconfig.json | 1 - x-pack/plugins/licensing/tsconfig.json | 1 - x-pack/plugins/lists/tsconfig.json | 41 ++-- x-pack/plugins/logstash/tsconfig.json | 45 ++--- x-pack/plugins/maps/tsconfig.json | 1 - x-pack/plugins/metrics_entities/tsconfig.json | 1 - .../routes/apidoc_scripts/tsconfig.json | 4 +- x-pack/plugins/ml/tsconfig.json | 1 - x-pack/plugins/monitoring/tsconfig.json | 1 - x-pack/plugins/observability/tsconfig.json | 1 - x-pack/plugins/osquery/cypress/tsconfig.json | 8 +- x-pack/plugins/osquery/tsconfig.json | 1 - x-pack/plugins/painless_lab/tsconfig.json | 1 - x-pack/plugins/remote_clusters/tsconfig.json | 1 - x-pack/plugins/reporting/tsconfig.json | 1 - x-pack/plugins/rollup/tsconfig.json | 1 - x-pack/plugins/rule_registry/tsconfig.json | 1 - x-pack/plugins/runtime_fields/tsconfig.json | 1 - .../saved_objects_tagging/tsconfig.json | 1 - x-pack/plugins/searchprofiler/tsconfig.json | 1 - x-pack/plugins/security/tsconfig.json | 1 - .../security_solution/cypress/tsconfig.json | 12 +- .../plugins/security_solution/tsconfig.json | 89 ++++---- x-pack/plugins/snapshot_restore/tsconfig.json | 1 - x-pack/plugins/spaces/tsconfig.json | 1 - x-pack/plugins/stack_alerts/tsconfig.json | 1 - x-pack/plugins/task_manager/tsconfig.json | 1 - .../telemetry_collection_xpack/tsconfig.json | 1 - x-pack/plugins/timelines/tsconfig.json | 57 +++--- x-pack/plugins/transform/tsconfig.json | 1 - x-pack/plugins/translations/tsconfig.json | 1 - .../plugins/triggers_actions_ui/tsconfig.json | 1 - .../plugins/ui_actions_enhanced/tsconfig.json | 1 - .../plugins/upgrade_assistant/tsconfig.json | 1 - x-pack/plugins/uptime/tsconfig.json | 3 +- x-pack/plugins/watcher/tsconfig.json | 1 - x-pack/plugins/xpack_legacy/tsconfig.json | 1 - x-pack/test/tsconfig.json | 1 - .../application_usage_test/tsconfig.json | 3 +- .../stack_management_usage_test/tsconfig.json | 3 +- 337 files changed, 1160 insertions(+), 1282 deletions(-) create mode 100644 scripts/convert_ts_projects.js create mode 100644 src/dev/typescript/convert_all_to_composite.ts delete mode 100644 src/dev/typescript/exec_in_projects.ts create mode 100644 src/dev/typescript/project_set.ts create mode 100644 src/dev/typescript/root_refs_config.ts create mode 100644 tsconfig.bazel.json create mode 100644 tsconfig.browser_bazel.json delete mode 100644 tsconfig.refs.json diff --git a/.gitignore b/.gitignore index c07bbf2bfe537..b75d9b4280a72 100644 --- a/.gitignore +++ b/.gitignore @@ -78,6 +78,9 @@ report.asciidoc # Ignore gihub folder to avoid pings on backports .github +# Automatically generated and user-modifiable +/tsconfig.refs.json + # Yarn local mirror content .yarn-local-mirror diff --git a/BUILD.bazel b/BUILD.bazel index 1f6e3030e5d0c..e838d312d8762 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -3,7 +3,9 @@ exports_files( [ "tsconfig.base.json", + "tsconfig.bazel.json", "tsconfig.browser.json", + "tsconfig.browser_bazel.json", "tsconfig.json", "package.json" ], diff --git a/docs/developer/best-practices/typescript.asciidoc b/docs/developer/best-practices/typescript.asciidoc index f6db3fdffcb6a..6058cb4945e11 100644 --- a/docs/developer/best-practices/typescript.asciidoc +++ b/docs/developer/best-practices/typescript.asciidoc @@ -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, diff --git a/examples/bfetch_explorer/tsconfig.json b/examples/bfetch_explorer/tsconfig.json index 253fdd9ee6c89..fe909968bd8e2 100644 --- a/examples/bfetch_explorer/tsconfig.json +++ b/examples/bfetch_explorer/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types", }, "include": [ "index.ts", @@ -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" }, ] } diff --git a/examples/dashboard_embeddable_examples/tsconfig.json b/examples/dashboard_embeddable_examples/tsconfig.json index 86b35c5e4943f..1c10d59de561f 100644 --- a/examples/dashboard_embeddable_examples/tsconfig.json +++ b/examples/dashboard_embeddable_examples/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types" }, "include": [ "index.ts", @@ -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" }, ] } diff --git a/examples/developer_examples/tsconfig.json b/examples/developer_examples/tsconfig.json index 86b35c5e4943f..23b24a38d1aef 100644 --- a/examples/developer_examples/tsconfig.json +++ b/examples/developer_examples/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types" }, "include": [ "index.ts", diff --git a/examples/embeddable_examples/tsconfig.json b/examples/embeddable_examples/tsconfig.json index a922c6defcd4c..34c7c8e04467e 100644 --- a/examples/embeddable_examples/tsconfig.json +++ b/examples/embeddable_examples/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types" }, "include": [ "index.ts", @@ -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" }, ] } diff --git a/examples/embeddable_explorer/tsconfig.json b/examples/embeddable_explorer/tsconfig.json index 4baebebcea42e..e5b19e2c1457a 100644 --- a/examples/embeddable_explorer/tsconfig.json +++ b/examples/embeddable_explorer/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types" }, "include": [ "index.ts", @@ -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" }, ] } diff --git a/examples/expressions_explorer/tsconfig.json b/examples/expressions_explorer/tsconfig.json index b4449819b25a6..f3451b496caa0 100644 --- a/examples/expressions_explorer/tsconfig.json +++ b/examples/expressions_explorer/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types" }, "include": [ "index.ts", @@ -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" }, ] } diff --git a/examples/index_pattern_field_editor_example/tsconfig.json b/examples/index_pattern_field_editor_example/tsconfig.json index 1f6d52ed5260e..f11ca18fc1a82 100644 --- a/examples/index_pattern_field_editor_example/tsconfig.json +++ b/examples/index_pattern_field_editor_example/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types" }, "include": [ "index.ts", @@ -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" }, ] -} \ No newline at end of file +} diff --git a/examples/locator_examples/tsconfig.json b/examples/locator_examples/tsconfig.json index 8aef3328b4222..5010ad5a5fe0f 100644 --- a/examples/locator_examples/tsconfig.json +++ b/examples/locator_examples/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types" }, "include": [ "index.ts", @@ -13,6 +12,7 @@ ], "exclude": [], "references": [ - { "path": "../../src/core/tsconfig.json" } + { "path": "../../src/core/tsconfig.json" }, + { "path": "../../src/plugins/share/tsconfig.json" }, ] } diff --git a/examples/locator_explorer/tsconfig.json b/examples/locator_explorer/tsconfig.json index 8aef3328b4222..2fa75fc163fdd 100644 --- a/examples/locator_explorer/tsconfig.json +++ b/examples/locator_explorer/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types" }, "include": [ "index.ts", @@ -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" }, ] } diff --git a/examples/preboot_example/tsconfig.json b/examples/preboot_example/tsconfig.json index d18953eadf330..e5b5eda0c6478 100644 --- a/examples/preboot_example/tsconfig.json +++ b/examples/preboot_example/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/examples/routing_example/tsconfig.json b/examples/routing_example/tsconfig.json index 54ac800019f82..e47bf1c9bedb8 100644 --- a/examples/routing_example/tsconfig.json +++ b/examples/routing_example/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types" }, "include": [ "index.ts", @@ -14,6 +13,7 @@ ], "exclude": [], "references": [ - { "path": "../../src/core/tsconfig.json" } + { "path": "../../src/core/tsconfig.json" }, + { "path": "../developer_examples/tsconfig.json" }, ] } diff --git a/examples/screenshot_mode_example/tsconfig.json b/examples/screenshot_mode_example/tsconfig.json index dfb436e7377ac..ef35abc699c66 100644 --- a/examples/screenshot_mode_example/tsconfig.json +++ b/examples/screenshot_mode_example/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types" }, "include": [ "index.ts", @@ -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" }, + ] } diff --git a/examples/search_examples/tsconfig.json b/examples/search_examples/tsconfig.json index 2b7d86d76a8a5..547952b8dd3d8 100644 --- a/examples/search_examples/tsconfig.json +++ b/examples/search_examples/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types" }, "include": [ "index.ts", @@ -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" }, ] } diff --git a/examples/state_containers_examples/tsconfig.json b/examples/state_containers_examples/tsconfig.json index 442fa08022dc4..fc266cbe2c83f 100644 --- a/examples/state_containers_examples/tsconfig.json +++ b/examples/state_containers_examples/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types" }, "include": [ "index.ts", @@ -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" }, ] } diff --git a/examples/ui_action_examples/tsconfig.json b/examples/ui_action_examples/tsconfig.json index 253fdd9ee6c89..41d91ac4b9be6 100644 --- a/examples/ui_action_examples/tsconfig.json +++ b/examples/ui_action_examples/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types" }, "include": [ "index.ts", @@ -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" }, ] } diff --git a/examples/ui_actions_explorer/tsconfig.json b/examples/ui_actions_explorer/tsconfig.json index b4449819b25a6..6debf7c0c650a 100644 --- a/examples/ui_actions_explorer/tsconfig.json +++ b/examples/ui_actions_explorer/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types" }, "include": [ "index.ts", @@ -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" }, ] } diff --git a/packages/elastic-datemath/BUILD.bazel b/packages/elastic-datemath/BUILD.bazel index 9244705c01550..04eb153bcc9e1 100644 --- a/packages/elastic-datemath/BUILD.bazel +++ b/packages/elastic-datemath/BUILD.bazel @@ -39,6 +39,7 @@ ts_config( src = "tsconfig.json", deps = [ "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -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", diff --git a/packages/elastic-datemath/tsconfig.json b/packages/elastic-datemath/tsconfig.json index dcfadbb7cf262..02465bebe519a 100644 --- a/packages/elastic-datemath/tsconfig.json +++ b/packages/elastic-datemath/tsconfig.json @@ -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, diff --git a/packages/elastic-safer-lodash-set/tsconfig.json b/packages/elastic-safer-lodash-set/tsconfig.json index 5a29c6ff2dd88..48aa6ed341d61 100644 --- a/packages/elastic-safer-lodash-set/tsconfig.json +++ b/packages/elastic-safer-lodash-set/tsconfig.json @@ -1,8 +1,6 @@ { - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "incremental": false, - }, + "extends": "../../tsconfig.bazel.json", + "compilerOptions": {}, "include": [ "**/*", ], diff --git a/packages/kbn-ace/BUILD.bazel b/packages/kbn-ace/BUILD.bazel index 49c9c6f783259..5b9c38b16b53a 100644 --- a/packages/kbn-ace/BUILD.bazel +++ b/packages/kbn-ace/BUILD.bazel @@ -55,6 +55,7 @@ ts_config( src = "tsconfig.json", deps = [ "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -66,7 +67,6 @@ ts_project( declaration = True, declaration_map = True, emit_declaration_only = True, - incremental = False, out_dir = "target_types", source_map = True, root_dir = "src", diff --git a/packages/kbn-ace/tsconfig.json b/packages/kbn-ace/tsconfig.json index 8fa6be6fb3fc3..4a132efa09118 100644 --- a/packages/kbn-ace/tsconfig.json +++ b/packages/kbn-ace/tsconfig.json @@ -1,10 +1,9 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, "declarationMap": true, "emitDeclarationOnly": true, - "incremental": false, "outDir": "./target_types", "sourceMap": true, "sourceRoot": "../../../../packages/kbn-ace/src", diff --git a/packages/kbn-analytics/BUILD.bazel b/packages/kbn-analytics/BUILD.bazel index 9f78d99b78710..ca8cdcbffbb52 100644 --- a/packages/kbn-analytics/BUILD.bazel +++ b/packages/kbn-analytics/BUILD.bazel @@ -50,6 +50,7 @@ ts_config( src = "tsconfig.json", deps = [ "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -59,6 +60,7 @@ ts_config( deps = [ "//:tsconfig.base.json", "//:tsconfig.browser.json", + "//:tsconfig.browser_bazel.json", ], ) @@ -70,7 +72,6 @@ ts_project( declaration = True, declaration_map = True, emit_declaration_only = True, - incremental = False, out_dir = "target_types", root_dir = "src", source_map = True, diff --git a/packages/kbn-analytics/tsconfig.json b/packages/kbn-analytics/tsconfig.json index b24ed9ea137a5..dfae54ad91c8e 100644 --- a/packages/kbn-analytics/tsconfig.json +++ b/packages/kbn-analytics/tsconfig.json @@ -1,10 +1,9 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, "declarationMap": true, "emitDeclarationOnly": true, - "incremental": false, "isolatedModules": true, "outDir": "./target_types", "sourceMap": true, diff --git a/packages/kbn-apm-config-loader/BUILD.bazel b/packages/kbn-apm-config-loader/BUILD.bazel index 2ace393bcc4a3..81189171412b6 100644 --- a/packages/kbn-apm-config-loader/BUILD.bazel +++ b/packages/kbn-apm-config-loader/BUILD.bazel @@ -53,6 +53,7 @@ ts_config( src = "tsconfig.json", deps = [ "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -64,7 +65,6 @@ ts_project( declaration = True, declaration_map = True, emit_declaration_only = True, - incremental = False, out_dir = "target_types", source_map = True, root_dir = "src", diff --git a/packages/kbn-apm-config-loader/tsconfig.json b/packages/kbn-apm-config-loader/tsconfig.json index 314c7969b3f94..2f6da800d9dd2 100644 --- a/packages/kbn-apm-config-loader/tsconfig.json +++ b/packages/kbn-apm-config-loader/tsconfig.json @@ -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, diff --git a/packages/kbn-apm-utils/BUILD.bazel b/packages/kbn-apm-utils/BUILD.bazel index c75ffb4207122..fdfd593476fe7 100644 --- a/packages/kbn-apm-utils/BUILD.bazel +++ b/packages/kbn-apm-utils/BUILD.bazel @@ -40,6 +40,7 @@ ts_config( src = "tsconfig.json", deps = [ "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -51,7 +52,6 @@ ts_project( declaration = True, declaration_map = True, emit_declaration_only = True, - incremental = False, out_dir = "target_types", source_map = True, root_dir = "src", diff --git a/packages/kbn-apm-utils/tsconfig.json b/packages/kbn-apm-utils/tsconfig.json index 08fa0e8a45088..d7056cda6d71a 100644 --- a/packages/kbn-apm-utils/tsconfig.json +++ b/packages/kbn-apm-utils/tsconfig.json @@ -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, diff --git a/packages/kbn-cli-dev-mode/BUILD.bazel b/packages/kbn-cli-dev-mode/BUILD.bazel index 608c781017dd6..e66a621781234 100644 --- a/packages/kbn-cli-dev-mode/BUILD.bazel +++ b/packages/kbn-cli-dev-mode/BUILD.bazel @@ -82,6 +82,7 @@ ts_config( src = "tsconfig.json", deps = [ "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -93,7 +94,6 @@ ts_project( declaration = True, declaration_map = True, emit_declaration_only = True, - incremental = False, out_dir = "target_types", root_dir = "src", source_map = True, diff --git a/packages/kbn-cli-dev-mode/tsconfig.json b/packages/kbn-cli-dev-mode/tsconfig.json index 18fda8b978917..6ce2e21b84674 100644 --- a/packages/kbn-cli-dev-mode/tsconfig.json +++ b/packages/kbn-cli-dev-mode/tsconfig.json @@ -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, diff --git a/packages/kbn-config-schema/BUILD.bazel b/packages/kbn-config-schema/BUILD.bazel index 2a4718b87df14..70de78b7617c9 100644 --- a/packages/kbn-config-schema/BUILD.bazel +++ b/packages/kbn-config-schema/BUILD.bazel @@ -51,6 +51,7 @@ ts_config( src = "tsconfig.json", deps = [ "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -62,7 +63,6 @@ ts_project( declaration = True, declaration_map = True, emit_declaration_only = True, - incremental = False, out_dir = "target_types", source_map = True, root_dir = "src", diff --git a/packages/kbn-config-schema/tsconfig.json b/packages/kbn-config-schema/tsconfig.json index de9476bbbb35c..79b652daf7ec1 100644 --- a/packages/kbn-config-schema/tsconfig.json +++ b/packages/kbn-config-schema/tsconfig.json @@ -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, diff --git a/packages/kbn-config/BUILD.bazel b/packages/kbn-config/BUILD.bazel index b11306be969b0..75e4428ed2d70 100644 --- a/packages/kbn-config/BUILD.bazel +++ b/packages/kbn-config/BUILD.bazel @@ -68,6 +68,7 @@ ts_config( src = "tsconfig.json", deps = [ "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -79,7 +80,6 @@ ts_project( declaration = True, declaration_map = True, emit_declaration_only = True, - incremental = False, out_dir = "target_types", source_map = True, root_dir = "src", diff --git a/packages/kbn-config/tsconfig.json b/packages/kbn-config/tsconfig.json index 20855c6073073..0971923a11a0f 100644 --- a/packages/kbn-config/tsconfig.json +++ b/packages/kbn-config/tsconfig.json @@ -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, diff --git a/packages/kbn-crypto/BUILD.bazel b/packages/kbn-crypto/BUILD.bazel index 7419145f62888..36b61d0fb046b 100644 --- a/packages/kbn-crypto/BUILD.bazel +++ b/packages/kbn-crypto/BUILD.bazel @@ -48,6 +48,7 @@ ts_config( src = "tsconfig.json", deps = [ "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -58,7 +59,6 @@ ts_project( deps = DEPS, declaration = True, declaration_map = True, - incremental = True, out_dir = "target", source_map = True, root_dir = "src", diff --git a/packages/kbn-crypto/tsconfig.json b/packages/kbn-crypto/tsconfig.json index 8b7be5e8a3c9b..af1a7c75c8e99 100644 --- a/packages/kbn-crypto/tsconfig.json +++ b/packages/kbn-crypto/tsconfig.json @@ -1,8 +1,7 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.bazel.json", "compilerOptions": { - "incremental": true, - "outDir": "./target", + "outDir": "./target/types", "declaration": true, "declarationMap": true, "rootDir": "src", diff --git a/packages/kbn-dev-utils/BUILD.bazel b/packages/kbn-dev-utils/BUILD.bazel index 65935a0d73868..502bcd05b74f8 100644 --- a/packages/kbn-dev-utils/BUILD.bazel +++ b/packages/kbn-dev-utils/BUILD.bazel @@ -56,7 +56,6 @@ RUNTIME_DEPS = [ "@npm//globby", "@npm//load-json-file", "@npm//markdown-it", - "@npm//moment", "@npm//normalize-path", "@npm//rxjs", "@npm//tar", @@ -100,6 +99,7 @@ ts_config( src = "tsconfig.json", deps = [ "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -111,7 +111,6 @@ ts_project( declaration = True, declaration_map = True, emit_declaration_only = True, - incremental = False, out_dir = "target_types", source_map = True, root_dir = "src", diff --git a/packages/kbn-dev-utils/src/extract.ts b/packages/kbn-dev-utils/src/extract.ts index 05ad2b4bd99ec..138e6bd67a50c 100644 --- a/packages/kbn-dev-utils/src/extract.ts +++ b/packages/kbn-dev-utils/src/extract.ts @@ -12,12 +12,16 @@ import Path from 'path'; import { pipeline } from 'stream'; import { promisify } from 'util'; -import { lastValueFrom } from '@kbn/std'; import Tar from 'tar'; import Yauzl, { ZipFile, Entry } from 'yauzl'; import * as Rx from 'rxjs'; import { map, mergeMap, takeUntil } from 'rxjs/operators'; +const strComplete = (obs: Rx.Observable) => + new Promise((resolve, reject) => { + obs.subscribe({ complete: resolve, error: reject }); + }); + const asyncPipeline = promisify(pipeline); interface Options { @@ -36,6 +40,11 @@ interface Options { * Number of path segments to strip form paths in the archive, like --strip-components from tar */ stripComponents?: number; + + /** + * Write modified timestamps to extracted files + */ + setModifiedTimes?: Date; } /** @@ -43,7 +52,12 @@ interface Options { * for both archive types, only tested with familiar archives we create so might not * support some weird exotic zip features we don't use in our own snapshot/build tooling */ -export async function extract({ archivePath, targetDir, stripComponents = 0 }: Options) { +export async function extract({ + archivePath, + targetDir, + stripComponents = 0, + setModifiedTimes, +}: Options) { await Fs.mkdir(targetDir, { recursive: true }); if (archivePath.endsWith('.tar') || archivePath.endsWith('.tar.gz')) { @@ -98,7 +112,7 @@ export async function extract({ archivePath, targetDir, stripComponents = 0 }: O } // file entry - return openReadStream$(entry).pipe( + const writeFile$ = openReadStream$(entry).pipe( mergeMap(async (readStream) => { if (!readStream) { throw new Error('no readstream provided by yauzl'); @@ -106,15 +120,23 @@ export async function extract({ archivePath, targetDir, stripComponents = 0 }: O // write the file contents to disk await asyncPipeline(readStream, createWriteStream(fileName)); - // tell yauzl to read the next entry - zipFile.readEntry(); + + if (setModifiedTimes) { + // update the modified time of the file to match the zip entry + await Fs.utimes(fileName, setModifiedTimes, setModifiedTimes); + } }) ); + + // tell yauzl to read the next entry + zipFile.readEntry(); + + return writeFile$; }) ); // trigger the initial 'entry' event, happens async so the event will be delivered after the observable is subscribed zipFile.readEntry(); - await lastValueFrom(Rx.merge(entry$, error$)); + await strComplete(Rx.merge(entry$, error$)); } diff --git a/packages/kbn-dev-utils/src/proc_runner/proc_runner.ts b/packages/kbn-dev-utils/src/proc_runner/proc_runner.ts index efe6d30875512..35c910c911105 100644 --- a/packages/kbn-dev-utils/src/proc_runner/proc_runner.ts +++ b/packages/kbn-dev-utils/src/proc_runner/proc_runner.ts @@ -6,7 +6,6 @@ * Side Public License, v 1. */ -import moment from 'moment'; import * as Rx from 'rxjs'; import { filter, first, catchError, map } from 'rxjs/operators'; import exitHook from 'exit-hook'; @@ -199,8 +198,12 @@ export class ProcRunner { // tie into proc outcome$, remove from _procs on compete proc.outcome$.subscribe({ next: (code) => { - const duration = moment.duration(Date.now() - startMs); - this.log.info('[%s] exited with %s after %s', name, code, duration.humanize()); + this.log.info( + '[%s] exited with %s after %s seconds', + name, + code, + ((Date.now() - startMs) / 1000).toFixed(1) + ); }, complete: () => { remove(); diff --git a/packages/kbn-dev-utils/tsconfig.json b/packages/kbn-dev-utils/tsconfig.json index 56843918d88b1..3c22642edfaa1 100644 --- a/packages/kbn-dev-utils/tsconfig.json +++ b/packages/kbn-dev-utils/tsconfig.json @@ -1,16 +1,14 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, "declarationMap": true, "emitDeclarationOnly": true, - "incremental": false, "outDir": "target_types", "rootDir": "src", "sourceMap": true, "sourceRoot": "../../../../packages/kbn-dev-utils/src", "stripInternal": false, - "target": "ES2019", "types": [ "jest", "node" diff --git a/packages/kbn-docs-utils/BUILD.bazel b/packages/kbn-docs-utils/BUILD.bazel index cf609f126d7db..498d2140b91fb 100644 --- a/packages/kbn-docs-utils/BUILD.bazel +++ b/packages/kbn-docs-utils/BUILD.bazel @@ -47,6 +47,7 @@ ts_config( src = "tsconfig.json", deps = [ "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -57,7 +58,6 @@ ts_project( deps = DEPS, declaration = True, declaration_map = True, - incremental = True, out_dir = "target", source_map = True, root_dir = "src", diff --git a/packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/tsconfig.json b/packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/tsconfig.json index 57353d8847ae1..e80808c6181fe 100644 --- a/packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/tsconfig.json +++ b/packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src/tsconfig.json @@ -4,4 +4,4 @@ "strictNullChecks": true, }, "include": ["./**/*"] -} \ No newline at end of file +} diff --git a/packages/kbn-docs-utils/tsconfig.json b/packages/kbn-docs-utils/tsconfig.json index 9868c8b3d2bb4..9b1d6994c1b27 100644 --- a/packages/kbn-docs-utils/tsconfig.json +++ b/packages/kbn-docs-utils/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.bazel.json", "compilerOptions": { - "incremental": true, - "outDir": "./target", - "target": "ES2019", + "outDir": "./target/types", "declaration": true, "declarationMap": true, "rootDir": "src", diff --git a/packages/kbn-es-archiver/BUILD.bazel b/packages/kbn-es-archiver/BUILD.bazel index 9b3db311afa24..b7040b584a318 100644 --- a/packages/kbn-es-archiver/BUILD.bazel +++ b/packages/kbn-es-archiver/BUILD.bazel @@ -59,6 +59,7 @@ ts_config( src = "tsconfig.json", deps = [ "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -69,7 +70,6 @@ ts_project( deps = DEPS, declaration = True, declaration_map = True, - incremental = True, out_dir = "target", source_map = True, root_dir = "src", diff --git a/packages/kbn-es-archiver/tsconfig.json b/packages/kbn-es-archiver/tsconfig.json index 1bc93908a993e..dce71fd6cd4a1 100644 --- a/packages/kbn-es-archiver/tsconfig.json +++ b/packages/kbn-es-archiver/tsconfig.json @@ -1,9 +1,7 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.bazel.json", "compilerOptions": { - "incremental": true, - "outDir": "./target", - "target": "ES2019", + "outDir": "./target/types", "declaration": true, "declarationMap": true, "sourceMap": true, diff --git a/packages/kbn-es-query/BUILD.bazel b/packages/kbn-es-query/BUILD.bazel index 1e40918e6b509..d4a531d308f6e 100644 --- a/packages/kbn-es-query/BUILD.bazel +++ b/packages/kbn-es-query/BUILD.bazel @@ -84,6 +84,7 @@ ts_config( src = "tsconfig.json", deps = [ "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -95,7 +96,6 @@ ts_project( declaration = True, declaration_map = True, emit_declaration_only = True, - incremental = False, out_dir = "target_types", source_map = True, root_dir = "src", diff --git a/packages/kbn-es-query/tsconfig.json b/packages/kbn-es-query/tsconfig.json index 78e722884594e..5b1f3be263138 100644 --- a/packages/kbn-es-query/tsconfig.json +++ b/packages/kbn-es-query/tsconfig.json @@ -1,10 +1,9 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, "declarationMap": true, "emitDeclarationOnly": true, - "incremental": false, "outDir": "./target_types", "sourceMap": true, "sourceRoot": "../../../../packages/kbn-es-query/src", diff --git a/packages/kbn-es/tsconfig.json b/packages/kbn-es/tsconfig.json index 9487a28232684..83035b6315e65 100644 --- a/packages/kbn-es/tsconfig.json +++ b/packages/kbn-es/tsconfig.json @@ -1,7 +1,7 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.bazel.json", "compilerOptions": { - "tsBuildInfoFile": "../../build/tsbuildinfo/packages/kbn-es" + "outDir": "target/types" }, "include": [ "src/**/*" diff --git a/packages/kbn-expect/tsconfig.json b/packages/kbn-expect/tsconfig.json index 8c0d9f1e34bd0..5ad392a7d8d5a 100644 --- a/packages/kbn-expect/tsconfig.json +++ b/packages/kbn-expect/tsconfig.json @@ -1,7 +1,7 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.bazel.json", "compilerOptions": { - "incremental": false, + "skipLibCheck": false }, "include": [ "expect.d.ts" diff --git a/packages/kbn-field-types/BUILD.bazel b/packages/kbn-field-types/BUILD.bazel index 829a1b11a0db7..1fb97a5914ee4 100644 --- a/packages/kbn-field-types/BUILD.bazel +++ b/packages/kbn-field-types/BUILD.bazel @@ -54,6 +54,7 @@ ts_config( src = "tsconfig.json", deps = [ "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -65,7 +66,6 @@ ts_project( declaration = True, declaration_map = True, emit_declaration_only = True, - incremental = False, out_dir = "target_types", source_map = True, root_dir = "src", diff --git a/packages/kbn-field-types/tsconfig.json b/packages/kbn-field-types/tsconfig.json index a7270134039be..150854076bbf8 100644 --- a/packages/kbn-field-types/tsconfig.json +++ b/packages/kbn-field-types/tsconfig.json @@ -1,7 +1,6 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.bazel.json", "compilerOptions": { - "incremental": false, "outDir": "./target_types", "declaration": true, "declarationMap": true, diff --git a/packages/kbn-i18n/BUILD.bazel b/packages/kbn-i18n/BUILD.bazel index 1b3410c9f25e7..62d5fb1d75a46 100644 --- a/packages/kbn-i18n/BUILD.bazel +++ b/packages/kbn-i18n/BUILD.bazel @@ -73,6 +73,7 @@ ts_config( src = "tsconfig.json", deps = [ "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -84,7 +85,6 @@ ts_project( declaration = True, declaration_map = True, emit_declaration_only = True, - incremental = False, out_dir = "target_types", source_map = True, root_dir = "src", diff --git a/packages/kbn-i18n/tsconfig.json b/packages/kbn-i18n/tsconfig.json index 68c02adf9aaea..2ac0b081b76dd 100644 --- a/packages/kbn-i18n/tsconfig.json +++ b/packages/kbn-i18n/tsconfig.json @@ -1,10 +1,9 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, "declarationMap": true, "emitDeclarationOnly": true, - "incremental": false, "outDir": "./target_types", "sourceMap": true, "sourceRoot": "../../../../../packages/kbn-i18n/src", diff --git a/packages/kbn-interpreter/BUILD.bazel b/packages/kbn-interpreter/BUILD.bazel index c29faf65638ca..903f892b64f3f 100644 --- a/packages/kbn-interpreter/BUILD.bazel +++ b/packages/kbn-interpreter/BUILD.bazel @@ -57,6 +57,7 @@ ts_config( src = "tsconfig.json", deps = [ "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -68,7 +69,6 @@ ts_project( allow_js = True, declaration = True, declaration_map = True, - incremental = True, out_dir = "target", source_map = True, root_dir = "src", diff --git a/packages/kbn-interpreter/tsconfig.json b/packages/kbn-interpreter/tsconfig.json index 011ed877146e8..74ec484ea63e9 100644 --- a/packages/kbn-interpreter/tsconfig.json +++ b/packages/kbn-interpreter/tsconfig.json @@ -1,9 +1,8 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.bazel.json", "compilerOptions": { "allowJs": true, - "incremental": true, - "outDir": "./target", + "outDir": "./target/types", "declaration": true, "declarationMap": true, "rootDir": "src", diff --git a/packages/kbn-io-ts-utils/BUILD.bazel b/packages/kbn-io-ts-utils/BUILD.bazel index 053030a6f11a9..0e5210bcc38a5 100644 --- a/packages/kbn-io-ts-utils/BUILD.bazel +++ b/packages/kbn-io-ts-utils/BUILD.bazel @@ -45,6 +45,7 @@ ts_config( src = "tsconfig.json", deps = [ "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -55,7 +56,6 @@ ts_project( deps = DEPS, declaration = True, declaration_map = True, - incremental = True, out_dir = "target", source_map = True, root_dir = "src", diff --git a/packages/kbn-io-ts-utils/tsconfig.json b/packages/kbn-io-ts-utils/tsconfig.json index 7b8f255275499..3ee769739dfc7 100644 --- a/packages/kbn-io-ts-utils/tsconfig.json +++ b/packages/kbn-io-ts-utils/tsconfig.json @@ -1,8 +1,7 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.bazel.json", "compilerOptions": { - "incremental": true, - "outDir": "./target", + "outDir": "./target/types", "stripInternal": false, "declaration": true, "declarationMap": true, diff --git a/packages/kbn-legacy-logging/BUILD.bazel b/packages/kbn-legacy-logging/BUILD.bazel index 1fd04604dbd24..7a9b472ca9553 100644 --- a/packages/kbn-legacy-logging/BUILD.bazel +++ b/packages/kbn-legacy-logging/BUILD.bazel @@ -52,6 +52,7 @@ ts_config( src = "tsconfig.json", deps = [ "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -62,7 +63,6 @@ ts_project( deps = DEPS, declaration = True, declaration_map = True, - incremental = True, out_dir = "target", source_map = True, root_dir = "src", diff --git a/packages/kbn-legacy-logging/tsconfig.json b/packages/kbn-legacy-logging/tsconfig.json index e3bcedd3de014..30a2e56602b6f 100644 --- a/packages/kbn-legacy-logging/tsconfig.json +++ b/packages/kbn-legacy-logging/tsconfig.json @@ -1,7 +1,6 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.bazel.json", "compilerOptions": { - "incremental": true, "outDir": "target", "stripInternal": false, "declaration": true, diff --git a/packages/kbn-logging/BUILD.bazel b/packages/kbn-logging/BUILD.bazel index a5ef1581f41ad..1a3fa851a3957 100644 --- a/packages/kbn-logging/BUILD.bazel +++ b/packages/kbn-logging/BUILD.bazel @@ -41,6 +41,7 @@ ts_config( src = "tsconfig.json", deps = [ "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -51,7 +52,6 @@ ts_project( deps = DEPS, declaration = True, declaration_map = True, - incremental = True, out_dir = "target", source_map = True, root_dir = "src", diff --git a/packages/kbn-logging/tsconfig.json b/packages/kbn-logging/tsconfig.json index 78985b823dd95..aaf79da229a86 100644 --- a/packages/kbn-logging/tsconfig.json +++ b/packages/kbn-logging/tsconfig.json @@ -1,7 +1,6 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.bazel.json", "compilerOptions": { - "incremental": true, "outDir": "target", "stripInternal": false, "declaration": true, diff --git a/packages/kbn-mapbox-gl/BUILD.bazel b/packages/kbn-mapbox-gl/BUILD.bazel index 7d7186068832e..3cbf7c39421e2 100644 --- a/packages/kbn-mapbox-gl/BUILD.bazel +++ b/packages/kbn-mapbox-gl/BUILD.bazel @@ -43,6 +43,7 @@ ts_config( src = "tsconfig.json", deps = [ "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -53,7 +54,6 @@ ts_project( deps = DEPS, declaration = True, declaration_map = True, - incremental = True, out_dir = "target", source_map = True, root_dir = "src", diff --git a/packages/kbn-mapbox-gl/tsconfig.json b/packages/kbn-mapbox-gl/tsconfig.json index cf1cca0f5a0fd..159f40c6a7ca6 100644 --- a/packages/kbn-mapbox-gl/tsconfig.json +++ b/packages/kbn-mapbox-gl/tsconfig.json @@ -1,8 +1,7 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.bazel.json", "compilerOptions": { - "incremental": true, - "outDir": "./target", + "outDir": "./target/types", "declaration": true, "declarationMap": true, "rootDir": "src", diff --git a/packages/kbn-monaco/BUILD.bazel b/packages/kbn-monaco/BUILD.bazel index 5f4351c89ff1f..3656210cb6b1b 100644 --- a/packages/kbn-monaco/BUILD.bazel +++ b/packages/kbn-monaco/BUILD.bazel @@ -81,6 +81,7 @@ ts_config( src = "tsconfig.json", deps = [ "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -92,7 +93,6 @@ ts_project( declaration = True, declaration_map = True, emit_declaration_only = True, - incremental = False, out_dir = "target_types", source_map = True, root_dir = "src", diff --git a/packages/kbn-monaco/tsconfig.json b/packages/kbn-monaco/tsconfig.json index 03b017428beb2..959051b17b782 100644 --- a/packages/kbn-monaco/tsconfig.json +++ b/packages/kbn-monaco/tsconfig.json @@ -1,7 +1,6 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.bazel.json", "compilerOptions": { - "incremental": false, "declaration": true, "declarationMap": true, "emitDeclarationOnly": true, diff --git a/packages/kbn-optimizer/BUILD.bazel b/packages/kbn-optimizer/BUILD.bazel index 3809c2b33d500..ddf2a05519682 100644 --- a/packages/kbn-optimizer/BUILD.bazel +++ b/packages/kbn-optimizer/BUILD.bazel @@ -79,6 +79,7 @@ ts_config( src = "tsconfig.json", deps = [ "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -89,7 +90,6 @@ ts_project( deps = DEPS, declaration = True, declaration_map = True, - incremental = True, out_dir = "target", source_map = True, root_dir = "src", diff --git a/packages/kbn-optimizer/tsconfig.json b/packages/kbn-optimizer/tsconfig.json index e7471846beca2..047c98db8a806 100644 --- a/packages/kbn-optimizer/tsconfig.json +++ b/packages/kbn-optimizer/tsconfig.json @@ -1,8 +1,7 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.bazel.json", "compilerOptions": { - "incremental": true, - "outDir": "./target", + "outDir": "./target/types", "declaration": true, "declarationMap": true, "rootDir": "./src", diff --git a/packages/kbn-plugin-generator/BUILD.bazel b/packages/kbn-plugin-generator/BUILD.bazel index cd18f5e14a736..c16862ee4f3c2 100644 --- a/packages/kbn-plugin-generator/BUILD.bazel +++ b/packages/kbn-plugin-generator/BUILD.bazel @@ -65,6 +65,7 @@ ts_config( src = "tsconfig.json", deps = [ "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -75,7 +76,6 @@ ts_project( deps = DEPS, declaration = True, declaration_map = True, - incremental = True, out_dir = "target", source_map = True, root_dir = "src", diff --git a/packages/kbn-plugin-generator/template/tsconfig.json.ejs b/packages/kbn-plugin-generator/template/tsconfig.json.ejs index 8a3ced743d0fa..06ef420ae55e0 100644 --- a/packages/kbn-plugin-generator/template/tsconfig.json.ejs +++ b/packages/kbn-plugin-generator/template/tsconfig.json.ejs @@ -1,8 +1,7 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types" }, "include": [ "index.ts", diff --git a/packages/kbn-plugin-generator/tsconfig.json b/packages/kbn-plugin-generator/tsconfig.json index 9165fd21ebea0..6a25803c83940 100644 --- a/packages/kbn-plugin-generator/tsconfig.json +++ b/packages/kbn-plugin-generator/tsconfig.json @@ -1,7 +1,6 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.bazel.json", "compilerOptions": { - "incremental": true, "outDir": "target", "target": "ES2019", "declaration": true, diff --git a/packages/kbn-plugin-helpers/BUILD.bazel b/packages/kbn-plugin-helpers/BUILD.bazel index 1a1f3453f768a..9242701770a86 100644 --- a/packages/kbn-plugin-helpers/BUILD.bazel +++ b/packages/kbn-plugin-helpers/BUILD.bazel @@ -56,6 +56,7 @@ ts_config( src = "tsconfig.json", deps = [ "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -66,7 +67,6 @@ ts_project( deps = DEPS, declaration = True, declaration_map = True, - incremental = True, out_dir = "target", source_map = True, root_dir = "src", diff --git a/packages/kbn-plugin-helpers/tsconfig.json b/packages/kbn-plugin-helpers/tsconfig.json index 4348f1e1a7516..22adf020187ba 100644 --- a/packages/kbn-plugin-helpers/tsconfig.json +++ b/packages/kbn-plugin-helpers/tsconfig.json @@ -1,7 +1,6 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.bazel.json", "compilerOptions": { - "incremental": true, "outDir": "target", "target": "ES2018", "declaration": true, diff --git a/packages/kbn-pm/tsconfig.json b/packages/kbn-pm/tsconfig.json index 558cff6556ff6..f12e49fe28d45 100644 --- a/packages/kbn-pm/tsconfig.json +++ b/packages/kbn-pm/tsconfig.json @@ -1,7 +1,7 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.bazel.json", "compilerOptions": { - "tsBuildInfoFile": "../../build/tsbuildinfo/packages/kbn-pm", + "outDir": "target/types", "types": [ "jest", "node" diff --git a/packages/kbn-rule-data-utils/BUILD.bazel b/packages/kbn-rule-data-utils/BUILD.bazel index 62a48b66b4bce..1268daf54cd47 100644 --- a/packages/kbn-rule-data-utils/BUILD.bazel +++ b/packages/kbn-rule-data-utils/BUILD.bazel @@ -40,6 +40,7 @@ ts_config( src = "tsconfig.json", deps = [ "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -50,7 +51,6 @@ ts_project( deps = DEPS, declaration = True, declaration_map = True, - incremental = True, out_dir = "target", source_map = True, root_dir = "src", diff --git a/packages/kbn-rule-data-utils/tsconfig.json b/packages/kbn-rule-data-utils/tsconfig.json index 852393f01e594..1c568530306c7 100644 --- a/packages/kbn-rule-data-utils/tsconfig.json +++ b/packages/kbn-rule-data-utils/tsconfig.json @@ -1,8 +1,7 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.bazel.json", "compilerOptions": { - "incremental": true, - "outDir": "./target", + "outDir": "./target/types", "stripInternal": false, "declaration": true, "declarationMap": true, diff --git a/packages/kbn-securitysolution-autocomplete/BUILD.bazel b/packages/kbn-securitysolution-autocomplete/BUILD.bazel index c29f6d6badc6f..18c3b8f3ae3bb 100644 --- a/packages/kbn-securitysolution-autocomplete/BUILD.bazel +++ b/packages/kbn-securitysolution-autocomplete/BUILD.bazel @@ -60,6 +60,7 @@ ts_config( src = "tsconfig.json", deps = [ "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -69,6 +70,7 @@ ts_config( deps = [ "//:tsconfig.base.json", "//:tsconfig.browser.json", + "//:tsconfig.browser_bazel.json", ], ) @@ -81,7 +83,6 @@ ts_project( declaration = True, declaration_dir = "target_types", declaration_map = True, - incremental = True, out_dir = "target_node", root_dir = "src", source_map = True, @@ -95,7 +96,6 @@ ts_project( deps = DEPS, allow_js = True, declaration = False, - incremental = True, out_dir = "target_web", source_map = True, root_dir = "src", diff --git a/packages/kbn-securitysolution-autocomplete/tsconfig.browser.json b/packages/kbn-securitysolution-autocomplete/tsconfig.browser.json index bab7b18c59cfd..404043569aa92 100644 --- a/packages/kbn-securitysolution-autocomplete/tsconfig.browser.json +++ b/packages/kbn-securitysolution-autocomplete/tsconfig.browser.json @@ -1,8 +1,7 @@ { - "extends": "../../tsconfig.browser.json", + "extends": "../../tsconfig.browser_bazel.json", "compilerOptions": { "allowJs": true, - "incremental": true, "outDir": "./target_web", "declaration": false, "isolatedModules": true, diff --git a/packages/kbn-securitysolution-autocomplete/tsconfig.json b/packages/kbn-securitysolution-autocomplete/tsconfig.json index bf402e93ffd69..484b639f94332 100644 --- a/packages/kbn-securitysolution-autocomplete/tsconfig.json +++ b/packages/kbn-securitysolution-autocomplete/tsconfig.json @@ -1,8 +1,7 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.bazel.json", "compilerOptions": { "allowJs": true, - "incremental": true, "declarationDir": "./target_types", "outDir": "target_node", "declaration": true, diff --git a/packages/kbn-securitysolution-es-utils/BUILD.bazel b/packages/kbn-securitysolution-es-utils/BUILD.bazel index b69aa3df8ecb5..97f2d9a41cd78 100644 --- a/packages/kbn-securitysolution-es-utils/BUILD.bazel +++ b/packages/kbn-securitysolution-es-utils/BUILD.bazel @@ -44,7 +44,8 @@ ts_config( name = "tsconfig", src = "tsconfig.json", deps = [ - "//:tsconfig.base.json", + "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -54,7 +55,6 @@ ts_project( args = ["--pretty"], declaration = True, declaration_map = True, - incremental = True, out_dir = "target", root_dir = "src", source_map = True, diff --git a/packages/kbn-securitysolution-es-utils/tsconfig.json b/packages/kbn-securitysolution-es-utils/tsconfig.json index be8848d781cae..906b01c943ab7 100644 --- a/packages/kbn-securitysolution-es-utils/tsconfig.json +++ b/packages/kbn-securitysolution-es-utils/tsconfig.json @@ -1,9 +1,8 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, "declarationMap": true, - "incremental": true, "outDir": "target", "rootDir": "src", "sourceMap": true, diff --git a/packages/kbn-securitysolution-hook-utils/BUILD.bazel b/packages/kbn-securitysolution-hook-utils/BUILD.bazel index 5bfe3d86867f6..b5f3e0df2e0a7 100644 --- a/packages/kbn-securitysolution-hook-utils/BUILD.bazel +++ b/packages/kbn-securitysolution-hook-utils/BUILD.bazel @@ -45,7 +45,8 @@ ts_config( name = "tsconfig", src = "tsconfig.json", deps = [ - "//:tsconfig.base.json", + "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -55,7 +56,6 @@ ts_project( args = ["--pretty"], declaration = True, declaration_map = True, - incremental = True, out_dir = "target", root_dir = "src", source_map = True, diff --git a/packages/kbn-securitysolution-hook-utils/tsconfig.json b/packages/kbn-securitysolution-hook-utils/tsconfig.json index 352dc086fec30..7e2cae223b14d 100644 --- a/packages/kbn-securitysolution-hook-utils/tsconfig.json +++ b/packages/kbn-securitysolution-hook-utils/tsconfig.json @@ -1,9 +1,8 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, "declarationMap": true, - "incremental": true, "outDir": "target", "rootDir": "src", "sourceMap": true, diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/BUILD.bazel b/packages/kbn-securitysolution-io-ts-alerting-types/BUILD.bazel index 8e4a464783fc6..3c9818a58408d 100644 --- a/packages/kbn-securitysolution-io-ts-alerting-types/BUILD.bazel +++ b/packages/kbn-securitysolution-io-ts-alerting-types/BUILD.bazel @@ -53,6 +53,7 @@ ts_config( src = "tsconfig.json", deps = [ "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -63,7 +64,6 @@ ts_project( deps = DEPS, declaration = True, declaration_map = True, - incremental = True, out_dir = "target", source_map = True, root_dir = "src", diff --git a/packages/kbn-securitysolution-io-ts-alerting-types/tsconfig.json b/packages/kbn-securitysolution-io-ts-alerting-types/tsconfig.json index 3411ce2c93d05..5f69f2bd0e2e4 100644 --- a/packages/kbn-securitysolution-io-ts-alerting-types/tsconfig.json +++ b/packages/kbn-securitysolution-io-ts-alerting-types/tsconfig.json @@ -1,9 +1,8 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, "declarationMap": true, - "incremental": true, "outDir": "target", "rootDir": "src", "sourceMap": true, diff --git a/packages/kbn-securitysolution-io-ts-list-types/BUILD.bazel b/packages/kbn-securitysolution-io-ts-list-types/BUILD.bazel index 99df07c3d8ea8..bfdde4363985e 100644 --- a/packages/kbn-securitysolution-io-ts-list-types/BUILD.bazel +++ b/packages/kbn-securitysolution-io-ts-list-types/BUILD.bazel @@ -54,6 +54,7 @@ ts_config( src = "tsconfig.json", deps = [ "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -64,7 +65,6 @@ ts_project( deps = DEPS, declaration = True, declaration_map = True, - incremental = True, out_dir = "target", source_map = True, root_dir = "src", diff --git a/packages/kbn-securitysolution-io-ts-list-types/tsconfig.json b/packages/kbn-securitysolution-io-ts-list-types/tsconfig.json index d926653a4230b..fb979c23df12b 100644 --- a/packages/kbn-securitysolution-io-ts-list-types/tsconfig.json +++ b/packages/kbn-securitysolution-io-ts-list-types/tsconfig.json @@ -1,9 +1,8 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, "declarationMap": true, - "incremental": true, "outDir": "target", "rootDir": "src", "sourceMap": true, diff --git a/packages/kbn-securitysolution-io-ts-types/BUILD.bazel b/packages/kbn-securitysolution-io-ts-types/BUILD.bazel index d30eb913b1a57..fdf3ef64460d9 100644 --- a/packages/kbn-securitysolution-io-ts-types/BUILD.bazel +++ b/packages/kbn-securitysolution-io-ts-types/BUILD.bazel @@ -52,6 +52,7 @@ ts_config( src = "tsconfig.json", deps = [ "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -62,7 +63,6 @@ ts_project( deps = DEPS, declaration = True, declaration_map = True, - incremental = True, out_dir = "target", source_map = True, root_dir = "src", diff --git a/packages/kbn-securitysolution-io-ts-types/tsconfig.json b/packages/kbn-securitysolution-io-ts-types/tsconfig.json index 42a059439ecb5..12de4ed6ccb76 100644 --- a/packages/kbn-securitysolution-io-ts-types/tsconfig.json +++ b/packages/kbn-securitysolution-io-ts-types/tsconfig.json @@ -1,9 +1,8 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, "declarationMap": true, - "incremental": true, "outDir": "target", "rootDir": "src", "sourceMap": true, diff --git a/packages/kbn-securitysolution-io-ts-utils/BUILD.bazel b/packages/kbn-securitysolution-io-ts-utils/BUILD.bazel index b9326a5020717..f6c81a9adb9a3 100644 --- a/packages/kbn-securitysolution-io-ts-utils/BUILD.bazel +++ b/packages/kbn-securitysolution-io-ts-utils/BUILD.bazel @@ -51,6 +51,7 @@ ts_config( src = "tsconfig.json", deps = [ "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -61,7 +62,6 @@ ts_project( deps = DEPS, declaration = True, declaration_map = True, - incremental = True, out_dir = "target", source_map = True, root_dir = "src", diff --git a/packages/kbn-securitysolution-io-ts-utils/tsconfig.json b/packages/kbn-securitysolution-io-ts-utils/tsconfig.json index 22718276926f0..aa5aa4df550f2 100644 --- a/packages/kbn-securitysolution-io-ts-utils/tsconfig.json +++ b/packages/kbn-securitysolution-io-ts-utils/tsconfig.json @@ -1,9 +1,8 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, "declarationMap": true, - "incremental": true, "outDir": "target", "rootDir": "src", "sourceMap": true, diff --git a/packages/kbn-securitysolution-list-api/BUILD.bazel b/packages/kbn-securitysolution-list-api/BUILD.bazel index 9055cf0804e49..726d75d8c86b8 100644 --- a/packages/kbn-securitysolution-list-api/BUILD.bazel +++ b/packages/kbn-securitysolution-list-api/BUILD.bazel @@ -47,7 +47,8 @@ ts_config( name = "tsconfig", src = "tsconfig.json", deps = [ - "//:tsconfig.base.json", + "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -57,7 +58,6 @@ ts_project( args = ["--pretty"], declaration = True, declaration_map = True, - incremental = True, out_dir = "target", root_dir = "src", source_map = True, diff --git a/packages/kbn-securitysolution-list-api/tsconfig.json b/packages/kbn-securitysolution-list-api/tsconfig.json index 4fad35e754f29..c2ac6d3d92286 100644 --- a/packages/kbn-securitysolution-list-api/tsconfig.json +++ b/packages/kbn-securitysolution-list-api/tsconfig.json @@ -1,9 +1,8 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, "declarationMap": true, - "incremental": true, "outDir": "target", "rootDir": "src", "sourceMap": true, diff --git a/packages/kbn-securitysolution-list-constants/BUILD.bazel b/packages/kbn-securitysolution-list-constants/BUILD.bazel index 8d6779bfa122e..e56c96e0b5da9 100644 --- a/packages/kbn-securitysolution-list-constants/BUILD.bazel +++ b/packages/kbn-securitysolution-list-constants/BUILD.bazel @@ -42,7 +42,8 @@ ts_config( name = "tsconfig", src = "tsconfig.json", deps = [ - "//:tsconfig.base.json", + "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -52,7 +53,6 @@ ts_project( args = ["--pretty"], declaration = True, declaration_map = True, - incremental = True, out_dir = "target", root_dir = "src", source_map = True, diff --git a/packages/kbn-securitysolution-list-constants/tsconfig.json b/packages/kbn-securitysolution-list-constants/tsconfig.json index 84edcdd1d5794..769b5df990e6b 100644 --- a/packages/kbn-securitysolution-list-constants/tsconfig.json +++ b/packages/kbn-securitysolution-list-constants/tsconfig.json @@ -1,9 +1,8 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, "declarationMap": true, - "incremental": true, "outDir": "target", "rootDir": "src", "sourceMap": true, diff --git a/packages/kbn-securitysolution-list-hooks/BUILD.bazel b/packages/kbn-securitysolution-list-hooks/BUILD.bazel index 631e57958d5fa..87075604a75c3 100644 --- a/packages/kbn-securitysolution-list-hooks/BUILD.bazel +++ b/packages/kbn-securitysolution-list-hooks/BUILD.bazel @@ -54,7 +54,8 @@ ts_config( name = "tsconfig", src = "tsconfig.json", deps = [ - "//:tsconfig.base.json", + "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -64,7 +65,6 @@ ts_project( args = ["--pretty"], declaration = True, declaration_map = True, - incremental = True, out_dir = "target", root_dir = "src", source_map = True, diff --git a/packages/kbn-securitysolution-list-hooks/tsconfig.json b/packages/kbn-securitysolution-list-hooks/tsconfig.json index 9e99c22ea9a07..9b09c02bd4aa1 100644 --- a/packages/kbn-securitysolution-list-hooks/tsconfig.json +++ b/packages/kbn-securitysolution-list-hooks/tsconfig.json @@ -1,9 +1,8 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, "declarationMap": true, - "incremental": true, "outDir": "target", "rootDir": "src", "sourceMap": true, diff --git a/packages/kbn-securitysolution-list-utils/BUILD.bazel b/packages/kbn-securitysolution-list-utils/BUILD.bazel index cb6ddbd7f91d5..b35b13004b1a8 100644 --- a/packages/kbn-securitysolution-list-utils/BUILD.bazel +++ b/packages/kbn-securitysolution-list-utils/BUILD.bazel @@ -49,7 +49,8 @@ ts_config( name = "tsconfig", src = "tsconfig.json", deps = [ - "//:tsconfig.base.json", + "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -59,7 +60,6 @@ ts_project( args = ["--pretty"], declaration = True, declaration_map = True, - incremental = True, out_dir = "target", root_dir = "src", source_map = True, diff --git a/packages/kbn-securitysolution-list-utils/tsconfig.json b/packages/kbn-securitysolution-list-utils/tsconfig.json index c462159445894..da48f4af29ead 100644 --- a/packages/kbn-securitysolution-list-utils/tsconfig.json +++ b/packages/kbn-securitysolution-list-utils/tsconfig.json @@ -1,9 +1,8 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, "declarationMap": true, - "incremental": true, "outDir": "target", "rootDir": "src", "sourceMap": true, diff --git a/packages/kbn-securitysolution-t-grid/BUILD.bazel b/packages/kbn-securitysolution-t-grid/BUILD.bazel index 5cf1081bdd32e..0c5ef200fc965 100644 --- a/packages/kbn-securitysolution-t-grid/BUILD.bazel +++ b/packages/kbn-securitysolution-t-grid/BUILD.bazel @@ -59,7 +59,8 @@ ts_config( name = "tsconfig", src = "tsconfig.json", deps = [ - "//:tsconfig.base.json", + "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -69,6 +70,7 @@ ts_config( deps = [ "//:tsconfig.base.json", "//:tsconfig.browser.json", + "//:tsconfig.browser_bazel.json", ], ) @@ -80,7 +82,6 @@ ts_project( declaration = True, declaration_dir = "target_types", declaration_map = True, - incremental = True, out_dir = "target_node", root_dir = "src", source_map = True, @@ -94,7 +95,6 @@ ts_project( deps = DEPS, allow_js = True, declaration = False, - incremental = True, out_dir = "target_web", source_map = True, root_dir = "src", diff --git a/packages/kbn-securitysolution-t-grid/tsconfig.browser.json b/packages/kbn-securitysolution-t-grid/tsconfig.browser.json index a5183ba4fd457..e951765c4b991 100644 --- a/packages/kbn-securitysolution-t-grid/tsconfig.browser.json +++ b/packages/kbn-securitysolution-t-grid/tsconfig.browser.json @@ -1,8 +1,7 @@ { - "extends": "../../tsconfig.browser.json", + "extends": "../../tsconfig.browser_bazel.json", "compilerOptions": { "allowJs": true, - "incremental": true, "outDir": "./target_web", "declaration": false, "isolatedModules": true, diff --git a/packages/kbn-securitysolution-t-grid/tsconfig.json b/packages/kbn-securitysolution-t-grid/tsconfig.json index 8cda578edede4..1d5957e516e00 100644 --- a/packages/kbn-securitysolution-t-grid/tsconfig.json +++ b/packages/kbn-securitysolution-t-grid/tsconfig.json @@ -1,9 +1,8 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, "declarationMap": true, - "incremental": true, "outDir": "target", "rootDir": "src", "sourceMap": true, diff --git a/packages/kbn-securitysolution-utils/BUILD.bazel b/packages/kbn-securitysolution-utils/BUILD.bazel index 6084480ef6a15..41fb97bc6079e 100644 --- a/packages/kbn-securitysolution-utils/BUILD.bazel +++ b/packages/kbn-securitysolution-utils/BUILD.bazel @@ -44,7 +44,8 @@ ts_config( name = "tsconfig", src = "tsconfig.json", deps = [ - "//:tsconfig.base.json", + "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -54,7 +55,6 @@ ts_project( args = ["--pretty"], declaration = True, declaration_map = True, - incremental = True, out_dir = "target", root_dir = "src", source_map = True, diff --git a/packages/kbn-securitysolution-utils/tsconfig.json b/packages/kbn-securitysolution-utils/tsconfig.json index 783e67666d8b8..3894b53d6cff3 100644 --- a/packages/kbn-securitysolution-utils/tsconfig.json +++ b/packages/kbn-securitysolution-utils/tsconfig.json @@ -1,9 +1,8 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, "declarationMap": true, - "incremental": true, "outDir": "target", "rootDir": "src", "sourceMap": true, diff --git a/packages/kbn-server-http-tools/BUILD.bazel b/packages/kbn-server-http-tools/BUILD.bazel index 2e1a33f647430..609fe6d00f173 100644 --- a/packages/kbn-server-http-tools/BUILD.bazel +++ b/packages/kbn-server-http-tools/BUILD.bazel @@ -61,6 +61,7 @@ ts_config( src = "tsconfig.json", deps = [ "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -72,7 +73,6 @@ ts_project( declaration = True, declaration_map = True, emit_declaration_only = True, - incremental = False, out_dir = "target_types", source_map = True, root_dir = "src", diff --git a/packages/kbn-server-http-tools/tsconfig.json b/packages/kbn-server-http-tools/tsconfig.json index 643b932073c9e..e378e41c3828b 100644 --- a/packages/kbn-server-http-tools/tsconfig.json +++ b/packages/kbn-server-http-tools/tsconfig.json @@ -1,11 +1,10 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, "declarationMap": true, "emitDeclarationOnly": true, - "incremental": false, - "outDir": "./target", + "outDir": "./target/types", "rootDir": "src", "sourceMap": true, "sourceRoot": "../../../../packages/kbn-server-http-tools/src", diff --git a/packages/kbn-server-route-repository/BUILD.bazel b/packages/kbn-server-route-repository/BUILD.bazel index 147b72c65f954..9f8a9f34061d2 100644 --- a/packages/kbn-server-route-repository/BUILD.bazel +++ b/packages/kbn-server-route-repository/BUILD.bazel @@ -57,6 +57,7 @@ ts_config( src = "tsconfig.json", deps = [ "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -68,7 +69,6 @@ ts_project( declaration = True, declaration_map = True, emit_declaration_only = True, - incremental = False, out_dir = "target_types", source_map = True, root_dir = "src", diff --git a/packages/kbn-server-route-repository/tsconfig.json b/packages/kbn-server-route-repository/tsconfig.json index 947744bc68d42..447a2084926c6 100644 --- a/packages/kbn-server-route-repository/tsconfig.json +++ b/packages/kbn-server-route-repository/tsconfig.json @@ -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, diff --git a/packages/kbn-std/BUILD.bazel b/packages/kbn-std/BUILD.bazel index bcc5a87a1e795..571d3c061c138 100644 --- a/packages/kbn-std/BUILD.bazel +++ b/packages/kbn-std/BUILD.bazel @@ -53,6 +53,7 @@ ts_config( src = "tsconfig.json", deps = [ "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -64,7 +65,6 @@ ts_project( declaration = True, declaration_map = True, emit_declaration_only = True, - incremental = False, out_dir = "target_types", source_map = True, root_dir = "src", diff --git a/packages/kbn-std/tsconfig.json b/packages/kbn-std/tsconfig.json index 3cff7fbd258a6..2674ca26e96d5 100644 --- a/packages/kbn-std/tsconfig.json +++ b/packages/kbn-std/tsconfig.json @@ -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, diff --git a/packages/kbn-storybook/BUILD.bazel b/packages/kbn-storybook/BUILD.bazel index ae09d79d58331..dce2a6b3010f3 100644 --- a/packages/kbn-storybook/BUILD.bazel +++ b/packages/kbn-storybook/BUILD.bazel @@ -72,6 +72,7 @@ ts_config( src = "tsconfig.json", deps = [ "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -83,7 +84,6 @@ ts_project( declaration = True, declaration_map = True, emit_declaration_only = True, - incremental = False, out_dir = "target_types", root_dir = "src", source_map = True, diff --git a/packages/kbn-storybook/tsconfig.json b/packages/kbn-storybook/tsconfig.json index 9e1ee54cd4899..0ccf3e78c8288 100644 --- a/packages/kbn-storybook/tsconfig.json +++ b/packages/kbn-storybook/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, "declarationMap": true, diff --git a/packages/kbn-telemetry-tools/BUILD.bazel b/packages/kbn-telemetry-tools/BUILD.bazel index f90ca9b22dc92..1183de2586424 100644 --- a/packages/kbn-telemetry-tools/BUILD.bazel +++ b/packages/kbn-telemetry-tools/BUILD.bazel @@ -59,6 +59,7 @@ ts_config( src = "tsconfig.json", deps = [ "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -70,7 +71,6 @@ ts_project( declaration = True, declaration_map = True, emit_declaration_only = True, - incremental = False, out_dir = "target_types", source_map = True, root_dir = "src", diff --git a/packages/kbn-telemetry-tools/tsconfig.json b/packages/kbn-telemetry-tools/tsconfig.json index 1f1b4aea5d5c6..034d7c0c6e745 100644 --- a/packages/kbn-telemetry-tools/tsconfig.json +++ b/packages/kbn-telemetry-tools/tsconfig.json @@ -1,10 +1,9 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, "declarationMap": true, "emitDeclarationOnly": true, - "incremental": false, "isolatedModules": true, "outDir": "./target_types", "rootDir": "src", diff --git a/packages/kbn-test-subj-selector/tsconfig.json b/packages/kbn-test-subj-selector/tsconfig.json index a1e1c1af372c6..a590073946162 100644 --- a/packages/kbn-test-subj-selector/tsconfig.json +++ b/packages/kbn-test-subj-selector/tsconfig.json @@ -1,7 +1,7 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.bazel.json", "compilerOptions": { - "tsBuildInfoFile": "../../build/tsbuildinfo/packages/kbn-test-subj-selector" + "outDir": "target/types" }, "include": [ "index.d.ts" diff --git a/packages/kbn-test/BUILD.bazel b/packages/kbn-test/BUILD.bazel index 34497ca141c5e..36e81df6d8c3c 100644 --- a/packages/kbn-test/BUILD.bazel +++ b/packages/kbn-test/BUILD.bazel @@ -110,6 +110,7 @@ ts_config( src = "tsconfig.json", deps = [ "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -121,7 +122,6 @@ ts_project( declaration = True, declaration_map = True, emit_declaration_only = True, - incremental = False, out_dir = "target_types", source_map = True, root_dir = "src", diff --git a/packages/kbn-test/tsconfig.json b/packages/kbn-test/tsconfig.json index 374139d965e3e..7ba83019b0075 100644 --- a/packages/kbn-test/tsconfig.json +++ b/packages/kbn-test/tsconfig.json @@ -1,10 +1,9 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, "declarationMap": true, "emitDeclarationOnly": true, - "incremental": false, "outDir": "./target_types", "stripInternal": true, "rootDir": "src", diff --git a/packages/kbn-tinymath/tsconfig.json b/packages/kbn-tinymath/tsconfig.json index 73133b7318a0d..748eb53a69e3d 100644 --- a/packages/kbn-tinymath/tsconfig.json +++ b/packages/kbn-tinymath/tsconfig.json @@ -1,4 +1,4 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.bazel.json", "include": ["index.d.ts"] } diff --git a/packages/kbn-typed-react-router-config/BUILD.bazel b/packages/kbn-typed-react-router-config/BUILD.bazel index fa89bc5029ccd..be346f8321fad 100644 --- a/packages/kbn-typed-react-router-config/BUILD.bazel +++ b/packages/kbn-typed-react-router-config/BUILD.bazel @@ -64,6 +64,7 @@ ts_config( src = "tsconfig.json", deps = [ "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -75,7 +76,6 @@ ts_project( declaration = True, declaration_map = True, emit_declaration_only = True, - incremental = False, out_dir = "target_types", source_map = True, root_dir = "src", diff --git a/packages/kbn-typed-react-router-config/tsconfig.json b/packages/kbn-typed-react-router-config/tsconfig.json index bee43cac2df0e..8e17781119ee9 100644 --- a/packages/kbn-typed-react-router-config/tsconfig.json +++ b/packages/kbn-typed-react-router-config/tsconfig.json @@ -1,10 +1,9 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, "declarationMap": true, "emitDeclarationOnly": true, - "incremental": false, "isolatedModules": true, "outDir": "./target_types", "sourceMap": true, diff --git a/packages/kbn-ui-shared-deps/BUILD.bazel b/packages/kbn-ui-shared-deps/BUILD.bazel index 426f8d0b7485a..352fd48907345 100644 --- a/packages/kbn-ui-shared-deps/BUILD.bazel +++ b/packages/kbn-ui-shared-deps/BUILD.bazel @@ -81,6 +81,7 @@ ts_config( src = "tsconfig.json", deps = [ "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -92,7 +93,6 @@ ts_project( allow_js = True, declaration = True, declaration_map = True, - incremental = True, out_dir = "target", source_map = True, root_dir = "src", diff --git a/packages/kbn-ui-shared-deps/tsconfig.json b/packages/kbn-ui-shared-deps/tsconfig.json index 0fd49ede21830..90a89ac580a40 100644 --- a/packages/kbn-ui-shared-deps/tsconfig.json +++ b/packages/kbn-ui-shared-deps/tsconfig.json @@ -1,9 +1,8 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.bazel.json", "compilerOptions": { "allowJs": true, - "incremental": true, - "outDir": "./target", + "outDir": "./target/types", "declaration": true, "declarationMap": true, "rootDir": "src", diff --git a/packages/kbn-utility-types/BUILD.bazel b/packages/kbn-utility-types/BUILD.bazel index 70f814c30f415..8b63eea537aa6 100644 --- a/packages/kbn-utility-types/BUILD.bazel +++ b/packages/kbn-utility-types/BUILD.bazel @@ -45,6 +45,7 @@ ts_config( src = "tsconfig.json", deps = [ "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -56,7 +57,6 @@ ts_project( declaration = True, declaration_map = True, emit_declaration_only = True, - incremental = False, out_dir = "target_types", source_map = True, root_dir = "src", diff --git a/packages/kbn-utility-types/tsconfig.json b/packages/kbn-utility-types/tsconfig.json index 92fd810b389c8..997bcf9e0c45b 100644 --- a/packages/kbn-utility-types/tsconfig.json +++ b/packages/kbn-utility-types/tsconfig.json @@ -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, diff --git a/packages/kbn-utils/BUILD.bazel b/packages/kbn-utils/BUILD.bazel index c4ded75eda637..c2f82d65d3318 100644 --- a/packages/kbn-utils/BUILD.bazel +++ b/packages/kbn-utils/BUILD.bazel @@ -49,6 +49,7 @@ ts_config( src = "tsconfig.json", deps = [ "//:tsconfig.base.json", + "//:tsconfig.bazel.json", ], ) @@ -60,7 +61,6 @@ ts_project( declaration = True, declaration_map = True, emit_declaration_only = True, - incremental = False, out_dir = "target_types", source_map = True, root_dir = "src", diff --git a/packages/kbn-utils/src/package_json/index.test.ts b/packages/kbn-utils/src/package_json/index.test.ts index f6d7e1f2f611b..f8d1b5d25fa1b 100644 --- a/packages/kbn-utils/src/package_json/index.test.ts +++ b/packages/kbn-utils/src/package_json/index.test.ts @@ -6,15 +6,8 @@ * Side Public License, v 1. */ -import path from 'path'; -import { kibanaPackageJson } from './'; +import { kibanaPackageJson } from './index'; it('parses package.json', () => { expect(kibanaPackageJson.name).toEqual('kibana'); }); - -it('includes __dirname and __filename', () => { - const root = path.resolve(__dirname, '../../../../'); - expect(kibanaPackageJson.__filename).toEqual(path.resolve(root, 'package.json')); - expect(kibanaPackageJson.__dirname).toEqual(root); -}); diff --git a/packages/kbn-utils/src/package_json/index.ts b/packages/kbn-utils/src/package_json/index.ts index d9304cee2ca38..fbd554c8c2c04 100644 --- a/packages/kbn-utils/src/package_json/index.ts +++ b/packages/kbn-utils/src/package_json/index.ts @@ -6,13 +6,11 @@ * Side Public License, v 1. */ -import { dirname, resolve } from 'path'; +import Path from 'path'; import { REPO_ROOT } from '../repo_root'; export const kibanaPackageJson = { - __filename: resolve(REPO_ROOT, 'package.json'), - __dirname: dirname(resolve(REPO_ROOT, 'package.json')), - ...require(resolve(REPO_ROOT, 'package.json')), + ...require(Path.resolve(REPO_ROOT, 'package.json')), }; export const isKibanaDistributable = () => { diff --git a/packages/kbn-utils/tsconfig.json b/packages/kbn-utils/tsconfig.json index cf546e2a1395e..85c26f42a695c 100644 --- a/packages/kbn-utils/tsconfig.json +++ b/packages/kbn-utils/tsconfig.json @@ -1,10 +1,9 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.bazel.json", "compilerOptions": { "declaration": true, "declarationMap": true, "emitDeclarationOnly": true, - "incremental": false, "outDir": "target_types", "sourceMap": true, "sourceRoot": "../../../../packages/kbn-utils/src", diff --git a/scripts/convert_ts_projects.js b/scripts/convert_ts_projects.js new file mode 100644 index 0000000000000..65053db0d0bd1 --- /dev/null +++ b/scripts/convert_ts_projects.js @@ -0,0 +1,10 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +require('../src/setup_node_env'); +require('../src/dev/typescript/convert_all_to_composite'); diff --git a/src/core/tsconfig.json b/src/core/tsconfig.json index 855962070457e..9c042577cfe21 100644 --- a/src/core/tsconfig.json +++ b/src/core/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/dev/build/lib/config.test.ts b/src/dev/build/lib/config.test.ts index 8bae63629046c..8bc5eb70c9437 100644 --- a/src/dev/build/lib/config.test.ts +++ b/src/dev/build/lib/config.test.ts @@ -8,10 +8,9 @@ import { resolve } from 'path'; -import { REPO_ROOT } from '@kbn/utils'; +import { REPO_ROOT, kibanaPackageJson } from '@kbn/utils'; import { createAbsolutePathSerializer } from '@kbn/dev-utils'; -import pkg from '../../../../package.json'; import { Config } from './config'; jest.mock('./version_info', () => ({ @@ -36,14 +35,14 @@ const setup = async ({ targetAllPlatforms = true }: { targetAllPlatforms?: boole describe('#getKibanaPkg()', () => { it('returns the parsed package.json from the Kibana repo', async () => { const config = await setup(); - expect(config.getKibanaPkg()).toEqual(pkg); + expect(config.getKibanaPkg()).toEqual(kibanaPackageJson); }); }); describe('#getNodeVersion()', () => { it('returns the node version from the kibana package.json', async () => { const config = await setup(); - expect(config.getNodeVersion()).toEqual(pkg.engines.node); + expect(config.getNodeVersion()).toEqual(kibanaPackageJson.engines.node); }); }); diff --git a/src/dev/build/tasks/os_packages/docker_generator/run.ts b/src/dev/build/tasks/os_packages/docker_generator/run.ts index 97fd740409741..cac02cae20c42 100644 --- a/src/dev/build/tasks/os_packages/docker_generator/run.ts +++ b/src/dev/build/tasks/os_packages/docker_generator/run.ts @@ -10,9 +10,8 @@ import { access, link, unlink, chmod } from 'fs'; import { resolve } from 'path'; import { promisify } from 'util'; -import { ToolingLog } from '@kbn/dev-utils'; +import { ToolingLog, kibanaPackageJson } from '@kbn/dev-utils'; -import { branch } from '../../../../../../package.json'; import { write, copyAll, mkdirp, exec, Config, Build } from '../../../lib'; import * as dockerTemplates from './templates'; import { TemplateContext } from './template_context'; @@ -64,7 +63,7 @@ export async function runDockerGenerator( artifactTarball, imageFlavor, version, - branch, + branch: kibanaPackageJson.branch, license, artifactsDir, imageTag, diff --git a/src/dev/typescript/build_ts_refs.ts b/src/dev/typescript/build_ts_refs.ts index 26425b7a3e61d..db51ff999ccc3 100644 --- a/src/dev/typescript/build_ts_refs.ts +++ b/src/dev/typescript/build_ts_refs.ts @@ -8,25 +8,31 @@ import Path from 'path'; -import execa from 'execa'; -import { ToolingLog, REPO_ROOT } from '@kbn/dev-utils'; +import { ToolingLog, REPO_ROOT, ProcRunner } from '@kbn/dev-utils'; -export const REF_CONFIG_PATHS = [Path.resolve(REPO_ROOT, 'tsconfig.refs.json')]; +import { ROOT_REFS_CONFIG_PATH } from './root_refs_config'; -export async function buildAllTsRefs(log: ToolingLog): Promise<{ failed: boolean }> { - for (const path of REF_CONFIG_PATHS) { - const relative = Path.relative(REPO_ROOT, path); - log.debug(`Building TypeScript projects refs for ${relative}...`); - const { failed, stdout } = await execa( - require.resolve('typescript/bin/tsc'), - ['-b', relative, '--pretty'], - { - cwd: REPO_ROOT, - reject: false, - } - ); - log.info(stdout); - if (failed) return { failed }; +export async function buildAllTsRefs({ + log, + procRunner, + verbose, +}: { + log: ToolingLog; + procRunner: ProcRunner; + verbose?: boolean; +}): Promise<{ failed: boolean }> { + const relative = Path.relative(REPO_ROOT, ROOT_REFS_CONFIG_PATH); + log.info(`Building TypeScript projects refs for ${relative}...`); + + try { + await procRunner.run('tsc', { + cmd: Path.relative(REPO_ROOT, require.resolve('typescript/bin/tsc')), + args: ['-b', relative, '--pretty', ...(verbose ? ['--verbose'] : [])], + cwd: REPO_ROOT, + wait: true, + }); + return { failed: false }; + } catch (error) { + return { failed: true }; } - return { failed: false }; } diff --git a/src/dev/typescript/build_ts_refs_cli.ts b/src/dev/typescript/build_ts_refs_cli.ts index ad7807eb87c66..6b3cb89a7b0ea 100644 --- a/src/dev/typescript/build_ts_refs_cli.ts +++ b/src/dev/typescript/build_ts_refs_cli.ts @@ -12,8 +12,10 @@ import { run, REPO_ROOT } from '@kbn/dev-utils'; import del from 'del'; import { RefOutputCache } from './ref_output_cache'; -import { buildAllTsRefs, REF_CONFIG_PATHS } from './build_ts_refs'; -import { getOutputsDeep } from './ts_configfile'; +import { buildAllTsRefs } from './build_ts_refs'; +import { updateRootRefsConfig, ROOT_REFS_CONFIG_PATH } from './root_refs_config'; +import { Project } from './project'; +import { PROJECT_CACHE } from './projects'; import { concurrentMap } from './concurrent_map'; const CACHE_WORKING_DIR = Path.resolve(REPO_ROOT, 'data/ts_refs_output_cache'); @@ -28,7 +30,7 @@ const isTypeFailure = (error: any) => export async function runBuildRefsCli() { run( - async ({ log, flags }) => { + async ({ log, flags, procRunner }) => { if (process.env.BUILD_TS_REFS_DISABLE === 'true' && !flags.force) { log.info( 'Building ts refs is disabled because the BUILD_TS_REFS_DISABLE environment variable is set to "true". Pass `--force` to run the build anyway.' @@ -36,7 +38,19 @@ export async function runBuildRefsCli() { return; } - const outDirs = getOutputsDeep(REF_CONFIG_PATHS); + // if the tsconfig.refs.json file is not self-managed then make sure it has + // a reference to every composite project in the repo + await updateRootRefsConfig(log); + + // load all the projects referenced from the root refs config deeply, so we know all + // the ts projects we are going to be cleaning or populating with caches + const projects = Project.load( + ROOT_REFS_CONFIG_PATH, + {}, + { + skipConfigValidation: true, + } + ).getProjectsDeep(PROJECT_CACHE); const cacheEnabled = process.env.BUILD_TS_REFS_CACHE_ENABLE !== 'false' && !!flags.cache; const doCapture = process.env.BUILD_TS_REFS_CACHE_CAPTURE === 'true'; @@ -44,15 +58,15 @@ export async function runBuildRefsCli() { const doInitCache = cacheEnabled && !doCapture; if (doClean) { - log.info('deleting', outDirs.length, 'ts output directories'); - await concurrentMap(100, outDirs, (outDir) => del(outDir)); + log.info('deleting', projects.outDirs.length, 'ts output directories'); + await concurrentMap(100, projects.outDirs, (outDir) => del(outDir)); } let outputCache; if (cacheEnabled) { outputCache = await RefOutputCache.create({ log, - outDirs, + projects, repoRoot: REPO_ROOT, workingDir: CACHE_WORKING_DIR, upstreamUrl: 'https://github.com/elastic/kibana.git', @@ -64,7 +78,7 @@ export async function runBuildRefsCli() { } try { - await buildAllTsRefs(log); + await buildAllTsRefs({ log, procRunner, verbose: !!flags.verbose }); log.success('ts refs build successfully'); } catch (error) { const typeFailure = isTypeFailure(error); @@ -97,7 +111,7 @@ export async function runBuildRefsCli() { --force Run the build even if the BUILD_TS_REFS_DISABLE is set to "true" --clean Delete outDirs for each ts project before building --no-cache Disable fetching/extracting outDir caches based on the mergeBase with upstream - --ignore-type-failures If tsc reports type errors, ignore them and just log a small warning. + --ignore-type-failures If tsc reports type errors, ignore them and just log a small warning `, }, log: { diff --git a/src/dev/typescript/concurrent_map.ts b/src/dev/typescript/concurrent_map.ts index 793630ab85a55..b40da14f4162b 100644 --- a/src/dev/typescript/concurrent_map.ts +++ b/src/dev/typescript/concurrent_map.ts @@ -15,6 +15,10 @@ export async function concurrentMap( arr: T[], fn: (item: T, i: number) => Promise ): Promise { + if (!arr.length) { + return []; + } + return await lastValueFrom( Rx.from(arr).pipe( // execute items in parallel based on concurrency diff --git a/src/dev/typescript/convert_all_to_composite.ts b/src/dev/typescript/convert_all_to_composite.ts new file mode 100644 index 0000000000000..9b9dd3468747b --- /dev/null +++ b/src/dev/typescript/convert_all_to_composite.ts @@ -0,0 +1,19 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { run } from '@kbn/dev-utils'; + +import { PROJECTS } from './projects'; + +run(async ({ log }) => { + for (const project of PROJECTS) { + if (!project.config.compilerOptions?.composite) { + log.info(project.tsConfigPath); + } + } +}); diff --git a/src/dev/typescript/exec_in_projects.ts b/src/dev/typescript/exec_in_projects.ts deleted file mode 100644 index ed87aec4ec196..0000000000000 --- a/src/dev/typescript/exec_in_projects.ts +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import os from 'os'; - -import { ToolingLog } from '@kbn/dev-utils'; -import chalk from 'chalk'; -import execa from 'execa'; -import Listr from 'listr'; - -import { Project } from './project'; - -class ProjectFailure { - constructor(public project: Project, public error: execa.ExecaError) {} -} - -export function execInProjects( - log: ToolingLog, - projects: Project[], - cmd: string, - getArgs: (project: Project) => string[] -) { - const list = new Listr( - projects.map((project) => ({ - task: () => - execa(cmd, getArgs(project), { - // execute in the current working directory so that relative paths in errors - // are relative from the right location - cwd: process.cwd(), - env: chalk.level > 0 ? { FORCE_COLOR: 'true' } : {}, - stdio: ['ignore', 'pipe', 'pipe'], - preferLocal: true, - }).catch((error) => { - throw new ProjectFailure(project, error); - }), - title: project.name, - })), - { - concurrent: Math.min(4, Math.round((os.cpus() || []).length / 2) || 1) || false, - exitOnError: false, - } - ); - - list.run().catch((error: any) => { - process.exitCode = 1; - - if (!error.errors) { - log.error('Unhandled exception!'); - log.error(error); - process.exit(); - } - - for (const e of error.errors) { - if (e instanceof ProjectFailure) { - log.write(''); - // stdout contains errors from tsc - // stderr conatins tsc crash report - log.error(`${e.project.name} failed\n${e.error.stdout || e.error.stderr}`); - } else { - log.error(e); - } - } - }); -} diff --git a/src/dev/typescript/index.ts b/src/dev/typescript/index.ts index 34ecd76a994db..d9ccc3975b4eb 100644 --- a/src/dev/typescript/index.ts +++ b/src/dev/typescript/index.ts @@ -7,8 +7,6 @@ */ export { Project } from './project'; -export { filterProjectsByFlag } from './projects'; export { getTsProjectForAbsolutePath } from './get_ts_project_for_absolute_path'; -export { execInProjects } from './exec_in_projects'; export { runTypeCheckCli } from './run_type_check_cli'; export * from './build_ts_refs_cli'; diff --git a/src/dev/typescript/project.ts b/src/dev/typescript/project.ts index 8d92284e49637..a0c196dd8e919 100644 --- a/src/dev/typescript/project.ts +++ b/src/dev/typescript/project.ts @@ -6,17 +6,18 @@ * Side Public License, v 1. */ -import { basename, dirname, relative, resolve } from 'path'; +import Path from 'path'; import { IMinimatch, Minimatch } from 'minimatch'; import { REPO_ROOT } from '@kbn/utils'; import { parseTsConfig } from './ts_configfile'; +import { ProjectSet } from './project_set'; function makeMatchers(directory: string, patterns: string[]) { return patterns.map( (pattern) => - new Minimatch(resolve(directory, pattern), { + new Minimatch(Path.resolve(directory, pattern), { dot: true, }) ); @@ -26,41 +27,151 @@ function testMatchers(matchers: IMinimatch[], path: string) { return matchers.some((matcher) => matcher.match(path)); } +export interface ProjectOptions { + name?: string; + disableTypeCheck?: boolean; +} + +interface LoadOptions { + history?: string[]; + cache?: Map; + skipConfigValidation?: boolean; +} + export class Project { - public directory: string; - public name: string; - public config: any; - public disableTypeCheck: boolean; + static load( + tsConfigPath: string, + projectOptions?: ProjectOptions, + loadOptions: LoadOptions = {} + ): Project { + const cache = loadOptions.cache ?? new Map(); + const cached = cache.get(tsConfigPath); + if (cached) { + return cached; + } - private readonly include: IMinimatch[]; - private readonly exclude: IMinimatch[]; + const config = parseTsConfig(tsConfigPath); - constructor( - public tsConfigPath: string, - options: { name?: string; disableTypeCheck?: boolean } = {} - ) { - this.config = parseTsConfig(tsConfigPath); - - const { files, include, exclude = [] } = this.config as { - files?: string[]; - include?: string[]; - exclude?: string[]; - }; - - if (files || !include) { - throw new Error( - 'tsconfig.json files in the Kibana repo must use "include" keys and not "files"' + if (!loadOptions?.skipConfigValidation) { + if (config.files) { + throw new Error(`${tsConfigPath} must not use "files" key`); + } + + if (!config.include) { + throw new Error(`${tsConfigPath} must have an "include" key`); + } + } + + const directory = Path.dirname(tsConfigPath); + const disableTypeCheck = projectOptions?.disableTypeCheck || false; + const name = + projectOptions?.name || Path.relative(REPO_ROOT, directory) || Path.basename(directory); + const include = config.include ? makeMatchers(directory, config.include) : undefined; + const exclude = config.exclude ? makeMatchers(directory, config.exclude) : undefined; + + let baseProject; + if (config.extends) { + const baseConfigPath = Path.resolve(directory, config.extends); + + // prevent circular deps + if (loadOptions.history?.includes(baseConfigPath)) { + throw new Error( + `circular "extends" are not supported in tsconfig files: ${loadOptions.history} => ${baseConfigPath}` + ); + } + + baseProject = Project.load( + baseConfigPath, + {}, + { + skipConfigValidation: true, + history: [...(loadOptions.history ?? []), tsConfigPath], + cache, + } ); } - this.directory = dirname(this.tsConfigPath); - this.disableTypeCheck = options.disableTypeCheck || false; - this.name = options.name || relative(REPO_ROOT, this.directory) || basename(this.directory); - this.include = makeMatchers(this.directory, include); - this.exclude = makeMatchers(this.directory, exclude); + const project = new Project( + tsConfigPath, + directory, + name, + config, + disableTypeCheck, + baseProject, + include, + exclude + ); + cache.set(tsConfigPath, project); + return project; + } + + constructor( + public readonly tsConfigPath: string, + public readonly directory: string, + public readonly name: string, + public readonly config: any, + public readonly disableTypeCheck: boolean, + + public readonly baseProject?: Project, + private readonly include?: IMinimatch[], + private readonly exclude?: IMinimatch[] + ) {} + + private getInclude(): IMinimatch[] { + return this.include ? this.include : this.baseProject?.getInclude() ?? []; + } + + private getExclude(): IMinimatch[] { + return this.exclude ? this.exclude : this.baseProject?.getExclude() ?? []; } public isAbsolutePathSelected(path: string) { - return testMatchers(this.exclude, path) ? false : testMatchers(this.include, path); + return testMatchers(this.getExclude(), path) ? false : testMatchers(this.getInclude(), path); + } + + public isCompositeProject(): boolean { + const own = this.config.compilerOptions?.composite; + return !!(own === undefined ? this.baseProject?.isCompositeProject() : own); + } + + public getOutDir(): string | undefined { + if (this.config.compilerOptions?.outDir) { + return Path.resolve(this.directory, this.config.compilerOptions.outDir); + } + if (this.baseProject) { + return this.baseProject.getOutDir(); + } + return undefined; + } + + public getRefdPaths(): string[] { + if (this.config.references) { + return (this.config.references as Array<{ path: string }>).map(({ path }) => + Path.resolve(this.directory, path) + ); + } + + return this.baseProject ? this.baseProject.getRefdPaths() : []; + } + + public getProjectsDeep(cache?: Map) { + const projects = new Set(); + const queue = new Set([this.tsConfigPath]); + + for (const path of queue) { + const project = Project.load(path, {}, { skipConfigValidation: true, cache }); + projects.add(project); + for (const refPath of project.getRefdPaths()) { + queue.add(refPath); + } + } + + return new ProjectSet(projects); + } + + public getConfigPaths(): string[] { + return this.baseProject + ? [this.tsConfigPath, ...this.baseProject.getConfigPaths()] + : [this.tsConfigPath]; } } diff --git a/src/dev/typescript/project_set.ts b/src/dev/typescript/project_set.ts new file mode 100644 index 0000000000000..4ef3693cf6d02 --- /dev/null +++ b/src/dev/typescript/project_set.ts @@ -0,0 +1,29 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import { Project } from './project'; + +export class ProjectSet { + public readonly outDirs: string[]; + private readonly projects: Project[]; + + constructor(projects: Iterable) { + this.projects = [...projects]; + this.outDirs = this.projects + .map((p) => p.getOutDir()) + .filter((p): p is string => typeof p === 'string'); + } + + filterByPaths(paths: string[]) { + return new ProjectSet( + this.projects.filter((p) => + paths.some((f) => p.isAbsolutePathSelected(f) || p.getConfigPaths().includes(f)) + ) + ); + } +} diff --git a/src/dev/typescript/projects.ts b/src/dev/typescript/projects.ts index 2c54bb8dba179..419d4f0854ecc 100644 --- a/src/dev/typescript/projects.ts +++ b/src/dev/typescript/projects.ts @@ -7,67 +7,57 @@ */ import glob from 'glob'; -import { resolve } from 'path'; +import Path from 'path'; import { REPO_ROOT } from '@kbn/utils'; -import { Project } from './project'; +import { Project, ProjectOptions } from './project'; + +/** + * Simple map of all projects defined in this file, to speed of some other operations + * which need to load files by path and to avoid re-parsing base config files hundreds of times + */ +export const PROJECT_CACHE = new Map(); + +const createProject = (rootRelativePath: string, options: ProjectOptions = {}) => + Project.load(Path.resolve(REPO_ROOT, rootRelativePath), options, { + cache: PROJECT_CACHE, + }); + +const findProjects = (pattern: string) => + // NOTE: using glob.sync rather than glob-all or globby + // because it takes less than 10 ms, while the other modules + // both took closer to 1000ms. + glob.sync(pattern, { cwd: REPO_ROOT }).map((path) => createProject(path)); export const PROJECTS = [ - new Project(resolve(REPO_ROOT, 'tsconfig.json')), - new Project(resolve(REPO_ROOT, 'test/tsconfig.json'), { name: 'kibana/test' }), - new Project(resolve(REPO_ROOT, 'x-pack/test/tsconfig.json'), { name: 'x-pack/test' }), - new Project(resolve(REPO_ROOT, 'src/core/tsconfig.json')), - new Project(resolve(REPO_ROOT, 'x-pack/plugins/drilldowns/url_drilldown/tsconfig.json'), { + createProject('tsconfig.json'), + createProject('test/tsconfig.json', { name: 'kibana/test' }), + createProject('x-pack/test/tsconfig.json', { name: 'x-pack/test' }), + createProject('src/core/tsconfig.json'), + + createProject('x-pack/plugins/drilldowns/url_drilldown/tsconfig.json', { name: 'security_solution/cypress', }), - new Project(resolve(REPO_ROOT, 'x-pack/plugins/security_solution/cypress/tsconfig.json'), { + createProject('x-pack/plugins/security_solution/cypress/tsconfig.json', { name: 'security_solution/cypress', }), - new Project(resolve(REPO_ROOT, 'x-pack/plugins/osquery/cypress/tsconfig.json'), { + createProject('x-pack/plugins/osquery/cypress/tsconfig.json', { name: 'osquery/cypress', }), - new Project(resolve(REPO_ROOT, 'x-pack/plugins/apm/e2e/tsconfig.json'), { + createProject('x-pack/plugins/apm/e2e/tsconfig.json', { name: 'apm/cypress', disableTypeCheck: true, }), - new Project(resolve(REPO_ROOT, 'x-pack/plugins/apm/ftr_e2e/tsconfig.json'), { + createProject('x-pack/plugins/apm/ftr_e2e/tsconfig.json', { name: 'apm/ftr_e2e', disableTypeCheck: true, }), - // NOTE: using glob.sync rather than glob-all or globby - // because it takes less than 10 ms, while the other modules - // both took closer to 1000ms. - ...glob - .sync('packages/*/tsconfig.json', { cwd: REPO_ROOT }) - .map((path) => new Project(resolve(REPO_ROOT, path))), - ...glob - .sync('src/plugins/*/tsconfig.json', { cwd: REPO_ROOT }) - .map((path) => new Project(resolve(REPO_ROOT, path))), - ...glob - .sync('x-pack/plugins/*/tsconfig.json', { cwd: REPO_ROOT }) - .map((path) => new Project(resolve(REPO_ROOT, path))), - ...glob - .sync('examples/*/tsconfig.json', { cwd: REPO_ROOT }) - .map((path) => new Project(resolve(REPO_ROOT, path))), - ...glob - .sync('x-pack/examples/*/tsconfig.json', { cwd: REPO_ROOT }) - .map((path) => new Project(resolve(REPO_ROOT, path))), - ...glob - .sync('test/plugin_functional/plugins/*/tsconfig.json', { cwd: REPO_ROOT }) - .map((path) => new Project(resolve(REPO_ROOT, path))), - ...glob - .sync('test/interpreter_functional/plugins/*/tsconfig.json', { cwd: REPO_ROOT }) - .map((path) => new Project(resolve(REPO_ROOT, path))), - ...glob - .sync('test/server_integration/__fixtures__/plugins/*/tsconfig.json', { cwd: REPO_ROOT }) - .map((path) => new Project(resolve(REPO_ROOT, path))), + ...findProjects('packages/*/tsconfig.json'), + ...findProjects('src/plugins/*/tsconfig.json'), + ...findProjects('x-pack/plugins/*/tsconfig.json'), + ...findProjects('examples/*/tsconfig.json'), + ...findProjects('x-pack/examples/*/tsconfig.json'), + ...findProjects('test/plugin_functional/plugins/*/tsconfig.json'), + ...findProjects('test/interpreter_functional/plugins/*/tsconfig.json'), + ...findProjects('test/server_integration/__fixtures__/plugins/*/tsconfig.json'), ]; - -export function filterProjectsByFlag(projectFlag?: string) { - if (!projectFlag) { - return PROJECTS; - } - - const tsConfigPath = resolve(projectFlag); - return PROJECTS.filter((project) => project.tsConfigPath === tsConfigPath); -} diff --git a/src/dev/typescript/ref_output_cache/integration_tests/ref_output_cache.test.ts b/src/dev/typescript/ref_output_cache/integration_tests/ref_output_cache.test.ts index 7347529239176..370ef9d17a04e 100644 --- a/src/dev/typescript/ref_output_cache/integration_tests/ref_output_cache.test.ts +++ b/src/dev/typescript/ref_output_cache/integration_tests/ref_output_cache.test.ts @@ -23,6 +23,8 @@ import { import { RefOutputCache, OUTDIR_MERGE_BASE_FILENAME } from '../ref_output_cache'; import { Archives } from '../archives'; import type { RepoInfo } from '../repo_info'; +import { Project } from '../../project'; +import { ProjectSet } from '../../project_set'; jest.mock('../repo_info'); const { RepoInfo: MockRepoInfo } = jest.requireMock('../repo_info'); @@ -48,25 +50,41 @@ afterEach(async () => { logWriter.messages.length = 0; }); -it('creates and extracts caches, ingoring dirs with matching merge-base file and placing merge-base files', async () => { +function makeMockProject(path: string) { + Fs.mkdirSync(Path.resolve(path, 'target/test-types'), { recursive: true }); + Fs.writeFileSync( + Path.resolve(path, 'tsconfig.json'), + JSON.stringify({ + compilerOptions: { + outDir: './target/test-types', + }, + include: ['**/*'], + exclude: ['test/target/**/*'], + }) + ); + + return Project.load(Path.resolve(path, 'tsconfig.json')); +} + +it('creates and extracts caches, ingoring dirs with matching merge-base file, placing merge-base files, and overriding modified time for updated inputs', async () => { // setup repo mock const HEAD = 'abcdefg'; repo.getHeadSha.mockResolvedValue(HEAD); repo.getRelative.mockImplementation((path) => Path.relative(TMP, path)); repo.getRecentShasFrom.mockResolvedValue(['5678', '1234']); + repo.getFilesChangesSinceSha.mockResolvedValue([]); // create two fake outDirs - const outDirs = [Path.resolve(TMP, 'out/foo'), Path.resolve(TMP, 'out/bar')]; - for (const dir of outDirs) { - Fs.mkdirSync(dir, { recursive: true }); - Fs.writeFileSync(Path.resolve(dir, 'test'), 'hello world'); - } + const projects = new ProjectSet([ + makeMockProject(Path.resolve(TMP, 'test1')), + makeMockProject(Path.resolve(TMP, 'test2')), + ]); // init an archives instance using tmp const archives = await Archives.create(log, TMP); // init the RefOutputCache with our mock data - const refOutputCache = new RefOutputCache(log, repo, archives, outDirs, HEAD); + const refOutputCache = new RefOutputCache(log, repo, archives, projects, HEAD); // create the new cache right in the archives dir await refOutputCache.captureCache(Path.resolve(TMP)); @@ -88,19 +106,21 @@ it('creates and extracts caches, ingoring dirs with matching merge-base file and }); // modify the files in the outDirs so we can see which ones are restored from the cache - for (const dir of outDirs) { - Fs.writeFileSync(Path.resolve(dir, 'test'), 'not cleared by cache init'); + for (const dir of projects.outDirs) { + Fs.writeFileSync(Path.resolve(dir, 'no-cleared.txt'), 'not cleared by cache init'); } - // add the mergeBase to the first outDir so that it is ignored - Fs.writeFileSync(Path.resolve(outDirs[0], OUTDIR_MERGE_BASE_FILENAME), HEAD); + + // add the mergeBase to test1 outDir so that it is not cleared + Fs.writeFileSync(Path.resolve(projects.outDirs[0], OUTDIR_MERGE_BASE_FILENAME), HEAD); // rebuild the outDir from the refOutputCache await refOutputCache.initCaches(); + // verify that "test1" outdir is untouched and that "test2" is cleared out const files = Object.fromEntries( globby .sync( - outDirs.map((p) => normalize(p)), + projects.outDirs.map((p) => normalize(p)), { dot: true } ) .map((path) => [Path.relative(TMP, path), Fs.readFileSync(path, 'utf-8')]) @@ -108,10 +128,9 @@ it('creates and extracts caches, ingoring dirs with matching merge-base file and expect(files).toMatchInlineSnapshot(` Object { - "out/bar/.ts-ref-cache-merge-base": "abcdefg", - "out/bar/test": "hello world", - "out/foo/.ts-ref-cache-merge-base": "abcdefg", - "out/foo/test": "not cleared by cache init", + "test1/target/test-types/.ts-ref-cache-merge-base": "abcdefg", + "test1/target/test-types/no-cleared.txt": "not cleared by cache init", + "test2/target/test-types/.ts-ref-cache-merge-base": "abcdefg", } `); expect(logWriter.messages).toMatchInlineSnapshot(` @@ -124,7 +143,7 @@ it('creates and extracts caches, ingoring dirs with matching merge-base file and " debg download complete, renaming tmp", " debg download of cache for abcdefg complete", " debg extracting archives/abcdefg.zip to rebuild caches in 1 outDirs", - " debg [out/bar] clearing outDir and replacing with cache", + " debg [test2/target/test-types] clearing outDir and replacing with cache", ] `); }); @@ -138,7 +157,7 @@ it('cleans up oldest archives when there are more than 10', async () => { } const archives = await Archives.create(log, TMP); - const cache = new RefOutputCache(log, repo, archives, [], '1234'); + const cache = new RefOutputCache(log, repo, archives, new ProjectSet([]), '1234'); expect(cache.archives.size()).toBe(102); await cache.cleanup(); expect(cache.archives.size()).toBe(10); diff --git a/src/dev/typescript/ref_output_cache/ref_output_cache.ts b/src/dev/typescript/ref_output_cache/ref_output_cache.ts index 6f51243e47555..b46faea3b3406 100644 --- a/src/dev/typescript/ref_output_cache/ref_output_cache.ts +++ b/src/dev/typescript/ref_output_cache/ref_output_cache.ts @@ -9,14 +9,15 @@ import Path from 'path'; import Fs from 'fs/promises'; -import { ToolingLog, kibanaPackageJson } from '@kbn/dev-utils'; +import { ToolingLog, kibanaPackageJson, extract } from '@kbn/dev-utils'; import del from 'del'; import tempy from 'tempy'; import { Archives } from './archives'; -import { unzip, zip } from './zip'; +import { zip } from './zip'; import { concurrentMap } from '../concurrent_map'; import { RepoInfo } from './repo_info'; +import { ProjectSet } from '../project_set'; export const OUTDIR_MERGE_BASE_FILENAME = '.ts-ref-cache-merge-base'; @@ -49,7 +50,7 @@ export class RefOutputCache { static async create(options: { log: ToolingLog; workingDir: string; - outDirs: string[]; + projects: ProjectSet; repoRoot: string; upstreamUrl: string; }) { @@ -59,14 +60,14 @@ export class RefOutputCache { const upstreamBranch: string = kibanaPackageJson.branch; const mergeBase = await repoInfo.getMergeBase('HEAD', upstreamBranch); - return new RefOutputCache(options.log, repoInfo, archives, options.outDirs, mergeBase); + return new RefOutputCache(options.log, repoInfo, archives, options.projects, mergeBase); } constructor( private readonly log: ToolingLog, private readonly repo: RepoInfo, public readonly archives: Archives, - private readonly outDirs: string[], + private readonly projects: ProjectSet, private readonly mergeBase: string ) {} @@ -88,7 +89,7 @@ export class RefOutputCache { } const outdatedOutDirs = ( - await concurrentMap(100, this.outDirs, async (outDir) => ({ + await concurrentMap(100, this.projects.outDirs, async (outDir) => ({ path: outDir, outdated: !(await matchMergeBase(outDir, archive.sha)), })) @@ -101,6 +102,9 @@ export class RefOutputCache { return; } + const changedFiles = await this.repo.getFilesChangesSinceSha(archive.sha); + const outDirsForcingExtraCacheCheck = this.projects.filterByPaths(changedFiles).outDirs; + const tmpDir = tempy.directory(); this.log.debug( 'extracting', @@ -109,9 +113,13 @@ export class RefOutputCache { outdatedOutDirs.length, 'outDirs' ); - await unzip(archive.path, tmpDir); + await extract({ + archivePath: archive.path, + targetDir: tmpDir, + }); const cacheNames = await Fs.readdir(tmpDir); + const beginningOfTime = new Date(0); await concurrentMap(50, outdatedOutDirs, async (outDir) => { const relative = this.repo.getRelative(outDir); @@ -129,9 +137,22 @@ export class RefOutputCache { return; } - this.log.debug(`[${relative}] clearing outDir and replacing with cache`); + const setModifiedTimes = outDirsForcingExtraCacheCheck.includes(outDir) + ? beginningOfTime + : undefined; + + if (setModifiedTimes) { + this.log.debug(`[${relative}] replacing outDir with cache (forcing revalidation)`); + } else { + this.log.debug(`[${relative}] clearing outDir and replacing with cache`); + } + await del(outDir); - await unzip(Path.resolve(tmpDir, cacheName), outDir); + await extract({ + archivePath: Path.resolve(tmpDir, cacheName), + targetDir: outDir, + setModifiedTimes, + }); await Fs.writeFile(Path.resolve(outDir, OUTDIR_MERGE_BASE_FILENAME), this.mergeBase); }); } @@ -154,7 +175,7 @@ export class RefOutputCache { const subZips: Array<[string, string]> = []; await Promise.all( - this.outDirs.map(async (absolute) => { + this.projects.outDirs.map(async (absolute) => { const relative = this.repo.getRelative(absolute); const subZipName = `${relative.split(Path.sep).join('__')}.zip`; const subZipPath = Path.resolve(tmpDir, subZipName); diff --git a/src/dev/typescript/ref_output_cache/repo_info.ts b/src/dev/typescript/ref_output_cache/repo_info.ts index 9a51f3f75182b..0bba010bc185d 100644 --- a/src/dev/typescript/ref_output_cache/repo_info.ts +++ b/src/dev/typescript/ref_output_cache/repo_info.ts @@ -52,4 +52,20 @@ export class RepoInfo { return proc.stdout.trim(); } + + async getFilesChangesSinceSha(sha: string) { + this.log.debug('determining files changes since sha', sha); + + const proc = await execa('git', ['diff', '--name-only', sha], { + cwd: this.dir, + }); + const files = proc.stdout + .trim() + .split('\n') + .map((p) => Path.resolve(this.dir, p)); + + this.log.verbose('found the following changes compared to', sha, `\n - ${files.join('\n - ')}`); + + return files; + } } diff --git a/src/dev/typescript/ref_output_cache/zip.ts b/src/dev/typescript/ref_output_cache/zip.ts index b1bd8f514bb95..6b0ee053367de 100644 --- a/src/dev/typescript/ref_output_cache/zip.ts +++ b/src/dev/typescript/ref_output_cache/zip.ts @@ -12,7 +12,6 @@ import Path from 'path'; import { pipeline } from 'stream'; import { promisify } from 'util'; -import extractZip from 'extract-zip'; import archiver from 'archiver'; const asyncPipeline = promisify(pipeline); @@ -44,9 +43,3 @@ export async function zip( // await the promise from the pipeline and archive.finalize() await Promise.all([asyncPipeline(archive, createWriteStream(outputPath)), archive.finalize()]); } - -export async function unzip(path: string, outputDir: string) { - await extractZip(path, { - dir: outputDir, - }); -} diff --git a/src/dev/typescript/root_refs_config.ts b/src/dev/typescript/root_refs_config.ts new file mode 100644 index 0000000000000..c297a9288ddd5 --- /dev/null +++ b/src/dev/typescript/root_refs_config.ts @@ -0,0 +1,61 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import Path from 'path'; +import Fs from 'fs/promises'; + +import dedent from 'dedent'; +import { REPO_ROOT, ToolingLog } from '@kbn/dev-utils'; + +import { PROJECTS } from './projects'; + +export const ROOT_REFS_CONFIG_PATH = Path.resolve(REPO_ROOT, 'tsconfig.refs.json'); +export const REF_CONFIG_PATHS = [ROOT_REFS_CONFIG_PATH]; + +async function isRootRefsConfigSelfManaged() { + try { + const currentRefsFile = await Fs.readFile(ROOT_REFS_CONFIG_PATH, 'utf-8'); + return currentRefsFile.trim().startsWith('// SELF MANAGED'); + } catch (error) { + if (error.code === 'ENOENT') { + return false; + } + + throw error; + } +} + +function generateTsConfig(refs: string[]) { + return dedent` + // This file is automatically updated when you run \`node scripts/build_ts_refs\`. If you start this + // file with the text "// SELF MANAGED" then you can comment out any projects that you like and only + // build types for specific projects and their dependencies + { + "include": [], + "references": [ +${refs.map((p) => ` { "path": ${JSON.stringify(p)} },`).join('\n')} + ] + } + `; +} + +export async function updateRootRefsConfig(log: ToolingLog) { + if (await isRootRefsConfigSelfManaged()) { + log.warning( + 'tsconfig.refs.json starts with "// SELF MANAGED" so not updating to include all projects' + ); + return; + } + + const refs = PROJECTS.filter((p) => p.isCompositeProject()) + .map((p) => `./${Path.relative(REPO_ROOT, p.tsConfigPath)}`) + .sort((a, b) => a.localeCompare(b)); + + log.debug('updating', ROOT_REFS_CONFIG_PATH); + await Fs.writeFile(ROOT_REFS_CONFIG_PATH, generateTsConfig(refs) + '\n'); +} diff --git a/src/dev/typescript/run_type_check_cli.ts b/src/dev/typescript/run_type_check_cli.ts index d9e9eb036fe0f..1bf31a6c5bac0 100644 --- a/src/dev/typescript/run_type_check_cli.ts +++ b/src/dev/typescript/run_type_check_cli.ts @@ -6,96 +6,116 @@ * Side Public License, v 1. */ -import { ToolingLog } from '@kbn/dev-utils'; -import chalk from 'chalk'; -import dedent from 'dedent'; -import getopts from 'getopts'; +import Path from 'path'; +import Os from 'os'; -import { execInProjects } from './exec_in_projects'; -import { filterProjectsByFlag } from './projects'; +import * as Rx from 'rxjs'; +import { mergeMap, reduce } from 'rxjs/operators'; +import execa from 'execa'; +import { run, createFailError } from '@kbn/dev-utils'; +import { lastValueFrom } from '@kbn/std'; + +import { PROJECTS } from './projects'; import { buildAllTsRefs } from './build_ts_refs'; +import { updateRootRefsConfig } from './root_refs_config'; export async function runTypeCheckCli() { - const extraFlags: string[] = []; - const opts = getopts(process.argv.slice(2), { - boolean: ['skip-lib-check', 'help'], - default: { - project: undefined, - }, - unknown(name) { - extraFlags.push(name); - return false; + run( + async ({ log, flags, procRunner }) => { + // if the tsconfig.refs.json file is not self-managed then make sure it has + // a reference to every composite project in the repo + await updateRootRefsConfig(log); + + const { failed } = await buildAllTsRefs({ log, procRunner, verbose: !!flags.verbose }); + if (failed) { + throw createFailError('Unable to build TS project refs'); + } + + const projectFilter = + flags.project && typeof flags.project === 'string' + ? Path.resolve(flags.project) + : undefined; + + const projects = PROJECTS.filter((p) => { + return ( + !p.disableTypeCheck && + (!projectFilter || p.tsConfigPath === projectFilter) && + !p.isCompositeProject() + ); + }); + + if (!projects.length) { + throw createFailError(`Unable to find project at ${flags.project}`); + } + + const concurrency = Math.min(4, Math.round((Os.cpus() || []).length / 2) || 1) || 1; + log.info('running type check in', projects.length, 'non-composite projects'); + + const tscArgs = [ + ...['--emitDeclarationOnly', 'false'], + '--noEmit', + '--pretty', + ...(flags['skip-lib-check'] + ? ['--skipLibCheck', flags['skip-lib-check'] as string] + : ['--skipLibCheck', 'false']), + ]; + + const failureCount = await lastValueFrom( + Rx.from(projects).pipe( + mergeMap(async (p) => { + const relativePath = Path.relative(process.cwd(), p.tsConfigPath); + + const result = await execa( + process.execPath, + [ + '--max-old-space-size=5120', + require.resolve('typescript/bin/tsc'), + ...['--project', p.tsConfigPath, ...(flags.verbose ? ['--verbose'] : [])], + ...tscArgs, + ], + { + reject: false, + all: true, + } + ); + + if (result.failed) { + log.error(`Type check failed in ${relativePath}:`); + log.error(result.all ?? ' - tsc produced no output - '); + return 1; + } else { + log.success(relativePath); + return 0; + } + }, concurrency), + reduce((acc, f) => acc + f, 0) + ) + ); + + if (failureCount > 0) { + throw createFailError(`${failureCount} type checks failed`); + } }, - }); - - const log = new ToolingLog({ - level: 'info', - writeTo: process.stdout, - }); - - if (extraFlags.length) { - for (const flag of extraFlags) { - log.error(`Unknown flag: ${flag}`); - } - - process.exitCode = 1; - opts.help = true; - } - - if (opts.help) { - process.stdout.write( - dedent(chalk` - {dim usage:} node scripts/type_check [...options] - - Run the TypeScript compiler without emitting files so that it can check - types during development. + { + description: ` + Run the TypeScript compiler without emitting files so that it can check types during development. Examples: - - {dim # check types in all projects} - {dim $} node scripts/type_check - - {dim # check types in a single project} - {dim $} node scripts/type_check --project packages/kbn-pm/tsconfig.json - - Options: - - --project [path] {dim Path to a tsconfig.json file determines the project to check} - --skip-lib-check {dim Skip type checking of all declaration files (*.d.ts). Default is false} - --help {dim Show this message} - `) - ); - process.stdout.write('\n'); - process.exit(); - } - - const { failed } = await buildAllTsRefs(log); - if (failed) { - log.error('Unable to build TS project refs'); - process.exit(1); - } - - const tscArgs = [ - // composite project cannot be used with --noEmit - ...['--composite', 'false'], - ...['--emitDeclarationOnly', 'false'], - '--noEmit', - '--pretty', - ...(opts['skip-lib-check'] - ? ['--skipLibCheck', opts['skip-lib-check']] - : ['--skipLibCheck', 'false']), - ]; - const projects = filterProjectsByFlag(opts.project).filter((p) => !p.disableTypeCheck); - - if (!projects.length) { - log.error(`Unable to find project at ${opts.project}`); - process.exit(1); - } - - execInProjects(log, projects, process.execPath, (project) => [ - '--max-old-space-size=5120', - require.resolve('typescript/bin/tsc'), - ...['--project', project.tsConfigPath], - ...tscArgs, - ]); + # check types in all projects + node scripts/type_check + + # check types in a single project + node scripts/type_check --project packages/kbn-pm/tsconfig.json + `, + flags: { + string: ['project'], + boolean: ['skip-lib-check'], + help: ` + --project [path] Path to a tsconfig.json file determines the project to check + --skip-lib-check Skip type checking of all declaration files (*.d.ts). Default is false + --help Show this message + `, + }, + } + ); } diff --git a/src/plugins/advanced_settings/tsconfig.json b/src/plugins/advanced_settings/tsconfig.json index 4d62e410326b6..b207f600cbd4e 100644 --- a/src/plugins/advanced_settings/tsconfig.json +++ b/src/plugins/advanced_settings/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/apm_oss/tsconfig.json b/src/plugins/apm_oss/tsconfig.json index aeb6837c69a99..08ed86d5da0a8 100644 --- a/src/plugins/apm_oss/tsconfig.json +++ b/src/plugins/apm_oss/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/bfetch/tsconfig.json b/src/plugins/bfetch/tsconfig.json index 173ff725d07d0..8fceb7d815ee9 100644 --- a/src/plugins/bfetch/tsconfig.json +++ b/src/plugins/bfetch/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/charts/tsconfig.json b/src/plugins/charts/tsconfig.json index a4f65d5937204..fc05a26068654 100644 --- a/src/plugins/charts/tsconfig.json +++ b/src/plugins/charts/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/console/tsconfig.json b/src/plugins/console/tsconfig.json index 34aca5021bac4..ee6fbfebc77a2 100644 --- a/src/plugins/console/tsconfig.json +++ b/src/plugins/console/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/dashboard/tsconfig.json b/src/plugins/dashboard/tsconfig.json index 12820fc08310d..4febb8b5555cf 100644 --- a/src/plugins/dashboard/tsconfig.json +++ b/src/plugins/dashboard/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/data/tsconfig.json b/src/plugins/data/tsconfig.json index 6e4e89f7538fd..3687604e05e2b 100644 --- a/src/plugins/data/tsconfig.json +++ b/src/plugins/data/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/dev_tools/tsconfig.json b/src/plugins/dev_tools/tsconfig.json index c17b2341fd42f..bbb33ac5b2f99 100644 --- a/src/plugins/dev_tools/tsconfig.json +++ b/src/plugins/dev_tools/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/discover/tsconfig.json b/src/plugins/discover/tsconfig.json index 8c71091e3ecf2..b3f1ad5d0bc1e 100644 --- a/src/plugins/discover/tsconfig.json +++ b/src/plugins/discover/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/embeddable/tsconfig.json b/src/plugins/embeddable/tsconfig.json index 27a887500fb68..b7a6ff3252d6a 100644 --- a/src/plugins/embeddable/tsconfig.json +++ b/src/plugins/embeddable/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/es_ui_shared/tsconfig.json b/src/plugins/es_ui_shared/tsconfig.json index 5f136d09b2ce4..38e6cf78f8f60 100644 --- a/src/plugins/es_ui_shared/tsconfig.json +++ b/src/plugins/es_ui_shared/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/expression_error/tsconfig.json b/src/plugins/expression_error/tsconfig.json index aa4562ec73576..111ff58935a35 100644 --- a/src/plugins/expression_error/tsconfig.json +++ b/src/plugins/expression_error/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/expression_image/tsconfig.json b/src/plugins/expression_image/tsconfig.json index 5fab51496c97e..9a7175a8d767b 100644 --- a/src/plugins/expression_image/tsconfig.json +++ b/src/plugins/expression_image/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/expression_metric/tsconfig.json b/src/plugins/expression_metric/tsconfig.json index 5fab51496c97e..9a7175a8d767b 100644 --- a/src/plugins/expression_metric/tsconfig.json +++ b/src/plugins/expression_metric/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/expression_repeat_image/tsconfig.json b/src/plugins/expression_repeat_image/tsconfig.json index aa4562ec73576..111ff58935a35 100644 --- a/src/plugins/expression_repeat_image/tsconfig.json +++ b/src/plugins/expression_repeat_image/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/expression_reveal_image/tsconfig.json b/src/plugins/expression_reveal_image/tsconfig.json index aa4562ec73576..111ff58935a35 100644 --- a/src/plugins/expression_reveal_image/tsconfig.json +++ b/src/plugins/expression_reveal_image/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/expression_shape/tsconfig.json b/src/plugins/expression_shape/tsconfig.json index 5fab51496c97e..9a7175a8d767b 100644 --- a/src/plugins/expression_shape/tsconfig.json +++ b/src/plugins/expression_shape/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/expressions/tsconfig.json b/src/plugins/expressions/tsconfig.json index cce71013cefa5..6716149d6b9c7 100644 --- a/src/plugins/expressions/tsconfig.json +++ b/src/plugins/expressions/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/field_formats/tsconfig.json b/src/plugins/field_formats/tsconfig.json index 4382ab1051c1d..9fb87bc5dd970 100644 --- a/src/plugins/field_formats/tsconfig.json +++ b/src/plugins/field_formats/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/home/tsconfig.json b/src/plugins/home/tsconfig.json index b15e1fc011b92..9324978b227d5 100644 --- a/src/plugins/home/tsconfig.json +++ b/src/plugins/home/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/index_pattern_field_editor/tsconfig.json b/src/plugins/index_pattern_field_editor/tsconfig.json index 5450ae74a91a0..e5caf463835d0 100644 --- a/src/plugins/index_pattern_field_editor/tsconfig.json +++ b/src/plugins/index_pattern_field_editor/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/index_pattern_management/tsconfig.json b/src/plugins/index_pattern_management/tsconfig.json index 16afcb3599fec..2a719e98bea31 100644 --- a/src/plugins/index_pattern_management/tsconfig.json +++ b/src/plugins/index_pattern_management/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/input_control_vis/public/input_control_vis_renderer.tsx b/src/plugins/input_control_vis/public/input_control_vis_renderer.tsx index 867fe13aee08f..81ff7a5aa47f1 100644 --- a/src/plugins/input_control_vis/public/input_control_vis_renderer.tsx +++ b/src/plugins/input_control_vis/public/input_control_vis_renderer.tsx @@ -24,8 +24,7 @@ export const getInputControlVisRenderer: ( if (!registeredController) { const { createInputControlVisController } = await import('./vis_controller'); - const Controller = createInputControlVisController(deps, handlers); - registeredController = new Controller(domNode); + registeredController = createInputControlVisController(deps, handlers, domNode); inputControlVisRegistry.set(domNode, registeredController); handlers.onDestroy(() => { diff --git a/src/plugins/input_control_vis/public/vis_controller.tsx b/src/plugins/input_control_vis/public/vis_controller.tsx index 566f9035fe77e..bb09a90bb9dd6 100644 --- a/src/plugins/input_control_vis/public/vis_controller.tsx +++ b/src/plugins/input_control_vis/public/vis_controller.tsx @@ -24,18 +24,17 @@ import { ListControl } from './control/list_control_factory'; import { InputControlVisDependencies } from './plugin'; import { InputControlVisParams } from './types'; -export type InputControlVisControllerType = InstanceType< - ReturnType ->; +export type InputControlVisControllerType = ReturnType; export const createInputControlVisController = ( deps: InputControlVisDependencies, - handlers: IInterpreterRenderHandlers + handlers: IInterpreterRenderHandlers, + el: Element ) => { - return class InputControlVisController { - private I18nContext?: I18nStart['Context']; - private _isLoaded = false; + let I18nContext: I18nStart['Context'] | undefined; + let isLoaded = false; + return new (class InputControlVisController { controls: Array; queryBarUpdateHandler: () => void; filterManager: FilterManager; @@ -43,7 +42,7 @@ export const createInputControlVisController = ( timeFilterSubscription: Subscription; visParams?: InputControlVisParams; - constructor(public el: Element) { + constructor() { this.controls = []; this.queryBarUpdateHandler = this.updateControlsFromKbn.bind(this); @@ -56,21 +55,21 @@ export const createInputControlVisController = ( .getTimeUpdate$() .subscribe(() => { if (this.visParams?.useTimeFilter) { - this._isLoaded = false; + isLoaded = false; } }); } async render(visParams: InputControlVisParams) { - if (!this.I18nContext) { + if (!I18nContext) { const [{ i18n }] = await deps.core.getStartServices(); - this.I18nContext = i18n.Context; + I18nContext = i18n.Context; } - if (!this._isLoaded || !isEqual(visParams, this.visParams)) { + if (!isLoaded || !isEqual(visParams, this.visParams)) { this.visParams = visParams; this.controls = []; this.controls = await this.initControls(visParams); - this._isLoaded = true; + isLoaded = true; } this.drawVis(); } @@ -78,17 +77,17 @@ export const createInputControlVisController = ( destroy() { this.updateSubsciption.unsubscribe(); this.timeFilterSubscription.unsubscribe(); - unmountComponentAtNode(this.el); + unmountComponentAtNode(el); this.controls.forEach((control) => control.destroy()); } drawVis = () => { - if (!this.I18nContext) { + if (!I18nContext) { throw new Error('no i18n context found'); } render( - + - , - this.el + , + el ); }; @@ -235,5 +234,5 @@ export const createInputControlVisController = ( await this.controls[controlIndex].fetch(query); this.drawVis(); }; - }; + })(); }; diff --git a/src/plugins/input_control_vis/tsconfig.json b/src/plugins/input_control_vis/tsconfig.json index bef7bc394a6cc..5e53199bb1e6e 100644 --- a/src/plugins/input_control_vis/tsconfig.json +++ b/src/plugins/input_control_vis/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/inspector/tsconfig.json b/src/plugins/inspector/tsconfig.json index 2a9c41464532c..4554a90821d48 100644 --- a/src/plugins/inspector/tsconfig.json +++ b/src/plugins/inspector/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/kibana_legacy/tsconfig.json b/src/plugins/kibana_legacy/tsconfig.json index 709036c9e82f4..17f1a70838fd7 100644 --- a/src/plugins/kibana_legacy/tsconfig.json +++ b/src/plugins/kibana_legacy/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/kibana_overview/tsconfig.json b/src/plugins/kibana_overview/tsconfig.json index ac3ac109cb35f..fd9002d39ee8c 100644 --- a/src/plugins/kibana_overview/tsconfig.json +++ b/src/plugins/kibana_overview/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/kibana_react/tsconfig.json b/src/plugins/kibana_react/tsconfig.json index eb9a24ca141f6..3f6dd8fd280b6 100644 --- a/src/plugins/kibana_react/tsconfig.json +++ b/src/plugins/kibana_react/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/kibana_usage_collection/tsconfig.json b/src/plugins/kibana_usage_collection/tsconfig.json index ee07dfe589e4a..e57d6e25db8cd 100644 --- a/src/plugins/kibana_usage_collection/tsconfig.json +++ b/src/plugins/kibana_usage_collection/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/kibana_utils/tsconfig.json b/src/plugins/kibana_utils/tsconfig.json index ae5e9b90af807..0538b145a5d62 100644 --- a/src/plugins/kibana_utils/tsconfig.json +++ b/src/plugins/kibana_utils/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/legacy_export/tsconfig.json b/src/plugins/legacy_export/tsconfig.json index ec006d492499e..2f071b5ba6c56 100644 --- a/src/plugins/legacy_export/tsconfig.json +++ b/src/plugins/legacy_export/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/management/tsconfig.json b/src/plugins/management/tsconfig.json index ba3661666631a..beef79c9affd0 100644 --- a/src/plugins/management/tsconfig.json +++ b/src/plugins/management/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/maps_ems/tsconfig.json b/src/plugins/maps_ems/tsconfig.json index b85c3da66b83a..dd579b47f3109 100644 --- a/src/plugins/maps_ems/tsconfig.json +++ b/src/plugins/maps_ems/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/maps_legacy/tsconfig.json b/src/plugins/maps_legacy/tsconfig.json index f757e35f785af..b6fcb9345b1ce 100644 --- a/src/plugins/maps_legacy/tsconfig.json +++ b/src/plugins/maps_legacy/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/navigation/tsconfig.json b/src/plugins/navigation/tsconfig.json index 07cfe10d7d81f..1b7e87aaba41a 100644 --- a/src/plugins/navigation/tsconfig.json +++ b/src/plugins/navigation/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/newsfeed/tsconfig.json b/src/plugins/newsfeed/tsconfig.json index 18e6f2de1bc6f..1388e11087254 100644 --- a/src/plugins/newsfeed/tsconfig.json +++ b/src/plugins/newsfeed/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/presentation_util/tsconfig.json b/src/plugins/presentation_util/tsconfig.json index e0b9bbeb4917d..caff10a90e84c 100644 --- a/src/plugins/presentation_util/tsconfig.json +++ b/src/plugins/presentation_util/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/region_map/tsconfig.json b/src/plugins/region_map/tsconfig.json index 899611d027465..fec191402f2ab 100644 --- a/src/plugins/region_map/tsconfig.json +++ b/src/plugins/region_map/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/saved_objects/tsconfig.json b/src/plugins/saved_objects/tsconfig.json index d9045b91b9dfa..b8761ab81fa78 100644 --- a/src/plugins/saved_objects/tsconfig.json +++ b/src/plugins/saved_objects/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/saved_objects_management/tsconfig.json b/src/plugins/saved_objects_management/tsconfig.json index 99849dea38618..0f26da69acd17 100644 --- a/src/plugins/saved_objects_management/tsconfig.json +++ b/src/plugins/saved_objects_management/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/saved_objects_tagging_oss/tsconfig.json b/src/plugins/saved_objects_tagging_oss/tsconfig.json index b0059c71424bf..5a3f642a9d6ea 100644 --- a/src/plugins/saved_objects_tagging_oss/tsconfig.json +++ b/src/plugins/saved_objects_tagging_oss/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/screenshot_mode/tsconfig.json b/src/plugins/screenshot_mode/tsconfig.json index 58194b385448b..832972ae0baa0 100644 --- a/src/plugins/screenshot_mode/tsconfig.json +++ b/src/plugins/screenshot_mode/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/security_oss/tsconfig.json b/src/plugins/security_oss/tsconfig.json index 530e01a034b00..6ebeff836f69b 100644 --- a/src/plugins/security_oss/tsconfig.json +++ b/src/plugins/security_oss/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/share/tsconfig.json b/src/plugins/share/tsconfig.json index 985066915f1dd..c6afc06bc61c2 100644 --- a/src/plugins/share/tsconfig.json +++ b/src/plugins/share/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/spaces_oss/tsconfig.json b/src/plugins/spaces_oss/tsconfig.json index 0cc82d7e5d124..35942863c1f1b 100644 --- a/src/plugins/spaces_oss/tsconfig.json +++ b/src/plugins/spaces_oss/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/telemetry/tsconfig.json b/src/plugins/telemetry/tsconfig.json index 710e209537b8e..d50ccd563fe5a 100644 --- a/src/plugins/telemetry/tsconfig.json +++ b/src/plugins/telemetry/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/telemetry_collection_manager/tsconfig.json b/src/plugins/telemetry_collection_manager/tsconfig.json index 1329979860603..adfe3bba07963 100644 --- a/src/plugins/telemetry_collection_manager/tsconfig.json +++ b/src/plugins/telemetry_collection_manager/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/telemetry_management_section/tsconfig.json b/src/plugins/telemetry_management_section/tsconfig.json index 2daee868ac200..0f00f12e71c20 100644 --- a/src/plugins/telemetry_management_section/tsconfig.json +++ b/src/plugins/telemetry_management_section/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/tile_map/tsconfig.json b/src/plugins/tile_map/tsconfig.json index 899611d027465..fec191402f2ab 100644 --- a/src/plugins/tile_map/tsconfig.json +++ b/src/plugins/tile_map/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/timelion/tsconfig.json b/src/plugins/timelion/tsconfig.json index 5b96d69a878ea..594901c3cc1ed 100644 --- a/src/plugins/timelion/tsconfig.json +++ b/src/plugins/timelion/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/ui_actions/tsconfig.json b/src/plugins/ui_actions/tsconfig.json index a871d7215cdc5..d53d60ec73cd4 100644 --- a/src/plugins/ui_actions/tsconfig.json +++ b/src/plugins/ui_actions/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/url_forwarding/tsconfig.json b/src/plugins/url_forwarding/tsconfig.json index 8e867a6bad14f..c6ef2a0286da1 100644 --- a/src/plugins/url_forwarding/tsconfig.json +++ b/src/plugins/url_forwarding/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/usage_collection/tsconfig.json b/src/plugins/usage_collection/tsconfig.json index 68a0853994e80..7fac30a8048ea 100644 --- a/src/plugins/usage_collection/tsconfig.json +++ b/src/plugins/usage_collection/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/vis_default_editor/tsconfig.json b/src/plugins/vis_default_editor/tsconfig.json index 34003bced5ad0..3d8fb6778c85e 100644 --- a/src/plugins/vis_default_editor/tsconfig.json +++ b/src/plugins/vis_default_editor/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/vis_type_markdown/tsconfig.json b/src/plugins/vis_type_markdown/tsconfig.json index d5ab89b98081b..7c32f44935195 100644 --- a/src/plugins/vis_type_markdown/tsconfig.json +++ b/src/plugins/vis_type_markdown/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/vis_type_metric/tsconfig.json b/src/plugins/vis_type_metric/tsconfig.json index bee666a5906cd..e430ec2460796 100644 --- a/src/plugins/vis_type_metric/tsconfig.json +++ b/src/plugins/vis_type_metric/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/vis_type_pie/tsconfig.json b/src/plugins/vis_type_pie/tsconfig.json index 69bd2855b9843..9640447b35d98 100644 --- a/src/plugins/vis_type_pie/tsconfig.json +++ b/src/plugins/vis_type_pie/tsconfig.json @@ -1,25 +1,24 @@ { - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "composite": true, - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, - "declarationMap": true - }, - "include": [ - "common/**/*", - "public/**/*", - "server/**/*" - ], - "references": [ - { "path": "../../core/tsconfig.json" }, - { "path": "../charts/tsconfig.json" }, - { "path": "../data/tsconfig.json" }, - { "path": "../expressions/tsconfig.json" }, - { "path": "../visualizations/tsconfig.json" }, - { "path": "../usage_collection/tsconfig.json" }, - { "path": "../vis_default_editor/tsconfig.json" }, - { "path": "../field_formats/tsconfig.json" } - ] - } \ No newline at end of file + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./target/types", + "emitDeclarationOnly": true, + "declaration": true, + "declarationMap": true + }, + "include": [ + "common/**/*", + "public/**/*", + "server/**/*" + ], + "references": [ + { "path": "../../core/tsconfig.json" }, + { "path": "../charts/tsconfig.json" }, + { "path": "../data/tsconfig.json" }, + { "path": "../expressions/tsconfig.json" }, + { "path": "../visualizations/tsconfig.json" }, + { "path": "../usage_collection/tsconfig.json" }, + { "path": "../vis_default_editor/tsconfig.json" }, + { "path": "../field_formats/tsconfig.json" } + ] +} diff --git a/src/plugins/vis_type_table/tsconfig.json b/src/plugins/vis_type_table/tsconfig.json index 50277d51e8748..16f2f809bde38 100644 --- a/src/plugins/vis_type_table/tsconfig.json +++ b/src/plugins/vis_type_table/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/vis_type_tagcloud/tsconfig.json b/src/plugins/vis_type_tagcloud/tsconfig.json index 18bbad2257466..021237dd7ad5b 100644 --- a/src/plugins/vis_type_tagcloud/tsconfig.json +++ b/src/plugins/vis_type_tagcloud/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/vis_type_timelion/tsconfig.json b/src/plugins/vis_type_timelion/tsconfig.json index 77f97de28366d..efeab8d73db1e 100644 --- a/src/plugins/vis_type_timelion/tsconfig.json +++ b/src/plugins/vis_type_timelion/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/vis_type_timeseries/tsconfig.json b/src/plugins/vis_type_timeseries/tsconfig.json index 7b2dd4b608c1c..68097d8cff786 100644 --- a/src/plugins/vis_type_timeseries/tsconfig.json +++ b/src/plugins/vis_type_timeseries/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/vis_type_vega/tsconfig.json b/src/plugins/vis_type_vega/tsconfig.json index 4091dafcbe357..e1b8b5d9d4bac 100644 --- a/src/plugins/vis_type_vega/tsconfig.json +++ b/src/plugins/vis_type_vega/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/vis_type_vislib/tsconfig.json b/src/plugins/vis_type_vislib/tsconfig.json index 5bf1af9ba75fe..0d2a4094f04be 100644 --- a/src/plugins/vis_type_vislib/tsconfig.json +++ b/src/plugins/vis_type_vislib/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/vis_type_xy/tsconfig.json b/src/plugins/vis_type_xy/tsconfig.json index 5cb0bc8d0bc8e..0e4e41c286bd2 100644 --- a/src/plugins/vis_type_xy/tsconfig.json +++ b/src/plugins/vis_type_xy/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/visualizations/tsconfig.json b/src/plugins/visualizations/tsconfig.json index 356448aa59771..65ab83d5e0bae 100644 --- a/src/plugins/visualizations/tsconfig.json +++ b/src/plugins/visualizations/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/src/plugins/visualize/tsconfig.json b/src/plugins/visualize/tsconfig.json index bc0891f391746..4dcf43dadf8ba 100644 --- a/src/plugins/visualize/tsconfig.json +++ b/src/plugins/visualize/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/test/interpreter_functional/plugins/kbn_tp_run_pipeline/tsconfig.json b/test/interpreter_functional/plugins/kbn_tp_run_pipeline/tsconfig.json index 3d9d8ca9451d4..86170d3561408 100644 --- a/test/interpreter_functional/plugins/kbn_tp_run_pipeline/tsconfig.json +++ b/test/interpreter_functional/plugins/kbn_tp_run_pipeline/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types" }, "include": [ "index.ts", @@ -13,6 +12,10 @@ ], "exclude": [], "references": [ - { "path": "../../../../src/core/tsconfig.json" } + { "path": "../../../../src/core/tsconfig.json" }, + { "path": "../../../../src/plugins/expressions/tsconfig.json" }, + { "path": "../../../../src/plugins/inspector/tsconfig.json" }, + { "path": "../../../../src/plugins/data/tsconfig.json" }, + { "path": "../../../../src/plugins/kibana_utils/tsconfig.json" }, ] } diff --git a/test/plugin_functional/plugins/app_link_test/tsconfig.json b/test/plugin_functional/plugins/app_link_test/tsconfig.json index f77a5eaffc301..b53fafd70cf5d 100644 --- a/test/plugin_functional/plugins/app_link_test/tsconfig.json +++ b/test/plugin_functional/plugins/app_link_test/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types" }, "include": [ "index.ts", @@ -12,6 +11,6 @@ ], "exclude": [], "references": [ - { "path": "../../../../src/core/tsconfig.json" } + { "path": "../../../../src/plugins/kibana_react/tsconfig.json" } ] } diff --git a/test/plugin_functional/plugins/core_app_status/tsconfig.json b/test/plugin_functional/plugins/core_app_status/tsconfig.json index 0f0e7caf2b486..f380bcc8e8b36 100644 --- a/test/plugin_functional/plugins/core_app_status/tsconfig.json +++ b/test/plugin_functional/plugins/core_app_status/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "composite": true, - "outDir": "./target", + "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, "declarationMap": true diff --git a/test/plugin_functional/plugins/core_history_block/tsconfig.json b/test/plugin_functional/plugins/core_history_block/tsconfig.json index ffd2cd261ab23..a6882ecb3d1e0 100644 --- a/test/plugin_functional/plugins/core_history_block/tsconfig.json +++ b/test/plugin_functional/plugins/core_history_block/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types" }, "include": ["index.ts", "public/**/*.ts", "public/**/*.tsx", "../../../../typings/**/*"], "exclude": [], diff --git a/test/plugin_functional/plugins/core_http/tsconfig.json b/test/plugin_functional/plugins/core_http/tsconfig.json index 3d9d8ca9451d4..eab76d901e427 100644 --- a/test/plugin_functional/plugins/core_http/tsconfig.json +++ b/test/plugin_functional/plugins/core_http/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types" }, "include": [ "index.ts", diff --git a/test/plugin_functional/plugins/core_plugin_a/tsconfig.json b/test/plugin_functional/plugins/core_plugin_a/tsconfig.json index 3d9d8ca9451d4..eab76d901e427 100644 --- a/test/plugin_functional/plugins/core_plugin_a/tsconfig.json +++ b/test/plugin_functional/plugins/core_plugin_a/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types" }, "include": [ "index.ts", diff --git a/test/plugin_functional/plugins/core_plugin_appleave/tsconfig.json b/test/plugin_functional/plugins/core_plugin_appleave/tsconfig.json index f77a5eaffc301..87e51c3eab37a 100644 --- a/test/plugin_functional/plugins/core_plugin_appleave/tsconfig.json +++ b/test/plugin_functional/plugins/core_plugin_appleave/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types" }, "include": [ "index.ts", diff --git a/test/plugin_functional/plugins/core_plugin_b/tsconfig.json b/test/plugin_functional/plugins/core_plugin_b/tsconfig.json index 3d9d8ca9451d4..78476ce6697e1 100644 --- a/test/plugin_functional/plugins/core_plugin_b/tsconfig.json +++ b/test/plugin_functional/plugins/core_plugin_b/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types" }, "include": [ "index.ts", @@ -13,6 +12,7 @@ ], "exclude": [], "references": [ - { "path": "../../../../src/core/tsconfig.json" } + { "path": "../../../../src/core/tsconfig.json" }, + { "path": "../core_plugin_a/tsconfig.json" }, ] } diff --git a/test/plugin_functional/plugins/core_plugin_chromeless/tsconfig.json b/test/plugin_functional/plugins/core_plugin_chromeless/tsconfig.json index f77a5eaffc301..010574f0c3be0 100644 --- a/test/plugin_functional/plugins/core_plugin_chromeless/tsconfig.json +++ b/test/plugin_functional/plugins/core_plugin_chromeless/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types" }, "include": [ "index.ts", @@ -12,6 +11,6 @@ ], "exclude": [], "references": [ - { "path": "../../../../src/core/tsconfig.json" } + { "path": "../../../../src/core/tsconfig.json" }, ] } diff --git a/test/plugin_functional/plugins/core_plugin_deep_links/tsconfig.json b/test/plugin_functional/plugins/core_plugin_deep_links/tsconfig.json index f77a5eaffc301..87e51c3eab37a 100644 --- a/test/plugin_functional/plugins/core_plugin_deep_links/tsconfig.json +++ b/test/plugin_functional/plugins/core_plugin_deep_links/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types" }, "include": [ "index.ts", diff --git a/test/plugin_functional/plugins/core_plugin_deprecations/tsconfig.json b/test/plugin_functional/plugins/core_plugin_deprecations/tsconfig.json index 3d9d8ca9451d4..eab76d901e427 100644 --- a/test/plugin_functional/plugins/core_plugin_deprecations/tsconfig.json +++ b/test/plugin_functional/plugins/core_plugin_deprecations/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types" }, "include": [ "index.ts", diff --git a/test/plugin_functional/plugins/core_plugin_execution_context/tsconfig.json b/test/plugin_functional/plugins/core_plugin_execution_context/tsconfig.json index 21662b2b64a18..4c00a35a3db77 100644 --- a/test/plugin_functional/plugins/core_plugin_execution_context/tsconfig.json +++ b/test/plugin_functional/plugins/core_plugin_execution_context/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types" }, "include": [ "index.ts", diff --git a/test/plugin_functional/plugins/core_plugin_helpmenu/tsconfig.json b/test/plugin_functional/plugins/core_plugin_helpmenu/tsconfig.json index f9b0443e0a8bf..d346449e67c42 100644 --- a/test/plugin_functional/plugins/core_plugin_helpmenu/tsconfig.json +++ b/test/plugin_functional/plugins/core_plugin_helpmenu/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types" }, "include": [ "index.ts", diff --git a/test/plugin_functional/plugins/core_plugin_route_timeouts/tsconfig.json b/test/plugin_functional/plugins/core_plugin_route_timeouts/tsconfig.json index 72793a327d97e..b0e6d4f5d84ce 100644 --- a/test/plugin_functional/plugins/core_plugin_route_timeouts/tsconfig.json +++ b/test/plugin_functional/plugins/core_plugin_route_timeouts/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types" }, "include": [ "server/**/*.ts", diff --git a/test/plugin_functional/plugins/core_plugin_static_assets/tsconfig.json b/test/plugin_functional/plugins/core_plugin_static_assets/tsconfig.json index f9b0443e0a8bf..d346449e67c42 100644 --- a/test/plugin_functional/plugins/core_plugin_static_assets/tsconfig.json +++ b/test/plugin_functional/plugins/core_plugin_static_assets/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types" }, "include": [ "index.ts", diff --git a/test/plugin_functional/plugins/core_provider_plugin/tsconfig.json b/test/plugin_functional/plugins/core_provider_plugin/tsconfig.json index d0d1f2d99295a..d18f6a63263bf 100644 --- a/test/plugin_functional/plugins/core_provider_plugin/tsconfig.json +++ b/test/plugin_functional/plugins/core_provider_plugin/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "composite": true, - "outDir": "./target", + "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, "declarationMap": true diff --git a/test/plugin_functional/plugins/data_search/tsconfig.json b/test/plugin_functional/plugins/data_search/tsconfig.json index 72793a327d97e..e82f3fca8fb3c 100644 --- a/test/plugin_functional/plugins/data_search/tsconfig.json +++ b/test/plugin_functional/plugins/data_search/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types" }, "include": [ "server/**/*.ts", @@ -10,6 +9,7 @@ ], "exclude": [], "references": [ - { "path": "../../../../src/core/tsconfig.json" } + { "path": "../../../../src/core/tsconfig.json" }, + { "path": "../../../../src/plugins/data/tsconfig.json" }, ] } diff --git a/test/plugin_functional/plugins/doc_views_plugin/tsconfig.json b/test/plugin_functional/plugins/doc_views_plugin/tsconfig.json index f9b0443e0a8bf..45babe3228965 100644 --- a/test/plugin_functional/plugins/doc_views_plugin/tsconfig.json +++ b/test/plugin_functional/plugins/doc_views_plugin/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types" }, "include": [ "index.ts", @@ -12,6 +11,7 @@ ], "exclude": [], "references": [ - { "path": "../../../../src/core/tsconfig.json" } + { "path": "../../../../src/core/tsconfig.json" }, + { "path": "../../../../src/plugins/discover/tsconfig.json" }, ] } diff --git a/test/plugin_functional/plugins/elasticsearch_client_plugin/tsconfig.json b/test/plugin_functional/plugins/elasticsearch_client_plugin/tsconfig.json index 72793a327d97e..b0e6d4f5d84ce 100644 --- a/test/plugin_functional/plugins/elasticsearch_client_plugin/tsconfig.json +++ b/test/plugin_functional/plugins/elasticsearch_client_plugin/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types" }, "include": [ "server/**/*.ts", diff --git a/test/plugin_functional/plugins/index_patterns/tsconfig.json b/test/plugin_functional/plugins/index_patterns/tsconfig.json index 9d11a9850f151..9ac0d7726c379 100644 --- a/test/plugin_functional/plugins/index_patterns/tsconfig.json +++ b/test/plugin_functional/plugins/index_patterns/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types" }, "include": [ "index.ts", @@ -12,6 +11,7 @@ ], "exclude": [], "references": [ - { "path": "../../../../src/core/tsconfig.json" } + { "path": "../../../../src/core/tsconfig.json" }, + { "path": "../../../../src/plugins/data/tsconfig.json" }, ] } diff --git a/test/plugin_functional/plugins/kbn_sample_panel_action/tsconfig.json b/test/plugin_functional/plugins/kbn_sample_panel_action/tsconfig.json index f77a5eaffc301..043ace6ce064d 100644 --- a/test/plugin_functional/plugins/kbn_sample_panel_action/tsconfig.json +++ b/test/plugin_functional/plugins/kbn_sample_panel_action/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types" }, "include": [ "index.ts", @@ -12,6 +11,9 @@ ], "exclude": [], "references": [ - { "path": "../../../../src/core/tsconfig.json" } + { "path": "../../../../src/core/tsconfig.json" }, + { "path": "../../../../src/plugins/ui_actions/tsconfig.json" }, + { "path": "../../../../src/plugins/embeddable/tsconfig.json" }, + { "path": "../../../../src/plugins/kibana_react/tsconfig.json" }, ] } diff --git a/test/plugin_functional/plugins/kbn_top_nav/tsconfig.json b/test/plugin_functional/plugins/kbn_top_nav/tsconfig.json index 3d9d8ca9451d4..adf3815905d1d 100644 --- a/test/plugin_functional/plugins/kbn_top_nav/tsconfig.json +++ b/test/plugin_functional/plugins/kbn_top_nav/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types" }, "include": [ "index.ts", @@ -13,6 +12,7 @@ ], "exclude": [], "references": [ - { "path": "../../../../src/core/tsconfig.json" } + { "path": "../../../../src/core/tsconfig.json" }, + { "path": "../../../../src/plugins/navigation/tsconfig.json" }, ] } diff --git a/test/plugin_functional/plugins/kbn_tp_custom_visualizations/tsconfig.json b/test/plugin_functional/plugins/kbn_tp_custom_visualizations/tsconfig.json index e92dc717ae25e..8cbb8696409b6 100644 --- a/test/plugin_functional/plugins/kbn_tp_custom_visualizations/tsconfig.json +++ b/test/plugin_functional/plugins/kbn_tp_custom_visualizations/tsconfig.json @@ -1,14 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true, - "types": [ - "node", - "jest", - "react", - "@emotion/react/types/css-prop" - ] + "outDir": "./target/types" }, "include": [ "index.ts", @@ -18,6 +11,9 @@ ], "exclude": [], "references": [ - { "path": "../../../../src/core/tsconfig.json" } + { "path": "../../../../src/core/tsconfig.json" }, + { "path": "../../../../src/plugins/data/tsconfig.json" }, + { "path": "../../../../src/plugins/visualizations/tsconfig.json" }, + { "path": "../../../../src/plugins/expressions/tsconfig.json" }, ] } diff --git a/test/plugin_functional/plugins/management_test_plugin/tsconfig.json b/test/plugin_functional/plugins/management_test_plugin/tsconfig.json index f77a5eaffc301..8222b8f011005 100644 --- a/test/plugin_functional/plugins/management_test_plugin/tsconfig.json +++ b/test/plugin_functional/plugins/management_test_plugin/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types" }, "include": [ "index.ts", @@ -12,6 +11,7 @@ ], "exclude": [], "references": [ - { "path": "../../../../src/core/tsconfig.json" } + { "path": "../../../../src/core/tsconfig.json" }, + { "path": "../../../../src/plugins/management/tsconfig.json" }, ] } diff --git a/test/plugin_functional/plugins/rendering_plugin/tsconfig.json b/test/plugin_functional/plugins/rendering_plugin/tsconfig.json index 3d9d8ca9451d4..eab76d901e427 100644 --- a/test/plugin_functional/plugins/rendering_plugin/tsconfig.json +++ b/test/plugin_functional/plugins/rendering_plugin/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types" }, "include": [ "index.ts", diff --git a/test/plugin_functional/plugins/saved_object_export_transforms/tsconfig.json b/test/plugin_functional/plugins/saved_object_export_transforms/tsconfig.json index da457c9ba32fc..f148b232e21fb 100644 --- a/test/plugin_functional/plugins/saved_object_export_transforms/tsconfig.json +++ b/test/plugin_functional/plugins/saved_object_export_transforms/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types" }, "include": [ "index.ts", diff --git a/test/plugin_functional/plugins/saved_object_import_warnings/tsconfig.json b/test/plugin_functional/plugins/saved_object_import_warnings/tsconfig.json index 3d9d8ca9451d4..eab76d901e427 100644 --- a/test/plugin_functional/plugins/saved_object_import_warnings/tsconfig.json +++ b/test/plugin_functional/plugins/saved_object_import_warnings/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types" }, "include": [ "index.ts", diff --git a/test/plugin_functional/plugins/saved_objects_hidden_type/tsconfig.json b/test/plugin_functional/plugins/saved_objects_hidden_type/tsconfig.json index da457c9ba32fc..f148b232e21fb 100644 --- a/test/plugin_functional/plugins/saved_objects_hidden_type/tsconfig.json +++ b/test/plugin_functional/plugins/saved_objects_hidden_type/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types" }, "include": [ "index.ts", diff --git a/test/plugin_functional/plugins/session_notifications/tsconfig.json b/test/plugin_functional/plugins/session_notifications/tsconfig.json index 3d9d8ca9451d4..c50f2e3f119c8 100644 --- a/test/plugin_functional/plugins/session_notifications/tsconfig.json +++ b/test/plugin_functional/plugins/session_notifications/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types" }, "include": [ "index.ts", @@ -13,6 +12,8 @@ ], "exclude": [], "references": [ - { "path": "../../../../src/core/tsconfig.json" } + { "path": "../../../../src/core/tsconfig.json" }, + { "path": "../../../../src/plugins/navigation/tsconfig.json" }, + { "path": "../../../../src/plugins/data/tsconfig.json" }, ] } diff --git a/test/plugin_functional/plugins/telemetry/tsconfig.json b/test/plugin_functional/plugins/telemetry/tsconfig.json index 947eb49a61b3a..b32ac67279f40 100644 --- a/test/plugin_functional/plugins/telemetry/tsconfig.json +++ b/test/plugin_functional/plugins/telemetry/tsconfig.json @@ -1,10 +1,12 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types" }, "include": ["public/**/*.ts", "types.ts", "../../../../typings/**/*"], "exclude": [], - "references": [{ "path": "../../../../src/core/tsconfig.json" }] + "references": [ + { "path": "../../../../src/core/tsconfig.json" }, + { "path": "../../../../src/plugins/telemetry/tsconfig.json" }, + ] } diff --git a/test/plugin_functional/plugins/ui_settings_plugin/tsconfig.json b/test/plugin_functional/plugins/ui_settings_plugin/tsconfig.json index 05b1c2c11da03..6551c1496164f 100644 --- a/test/plugin_functional/plugins/ui_settings_plugin/tsconfig.json +++ b/test/plugin_functional/plugins/ui_settings_plugin/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types", }, "include": [ "server/**/*.ts", diff --git a/test/plugin_functional/plugins/usage_collection/tsconfig.json b/test/plugin_functional/plugins/usage_collection/tsconfig.json index 3d9d8ca9451d4..d6f7d08f18589 100644 --- a/test/plugin_functional/plugins/usage_collection/tsconfig.json +++ b/test/plugin_functional/plugins/usage_collection/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types" }, "include": [ "index.ts", @@ -13,6 +12,7 @@ ], "exclude": [], "references": [ - { "path": "../../../../src/core/tsconfig.json" } + { "path": "../../../../src/core/tsconfig.json" }, + { "path": "../../../../src/plugins/usage_collection/tsconfig.json" }, ] } diff --git a/test/scripts/checks/type_check_plugin_public_api_docs.sh b/test/scripts/checks/type_check_plugin_public_api_docs.sh index 8acacb696c576..77fa76038f7c4 100755 --- a/test/scripts/checks/type_check_plugin_public_api_docs.sh +++ b/test/scripts/checks/type_check_plugin_public_api_docs.sh @@ -4,7 +4,6 @@ source src/dev/ci_setup/setup_env.sh checks-reporter-with-killswitch "Build TS Refs" \ node scripts/build_ts_refs \ - --ignore-type-failures \ --clean \ --no-cache \ --force diff --git a/test/server_integration/__fixtures__/plugins/status_plugin_a/tsconfig.json b/test/server_integration/__fixtures__/plugins/status_plugin_a/tsconfig.json index 5069db62589c7..14ebb2e7d00c4 100644 --- a/test/server_integration/__fixtures__/plugins/status_plugin_a/tsconfig.json +++ b/test/server_integration/__fixtures__/plugins/status_plugin_a/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true, - "composite": true + "outDir": "./target/types", }, "include": [ "index.ts", diff --git a/test/server_integration/__fixtures__/plugins/status_plugin_b/tsconfig.json b/test/server_integration/__fixtures__/plugins/status_plugin_b/tsconfig.json index 224aa42ef68d2..6b27e9b4b7a6c 100644 --- a/test/server_integration/__fixtures__/plugins/status_plugin_b/tsconfig.json +++ b/test/server_integration/__fixtures__/plugins/status_plugin_b/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true, - "composite": true + "outDir": "./target/types" }, "include": [ "index.ts", diff --git a/test/tsconfig.json b/test/tsconfig.json index dccbe8d715c51..c94d4445dd246 100644 --- a/test/tsconfig.json +++ b/test/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/tsconfig.base.json b/tsconfig.base.json index 0c8fec7c88cda..9de81f68110c1 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -21,6 +21,8 @@ "jsx": "react", // Enables all strict type checking options. "strict": true, + // All TS projects should be composite and only include the files they select, and ref the files outside of the project + "composite": true, // save information about the project graph on disk "incremental": true, // Do not check d.ts files by default diff --git a/tsconfig.bazel.json b/tsconfig.bazel.json new file mode 100644 index 0000000000000..892c727ef588e --- /dev/null +++ b/tsconfig.bazel.json @@ -0,0 +1,7 @@ +{ + "extends": "./tsconfig.base.json", + "compilerOptions": { + "incremental": false, + "composite": false + } +} diff --git a/tsconfig.browser_bazel.json b/tsconfig.browser_bazel.json new file mode 100644 index 0000000000000..3a950a756dd08 --- /dev/null +++ b/tsconfig.browser_bazel.json @@ -0,0 +1,7 @@ +{ + "extends": "./tsconfig.browser.json", + "compilerOptions": { + "incremental": false, + "composite": false + } +} diff --git a/tsconfig.json b/tsconfig.json index 6066ce11cc626..769dd5ecb6a55 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "./tsconfig.base.json", "compilerOptions": { - "incremental": false + "outDir": "target/root_types" }, "include": [ "kibana.d.ts", @@ -16,121 +16,7 @@ "exclude": [], "references": [ { "path": "./src/core/tsconfig.json" }, - { "path": "./src/plugins/telemetry_management_section/tsconfig.json" }, - { "path": "./src/plugins/advanced_settings/tsconfig.json" }, - { "path": "./src/plugins/apm_oss/tsconfig.json" }, - { "path": "./src/plugins/bfetch/tsconfig.json" }, - { "path": "./src/plugins/charts/tsconfig.json" }, - { "path": "./src/plugins/console/tsconfig.json" }, - { "path": "./src/plugins/dashboard/tsconfig.json" }, - { "path": "./src/plugins/discover/tsconfig.json" }, - { "path": "./src/plugins/data/tsconfig.json" }, - { "path": "./src/plugins/dev_tools/tsconfig.json" }, - { "path": "./src/plugins/embeddable/tsconfig.json" }, - { "path": "./src/plugins/es_ui_shared/tsconfig.json" }, - { "path": "./src/plugins/expressions/tsconfig.json" }, - { "path": "./src/plugins/home/tsconfig.json" }, - { "path": "./src/plugins/inspector/tsconfig.json" }, - { "path": "./src/plugins/kibana_legacy/tsconfig.json" }, - { "path": "./src/plugins/kibana_overview/tsconfig.json" }, - { "path": "./src/plugins/kibana_react/tsconfig.json" }, - { "path": "./src/plugins/kibana_usage_collection/tsconfig.json" }, - { "path": "./src/plugins/kibana_utils/tsconfig.json" }, - { "path": "./src/plugins/legacy_export/tsconfig.json" }, - { "path": "./src/plugins/management/tsconfig.json" }, - { "path": "./src/plugins/maps_legacy/tsconfig.json" }, - { "path": "./src/plugins/navigation/tsconfig.json" }, - { "path": "./src/plugins/newsfeed/tsconfig.json" }, - { "path": "./src/plugins/region_map/tsconfig.json" }, - { "path": "./src/plugins/saved_objects/tsconfig.json" }, - { "path": "./src/plugins/saved_objects_management/tsconfig.json" }, - { "path": "./src/plugins/saved_objects_tagging_oss/tsconfig.json" }, - { "path": "./src/plugins/security_oss/tsconfig.json" }, - { "path": "./src/plugins/share/tsconfig.json" }, - { "path": "./src/plugins/spaces_oss/tsconfig.json" }, - { "path": "./src/plugins/telemetry/tsconfig.json" }, - { "path": "./src/plugins/telemetry_collection_manager/tsconfig.json" }, - { "path": "./src/plugins/tile_map/tsconfig.json" }, - { "path": "./src/plugins/timelion/tsconfig.json" }, - { "path": "./src/plugins/ui_actions/tsconfig.json" }, - { "path": "./src/plugins/url_forwarding/tsconfig.json" }, { "path": "./src/plugins/usage_collection/tsconfig.json" }, - { "path": "./src/plugins/vis_default_editor/tsconfig.json" }, - { "path": "./src/plugins/vis_type_markdown/tsconfig.json" }, - { "path": "./src/plugins/vis_type_metric/tsconfig.json" }, - { "path": "./src/plugins/vis_type_table/tsconfig.json" }, - { "path": "./src/plugins/vis_type_tagcloud/tsconfig.json" }, - { "path": "./src/plugins/vis_type_timelion/tsconfig.json" }, - { "path": "./src/plugins/vis_type_timeseries/tsconfig.json" }, - { "path": "./src/plugins/vis_type_vislib/tsconfig.json" }, - { "path": "./src/plugins/vis_type_vega/tsconfig.json" }, - { "path": "./src/plugins/vis_type_xy/tsconfig.json" }, - { "path": "./src/plugins/vis_type_pie/tsconfig.json" }, - { "path": "./src/plugins/visualizations/tsconfig.json" }, - { "path": "./src/plugins/visualize/tsconfig.json" }, - { "path": "./src/plugins/index_pattern_management/tsconfig.json" }, - { "path": "./src/plugins/index_pattern_field_editor/tsconfig.json" }, - { "path": "./src/plugins/index_pattern_editor/tsconfig.json" }, - { "path": "./x-pack/plugins/actions/tsconfig.json" }, - { "path": "./x-pack/plugins/alerting/tsconfig.json" }, - { "path": "./x-pack/plugins/apm/tsconfig.json" }, - { "path": "./x-pack/plugins/canvas/tsconfig.json" }, - { "path": "./x-pack/plugins/cases/tsconfig.json" }, - { "path": "./x-pack/plugins/cloud/tsconfig.json" }, - { "path": "./x-pack/plugins/data_enhanced/tsconfig.json" }, - { "path": "./x-pack/plugins/dashboard_mode/tsconfig.json" }, - { "path": "./x-pack/plugins/discover_enhanced/tsconfig.json" }, - { "path": "./x-pack/plugins/drilldowns/url_drilldown/tsconfig.json" }, - { "path": "./x-pack/plugins/embeddable_enhanced/tsconfig.json" }, - { "path": "./x-pack/plugins/encrypted_saved_objects/tsconfig.json" }, - { "path": "./x-pack/plugins/enterprise_search/tsconfig.json" }, - { "path": "./x-pack/plugins/event_log/tsconfig.json" }, - { "path": "./x-pack/plugins/features/tsconfig.json" }, - { "path": "./x-pack/plugins/file_upload/tsconfig.json" }, - { "path": "./x-pack/plugins/fleet/tsconfig.json" }, - { "path": "./x-pack/plugins/global_search_bar/tsconfig.json" }, - { "path": "./x-pack/plugins/global_search_providers/tsconfig.json" }, - { "path": "./x-pack/plugins/global_search/tsconfig.json" }, - { "path": "./x-pack/plugins/graph/tsconfig.json" }, - { "path": "./x-pack/plugins/grokdebugger/tsconfig.json" }, - { "path": "./x-pack/plugins/infra/tsconfig.json" }, - { "path": "./x-pack/plugins/ingest_pipelines/tsconfig.json" }, - { "path": "./x-pack/plugins/lens/tsconfig.json" }, - { "path": "./x-pack/plugins/license_api_guard/tsconfig.json" }, - { "path": "./x-pack/plugins/license_management/tsconfig.json" }, - { "path": "./x-pack/plugins/licensing/tsconfig.json" }, - { "path": "./x-pack/plugins/lists/tsconfig.json" }, - { "path": "./x-pack/plugins/logstash/tsconfig.json" }, - { "path": "./x-pack/plugins/maps/tsconfig.json" }, - { "path": "./x-pack/plugins/metrics_entities/tsconfig.json" }, - { "path": "./x-pack/plugins/ml/tsconfig.json" }, - { "path": "./x-pack/plugins/monitoring/tsconfig.json" }, - { "path": "./x-pack/plugins/observability/tsconfig.json" }, - { "path": "./x-pack/plugins/osquery/tsconfig.json" }, - { "path": "./x-pack/plugins/painless_lab/tsconfig.json" }, - { "path": "./x-pack/plugins/saved_objects_tagging/tsconfig.json" }, - { "path": "./x-pack/plugins/searchprofiler/tsconfig.json" }, - { "path": "./x-pack/plugins/security/tsconfig.json" }, - { "path": "./x-pack/plugins/security_solution/tsconfig.json" }, - { "path": "./x-pack/plugins/snapshot_restore/tsconfig.json" }, - { "path": "./x-pack/plugins/spaces/tsconfig.json" }, - { "path": "./x-pack/plugins/stack_alerts/tsconfig.json" }, - { "path": "./x-pack/plugins/task_manager/tsconfig.json" }, - { "path": "./x-pack/plugins/telemetry_collection_xpack/tsconfig.json" }, - { "path": "./x-pack/plugins/timelines/tsconfig.json" }, - { "path": "./x-pack/plugins/transform/tsconfig.json" }, - { "path": "./x-pack/plugins/translations/tsconfig.json" }, - { "path": "./x-pack/plugins/triggers_actions_ui/tsconfig.json" }, - { "path": "./x-pack/plugins/ui_actions_enhanced/tsconfig.json" }, - { "path": "./x-pack/plugins/upgrade_assistant/tsconfig.json" }, - { "path": "./x-pack/plugins/runtime_fields/tsconfig.json" }, - { "path": "./x-pack/plugins/index_management/tsconfig.json" }, - { "path": "./x-pack/plugins/watcher/tsconfig.json" }, - { "path": "./x-pack/plugins/rollup/tsconfig.json" }, - { "path": "./x-pack/plugins/remote_clusters/tsconfig.json" }, - { "path": "./x-pack/plugins/cross_cluster_replication/tsconfig.json"}, - { "path": "./x-pack/plugins/index_lifecycle_management/tsconfig.json"}, - { "path": "./x-pack/plugins/uptime/tsconfig.json" }, - { "path": "./x-pack/plugins/xpack_legacy/tsconfig.json" } + { "path": "./x-pack/plugins/reporting/tsconfig.json" }, ] } diff --git a/tsconfig.refs.json b/tsconfig.refs.json deleted file mode 100644 index 5778988e85bc1..0000000000000 --- a/tsconfig.refs.json +++ /dev/null @@ -1,126 +0,0 @@ -{ - "include": [], - "references": [ - { "path": "./src/core/tsconfig.json" }, - { "path": "./src/plugins/advanced_settings/tsconfig.json" }, - { "path": "./src/plugins/apm_oss/tsconfig.json" }, - { "path": "./src/plugins/bfetch/tsconfig.json" }, - { "path": "./src/plugins/charts/tsconfig.json" }, - { "path": "./src/plugins/console/tsconfig.json" }, - { "path": "./src/plugins/dashboard/tsconfig.json" }, - { "path": "./src/plugins/data/tsconfig.json" }, - { "path": "./src/plugins/dev_tools/tsconfig.json" }, - { "path": "./src/plugins/discover/tsconfig.json" }, - { "path": "./src/plugins/embeddable/tsconfig.json" }, - { "path": "./src/plugins/es_ui_shared/tsconfig.json" }, - { "path": "./src/plugins/expressions/tsconfig.json" }, - { "path": "./src/plugins/home/tsconfig.json" }, - { "path": "./src/plugins/inspector/tsconfig.json" }, - { "path": "./src/plugins/kibana_legacy/tsconfig.json" }, - { "path": "./src/plugins/kibana_overview/tsconfig.json" }, - { "path": "./src/plugins/kibana_react/tsconfig.json" }, - { "path": "./src/plugins/kibana_usage_collection/tsconfig.json" }, - { "path": "./src/plugins/kibana_utils/tsconfig.json" }, - { "path": "./src/plugins/legacy_export/tsconfig.json" }, - { "path": "./src/plugins/management/tsconfig.json" }, - { "path": "./src/plugins/maps_legacy/tsconfig.json" }, - { "path": "./src/plugins/navigation/tsconfig.json" }, - { "path": "./src/plugins/newsfeed/tsconfig.json" }, - { "path": "./src/plugins/presentation_util/tsconfig.json" }, - { "path": "./src/plugins/region_map/tsconfig.json" }, - { "path": "./src/plugins/saved_objects_management/tsconfig.json" }, - { "path": "./src/plugins/saved_objects_tagging_oss/tsconfig.json" }, - { "path": "./src/plugins/saved_objects/tsconfig.json" }, - { "path": "./src/plugins/security_oss/tsconfig.json" }, - { "path": "./src/plugins/share/tsconfig.json" }, - { "path": "./src/plugins/spaces_oss/tsconfig.json" }, - { "path": "./src/plugins/telemetry_collection_manager/tsconfig.json" }, - { "path": "./src/plugins/telemetry_management_section/tsconfig.json" }, - { "path": "./src/plugins/telemetry/tsconfig.json" }, - { "path": "./src/plugins/tile_map/tsconfig.json" }, - { "path": "./src/plugins/timelion/tsconfig.json" }, - { "path": "./src/plugins/ui_actions/tsconfig.json" }, - { "path": "./src/plugins/url_forwarding/tsconfig.json" }, - { "path": "./src/plugins/usage_collection/tsconfig.json" }, - { "path": "./src/plugins/vis_default_editor/tsconfig.json" }, - { "path": "./src/plugins/vis_type_markdown/tsconfig.json" }, - { "path": "./src/plugins/vis_type_metric/tsconfig.json" }, - { "path": "./src/plugins/vis_type_table/tsconfig.json" }, - { "path": "./src/plugins/vis_type_tagcloud/tsconfig.json" }, - { "path": "./src/plugins/vis_type_timelion/tsconfig.json" }, - { "path": "./src/plugins/vis_type_timeseries/tsconfig.json" }, - { "path": "./src/plugins/vis_type_vislib/tsconfig.json" }, - { "path": "./src/plugins/vis_type_vega/tsconfig.json" }, - { "path": "./src/plugins/vis_type_xy/tsconfig.json" }, - { "path": "./src/plugins/vis_type_pie/tsconfig.json" }, - { "path": "./src/plugins/visualizations/tsconfig.json" }, - { "path": "./src/plugins/visualize/tsconfig.json" }, - { "path": "./src/plugins/index_pattern_management/tsconfig.json" }, - { "path": "./src/plugins/index_pattern_editor/tsconfig.json" }, - { "path": "./test/tsconfig.json" }, - { "path": "./x-pack/plugins/actions/tsconfig.json" }, - { "path": "./x-pack/plugins/alerting/tsconfig.json" }, - { "path": "./x-pack/plugins/apm/tsconfig.json" }, - { "path": "./x-pack/plugins/canvas/tsconfig.json" }, - { "path": "./x-pack/plugins/cases/tsconfig.json" }, - { "path": "./x-pack/plugins/cloud/tsconfig.json" }, - { "path": "./x-pack/plugins/code/tsconfig.json" }, - { "path": "./x-pack/plugins/dashboard_enhanced/tsconfig.json" }, - { "path": "./x-pack/plugins/data_enhanced/tsconfig.json" }, - { "path": "./x-pack/plugins/dashboard_mode/tsconfig.json" }, - { "path": "./x-pack/plugins/discover_enhanced/tsconfig.json" }, - { "path": "./x-pack/plugins/drilldowns/url_drilldown/tsconfig.json" }, - { "path": "./x-pack/plugins/embeddable_enhanced/tsconfig.json" }, - { "path": "./x-pack/plugins/encrypted_saved_objects/tsconfig.json" }, - { "path": "./x-pack/plugins/enterprise_search/tsconfig.json" }, - { "path": "./x-pack/plugins/event_log/tsconfig.json" }, - { "path": "./x-pack/plugins/features/tsconfig.json" }, - { "path": "./x-pack/plugins/file_upload/tsconfig.json" }, - { "path": "./x-pack/plugins/fleet/tsconfig.json" }, - { "path": "./x-pack/plugins/global_search_bar/tsconfig.json" }, - { "path": "./x-pack/plugins/global_search_providers/tsconfig.json" }, - { "path": "./x-pack/plugins/global_search/tsconfig.json" }, - { "path": "./x-pack/plugins/graph/tsconfig.json" }, - { "path": "./x-pack/plugins/grokdebugger/tsconfig.json" }, - { "path": "./x-pack/plugins/infra/tsconfig.json" }, - { "path": "./x-pack/plugins/ingest_pipelines/tsconfig.json" }, - { "path": "./x-pack/plugins/lens/tsconfig.json" }, - { "path": "./x-pack/plugins/license_management/tsconfig.json" }, - { "path": "./x-pack/plugins/licensing/tsconfig.json" }, - { "path": "./x-pack/plugins/lists/tsconfig.json" }, - { "path": "./x-pack/plugins/logstash/tsconfig.json" }, - { "path": "./x-pack/plugins/maps/tsconfig.json" }, - { "path": "./x-pack/plugins/metrics_entities/tsconfig.json" }, - { "path": "./x-pack/plugins/ml/tsconfig.json" }, - { "path": "./x-pack/plugins/monitoring/tsconfig.json" }, - { "path": "./x-pack/plugins/observability/tsconfig.json" }, - { "path": "./x-pack/plugins/osquery/tsconfig.json" }, - { "path": "./x-pack/plugins/painless_lab/tsconfig.json" }, - { "path": "./x-pack/plugins/reporting/tsconfig.json" }, - { "path": "./x-pack/plugins/saved_objects_tagging/tsconfig.json" }, - { "path": "./x-pack/plugins/searchprofiler/tsconfig.json" }, - { "path": "./x-pack/plugins/security/tsconfig.json" }, - { "path": "./x-pack/plugins/security_solution/tsconfig.json" }, - { "path": "./x-pack/plugins/snapshot_restore/tsconfig.json" }, - { "path": "./x-pack/plugins/spaces/tsconfig.json" }, - { "path": "./x-pack/plugins/stack_alerts/tsconfig.json" }, - { "path": "./x-pack/plugins/task_manager/tsconfig.json" }, - { "path": "./x-pack/plugins/telemetry_collection_xpack/tsconfig.json" }, - { "path": "./x-pack/plugins/timelines/tsconfig.json" }, - { "path": "./x-pack/plugins/transform/tsconfig.json" }, - { "path": "./x-pack/plugins/translations/tsconfig.json" }, - { "path": "./x-pack/plugins/triggers_actions_ui/tsconfig.json" }, - { "path": "./x-pack/plugins/ui_actions_enhanced/tsconfig.json" }, - { "path": "./x-pack/plugins/upgrade_assistant/tsconfig.json" }, - { "path": "./x-pack/plugins/runtime_fields/tsconfig.json" }, - { "path": "./x-pack/plugins/index_management/tsconfig.json" }, - { "path": "./x-pack/plugins/watcher/tsconfig.json" }, - { "path": "./x-pack/plugins/rollup/tsconfig.json" }, - { "path": "./x-pack/plugins/remote_clusters/tsconfig.json" }, - { "path": "./x-pack/plugins/cross_cluster_replication/tsconfig.json" }, - { "path": "./x-pack/plugins/index_lifecycle_management/tsconfig.json" }, - { "path": "./x-pack/plugins/uptime/tsconfig.json" }, - { "path": "./x-pack/plugins/xpack_legacy/tsconfig.json" }, - { "path": "./x-pack/test/tsconfig.json" }, - ] -} diff --git a/tsconfig.types.json b/tsconfig.types.json index 86a45f6db1697..54a26b6aca404 100644 --- a/tsconfig.types.json +++ b/tsconfig.types.json @@ -1,12 +1,12 @@ { "extends": "./tsconfig.base.json", "compilerOptions": { - "incremental": false, - "declaration": true, + "composite": false, "outDir": "./target/types", "stripInternal": false, + "declaration": true, "emitDeclarationOnly": true, - "declarationMap": true + "declarationMap": true, }, "include": [ "src/core/server/index.ts", diff --git a/x-pack/examples/alerting_example/tsconfig.json b/x-pack/examples/alerting_example/tsconfig.json index 95d42d40aceb3..881c48029031d 100644 --- a/x-pack/examples/alerting_example/tsconfig.json +++ b/x-pack/examples/alerting_example/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target" + "outDir": "./target/types" }, "include": [ "index.ts", @@ -13,6 +13,13 @@ ], "exclude": [], "references": [ - { "path": "../../../src/core/tsconfig.json" } + { "path": "../../../src/core/tsconfig.json" }, + { "path": "../../../src/plugins/kibana_react/tsconfig.json" }, + { "path": "../../../src/plugins/charts/tsconfig.json" }, + { "path": "../../../src/plugins/data/tsconfig.json" }, + { "path": "../../plugins/alerting/tsconfig.json" }, + { "path": "../../plugins/triggers_actions_ui/tsconfig.json" }, + { "path": "../../plugins/features/tsconfig.json" }, + { "path": "../../../examples/developer_examples/tsconfig.json" }, ] } diff --git a/x-pack/examples/embedded_lens_example/tsconfig.json b/x-pack/examples/embedded_lens_example/tsconfig.json index 195db6effc5e6..e1016a6c011a1 100644 --- a/x-pack/examples/embedded_lens_example/tsconfig.json +++ b/x-pack/examples/embedded_lens_example/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types" }, "include": [ "index.ts", @@ -14,9 +13,9 @@ "exclude": [], "references": [ { "path": "../../../src/core/tsconfig.json" }, - { "path": "../../../src/plugins/kibana_utils/tsconfig.json" }, - { "path": "../../../src/plugins/kibana_react/tsconfig.json" }, - { "path": "../../../src/plugins/share/tsconfig.json" }, - { "path": "../../../src/plugins/data/tsconfig.json" } + { "path": "../../../src/plugins/data/tsconfig.json" }, + { "path": "../../../src/plugins/embeddable/tsconfig.json" }, + { "path": "../../plugins/lens/tsconfig.json" }, + { "path": "../../../examples/developer_examples/tsconfig.json" }, ] } diff --git a/x-pack/examples/reporting_example/tsconfig.json b/x-pack/examples/reporting_example/tsconfig.json index ef727b3368b12..4c4016911e0c5 100644 --- a/x-pack/examples/reporting_example/tsconfig.json +++ b/x-pack/examples/reporting_example/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target" + "outDir": "./target/types" }, "include": [ "index.ts", @@ -13,7 +13,11 @@ ], "exclude": [], "references": [ - { "path": "../../../src/core/tsconfig.json" } + { "path": "../../../src/core/tsconfig.json" }, + { "path": "../../../src/plugins/navigation/tsconfig.json" }, + { "path": "../../../src/plugins/screenshot_mode/tsconfig.json" }, + { "path": "../../../examples/developer_examples/tsconfig.json" }, + { "path": "../../plugins/reporting/tsconfig.json" }, ] } diff --git a/x-pack/examples/ui_actions_enhanced_examples/tsconfig.json b/x-pack/examples/ui_actions_enhanced_examples/tsconfig.json index 567baca039d76..0282ecbdd173a 100644 --- a/x-pack/examples/ui_actions_enhanced_examples/tsconfig.json +++ b/x-pack/examples/ui_actions_enhanced_examples/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types" }, "include": [ "index.ts", @@ -16,6 +15,12 @@ { "path": "../../../src/core/tsconfig.json" }, { "path": "../../../src/plugins/kibana_utils/tsconfig.json" }, { "path": "../../../src/plugins/kibana_react/tsconfig.json" }, - { "path": "../../../src/plugins/share/tsconfig.json" } + { "path": "../../../src/plugins/share/tsconfig.json" }, + { "path": "../../../src/plugins/discover/tsconfig.json" }, + { "path": "../../../src/plugins/dashboard/tsconfig.json" }, + { "path": "../../../src/plugins/embeddable/tsconfig.json" }, + { "path": "../../../examples/developer_examples/tsconfig.json" }, + { "path": "../../plugins/dashboard_enhanced/tsconfig.json" }, + { "path": "../../plugins/ui_actions_enhanced/tsconfig.json" }, ] } diff --git a/x-pack/plugins/actions/tsconfig.json b/x-pack/plugins/actions/tsconfig.json index d5c1105c99ad0..b2526d84a3ce4 100644 --- a/x-pack/plugins/actions/tsconfig.json +++ b/x-pack/plugins/actions/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/alerting/tsconfig.json b/x-pack/plugins/alerting/tsconfig.json index 86ab00faeb5ad..a822bd776134b 100644 --- a/x-pack/plugins/alerting/tsconfig.json +++ b/x-pack/plugins/alerting/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/apm/e2e/tsconfig.json b/x-pack/plugins/apm/e2e/tsconfig.json index c4587349c7ad7..2560a15df9224 100644 --- a/x-pack/plugins/apm/e2e/tsconfig.json +++ b/x-pack/plugins/apm/e2e/tsconfig.json @@ -1,8 +1,9 @@ { "extends": "../../../../tsconfig.base.json", - "exclude": ["tmp"], - "include": ["./**/*"], + "include": ["**/*"], + "exclude": ["tmp", "target/**/*"], "compilerOptions": { + "outDir": "target/types", "types": ["cypress", "node"] } } diff --git a/x-pack/plugins/apm/ftr_e2e/config.ts b/x-pack/plugins/apm/ftr_e2e/config.ts index 38c196fbe70c2..4cb218fd24755 100644 --- a/x-pack/plugins/apm/ftr_e2e/config.ts +++ b/x-pack/plugins/apm/ftr_e2e/config.ts @@ -5,8 +5,6 @@ * 2.0. */ -import { resolve } from 'path'; - import { FtrConfigProviderContext } from '@kbn/test'; import { CA_CERT_PATH } from '@kbn/dev-utils'; diff --git a/x-pack/plugins/apm/ftr_e2e/tsconfig.json b/x-pack/plugins/apm/ftr_e2e/tsconfig.json index 94b2b024ca4cc..84a66afe4588d 100644 --- a/x-pack/plugins/apm/ftr_e2e/tsconfig.json +++ b/x-pack/plugins/apm/ftr_e2e/tsconfig.json @@ -1,16 +1,22 @@ { "extends": "../../../../tsconfig.base.json", - "exclude": [ - "tmp" - ], "include": [ - "./**/*" + "**/*" + ], + "exclude": [ + "tmp", + "target/**/*" ], "compilerOptions": { + "outDir": "target/types", "types": [ "cypress", "node", "cypress-real-events" ] - } -} \ No newline at end of file + }, + "references": [ + { "path": "../../../test/tsconfig.json" }, + { "path": "../../../../test/tsconfig.json" }, + ] +} diff --git a/x-pack/plugins/apm/tsconfig.json b/x-pack/plugins/apm/tsconfig.json index 192b7f4fe8c2e..6eaf1a3bf1833 100644 --- a/x-pack/plugins/apm/tsconfig.json +++ b/x-pack/plugins/apm/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/banners/tsconfig.json b/x-pack/plugins/banners/tsconfig.json index 85608a8a78ad5..48767fb4525f5 100644 --- a/x-pack/plugins/banners/tsconfig.json +++ b/x-pack/plugins/banners/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/canvas/tsconfig.json b/x-pack/plugins/canvas/tsconfig.json index 384a7716657f5..87fabe2730c16 100644 --- a/x-pack/plugins/canvas/tsconfig.json +++ b/x-pack/plugins/canvas/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/cases/tsconfig.json b/x-pack/plugins/cases/tsconfig.json index 493fe6430efa7..99622df805ced 100644 --- a/x-pack/plugins/cases/tsconfig.json +++ b/x-pack/plugins/cases/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/cloud/tsconfig.json b/x-pack/plugins/cloud/tsconfig.json index 46e81aa7fa086..d1ff8c63e84cb 100644 --- a/x-pack/plugins/cloud/tsconfig.json +++ b/x-pack/plugins/cloud/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/code/tsconfig.json b/x-pack/plugins/code/tsconfig.json index 9c0b0ed21330f..1b80f911d53bf 100644 --- a/x-pack/plugins/code/tsconfig.json +++ b/x-pack/plugins/code/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/cross_cluster_replication/tsconfig.json b/x-pack/plugins/cross_cluster_replication/tsconfig.json index e0923553beadc..4c1f3b20fa23e 100644 --- a/x-pack/plugins/cross_cluster_replication/tsconfig.json +++ b/x-pack/plugins/cross_cluster_replication/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/dashboard_enhanced/tsconfig.json b/x-pack/plugins/dashboard_enhanced/tsconfig.json index 567c390edfa5a..cebf306003aba 100644 --- a/x-pack/plugins/dashboard_enhanced/tsconfig.json +++ b/x-pack/plugins/dashboard_enhanced/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/dashboard_mode/tsconfig.json b/x-pack/plugins/dashboard_mode/tsconfig.json index 6e4ed11ffa7ff..8094e70e96b60 100644 --- a/x-pack/plugins/dashboard_mode/tsconfig.json +++ b/x-pack/plugins/dashboard_mode/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/data_enhanced/tsconfig.json b/x-pack/plugins/data_enhanced/tsconfig.json index 047b9b06516ba..544b50c21224f 100644 --- a/x-pack/plugins/data_enhanced/tsconfig.json +++ b/x-pack/plugins/data_enhanced/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/data_visualizer/tsconfig.json b/x-pack/plugins/data_visualizer/tsconfig.json index 7c60002c3c630..ee5f894305d5a 100644 --- a/x-pack/plugins/data_visualizer/tsconfig.json +++ b/x-pack/plugins/data_visualizer/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/discover_enhanced/tsconfig.json b/x-pack/plugins/discover_enhanced/tsconfig.json index 38a55e557909b..f372b7a7539ac 100644 --- a/x-pack/plugins/discover_enhanced/tsconfig.json +++ b/x-pack/plugins/discover_enhanced/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/drilldowns/url_drilldown/tsconfig.json b/x-pack/plugins/drilldowns/url_drilldown/tsconfig.json index 50fe41c49b0c8..85a215254bb77 100644 --- a/x-pack/plugins/drilldowns/url_drilldown/tsconfig.json +++ b/x-pack/plugins/drilldowns/url_drilldown/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/embeddable_enhanced/tsconfig.json b/x-pack/plugins/embeddable_enhanced/tsconfig.json index 6e9eb69585cbc..f9ac369587473 100644 --- a/x-pack/plugins/embeddable_enhanced/tsconfig.json +++ b/x-pack/plugins/embeddable_enhanced/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/encrypted_saved_objects/tsconfig.json b/x-pack/plugins/encrypted_saved_objects/tsconfig.json index 2b51b313d34fc..4b06756a9cf2f 100644 --- a/x-pack/plugins/encrypted_saved_objects/tsconfig.json +++ b/x-pack/plugins/encrypted_saved_objects/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/enterprise_search/tsconfig.json b/x-pack/plugins/enterprise_search/tsconfig.json index 976cdfadca4b7..481c4527d5977 100644 --- a/x-pack/plugins/enterprise_search/tsconfig.json +++ b/x-pack/plugins/enterprise_search/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/event_log/tsconfig.json b/x-pack/plugins/event_log/tsconfig.json index 9b7cde10da3d6..e0e72fdbf6581 100644 --- a/x-pack/plugins/event_log/tsconfig.json +++ b/x-pack/plugins/event_log/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/features/tsconfig.json b/x-pack/plugins/features/tsconfig.json index 1260af55fbff6..b16d7b47bba5b 100644 --- a/x-pack/plugins/features/tsconfig.json +++ b/x-pack/plugins/features/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/file_upload/tsconfig.json b/x-pack/plugins/file_upload/tsconfig.json index 3e146d76fbb90..efea61e38b3e8 100644 --- a/x-pack/plugins/file_upload/tsconfig.json +++ b/x-pack/plugins/file_upload/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/fleet/tsconfig.json b/x-pack/plugins/fleet/tsconfig.json index a20d82de3c859..5002bf2893872 100644 --- a/x-pack/plugins/fleet/tsconfig.json +++ b/x-pack/plugins/fleet/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/global_search/tsconfig.json b/x-pack/plugins/global_search/tsconfig.json index 2d05328f445df..6a0385e5c080b 100644 --- a/x-pack/plugins/global_search/tsconfig.json +++ b/x-pack/plugins/global_search/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/global_search_bar/tsconfig.json b/x-pack/plugins/global_search_bar/tsconfig.json index 266eecc35c84b..04464a3c08200 100644 --- a/x-pack/plugins/global_search_bar/tsconfig.json +++ b/x-pack/plugins/global_search_bar/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/global_search_providers/tsconfig.json b/x-pack/plugins/global_search_providers/tsconfig.json index f2759954a6845..4ce15f6d44683 100644 --- a/x-pack/plugins/global_search_providers/tsconfig.json +++ b/x-pack/plugins/global_search_providers/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/graph/tsconfig.json b/x-pack/plugins/graph/tsconfig.json index 741c603e3aae4..d655f28c4e46e 100644 --- a/x-pack/plugins/graph/tsconfig.json +++ b/x-pack/plugins/graph/tsconfig.json @@ -1,30 +1,29 @@ { - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "composite": true, - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, - "declarationMap": true - }, - "include": [ - "*.ts", - "common/**/*", - "public/**/*", - "server/**/*", - "../../../typings/**/*", - ], - "references": [ - { "path": "../../../src/core/tsconfig.json" }, - { "path": "../licensing/tsconfig.json" }, - { "path": "../features/tsconfig.json"}, - { "path": "../../../src/plugins/data/tsconfig.json"}, - { "path": "../../../src/plugins/navigation/tsconfig.json" }, - { "path": "../../../src/plugins/saved_objects/tsconfig.json"}, - { "path": "../../../src/plugins/kibana_legacy/tsconfig.json"}, - { "path": "../../../src/plugins/home/tsconfig.json"}, - { "path": "../../../src/plugins/kibana_utils/tsconfig.json" }, - { "path": "../../../src/plugins/kibana_react/tsconfig.json" } - ] - } \ No newline at end of file + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./target/types", + "emitDeclarationOnly": true, + "declaration": true, + "declarationMap": true + }, + "include": [ + "*.ts", + "common/**/*", + "public/**/*", + "server/**/*", + "../../../typings/**/*", + ], + "references": [ + { "path": "../../../src/core/tsconfig.json" }, + { "path": "../licensing/tsconfig.json" }, + { "path": "../features/tsconfig.json"}, + { "path": "../../../src/plugins/data/tsconfig.json"}, + { "path": "../../../src/plugins/navigation/tsconfig.json" }, + { "path": "../../../src/plugins/saved_objects/tsconfig.json"}, + { "path": "../../../src/plugins/kibana_legacy/tsconfig.json"}, + { "path": "../../../src/plugins/home/tsconfig.json"}, + { "path": "../../../src/plugins/kibana_utils/tsconfig.json" }, + { "path": "../../../src/plugins/kibana_react/tsconfig.json" } + ] +} diff --git a/x-pack/plugins/grokdebugger/tsconfig.json b/x-pack/plugins/grokdebugger/tsconfig.json index 51d2d0b6db0ea..aefb15f74c7b6 100644 --- a/x-pack/plugins/grokdebugger/tsconfig.json +++ b/x-pack/plugins/grokdebugger/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/index_lifecycle_management/tsconfig.json b/x-pack/plugins/index_lifecycle_management/tsconfig.json index 75bd775a36749..d3a342e110211 100644 --- a/x-pack/plugins/index_lifecycle_management/tsconfig.json +++ b/x-pack/plugins/index_lifecycle_management/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/index_management/tsconfig.json b/x-pack/plugins/index_management/tsconfig.json index 81a96a77cef83..120e58c2850c5 100644 --- a/x-pack/plugins/index_management/tsconfig.json +++ b/x-pack/plugins/index_management/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/infra/tsconfig.json b/x-pack/plugins/infra/tsconfig.json index 765af7974a2f1..a9739bdfdedc7 100644 --- a/x-pack/plugins/infra/tsconfig.json +++ b/x-pack/plugins/infra/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/ingest_pipelines/tsconfig.json b/x-pack/plugins/ingest_pipelines/tsconfig.json index a248bc9f337fe..de9a8362e8c6b 100644 --- a/x-pack/plugins/ingest_pipelines/tsconfig.json +++ b/x-pack/plugins/ingest_pipelines/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/lens/tsconfig.json b/x-pack/plugins/lens/tsconfig.json index 6c4d3631a12f3..04d3838df2063 100644 --- a/x-pack/plugins/lens/tsconfig.json +++ b/x-pack/plugins/lens/tsconfig.json @@ -1,42 +1,41 @@ { - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "composite": true, - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, - "declarationMap": true - }, - "include": [ - "*.ts", - "common/**/*", - "public/**/*", - "server/**/*", - "../../../typings/**/*" - ], - "references": [ - { "path": "../../../src/core/tsconfig.json" }, - { "path": "../task_manager/tsconfig.json" }, - { "path": "../global_search/tsconfig.json"}, - { "path": "../saved_objects_tagging/tsconfig.json"}, - { "path": "../../../src/plugins/data/tsconfig.json"}, - { "path": "../../../src/plugins/index_pattern_field_editor/tsconfig.json"}, - { "path": "../../../src/plugins/charts/tsconfig.json"}, - { "path": "../../../src/plugins/expressions/tsconfig.json"}, - { "path": "../../../src/plugins/navigation/tsconfig.json" }, - { "path": "../../../src/plugins/url_forwarding/tsconfig.json" }, - { "path": "../../../src/plugins/visualizations/tsconfig.json" }, - { "path": "../../../src/plugins/dashboard/tsconfig.json" }, - { "path": "../../../src/plugins/ui_actions/tsconfig.json" }, - { "path": "../../../src/plugins/embeddable/tsconfig.json" }, - { "path": "../../../src/plugins/share/tsconfig.json" }, - { "path": "../../../src/plugins/usage_collection/tsconfig.json" }, - { "path": "../../../src/plugins/saved_objects/tsconfig.json"}, - { "path": "../../../src/plugins/kibana_utils/tsconfig.json" }, - { "path": "../../../src/plugins/kibana_react/tsconfig.json" }, - { "path": "../../../src/plugins/embeddable/tsconfig.json"}, - { "path": "../../../src/plugins/presentation_util/tsconfig.json"}, - { "path": "../../../src/plugins/field_formats/tsconfig.json"} - ] - } + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./target/types", + "emitDeclarationOnly": true, + "declaration": true, + "declarationMap": true + }, + "include": [ + "*.ts", + "common/**/*", + "public/**/*", + "server/**/*", + "../../../typings/**/*" + ], + "references": [ + { "path": "../../../src/core/tsconfig.json" }, + { "path": "../task_manager/tsconfig.json" }, + { "path": "../global_search/tsconfig.json"}, + { "path": "../saved_objects_tagging/tsconfig.json"}, + { "path": "../../../src/plugins/data/tsconfig.json"}, + { "path": "../../../src/plugins/index_pattern_field_editor/tsconfig.json"}, + { "path": "../../../src/plugins/charts/tsconfig.json"}, + { "path": "../../../src/plugins/expressions/tsconfig.json"}, + { "path": "../../../src/plugins/navigation/tsconfig.json" }, + { "path": "../../../src/plugins/url_forwarding/tsconfig.json" }, + { "path": "../../../src/plugins/visualizations/tsconfig.json" }, + { "path": "../../../src/plugins/dashboard/tsconfig.json" }, + { "path": "../../../src/plugins/ui_actions/tsconfig.json" }, + { "path": "../../../src/plugins/embeddable/tsconfig.json" }, + { "path": "../../../src/plugins/share/tsconfig.json" }, + { "path": "../../../src/plugins/usage_collection/tsconfig.json" }, + { "path": "../../../src/plugins/saved_objects/tsconfig.json"}, + { "path": "../../../src/plugins/kibana_utils/tsconfig.json" }, + { "path": "../../../src/plugins/kibana_react/tsconfig.json" }, + { "path": "../../../src/plugins/embeddable/tsconfig.json"}, + { "path": "../../../src/plugins/presentation_util/tsconfig.json"}, + { "path": "../../../src/plugins/field_formats/tsconfig.json"} + ] +} diff --git a/x-pack/plugins/license_api_guard/tsconfig.json b/x-pack/plugins/license_api_guard/tsconfig.json index 1b6ea789760d5..123e73a9e8163 100644 --- a/x-pack/plugins/license_api_guard/tsconfig.json +++ b/x-pack/plugins/license_api_guard/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/license_management/tsconfig.json b/x-pack/plugins/license_management/tsconfig.json index e6cb0101ee838..4384a9a0efd98 100644 --- a/x-pack/plugins/license_management/tsconfig.json +++ b/x-pack/plugins/license_management/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/licensing/tsconfig.json b/x-pack/plugins/licensing/tsconfig.json index 6118bcd81d342..d8855fcd65912 100644 --- a/x-pack/plugins/licensing/tsconfig.json +++ b/x-pack/plugins/licensing/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/lists/tsconfig.json b/x-pack/plugins/lists/tsconfig.json index 9025a1640f8bf..691c5243d9db8 100644 --- a/x-pack/plugins/lists/tsconfig.json +++ b/x-pack/plugins/lists/tsconfig.json @@ -1,23 +1,22 @@ { - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "composite": true, - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, - "declarationMap": true - }, - "include": [ - "common/**/*", - "public/**/*", - "server/**/*", - // have to declare *.json explicitly due to https://github.com/microsoft/TypeScript/issues/25636 - "server/**/*.json", - ], - "references": [ - { "path": "../../../src/core/tsconfig.json" }, - { "path": "../spaces/tsconfig.json" }, - { "path": "../security/tsconfig.json"}, - ] - } + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./target/types", + "emitDeclarationOnly": true, + "declaration": true, + "declarationMap": true + }, + "include": [ + "common/**/*", + "public/**/*", + "server/**/*", + // have to declare *.json explicitly due to https://github.com/microsoft/TypeScript/issues/25636 + "server/**/*.json", + ], + "references": [ + { "path": "../../../src/core/tsconfig.json" }, + { "path": "../spaces/tsconfig.json" }, + { "path": "../security/tsconfig.json"}, + ] +} diff --git a/x-pack/plugins/logstash/tsconfig.json b/x-pack/plugins/logstash/tsconfig.json index 6f21cfdb0b191..5a13e8ca71599 100644 --- a/x-pack/plugins/logstash/tsconfig.json +++ b/x-pack/plugins/logstash/tsconfig.json @@ -1,26 +1,25 @@ { - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "composite": true, - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, - "declarationMap": true - }, - "include": [ - "common/**/*", - "public/**/*", - "server/**/*", - ], - "references": [ - { "path": "../../../src/core/tsconfig.json" }, - { "path": "../../../src/plugins/home/tsconfig.json"}, - { "path": "../../../src/plugins/management/tsconfig.json"}, + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./target/types", + "emitDeclarationOnly": true, + "declaration": true, + "declarationMap": true + }, + "include": [ + "common/**/*", + "public/**/*", + "server/**/*", + ], + "references": [ + { "path": "../../../src/core/tsconfig.json" }, + { "path": "../../../src/plugins/home/tsconfig.json"}, + { "path": "../../../src/plugins/management/tsconfig.json"}, - { "path": "../features/tsconfig.json" }, - { "path": "../licensing/tsconfig.json"}, - { "path": "../monitoring/tsconfig.json"}, - { "path": "../security/tsconfig.json"}, - ] - } + { "path": "../features/tsconfig.json" }, + { "path": "../licensing/tsconfig.json"}, + { "path": "../monitoring/tsconfig.json"}, + { "path": "../security/tsconfig.json"}, + ] +} diff --git a/x-pack/plugins/maps/tsconfig.json b/x-pack/plugins/maps/tsconfig.json index 1b74b7ee7566a..5245b374b9fec 100644 --- a/x-pack/plugins/maps/tsconfig.json +++ b/x-pack/plugins/maps/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/metrics_entities/tsconfig.json b/x-pack/plugins/metrics_entities/tsconfig.json index 15e6aa1601627..402b327a2dbf2 100644 --- a/x-pack/plugins/metrics_entities/tsconfig.json +++ b/x-pack/plugins/metrics_entities/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/ml/server/routes/apidoc_scripts/tsconfig.json b/x-pack/plugins/ml/server/routes/apidoc_scripts/tsconfig.json index 6d01a853698b8..4748911105e8c 100644 --- a/x-pack/plugins/ml/server/routes/apidoc_scripts/tsconfig.json +++ b/x-pack/plugins/ml/server/routes/apidoc_scripts/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../../../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "target": "es6", - "moduleResolution": "node" + "outDir": "./target/types" }, "include": [ "schema_worker.ts", diff --git a/x-pack/plugins/ml/tsconfig.json b/x-pack/plugins/ml/tsconfig.json index 8e859c35e3f85..db8fc463b0550 100644 --- a/x-pack/plugins/ml/tsconfig.json +++ b/x-pack/plugins/ml/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/monitoring/tsconfig.json b/x-pack/plugins/monitoring/tsconfig.json index d0fb7e1a88dcf..756b8528865ce 100644 --- a/x-pack/plugins/monitoring/tsconfig.json +++ b/x-pack/plugins/monitoring/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/observability/tsconfig.json b/x-pack/plugins/observability/tsconfig.json index 8aa184bca913f..4e912ee4535b8 100644 --- a/x-pack/plugins/observability/tsconfig.json +++ b/x-pack/plugins/observability/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/osquery/cypress/tsconfig.json b/x-pack/plugins/osquery/cypress/tsconfig.json index 467ea13fc4869..1adb067fe682e 100644 --- a/x-pack/plugins/osquery/cypress/tsconfig.json +++ b/x-pack/plugins/osquery/cypress/tsconfig.json @@ -1,11 +1,13 @@ { "extends": "../../../../tsconfig.base.json", - "exclude": [], "include": [ - "./**/*" + "**/*" + ], + "exclude": [ + "target/**/*" ], "compilerOptions": { - "tsBuildInfoFile": "../../../../build/tsbuildinfo/osquery/cypress", + "outDir": "target/types", "types": [ "cypress", "node" diff --git a/x-pack/plugins/osquery/tsconfig.json b/x-pack/plugins/osquery/tsconfig.json index 76e26c770cfe0..50b9807670954 100644 --- a/x-pack/plugins/osquery/tsconfig.json +++ b/x-pack/plugins/osquery/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/painless_lab/tsconfig.json b/x-pack/plugins/painless_lab/tsconfig.json index a869b21e06d4d..e0cf386193bb4 100644 --- a/x-pack/plugins/painless_lab/tsconfig.json +++ b/x-pack/plugins/painless_lab/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/remote_clusters/tsconfig.json b/x-pack/plugins/remote_clusters/tsconfig.json index 9dc7926bd62ea..006c3c53c1be4 100644 --- a/x-pack/plugins/remote_clusters/tsconfig.json +++ b/x-pack/plugins/remote_clusters/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/reporting/tsconfig.json b/x-pack/plugins/reporting/tsconfig.json index 406fe9965b8a0..3e58450565720 100644 --- a/x-pack/plugins/reporting/tsconfig.json +++ b/x-pack/plugins/reporting/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/rollup/tsconfig.json b/x-pack/plugins/rollup/tsconfig.json index 6885081ce4bdd..fbe323b2549ea 100644 --- a/x-pack/plugins/rollup/tsconfig.json +++ b/x-pack/plugins/rollup/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/rule_registry/tsconfig.json b/x-pack/plugins/rule_registry/tsconfig.json index f6253e441da31..769c9f81f8ce9 100644 --- a/x-pack/plugins/rule_registry/tsconfig.json +++ b/x-pack/plugins/rule_registry/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/runtime_fields/tsconfig.json b/x-pack/plugins/runtime_fields/tsconfig.json index a1efe4c9cf2dd..5dc704ec57693 100644 --- a/x-pack/plugins/runtime_fields/tsconfig.json +++ b/x-pack/plugins/runtime_fields/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/saved_objects_tagging/tsconfig.json b/x-pack/plugins/saved_objects_tagging/tsconfig.json index d00156ad1277c..608cdb2c793cd 100644 --- a/x-pack/plugins/saved_objects_tagging/tsconfig.json +++ b/x-pack/plugins/saved_objects_tagging/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/searchprofiler/tsconfig.json b/x-pack/plugins/searchprofiler/tsconfig.json index f8ac3a61f7812..c53c65b812a44 100644 --- a/x-pack/plugins/searchprofiler/tsconfig.json +++ b/x-pack/plugins/searchprofiler/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/security/tsconfig.json b/x-pack/plugins/security/tsconfig.json index 6c3fd1851a8cb..ea03b9dbb6471 100644 --- a/x-pack/plugins/security/tsconfig.json +++ b/x-pack/plugins/security/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/security_solution/cypress/tsconfig.json b/x-pack/plugins/security_solution/cypress/tsconfig.json index 270d877a362a6..f762e63c899ac 100644 --- a/x-pack/plugins/security_solution/cypress/tsconfig.json +++ b/x-pack/plugins/security_solution/cypress/tsconfig.json @@ -1,11 +1,14 @@ { "extends": "../../../../tsconfig.base.json", - "exclude": [], "include": [ - "./**/*" + "**/*", + "fixtures/**/*.json" + ], + "exclude": [ + "target/**/*" ], "compilerOptions": { - "tsBuildInfoFile": "../../../../build/tsbuildinfo/security_solution/cypress", + "outDir": "target/types", "types": [ "cypress", "cypress-pipe", @@ -13,4 +16,7 @@ ], "resolveJsonModule": true, }, + "references": [ + { "path": "../tsconfig.json" } + ] } diff --git a/x-pack/plugins/security_solution/tsconfig.json b/x-pack/plugins/security_solution/tsconfig.json index 0df41b9f988b7..5c87d58199df4 100644 --- a/x-pack/plugins/security_solution/tsconfig.json +++ b/x-pack/plugins/security_solution/tsconfig.json @@ -1,47 +1,46 @@ { - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "composite": true, - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, - "declarationMap": true - }, - "include": [ - "common/**/*", - "public/**/*", - "server/**/*", - "scripts/**/*", - // have to declare *.json explicitly due to https://github.com/microsoft/TypeScript/issues/25636 - "server/**/*.json", - "public/**/*.json", - "../../../typings/**/*" - ], - "references": [ - { "path": "../../../src/core/tsconfig.json" }, - { "path": "../../../src/plugins/data/tsconfig.json" }, - { "path": "../../../src/plugins/embeddable/tsconfig.json" }, - { "path": "../../../src/plugins/home/tsconfig.json" }, - { "path": "../../../src/plugins/inspector/tsconfig.json" }, - { "path": "../../../src/plugins/ui_actions/tsconfig.json" }, - { "path": "../../../src/plugins/newsfeed/tsconfig.json" }, - { "path": "../../../src/plugins/usage_collection/tsconfig.json" }, - { "path": "../../../src/plugins/telemetry/tsconfig.json" }, - { "path": "../../../src/plugins/telemetry_management_section/tsconfig.json" }, - { "path": "../actions/tsconfig.json" }, - { "path": "../alerting/tsconfig.json" }, - { "path": "../cases/tsconfig.json" }, - { "path": "../data_enhanced/tsconfig.json" }, - { "path": "../encrypted_saved_objects/tsconfig.json" }, - { "path": "../features/tsconfig.json" }, - { "path": "../fleet/tsconfig.json" }, - { "path": "../licensing/tsconfig.json" }, - { "path": "../lists/tsconfig.json" }, - { "path": "../maps/tsconfig.json" }, - { "path": "../ml/tsconfig.json" }, - { "path": "../spaces/tsconfig.json" }, - { "path": "../security/tsconfig.json"}, - { "path": "../timelines/tsconfig.json"}, - ] - } + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./target/types", + "emitDeclarationOnly": true, + "declaration": true, + "declarationMap": true + }, + "include": [ + "common/**/*", + "public/**/*", + "server/**/*", + "scripts/**/*", + // have to declare *.json explicitly due to https://github.com/microsoft/TypeScript/issues/25636 + "server/**/*.json", + "public/**/*.json", + "../../../typings/**/*" + ], + "references": [ + { "path": "../../../src/core/tsconfig.json" }, + { "path": "../../../src/plugins/data/tsconfig.json" }, + { "path": "../../../src/plugins/embeddable/tsconfig.json" }, + { "path": "../../../src/plugins/home/tsconfig.json" }, + { "path": "../../../src/plugins/inspector/tsconfig.json" }, + { "path": "../../../src/plugins/ui_actions/tsconfig.json" }, + { "path": "../../../src/plugins/newsfeed/tsconfig.json" }, + { "path": "../../../src/plugins/usage_collection/tsconfig.json" }, + { "path": "../../../src/plugins/telemetry/tsconfig.json" }, + { "path": "../../../src/plugins/telemetry_management_section/tsconfig.json" }, + { "path": "../actions/tsconfig.json" }, + { "path": "../alerting/tsconfig.json" }, + { "path": "../cases/tsconfig.json" }, + { "path": "../data_enhanced/tsconfig.json" }, + { "path": "../encrypted_saved_objects/tsconfig.json" }, + { "path": "../features/tsconfig.json" }, + { "path": "../fleet/tsconfig.json" }, + { "path": "../licensing/tsconfig.json" }, + { "path": "../lists/tsconfig.json" }, + { "path": "../maps/tsconfig.json" }, + { "path": "../ml/tsconfig.json" }, + { "path": "../spaces/tsconfig.json" }, + { "path": "../security/tsconfig.json"}, + { "path": "../timelines/tsconfig.json"}, + ] +} diff --git a/x-pack/plugins/snapshot_restore/tsconfig.json b/x-pack/plugins/snapshot_restore/tsconfig.json index 39beda02977e1..82f0e86df3683 100644 --- a/x-pack/plugins/snapshot_restore/tsconfig.json +++ b/x-pack/plugins/snapshot_restore/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/spaces/tsconfig.json b/x-pack/plugins/spaces/tsconfig.json index 3888519555d22..4cc95504a158e 100644 --- a/x-pack/plugins/spaces/tsconfig.json +++ b/x-pack/plugins/spaces/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/stack_alerts/tsconfig.json b/x-pack/plugins/stack_alerts/tsconfig.json index c83935945c67b..f3ae4509f35be 100644 --- a/x-pack/plugins/stack_alerts/tsconfig.json +++ b/x-pack/plugins/stack_alerts/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/task_manager/tsconfig.json b/x-pack/plugins/task_manager/tsconfig.json index 4b53dcac72c8e..42ebd42b4f7a5 100644 --- a/x-pack/plugins/task_manager/tsconfig.json +++ b/x-pack/plugins/task_manager/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/telemetry_collection_xpack/tsconfig.json b/x-pack/plugins/telemetry_collection_xpack/tsconfig.json index f4c17c4317a9f..03ca7efad22a4 100644 --- a/x-pack/plugins/telemetry_collection_xpack/tsconfig.json +++ b/x-pack/plugins/telemetry_collection_xpack/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/timelines/tsconfig.json b/x-pack/plugins/timelines/tsconfig.json index 17a2a9b612ab1..9677c0e64dd88 100644 --- a/x-pack/plugins/timelines/tsconfig.json +++ b/x-pack/plugins/timelines/tsconfig.json @@ -1,31 +1,30 @@ { - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "composite": true, - "outDir": "./target/types", - "emitDeclarationOnly": true, - "declaration": true, - "declarationMap": true - }, - "include": [ - "common/**/*", - "public/**/*", - "server/**/*", - // have to declare *.json explicitly due to https://github.com/microsoft/TypeScript/issues/25636 - "server/**/*.json", - "public/**/*.json", - "../../../typings/**/*" - ], - "references": [ - { "path": "../../../src/core/tsconfig.json" }, - { "path": "../../../src/plugins/data/tsconfig.json" }, - { "path": "../../../src/plugins/home/tsconfig.json" }, - { "path": "../data_enhanced/tsconfig.json" }, - { "path": "../features/tsconfig.json" }, - { "path": "../cases/tsconfig.json" }, - { "path": "../licensing/tsconfig.json" }, - { "path": "../spaces/tsconfig.json" }, - { "path": "../alerting/tsconfig.json" } - ] - } + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "./target/types", + "emitDeclarationOnly": true, + "declaration": true, + "declarationMap": true + }, + "include": [ + "common/**/*", + "public/**/*", + "server/**/*", + // have to declare *.json explicitly due to https://github.com/microsoft/TypeScript/issues/25636 + "server/**/*.json", + "public/**/*.json", + "../../../typings/**/*" + ], + "references": [ + { "path": "../../../src/core/tsconfig.json" }, + { "path": "../../../src/plugins/data/tsconfig.json" }, + { "path": "../../../src/plugins/home/tsconfig.json" }, + { "path": "../data_enhanced/tsconfig.json" }, + { "path": "../features/tsconfig.json" }, + { "path": "../cases/tsconfig.json" }, + { "path": "../licensing/tsconfig.json" }, + { "path": "../spaces/tsconfig.json" }, + { "path": "../alerting/tsconfig.json" } + ] +} diff --git a/x-pack/plugins/transform/tsconfig.json b/x-pack/plugins/transform/tsconfig.json index 2717f92c7a4df..99e8baf3f92fc 100644 --- a/x-pack/plugins/transform/tsconfig.json +++ b/x-pack/plugins/transform/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/translations/tsconfig.json b/x-pack/plugins/translations/tsconfig.json index e48512742ed68..6b09de638f3f9 100644 --- a/x-pack/plugins/translations/tsconfig.json +++ b/x-pack/plugins/translations/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/triggers_actions_ui/tsconfig.json b/x-pack/plugins/triggers_actions_ui/tsconfig.json index 8202449b22298..6536206acf369 100644 --- a/x-pack/plugins/triggers_actions_ui/tsconfig.json +++ b/x-pack/plugins/triggers_actions_ui/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/ui_actions_enhanced/tsconfig.json b/x-pack/plugins/ui_actions_enhanced/tsconfig.json index 39318770126e5..100a1decd9427 100644 --- a/x-pack/plugins/ui_actions_enhanced/tsconfig.json +++ b/x-pack/plugins/ui_actions_enhanced/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/upgrade_assistant/tsconfig.json b/x-pack/plugins/upgrade_assistant/tsconfig.json index 750bea75c6656..33a1421fbb0c1 100644 --- a/x-pack/plugins/upgrade_assistant/tsconfig.json +++ b/x-pack/plugins/upgrade_assistant/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/uptime/tsconfig.json b/x-pack/plugins/uptime/tsconfig.json index 88099b57f0898..a41da4837f453 100644 --- a/x-pack/plugins/uptime/tsconfig.json +++ b/x-pack/plugins/uptime/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, @@ -32,4 +31,4 @@ "path": "../fleet/tsconfig.json" } ] -} \ No newline at end of file +} diff --git a/x-pack/plugins/watcher/tsconfig.json b/x-pack/plugins/watcher/tsconfig.json index 15a28d498f2bd..e17e7e753592a 100644 --- a/x-pack/plugins/watcher/tsconfig.json +++ b/x-pack/plugins/watcher/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/plugins/xpack_legacy/tsconfig.json b/x-pack/plugins/xpack_legacy/tsconfig.json index 3bfc78b72cb3e..57fccc031a0cf 100644 --- a/x-pack/plugins/xpack_legacy/tsconfig.json +++ b/x-pack/plugins/xpack_legacy/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/test/tsconfig.json b/x-pack/test/tsconfig.json index d27c722c3e40d..b9940ecdbfe75 100644 --- a/x-pack/test/tsconfig.json +++ b/x-pack/test/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "composite": true, "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, diff --git a/x-pack/test/usage_collection/plugins/application_usage_test/tsconfig.json b/x-pack/test/usage_collection/plugins/application_usage_test/tsconfig.json index f1bf94a38de8f..e625acbc569cf 100644 --- a/x-pack/test/usage_collection/plugins/application_usage_test/tsconfig.json +++ b/x-pack/test/usage_collection/plugins/application_usage_test/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types" }, "include": [ "public/**/*.ts", diff --git a/x-pack/test/usage_collection/plugins/stack_management_usage_test/tsconfig.json b/x-pack/test/usage_collection/plugins/stack_management_usage_test/tsconfig.json index f1bf94a38de8f..e625acbc569cf 100644 --- a/x-pack/test/usage_collection/plugins/stack_management_usage_test/tsconfig.json +++ b/x-pack/test/usage_collection/plugins/stack_management_usage_test/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "../../../../../tsconfig.base.json", "compilerOptions": { - "outDir": "./target", - "skipLibCheck": true + "outDir": "./target/types" }, "include": [ "public/**/*.ts",