diff --git a/package.json b/package.json index 8be3b49992cf4..9cf598931eb10 100644 --- a/package.json +++ b/package.json @@ -567,6 +567,7 @@ "@kbn/i18n-react": "link:packages/kbn-i18n-react", "@kbn/iframe-embedded-plugin": "link:x-pack/test/functional_embedded/plugins/iframe_embedded", "@kbn/image-embeddable-plugin": "link:src/plugins/image_embeddable", + "@kbn/index-lifecycle-management-common-shared": "link:x-pack/packages/index-lifecycle-management/index-lifecycle-management-common-shared", "@kbn/index-lifecycle-management-plugin": "link:x-pack/plugins/index_lifecycle_management", "@kbn/index-management-plugin": "link:x-pack/plugins/index_management", "@kbn/index-management-shared-types": "link:x-pack/packages/index-management/index_management_shared_types", diff --git a/tsconfig.base.json b/tsconfig.base.json index 7b1bc834fcc28..54b1ab09e9c4a 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -1034,6 +1034,8 @@ "@kbn/import-locator/*": ["packages/kbn-import-locator/*"], "@kbn/import-resolver": ["packages/kbn-import-resolver"], "@kbn/import-resolver/*": ["packages/kbn-import-resolver/*"], + "@kbn/index-lifecycle-management-common-shared": ["x-pack/packages/index-lifecycle-management/index-lifecycle-management-common-shared"], + "@kbn/index-lifecycle-management-common-shared/*": ["x-pack/packages/index-lifecycle-management/index-lifecycle-management-common-shared/*"], "@kbn/index-lifecycle-management-plugin": ["x-pack/plugins/index_lifecycle_management"], "@kbn/index-lifecycle-management-plugin/*": ["x-pack/plugins/index_lifecycle_management/*"], "@kbn/index-management-plugin": ["x-pack/plugins/index_management"], diff --git a/x-pack/packages/index-lifecycle-management/index-lifecycle-management-common-shared/README.md b/x-pack/packages/index-lifecycle-management/index-lifecycle-management-common-shared/README.md new file mode 100644 index 0000000000000..66d1ff7e3c8f2 --- /dev/null +++ b/x-pack/packages/index-lifecycle-management/index-lifecycle-management-common-shared/README.md @@ -0,0 +1,3 @@ +# @kbn/index-lifecycle-management-common-shared + +Contains types and functions used and exported by the index lifecycle management plugin. Primarily used to address dependency issues. diff --git a/x-pack/packages/index-lifecycle-management/index-lifecycle-management-common-shared/index.ts b/x-pack/packages/index-lifecycle-management/index-lifecycle-management-common-shared/index.ts new file mode 100644 index 0000000000000..044ab18aa34df --- /dev/null +++ b/x-pack/packages/index-lifecycle-management/index-lifecycle-management-common-shared/index.ts @@ -0,0 +1,9 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export const ILM_LOCATOR_ID = 'ILM_LOCATOR_ID'; +export * from './src/policies'; diff --git a/x-pack/packages/index-lifecycle-management/index-lifecycle-management-common-shared/kibana.jsonc b/x-pack/packages/index-lifecycle-management/index-lifecycle-management-common-shared/kibana.jsonc new file mode 100644 index 0000000000000..dfaef1d0dfb9c --- /dev/null +++ b/x-pack/packages/index-lifecycle-management/index-lifecycle-management-common-shared/kibana.jsonc @@ -0,0 +1,5 @@ +{ + "type": "shared-common", + "id": "@kbn/index-lifecycle-management-common-shared", + "owner": "@elastic/kibana-management" +} diff --git a/x-pack/packages/index-lifecycle-management/index-lifecycle-management-common-shared/package.json b/x-pack/packages/index-lifecycle-management/index-lifecycle-management-common-shared/package.json new file mode 100644 index 0000000000000..9c3e7c99dd7d9 --- /dev/null +++ b/x-pack/packages/index-lifecycle-management/index-lifecycle-management-common-shared/package.json @@ -0,0 +1,6 @@ +{ + "name": "@kbn/index-lifecycle-management-common-shared", + "private": true, + "version": "1.0.0", + "license": "Elastic License 2.0" +} diff --git a/x-pack/plugins/index_lifecycle_management/common/types/policies.ts b/x-pack/packages/index-lifecycle-management/index-lifecycle-management-common-shared/src/policies.ts similarity index 94% rename from x-pack/plugins/index_lifecycle_management/common/types/policies.ts rename to x-pack/packages/index-lifecycle-management/index-lifecycle-management-common-shared/src/policies.ts index 7ebb789f62e54..a85c8353e5156 100644 --- a/x-pack/plugins/index_lifecycle_management/common/types/policies.ts +++ b/x-pack/packages/index-lifecycle-management/index-lifecycle-management-common-shared/src/policies.ts @@ -5,6 +5,13 @@ * 2.0. */ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + export type Phase = keyof Phases; export type PhaseWithAllocation = 'warm' | 'cold'; diff --git a/x-pack/packages/index-lifecycle-management/index-lifecycle-management-common-shared/tsconfig.json b/x-pack/packages/index-lifecycle-management/index-lifecycle-management-common-shared/tsconfig.json new file mode 100644 index 0000000000000..8e9142a838322 --- /dev/null +++ b/x-pack/packages/index-lifecycle-management/index-lifecycle-management-common-shared/tsconfig.json @@ -0,0 +1,23 @@ +{ + "extends": "../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node", + "react" + ] + }, + "include": [ + "**/*.ts", + "**/*.tsx" + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [ + "@kbn/core-application-browser", + "@kbn/utility-types", + "@kbn/share-plugin", + ] +} diff --git a/x-pack/plugins/index_lifecycle_management/common/types/index.ts b/x-pack/plugins/index_lifecycle_management/common/types/index.ts index bc7e881a8c230..ee5939e328ce5 100644 --- a/x-pack/plugins/index_lifecycle_management/common/types/index.ts +++ b/x-pack/plugins/index_lifecycle_management/common/types/index.ts @@ -7,7 +7,7 @@ export * from './api'; -export * from './policies'; +export * from '@kbn/index-lifecycle-management-common-shared'; /** * These roles reflect how nodes are stratified into different data tiers. diff --git a/x-pack/plugins/index_lifecycle_management/public/locator.ts b/x-pack/plugins/index_lifecycle_management/public/locator.ts index 24599b6a6b47e..382cbc4ad1838 100644 --- a/x-pack/plugins/index_lifecycle_management/public/locator.ts +++ b/x-pack/plugins/index_lifecycle_management/public/locator.ts @@ -8,6 +8,7 @@ import type { SerializableRecord } from '@kbn/utility-types'; import { ManagementAppLocator } from '@kbn/management-plugin/common'; import { LocatorDefinition } from '@kbn/share-plugin/public'; +import { ILM_LOCATOR_ID } from '@kbn/index-lifecycle-management-common-shared'; import { getPoliciesListPath, getPolicyCreatePath, @@ -15,7 +16,7 @@ import { } from './application/services/navigation'; import { PLUGIN } from '../common/constants'; -export const ILM_LOCATOR_ID = 'ILM_LOCATOR_ID'; +export { ILM_LOCATOR_ID }; export interface IlmLocatorParams extends SerializableRecord { page: 'policies_list' | 'policy_edit' | 'policy_create'; diff --git a/x-pack/plugins/observability_solution/synthetics/kibana.jsonc b/x-pack/plugins/observability_solution/synthetics/kibana.jsonc index 89870a9e6c881..44d549843f469 100644 --- a/x-pack/plugins/observability_solution/synthetics/kibana.jsonc +++ b/x-pack/plugins/observability_solution/synthetics/kibana.jsonc @@ -63,8 +63,7 @@ "kibanaUtils", "observability", "spaces", - "indexLifecycleManagement", "unifiedDocViewer" ] } -} \ No newline at end of file +} diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/hooks/api.ts b/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/hooks/api.ts index ad3d45d0ba806..a113f86bdfef4 100644 --- a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/hooks/api.ts +++ b/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/hooks/api.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { PolicyFromES } from '@kbn/index-lifecycle-management-plugin/common/types'; +import { PolicyFromES } from '@kbn/index-lifecycle-management-common-shared'; import { DataStream } from '@kbn/index-management-plugin/common'; import { CatIndicesResponse } from '@elastic/elasticsearch/lib/api/types'; import { apiService } from '../../../../../utils/api_service'; diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/policy_link.tsx b/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/policy_link.tsx index 0c9cb465c127f..3918e20bccabd 100644 --- a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/policy_link.tsx +++ b/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/policy_link.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { EuiIconTip, EuiLink, EuiSkeletonText, EuiToolTip, EuiText } from '@elastic/eui'; import { useKibana } from '@kbn/kibana-react-plugin/public'; -import { ILM_LOCATOR_ID } from '@kbn/index-lifecycle-management-plugin/public'; +import { ILM_LOCATOR_ID } from '@kbn/index-lifecycle-management-common-shared'; import { useFetcher } from '@kbn/observability-shared-plugin/public'; import { i18n } from '@kbn/i18n'; import { useSyntheticsSettingsContext } from '../../contexts'; diff --git a/yarn.lock b/yarn.lock index 34d99f881d686..9efd93ee2182c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5328,6 +5328,10 @@ version "0.0.0" uid "" +"@kbn/index-lifecycle-management-common-shared@link:x-pack/packages/index-lifecycle-management/index-lifecycle-management-common-shared": + version "0.0.0" + uid "" + "@kbn/index-management-plugin@link:x-pack/plugins/index_management": version "0.0.0" uid ""