mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Sustainable Kibana Architecture: Move 11 modules under packages/core
(#203638)
## Summary This PR aims at relocating some of the Kibana modules (plugins and packages) into a new folder structure, according to the _Sustainable Kibana Architecture_ initiative. > [!IMPORTANT] > * We kindly ask you to: > * Manually fix the errors in the error section below (if there are any). > * Search for the `packages[\/\\]` and `plugins[\/\\]` patterns in the source code (Babel and Eslint config files), and update them appropriately. > * Manually review `.buildkite/scripts/pipelines/pull_request/pipeline.ts` to ensure that any CI pipeline customizations continue to be correctly applied after the changed path names > * Review all of the updated files, specially the `.ts` and `.js` files listed in the sections below, as some of them contain relative paths that have been updated. > * Think of potential impact of the move, including tooling and configuration files that can be pointing to the relocated modules. E.g.: > * customised eslint rules > * docs pointing to source code > [!NOTE] > This PR has been auto-generated. > Do not attempt to push any changes unless you know what you are doing. > Please use [#sustainable_kibana_architecture](https://elastic.slack.com/archives/C07TCKTA22E) Slack channel for feedback. #### 11 package(s) are going to be relocated: | Id | Target folder | | -- | ------------- | | @kbn/core-analytics-browser | src/core/packages/analytics/browser | | @kbn/core-analytics-browser-internal | src/core/packages/analytics/browser-internal | | @kbn/core-analytics-server | src/core/packages/analytics/server | | @kbn/core-analytics-server-internal | src/core/packages/analytics/server-internal | | @kbn/core-application-browser | src/core/packages/application/browser | | @kbn/core-application-browser-internal | src/core/packages/application/browser-internal | | @kbn/core-application-common | src/core/packages/application/common | | @kbn/core-apps-browser-internal | src/core/packages/apps/browser-internal | | @kbn/core-apps-server-internal | src/core/packages/apps/server-internal | | @kbn/core-base-browser-internal | src/core/packages/base/browser-internal | | @kbn/core-base-common | src/core/packages/base/common |
This commit is contained in:
parent
de1064e103
commit
f2a50ef30d
271 changed files with 149 additions and 149 deletions
22
.github/CODEOWNERS
vendored
22
.github/CODEOWNERS
vendored
|
@ -54,22 +54,11 @@ packages/content-management/table_list_view @elastic/appex-sharedux
|
|||
packages/content-management/table_list_view_common @elastic/appex-sharedux
|
||||
packages/content-management/table_list_view_table @elastic/appex-sharedux
|
||||
packages/content-management/user_profiles @elastic/appex-sharedux
|
||||
packages/core/analytics/core-analytics-browser @elastic/kibana-core
|
||||
packages/core/analytics/core-analytics-browser-internal @elastic/kibana-core
|
||||
packages/core/analytics/core-analytics-browser-mocks @elastic/kibana-core
|
||||
packages/core/analytics/core-analytics-server @elastic/kibana-core
|
||||
packages/core/analytics/core-analytics-server-internal @elastic/kibana-core
|
||||
packages/core/analytics/core-analytics-server-mocks @elastic/kibana-core
|
||||
packages/core/application/core-application-browser @elastic/kibana-core
|
||||
packages/core/application/core-application-browser-internal @elastic/kibana-core
|
||||
packages/core/application/core-application-browser-mocks @elastic/kibana-core
|
||||
packages/core/application/core-application-common @elastic/kibana-core
|
||||
packages/core/apps/core-apps-browser-internal @elastic/kibana-core
|
||||
packages/core/apps/core-apps-browser-mocks @elastic/kibana-core
|
||||
packages/core/apps/core-apps-server-internal @elastic/kibana-core
|
||||
packages/core/base/core-base-browser-internal @elastic/kibana-core
|
||||
packages/core/base/core-base-browser-mocks @elastic/kibana-core
|
||||
packages/core/base/core-base-common @elastic/kibana-core
|
||||
packages/core/base/core-base-common-internal @elastic/kibana-core
|
||||
packages/core/base/core-base-server-internal @elastic/kibana-core
|
||||
packages/core/base/core-base-server-mocks @elastic/kibana-core
|
||||
|
@ -558,6 +547,17 @@ packages/shared-ux/storybook/config @elastic/appex-sharedux
|
|||
packages/shared-ux/storybook/mock @elastic/appex-sharedux
|
||||
packages/shared-ux/table_persist @elastic/appex-sharedux
|
||||
src/core @elastic/kibana-core
|
||||
src/core/packages/analytics/browser @elastic/kibana-core
|
||||
src/core/packages/analytics/browser-internal @elastic/kibana-core
|
||||
src/core/packages/analytics/server @elastic/kibana-core
|
||||
src/core/packages/analytics/server-internal @elastic/kibana-core
|
||||
src/core/packages/application/browser @elastic/kibana-core
|
||||
src/core/packages/application/browser-internal @elastic/kibana-core
|
||||
src/core/packages/application/common @elastic/kibana-core
|
||||
src/core/packages/apps/browser-internal @elastic/kibana-core
|
||||
src/core/packages/apps/server-internal @elastic/kibana-core
|
||||
src/core/packages/base/browser-internal @elastic/kibana-core
|
||||
src/core/packages/base/common @elastic/kibana-core
|
||||
src/platform/packages/private/default-nav/devtools @elastic/kibana-management
|
||||
src/platform/packages/private/default-nav/management @elastic/kibana-management
|
||||
src/platform/packages/private/default-nav/ml @elastic/ml-ui
|
||||
|
|
|
@ -29,7 +29,7 @@ export class MyPlugin implements Plugin {
|
|||
}
|
||||
}
|
||||
----
|
||||
<1> Refer to {kib-repo}/blob/8.9/packages/core/application/core-application-browser/src/contracts.ts[application.register interface]
|
||||
<1> Refer to {kib-repo}tree/{branch}/packages/core/application/core-application-browser/src/contracts.ts[application.register interface]
|
||||
<2> Application specific URL.
|
||||
<3> `mount` callback is invoked when a user navigates to the application-specific URL.
|
||||
<4> `core.getStartServices` method provides API available during `start` lifecycle.
|
||||
|
|
|
@ -39,7 +39,7 @@ Registering a feature consists of the following fields. For more information, co
|
|||
|A human readable name for your feature.
|
||||
|
||||
|`category` (required)
|
||||
|{kib-repo}blob/{branch}/packages/core/application/core-application-common/src/app_category.ts[`AppCategory`]
|
||||
|{kib-repo}blob/{branch}/src/core/packages/application/common/src/app_category.ts[`AppCategory`]
|
||||
|`DEFAULT_APP_CATEGORIES.kibana`
|
||||
|The `AppCategory` which best represents your feature. Used to organize the display
|
||||
of features within the management screens.
|
||||
|
|
|
@ -87,13 +87,13 @@ window.location.href = urlToADashboard;
|
|||
|
||||
To navigate between different {kib} apps without a page reload (by default) there are APIs in `core`:
|
||||
|
||||
* {kib-repo}tree/{branch}/packages/core/application/core-application-browser/src/contracts.ts[core.application.navigateToApp]
|
||||
* {kib-repo}tree/{branch}/packages/core/application/core-application-browser/src/contracts.ts[core.application.navigateToUrl]
|
||||
* {kib-repo}tree/{branch}/src/core/packages/application/browser/src/contracts.ts[core.application.navigateToApp]
|
||||
* {kib-repo}tree/{branch}/src/core/packages/application/browser/src/contracts.ts[core.application.navigateToUrl]
|
||||
|
||||
Both methods offer customization such as opening the target in a new page, with an `options` parameter. All the options are optional be default.
|
||||
|
||||
* {kib-repo}tree/{branch}/packages/core/application/core-application-browser/src/contracts.ts[core.application.navigateToApp options]
|
||||
* {kib-repo}tree/{branch}/packages/core/application/core-application-browser/src/contracts.ts[core.application.navigateToUrl options]
|
||||
* {kib-repo}tree/{branch}/src/core/packages/application/browser/src/contracts.ts[core.application.navigateToApp options]
|
||||
* {kib-repo}tree/{branch}/src/core/packages/application/browser/src/contracts.ts[core.application.navigateToUrl options]
|
||||
|
||||
*Rendering a link to a different {kib} app on its own would also cause a full page reload:*
|
||||
|
||||
|
@ -163,8 +163,8 @@ Common rules to follow in this scenario:
|
|||
|
||||
This is required to make sure `core` is aware of navigations triggered inside your app, so it could act accordingly when needed.
|
||||
|
||||
* `Core`'s {kib-repo}tree/{branch}/packages/core/application/core-application-browser/src/scoped_history.ts[ScopedHistory] instance.
|
||||
* {kib-repo}tree/{branch}/packages/core/application/core-application-browser/src/app_mount.ts[Example usage]
|
||||
* `Core`'s {kib-repo}tree/{branch}/src/core/packages/application/browser/src/scoped_history.ts[ScopedHistory] instance.
|
||||
* {kib-repo}tree/{branch}/src/core/packages/application/browser/src/app_mount.ts[Example usage]
|
||||
* {kib-repo}tree/{branch}/test/plugin_functional/plugins/core_plugin_a/public/application.tsx#L120[Example plugin]
|
||||
|
||||
Relative links will be resolved relative to your app's route (e.g.: `http://localhost5601/app/{your-app-id}`)
|
||||
|
@ -181,14 +181,14 @@ const MyInternalLink = () => <Link to="/my-other-page"></Link>
|
|||
=== Using history and browser location
|
||||
|
||||
Try to avoid using `window.location` and `window.history` directly. +
|
||||
Instead, consider using {kib-repo}tree/{branch}/packages/core/application/core-application-browser/src/scoped_history.ts[ScopedHistory]
|
||||
Instead, consider using {kib-repo}tree/{branch}/src/core/packages/application/browser/src/scoped_history.ts[ScopedHistory]
|
||||
instance provided by `core`.
|
||||
|
||||
* This way `core` will know about location changes triggered within your app, and it would act accordingly.
|
||||
* Some plugins are listening to location changes. Triggering location change manually could lead to unpredictable and hard-to-catch bugs.
|
||||
|
||||
Common use-case for using
|
||||
`core`'s {kib-repo}tree/{branch}/packages/core/application/core-application-browser/src/scoped_history.ts[ScopedHistory] directly:
|
||||
`core`'s {kib-repo}tree/{branch}/src/core/packages/application/browser/src/scoped_history.ts[ScopedHistory] directly:
|
||||
|
||||
* Reading/writing query params or hash.
|
||||
* Imperatively triggering internal navigations within your app.
|
||||
|
|
22
package.json
22
package.json
|
@ -245,18 +245,18 @@
|
|||
"@kbn/controls-example-plugin": "link:examples/controls_example",
|
||||
"@kbn/controls-plugin": "link:src/plugins/controls",
|
||||
"@kbn/core": "link:src/core",
|
||||
"@kbn/core-analytics-browser": "link:packages/core/analytics/core-analytics-browser",
|
||||
"@kbn/core-analytics-browser-internal": "link:packages/core/analytics/core-analytics-browser-internal",
|
||||
"@kbn/core-analytics-server": "link:packages/core/analytics/core-analytics-server",
|
||||
"@kbn/core-analytics-server-internal": "link:packages/core/analytics/core-analytics-server-internal",
|
||||
"@kbn/core-analytics-browser": "link:src/core/packages/analytics/browser",
|
||||
"@kbn/core-analytics-browser-internal": "link:src/core/packages/analytics/browser-internal",
|
||||
"@kbn/core-analytics-server": "link:src/core/packages/analytics/server",
|
||||
"@kbn/core-analytics-server-internal": "link:src/core/packages/analytics/server-internal",
|
||||
"@kbn/core-app-status-plugin": "link:test/plugin_functional/plugins/core_app_status",
|
||||
"@kbn/core-application-browser": "link:packages/core/application/core-application-browser",
|
||||
"@kbn/core-application-browser-internal": "link:packages/core/application/core-application-browser-internal",
|
||||
"@kbn/core-application-common": "link:packages/core/application/core-application-common",
|
||||
"@kbn/core-apps-browser-internal": "link:packages/core/apps/core-apps-browser-internal",
|
||||
"@kbn/core-apps-server-internal": "link:packages/core/apps/core-apps-server-internal",
|
||||
"@kbn/core-base-browser-internal": "link:packages/core/base/core-base-browser-internal",
|
||||
"@kbn/core-base-common": "link:packages/core/base/core-base-common",
|
||||
"@kbn/core-application-browser": "link:src/core/packages/application/browser",
|
||||
"@kbn/core-application-browser-internal": "link:src/core/packages/application/browser-internal",
|
||||
"@kbn/core-application-common": "link:src/core/packages/application/common",
|
||||
"@kbn/core-apps-browser-internal": "link:src/core/packages/apps/browser-internal",
|
||||
"@kbn/core-apps-server-internal": "link:src/core/packages/apps/server-internal",
|
||||
"@kbn/core-base-browser-internal": "link:src/core/packages/base/browser-internal",
|
||||
"@kbn/core-base-common": "link:src/core/packages/base/common",
|
||||
"@kbn/core-base-common-internal": "link:packages/core/base/core-base-common-internal",
|
||||
"@kbn/core-base-server-internal": "link:packages/core/base/core-base-server-internal",
|
||||
"@kbn/core-capabilities-browser-internal": "link:packages/core/capabilities/core-capabilities-browser-internal",
|
||||
|
|
|
@ -1,14 +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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
|
||||
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
preset: '@kbn/test',
|
||||
rootDir: '../../../..',
|
||||
roots: ['<rootDir>/packages/core/analytics/core-analytics-browser-internal'],
|
||||
};
|
|
@ -1,14 +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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
|
||||
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
preset: '@kbn/test',
|
||||
rootDir: '../../../..',
|
||||
roots: ['<rootDir>/packages/core/application/core-application-browser-internal'],
|
||||
};
|
|
@ -1,14 +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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
|
||||
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
preset: '@kbn/test',
|
||||
rootDir: '../../../..',
|
||||
roots: ['<rootDir>/packages/core/application/core-application-browser'],
|
||||
};
|
|
@ -25,7 +25,7 @@ DEPS = [
|
|||
"@npm//react",
|
||||
"@npm//tslib",
|
||||
"@npm//@elastic/eui",
|
||||
"//packages/core/base/core-base-common",
|
||||
"//src/core/packages/base/common:core-base-common",
|
||||
"//packages/shared-ux/router/impl:shared-ux-router",
|
||||
]
|
||||
|
||||
|
|
|
@ -9,6 +9,6 @@
|
|||
|
||||
module.exports = {
|
||||
preset: '@kbn/test',
|
||||
rootDir: '../../../..',
|
||||
roots: ['<rootDir>/packages/core/application/core-application-common'],
|
||||
rootDir: '../../../../..',
|
||||
roots: ['<rootDir>/src/core/packages/analytics/browser-internal'],
|
||||
};
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"extends": "../../../../tsconfig.base.json",
|
||||
"extends": "../../../../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "target/types",
|
||||
"types": ["jest", "node"]
|
|
@ -9,6 +9,6 @@
|
|||
|
||||
module.exports = {
|
||||
preset: '@kbn/test',
|
||||
rootDir: '../../../..',
|
||||
roots: ['<rootDir>/packages/core/apps/core-apps-browser-internal'],
|
||||
rootDir: '../../../../..',
|
||||
roots: ['<rootDir>/src/core/packages/analytics/browser'],
|
||||
};
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"extends": "../../../../tsconfig.base.json",
|
||||
"extends": "../../../../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "target/types",
|
||||
"types": [
|
|
@ -9,6 +9,6 @@
|
|||
|
||||
module.exports = {
|
||||
preset: '@kbn/test/jest_node',
|
||||
rootDir: '../../../..',
|
||||
roots: ['<rootDir>/packages/core/analytics/core-analytics-server-internal'],
|
||||
rootDir: '../../../../..',
|
||||
roots: ['<rootDir>/src/core/packages/analytics/server-internal'],
|
||||
};
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"extends": "../../../../tsconfig.base.json",
|
||||
"extends": "../../../../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "target/types",
|
||||
"types": [
|
|
@ -9,6 +9,6 @@
|
|||
|
||||
module.exports = {
|
||||
preset: '@kbn/test/jest_node',
|
||||
rootDir: '../../../..',
|
||||
roots: ['<rootDir>/packages/core/apps/core-apps-server-internal'],
|
||||
rootDir: '../../../../..',
|
||||
roots: ['<rootDir>/src/core/packages/analytics/server'],
|
||||
};
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"extends": "../../../../tsconfig.base.json",
|
||||
"extends": "../../../../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "target/types",
|
||||
"types": [
|
|
@ -0,0 +1,14 @@
|
|||
/*
|
||||
* 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", the "GNU Affero General Public License v3.0 only", 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", the "GNU Affero General Public
|
||||
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
preset: '@kbn/test',
|
||||
rootDir: '../../../../..',
|
||||
roots: ['<rootDir>/src/core/packages/application/browser-internal'],
|
||||
};
|
|
@ -9,6 +9,6 @@
|
|||
|
||||
module.exports = {
|
||||
preset: '@kbn/test/jest_integration',
|
||||
rootDir: '../../../..',
|
||||
roots: ['<rootDir>/packages/core/application/core-application-browser-internal'],
|
||||
rootDir: '../../../../..',
|
||||
roots: ['<rootDir>/src/core/packages/application/browser-internal'],
|
||||
};
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"extends": "../../../../tsconfig.base.json",
|
||||
"extends": "../../../../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "target/types",
|
||||
"types": [
|
|
@ -9,6 +9,6 @@
|
|||
|
||||
module.exports = {
|
||||
preset: '@kbn/test',
|
||||
rootDir: '../../../..',
|
||||
roots: ['<rootDir>/packages/core/base/core-base-browser-internal'],
|
||||
rootDir: '../../../../..',
|
||||
roots: ['<rootDir>/src/core/packages/application/browser'],
|
||||
};
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue