From 8016e44a0b88eac37d2c65c30d726af2b5a28ecb Mon Sep 17 00:00:00 2001 From: Christiane Heiligers Date: Sat, 9 Jul 2022 15:07:13 -0700 Subject: [PATCH] removes public version of internal contract and removes contract type --- .../core-preboot-server-internal/BUILD.bazel | 19 +++++----- .../core-preboot-server-mocks/BUILD.bazel | 4 +- .../preboot/core-preboot-server/BUILD.bazel | 1 - .../core-preboot-server/src/contracts.ts | 38 ------------------- .../preboot/core-preboot-server/src/index.ts | 6 +-- 5 files changed, 14 insertions(+), 54 deletions(-) diff --git a/packages/core/preboot/core-preboot-server-internal/BUILD.bazel b/packages/core/preboot/core-preboot-server-internal/BUILD.bazel index 04d99ac806ddc..4afb072e6387b 100644 --- a/packages/core/preboot/core-preboot-server-internal/BUILD.bazel +++ b/packages/core/preboot/core-preboot-server-internal/BUILD.bazel @@ -27,24 +27,25 @@ NPM_MODULE_EXTRA_FILES = [ ] RUNTIME_DEPS = [ - "//packages/core/logging/core-logging-server-mocks", + "//packages/kbn-logging", + "//packages/core/base/core-base-server-internal", "//packages/core/base/core-base-common", - "//packages/kbn-config-mocks", + "//packages/kbn-utils", "//packages/kbn-config", - "//packages/kbn-logging", - "//packages/kbn-utils" + "//packages/kbn-config-mocks", + "//packages/core/logging/core-logging-server-mocks", ] TYPES_DEPS = [ "@npm//@types/node", "@npm//@types/jest", - "//packages/core/logging/core-logging-server-mocks:npm_module_types", - "//packages/core/base/core-base-common:npm_module_types", - "//packages/kbn-config-mocks:npm_module_types", - "//packages/kbn-config:npm_module_types", "//packages/kbn-logging:npm_module_types", + "//packages/core/base/core-base-server-internal:npm_module_types", + "//packages/core/base/core-base-common:npm_module_types", "//packages/kbn-utils:npm_module_types", - "//packages/core/preboot/core-preboot-server:npm_module_types" + "//packages/kbn-config:npm_module_types", + "//packages/kbn-config-mocks:npm_module_types", + "//packages/core/logging/core-logging-server-mocks:npm_module_types", ] jsts_transpiler( diff --git a/packages/core/preboot/core-preboot-server-mocks/BUILD.bazel b/packages/core/preboot/core-preboot-server-mocks/BUILD.bazel index a8d4c3521e8c8..572a8f80d6012 100644 --- a/packages/core/preboot/core-preboot-server-mocks/BUILD.bazel +++ b/packages/core/preboot/core-preboot-server-mocks/BUILD.bazel @@ -27,12 +27,14 @@ NPM_MODULE_EXTRA_FILES = [ ] RUNTIME_DEPS = [ - "//packages/core/preboot/core-preboot-server-internal" + "//packages/kbn-utility-types", + "//packages/core/preboot/core-preboot-server-internal", ] TYPES_DEPS = [ "@npm//@types/node", "@npm//@types/jest", + "//packages/kbn-utility-types:npm_module_types", "//packages/core/preboot/core-preboot-server-internal:npm_module_types", "//packages/core/preboot/core-preboot-server:npm_module_types" ] diff --git a/packages/core/preboot/core-preboot-server/BUILD.bazel b/packages/core/preboot/core-preboot-server/BUILD.bazel index 178d866c86ab0..e568ca5ab8a3b 100644 --- a/packages/core/preboot/core-preboot-server/BUILD.bazel +++ b/packages/core/preboot/core-preboot-server/BUILD.bazel @@ -32,7 +32,6 @@ RUNTIME_DEPS = [ TYPES_DEPS = [ "@npm//@types/node", "@npm//@types/jest", - "//packages/core/base/core-base-common:npm_module_types", ] jsts_transpiler( diff --git a/packages/core/preboot/core-preboot-server/src/contracts.ts b/packages/core/preboot/core-preboot-server/src/contracts.ts index 24bdc6bcb47df..b76298e4d3e98 100644 --- a/packages/core/preboot/core-preboot-server/src/contracts.ts +++ b/packages/core/preboot/core-preboot-server/src/contracts.ts @@ -5,7 +5,6 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -import type { PluginName } from '@kbn/core-base-common'; /** * Kibana Preboot Service allows to control the boot flow of Kibana. Preboot plugins can use it to hold the boot until certain condition is met. * @@ -50,40 +49,3 @@ export interface PrebootServicePreboot { promise: Promise<{ shouldReloadConfig: boolean } | undefined> ) => void; } - -/** - * public version of InternalPrebootServicePreboot that is exposed in the public service contract - * @public - */ -export interface KibanaPrebootServicePreboot - extends Omit { - /** - * Registers a `Promise` as a precondition before Kibana can proceed to `setup`. This method can be invoked multiple - * times and from multiple `preboot` plugins. Kibana will proceed to `setup` only when all registered `Promise` are - * resolved, or it will shut down if any of them are rejected. - * @param pluginName Name of the plugin that needs to hold `setup`. - * @param reason A string that explains the reason why this promise should hold `setup`. It's supposed to be a human - * readable string that will be recorded in the logs or standard output. - * @param promise A `Promise` that should resolved before Kibana can proceed to `setup`. - */ - readonly holdSetupUntilResolved: ( - pluginName: PluginName, - reason: string, - promise: Promise<{ shouldReloadConfig: boolean } | undefined> - ) => void; - /** - * Returns a `Promise` that is resolved only when all `Promise` instances registered with {@link holdSetupUntilResolved} - * are resolved, or rejected if any of them are rejected. If the supplied `Promise` resolves to an object with the - * `shouldReloadConfig` property set to `true`, it indicates that Kibana configuration might have changed and Kibana - * needs to reload it from the disk. - */ - readonly waitUntilCanSetup: () => Promise<{ shouldReloadConfig: boolean }>; -} - -/** - * @public - */ -export interface KibanaPrebootServiceContract { - preboot: () => KibanaPrebootServicePreboot; - stop: () => void; -} diff --git a/packages/core/preboot/core-preboot-server/src/index.ts b/packages/core/preboot/core-preboot-server/src/index.ts index 01f0dc952562a..eb8e763e53b14 100644 --- a/packages/core/preboot/core-preboot-server/src/index.ts +++ b/packages/core/preboot/core-preboot-server/src/index.ts @@ -6,8 +6,4 @@ * Side Public License, v 1. */ -export type { - PrebootServicePreboot, - KibanaPrebootServicePreboot, - KibanaPrebootServiceContract, -} from './contracts'; +export type { PrebootServicePreboot } from './contracts';