Skip to content

Commit

Permalink
removes public version of internal contract and removes contract type
Browse files Browse the repository at this point in the history
  • Loading branch information
TinaHeiligers committed Jul 9, 2022
1 parent 386b75f commit 8016e44
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 54 deletions.
19 changes: 10 additions & 9 deletions packages/core/preboot/core-preboot-server-internal/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 3 additions & 1 deletion packages/core/preboot/core-preboot-server-mocks/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
Expand Down
1 change: 0 additions & 1 deletion packages/core/preboot/core-preboot-server/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
38 changes: 0 additions & 38 deletions packages/core/preboot/core-preboot-server/src/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -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<PrebootServicePreboot, 'holdSetupUntilResolved'> {
/**
* 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;
}
6 changes: 1 addition & 5 deletions packages/core/preboot/core-preboot-server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,4 @@
* Side Public License, v 1.
*/

export type {
PrebootServicePreboot,
KibanaPrebootServicePreboot,
KibanaPrebootServiceContract,
} from './contracts';
export type { PrebootServicePreboot } from './contracts';

0 comments on commit 8016e44

Please sign in to comment.