Skip to content

Commit

Permalink
Sustainable Kibana Architecture: Move 11 modules under packages/core (
Browse files Browse the repository at this point in the history
elastic#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 |
  • Loading branch information
gsoldevila authored Dec 23, 2024
1 parent de1064e commit f2a50ef
Show file tree
Hide file tree
Showing 271 changed files with 149 additions and 149 deletions.
22 changes: 11 additions & 11 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
16 changes: 8 additions & 8 deletions docs/developer/best-practices/navigation.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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:*

Expand Down Expand Up @@ -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}`)
Expand All @@ -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.
Expand Down
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

This file was deleted.

This file was deleted.

14 changes: 0 additions & 14 deletions packages/core/application/core-application-browser/jest.config.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/react/kibana_context/root/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../../../tsconfig.base.json",
"extends": "../../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types",
"types": ["jest", "node"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../../../tsconfig.base.json",
"extends": "../../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types",
"types": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../../../tsconfig.base.json",
"extends": "../../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types",
"types": [
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../../../tsconfig.base.json",
"extends": "../../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types",
"types": [
Expand Down
14 changes: 14 additions & 0 deletions src/core/packages/application/browser-internal/jest.config.js
Original file line number Diff line number Diff line change
@@ -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'],
};
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../../../tsconfig.base.json",
"extends": "../../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types",
"types": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
};
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export interface ApplicationStart {
* application.navigateToUrl('/app/discover/some-path') // does not include the current basePath
* application.navigateToUrl('/base-path/s/my-space/app/unknown-app/some-path') // unknown application
* application.navigateToUrl('../discover') // resolve to `/base-path/s/my-space/discover` which is not a path of a known app.
* application.navigateToUrl('../../other-space/discover') // resolve to `/base-path/s/other-space/discover` which is not within the current basePath.
* application.navigateToUrl('../../../other-space/discover') // resolve to `/base-path/s/other-space/discover` which is not within the current basePath.
* ```
*
* @param url - an absolute URL, an absolute path or a relative path, to navigate to.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../../../tsconfig.base.json",
"extends": "../../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types",
"types": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@

module.exports = {
preset: '@kbn/test',
rootDir: '../../../..',
roots: ['<rootDir>/packages/core/analytics/core-analytics-browser'],
rootDir: '../../../../..',
roots: ['<rootDir>/src/core/packages/application/common'],
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../../../tsconfig.base.json",
"extends": "../../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types",
"types": [
Expand Down
14 changes: 14 additions & 0 deletions src/core/packages/apps/browser-internal/jest.config.js
Original file line number Diff line number Diff line change
@@ -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/apps/browser-internal'],
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../../../tsconfig.base.json",
"extends": "../../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types",
"types": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@

module.exports = {
preset: '@kbn/test/jest_node',
rootDir: '../../../..',
roots: ['<rootDir>/packages/core/analytics/core-analytics-server'],
rootDir: '../../../../..',
roots: ['<rootDir>/src/core/packages/apps/server-internal'],
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../../../tsconfig.base.json",
"extends": "../../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types",
"stripInternal": false,
Expand Down
14 changes: 14 additions & 0 deletions src/core/packages/base/browser-internal/jest.config.js
Original file line number Diff line number Diff line change
@@ -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/base/browser-internal'],
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../../../tsconfig.base.json",
"extends": "../../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types",
"types": [
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@

module.exports = {
preset: '@kbn/test/jest_node',
rootDir: '../../../..',
roots: ['<rootDir>/packages/core/base/core-base-common'],
rootDir: '../../../../..',
roots: ['<rootDir>/src/core/packages/base/common'],
};
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit f2a50ef

Please sign in to comment.