From 06effae42be432beb9d2cd6bdad3dfda7a0551f5 Mon Sep 17 00:00:00 2001 From: restrry Date: Thu, 2 Sep 2021 10:15:38 +0200 Subject: [PATCH] do not export all the types from licensing plugin --- x-pack/plugins/licensing/public/index.ts | 18 ++++++++++---- x-pack/plugins/licensing/server/index.ts | 31 ++++++++++++++++++------ x-pack/plugins/licensing/tsconfig.json | 3 ++- 3 files changed, 39 insertions(+), 13 deletions(-) diff --git a/x-pack/plugins/licensing/public/index.ts b/x-pack/plugins/licensing/public/index.ts index 1b7ff40d0f14a..ec1c0aa1538cd 100644 --- a/x-pack/plugins/licensing/public/index.ts +++ b/x-pack/plugins/licensing/public/index.ts @@ -5,12 +5,20 @@ * 2.0. */ -// TODO: https://github.com/elastic/kibana/issues/110902 -/* eslint-disable @kbn/eslint/no_export_all */ +import type { PluginInitializerContext } from 'src/core/public'; -import { PluginInitializerContext } from 'src/core/public'; import { LicensingPlugin } from './plugin'; -export * from '../common/types'; -export { LicensingPluginSetup, LicensingPluginStart } from './types'; +export type { + LicenseCheckState, + LicenseType, + LicenseStatus, + LicenseFeature, + PublicLicense, + PublicFeatures, + PublicLicenseJSON, + LicenseCheck, + ILicense, +} from '../common/types'; +export type { LicensingPluginSetup, LicensingPluginStart } from './types'; export const plugin = (context: PluginInitializerContext) => new LicensingPlugin(context); diff --git a/x-pack/plugins/licensing/server/index.ts b/x-pack/plugins/licensing/server/index.ts index 64933d0820cf3..e242719cac2fb 100644 --- a/x-pack/plugins/licensing/server/index.ts +++ b/x-pack/plugins/licensing/server/index.ts @@ -5,16 +5,33 @@ * 2.0. */ -// TODO: https://github.com/elastic/kibana/issues/110902 -/* eslint-disable @kbn/eslint/no_export_all */ - import { PluginInitializerContext } from 'src/core/server'; import { LicensingPlugin } from './plugin'; export const plugin = (context: PluginInitializerContext) => new LicensingPlugin(context); -export * from '../common/types'; -export { FeatureUsageServiceSetup, FeatureUsageServiceStart } from './services'; -export * from './types'; +export type { + LicenseCheckState, + LicenseType, + LicenseStatus, + LicenseFeature, + PublicLicense, + PublicFeatures, + PublicLicenseJSON, + LicenseCheck, + ILicense, +} from '../common/types'; + +export type { FeatureUsageServiceSetup, FeatureUsageServiceStart } from './services'; + +export type { + ElasticsearchError, + LicensingApiRequestHandlerContext, + LicensingPluginSetup, + LicensingPluginStart, +} from './types'; + export { config } from './licensing_config'; -export { CheckLicense, wrapRouteWithLicenseCheck } from './wrap_route_with_license_check'; + +export type { CheckLicense } from './wrap_route_with_license_check'; +export { wrapRouteWithLicenseCheck } from './wrap_route_with_license_check'; diff --git a/x-pack/plugins/licensing/tsconfig.json b/x-pack/plugins/licensing/tsconfig.json index d8855fcd65912..355d99fa461b8 100644 --- a/x-pack/plugins/licensing/tsconfig.json +++ b/x-pack/plugins/licensing/tsconfig.json @@ -4,7 +4,8 @@ "outDir": "./target/types", "emitDeclarationOnly": true, "declaration": true, - "declarationMap": true + "declarationMap": true, + "isolatedModules": true, }, "include": [ "public/**/*",