[Index Management] [Onboarding] Create new package folder for index_management (#192594)

## Summary

We have to extract few components from `index_management` plugin to
shared packages for onboarding project. These extracted files would be
separated into small subject matter packages within a common folder -
`index-management` in `x-pack/packages/`.


What is covered in this PR? 

* Created new folder `index-management` under [
x-pack/packages/](https://github.com/elastic/kibana/tree/main/x-pack/packages)
as a home for subject matter packages.
* moved existing package -
[@kbn/index-management](https://github.com/elastic/kibana/tree/main/x-pack/packages/index-management)
under `x-pack/packages/index-management`
* update name of
[@kbn/index-management](https://github.com/elastic/kibana/tree/main/x-pack/packages/index-management)
to `@kbn/index-management-shared-types`
* updated related files which use `@kbn/index-management` to use
`@kbn/index-management-shared-types`

**Note** 
Extracting components required for onboarding project will be part of
another PR
This commit is contained in:
Saarika Bhasi 2024-09-13 07:46:00 -04:00 committed by GitHub
parent e5f0134464
commit 7264d3a548
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
50 changed files with 50 additions and 47 deletions

2
.github/CODEOWNERS vendored
View file

@ -508,8 +508,8 @@ src/plugins/image_embeddable @elastic/appex-sharedux
packages/kbn-import-locator @elastic/kibana-operations
packages/kbn-import-resolver @elastic/kibana-operations
x-pack/plugins/index_lifecycle_management @elastic/kibana-management
x-pack/packages/index-management @elastic/kibana-management
x-pack/plugins/index_management @elastic/kibana-management
x-pack/packages/index-management/index_management_shared_types @elastic/kibana-management
test/plugin_functional/plugins/index_patterns @elastic/kibana-data-discovery
x-pack/packages/ml/inference_integration_flyout @elastic/ml-ui
x-pack/plugins/inference @elastic/appex-ai-infra

View file

@ -552,8 +552,8 @@
"@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-plugin": "link:x-pack/plugins/index_lifecycle_management",
"@kbn/index-management": "link:x-pack/packages/index-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",
"@kbn/index-patterns-test-plugin": "link:test/plugin_functional/plugins/index_patterns",
"@kbn/inference-plugin": "link:x-pack/plugins/inference",
"@kbn/inference_integration_flyout": "link:x-pack/packages/ml/inference_integration_flyout",

View file

@ -11,7 +11,7 @@ import type { CoreStart } from '@kbn/core/public';
import type { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public';
import type { AggregateQuery } from '@kbn/es-query';
import type { ExpressionsStart } from '@kbn/expressions-plugin/public';
import type { IndexManagementPluginSetup } from '@kbn/index-management';
import type { IndexManagementPluginSetup } from '@kbn/index-management-shared-types';
import type { FieldsMetadataPublicStart } from '@kbn/fields-metadata-plugin/public';
export interface TextBasedLanguagesEditorProps {

View file

@ -23,7 +23,7 @@
"@kbn/data-plugin",
"@kbn/expressions-plugin",
"@kbn/data-views-plugin",
"@kbn/index-management",
"@kbn/index-management-shared-types",
"@kbn/code-editor",
"@kbn/shared-ux-markdown",
"@kbn/fields-metadata-plugin",

View file

@ -11,7 +11,7 @@ import { BehaviorSubject } from 'rxjs';
import type { CoreStart } from '@kbn/core/public';
import type { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public';
import type { ExpressionsStart } from '@kbn/expressions-plugin/public';
import type { IndexManagementPluginSetup } from '@kbn/index-management';
import type { IndexManagementPluginSetup } from '@kbn/index-management-shared-types';
import type { FieldsMetadataPublicStart } from '@kbn/fields-metadata-plugin/public';
export let core: CoreStart;

View file

@ -11,7 +11,7 @@ import type { Plugin, CoreStart, CoreSetup } from '@kbn/core/public';
import type { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public';
import type { ExpressionsStart } from '@kbn/expressions-plugin/public';
import type { DataPublicPluginStart } from '@kbn/data-plugin/public';
import type { IndexManagementPluginSetup } from '@kbn/index-management';
import type { IndexManagementPluginSetup } from '@kbn/index-management-shared-types';
import type { UiActionsSetup, UiActionsStart } from '@kbn/ui-actions-plugin/public';
import type { FieldsMetadataPublicStart } from '@kbn/fields-metadata-plugin/public';
import {

View file

@ -15,7 +15,7 @@
"@kbn/core",
"@kbn/expressions-plugin",
"@kbn/data-views-plugin",
"@kbn/index-management",
"@kbn/index-management-shared-types",
"@kbn/i18n",
"@kbn/config-schema",
"@kbn/esql-utils",

View file

@ -1010,10 +1010,10 @@
"@kbn/import-resolver/*": ["packages/kbn-import-resolver/*"],
"@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": ["x-pack/packages/index-management"],
"@kbn/index-management/*": ["x-pack/packages/index-management/*"],
"@kbn/index-management-plugin": ["x-pack/plugins/index_management"],
"@kbn/index-management-plugin/*": ["x-pack/plugins/index_management/*"],
"@kbn/index-management-shared-types": ["x-pack/packages/index-management/index_management_shared_types"],
"@kbn/index-management-shared-types/*": ["x-pack/packages/index-management/index_management_shared_types/*"],
"@kbn/index-patterns-test-plugin": ["test/plugin_functional/plugins/index_patterns"],
"@kbn/index-patterns-test-plugin/*": ["test/plugin_functional/plugins/index_patterns/*"],
"@kbn/inference_integration_flyout": ["x-pack/packages/ml/inference_integration_flyout"],

View file

@ -1,3 +1,3 @@
# @kbn/index-management
# @kbn/index-management-shared-types
Contains types and functions used and exported by the index management plugin. Primarily used to avoid cyclical dependencies.

View file

@ -7,6 +7,6 @@
module.exports = {
preset: '@kbn/test',
rootDir: '../../..',
roots: ['<rootDir>/x-pack/packages/index-management'],
rootDir: '../../../..',
roots: ['<rootDir>/x-pack/packages/index-management/index_management_shared_types'],
};

View file

@ -1,5 +1,5 @@
{
"type": "shared-common",
"id": "@kbn/index-management",
"id": "@kbn/index-management-shared-types",
"owner": "@elastic/kibana-management"
}

View file

@ -1,5 +1,5 @@
{
"name": "@kbn/index-management",
"name": "@kbn/index-management-shared-types",
"private": true,
"version": "1.0.0",
"license": "Elastic License 2.0"

View file

@ -1,5 +1,5 @@
{
"extends": "../../../tsconfig.base.json",
"extends": "../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types",
"types": [

View file

@ -24,7 +24,7 @@ import {
import { DataPublicPluginStart } from '@kbn/data-plugin/public';
import { GuidedOnboardingPluginStart } from '@kbn/guided-onboarding-plugin/public';
import { IndexMappingProps } from '@kbn/index-management';
import { IndexMappingProps } from '@kbn/index-management-shared-types';
import { LensPublicStart } from '@kbn/lens-plugin/public';
import { MlPluginStart } from '@kbn/ml-plugin/public';
import { ELASTICSEARCH_URL_PLACEHOLDER } from '@kbn/search-api-panels/constants';

View file

@ -25,7 +25,7 @@ import { DataPublicPluginStart } from '@kbn/data-plugin/public';
import { GuidedOnboardingPluginStart } from '@kbn/guided-onboarding-plugin/public';
import type { HomePublicPluginSetup } from '@kbn/home-plugin/public';
import { i18n } from '@kbn/i18n';
import type { IndexManagementPluginStart } from '@kbn/index-management';
import type { IndexManagementPluginStart } from '@kbn/index-management-shared-types';
import { LensPublicStart } from '@kbn/lens-plugin/public';
import { LicensingPluginStart } from '@kbn/licensing-plugin/public';
import { MlPluginStart } from '@kbn/ml-plugin/public';

View file

@ -72,7 +72,7 @@
"@kbn/search-playground",
"@kbn/search-inference-endpoints",
"@kbn/utility-types",
"@kbn/index-management",
"@kbn/index-management-shared-types",
"@kbn/deeplinks-search",
"@kbn/react-kibana-context-theme",
"@kbn/search-types",

View file

@ -26,7 +26,7 @@ import {
import { euiThemeVars } from '@kbn/ui-theme';
import { ApplicationStart } from '@kbn/core/public';
import { Index, IndexDetailsTab } from '@kbn/index-management';
import { Index, IndexDetailsTab } from '@kbn/index-management-shared-types';
import { IlmExplainLifecycleLifecycleExplainManaged } from '@elastic/elasticsearch/lib/api/types';
import { Phase } from '../../../common/types';
import { getPolicyEditPath } from '../../application/services/navigation';

View file

@ -37,7 +37,7 @@
"@kbn/shared-ux-router",
"@kbn/ui-theme",
"@kbn/shared-ux-link-redirect-app",
"@kbn/index-management",
"@kbn/index-management-shared-types",
"@kbn/react-kibana-context-render",
"@kbn/unsaved-changes-prompt",
"@kbn/shared-ux-table-persist",

View file

@ -54,6 +54,6 @@ export {
export { MAJOR_VERSION } from './plugin';
export { Section, IndexDetailsSection } from '@kbn/index-management';
export type { IndexDetailsTab, IndexDetailsTabId } from '@kbn/index-management';
export { Section, IndexDetailsSection } from '@kbn/index-management-shared-types';
export type { IndexDetailsTab, IndexDetailsTabId } from '@kbn/index-management-shared-types';
export * from './allow_auto_create';

View file

@ -6,7 +6,7 @@
*/
import type { EnrichSummary, EnrichPolicyType } from '@elastic/elasticsearch/lib/api/types';
import type { SerializedEnrichPolicy } from '@kbn/index-management';
import type { SerializedEnrichPolicy } from '@kbn/index-management-shared-types';
export const getPolicyType = (policy: EnrichSummary): EnrichPolicyType => {
if (policy.config.match) {

View file

@ -5,7 +5,7 @@
* 2.0.
*/
export type { Index } from '@kbn/index-management';
export type { Index } from '@kbn/index-management-shared-types';
export interface IndexModule {
number_of_shards: number | string;

View file

@ -6,7 +6,7 @@
*/
import { i18n } from '@kbn/i18n';
import { Index } from '@kbn/index-management';
import { Index } from '@kbn/index-management-shared-types';
import { MlPluginStart } from '@kbn/ml-plugin/public';
import { useState, useEffect } from 'react';
import { normalize } from '../components/mappings_editor/lib';

View file

@ -6,7 +6,7 @@
*/
import React, { createContext, useContext, useState } from 'react';
import type { SerializedEnrichPolicy } from '@kbn/index-management';
import type { SerializedEnrichPolicy } from '@kbn/index-management-shared-types';
export type DraftPolicy = Partial<SerializedEnrichPolicy>;

View file

@ -9,7 +9,7 @@ import React, { useState, useMemo, useCallback } from 'react';
import { i18n } from '@kbn/i18n';
import { EuiSteps, EuiStepStatus, EuiCallOut, EuiSpacer } from '@elastic/eui';
import type { SerializedEnrichPolicy } from '@kbn/index-management';
import type { SerializedEnrichPolicy } from '@kbn/index-management-shared-types';
import { useAppContext } from '../../app_context';
import { ConfigurationStep, FieldSelectionStep, CreateStep } from './steps';
import { useCreatePolicyContext } from './create_policy_context';

View file

@ -21,7 +21,7 @@ import {
EuiCodeBlock,
} from '@elastic/eui';
import type { SerializedEnrichPolicy } from '@kbn/index-management';
import type { SerializedEnrichPolicy } from '@kbn/index-management-shared-types';
import { useCreatePolicyContext } from '../create_policy_context';
import { serializeAsESPolicy, getESPolicyCreationApiCall } from '../../../../../common/lib';

View file

@ -21,7 +21,7 @@ import {
EuiButtonEmpty,
} from '@elastic/eui';
import { CodeEditor } from '@kbn/code-editor';
import type { SerializedEnrichPolicy } from '@kbn/index-management';
import type { SerializedEnrichPolicy } from '@kbn/index-management-shared-types';
export interface Props {
policy: SerializedEnrichPolicy;

View file

@ -12,7 +12,7 @@ import { RouteComponentProps } from 'react-router-dom';
import { Location } from 'history';
import { parse } from 'query-string';
import type { SerializedEnrichPolicy } from '@kbn/index-management';
import type { SerializedEnrichPolicy } from '@kbn/index-management-shared-types';
import { APP_WRAPPER_CLASS, useExecutionContext } from '../../../../shared_imports';
import { useAppContext } from '../../../app_context';
import { useRedirectPath } from '../../../hooks/redirect_path';

View file

@ -16,7 +16,7 @@ import {
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';
import { reactRouterNavigate } from '@kbn/kibana-react-plugin/public';
import type { SerializedEnrichPolicy } from '@kbn/index-management';
import type { SerializedEnrichPolicy } from '@kbn/index-management-shared-types';
import { useEuiTablePersist, DEFAULT_PAGE_SIZE_OPTIONS } from '@kbn/shared-ux-table-persist';
import { useAppContext } from '../../../../app_context';

View file

@ -6,7 +6,7 @@
*/
import { CoreStart } from '@kbn/core/public';
import { IndexMappingProps } from '@kbn/index-management';
import { IndexMappingProps } from '@kbn/index-management-shared-types';
import { AppDependencies } from '../../../../app_context';
import { ExtensionsService } from '../../../../../services/extensions_service';

View file

@ -6,7 +6,7 @@
*/
import { METRIC_TYPE } from '@kbn/analytics';
import type { SerializedEnrichPolicy } from '@kbn/index-management';
import type { SerializedEnrichPolicy } from '@kbn/index-management-shared-types';
import { IndicesStatsResponse } from '@elastic/elasticsearch/lib/api/types';
import { InferenceAPIConfigResponse } from '@kbn/ml-trained-models-utils';
import { MappingTypeMapping } from '@elastic/elasticsearch/lib/api/typesWithBodyKey';

View file

@ -19,6 +19,6 @@ export type {
IndexMappingProps,
IndexManagementPluginSetup,
IndexManagementPluginStart,
} from '@kbn/index-management';
} from '@kbn/index-management-shared-types';
export { getIndexListUri, getTemplateDetailsLink } from './application/services/routing';

View file

@ -15,7 +15,10 @@ import {
PluginInitializerContext,
ScopedHistory,
} from '@kbn/core/public';
import { IndexManagementPluginSetup, IndexManagementPluginStart } from '@kbn/index-management';
import {
IndexManagementPluginSetup,
IndexManagementPluginStart,
} from '@kbn/index-management-shared-types';
import { setExtensionsService } from './application/store/selectors/extension_service';
import { ExtensionsService } from './services/extensions_service';

View file

@ -6,7 +6,7 @@
*/
import type { PublicMethodsOf } from '@kbn/utility-types';
import { ExtensionsSetup } from '@kbn/index-management/src/services/extensions_service';
import { ExtensionsSetup } from '@kbn/index-management-shared-types/src/services/extensions_service';
import { ExtensionsService } from './extensions_service';
export type ExtensionsSetupMock = jest.Mocked<ExtensionsSetup>;

View file

@ -13,7 +13,7 @@ import {
EmptyListContent,
IndexContent,
ExtensionsSetup,
} from '@kbn/index-management';
} from '@kbn/index-management-shared-types';
import { IndexDetailsTab } from '../../common/constants';
export class ExtensionsService {

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { PublicApiServiceSetup } from '@kbn/index-management/src/services/public_api_service';
import { PublicApiServiceSetup } from '@kbn/index-management-shared-types/src/services/public_api_service';
export type PublicApiServiceSetupMock = jest.Mocked<PublicApiServiceSetup>;

View file

@ -7,7 +7,7 @@
import { IScopedClusterClient } from '@kbn/core/server';
import type { EnrichSummary } from '@elastic/elasticsearch/lib/api/types';
import type { SerializedEnrichPolicy } from '@kbn/index-management';
import type { SerializedEnrichPolicy } from '@kbn/index-management-shared-types';
import { getPolicyType } from '../../common/lib';
export const serializeEnrichmentPolicies = (

View file

@ -8,7 +8,7 @@
import { IScopedClusterClient } from '@kbn/core/server';
import { schema, TypeOf } from '@kbn/config-schema';
import type { SerializedEnrichPolicy } from '@kbn/index-management';
import type { SerializedEnrichPolicy } from '@kbn/index-management-shared-types';
import { RouteDependencies } from '../../../types';
import { addInternalBasePath } from '..';
import { enrichPoliciesActions } from '../../../lib/enrich_policies';

View file

@ -45,7 +45,7 @@
"@kbn/monaco",
"@kbn/console-plugin",
"@kbn/shared-ux-utility",
"@kbn/index-management",
"@kbn/index-management-shared-types",
"@kbn/utility-types",
"@kbn/inference_integration_flyout",
"@kbn/ml-plugin",

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import type { Index } from '@kbn/index-management';
import type { Index } from '@kbn/index-management-shared-types';
import { useQuery } from '@tanstack/react-query';
import { useKibana } from '../use_kibana';

View file

@ -27,7 +27,7 @@
"@kbn/share-plugin",
"@kbn/kibana-utils-plugin",
"@kbn/shared-ux-router",
"@kbn/index-management",
"@kbn/index-management-shared-types",
"@kbn/try-in-console",
"@kbn/cloud-plugin",
],

View file

@ -18,7 +18,7 @@ import {
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';
import { CoreStart } from '@kbn/core/public';
import { IndexContent } from '@kbn/index-management';
import { IndexContent } from '@kbn/index-management-shared-types';
const IndexMappingsDocsLink: FunctionComponent<{ docLinks: CoreStart['docLinks'] }> = ({
docLinks,

View file

@ -12,7 +12,7 @@ import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
import { EuiLoadingSpinner } from '@elastic/eui';
import { IndexContent } from '@kbn/index-management';
import { IndexContent } from '@kbn/index-management-shared-types';
import { ServerlessSearchPluginStartDependencies } from '../../../types';

View file

@ -45,7 +45,7 @@
"@kbn/core-logging-server-mocks",
"@kbn/discover-plugin",
"@kbn/search-connectors-plugin",
"@kbn/index-management",
"@kbn/index-management-shared-types",
"@kbn/react-kibana-context-render",
"@kbn/search-playground",
"@kbn/security-api-key-management",

View file

@ -5302,7 +5302,7 @@
version "0.0.0"
uid ""
"@kbn/index-management@link:x-pack/packages/index-management":
"@kbn/index-management-shared-types@link:x-pack/packages/index-management/index_management_shared_types":
version "0.0.0"
uid ""