From 4f8f403bd3b70fc482931c5276dc4b6850c9567e Mon Sep 17 00:00:00 2001 From: Christiane Heiligers Date: Mon, 8 Feb 2021 16:38:16 -0700 Subject: [PATCH 1/4] Converts rollup to a TS project ref --- x-pack/plugins/rollup/tsconfig.json | 35 +++++++++++++++++++++++++++++ x-pack/test/tsconfig.json | 3 ++- x-pack/tsconfig.json | 4 +++- x-pack/tsconfig.refs.json | 3 ++- 4 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 x-pack/plugins/rollup/tsconfig.json diff --git a/x-pack/plugins/rollup/tsconfig.json b/x-pack/plugins/rollup/tsconfig.json new file mode 100644 index 0000000000000..9b994d1710ffc --- /dev/null +++ b/x-pack/plugins/rollup/tsconfig.json @@ -0,0 +1,35 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "composite": true, + "outDir": "./target/types", + "emitDeclarationOnly": true, + "declaration": true, + "declarationMap": true + }, + "include": [ + "common/**/*", + "fixtures/**/*", + "public/**/*", + "server/**/*", + ], + "references": [ + { "path": "../../../src/core/tsconfig.json" }, + // required plugins + { "path": "../../../src/plugins/index_pattern_management/tsconfig.json" }, + { "path": "../../../src/plugins/management/tsconfig.json" }, + { "path": "../licensing/tsconfig.json" }, + { "path": "../features/tsconfig.json" }, + // optional plugins + { "path": "../../../src/plugins/home/tsconfig.json" }, + { "path": "../index_management/tsconfig.json" }, + { "path": "../../../src/plugins/usage_collection/tsconfig.json" }, + { "path": "../../../src/plugins/vis_type_timeseries/tsconfig.json" }, + // required bundles + { "path": "../../../src/plugins/kibana_utils/tsconfig.json" }, + { "path": "../../../src/plugins/kibana_react/tsconfig.json" }, + { "path": "../../../src/plugins/es_ui_shared/tsconfig.json" }, + { "path": "../../../src/plugins/data/tsconfig.json" }, + + ] +} diff --git a/x-pack/test/tsconfig.json b/x-pack/test/tsconfig.json index 0a7a30f373e07..4ebdb591908d5 100644 --- a/x-pack/test/tsconfig.json +++ b/x-pack/test/tsconfig.json @@ -76,6 +76,7 @@ { "path": "../plugins/triggers_actions_ui/tsconfig.json" }, { "path": "../plugins/ui_actions_enhanced/tsconfig.json" }, { "path": "../plugins/upgrade_assistant/tsconfig.json" }, - { "path": "../plugins/watcher/tsconfig.json" } + { "path": "../plugins/watcher/tsconfig.json" }, + { "path": "../plugins/rollup/tsconfig.json" } ] } diff --git a/x-pack/tsconfig.json b/x-pack/tsconfig.json index 5d51c2923abd0..fbcc46512a5bf 100644 --- a/x-pack/tsconfig.json +++ b/x-pack/tsconfig.json @@ -56,6 +56,7 @@ "plugins/index_management/**/*", "plugins/grokdebugger/**/*", "plugins/upgrade_assistant/**/*", + "plugins/rollup/**/*", "test/**/*" ], "compilerOptions": { @@ -145,6 +146,7 @@ { "path": "./plugins/upgrade_assistant/tsconfig.json" }, { "path": "./plugins/runtime_fields/tsconfig.json" }, { "path": "./plugins/index_management/tsconfig.json" }, - { "path": "./plugins/watcher/tsconfig.json" } + { "path": "./plugins/watcher/tsconfig.json" }, + { "path": "./plugins/rollup/tsconfig.json" } ] } diff --git a/x-pack/tsconfig.refs.json b/x-pack/tsconfig.refs.json index ae88ab6486e64..86edd01bb3955 100644 --- a/x-pack/tsconfig.refs.json +++ b/x-pack/tsconfig.refs.json @@ -50,6 +50,7 @@ { "path": "./plugins/upgrade_assistant/tsconfig.json" }, { "path": "./plugins/runtime_fields/tsconfig.json" }, { "path": "./plugins/index_management/tsconfig.json" }, - { "path": "./plugins/watcher/tsconfig.json" } + { "path": "./plugins/watcher/tsconfig.json" }, + { "path": "./plugins/rollup/tsconfig.json"} ] } From 0a157bebaa786c67928e4410750f1d6613d80586 Mon Sep 17 00:00:00 2001 From: Christiane Heiligers Date: Mon, 8 Feb 2021 16:54:03 -0700 Subject: [PATCH 2/4] Converts remoteClusters to a TS project ref --- .../server/routes/api/add_route.test.ts | 15 +++++++++- .../server/routes/api/delete_route.test.ts | 15 +++++++++- .../server/routes/api/get_route.test.ts | 15 +++++++++- .../server/routes/api/update_route.test.ts | 15 +++++++++- x-pack/plugins/remote_clusters/tsconfig.json | 30 +++++++++++++++++++ x-pack/test/tsconfig.json | 3 +- x-pack/tsconfig.json | 4 ++- x-pack/tsconfig.refs.json | 3 +- 8 files changed, 93 insertions(+), 7 deletions(-) create mode 100644 x-pack/plugins/remote_clusters/tsconfig.json diff --git a/x-pack/plugins/remote_clusters/server/routes/api/add_route.test.ts b/x-pack/plugins/remote_clusters/server/routes/api/add_route.test.ts index 066a2d56cbeec..9348fd1eb20df 100644 --- a/x-pack/plugins/remote_clusters/server/routes/api/add_route.test.ts +++ b/x-pack/plugins/remote_clusters/server/routes/api/add_route.test.ts @@ -10,13 +10,26 @@ import { register } from './add_route'; import { API_BASE_PATH } from '../../../common/constants'; import { LicenseStatus } from '../../types'; -import { xpackMocks } from '../../../../../mocks'; +import { licensingMock } from '../../../../../plugins/licensing/server/mocks'; + import { elasticsearchServiceMock, httpServerMock, httpServiceMock, + coreMock, } from '../../../../../../src/core/server/mocks'; +// Re-implement the mock that was imported directly from `x-pack/mocks` +function createCoreRequestHandlerContextMock() { + return { + core: coreMock.createRequestHandlerContext(), + licensing: licensingMock.createRequestHandlerContext(), + }; +} + +const xpackMocks = { + createRequestHandlerContext: createCoreRequestHandlerContextMock, +}; interface TestOptions { licenseCheckResult?: LicenseStatus; apiResponses?: Array<() => Promise>; diff --git a/x-pack/plugins/remote_clusters/server/routes/api/delete_route.test.ts b/x-pack/plugins/remote_clusters/server/routes/api/delete_route.test.ts index 29d846314bd9b..ce94f45bb8443 100644 --- a/x-pack/plugins/remote_clusters/server/routes/api/delete_route.test.ts +++ b/x-pack/plugins/remote_clusters/server/routes/api/delete_route.test.ts @@ -10,13 +10,26 @@ import { register } from './delete_route'; import { API_BASE_PATH } from '../../../common/constants'; import { LicenseStatus } from '../../types'; -import { xpackMocks } from '../../../../../mocks'; +import { licensingMock } from '../../../../../plugins/licensing/server/mocks'; + import { elasticsearchServiceMock, httpServerMock, httpServiceMock, + coreMock, } from '../../../../../../src/core/server/mocks'; +// Re-implement the mock that was imported directly from `x-pack/mocks` +function createCoreRequestHandlerContextMock() { + return { + core: coreMock.createRequestHandlerContext(), + licensing: licensingMock.createRequestHandlerContext(), + }; +} + +const xpackMocks = { + createRequestHandlerContext: createCoreRequestHandlerContextMock, +}; interface TestOptions { licenseCheckResult?: LicenseStatus; apiResponses?: Array<() => Promise>; diff --git a/x-pack/plugins/remote_clusters/server/routes/api/get_route.test.ts b/x-pack/plugins/remote_clusters/server/routes/api/get_route.test.ts index 33a3142ddc105..25d17d796b0ee 100644 --- a/x-pack/plugins/remote_clusters/server/routes/api/get_route.test.ts +++ b/x-pack/plugins/remote_clusters/server/routes/api/get_route.test.ts @@ -12,13 +12,26 @@ import { register } from './get_route'; import { API_BASE_PATH } from '../../../common/constants'; import { LicenseStatus } from '../../types'; -import { xpackMocks } from '../../../../../mocks'; +import { licensingMock } from '../../../../../plugins/licensing/server/mocks'; + import { elasticsearchServiceMock, httpServerMock, httpServiceMock, + coreMock, } from '../../../../../../src/core/server/mocks'; +// Re-implement the mock that was imported directly from `x-pack/mocks` +function createCoreRequestHandlerContextMock() { + return { + core: coreMock.createRequestHandlerContext(), + licensing: licensingMock.createRequestHandlerContext(), + }; +} + +const xpackMocks = { + createRequestHandlerContext: createCoreRequestHandlerContextMock, +}; interface TestOptions { licenseCheckResult?: LicenseStatus; apiResponses?: Array<() => Promise>; diff --git a/x-pack/plugins/remote_clusters/server/routes/api/update_route.test.ts b/x-pack/plugins/remote_clusters/server/routes/api/update_route.test.ts index 31db362f7c953..22c87786a585c 100644 --- a/x-pack/plugins/remote_clusters/server/routes/api/update_route.test.ts +++ b/x-pack/plugins/remote_clusters/server/routes/api/update_route.test.ts @@ -10,13 +10,26 @@ import { register } from './update_route'; import { API_BASE_PATH } from '../../../common/constants'; import { LicenseStatus } from '../../types'; -import { xpackMocks } from '../../../../../mocks'; +import { licensingMock } from '../../../../../plugins/licensing/server/mocks'; + import { elasticsearchServiceMock, httpServerMock, httpServiceMock, + coreMock, } from '../../../../../../src/core/server/mocks'; +// Re-implement the mock that was imported directly from `x-pack/mocks` +function createCoreRequestHandlerContextMock() { + return { + core: coreMock.createRequestHandlerContext(), + licensing: licensingMock.createRequestHandlerContext(), + }; +} + +const xpackMocks = { + createRequestHandlerContext: createCoreRequestHandlerContextMock, +}; interface TestOptions { licenseCheckResult?: LicenseStatus; apiResponses?: Array<() => Promise>; diff --git a/x-pack/plugins/remote_clusters/tsconfig.json b/x-pack/plugins/remote_clusters/tsconfig.json new file mode 100644 index 0000000000000..0bee6300cf0b2 --- /dev/null +++ b/x-pack/plugins/remote_clusters/tsconfig.json @@ -0,0 +1,30 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "composite": true, + "outDir": "./target/types", + "emitDeclarationOnly": true, + "declaration": true, + "declarationMap": true + }, + "include": [ + "common/**/*", + "fixtures/**/*", + "public/**/*", + "server/**/*", + ], + "references": [ + { "path": "../../../src/core/tsconfig.json" }, + // required plugins + { "path": "../licensing/tsconfig.json" }, + { "path": "../../../src/plugins/management/tsconfig.json" }, + { "path": "../index_management/tsconfig.json" }, + { "path": "../features/tsconfig.json" }, + // optional plugins + { "path": "../../../src/plugins/usage_collection/tsconfig.json" }, + { "path": "../cloud/tsconfig.json" }, + // required bundles + { "path": "../../../src/plugins/kibana_react/tsconfig.json" }, + { "path": "../../../src/plugins/es_ui_shared/tsconfig.json" }, + ] +} diff --git a/x-pack/test/tsconfig.json b/x-pack/test/tsconfig.json index 4ebdb591908d5..a1ba112e0eab7 100644 --- a/x-pack/test/tsconfig.json +++ b/x-pack/test/tsconfig.json @@ -77,6 +77,7 @@ { "path": "../plugins/ui_actions_enhanced/tsconfig.json" }, { "path": "../plugins/upgrade_assistant/tsconfig.json" }, { "path": "../plugins/watcher/tsconfig.json" }, - { "path": "../plugins/rollup/tsconfig.json" } + { "path": "../plugins/rollup/tsconfig.json" }, + { "path": "../plugins/remote_clusters/tsconfig.json" } ] } diff --git a/x-pack/tsconfig.json b/x-pack/tsconfig.json index fbcc46512a5bf..49a5223f7867a 100644 --- a/x-pack/tsconfig.json +++ b/x-pack/tsconfig.json @@ -57,6 +57,7 @@ "plugins/grokdebugger/**/*", "plugins/upgrade_assistant/**/*", "plugins/rollup/**/*", + "plugins/remote_clusters/**/*", "test/**/*" ], "compilerOptions": { @@ -147,6 +148,7 @@ { "path": "./plugins/runtime_fields/tsconfig.json" }, { "path": "./plugins/index_management/tsconfig.json" }, { "path": "./plugins/watcher/tsconfig.json" }, - { "path": "./plugins/rollup/tsconfig.json" } + { "path": "./plugins/rollup/tsconfig.json" }, + { "path": "./plugins/remote_clusters/tsconfig.json" } ] } diff --git a/x-pack/tsconfig.refs.json b/x-pack/tsconfig.refs.json index 86edd01bb3955..1848efa645fef 100644 --- a/x-pack/tsconfig.refs.json +++ b/x-pack/tsconfig.refs.json @@ -51,6 +51,7 @@ { "path": "./plugins/runtime_fields/tsconfig.json" }, { "path": "./plugins/index_management/tsconfig.json" }, { "path": "./plugins/watcher/tsconfig.json" }, - { "path": "./plugins/rollup/tsconfig.json"} + { "path": "./plugins/rollup/tsconfig.json"}, + { "path": "./plugins/remote_clusters/tsconfig.json"} ] } From b01fa280f0c0da3ce148543d6871f7dd82b7ada8 Mon Sep 17 00:00:00 2001 From: Christiane Heiligers Date: Mon, 8 Feb 2021 16:59:50 -0700 Subject: [PATCH 3/4] Converts crossClusterReplication to a TS project ref --- .../cross_cluster_replication/tsconfig.json | 31 +++++++++++++++++++ x-pack/test/tsconfig.json | 3 +- x-pack/tsconfig.json | 4 ++- x-pack/tsconfig.refs.json | 3 +- 4 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 x-pack/plugins/cross_cluster_replication/tsconfig.json diff --git a/x-pack/plugins/cross_cluster_replication/tsconfig.json b/x-pack/plugins/cross_cluster_replication/tsconfig.json new file mode 100644 index 0000000000000..9c7590b9c2553 --- /dev/null +++ b/x-pack/plugins/cross_cluster_replication/tsconfig.json @@ -0,0 +1,31 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "composite": true, + "outDir": "./target/types", + "emitDeclarationOnly": true, + "declaration": true, + "declarationMap": true + }, + "include": [ + "common/**/*", + "public/**/*", + "server/**/*", + ], + "references": [ + { "path": "../../../src/core/tsconfig.json" }, + // required plugins + { "path": "../../../src/plugins/home/tsconfig.json" }, + { "path": "../licensing/tsconfig.json" }, + { "path": "../../../src/plugins/management/tsconfig.json" }, + { "path": "../remote_clusters/tsconfig.json" }, + { "path": "../index_management/tsconfig.json" }, + { "path": "../features/tsconfig.json" }, + // optional plugins + { "path": "../../../src/plugins/usage_collection/tsconfig.json" }, + // required bundles + { "path": "../../../src/plugins/kibana_react/tsconfig.json" }, + { "path": "../../../src/plugins/es_ui_shared/tsconfig.json" }, + { "path": "../../../src/plugins/data/tsconfig.json" }, + ] +} diff --git a/x-pack/test/tsconfig.json b/x-pack/test/tsconfig.json index a1ba112e0eab7..2384877f09efe 100644 --- a/x-pack/test/tsconfig.json +++ b/x-pack/test/tsconfig.json @@ -78,6 +78,7 @@ { "path": "../plugins/upgrade_assistant/tsconfig.json" }, { "path": "../plugins/watcher/tsconfig.json" }, { "path": "../plugins/rollup/tsconfig.json" }, - { "path": "../plugins/remote_clusters/tsconfig.json" } + { "path": "../plugins/remote_clusters/tsconfig.json" }, + { "path": "../plugins/cross_cluster_replication/tsconfig.json" } ] } diff --git a/x-pack/tsconfig.json b/x-pack/tsconfig.json index 49a5223f7867a..a8e1471555dde 100644 --- a/x-pack/tsconfig.json +++ b/x-pack/tsconfig.json @@ -58,6 +58,7 @@ "plugins/upgrade_assistant/**/*", "plugins/rollup/**/*", "plugins/remote_clusters/**/*", + "plugins/cross_cluster_replication/**/*", "test/**/*" ], "compilerOptions": { @@ -149,6 +150,7 @@ { "path": "./plugins/index_management/tsconfig.json" }, { "path": "./plugins/watcher/tsconfig.json" }, { "path": "./plugins/rollup/tsconfig.json" }, - { "path": "./plugins/remote_clusters/tsconfig.json" } + { "path": "./plugins/remote_clusters/tsconfig.json" }, + { "path": "./plugins/cross_cluster_replication/tsconfig.json"} ] } diff --git a/x-pack/tsconfig.refs.json b/x-pack/tsconfig.refs.json index 1848efa645fef..d5dfd04710f3c 100644 --- a/x-pack/tsconfig.refs.json +++ b/x-pack/tsconfig.refs.json @@ -52,6 +52,7 @@ { "path": "./plugins/index_management/tsconfig.json" }, { "path": "./plugins/watcher/tsconfig.json" }, { "path": "./plugins/rollup/tsconfig.json"}, - { "path": "./plugins/remote_clusters/tsconfig.json"} + { "path": "./plugins/remote_clusters/tsconfig.json"}, + { "path": "./plugins/cross_cluster_replication/tsconfig.json"} ] } From 7bbd188bd1ee6d21e35d5e22eeaeb5e6f1014a6f Mon Sep 17 00:00:00 2001 From: Christiane Heiligers Date: Mon, 8 Feb 2021 17:08:38 -0700 Subject: [PATCH 4/4] Converts indexLifecycleManagement to a TS project ref --- .../index_lifecycle_management/tsconfig.json | 32 +++++++++++++++++++ x-pack/test/tsconfig.json | 3 +- x-pack/tsconfig.json | 4 ++- x-pack/tsconfig.refs.json | 3 +- 4 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 x-pack/plugins/index_lifecycle_management/tsconfig.json diff --git a/x-pack/plugins/index_lifecycle_management/tsconfig.json b/x-pack/plugins/index_lifecycle_management/tsconfig.json new file mode 100644 index 0000000000000..73dcc62132cbf --- /dev/null +++ b/x-pack/plugins/index_lifecycle_management/tsconfig.json @@ -0,0 +1,32 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "composite": true, + "outDir": "./target/types", + "emitDeclarationOnly": true, + "declaration": true, + "declarationMap": true + }, + "include": [ + "__jest__/**/*", + "common/**/*", + "public/**/*", + "server/**/*", + "../../typings/**/*", + ], + "references": [ + { "path": "../../../src/core/tsconfig.json" }, + // required plugins + { "path": "../licensing/tsconfig.json" }, + { "path": "../../../src/plugins/management/tsconfig.json" }, + { "path": "../features/tsconfig.json" }, + { "path": "../../../src/plugins/share/tsconfig.json" }, + // optional plugins + { "path": "../cloud/tsconfig.json" }, + { "path": "../../../src/plugins/usage_collection/tsconfig.json" }, + { "path": "../index_management/tsconfig.json" }, + { "path": "../../../src/plugins/home/tsconfig.json" }, + // required bundles + { "path": "../../../src/plugins/kibana_react/tsconfig.json" }, + ] +} diff --git a/x-pack/test/tsconfig.json b/x-pack/test/tsconfig.json index 2384877f09efe..1f6a5744161a3 100644 --- a/x-pack/test/tsconfig.json +++ b/x-pack/test/tsconfig.json @@ -79,6 +79,7 @@ { "path": "../plugins/watcher/tsconfig.json" }, { "path": "../plugins/rollup/tsconfig.json" }, { "path": "../plugins/remote_clusters/tsconfig.json" }, - { "path": "../plugins/cross_cluster_replication/tsconfig.json" } + { "path": "../plugins/cross_cluster_replication/tsconfig.json" }, + { "path": "../plugins/index_lifecycle_management/tsconfig.json"} ] } diff --git a/x-pack/tsconfig.json b/x-pack/tsconfig.json index a8e1471555dde..bed426f5b53f1 100644 --- a/x-pack/tsconfig.json +++ b/x-pack/tsconfig.json @@ -59,6 +59,7 @@ "plugins/rollup/**/*", "plugins/remote_clusters/**/*", "plugins/cross_cluster_replication/**/*", + "plugins/index_lifecycle_management/**/*", "test/**/*" ], "compilerOptions": { @@ -151,6 +152,7 @@ { "path": "./plugins/watcher/tsconfig.json" }, { "path": "./plugins/rollup/tsconfig.json" }, { "path": "./plugins/remote_clusters/tsconfig.json" }, - { "path": "./plugins/cross_cluster_replication/tsconfig.json"} + { "path": "./plugins/cross_cluster_replication/tsconfig.json"}, + { "path": "./plugins/index_lifecycle_management/tsconfig.json"} ] } diff --git a/x-pack/tsconfig.refs.json b/x-pack/tsconfig.refs.json index d5dfd04710f3c..d344ce10fd618 100644 --- a/x-pack/tsconfig.refs.json +++ b/x-pack/tsconfig.refs.json @@ -53,6 +53,7 @@ { "path": "./plugins/watcher/tsconfig.json" }, { "path": "./plugins/rollup/tsconfig.json"}, { "path": "./plugins/remote_clusters/tsconfig.json"}, - { "path": "./plugins/cross_cluster_replication/tsconfig.json"} + { "path": "./plugins/cross_cluster_replication/tsconfig.json"}, + { "path": "./plugins/index_lifecycle_management/tsconfig.json"} ] }