From 54cea57bbbe8c517d3823e0dcbde875e06044eab Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Thu, 2 Sep 2021 11:53:03 -0400 Subject: [PATCH] do not export all the types from licensing plugin (#110942) (#110963) * do not export all the types from licensing plugin * another export issue Co-authored-by: Mikhail Shustov --- x-pack/plugins/licensing/public/index.ts | 18 +++++++--- .../licensing/public/services/index.ts | 7 ++-- x-pack/plugins/licensing/server/index.ts | 33 +++++++++++++++---- .../licensing/server/services/index.ts | 7 ++-- x-pack/plugins/licensing/tsconfig.json | 3 +- 5 files changed, 45 insertions(+), 23 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/public/services/index.ts b/x-pack/plugins/licensing/public/services/index.ts index f7e125a253293..19c7b58dbb9c4 100644 --- a/x-pack/plugins/licensing/public/services/index.ts +++ b/x-pack/plugins/licensing/public/services/index.ts @@ -5,8 +5,5 @@ * 2.0. */ -export { - FeatureUsageService, - FeatureUsageServiceSetup, - FeatureUsageServiceStart, -} from './feature_usage_service'; +export { FeatureUsageService } from './feature_usage_service'; +export type { FeatureUsageServiceSetup, FeatureUsageServiceStart } from './feature_usage_service'; diff --git a/x-pack/plugins/licensing/server/index.ts b/x-pack/plugins/licensing/server/index.ts index 64933d0820cf3..a95842308e4eb 100644 --- a/x-pack/plugins/licensing/server/index.ts +++ b/x-pack/plugins/licensing/server/index.ts @@ -5,16 +5,35 @@ * 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 { LICENSE_TYPE } 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/server/services/index.ts b/x-pack/plugins/licensing/server/services/index.ts index f7e125a253293..19c7b58dbb9c4 100644 --- a/x-pack/plugins/licensing/server/services/index.ts +++ b/x-pack/plugins/licensing/server/services/index.ts @@ -5,8 +5,5 @@ * 2.0. */ -export { - FeatureUsageService, - FeatureUsageServiceSetup, - FeatureUsageServiceStart, -} from './feature_usage_service'; +export { FeatureUsageService } from './feature_usage_service'; +export type { FeatureUsageServiceSetup, FeatureUsageServiceStart } from './feature_usage_service'; 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/**/*",