diff --git a/dev_docs/key_concepts/anatomy_of_a_plugin.mdx b/dev_docs/key_concepts/anatomy_of_a_plugin.mdx index 4c082fc3bf1db..f99c41ff18d07 100644 --- a/dev_docs/key_concepts/anatomy_of_a_plugin.mdx +++ b/dev_docs/key_concepts/anatomy_of_a_plugin.mdx @@ -122,7 +122,7 @@ If you are developing in TypeScript (which we recommend), you will need to add a core capabilities as an argument. It should return an instance of its plugin class for Kibana to load. ```ts -import type { PluginInitializerContext } from 'kibana/server'; +import type { PluginInitializerContext } from '@kbn/core/server'; import { DemoPlugin } from './plugin'; export function plugin(initializerContext: PluginInitializerContext) { @@ -156,7 +156,7 @@ Using the non-`type` variation will increase the bundle size unnecessarily and m point, but all plugins at Elastic should be consistent in this way. ```ts -import type { Plugin, PluginInitializerContext, CoreSetup, CoreStart } from 'kibana/server'; +import type { Plugin, PluginInitializerContext, CoreSetup, CoreStart } from '@kbn/core/server'; export class DemoPlugin implements Plugin { constructor(initializerContext: PluginInitializerContext) {} @@ -184,7 +184,7 @@ export class DemoPlugin implements Plugin { `server/plugin.ts` is the server-side plugin definition. The shape of this plugin is the same as it’s client-side counter-part: ```ts -import type { Plugin, PluginInitializerContext, CoreSetup, CoreStart } from 'kibana/server'; +import type { Plugin, PluginInitializerContext, CoreSetup, CoreStart } from '@kbn/core/server'; export class DemoPlugin implements Plugin { constructor(initializerContext: PluginInitializerContext) {} @@ -240,7 +240,7 @@ For example, the core http service exposes a function createRouter to all plugin a plugin just accesses it off of the first argument: ```ts -import type { CoreSetup } from 'kibana/server'; +import type { CoreSetup } from '@kbn/core/server'; export class DemoPlugin { public setup(core: CoreSetup) { @@ -260,7 +260,7 @@ dependency in it’s kibana.json manifest file. ** foobar plugin.ts: ** ```ts -import type { Plugin } from 'kibana/server'; +import type { Plugin } from '@kbn/core/server'; // [1] export interface FoobarPluginSetup { getFoo(): string; @@ -306,7 +306,7 @@ export class MyPlugin implements Plugin { With that specified in the plugin manifest, the appropriate interfaces are then available via the second argument of setup and/or start: ```ts -import type { CoreSetup, CoreStart } from 'kibana/server'; +import type { CoreSetup, CoreStart } from '@kbn/core/server'; import type { FoobarPluginSetup, FoobarPluginStart } from '../../foobar/server'; // [1] diff --git a/dev_docs/key_concepts/performance.mdx b/dev_docs/key_concepts/performance.mdx index 5d955c789ddeb..c57630f508dcd 100644 --- a/dev_docs/key_concepts/performance.mdx +++ b/dev_docs/key_concepts/performance.mdx @@ -33,7 +33,7 @@ some heavy-weight libraries that will also be removed from the initial plugin bundle, therefore, reducing its size by a significant amount. ```ts -import type { Plugin, CoreSetup, AppMountParameters } from 'kibana/public'; +import type { Plugin, CoreSetup, AppMountParameters } from '@kbn/core/public'; export class MyPlugin implements Plugin { setup(core: CoreSetup, plugins: SetupDeps) { core.application.register({ diff --git a/dev_docs/tutorials/advanced_settings.mdx b/dev_docs/tutorials/advanced_settings.mdx index 1ca925e24f54a..b0c12ad5e5edd 100644 --- a/dev_docs/tutorials/advanced_settings.mdx +++ b/dev_docs/tutorials/advanced_settings.mdx @@ -54,7 +54,7 @@ The following is a basic example for using the `uiSettings` service: **src/plugins/charts/public/plugin.ts** ```ts -import { Plugin, CoreSetup } from 'kibana/public'; +import { Plugin, CoreSetup } from '@kbn/core/public'; import { ExpressionsSetup } from '../../expressions/public'; import { palette, systemPalette } from '../common'; @@ -132,7 +132,7 @@ The example also shows how plugins can leverage the optional deprecation paramet ```ts import { i18n } from '@kbn/i18n'; import { schema } from '@kbn/config-schema'; -import { CoreSetup, Plugin } from 'kibana/server'; +import { CoreSetup, Plugin } from '@kbn/core/server'; import { COLOR_MAPPING_SETTING, LEGACY_TIME_AXIS, palette, systemPalette } from '../common'; import { ExpressionsServerSetup } from '../../expressions/server'; @@ -192,7 +192,7 @@ For example, changing the time filter refresh interval triggers a prompt in the ```ts import { i18n } from '@kbn/i18n'; import { schema } from '@kbn/config-schema'; -import type { DocLinksServiceSetup, UiSettingsParams } from 'kibana/server'; +import type { DocLinksServiceSetup, UiSettingsParams } from '@kbn/core/server'; import { DEFAULT_QUERY_LANGUAGE, UI_SETTINGS } from '../common'; export function getUiSettings( @@ -231,7 +231,7 @@ For example, in 7.9.0, `siem` as renamed to `securitySolution`, and in 8.0.0, `t **src/core/server/ui_settings/saved_objects/migrations.ts** ```ts -import { SavedObjectUnsanitizedDoc, SavedObjectSanitizedDoc } from 'kibana/server'; +import { SavedObjectUnsanitizedDoc, SavedObjectSanitizedDoc } from '@kbn/core/server'; export const migrations = { '7.9.0': (doc: SavedObjectUnsanitizedDoc): SavedObjectSanitizedDoc => ({ diff --git a/dev_docs/tutorials/data/search.mdx b/dev_docs/tutorials/data/search.mdx index ab5c3f29ea1be..d422eb811b60b 100644 --- a/dev_docs/tutorials/data/search.mdx +++ b/dev_docs/tutorials/data/search.mdx @@ -18,7 +18,7 @@ However, the recommended and easiest way to search Elasticsearch is by using the Here is a basic example for using the `data.search` service from a custom plugin: ```ts -import { CoreStart, Plugin } from 'kibana/public'; +import { CoreStart, Plugin } from '@kbn/core/public'; import { DataPublicPluginStart, isCompleteResponse, isErrorResponse } from import { DataPublicPluginStart, isCompleteResponse, isErrorResponse } from '../../src/plugins/data'; export interface MyPluginStartDependencies { @@ -189,7 +189,7 @@ export const mySearchStrategyProvider = ( ```ts // ./myPlugin/server/plugin.ts -import type { CoreSetup, CoreStart, Plugin } from 'kibana/server'; +import type { CoreSetup, CoreStart, Plugin } from '@kbn/core/server'; import { mySearchStrategyProvider } from './my_strategy'; diff --git a/dev_docs/tutorials/endpoints.mdx b/dev_docs/tutorials/endpoints.mdx index f6367580420db..ab7aeda0e5693 100644 --- a/dev_docs/tutorials/endpoints.mdx +++ b/dev_docs/tutorials/endpoints.mdx @@ -63,7 +63,7 @@ the request. The following snippet demonstrate how to create a basic `GET` endpoint on the `/api/my_plugin/get_object` path: ```ts -import type { CoreSetup, Plugin } from 'kibana/server'; +import type { CoreSetup, Plugin } from '@kbn/core/server'; export class MyPlugin implements Plugin { public setup(core: CoreSetup) { @@ -86,7 +86,7 @@ export class MyPlugin implements Plugin { consuming the endpoint from the client-side using core's `http` service would then look like: ```ts -import { HttpStart } from 'kibana/public'; +import { HttpStart } from '@kbn/core/public'; interface ResponseType { result: string; @@ -105,7 +105,7 @@ of the route definition. ```ts import { schema } from '@kbn/config-schema'; -import type { CoreSetup, Plugin } from 'kibana/server'; +import type { CoreSetup, Plugin } from '@kbn/core/server'; export class MyPlugin implements Plugin { public setup(core: CoreSetup) { @@ -135,7 +135,7 @@ export class MyPlugin implements Plugin { consuming the endpoint from the client-side using core's `http` service would then look like: ```ts -import { HttpStart } from 'kibana/public'; +import { HttpStart } from '@kbn/core/public'; import { MyObjectType } from '../common/types'; async function fetchData(http: HttpStart, id: string) { @@ -150,7 +150,7 @@ must be provided when registering a `post` handler that will access the payload. ```ts import { schema } from '@kbn/config-schema'; -import type { CoreSetup, Plugin } from 'kibana/server'; +import type { CoreSetup, Plugin } from '@kbn/core/server'; export class MyPlugin implements Plugin { public setup(core: CoreSetup) { @@ -182,7 +182,7 @@ export class MyPlugin implements Plugin { consuming the endpoint from the client-side using core's `http` service would then look like: ```ts -import { HttpStart } from 'kibana/public'; +import { HttpStart } from '@kbn/core/public'; interface ResponseType { updated: boolean; @@ -207,7 +207,7 @@ option of the route definition to be accessible from the handler. ```ts import { schema } from '@kbn/config-schema'; -import type { CoreSetup, Plugin } from 'kibana/server'; +import type { CoreSetup, Plugin } from '@kbn/core/server'; export class MyPlugin implements Plugin { public setup(core: CoreSetup) { @@ -236,7 +236,7 @@ export class MyPlugin implements Plugin { consuming the endpoint from the client-side using core's `http` service would then look like: ```ts -import { HttpStart } from 'kibana/public'; +import { HttpStart } from '@kbn/core/public'; import { MyObjectType } from '../common/types'; interface ResponseType { @@ -264,7 +264,7 @@ All APIs of the `response` parameter of the handler accept a `headers` property to define headers to attach to the response. ```ts -import type { CoreSetup, Plugin } from 'kibana/server'; +import type { CoreSetup, Plugin } from '@kbn/core/server'; export class MyPlugin implements Plugin { public setup(core: CoreSetup) { @@ -300,7 +300,7 @@ However, some of the less commonly used return codes don't have such helpers. In and/or `response.customError` APIs should be used. ```ts -import type { CoreSetup, Plugin } from 'kibana/server'; +import type { CoreSetup, Plugin } from '@kbn/core/server'; export class MyPlugin implements Plugin { public setup(core: CoreSetup) { @@ -332,7 +332,7 @@ These observables can either be used directly, or be used to control an `AbortCo ```ts import { schema } from '@kbn/config-schema'; -import type { CoreSetup, Plugin } from 'kibana/server'; +import type { CoreSetup, Plugin } from '@kbn/core/server'; export class MyPlugin implements Plugin { public setup(core: CoreSetup) { @@ -371,7 +371,7 @@ and will return a `401 - Unauthorized` otherwise. It is possible to disable this requirement using the `authRequired` option of the route. ```ts -import type { CoreSetup, Plugin } from 'kibana/server'; +import type { CoreSetup, Plugin } from '@kbn/core/server'; export class MyPlugin implements Plugin { public setup(core: CoreSetup) { @@ -407,7 +407,7 @@ be achieved by using the `url` and `route` properties of the `request` parameter request.url / request.route ```ts -import type { CoreSetup, Plugin } from 'kibana/server'; +import type { CoreSetup, Plugin } from '@kbn/core/server'; export class MyPlugin implements Plugin { public setup(core: CoreSetup) { diff --git a/dev_docs/tutorials/testing_plugins.mdx b/dev_docs/tutorials/testing_plugins.mdx index 044d610aa3489..b43fa19927cc4 100644 --- a/dev_docs/tutorials/testing_plugins.mdx +++ b/dev_docs/tutorials/testing_plugins.mdx @@ -590,7 +590,7 @@ Objects client: ```typescript // src/plugins/myplugin/server/lib/short_url_lookup.ts import crypto from 'crypto'; -import { SavedObjectsClientContract } from 'kibana/server'; +import { SavedObjectsClientContract } from '@kbn/core/server'; export const shortUrlLookup = { generateUrlId(url: string, savedObjectsClient: SavedObjectsClientContract) { @@ -1025,7 +1025,7 @@ data. ```typescript // src/plugins/myplugin/public/plugin.ts import { METRIC_TYPE } from '@kbn/analytics'; -import { CoreSetup, CoreStart, Plugin } from 'kibana/public'; +import { CoreSetup, CoreStart, Plugin } from '@kbn/core/public'; import { DataPublicPluginSetup, DataPublicPluginStart } from '../../data/public'; import { UsageCollectionSetup } from '../../usage_collection/public'; import { SuggestionsService } from './suggestions'; diff --git a/docs/developer/architecture/core/application_service.asciidoc b/docs/developer/architecture/core/application_service.asciidoc index ba3c6bbed72be..2aa50ebafad8d 100644 --- a/docs/developer/architecture/core/application_service.asciidoc +++ b/docs/developer/architecture/core/application_service.asciidoc @@ -6,7 +6,7 @@ NOTE: The Application service is only available client side. [source,typescript] ---- -import { AppMountParameters, CoreSetup, Plugin, DEFAULT_APP_CATEGORIES } from 'kibana/public'; +import { AppMountParameters, CoreSetup, Plugin, DEFAULT_APP_CATEGORIES } from '@kbn/core/public'; export class MyPlugin implements Plugin { public setup(core: CoreSetup) { diff --git a/docs/developer/architecture/core/configuration-service.asciidoc b/docs/developer/architecture/core/configuration-service.asciidoc index 031135c7b790f..b78414486e3c3 100644 --- a/docs/developer/architecture/core/configuration-service.asciidoc +++ b/docs/developer/architecture/core/configuration-service.asciidoc @@ -38,7 +38,7 @@ export type MyPluginConfigType = TypeOf; *my_plugin/server/index.ts* [source,typescript] ---- -import type { PluginInitializerContext } from 'kibana/server'; +import type { PluginInitializerContext } from '@kbn/core/server'; export class MyPlugin { constructor(initializerContext: PluginInitializerContext) { this.config$ = initializerContext.config.create(); @@ -57,7 +57,7 @@ allow-list property. [source,typescript] ---- import { schema, TypeOf } from '@kbn/config-schema'; -import type { PluginConfigDescriptor } from 'kibana/server'; +import type { PluginConfigDescriptor } from '@kbn/core/server'; const configSchema = schema.object({ secret: schema.string({ defaultValue: 'Only on server' }), @@ -115,7 +115,7 @@ configuration root. [source,typescript] ---- import { schema, TypeOf } from '@kbn/config-schema'; -import type { PluginConfigDescriptor } from 'kibana/server'; +import type { PluginConfigDescriptor } from '@kbn/core/server'; const configSchema = schema.object({ newProperty: schema.string({ defaultValue: 'Some string' }), diff --git a/docs/developer/architecture/core/elasticsearch-service.asciidoc b/docs/developer/architecture/core/elasticsearch-service.asciidoc index 55632c0117938..b65c8859d50dc 100644 --- a/docs/developer/architecture/core/elasticsearch-service.asciidoc +++ b/docs/developer/architecture/core/elasticsearch-service.asciidoc @@ -14,7 +14,7 @@ See <> and <>. [source,typescript] ---- -import { CoreStart, Plugin } from 'kibana/public'; +import { CoreStart, Plugin } from '@kbn/core/public'; export class MyPlugin implements Plugin { public start(core: CoreStart) { diff --git a/docs/developer/architecture/core/http-service.asciidoc b/docs/developer/architecture/core/http-service.asciidoc index 45468d618dd09..6cc171aa7969a 100644 --- a/docs/developer/architecture/core/http-service.asciidoc +++ b/docs/developer/architecture/core/http-service.asciidoc @@ -17,7 +17,7 @@ See {kib-repo}blob/{branch}/docs/development/core/server/kibana-plugin-core-serv [source,typescript] ---- import { schema } from '@kbn/config-schema'; -import type { CoreSetup, Plugin } from 'kibana/server'; +import type { CoreSetup, Plugin } from '@kbn/core/server'; export class MyPlugin implements Plugin { public setup(core: CoreSetup) { @@ -54,7 +54,7 @@ The client-side HttpService is a preconfigured wrapper around `window.fetch` tha [source,typescript] ---- -import { CoreStart } from 'kibana/public'; +import { CoreStart } from '@kbn/core/public'; interface ResponseType {…}; interface MyPluginData {…}; async function fetchData(core: CoreStart) { diff --git a/docs/developer/architecture/core/index.asciidoc b/docs/developer/architecture/core/index.asciidoc index 6c70205c3590d..b03e98ffbb57d 100644 --- a/docs/developer/architecture/core/index.asciidoc +++ b/docs/developer/architecture/core/index.asciidoc @@ -8,7 +8,7 @@ These API's are injected into your plugin's lifecycle methods and may be invoked [source,typescript] ---- -import type { PluginInitializerContext, CoreSetup, CoreStart } from 'kibana/server'; +import type { PluginInitializerContext, CoreSetup, CoreStart } from '@kbn/core/server'; export class MyPlugin { constructor(initializerContext: PluginInitializerContext) {} diff --git a/docs/developer/architecture/core/logging-service.asciidoc b/docs/developer/architecture/core/logging-service.asciidoc index 79d8c6d197e10..a4d5a12ff64e7 100644 --- a/docs/developer/architecture/core/logging-service.asciidoc +++ b/docs/developer/architecture/core/logging-service.asciidoc @@ -6,7 +6,7 @@ NOTE: The Logging service is only available server side. [source,typescript] ---- -import type { PluginInitializerContext, CoreSetup, Plugin, Logger } from 'kibana/server'; +import type { PluginInitializerContext, CoreSetup, Plugin, Logger } from '@kbn/core/server'; export class MyPlugin implements Plugin { private readonly logger: Logger; diff --git a/docs/developer/architecture/core/patterns-scoped-services.asciidoc b/docs/developer/architecture/core/patterns-scoped-services.asciidoc index d4618684fc7e4..bfd8b42dbb951 100644 --- a/docs/developer/architecture/core/patterns-scoped-services.asciidoc +++ b/docs/developer/architecture/core/patterns-scoped-services.asciidoc @@ -35,7 +35,7 @@ the request handler context: [source,typescript] ---- -import type { CoreSetup, RequestHandlerContext, IScopedClusterClient } from 'kibana/server'; +import type { CoreSetup, RequestHandlerContext, IScopedClusterClient } from '@kbn/core/server'; interface MyRequestHandlerContext extends RequestHandlerContext { myPlugin: { diff --git a/docs/developer/architecture/core/uisettings-service.asciidoc b/docs/developer/architecture/core/uisettings-service.asciidoc index 32a0058476df8..2d24465b69c32 100644 --- a/docs/developer/architecture/core/uisettings-service.asciidoc +++ b/docs/developer/architecture/core/uisettings-service.asciidoc @@ -82,7 +82,7 @@ The following example shows how to {kib-repo}blob/{branch}/docs/development/core [source,typescript] ---- import { schema } from '@kbn/config-schema'; -import type { CoreSetup,Plugin } from 'kibana/server'; +import type { CoreSetup,Plugin } from '@kbn/core/server'; export class MyPlugin implements Plugin { public setup(core: CoreSetup) { diff --git a/docs/developer/architecture/kibana-platform-plugin-api.asciidoc b/docs/developer/architecture/kibana-platform-plugin-api.asciidoc index 9cf60cda76f75..af3dfa8647656 100644 --- a/docs/developer/architecture/kibana-platform-plugin-api.asciidoc +++ b/docs/developer/architecture/kibana-platform-plugin-api.asciidoc @@ -57,7 +57,7 @@ It should return an instance of its plugin class for [source,typescript] ---- -import type { PluginInitializerContext } from 'kibana/server'; +import type { PluginInitializerContext } from '@kbn/core/server'; import { MyPlugin } from './plugin'; export function plugin(initializerContext: PluginInitializerContext) { @@ -73,7 +73,7 @@ for first-party Elastic plugins]. [source,typescript] ---- -import type { Plugin, PluginInitializerContext, CoreSetup, CoreStart } from 'kibana/server'; +import type { Plugin, PluginInitializerContext, CoreSetup, CoreStart } from '@kbn/core/server'; export class MyPlugin implements Plugin { constructor(initializerContext: PluginInitializerContext) {} @@ -99,7 +99,7 @@ entry-point: [source,typescript] ---- -import type { PluginInitializerContext } from 'kibana/server'; +import type { PluginInitializerContext } from '@kbn/core/server'; import { MyPlugin } from './plugin'; export function plugin(initializerContext: PluginInitializerContext) { @@ -112,7 +112,7 @@ shape of this plugin is the same as it’s client-side counter-part: [source,typescript] ---- -import type { Plugin, PluginInitializerContext, CoreSetup, CoreStart } from 'kibana/server'; +import type { Plugin, PluginInitializerContext, CoreSetup, CoreStart } from '@kbn/core/server'; export class MyPlugin implements Plugin { constructor(initializerContext: PluginInitializerContext) {} @@ -190,7 +190,7 @@ an HTTP route handler, a plugin just accesses it off of the first argument: [source, typescript] ---- -import type { CoreSetup } from 'kibana/server'; +import type { CoreSetup } from '@kbn/core/server'; export class MyPlugin { public setup(core: CoreSetup) { @@ -252,7 +252,7 @@ encouraged to expose types for their plugin interfaces. [source, typescript] ---- -import type { Plugin } from 'kibana/server'; +import type { Plugin } from '@kbn/core/server'; export interface FoobarPluginSetup { <1> getFoo(): string; } @@ -305,7 +305,7 @@ are then available via the second argument of `setup` and/or `start`: [source,typescript] ---- -import type { CoreSetup, CoreStart } from 'kibana/server'; +import type { CoreSetup, CoreStart } from '@kbn/core/server'; import type { FoobarPluginSetup, FoobarPluginStart } from '../../foobar/server'; interface DemoSetupPlugins { <1> diff --git a/docs/developer/best-practices/performance.asciidoc b/docs/developer/best-practices/performance.asciidoc index 5d7bee2d58e6e..05489a36f9c7b 100644 --- a/docs/developer/best-practices/performance.asciidoc +++ b/docs/developer/best-practices/performance.asciidoc @@ -24,7 +24,7 @@ plugin bundle, therefore, reducing its size by a significant amount. [source,typescript] ---- -import type { Plugin, CoreSetup, AppMountParameters } from 'kibana/public'; +import type { Plugin, CoreSetup, AppMountParameters } from '@kbn/core/public'; export class MyPlugin implements Plugin { setup(core: CoreSetup, plugins: SetupDeps) { core.application.register({ diff --git a/docs/developer/plugin/migrating-legacy-plugins-examples.asciidoc b/docs/developer/plugin/migrating-legacy-plugins-examples.asciidoc index e7468c60a2ebc..b674d084a76ca 100644 --- a/docs/developer/plugin/migrating-legacy-plugins-examples.asciidoc +++ b/docs/developer/plugin/migrating-legacy-plugins-examples.asciidoc @@ -60,7 +60,7 @@ in the _constructor_ of the plugin: *plugins/my_plugin/(public|server)/index.ts* [source,typescript] ---- -import type { PluginInitializerContext } from 'kibana/server'; +import type { PluginInitializerContext } from '@kbn/core/server'; import { MyPlugin } from './plugin'; export function plugin(initializerContext: PluginInitializerContext) { @@ -71,7 +71,7 @@ export function plugin(initializerContext: PluginInitializerContext) { *plugins/my_plugin/(public|server)/plugin.ts* [source,typescript] ---- -import { CoreSetup, Logger, Plugin, PluginInitializerContext, PluginName } from 'kibana/server'; +import { CoreSetup, Logger, Plugin, PluginInitializerContext, PluginName } from '@kbn/core/server'; import type { MyPluginConfig } from './config'; export class MyPlugin implements Plugin { @@ -118,7 +118,7 @@ same name in `plugins/demoplugin` with the following files: [source,typescript] ---- import { schema, TypeOf } from '@kbn/config-schema'; -import type { PluginInitializerContext } from 'kibana/server'; +import type { PluginInitializerContext } from '@kbn/core/server'; import { DemoPlugin } from './plugin'; export const config = { @@ -136,7 +136,7 @@ export { DemoPluginSetup } from './plugin'; *plugins/demoplugin/server/plugin.ts* [source,typescript] ---- -import type { PluginInitializerContext, Plugin, CoreSetup } from 'kibana/server'; +import type { PluginInitializerContext, Plugin, CoreSetup } from '@kbn/core/server'; import type { DemoPluginConfig } from '.'; export interface DemoPluginSetup {}; @@ -205,7 +205,7 @@ to the {kib} platform format: [source,typescript] ---- import { schema } from '@kbn/config-schema'; -import type { CoreSetup } from 'kibana/server'; +import type { CoreSetup } from '@kbn/core/server'; export class DemoPlugin { public setup(core: CoreSetup) { @@ -239,7 +239,7 @@ migration is complete: [source,typescript] ---- import { schema } from '@kbn/config-schema'; -import { CoreSetup } from 'kibana/server'; +import { CoreSetup } from '@kbn/core/server'; import Boom from '@hapi/boom'; export class DemoPlugin { @@ -706,7 +706,7 @@ First type: *plugins/demoplugin/server/saved_objects/first_type.ts* [source,typescript] ---- -import type { SavedObjectsType } from 'kibana/server'; +import type { SavedObjectsType } from '@kbn/core/server'; export const firstType: SavedObjectsType = { name: 'first-type', @@ -744,7 +744,7 @@ Second type: *plugins/demoplugin/server/saved_objects/second_type.ts* [source,typescript] ---- -import type { SavedObjectsType } from 'kibana/server'; +import type { SavedObjectsType } from '@kbn/core/server'; export const secondType: SavedObjectsType = { name: 'second-type', @@ -979,7 +979,7 @@ Legacy Elasticsearch library until the additional announcements. [source,typescript] ---- // Kibana provides a few typings for internal purposes -import type { SearchResponse } from 'kibana/server'; +import type { SearchResponse } from '@kbn/core/server'; type SearchSource = {...}; type SearchBody = SearchResponse; const { body } = await client.search(...); diff --git a/docs/developer/plugin/testing-kibana-plugin.asciidoc b/docs/developer/plugin/testing-kibana-plugin.asciidoc index 6e856d2e2578a..7757f47df0c42 100644 --- a/docs/developer/plugin/testing-kibana-plugin.asciidoc +++ b/docs/developer/plugin/testing-kibana-plugin.asciidoc @@ -11,7 +11,7 @@ plugins always rely on valid public contracts: *my_plugin/server/plugin.test.ts* [source,typescript] ---- -import { configServiceMock } from 'kibana/server/mocks'; +import { configServiceMock } from '@kbn/core/server/mocks'; const configService = configServiceMock.create(); configService.atPath.mockReturnValue(config$); @@ -24,7 +24,7 @@ Or if you need to get the whole core `setup` or `start` contracts: *my_plugin/server/plugin.test.ts* [source,typescript] ---- -import { coreMock } from 'kibana/public/mocks'; +import { coreMock } from '@kbn/core/public/mocks'; const coreSetup = coreMock.createSetup(); coreSetup.uiSettings.get.mockImplementation((key: string) => { diff --git a/packages/kbn-alerts/src/hooks/use_get_alerts_permissions/index.ts b/packages/kbn-alerts/src/hooks/use_get_alerts_permissions/index.ts index 2f2c0967c32f2..dc9e3f8ccee57 100644 --- a/packages/kbn-alerts/src/hooks/use_get_alerts_permissions/index.ts +++ b/packages/kbn-alerts/src/hooks/use_get_alerts_permissions/index.ts @@ -9,7 +9,7 @@ import { useEffect, useState } from 'react'; // TODO: I have to use any here for now, but once this is available below, we should use the correct types, https://github.com/elastic/kibana/issues/100715 -// import { Capabilities } from 'kibana/public'; +// import { Capabilities } from '@kbn/core/public'; type Capabilities = any; export interface UseGetUserAlertsPermissionsProps { crud: boolean; diff --git a/packages/kbn-securitysolution-autocomplete/src/field_value_lists/index.tsx b/packages/kbn-securitysolution-autocomplete/src/field_value_lists/index.tsx index 64432b1480df3..2d87c3523a839 100644 --- a/packages/kbn-securitysolution-autocomplete/src/field_value_lists/index.tsx +++ b/packages/kbn-securitysolution-autocomplete/src/field_value_lists/index.tsx @@ -16,7 +16,7 @@ import { filterFieldToList } from '../filter_field_to_list'; import { getGenericComboBoxProps } from '../get_generic_combo_box_props'; // TODO: I have to use any here for now, but once this is available below, we should use the correct types, https://github.com/elastic/kibana/issues/100715 -// import { HttpStart } from 'kibana/public'; +// import { HttpStart } from '@kbn/core/public'; type HttpStart = any; import * as i18n from '../translations'; diff --git a/src/core/index.ts b/src/core/index.ts deleted file mode 100644 index 2dad5167d5524..0000000000000 --- a/src/core/index.ts +++ /dev/null @@ -1,12 +0,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 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import * as Public from './public'; -import * as Server from './server'; - -export { Public, Server }; diff --git a/src/core/server/plugins/types.ts b/src/core/server/plugins/types.ts index a07eff177108e..d41be740018a7 100644 --- a/src/core/server/plugins/types.ts +++ b/src/core/server/plugins/types.ts @@ -61,7 +61,7 @@ export type ExposedToBrowserDescriptor = { * ```typescript * // my_plugin/server/index.ts * import { schema, TypeOf } from '@kbn/config-schema'; - * import { PluginConfigDescriptor } from 'kibana/server'; + * import { PluginConfigDescriptor } from '@kbn/core/server'; * * const configSchema = schema.object({ * secret: schema.string({ defaultValue: 'Only on server' }), diff --git a/tsconfig.base.json b/tsconfig.base.json index 1c0c40e18f999..c1c1539e7b043 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -451,9 +451,6 @@ "@kbn/stack-management-usage-test-plugin/*": ["x-pack/test/usage_collection/plugins/stack_management_usage_test/*"], // END AUTOMATED PACKAGE LISTING // Allows for importing from `kibana` package for the exported types. - "kibana": ["./kibana"], - "kibana/public": ["src/core/public"], - "kibana/server": ["src/core/server"], "@emotion/core": ["typings/@emotion"], "resize-observer-polyfill": ["typings/resize-observer-polyfill"] },