From b6e582c53ebb9c496c232408066b128d2ca2f92c Mon Sep 17 00:00:00 2001 From: Mikhail Shustov Date: Thu, 1 Apr 2021 14:40:47 +0200 Subject: [PATCH] TS Incremental build exclude test files (#95610) * add base config for all the TS projects * all the project use new tsconfig.project.json * compile test files in the high-level tsconfig.json * fix TS error in maps plugin * fix TS error in infra plugin * exclude mote test and test until folders * uptime. do not import test code within prod code * expressions. do not import test code within prod code * data: export mocks from high level folder * task_manager: comply with es client typings * infra: remove unused enzyme_helpers * check_ts_project requires "include" key * ts_check should handle parent configs * all ts configs should extend base one * exclude test folders from plugins * update patterns to fix ts_check errors * Apply suggestions from code review Co-authored-by: Constance * uptime: MountWithReduxProvider to test helpers Co-authored-by: Constance Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- packages/kbn-storybook/tsconfig.json | 2 +- src/core/tsconfig.json | 2 +- src/dev/typescript/project.ts | 37 ++++++-- src/plugins/advanced_settings/tsconfig.json | 2 +- src/plugins/apm_oss/tsconfig.json | 2 +- src/plugins/bfetch/tsconfig.json | 2 +- src/plugins/charts/tsconfig.json | 2 +- src/plugins/console/tsconfig.json | 2 +- src/plugins/dashboard/tsconfig.json | 2 +- .../search/expressions/exists_filter.test.ts | 2 +- .../search/expressions/kibana_filter.test.ts | 2 +- .../search/expressions/phrase_filter.test.ts | 2 +- .../search/expressions/range_filter.test.ts | 2 +- src/plugins/data/tsconfig.json | 2 +- src/plugins/dev_tools/tsconfig.json | 2 +- src/plugins/discover/tsconfig.json | 2 +- src/plugins/embeddable/tsconfig.json | 2 +- src/plugins/es_ui_shared/tsconfig.json | 2 +- src/plugins/expressions/common/mocks.ts | 2 + src/plugins/expressions/common/util/index.ts | 1 - src/plugins/expressions/tsconfig.json | 2 +- src/plugins/home/tsconfig.json | 2 +- .../index_pattern_field_editor/tsconfig.json | 2 +- .../index_pattern_management/tsconfig.json | 2 +- src/plugins/input_control_vis/tsconfig.json | 2 +- src/plugins/inspector/tsconfig.json | 2 +- src/plugins/kibana_legacy/tsconfig.json | 2 +- src/plugins/kibana_overview/tsconfig.json | 2 +- src/plugins/kibana_react/tsconfig.json | 2 +- .../kibana_usage_collection/tsconfig.json | 2 +- src/plugins/kibana_utils/tsconfig.json | 2 +- src/plugins/legacy_export/tsconfig.json | 2 +- src/plugins/management/tsconfig.json | 2 +- src/plugins/maps_ems/tsconfig.json | 2 +- src/plugins/maps_legacy/tsconfig.json | 2 +- src/plugins/navigation/tsconfig.json | 2 +- src/plugins/newsfeed/tsconfig.json | 2 +- src/plugins/presentation_util/tsconfig.json | 2 +- src/plugins/region_map/tsconfig.json | 2 +- src/plugins/saved_objects/tsconfig.json | 2 +- .../saved_objects_management/tsconfig.json | 2 +- .../saved_objects_tagging_oss/tsconfig.json | 2 +- src/plugins/security_oss/tsconfig.json | 2 +- src/plugins/share/tsconfig.json | 2 +- src/plugins/spaces_oss/tsconfig.json | 2 +- src/plugins/telemetry/tsconfig.json | 2 +- .../tsconfig.json | 2 +- .../tsconfig.json | 2 +- src/plugins/tile_map/tsconfig.json | 2 +- src/plugins/timelion/tsconfig.json | 2 +- src/plugins/ui_actions/tsconfig.json | 2 +- src/plugins/url_forwarding/tsconfig.json | 2 +- src/plugins/usage_collection/tsconfig.json | 2 +- src/plugins/vis_default_editor/tsconfig.json | 2 +- src/plugins/vis_type_markdown/tsconfig.json | 2 +- src/plugins/vis_type_metric/tsconfig.json | 2 +- src/plugins/vis_type_table/tsconfig.json | 2 +- src/plugins/vis_type_tagcloud/tsconfig.json | 2 +- src/plugins/vis_type_timelion/tsconfig.json | 2 +- src/plugins/vis_type_timeseries/tsconfig.json | 2 +- src/plugins/vis_type_vega/tsconfig.json | 2 +- src/plugins/vis_type_vislib/tsconfig.json | 2 +- src/plugins/vis_type_xy/tsconfig.json | 2 +- src/plugins/visualizations/tsconfig.json | 2 +- src/plugins/visualize/tsconfig.json | 2 +- tsconfig.base.json | 3 +- tsconfig.json | 72 +++++++++++++++ tsconfig.project.json | 65 ++++++++++++++ x-pack/plugins/actions/tsconfig.json | 2 +- x-pack/plugins/alerting/tsconfig.json | 2 +- x-pack/plugins/apm/e2e/tsconfig.json | 2 +- x-pack/plugins/apm/ftr_e2e/tsconfig.json | 4 +- .../apm/scripts/optimize-tsconfig/optimize.js | 2 +- .../apm/scripts/optimize-tsconfig/paths.js | 2 +- x-pack/plugins/apm/tsconfig.json | 2 +- x-pack/plugins/banners/tsconfig.json | 2 +- x-pack/plugins/beats_management/tsconfig.json | 2 +- .../canvas/storybook/addon/tsconfig.json | 2 +- x-pack/plugins/canvas/tsconfig.json | 2 +- x-pack/plugins/cloud/tsconfig.json | 2 +- .../plugins/console_extensions/tsconfig.json | 2 +- .../cross_cluster_replication/tsconfig.json | 2 +- .../plugins/dashboard_enhanced/tsconfig.json | 2 +- x-pack/plugins/dashboard_mode/tsconfig.json | 2 +- x-pack/plugins/data_enhanced/tsconfig.json | 2 +- .../plugins/discover_enhanced/tsconfig.json | 2 +- .../drilldowns/url_drilldown/tsconfig.json | 2 +- .../plugins/embeddable_enhanced/tsconfig.json | 2 +- .../encrypted_saved_objects/tsconfig.json | 2 +- .../plugins/enterprise_search/tsconfig.json | 2 +- x-pack/plugins/event_log/tsconfig.json | 2 +- x-pack/plugins/features/tsconfig.json | 2 +- x-pack/plugins/file_upload/tsconfig.json | 2 +- x-pack/plugins/fleet/tsconfig.json | 2 +- x-pack/plugins/global_search/tsconfig.json | 2 +- .../plugins/global_search_bar/tsconfig.json | 2 +- .../global_search_providers/tsconfig.json | 2 +- x-pack/plugins/graph/tsconfig.json | 4 +- x-pack/plugins/grokdebugger/tsconfig.json | 2 +- .../index_lifecycle_management/tsconfig.json | 3 +- x-pack/plugins/index_management/tsconfig.json | 4 +- .../infra/public/utils/enzyme_helpers.tsx | 87 ------------------- .../queries/metrics_hosts_anomalies.ts | 2 +- .../infra_ml/queries/metrics_k8s_anomalies.ts | 2 +- x-pack/plugins/infra/tsconfig.json | 2 +- x-pack/plugins/ingest_pipelines/tsconfig.json | 3 +- x-pack/plugins/lens/tsconfig.json | 4 +- .../plugins/license_management/tsconfig.json | 2 +- x-pack/plugins/licensing/tsconfig.json | 2 +- x-pack/plugins/logstash/tsconfig.json | 2 +- .../components/validated_number_input.tsx | 4 +- x-pack/plugins/maps/tsconfig.json | 2 +- .../maps_legacy_licensing/tsconfig.json | 2 +- .../routes/apidoc_scripts/tsconfig.json | 2 +- x-pack/plugins/ml/tsconfig.json | 2 +- x-pack/plugins/monitoring/tsconfig.json | 2 +- x-pack/plugins/observability/tsconfig.json | 2 +- x-pack/plugins/osquery/tsconfig.json | 2 +- x-pack/plugins/painless_lab/tsconfig.json | 2 +- x-pack/plugins/remote_clusters/tsconfig.json | 2 +- x-pack/plugins/reporting/tsconfig.json | 2 +- x-pack/plugins/rollup/tsconfig.json | 2 +- x-pack/plugins/runtime_fields/tsconfig.json | 2 +- .../saved_objects_tagging/tsconfig.json | 2 +- x-pack/plugins/searchprofiler/tsconfig.json | 2 +- x-pack/plugins/security/tsconfig.json | 2 +- .../security_solution/cypress/tsconfig.json | 2 +- x-pack/plugins/snapshot_restore/tsconfig.json | 4 +- x-pack/plugins/spaces/tsconfig.json | 2 +- x-pack/plugins/stack_alerts/tsconfig.json | 2 +- .../server/monitoring/workload_statistics.ts | 3 +- x-pack/plugins/task_manager/tsconfig.json | 2 +- .../telemetry_collection_xpack/tsconfig.json | 2 +- x-pack/plugins/transform/tsconfig.json | 2 +- .../plugins/triggers_actions_ui/tsconfig.json | 2 +- .../plugins/ui_actions_enhanced/tsconfig.json | 2 +- .../plugins/upgrade_assistant/tsconfig.json | 2 +- .../certificates/cert_monitors.test.tsx | 2 +- .../certificates/cert_search.test.tsx | 2 +- .../certificates/cert_status.test.tsx | 2 +- .../certificates/certificates_list.test.tsx | 2 +- .../certificates/fingerprint_col.test.tsx | 2 +- .../common/charts/duration_charts.test.tsx | 2 +- .../common/charts/monitor_bar_series.test.tsx | 3 +- .../common/header/page_header.test.tsx | 2 +- .../components/common/monitor_tags.test.tsx | 2 +- .../common/uptime_date_picker.test.tsx | 4 +- .../monitor/ml/ml_integerations.test.tsx | 2 +- .../monitor/ml/ml_manage_job.test.tsx | 2 +- .../monitor/monitor_charts.test.tsx | 2 +- .../components/monitor/monitor_title.test.tsx | 2 +- .../monitor_status.bar.test.tsx | 2 +- .../status_details/ssl_certificate.test.tsx | 6 +- .../overview/empty_state/empty_state.test.tsx | 2 +- .../columns/enable_alert.test.tsx | 2 +- .../filter_status_button.test.tsx | 3 +- .../monitor_list/monitor_list.test.tsx | 2 +- .../monitor_list_drawer.test.tsx | 2 +- .../monitor_list/status_filter.test.tsx | 4 +- .../settings/certificate_form.test.tsx | 2 +- .../components/settings/indices_form.test.tsx | 2 +- .../public/hooks/use_breadcrumbs.test.tsx | 5 +- .../public/hooks/use_url_params.test.tsx | 3 +- .../plugins/uptime/public/lib/helper/index.ts | 1 - x-pack/plugins/uptime/public/lib/index.ts | 9 -- .../uptime/public/pages/certificates.test.tsx | 2 +- .../uptime/public/pages/monitor.test.tsx | 2 +- .../uptime/public/pages/not_found.test.tsx | 2 +- .../uptime/public/pages/overview.test.tsx | 2 +- x-pack/plugins/uptime/tsconfig.json | 3 +- x-pack/plugins/watcher/tsconfig.json | 2 +- x-pack/plugins/xpack_legacy/tsconfig.json | 2 +- 172 files changed, 351 insertions(+), 282 deletions(-) create mode 100644 tsconfig.project.json delete mode 100644 x-pack/plugins/infra/public/utils/enzyme_helpers.tsx delete mode 100644 x-pack/plugins/uptime/public/lib/index.ts diff --git a/packages/kbn-storybook/tsconfig.json b/packages/kbn-storybook/tsconfig.json index db10d4630ff9c..5c81c9100e601 100644 --- a/packages/kbn-storybook/tsconfig.json +++ b/packages/kbn-storybook/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { "incremental": false, "outDir": "target", diff --git a/src/core/tsconfig.json b/src/core/tsconfig.json index 855962070457e..f19e379482d3c 100644 --- a/src/core/tsconfig.json +++ b/src/core/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/dev/typescript/project.ts b/src/dev/typescript/project.ts index 8d92284e49637..04a5de945619b 100644 --- a/src/dev/typescript/project.ts +++ b/src/dev/typescript/project.ts @@ -7,7 +7,7 @@ */ import { basename, dirname, relative, resolve } from 'path'; - +import { memoize } from 'lodash'; import { IMinimatch, Minimatch } from 'minimatch'; import { REPO_ROOT } from '@kbn/utils'; @@ -26,6 +26,10 @@ function testMatchers(matchers: IMinimatch[], path: string) { return matchers.some((matcher) => matcher.match(path)); } +const parentProjectFactory = memoize(function (parentConfigPath: string) { + return new Project(parentConfigPath); +}); + export class Project { public directory: string; public name: string; @@ -34,6 +38,7 @@ export class Project { private readonly include: IMinimatch[]; private readonly exclude: IMinimatch[]; + private readonly parent?: Project; constructor( public tsConfigPath: string, @@ -41,15 +46,16 @@ export class Project { ) { this.config = parseTsConfig(tsConfigPath); - const { files, include, exclude = [] } = this.config as { + const { files, include, exclude = [], extends: extendsPath } = this.config as { files?: string[]; include?: string[]; exclude?: string[]; + extends?: string; }; if (files || !include) { throw new Error( - 'tsconfig.json files in the Kibana repo must use "include" keys and not "files"' + `[${tsConfigPath}]: tsconfig.json files in the Kibana repo must use "include" keys and not "files"` ); } @@ -58,9 +64,30 @@ export class Project { this.name = options.name || relative(REPO_ROOT, this.directory) || basename(this.directory); this.include = makeMatchers(this.directory, include); this.exclude = makeMatchers(this.directory, exclude); + + if (extendsPath !== undefined) { + const parentConfigPath = resolve(this.directory, extendsPath); + this.parent = parentProjectFactory(parentConfigPath); + } + } + + public isAbsolutePathSelected(path: string): boolean { + return this.isExcluded(path) ? false : this.isIncluded(path); } - public isAbsolutePathSelected(path: string) { - return testMatchers(this.exclude, path) ? false : testMatchers(this.include, path); + public isExcluded(path: string): boolean { + if (testMatchers(this.exclude, path)) return true; + if (this.parent) { + return this.parent.isExcluded(path); + } + return false; + } + + public isIncluded(path: string): boolean { + if (testMatchers(this.include, path)) return true; + if (this.parent) { + return this.parent.isIncluded(path); + } + return false; } } diff --git a/src/plugins/advanced_settings/tsconfig.json b/src/plugins/advanced_settings/tsconfig.json index 4d62e410326b6..97a855959903d 100644 --- a/src/plugins/advanced_settings/tsconfig.json +++ b/src/plugins/advanced_settings/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/apm_oss/tsconfig.json b/src/plugins/apm_oss/tsconfig.json index aeb6837c69a99..ccb123aaec83b 100644 --- a/src/plugins/apm_oss/tsconfig.json +++ b/src/plugins/apm_oss/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/bfetch/tsconfig.json b/src/plugins/bfetch/tsconfig.json index 173ff725d07d0..6c01479f1929e 100644 --- a/src/plugins/bfetch/tsconfig.json +++ b/src/plugins/bfetch/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/charts/tsconfig.json b/src/plugins/charts/tsconfig.json index a4f65d5937204..99edb2ffe3c16 100644 --- a/src/plugins/charts/tsconfig.json +++ b/src/plugins/charts/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/console/tsconfig.json b/src/plugins/console/tsconfig.json index 34aca5021bac4..d9f49036be8f8 100644 --- a/src/plugins/console/tsconfig.json +++ b/src/plugins/console/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/dashboard/tsconfig.json b/src/plugins/dashboard/tsconfig.json index dd99119cfb457..452208b39af60 100644 --- a/src/plugins/dashboard/tsconfig.json +++ b/src/plugins/dashboard/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/data/common/search/expressions/exists_filter.test.ts b/src/plugins/data/common/search/expressions/exists_filter.test.ts index e3b53b2281398..60e8a9c7a09ce 100644 --- a/src/plugins/data/common/search/expressions/exists_filter.test.ts +++ b/src/plugins/data/common/search/expressions/exists_filter.test.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { createMockContext } from '../../../../expressions/common'; +import { createMockContext } from '../../../../expressions/common/mocks'; import { functionWrapper } from './utils'; import { existsFilterFunction } from './exists_filter'; diff --git a/src/plugins/data/common/search/expressions/kibana_filter.test.ts b/src/plugins/data/common/search/expressions/kibana_filter.test.ts index ac8ae55492cc0..56a9e1ce660cd 100644 --- a/src/plugins/data/common/search/expressions/kibana_filter.test.ts +++ b/src/plugins/data/common/search/expressions/kibana_filter.test.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { createMockContext } from '../../../../expressions/common'; +import { createMockContext } from '../../../../expressions/common/mocks'; import { functionWrapper } from './utils'; import { kibanaFilterFunction } from './kibana_filter'; diff --git a/src/plugins/data/common/search/expressions/phrase_filter.test.ts b/src/plugins/data/common/search/expressions/phrase_filter.test.ts index 39bd907513a0d..90e471e166f5e 100644 --- a/src/plugins/data/common/search/expressions/phrase_filter.test.ts +++ b/src/plugins/data/common/search/expressions/phrase_filter.test.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { createMockContext } from '../../../../expressions/common'; +import { createMockContext } from '../../../../expressions/common/mocks'; import { functionWrapper } from './utils'; import { phraseFilterFunction } from './phrase_filter'; diff --git a/src/plugins/data/common/search/expressions/range_filter.test.ts b/src/plugins/data/common/search/expressions/range_filter.test.ts index 92670f8a044ba..129e6bd82e16a 100644 --- a/src/plugins/data/common/search/expressions/range_filter.test.ts +++ b/src/plugins/data/common/search/expressions/range_filter.test.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { createMockContext } from '../../../../expressions/common'; +import { createMockContext } from '../../../../expressions/common/mocks'; import { functionWrapper } from './utils'; import { rangeFilterFunction } from './range_filter'; diff --git a/src/plugins/data/tsconfig.json b/src/plugins/data/tsconfig.json index 9c95878af631e..b99a2f6f85904 100644 --- a/src/plugins/data/tsconfig.json +++ b/src/plugins/data/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/dev_tools/tsconfig.json b/src/plugins/dev_tools/tsconfig.json index c17b2341fd42f..f369396b17fbe 100644 --- a/src/plugins/dev_tools/tsconfig.json +++ b/src/plugins/dev_tools/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/discover/tsconfig.json b/src/plugins/discover/tsconfig.json index ec98199c3423e..96765d76a340b 100644 --- a/src/plugins/discover/tsconfig.json +++ b/src/plugins/discover/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/embeddable/tsconfig.json b/src/plugins/embeddable/tsconfig.json index 27a887500fb68..eacfa831ecee5 100644 --- a/src/plugins/embeddable/tsconfig.json +++ b/src/plugins/embeddable/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/es_ui_shared/tsconfig.json b/src/plugins/es_ui_shared/tsconfig.json index 9bcda2e0614de..3d102daaf3aaf 100644 --- a/src/plugins/es_ui_shared/tsconfig.json +++ b/src/plugins/es_ui_shared/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/expressions/common/mocks.ts b/src/plugins/expressions/common/mocks.ts index eaeebd8e53492..20bdbca07f008 100644 --- a/src/plugins/expressions/common/mocks.ts +++ b/src/plugins/expressions/common/mocks.ts @@ -34,3 +34,5 @@ export const createMockExecutionContext = ...extraContext, }; }; + +export { createMockContext } from './util/test_utils'; diff --git a/src/plugins/expressions/common/util/index.ts b/src/plugins/expressions/common/util/index.ts index 470dfc3c2d436..5f83d962d5aea 100644 --- a/src/plugins/expressions/common/util/index.ts +++ b/src/plugins/expressions/common/util/index.ts @@ -10,4 +10,3 @@ export * from './create_error'; export * from './get_by_alias'; export * from './tables_adapter'; export * from './expressions_inspector_adapter'; -export * from './test_utils'; diff --git a/src/plugins/expressions/tsconfig.json b/src/plugins/expressions/tsconfig.json index cce71013cefa5..fe76ba3050a3b 100644 --- a/src/plugins/expressions/tsconfig.json +++ b/src/plugins/expressions/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/home/tsconfig.json b/src/plugins/home/tsconfig.json index b15e1fc011b92..19ab5a8e6efec 100644 --- a/src/plugins/home/tsconfig.json +++ b/src/plugins/home/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/index_pattern_field_editor/tsconfig.json b/src/plugins/index_pattern_field_editor/tsconfig.json index 559b1aaf0fc26..c638fd34c6bbb 100644 --- a/src/plugins/index_pattern_field_editor/tsconfig.json +++ b/src/plugins/index_pattern_field_editor/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/index_pattern_management/tsconfig.json b/src/plugins/index_pattern_management/tsconfig.json index 37bd3e4aa5bbb..3c8fdb1cf6597 100644 --- a/src/plugins/index_pattern_management/tsconfig.json +++ b/src/plugins/index_pattern_management/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/input_control_vis/tsconfig.json b/src/plugins/input_control_vis/tsconfig.json index bef7bc394a6cc..c2f8d8783e822 100644 --- a/src/plugins/input_control_vis/tsconfig.json +++ b/src/plugins/input_control_vis/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/inspector/tsconfig.json b/src/plugins/inspector/tsconfig.json index 2a9c41464532c..0e42e577428c6 100644 --- a/src/plugins/inspector/tsconfig.json +++ b/src/plugins/inspector/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/kibana_legacy/tsconfig.json b/src/plugins/kibana_legacy/tsconfig.json index 709036c9e82f4..0b3f42cd3b57b 100644 --- a/src/plugins/kibana_legacy/tsconfig.json +++ b/src/plugins/kibana_legacy/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/kibana_overview/tsconfig.json b/src/plugins/kibana_overview/tsconfig.json index ac3ac109cb35f..3396861cb9179 100644 --- a/src/plugins/kibana_overview/tsconfig.json +++ b/src/plugins/kibana_overview/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/kibana_react/tsconfig.json b/src/plugins/kibana_react/tsconfig.json index eb9a24ca141f6..857b8cf83645c 100644 --- a/src/plugins/kibana_react/tsconfig.json +++ b/src/plugins/kibana_react/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/kibana_usage_collection/tsconfig.json b/src/plugins/kibana_usage_collection/tsconfig.json index d664d936f6667..100f1f03955d0 100644 --- a/src/plugins/kibana_usage_collection/tsconfig.json +++ b/src/plugins/kibana_usage_collection/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/kibana_utils/tsconfig.json b/src/plugins/kibana_utils/tsconfig.json index ae5e9b90af807..d9572707e8662 100644 --- a/src/plugins/kibana_utils/tsconfig.json +++ b/src/plugins/kibana_utils/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/legacy_export/tsconfig.json b/src/plugins/legacy_export/tsconfig.json index ec006d492499e..d6689ea1067db 100644 --- a/src/plugins/legacy_export/tsconfig.json +++ b/src/plugins/legacy_export/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/management/tsconfig.json b/src/plugins/management/tsconfig.json index ba3661666631a..3423299a53df7 100644 --- a/src/plugins/management/tsconfig.json +++ b/src/plugins/management/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/maps_ems/tsconfig.json b/src/plugins/maps_ems/tsconfig.json index b85c3da66b83a..7f44da00d47a4 100644 --- a/src/plugins/maps_ems/tsconfig.json +++ b/src/plugins/maps_ems/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/maps_legacy/tsconfig.json b/src/plugins/maps_legacy/tsconfig.json index f757e35f785af..c600024cc4a74 100644 --- a/src/plugins/maps_legacy/tsconfig.json +++ b/src/plugins/maps_legacy/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/navigation/tsconfig.json b/src/plugins/navigation/tsconfig.json index 07cfe10d7d81f..bb86142e1c443 100644 --- a/src/plugins/navigation/tsconfig.json +++ b/src/plugins/navigation/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/newsfeed/tsconfig.json b/src/plugins/newsfeed/tsconfig.json index 66244a22336c7..84626b2f3a6a8 100644 --- a/src/plugins/newsfeed/tsconfig.json +++ b/src/plugins/newsfeed/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/presentation_util/tsconfig.json b/src/plugins/presentation_util/tsconfig.json index 37b9380f6f2b9..cb39c5fb36f56 100644 --- a/src/plugins/presentation_util/tsconfig.json +++ b/src/plugins/presentation_util/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/region_map/tsconfig.json b/src/plugins/region_map/tsconfig.json index 899611d027465..385c31e6bd2d6 100644 --- a/src/plugins/region_map/tsconfig.json +++ b/src/plugins/region_map/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/saved_objects/tsconfig.json b/src/plugins/saved_objects/tsconfig.json index d9045b91b9dfa..46b3f9a5afcb6 100644 --- a/src/plugins/saved_objects/tsconfig.json +++ b/src/plugins/saved_objects/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/saved_objects_management/tsconfig.json b/src/plugins/saved_objects_management/tsconfig.json index 99849dea38618..cb74b06179225 100644 --- a/src/plugins/saved_objects_management/tsconfig.json +++ b/src/plugins/saved_objects_management/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/saved_objects_tagging_oss/tsconfig.json b/src/plugins/saved_objects_tagging_oss/tsconfig.json index b0059c71424bf..ae566d9626895 100644 --- a/src/plugins/saved_objects_tagging_oss/tsconfig.json +++ b/src/plugins/saved_objects_tagging_oss/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/security_oss/tsconfig.json b/src/plugins/security_oss/tsconfig.json index 530e01a034b00..156e4ffee9d79 100644 --- a/src/plugins/security_oss/tsconfig.json +++ b/src/plugins/security_oss/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/share/tsconfig.json b/src/plugins/share/tsconfig.json index 985066915f1dd..62c0b3739f4b7 100644 --- a/src/plugins/share/tsconfig.json +++ b/src/plugins/share/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/spaces_oss/tsconfig.json b/src/plugins/spaces_oss/tsconfig.json index 0cc82d7e5d124..96584842ec32b 100644 --- a/src/plugins/spaces_oss/tsconfig.json +++ b/src/plugins/spaces_oss/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/telemetry/tsconfig.json b/src/plugins/telemetry/tsconfig.json index bdced01d9eb6f..40370082f99e2 100644 --- a/src/plugins/telemetry/tsconfig.json +++ b/src/plugins/telemetry/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/telemetry_collection_manager/tsconfig.json b/src/plugins/telemetry_collection_manager/tsconfig.json index 1bba81769f0dd..8bbc440fb1a54 100644 --- a/src/plugins/telemetry_collection_manager/tsconfig.json +++ b/src/plugins/telemetry_collection_manager/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/telemetry_management_section/tsconfig.json b/src/plugins/telemetry_management_section/tsconfig.json index 48e40814b8570..c6a21733b2d6b 100644 --- a/src/plugins/telemetry_management_section/tsconfig.json +++ b/src/plugins/telemetry_management_section/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/tile_map/tsconfig.json b/src/plugins/tile_map/tsconfig.json index 899611d027465..385c31e6bd2d6 100644 --- a/src/plugins/tile_map/tsconfig.json +++ b/src/plugins/tile_map/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/timelion/tsconfig.json b/src/plugins/timelion/tsconfig.json index 5b96d69a878ea..bb8a48339d44e 100644 --- a/src/plugins/timelion/tsconfig.json +++ b/src/plugins/timelion/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/ui_actions/tsconfig.json b/src/plugins/ui_actions/tsconfig.json index a871d7215cdc5..89b66d18705c2 100644 --- a/src/plugins/ui_actions/tsconfig.json +++ b/src/plugins/ui_actions/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/url_forwarding/tsconfig.json b/src/plugins/url_forwarding/tsconfig.json index 8e867a6bad14f..f1916e4ce5957 100644 --- a/src/plugins/url_forwarding/tsconfig.json +++ b/src/plugins/url_forwarding/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/usage_collection/tsconfig.json b/src/plugins/usage_collection/tsconfig.json index 96b2c4d37e17c..b4a0721ef3672 100644 --- a/src/plugins/usage_collection/tsconfig.json +++ b/src/plugins/usage_collection/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/vis_default_editor/tsconfig.json b/src/plugins/vis_default_editor/tsconfig.json index 27bb775c2d0e8..54a84e08224a8 100644 --- a/src/plugins/vis_default_editor/tsconfig.json +++ b/src/plugins/vis_default_editor/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/vis_type_markdown/tsconfig.json b/src/plugins/vis_type_markdown/tsconfig.json index d5ab89b98081b..f940c295e7cee 100644 --- a/src/plugins/vis_type_markdown/tsconfig.json +++ b/src/plugins/vis_type_markdown/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/vis_type_metric/tsconfig.json b/src/plugins/vis_type_metric/tsconfig.json index 7441848d5a430..8cee918a3dc82 100644 --- a/src/plugins/vis_type_metric/tsconfig.json +++ b/src/plugins/vis_type_metric/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/vis_type_table/tsconfig.json b/src/plugins/vis_type_table/tsconfig.json index ccff3c349cf21..4f2e80575497b 100644 --- a/src/plugins/vis_type_table/tsconfig.json +++ b/src/plugins/vis_type_table/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/vis_type_tagcloud/tsconfig.json b/src/plugins/vis_type_tagcloud/tsconfig.json index 18bbad2257466..f7f3688183a48 100644 --- a/src/plugins/vis_type_tagcloud/tsconfig.json +++ b/src/plugins/vis_type_tagcloud/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/vis_type_timelion/tsconfig.json b/src/plugins/vis_type_timelion/tsconfig.json index 77f97de28366d..d29fb25b15315 100644 --- a/src/plugins/vis_type_timelion/tsconfig.json +++ b/src/plugins/vis_type_timelion/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/vis_type_timeseries/tsconfig.json b/src/plugins/vis_type_timeseries/tsconfig.json index 7b2dd4b608c1c..edc2d25b867d1 100644 --- a/src/plugins/vis_type_timeseries/tsconfig.json +++ b/src/plugins/vis_type_timeseries/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/vis_type_vega/tsconfig.json b/src/plugins/vis_type_vega/tsconfig.json index 4091dafcbe357..f375a2483e24f 100644 --- a/src/plugins/vis_type_vega/tsconfig.json +++ b/src/plugins/vis_type_vega/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/vis_type_vislib/tsconfig.json b/src/plugins/vis_type_vislib/tsconfig.json index 74bc1440d9dbc..845628a6b86f9 100644 --- a/src/plugins/vis_type_vislib/tsconfig.json +++ b/src/plugins/vis_type_vislib/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/vis_type_xy/tsconfig.json b/src/plugins/vis_type_xy/tsconfig.json index 5cb0bc8d0bc8e..7e23b07bd80f6 100644 --- a/src/plugins/vis_type_xy/tsconfig.json +++ b/src/plugins/vis_type_xy/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/visualizations/tsconfig.json b/src/plugins/visualizations/tsconfig.json index d7c5e6a4b4366..65de6908228b3 100644 --- a/src/plugins/visualizations/tsconfig.json +++ b/src/plugins/visualizations/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/src/plugins/visualize/tsconfig.json b/src/plugins/visualize/tsconfig.json index bc0891f391746..046202d82d1aa 100644 --- a/src/plugins/visualize/tsconfig.json +++ b/src/plugins/visualize/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/tsconfig.base.json b/tsconfig.base.json index da4de5ef3712b..c28ed0d8c8750 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -56,5 +56,6 @@ "jest-styled-components", "@testing-library/jest-dom" ] - } + }, + "include": [] } diff --git a/tsconfig.json b/tsconfig.json index c852481518d54..03597114333ca 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -19,6 +19,78 @@ "x-pack/plugins/cases/**/*", "x-pack/plugins/lists/**/*", "x-pack/plugins/security_solution/**/*", + + // tests + "src/**/*.test.ts", + "src/**/*.test.tsx", + "src/**/integration_tests/*", + "src/**/tests/*", + // mocks + "src/**/__mocks__/*", + "src/**/mock/*", + "src/**/mocks/*", + "src/**/*/mock.ts", + "src/**/*/mocks.ts", + "src/**/*/mocks.tsx", + "src/**/*.mock.ts", + "src/**/*.mock.tsx", + "src/**/*.mocks.ts", + "src/**/*.mocks.tsx", + + // test helpers + "src/**/test_helpers/*", + "src/**/test_utils/*", + "src/**/*/test_utils.ts", + "src/**/*/test_helpers.ts", + "src/**/*/test_helper.tsx", + + // stubs + "src/**/*/stubs.ts", + "src/**/*.stub.ts", + "src/**/*.stories.tsx", + "src/**/*/_mock_handler_arguments.ts", + + // tests + "x-pack/plugins/**/*.test.ts", + "x-pack/plugins/**/*.test.tsx", + "x-pack/plugins/**/test/**/*", + "x-pack/plugins/**/tests/*", + "x-pack/plugins/**/integration_tests/*", + "x-pack/plugins/**/tests_client_integration/*", + "x-pack/plugins/**/__fixtures__/*", + "x-pack/plugins/**/__stories__/*", + "x-pack/plugins/**/__jest__/**/*", + + // mocks + "x-pack/plugins/**/__mocks__/*", + "x-pack/plugins/**/mock/*", + "x-pack/plugins/**/mocks/*", + "x-pack/plugins/**/*/mock.ts", + "x-pack/plugins/**/*/mocks.ts", + "x-pack/plugins/**/*/mocks.tsx", + "x-pack/plugins/**/*.mock.ts", + "x-pack/plugins/**/*.mock.tsx", + "x-pack/plugins/**/*.mocks.ts", + "x-pack/plugins/**/*.mocks.tsx", + + // test helpers + "x-pack/plugins/**/test_helpers/*", + "x-pack/plugins/**/test_utils/*", + "x-pack/plugins/**/*/test_utils.ts", + "x-pack/plugins/**/*/test_helper.tsx", + "x-pack/plugins/**/*/test_helpers.ts", + "x-pack/plugins/ui_actions_enhanced/public/components/action_wizard/test_data.tsx", + "x-pack/plugins/uptime/server/lib/requests/helper.ts", + "x-pack/plugins/uptime/public/lib/helper/rtl_helpers.tsx", + "x-pack/plugins/uptime/public/lib/helper/enzyme_helpers.tsx", + "x-pack/plugins/apm/server/utils/test_helpers.tsx", + "x-pack/plugins/apm/public/utils/testHelpers.tsx", + + // stubs + "x-pack/plugins/**/*/stubs.ts", + "x-pack/plugins/**/*.stub.ts", + "x-pack/plugins/**/*.stories.tsx", + "x-pack/plugins/**/*/_mock_handler_arguments.ts" ], "exclude": [ "x-pack/plugins/security_solution/cypress/**/*" diff --git a/tsconfig.project.json b/tsconfig.project.json new file mode 100644 index 0000000000000..174c3fdf0fd54 --- /dev/null +++ b/tsconfig.project.json @@ -0,0 +1,65 @@ +{ + "extends": "./tsconfig.base.json", + "compilerOptions": { + "composite": true, + "emitDeclarationOnly": true, + "declaration": true, + "declarationMap": true + }, + "exclude": [ + // tests + "**/*.test.ts", + "**/*.test.tsx", + "**/integration_tests/*", + "**/test/**/*", + "**/test/*", + "**/tests/*", + "**/tests_client_integration/*", + "**/__fixtures__/*", + "**/__stories__/*", + "**/__jest__/**", + + // mocks + "**/__mocks__/*", + "**/mock/*", + "**/mocks/*", + "**/*/mock.ts", + "**/*/mocks.ts", + "**/*/mocks.tsx", + "**/*.mock.ts", + "**/*.mock.tsx", + "**/*.mocks.ts", + "**/*.mocks.tsx", + + // test helpers + "**/test_helpers/*", + "**/test_utils/*", + "**/*/test_utils.ts", + "**/*/test_helper.tsx", + "**/*/test_helpers.ts", + // x-pack/plugins/ui_actions_enhanced/public/components/action_wizard/test_data.tsx + "**/*/test_data.tsx", + "**/*/shared_columns_tests.tsx", + // x-pack/plugins/uptime/server/lib/requests/helper.ts + "**/*/requests/helper.ts", + // x-pack/plugins/uptime/public/lib/helper/rtl_helpers.tsx + "**/*/rtl_helpers.tsx", + // x-pack/plugins/uptime/public/lib/helper/enzyme_helpers.tsx + "**/*/enzyme_helpers.tsx", + // x-pack/plugins/apm/server/utils/test_helpers.tsx + "**/*/test_helpers.tsx", + // x-pack/plugins/apm/public/utils/testHelpers.tsx + "**/*/testHelpers.tsx", + + // stubs + "**/*/stubs.ts", + "**/*.stub.ts", + "**/*.stories.tsx", + "**/*/_mock_handler_arguments.ts" + ], + "include": [], + "types": [ + "node", + "flot" + ] +} diff --git a/x-pack/plugins/actions/tsconfig.json b/x-pack/plugins/actions/tsconfig.json index d5c1105c99ad0..10ebd09235236 100644 --- a/x-pack/plugins/actions/tsconfig.json +++ b/x-pack/plugins/actions/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/alerting/tsconfig.json b/x-pack/plugins/alerting/tsconfig.json index 86ab00faeb5ad..4010688746901 100644 --- a/x-pack/plugins/alerting/tsconfig.json +++ b/x-pack/plugins/alerting/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/apm/e2e/tsconfig.json b/x-pack/plugins/apm/e2e/tsconfig.json index c4587349c7ad7..0c13dd717991c 100644 --- a/x-pack/plugins/apm/e2e/tsconfig.json +++ b/x-pack/plugins/apm/e2e/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../../tsconfig.base.json", + "extends": "../../../../tsconfig.project.json", "exclude": ["tmp"], "include": ["./**/*"], "compilerOptions": { diff --git a/x-pack/plugins/apm/ftr_e2e/tsconfig.json b/x-pack/plugins/apm/ftr_e2e/tsconfig.json index 168801f782607..f699943a254fa 100644 --- a/x-pack/plugins/apm/ftr_e2e/tsconfig.json +++ b/x-pack/plugins/apm/ftr_e2e/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../../tsconfig.base.json", + "extends": "../../../../tsconfig.project.json", "exclude": [ "tmp" ], @@ -12,4 +12,4 @@ "node" ] } -} \ No newline at end of file +} diff --git a/x-pack/plugins/apm/scripts/optimize-tsconfig/optimize.js b/x-pack/plugins/apm/scripts/optimize-tsconfig/optimize.js index fed938119c4a6..613435fe186bf 100644 --- a/x-pack/plugins/apm/scripts/optimize-tsconfig/optimize.js +++ b/x-pack/plugins/apm/scripts/optimize-tsconfig/optimize.js @@ -22,7 +22,7 @@ const { kibanaRoot, tsconfigTpl, filesToIgnore } = require('./paths'); const { unoptimizeTsConfig } = require('./unoptimize'); async function prepareBaseTsConfig() { - const baseConfigFilename = path.resolve(kibanaRoot, 'tsconfig.base.json'); + const baseConfigFilename = path.resolve(kibanaRoot, 'tsconfig.project.json'); const config = json5.parse(await readFile(baseConfigFilename, 'utf-8')); await writeFile( diff --git a/x-pack/plugins/apm/scripts/optimize-tsconfig/paths.js b/x-pack/plugins/apm/scripts/optimize-tsconfig/paths.js index dbc207c9e6d26..b501ec3a8eedf 100644 --- a/x-pack/plugins/apm/scripts/optimize-tsconfig/paths.js +++ b/x-pack/plugins/apm/scripts/optimize-tsconfig/paths.js @@ -12,7 +12,7 @@ const tsconfigTpl = path.resolve(__dirname, './tsconfig.json'); const filesToIgnore = [ path.resolve(kibanaRoot, 'tsconfig.json'), - path.resolve(kibanaRoot, 'tsconfig.base.json'), + path.resolve(kibanaRoot, 'tsconfig.project.json'), path.resolve(kibanaRoot, 'x-pack/plugins/apm', 'tsconfig.json'), ]; diff --git a/x-pack/plugins/apm/tsconfig.json b/x-pack/plugins/apm/tsconfig.json index ffbf11c23f63a..ae2085dc24003 100644 --- a/x-pack/plugins/apm/tsconfig.json +++ b/x-pack/plugins/apm/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/banners/tsconfig.json b/x-pack/plugins/banners/tsconfig.json index 85608a8a78ad5..6c4c80173208b 100644 --- a/x-pack/plugins/banners/tsconfig.json +++ b/x-pack/plugins/banners/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/beats_management/tsconfig.json b/x-pack/plugins/beats_management/tsconfig.json index ad68cc900e638..398438712b26b 100644 --- a/x-pack/plugins/beats_management/tsconfig.json +++ b/x-pack/plugins/beats_management/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/canvas/storybook/addon/tsconfig.json b/x-pack/plugins/canvas/storybook/addon/tsconfig.json index 2ab1856de661a..b115d1c46546c 100644 --- a/x-pack/plugins/canvas/storybook/addon/tsconfig.json +++ b/x-pack/plugins/canvas/storybook/addon/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../../../tsconfig.base.json", + "extends": "../../../../../tsconfig.project.json", "include": [ "src/**/*.ts", "src/**/*.tsx" diff --git a/x-pack/plugins/canvas/tsconfig.json b/x-pack/plugins/canvas/tsconfig.json index 487b68ba3542b..679165f0a1b76 100644 --- a/x-pack/plugins/canvas/tsconfig.json +++ b/x-pack/plugins/canvas/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/cloud/tsconfig.json b/x-pack/plugins/cloud/tsconfig.json index 46e81aa7fa086..f6edb9fb7ccae 100644 --- a/x-pack/plugins/cloud/tsconfig.json +++ b/x-pack/plugins/cloud/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/console_extensions/tsconfig.json b/x-pack/plugins/console_extensions/tsconfig.json index 5ad28f230a0bb..edcd46c4fafc5 100644 --- a/x-pack/plugins/console_extensions/tsconfig.json +++ b/x-pack/plugins/console_extensions/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/cross_cluster_replication/tsconfig.json b/x-pack/plugins/cross_cluster_replication/tsconfig.json index 9c7590b9c2553..156a851abb8db 100644 --- a/x-pack/plugins/cross_cluster_replication/tsconfig.json +++ b/x-pack/plugins/cross_cluster_replication/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/dashboard_enhanced/tsconfig.json b/x-pack/plugins/dashboard_enhanced/tsconfig.json index 567c390edfa5a..f6acdddc6f997 100644 --- a/x-pack/plugins/dashboard_enhanced/tsconfig.json +++ b/x-pack/plugins/dashboard_enhanced/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/dashboard_mode/tsconfig.json b/x-pack/plugins/dashboard_mode/tsconfig.json index 6e4ed11ffa7ff..c4a11959ec3e3 100644 --- a/x-pack/plugins/dashboard_mode/tsconfig.json +++ b/x-pack/plugins/dashboard_mode/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/data_enhanced/tsconfig.json b/x-pack/plugins/data_enhanced/tsconfig.json index 047b9b06516ba..5538a2db3e4cd 100644 --- a/x-pack/plugins/data_enhanced/tsconfig.json +++ b/x-pack/plugins/data_enhanced/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/discover_enhanced/tsconfig.json b/x-pack/plugins/discover_enhanced/tsconfig.json index 38a55e557909b..2a055bd0e0710 100644 --- a/x-pack/plugins/discover_enhanced/tsconfig.json +++ b/x-pack/plugins/discover_enhanced/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/drilldowns/url_drilldown/tsconfig.json b/x-pack/plugins/drilldowns/url_drilldown/tsconfig.json index 50fe41c49b0c8..99aea16a9aaba 100644 --- a/x-pack/plugins/drilldowns/url_drilldown/tsconfig.json +++ b/x-pack/plugins/drilldowns/url_drilldown/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../../tsconfig.base.json", + "extends": "../../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/embeddable_enhanced/tsconfig.json b/x-pack/plugins/embeddable_enhanced/tsconfig.json index 6e9eb69585cbc..32754f2fd5524 100644 --- a/x-pack/plugins/embeddable_enhanced/tsconfig.json +++ b/x-pack/plugins/embeddable_enhanced/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/encrypted_saved_objects/tsconfig.json b/x-pack/plugins/encrypted_saved_objects/tsconfig.json index 2b51b313d34fc..9eae8b7366bea 100644 --- a/x-pack/plugins/encrypted_saved_objects/tsconfig.json +++ b/x-pack/plugins/encrypted_saved_objects/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/enterprise_search/tsconfig.json b/x-pack/plugins/enterprise_search/tsconfig.json index 6b4c50770b49f..a4f1c55463e75 100644 --- a/x-pack/plugins/enterprise_search/tsconfig.json +++ b/x-pack/plugins/enterprise_search/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/event_log/tsconfig.json b/x-pack/plugins/event_log/tsconfig.json index 9b7cde10da3d6..e21dbc93b7b47 100644 --- a/x-pack/plugins/event_log/tsconfig.json +++ b/x-pack/plugins/event_log/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/features/tsconfig.json b/x-pack/plugins/features/tsconfig.json index 1260af55fbff6..11e2dbc8f093f 100644 --- a/x-pack/plugins/features/tsconfig.json +++ b/x-pack/plugins/features/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/file_upload/tsconfig.json b/x-pack/plugins/file_upload/tsconfig.json index 887a05af31174..8a982f83632aa 100644 --- a/x-pack/plugins/file_upload/tsconfig.json +++ b/x-pack/plugins/file_upload/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/fleet/tsconfig.json b/x-pack/plugins/fleet/tsconfig.json index a20d82de3c859..66849e017395b 100644 --- a/x-pack/plugins/fleet/tsconfig.json +++ b/x-pack/plugins/fleet/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/global_search/tsconfig.json b/x-pack/plugins/global_search/tsconfig.json index 2d05328f445df..2571f7c2e2935 100644 --- a/x-pack/plugins/global_search/tsconfig.json +++ b/x-pack/plugins/global_search/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/global_search_bar/tsconfig.json b/x-pack/plugins/global_search_bar/tsconfig.json index 266eecc35c84b..595d55c3c5a0d 100644 --- a/x-pack/plugins/global_search_bar/tsconfig.json +++ b/x-pack/plugins/global_search_bar/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/global_search_providers/tsconfig.json b/x-pack/plugins/global_search_providers/tsconfig.json index f2759954a6845..9be9a681ee7c5 100644 --- a/x-pack/plugins/global_search_providers/tsconfig.json +++ b/x-pack/plugins/global_search_providers/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/graph/tsconfig.json b/x-pack/plugins/graph/tsconfig.json index 741c603e3aae4..ae0d143455d52 100644 --- a/x-pack/plugins/graph/tsconfig.json +++ b/x-pack/plugins/graph/tsconfig.json @@ -1,6 +1,6 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", @@ -27,4 +27,4 @@ { "path": "../../../src/plugins/kibana_utils/tsconfig.json" }, { "path": "../../../src/plugins/kibana_react/tsconfig.json" } ] - } \ No newline at end of file + } diff --git a/x-pack/plugins/grokdebugger/tsconfig.json b/x-pack/plugins/grokdebugger/tsconfig.json index 51d2d0b6db0ea..3e9e2f7870814 100644 --- a/x-pack/plugins/grokdebugger/tsconfig.json +++ b/x-pack/plugins/grokdebugger/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/index_lifecycle_management/tsconfig.json b/x-pack/plugins/index_lifecycle_management/tsconfig.json index 75bd775a36749..bf43817cbc407 100644 --- a/x-pack/plugins/index_lifecycle_management/tsconfig.json +++ b/x-pack/plugins/index_lifecycle_management/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", @@ -8,7 +8,6 @@ "declarationMap": true }, "include": [ - "__jest__/**/*", "common/**/*", "public/**/*", "server/**/*", diff --git a/x-pack/plugins/index_management/tsconfig.json b/x-pack/plugins/index_management/tsconfig.json index 81a96a77cef83..0766839a230b9 100644 --- a/x-pack/plugins/index_management/tsconfig.json +++ b/x-pack/plugins/index_management/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", @@ -8,11 +8,9 @@ "declarationMap": true }, "include": [ - "__jest__/**/*", "common/**/*", "public/**/*", "server/**/*", - "test/**/*", "../../../typings/**/*", ], "references": [ diff --git a/x-pack/plugins/infra/public/utils/enzyme_helpers.tsx b/x-pack/plugins/infra/public/utils/enzyme_helpers.tsx deleted file mode 100644 index 33fbbd03d790a..0000000000000 --- a/x-pack/plugins/infra/public/utils/enzyme_helpers.tsx +++ /dev/null @@ -1,87 +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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -// eslint-disable-next-line import/no-extraneous-dependencies -import { mount, ReactWrapper } from 'enzyme'; -import React from 'react'; -import { act as reactAct } from 'react-dom/test-utils'; -/** - * A wrapper object to provide access to the state of a hook under test and to - * enable interaction with that hook. - */ -interface ReactHookWrapper { - /* Ensures that async React operations have settled before and after the - * given actor callback is called. The actor callback arguments provide easy - * access to the last hook value and allow for updating the arguments passed - * to the hook body to trigger reevaluation. - */ - act: (actor: (lastHookValue: HookValue, setArgs: (args: Args) => void) => void) => void; - /* The enzyme wrapper around the test component. */ - component: ReactWrapper; - /* The most recent value return the by test harness of the hook. */ - getLastHookValue: () => HookValue; - /* The jest Mock function that receives the hook values for introspection. */ - hookValueCallback: jest.Mock; -} - -/** - * Allows for execution of hooks inside of a test component which records the - * returned values. - * - * @param body A function that calls the hook and returns data derived from it - * @param WrapperComponent A component that, if provided, will be wrapped - * around the test component. This can be useful to provide context values. - * @return {ReactHookWrapper} An object providing access to the hook state and - * functions to interact with it. - */ -export const mountHook = ( - body: (args: Args) => HookValue, - WrapperComponent?: React.ComponentType, - initialArgs: Args = {} as Args -): ReactHookWrapper => { - const hookValueCallback = jest.fn(); - let component!: ReactWrapper; - - const act: ReactHookWrapper['act'] = (actor) => { - reactAct(() => { - actor(getLastHookValue(), (args: Args) => component.setProps(args)); - component.update(); - }); - }; - - const getLastHookValue = () => { - const calls = hookValueCallback.mock.calls; - if (calls.length <= 0) { - throw Error('No recent hook value present.'); - } - return calls[calls.length - 1][0]; - }; - - const HookComponent = (props: Args) => { - hookValueCallback(body(props)); - return null; - }; - const TestComponent: React.FunctionComponent = (args) => - WrapperComponent ? ( - - - - ) : ( - - ); - - reactAct(() => { - component = mount(); - }); - - return { - act, - component, - getLastHookValue, - hookValueCallback, - }; -}; diff --git a/x-pack/plugins/infra/server/lib/infra_ml/queries/metrics_hosts_anomalies.ts b/x-pack/plugins/infra/server/lib/infra_ml/queries/metrics_hosts_anomalies.ts index ab50986c3b3d5..b9bfcd302fb83 100644 --- a/x-pack/plugins/infra/server/lib/infra_ml/queries/metrics_hosts_anomalies.ts +++ b/x-pack/plugins/infra/server/lib/infra_ml/queries/metrics_hosts_anomalies.ts @@ -84,7 +84,7 @@ export const createMetricsHostsAnomaliesQuery = ({ const sortOptions = [ { [sortToMlFieldMap[field]]: querySortDirection }, { [TIEBREAKER_FIELD]: querySortDirection }, // Tiebreaker - ]; + ] as const; const resultsQuery = { ...defaultRequestParameters, diff --git a/x-pack/plugins/infra/server/lib/infra_ml/queries/metrics_k8s_anomalies.ts b/x-pack/plugins/infra/server/lib/infra_ml/queries/metrics_k8s_anomalies.ts index 8fb8df5eef3d7..8dadcfe87c6f9 100644 --- a/x-pack/plugins/infra/server/lib/infra_ml/queries/metrics_k8s_anomalies.ts +++ b/x-pack/plugins/infra/server/lib/infra_ml/queries/metrics_k8s_anomalies.ts @@ -83,7 +83,7 @@ export const createMetricsK8sAnomaliesQuery = ({ const sortOptions = [ { [sortToMlFieldMap[field]]: querySortDirection }, { [TIEBREAKER_FIELD]: querySortDirection }, // Tiebreaker - ]; + ] as const; const resultsQuery = { ...defaultRequestParameters, diff --git a/x-pack/plugins/infra/tsconfig.json b/x-pack/plugins/infra/tsconfig.json index 765af7974a2f1..b684e1866282f 100644 --- a/x-pack/plugins/infra/tsconfig.json +++ b/x-pack/plugins/infra/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/ingest_pipelines/tsconfig.json b/x-pack/plugins/ingest_pipelines/tsconfig.json index a248bc9f337fe..5917b94caf76b 100644 --- a/x-pack/plugins/ingest_pipelines/tsconfig.json +++ b/x-pack/plugins/ingest_pipelines/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", @@ -11,7 +11,6 @@ "common/**/*", "public/**/*", "server/**/*", - "__jest__/**/*", "../../../typings/**/*" ], "references": [ diff --git a/x-pack/plugins/lens/tsconfig.json b/x-pack/plugins/lens/tsconfig.json index 134f0b4185b84..69ef52535dd9d 100644 --- a/x-pack/plugins/lens/tsconfig.json +++ b/x-pack/plugins/lens/tsconfig.json @@ -1,6 +1,6 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", @@ -38,4 +38,4 @@ { "path": "../../../src/plugins/embeddable/tsconfig.json"}, { "path": "../../../src/plugins/presentation_util/tsconfig.json"}, ] - } \ No newline at end of file + } diff --git a/x-pack/plugins/license_management/tsconfig.json b/x-pack/plugins/license_management/tsconfig.json index e6cb0101ee838..925049ca924cf 100644 --- a/x-pack/plugins/license_management/tsconfig.json +++ b/x-pack/plugins/license_management/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/licensing/tsconfig.json b/x-pack/plugins/licensing/tsconfig.json index 6118bcd81d342..2d744e57c1895 100644 --- a/x-pack/plugins/licensing/tsconfig.json +++ b/x-pack/plugins/licensing/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/logstash/tsconfig.json b/x-pack/plugins/logstash/tsconfig.json index 6f21cfdb0b191..6430248e46396 100644 --- a/x-pack/plugins/logstash/tsconfig.json +++ b/x-pack/plugins/logstash/tsconfig.json @@ -1,6 +1,6 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/maps/public/components/validated_number_input.tsx b/x-pack/plugins/maps/public/components/validated_number_input.tsx index cd525cf1ee2c9..942f31074000f 100644 --- a/x-pack/plugins/maps/public/components/validated_number_input.tsx +++ b/x-pack/plugins/maps/public/components/validated_number_input.tsx @@ -6,8 +6,8 @@ */ import React, { Component, ChangeEvent, ReactNode } from 'react'; -// @ts-expect-error -import { EuiFieldNumber, EuiFormRow, EuiFormRowDisplayKeys } from '@elastic/eui'; +import { EuiFieldNumber, EuiFormRow } from '@elastic/eui'; +import type { EuiFormRowDisplayKeys } from '@elastic/eui/src/components/form/form_row/form_row'; import { i18n } from '@kbn/i18n'; import _ from 'lodash'; diff --git a/x-pack/plugins/maps/tsconfig.json b/x-pack/plugins/maps/tsconfig.json index 1b74b7ee7566a..59af94bea0b68 100644 --- a/x-pack/plugins/maps/tsconfig.json +++ b/x-pack/plugins/maps/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/maps_legacy_licensing/tsconfig.json b/x-pack/plugins/maps_legacy_licensing/tsconfig.json index 30a547b18a831..3b8102b5205a8 100644 --- a/x-pack/plugins/maps_legacy_licensing/tsconfig.json +++ b/x-pack/plugins/maps_legacy_licensing/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", 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..599dee1e56c0f 100644 --- a/x-pack/plugins/ml/server/routes/apidoc_scripts/tsconfig.json +++ b/x-pack/plugins/ml/server/routes/apidoc_scripts/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../../../../tsconfig.base.json", + "extends": "../../../../../../tsconfig.project.json", "compilerOptions": { "outDir": "./target", "target": "es6", diff --git a/x-pack/plugins/ml/tsconfig.json b/x-pack/plugins/ml/tsconfig.json index 6b396b1c59642..b1135b867dc08 100644 --- a/x-pack/plugins/ml/tsconfig.json +++ b/x-pack/plugins/ml/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/monitoring/tsconfig.json b/x-pack/plugins/monitoring/tsconfig.json index d0fb7e1a88dcf..b1999101f7c12 100644 --- a/x-pack/plugins/monitoring/tsconfig.json +++ b/x-pack/plugins/monitoring/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/observability/tsconfig.json b/x-pack/plugins/observability/tsconfig.json index 6833948b86b18..083c35a26c20b 100644 --- a/x-pack/plugins/observability/tsconfig.json +++ b/x-pack/plugins/observability/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/osquery/tsconfig.json b/x-pack/plugins/osquery/tsconfig.json index 291b0f7c607cf..03c9e451f3b52 100644 --- a/x-pack/plugins/osquery/tsconfig.json +++ b/x-pack/plugins/osquery/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/painless_lab/tsconfig.json b/x-pack/plugins/painless_lab/tsconfig.json index a869b21e06d4d..2519206b0fcdb 100644 --- a/x-pack/plugins/painless_lab/tsconfig.json +++ b/x-pack/plugins/painless_lab/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/remote_clusters/tsconfig.json b/x-pack/plugins/remote_clusters/tsconfig.json index 0bee6300cf0b2..b48933bc9f1ec 100644 --- a/x-pack/plugins/remote_clusters/tsconfig.json +++ b/x-pack/plugins/remote_clusters/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/reporting/tsconfig.json b/x-pack/plugins/reporting/tsconfig.json index 88e8d343f4700..4f252743ed078 100644 --- a/x-pack/plugins/reporting/tsconfig.json +++ b/x-pack/plugins/reporting/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/rollup/tsconfig.json b/x-pack/plugins/rollup/tsconfig.json index 9b994d1710ffc..bf589c62713d6 100644 --- a/x-pack/plugins/rollup/tsconfig.json +++ b/x-pack/plugins/rollup/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/runtime_fields/tsconfig.json b/x-pack/plugins/runtime_fields/tsconfig.json index a1efe4c9cf2dd..e1ad141f1c702 100644 --- a/x-pack/plugins/runtime_fields/tsconfig.json +++ b/x-pack/plugins/runtime_fields/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/saved_objects_tagging/tsconfig.json b/x-pack/plugins/saved_objects_tagging/tsconfig.json index d00156ad1277c..5c37481f982d9 100644 --- a/x-pack/plugins/saved_objects_tagging/tsconfig.json +++ b/x-pack/plugins/saved_objects_tagging/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/searchprofiler/tsconfig.json b/x-pack/plugins/searchprofiler/tsconfig.json index f8ac3a61f7812..57cd882422b39 100644 --- a/x-pack/plugins/searchprofiler/tsconfig.json +++ b/x-pack/plugins/searchprofiler/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/security/tsconfig.json b/x-pack/plugins/security/tsconfig.json index 6c3fd1851a8cb..4ace497dbd5ad 100644 --- a/x-pack/plugins/security/tsconfig.json +++ b/x-pack/plugins/security/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/security_solution/cypress/tsconfig.json b/x-pack/plugins/security_solution/cypress/tsconfig.json index 270d877a362a6..bd8d9aa058bc3 100644 --- a/x-pack/plugins/security_solution/cypress/tsconfig.json +++ b/x-pack/plugins/security_solution/cypress/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../../tsconfig.base.json", + "extends": "../../../../tsconfig.project.json", "exclude": [], "include": [ "./**/*" diff --git a/x-pack/plugins/snapshot_restore/tsconfig.json b/x-pack/plugins/snapshot_restore/tsconfig.json index 39beda02977e1..c496847e4dd9b 100644 --- a/x-pack/plugins/snapshot_restore/tsconfig.json +++ b/x-pack/plugins/snapshot_restore/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", @@ -8,11 +8,9 @@ "declarationMap": true }, "include": [ - "__jest__/**/*", "common/**/*", "public/**/*", "server/**/*", - "test/**/*", "../../../typings/**/*", ], "references": [ diff --git a/x-pack/plugins/spaces/tsconfig.json b/x-pack/plugins/spaces/tsconfig.json index 95fbecaa90936..4c67cbe8912bd 100644 --- a/x-pack/plugins/spaces/tsconfig.json +++ b/x-pack/plugins/spaces/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/stack_alerts/tsconfig.json b/x-pack/plugins/stack_alerts/tsconfig.json index c83935945c67b..97eb9a9a05b86 100644 --- a/x-pack/plugins/stack_alerts/tsconfig.json +++ b/x-pack/plugins/stack_alerts/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/task_manager/server/monitoring/workload_statistics.ts b/x-pack/plugins/task_manager/server/monitoring/workload_statistics.ts index c79b310822c3e..70b4ba55c2393 100644 --- a/x-pack/plugins/task_manager/server/monitoring/workload_statistics.ts +++ b/x-pack/plugins/task_manager/server/monitoring/workload_statistics.ts @@ -56,7 +56,7 @@ export interface WorkloadAggregation { scheduleDensity: { range: { field: string; - ranges: [{ from: string; to: string }]; + ranges: [{ from: number; to: number }]; }; aggs: { histogram: { @@ -86,7 +86,6 @@ export interface WorkloadAggregation { // The type of a bucket in the scheduleDensity range aggregation type ScheduleDensityResult = AggregationResultOf< - // @ts-expect-error AggregationRange reqires from: number WorkloadAggregation['aggs']['idleTasks']['aggs']['scheduleDensity'], {} >['buckets'][0]; diff --git a/x-pack/plugins/task_manager/tsconfig.json b/x-pack/plugins/task_manager/tsconfig.json index a72b678da1f7c..95a098e54619e 100644 --- a/x-pack/plugins/task_manager/tsconfig.json +++ b/x-pack/plugins/task_manager/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/telemetry_collection_xpack/tsconfig.json b/x-pack/plugins/telemetry_collection_xpack/tsconfig.json index 476f5926f757a..80488bd74617d 100644 --- a/x-pack/plugins/telemetry_collection_xpack/tsconfig.json +++ b/x-pack/plugins/telemetry_collection_xpack/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/transform/tsconfig.json b/x-pack/plugins/transform/tsconfig.json index 2717f92c7a4df..30da887cc1c43 100644 --- a/x-pack/plugins/transform/tsconfig.json +++ b/x-pack/plugins/transform/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/triggers_actions_ui/tsconfig.json b/x-pack/plugins/triggers_actions_ui/tsconfig.json index 8202449b22298..b7a63d7043f49 100644 --- a/x-pack/plugins/triggers_actions_ui/tsconfig.json +++ b/x-pack/plugins/triggers_actions_ui/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/ui_actions_enhanced/tsconfig.json b/x-pack/plugins/ui_actions_enhanced/tsconfig.json index 39318770126e5..1513669cdc1ad 100644 --- a/x-pack/plugins/ui_actions_enhanced/tsconfig.json +++ b/x-pack/plugins/ui_actions_enhanced/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/upgrade_assistant/tsconfig.json b/x-pack/plugins/upgrade_assistant/tsconfig.json index 0d65c8ddd8fed..08e45bebf125b 100644 --- a/x-pack/plugins/upgrade_assistant/tsconfig.json +++ b/x-pack/plugins/upgrade_assistant/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/uptime/public/components/certificates/cert_monitors.test.tsx b/x-pack/plugins/uptime/public/components/certificates/cert_monitors.test.tsx index 5dfc11837b72d..719c90574b088 100644 --- a/x-pack/plugins/uptime/public/components/certificates/cert_monitors.test.tsx +++ b/x-pack/plugins/uptime/public/components/certificates/cert_monitors.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { CertMonitors } from './cert_monitors'; -import { renderWithRouter, shallowWithRouter } from '../../lib'; +import { renderWithRouter, shallowWithRouter } from '../../lib/helper/enzyme_helpers'; describe('CertMonitors', () => { const certMons = [ diff --git a/x-pack/plugins/uptime/public/components/certificates/cert_search.test.tsx b/x-pack/plugins/uptime/public/components/certificates/cert_search.test.tsx index a991634de22a6..a0166fc573754 100644 --- a/x-pack/plugins/uptime/public/components/certificates/cert_search.test.tsx +++ b/x-pack/plugins/uptime/public/components/certificates/cert_search.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { renderWithRouter, shallowWithRouter } from '../../lib'; +import { renderWithRouter, shallowWithRouter } from '../../lib/helper/enzyme_helpers'; import { CertificateSearch } from './cert_search'; describe('CertificatesSearch', () => { diff --git a/x-pack/plugins/uptime/public/components/certificates/cert_status.test.tsx b/x-pack/plugins/uptime/public/components/certificates/cert_status.test.tsx index e331a6e5c34fe..999d76f690867 100644 --- a/x-pack/plugins/uptime/public/components/certificates/cert_status.test.tsx +++ b/x-pack/plugins/uptime/public/components/certificates/cert_status.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { renderWithRouter, shallowWithRouter } from '../../lib'; +import { renderWithRouter, shallowWithRouter } from '../../lib/helper/enzyme_helpers'; import { CertStatus } from './cert_status'; import * as redux from 'react-redux'; import moment from 'moment'; diff --git a/x-pack/plugins/uptime/public/components/certificates/certificates_list.test.tsx b/x-pack/plugins/uptime/public/components/certificates/certificates_list.test.tsx index ec6a5d91a67c3..8ae0cdb791d9b 100644 --- a/x-pack/plugins/uptime/public/components/certificates/certificates_list.test.tsx +++ b/x-pack/plugins/uptime/public/components/certificates/certificates_list.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { shallowWithRouter } from '../../lib'; +import { shallowWithRouter } from '../../lib/helper/enzyme_helpers'; import { CertificateList, CertSort } from './certificates_list'; describe('CertificateList', () => { diff --git a/x-pack/plugins/uptime/public/components/certificates/fingerprint_col.test.tsx b/x-pack/plugins/uptime/public/components/certificates/fingerprint_col.test.tsx index 1affd1f990f90..550b7f75623f0 100644 --- a/x-pack/plugins/uptime/public/components/certificates/fingerprint_col.test.tsx +++ b/x-pack/plugins/uptime/public/components/certificates/fingerprint_col.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { renderWithRouter, shallowWithRouter } from '../../lib'; +import { renderWithRouter, shallowWithRouter } from '../../lib/helper/enzyme_helpers'; import { FingerprintCol } from './fingerprint_col'; import moment from 'moment'; diff --git a/x-pack/plugins/uptime/public/components/common/charts/duration_charts.test.tsx b/x-pack/plugins/uptime/public/components/common/charts/duration_charts.test.tsx index d7ae92a0e7654..72b1145a9f34e 100644 --- a/x-pack/plugins/uptime/public/components/common/charts/duration_charts.test.tsx +++ b/x-pack/plugins/uptime/public/components/common/charts/duration_charts.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import DateMath from '@elastic/datemath'; import { DurationChartComponent } from './duration_chart'; import { MonitorDurationResult } from '../../../../common/types'; -import { shallowWithRouter } from '../../../lib'; +import { shallowWithRouter } from '../../../lib/helper/enzyme_helpers'; describe('MonitorCharts component', () => { let dateMathSpy: any; diff --git a/x-pack/plugins/uptime/public/components/common/charts/monitor_bar_series.test.tsx b/x-pack/plugins/uptime/public/components/common/charts/monitor_bar_series.test.tsx index 792b357b3baba..b11595eafae4f 100644 --- a/x-pack/plugins/uptime/public/components/common/charts/monitor_bar_series.test.tsx +++ b/x-pack/plugins/uptime/public/components/common/charts/monitor_bar_series.test.tsx @@ -7,7 +7,8 @@ import React from 'react'; import { MonitorBarSeries, MonitorBarSeriesProps } from './monitor_bar_series'; -import { renderWithRouter, shallowWithRouter, MountWithReduxProvider } from '../../../lib'; +import { renderWithRouter, shallowWithRouter } from '../../../lib/helper/enzyme_helpers'; +import { MountWithReduxProvider } from '../../../lib/helper/helper_with_redux'; import { HistogramPoint } from '../../../../common/runtime_types'; describe('MonitorBarSeries component', () => { diff --git a/x-pack/plugins/uptime/public/components/common/header/page_header.test.tsx b/x-pack/plugins/uptime/public/components/common/header/page_header.test.tsx index 6e04648a817f0..bede71b8ba03d 100644 --- a/x-pack/plugins/uptime/public/components/common/header/page_header.test.tsx +++ b/x-pack/plugins/uptime/public/components/common/header/page_header.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import moment from 'moment'; import { PageHeader } from './page_header'; import { Ping } from '../../../../common/runtime_types'; -import { renderWithRouter } from '../../../lib'; +import { renderWithRouter } from '../../../lib/helper/enzyme_helpers'; import { mockReduxHooks } from '../../../lib/helper/test_helpers'; describe('PageHeader', () => { diff --git a/x-pack/plugins/uptime/public/components/common/monitor_tags.test.tsx b/x-pack/plugins/uptime/public/components/common/monitor_tags.test.tsx index fdb5498969d39..63465aefcdd43 100644 --- a/x-pack/plugins/uptime/public/components/common/monitor_tags.test.tsx +++ b/x-pack/plugins/uptime/public/components/common/monitor_tags.test.tsx @@ -10,7 +10,7 @@ import React from 'react'; import { MemoryRouter } from 'react-router-dom'; import { MonitorTags } from './monitor_tags'; import * as hooks from '../../hooks/use_url_params'; -import { renderWithRouter, shallowWithRouter } from '../../lib'; +import { renderWithRouter, shallowWithRouter } from '../../lib/helper/enzyme_helpers'; describe('MonitorTags component', () => { const summaryPing = { diff --git a/x-pack/plugins/uptime/public/components/common/uptime_date_picker.test.tsx b/x-pack/plugins/uptime/public/components/common/uptime_date_picker.test.tsx index 4bfe7de33cba5..d433e7fccd1b8 100644 --- a/x-pack/plugins/uptime/public/components/common/uptime_date_picker.test.tsx +++ b/x-pack/plugins/uptime/public/components/common/uptime_date_picker.test.tsx @@ -10,9 +10,9 @@ import { UptimeDatePicker } from './uptime_date_picker'; import { renderWithRouter, shallowWithRouter, - MountWithReduxProvider, mountWithRouterRedux, -} from '../../lib'; +} from '../../lib/helper/enzyme_helpers'; +import { MountWithReduxProvider } from '../../lib/helper/helper_with_redux'; import { UptimeStartupPluginsContextProvider } from '../../contexts'; import { startPlugins } from '../../lib/__mocks__/uptime_plugin_start_mock'; import { ClientPluginsStart } from '../../apps/plugin'; diff --git a/x-pack/plugins/uptime/public/components/monitor/ml/ml_integerations.test.tsx b/x-pack/plugins/uptime/public/components/monitor/ml/ml_integerations.test.tsx index f29be50633fab..16d96148af340 100644 --- a/x-pack/plugins/uptime/public/components/monitor/ml/ml_integerations.test.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/ml/ml_integerations.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { MLIntegrationComponent } from './ml_integeration'; -import { renderWithRouter, shallowWithRouter } from '../../../lib'; +import { renderWithRouter, shallowWithRouter } from '../../../lib/helper/enzyme_helpers'; import * as redux from 'react-redux'; import { KibanaContextProvider } from '../../../../../../../src/plugins/kibana_react/public'; import { coreMock } from 'src/core/public/mocks'; diff --git a/x-pack/plugins/uptime/public/components/monitor/ml/ml_manage_job.test.tsx b/x-pack/plugins/uptime/public/components/monitor/ml/ml_manage_job.test.tsx index 15a537a49ccf3..6bff0b61d7349 100644 --- a/x-pack/plugins/uptime/public/components/monitor/ml/ml_manage_job.test.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/ml/ml_manage_job.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { coreMock } from 'src/core/public/mocks'; import { ManageMLJobComponent } from './manage_ml_job'; import * as redux from 'react-redux'; -import { renderWithRouter, shallowWithRouter } from '../../../lib'; +import { renderWithRouter, shallowWithRouter } from '../../../lib/helper/enzyme_helpers'; import { KibanaContextProvider } from '../../../../../../../src/plugins/kibana_react/public'; const core = coreMock.createStart(); diff --git a/x-pack/plugins/uptime/public/components/monitor/monitor_charts.test.tsx b/x-pack/plugins/uptime/public/components/monitor/monitor_charts.test.tsx index 3f107581c1eea..a1be391833bc3 100644 --- a/x-pack/plugins/uptime/public/components/monitor/monitor_charts.test.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/monitor_charts.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import DateMath from '@elastic/datemath'; import { MonitorCharts } from './monitor_charts'; -import { shallowWithRouter } from '../../lib'; +import { shallowWithRouter } from '../../lib/helper/enzyme_helpers'; describe('MonitorCharts component', () => { let dateMathSpy: any; diff --git a/x-pack/plugins/uptime/public/components/monitor/monitor_title.test.tsx b/x-pack/plugins/uptime/public/components/monitor/monitor_title.test.tsx index dabc0021898eb..682be99b9b418 100644 --- a/x-pack/plugins/uptime/public/components/monitor/monitor_title.test.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/monitor_title.test.tsx @@ -10,7 +10,7 @@ import moment from 'moment'; import * as reactRouterDom from 'react-router-dom'; import { Ping } from '../../../common/runtime_types'; import { MonitorPageTitle } from './monitor_title'; -import { renderWithRouter } from '../../lib'; +import { renderWithRouter } from '../../lib/helper/enzyme_helpers'; import { mockReduxHooks } from '../../lib/helper/test_helpers'; jest.mock('react-router-dom', () => { diff --git a/x-pack/plugins/uptime/public/components/monitor/status_details/monitor_status.bar.test.tsx b/x-pack/plugins/uptime/public/components/monitor/status_details/monitor_status.bar.test.tsx index af3c47b9caf30..ba0853b5b1b60 100644 --- a/x-pack/plugins/uptime/public/components/monitor/status_details/monitor_status.bar.test.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/status_details/monitor_status.bar.test.tsx @@ -10,7 +10,7 @@ import React from 'react'; import { MonitorStatusBar } from './status_bar'; import { Ping } from '../../../../common/runtime_types'; import * as redux from 'react-redux'; -import { renderWithRouter } from '../../../lib'; +import { renderWithRouter } from '../../../lib/helper/enzyme_helpers'; import { createMemoryHistory } from 'history'; describe('MonitorStatusBar component', () => { diff --git a/x-pack/plugins/uptime/public/components/monitor/status_details/ssl_certificate.test.tsx b/x-pack/plugins/uptime/public/components/monitor/status_details/ssl_certificate.test.tsx index 03ce292e63621..0cb7ff7168404 100644 --- a/x-pack/plugins/uptime/public/components/monitor/status_details/ssl_certificate.test.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/status_details/ssl_certificate.test.tsx @@ -11,7 +11,11 @@ import { EuiIcon } from '@elastic/eui'; import { Tls } from '../../../../common/runtime_types'; import { MonitorSSLCertificate } from './status_bar'; import * as redux from 'react-redux'; -import { mountWithRouter, renderWithRouter, shallowWithRouter } from '../../../lib'; +import { + mountWithRouter, + renderWithRouter, + shallowWithRouter, +} from '../../../lib/helper/enzyme_helpers'; import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../../common/constants'; describe('SSL Certificate component', () => { diff --git a/x-pack/plugins/uptime/public/components/overview/empty_state/empty_state.test.tsx b/x-pack/plugins/uptime/public/components/overview/empty_state/empty_state.test.tsx index a617ba0db1eb3..c751e6a0c24fa 100644 --- a/x-pack/plugins/uptime/public/components/overview/empty_state/empty_state.test.tsx +++ b/x-pack/plugins/uptime/public/components/overview/empty_state/empty_state.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { EmptyStateComponent } from './empty_state'; import { StatesIndexStatus } from '../../../../common/runtime_types'; import { HttpFetchError, IHttpFetchError } from 'src/core/public'; -import { mountWithRouter, shallowWithRouter } from '../../../lib'; +import { mountWithRouter, shallowWithRouter } from '../../../lib/helper/enzyme_helpers'; describe('EmptyState component', () => { let statesIndexStatus: StatesIndexStatus; diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/columns/enable_alert.test.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/columns/enable_alert.test.tsx index a325edc243129..a4e7f10d97bfc 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/columns/enable_alert.test.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/columns/enable_alert.test.tsx @@ -12,7 +12,7 @@ import { mountWithRouterRedux, renderWithRouterRedux, shallowWithRouterRedux, -} from '../../../../lib'; +} from '../../../../lib/helper/enzyme_helpers'; import { EuiPopover, EuiText } from '@elastic/eui'; import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../../../common/constants'; import { ReactRouterEuiLink } from '../../../common/react_router_helpers'; diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/filter_status_button.test.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/filter_status_button.test.tsx index 4d0e82dc8a296..c95e3cd61c5fd 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/filter_status_button.test.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/filter_status_button.test.tsx @@ -7,7 +7,8 @@ import React from 'react'; import { FilterStatusButton, FilterStatusButtonProps } from './filter_status_button'; -import { renderWithRouter, shallowWithRouter, MountWithReduxProvider } from '../../../lib'; +import { renderWithRouter, shallowWithRouter } from '../../../lib/helper/enzyme_helpers'; +import { MountWithReduxProvider } from '../../../lib/helper/helper_with_redux'; describe('FilterStatusButton', () => { let props: FilterStatusButtonProps; diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list.test.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list.test.tsx index 39f9b20624b63..f7a2ad9a536bd 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list.test.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list.test.tsx @@ -15,7 +15,7 @@ import { MonitorSummary, } from '../../../../common/runtime_types'; import { MonitorListComponent, noItemsMessage } from './monitor_list'; -import { renderWithRouter, shallowWithRouter } from '../../../lib'; +import { renderWithRouter, shallowWithRouter } from '../../../lib/helper/enzyme_helpers'; import * as redux from 'react-redux'; import moment from 'moment'; import { IHttpFetchError } from '../../../../../../../src/core/public'; diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/monitor_list_drawer.test.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/monitor_list_drawer.test.tsx index d044ad4e6a3a2..39c6d6bd9215d 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/monitor_list_drawer.test.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/monitor_list_drawer.test.tsx @@ -9,7 +9,7 @@ import 'jest'; import React from 'react'; import { MonitorListDrawerComponent } from './monitor_list_drawer'; import { MonitorDetails, MonitorSummary, makePing } from '../../../../../common/runtime_types'; -import { shallowWithRouter } from '../../../../lib'; +import { shallowWithRouter } from '../../../../lib/helper/enzyme_helpers'; describe('MonitorListDrawer component', () => { let summary: MonitorSummary; diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/status_filter.test.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/status_filter.test.tsx index bbc4e13c9eca2..c2515ab55b126 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/status_filter.test.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/status_filter.test.tsx @@ -10,8 +10,8 @@ import { mountWithRouter, renderWithRouter, shallowWithRouter, - MountWithReduxProvider, -} from '../../../lib'; +} from '../../../lib/helper/enzyme_helpers'; +import { MountWithReduxProvider } from '../../../lib/helper/helper_with_redux'; import { createMemoryHistory } from 'history'; import { StatusFilter } from './status_filter'; import { FilterStatusButton } from './filter_status_button'; diff --git a/x-pack/plugins/uptime/public/components/settings/certificate_form.test.tsx b/x-pack/plugins/uptime/public/components/settings/certificate_form.test.tsx index 84c9923bfc419..051c4166d0fdd 100644 --- a/x-pack/plugins/uptime/public/components/settings/certificate_form.test.tsx +++ b/x-pack/plugins/uptime/public/components/settings/certificate_form.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { CertificateExpirationForm } from './certificate_form'; -import { shallowWithRouter, mountWithRouter } from '../../lib'; +import { shallowWithRouter, mountWithRouter } from '../../lib/helper/enzyme_helpers'; describe('CertificateForm', () => { it('shallow renders expected elements for valid props', () => { diff --git a/x-pack/plugins/uptime/public/components/settings/indices_form.test.tsx b/x-pack/plugins/uptime/public/components/settings/indices_form.test.tsx index 67ca142d8a8ea..fc2567ea98c45 100644 --- a/x-pack/plugins/uptime/public/components/settings/indices_form.test.tsx +++ b/x-pack/plugins/uptime/public/components/settings/indices_form.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { IndicesForm } from './indices_form'; -import { shallowWithRouter } from '../../lib'; +import { shallowWithRouter } from '../../lib/helper/enzyme_helpers'; describe('CertificateForm', () => { it('shallow renders expected elements for valid props', () => { diff --git a/x-pack/plugins/uptime/public/hooks/use_breadcrumbs.test.tsx b/x-pack/plugins/uptime/public/hooks/use_breadcrumbs.test.tsx index 6fc98fbaf1f5b..7aeac9706af58 100644 --- a/x-pack/plugins/uptime/public/hooks/use_breadcrumbs.test.tsx +++ b/x-pack/plugins/uptime/public/hooks/use_breadcrumbs.test.tsx @@ -8,10 +8,11 @@ import { ChromeBreadcrumb } from 'kibana/public'; import React from 'react'; import { Route } from 'react-router-dom'; -import { mountWithRouter } from '../lib'; +import { mountWithRouter } from '../lib/helper/enzyme_helpers'; import { OVERVIEW_ROUTE } from '../../common/constants'; import { KibanaContextProvider } from '../../../../../src/plugins/kibana_react/public'; -import { UptimeUrlParams, getSupportedUrlParams, MountWithReduxProvider } from '../lib/helper'; +import { UptimeUrlParams, getSupportedUrlParams } from '../lib/helper'; +import { MountWithReduxProvider } from '../lib/helper/helper_with_redux'; import { makeBaseBreadcrumb, useBreadcrumbs } from './use_breadcrumbs'; describe('useBreadcrumbs', () => { diff --git a/x-pack/plugins/uptime/public/hooks/use_url_params.test.tsx b/x-pack/plugins/uptime/public/hooks/use_url_params.test.tsx index 3ce112b1cb835..31580ec22d48c 100644 --- a/x-pack/plugins/uptime/public/hooks/use_url_params.test.tsx +++ b/x-pack/plugins/uptime/public/hooks/use_url_params.test.tsx @@ -9,7 +9,8 @@ import DateMath from '@elastic/datemath'; import React, { useState, Fragment } from 'react'; import { useUrlParams, UptimeUrlParamsHook } from './use_url_params'; import { UptimeRefreshContext } from '../contexts'; -import { mountWithRouter, MountWithReduxProvider } from '../lib'; +import { MountWithReduxProvider } from '../lib/helper/helper_with_redux'; +import { mountWithRouter } from '../lib/helper/enzyme_helpers'; import { createMemoryHistory } from 'history'; interface MockUrlParamsComponentProps { diff --git a/x-pack/plugins/uptime/public/lib/helper/index.ts b/x-pack/plugins/uptime/public/lib/helper/index.ts index 2fce3cc0e54dc..6546b5f9ae6c4 100644 --- a/x-pack/plugins/uptime/public/lib/helper/index.ts +++ b/x-pack/plugins/uptime/public/lib/helper/index.ts @@ -10,4 +10,3 @@ export * from './observability_integration'; export { getChartDateLabel } from './charts'; export { seriesHasDownValues } from './series_has_down_values'; export { UptimeUrlParams, getSupportedUrlParams } from './url_params'; -export { MountWithReduxProvider } from './helper_with_redux'; diff --git a/x-pack/plugins/uptime/public/lib/index.ts b/x-pack/plugins/uptime/public/lib/index.ts deleted file mode 100644 index 9added9af6592..0000000000000 --- a/x-pack/plugins/uptime/public/lib/index.ts +++ /dev/null @@ -1,9 +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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export { MountWithReduxProvider } from './helper'; -export * from './helper/enzyme_helpers'; diff --git a/x-pack/plugins/uptime/public/pages/certificates.test.tsx b/x-pack/plugins/uptime/public/pages/certificates.test.tsx index ff5f1afcaa290..1218a1882b3bf 100644 --- a/x-pack/plugins/uptime/public/pages/certificates.test.tsx +++ b/x-pack/plugins/uptime/public/pages/certificates.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { shallowWithRouter } from '../lib'; +import { shallowWithRouter } from '../lib/helper/enzyme_helpers'; import { CertificatesPage } from './certificates'; describe('CertificatesPage', () => { diff --git a/x-pack/plugins/uptime/public/pages/monitor.test.tsx b/x-pack/plugins/uptime/public/pages/monitor.test.tsx index 80fcfcc271964..2664f73d26075 100644 --- a/x-pack/plugins/uptime/public/pages/monitor.test.tsx +++ b/x-pack/plugins/uptime/public/pages/monitor.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { MonitorPage } from './monitor'; -import { shallowWithRouter } from '../lib'; +import { shallowWithRouter } from '../lib/helper/enzyme_helpers'; describe('MonitorPage', () => { it('shallow renders expected elements for valid props', () => { diff --git a/x-pack/plugins/uptime/public/pages/not_found.test.tsx b/x-pack/plugins/uptime/public/pages/not_found.test.tsx index 8d5b20e45303d..cc9ea1a62cd0f 100644 --- a/x-pack/plugins/uptime/public/pages/not_found.test.tsx +++ b/x-pack/plugins/uptime/public/pages/not_found.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { shallowWithRouter } from '../lib'; +import { shallowWithRouter } from '../lib/helper/enzyme_helpers'; import { NotFoundPage } from './not_found'; describe('NotFoundPage', () => { diff --git a/x-pack/plugins/uptime/public/pages/overview.test.tsx b/x-pack/plugins/uptime/public/pages/overview.test.tsx index cfc140e6b22a3..b4949a84a6e36 100644 --- a/x-pack/plugins/uptime/public/pages/overview.test.tsx +++ b/x-pack/plugins/uptime/public/pages/overview.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { OverviewPageComponent } from './overview'; -import { shallowWithRouter } from '../lib'; +import { shallowWithRouter } from '../lib/helper/enzyme_helpers'; describe('MonitorPage', () => { const indexPattern = { diff --git a/x-pack/plugins/uptime/tsconfig.json b/x-pack/plugins/uptime/tsconfig.json index 531ee2ecd8d2b..0b98204001753 100644 --- a/x-pack/plugins/uptime/tsconfig.json +++ b/x-pack/plugins/uptime/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", @@ -12,7 +12,6 @@ "public/**/*", "public/components/monitor/status_details/location_map/embeddables/low_poly_layer.json", "server/**/*", - "server/lib/requests/__fixtures__/monitor_charts_mock.json", "../../../typings/**/*" ], "references": [ diff --git a/x-pack/plugins/watcher/tsconfig.json b/x-pack/plugins/watcher/tsconfig.json index e8dabe8cd40a9..41bcb015d2d94 100644 --- a/x-pack/plugins/watcher/tsconfig.json +++ b/x-pack/plugins/watcher/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types", diff --git a/x-pack/plugins/xpack_legacy/tsconfig.json b/x-pack/plugins/xpack_legacy/tsconfig.json index 3bfc78b72cb3e..fdac21a391313 100644 --- a/x-pack/plugins/xpack_legacy/tsconfig.json +++ b/x-pack/plugins/xpack_legacy/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.base.json", + "extends": "../../../tsconfig.project.json", "compilerOptions": { "composite": true, "outDir": "./target/types",