Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SKA: Move SharedUX packages under packages/core #205608

Merged
merged 16 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,7 @@ packages/core/base/core-base-server-mocks @elastic/kibana-core
packages/core/capabilities/core-capabilities-browser-mocks @elastic/kibana-core
packages/core/capabilities/core-capabilities-server-mocks @elastic/kibana-core
packages/core/chrome/core-chrome-browser @elastic/appex-sharedux
packages/core/chrome/core-chrome-browser-internal @elastic/appex-sharedux
packages/core/chrome/core-chrome-browser-mocks @elastic/appex-sharedux
packages/core/custom-branding/core-custom-branding-browser @elastic/appex-sharedux
packages/core/custom-branding/core-custom-branding-browser-internal @elastic/appex-sharedux
packages/core/custom-branding/core-custom-branding-browser-mocks @elastic/appex-sharedux
packages/core/custom-branding/core-custom-branding-common @elastic/appex-sharedux
packages/core/custom-branding/core-custom-branding-server @elastic/appex-sharedux
packages/core/custom-branding/core-custom-branding-server-internal @elastic/appex-sharedux
packages/core/custom-branding/core-custom-branding-server-mocks @elastic/appex-sharedux
packages/core/deprecations/core-deprecations-browser-mocks @elastic/kibana-core
packages/core/deprecations/core-deprecations-server-mocks @elastic/kibana-core
packages/core/doc-links/core-doc-links-browser-mocks @elastic/kibana-core
Expand Down Expand Up @@ -113,12 +105,7 @@ packages/core/status/core-status-server-mocks @elastic/kibana-core
packages/core/test-helpers/core-test-helpers-kbn-server @elastic/kibana-core
packages/core/test-helpers/core-test-helpers-model-versions @elastic/kibana-core
packages/core/theme/core-theme-browser-mocks @elastic/kibana-core
packages/core/ui-settings/core-ui-settings-browser @elastic/appex-sharedux
packages/core/ui-settings/core-ui-settings-browser-internal @elastic/appex-sharedux
packages/core/ui-settings/core-ui-settings-browser-mocks @elastic/appex-sharedux
packages/core/ui-settings/core-ui-settings-common @elastic/appex-sharedux
packages/core/ui-settings/core-ui-settings-server @elastic/appex-sharedux
packages/core/ui-settings/core-ui-settings-server-internal @elastic/appex-sharedux
packages/core/ui-settings/core-ui-settings-server-mocks @elastic/appex-sharedux
packages/core/usage-data/core-usage-data-server-mocks @elastic/kibana-core
packages/core/user-settings/core-user-settings-server @elastic/kibana-security
Expand Down Expand Up @@ -307,7 +294,15 @@ src/core/packages/capabilities/browser-internal @elastic/kibana-core
src/core/packages/capabilities/common @elastic/kibana-core
src/core/packages/capabilities/server @elastic/kibana-core
src/core/packages/capabilities/server-internal @elastic/kibana-core
src/core/packages/chrome/browser-internal @elastic/appex-sharedux
src/core/packages/config/server-internal @elastic/kibana-core
src/core/packages/custom-branding/browser @elastic/appex-sharedux
src/core/packages/custom-branding/browser-internal @elastic/appex-sharedux
src/core/packages/custom-branding/browser-mocks @elastic/appex-sharedux
src/core/packages/custom-branding/common @elastic/appex-sharedux
src/core/packages/custom-branding/server @elastic/appex-sharedux
src/core/packages/custom-branding/server-internal @elastic/appex-sharedux
src/core/packages/custom-branding/server-mocks @elastic/appex-sharedux
src/core/packages/deprecations/browser @elastic/kibana-core
src/core/packages/deprecations/browser-internal @elastic/kibana-core
src/core/packages/deprecations/common @elastic/kibana-core
Expand Down Expand Up @@ -414,6 +409,11 @@ src/core/packages/test-helpers/so-type-serializer @elastic/kibana-core
src/core/packages/test-helpers/test-utils @elastic/kibana-core
src/core/packages/theme/browser @elastic/kibana-core
src/core/packages/theme/browser-internal @elastic/kibana-core
src/core/packages/ui-settings/browser @elastic/appex-sharedux
src/core/packages/ui-settings/browser-internal @elastic/appex-sharedux
src/core/packages/ui-settings/common @elastic/appex-sharedux
src/core/packages/ui-settings/server @elastic/appex-sharedux
src/core/packages/ui-settings/server-internal @elastic/appex-sharedux
src/core/packages/usage-data/base-server-internal @elastic/kibana-core
src/core/packages/usage-data/server @elastic/kibana-core
src/core/packages/usage-data/server-internal @elastic/kibana-core
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The {kib-repo}/blob/8.9/src/core/packages/http/server/src/router/request_handler

* {kib-repo}/blob/8.9/src/core/packages/saved-objects/api-server/src/saved_objects_client.ts[`context.savedObjects.client`]
* {kib-repo}/blob/8.9/src/core/packages/elasticsearch/server/src/client/scoped_cluster_client.ts[`context.elasticsearch.client`]
* {kib-repo}/blob/8.9/packages/core/ui-settings/core-ui-settings-server/src/ui_settings_client.ts[`context.uiSettings.client`]
* {kib-repo}/blob/8.9/src/core/packages/ui-settings/server/src/ui_settings_client.ts[`context.uiSettings.client`]

==== Declare a custom scoped service

Expand Down
6 changes: 3 additions & 3 deletions docs/developer/architecture/core/uisettings-service.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ uiSettings:

[[client-side-usage]]
=== Client side usage
On the client, the `uiSettings` service is exposed directly from `core` and the {kib-repo}/blob/8.9/packages/core/ui-settings/core-ui-settings-server/src/ui_settings_client.ts[client]
On the client, the `uiSettings` service is exposed directly from `core` and the {kib-repo}/blob/8.9/src/core/packages/ui-settings/server/src/ui_settings_client.ts[client]
provides plugins access to the `config` entries stored in {es}.

In the interest of performance, `uiSettings` are cached. Any changes that require cache refreshes should register an instruction to reload the page when settings are configured in Advanced Settings using the `requiresPageReload` {kib-repo}/blob/8.9/packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts[parameter].
In the interest of performance, `uiSettings` are cached. Any changes that require cache refreshes should register an instruction to reload the page when settings are configured in Advanced Settings using the `requiresPageReload` {kib-repo}/blob/8.9/src/core/packages/ui-settings/common/src/ui_settings.ts[parameter].

[source,typescript]
----
Expand Down Expand Up @@ -78,7 +78,7 @@ export class MyPlugin implements Plugin<MyPluginSetup, MyPluginStart> {
=== Server side usage
On the server, `uiSettings` are exposed directly from `core`.

The following example shows how to register a new `custom` setting with a default value of '42'. When registering a new setting, you must provide a schema against which validations are performed on read and write. All the other {kib-repo}/blob/8.9/packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts[parameters] are optional.
The following example shows how to register a new `custom` setting with a default value of '42'. When registering a new setting, you must provide a schema against which validations are performed on read and write. All the other {kib-repo}/blob/8.9/src/core/packages/ui-settings/common/src/ui_settings.ts[parameters] are optional.

[source,typescript]
----
Expand Down
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -264,15 +264,15 @@
"@kbn/core-capabilities-server": "link:src/core/packages/capabilities/server",
"@kbn/core-capabilities-server-internal": "link:src/core/packages/capabilities/server-internal",
"@kbn/core-chrome-browser": "link:packages/core/chrome/core-chrome-browser",
"@kbn/core-chrome-browser-internal": "link:packages/core/chrome/core-chrome-browser-internal",
"@kbn/core-chrome-browser-internal": "link:src/core/packages/chrome/browser-internal",
"@kbn/core-config-server-internal": "link:src/core/packages/config/server-internal",
"@kbn/core-custom-branding-browser": "link:packages/core/custom-branding/core-custom-branding-browser",
"@kbn/core-custom-branding-browser-internal": "link:packages/core/custom-branding/core-custom-branding-browser-internal",
"@kbn/core-custom-branding-browser-mocks": "link:packages/core/custom-branding/core-custom-branding-browser-mocks",
"@kbn/core-custom-branding-common": "link:packages/core/custom-branding/core-custom-branding-common",
"@kbn/core-custom-branding-server": "link:packages/core/custom-branding/core-custom-branding-server",
"@kbn/core-custom-branding-server-internal": "link:packages/core/custom-branding/core-custom-branding-server-internal",
"@kbn/core-custom-branding-server-mocks": "link:packages/core/custom-branding/core-custom-branding-server-mocks",
"@kbn/core-custom-branding-browser": "link:src/core/packages/custom-branding/browser",
"@kbn/core-custom-branding-browser-internal": "link:src/core/packages/custom-branding/browser-internal",
"@kbn/core-custom-branding-browser-mocks": "link:src/core/packages/custom-branding/browser-mocks",
"@kbn/core-custom-branding-common": "link:src/core/packages/custom-branding/common",
"@kbn/core-custom-branding-server": "link:src/core/packages/custom-branding/server",
"@kbn/core-custom-branding-server-internal": "link:src/core/packages/custom-branding/server-internal",
"@kbn/core-custom-branding-server-mocks": "link:src/core/packages/custom-branding/server-mocks",
"@kbn/core-deprecations-browser": "link:src/core/packages/deprecations/browser",
"@kbn/core-deprecations-browser-internal": "link:src/core/packages/deprecations/browser-internal",
"@kbn/core-deprecations-common": "link:src/core/packages/deprecations/common",
Expand Down Expand Up @@ -395,11 +395,11 @@
"@kbn/core-test-helpers-test-utils": "link:src/core/packages/test-helpers/test-utils",
"@kbn/core-theme-browser": "link:src/core/packages/theme/browser",
"@kbn/core-theme-browser-internal": "link:src/core/packages/theme/browser-internal",
"@kbn/core-ui-settings-browser": "link:packages/core/ui-settings/core-ui-settings-browser",
"@kbn/core-ui-settings-browser-internal": "link:packages/core/ui-settings/core-ui-settings-browser-internal",
"@kbn/core-ui-settings-common": "link:packages/core/ui-settings/core-ui-settings-common",
"@kbn/core-ui-settings-server": "link:packages/core/ui-settings/core-ui-settings-server",
"@kbn/core-ui-settings-server-internal": "link:packages/core/ui-settings/core-ui-settings-server-internal",
"@kbn/core-ui-settings-browser": "link:src/core/packages/ui-settings/browser",
"@kbn/core-ui-settings-browser-internal": "link:src/core/packages/ui-settings/browser-internal",
"@kbn/core-ui-settings-common": "link:src/core/packages/ui-settings/common",
"@kbn/core-ui-settings-server": "link:src/core/packages/ui-settings/server",
"@kbn/core-ui-settings-server-internal": "link:src/core/packages/ui-settings/server-internal",
"@kbn/core-usage-data-base-server-internal": "link:src/core/packages/usage-data/base-server-internal",
"@kbn/core-usage-data-server": "link:src/core/packages/usage-data/server",
"@kbn/core-usage-data-server-internal": "link:src/core/packages/usage-data/server-internal",
Expand Down

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion packages/shared-ux/chrome/solution_navigation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ navigation.addSolutionNavigation({
#### Navigation tree API

> **Warning**
> The API reference is manually maintained and might be out of date. Please refer [to the source](https://github.com/elastic/kibana/blob/main/packages/core/chrome/core-chrome-browser/src/project_navigation.ts) for the most up-to-date information, until we have automated the API reference.
> The API reference is manually maintained and might be out of date. Please refer [to the source](https://github.com/elastic/kibana/blob/main/src/core/packages/chrome/browser/src/project_navigation.ts) for the most up-to-date information, until we have automated the API reference.

##### `NavigationTreeDefinition`

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/chrome/core-chrome-browser-internal'],
rootDir: '../../../../..',
roots: ['<rootDir>/src/core/packages/chrome/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/ui-settings/core-ui-settings-browser-internal'],
rootDir: '../../../../../',
roots: ['<rootDir>/src/core/packages/custom-branding/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/ui-settings/core-ui-settings-browser'],
rootDir: '../../../../..',
roots: ['<rootDir>/src/core/packages/custom-branding/browser-mocks'],
};
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
@@ -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 @@ -22,7 +22,7 @@ export interface CustomBranding {
pageTitle?: string;
/**
* Custom replacement for Elastic Mark
* @link packages/core/chrome/core-chrome-browser-internal/src/ui/header/elastic_mark.tsx
* @link src/core/packages/chrome/browser-internal/src/ui/header/elastic_mark.tsx
*/
customizedLogo?: string;
/**
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/jest_node',
rootDir: '../../../..',
roots: ['<rootDir>/packages/core/ui-settings/core-ui-settings-server-internal'],
rootDir: '../../../../../',
roots: ['<rootDir>/src/core/packages/custom-branding/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
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/ui-settings/core-ui-settings-server'],
rootDir: '../../../../..',
roots: ['<rootDir>/src/core/packages/custom-branding/server-mocks'],
};
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
@@ -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/ui-settings/core-ui-settings-common'],
rootDir: '../../../../..',
roots: ['<rootDir>/src/core/packages/ui-settings/browser-internal'],
};
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ You can use \`IUiSettingsClient.get("${key}", defaultValue)\`, which will just r

isDeclared(key: string) {
return (
// @ts-ignore
// @ts-expect-error
(key !== '__proto__' || key !== 'constructor' || key !== 'prototype') && key in this.cache
);
}
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
14 changes: 14 additions & 0 deletions src/core/packages/ui-settings/browser/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/ui-settings/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
14 changes: 14 additions & 0 deletions src/core/packages/ui-settings/common/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/ui-settings/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
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/custom-branding/core-custom-branding-server-mocks'],
rootDir: '../../../../..',
roots: ['<rootDir>/src/core/packages/ui-settings/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
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/custom-branding/core-custom-branding-server-internal'],
rootDir: '../../../../..',
roots: ['<rootDir>/src/core/packages/ui-settings/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
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ A `FormRow` represents a single UiSetting, and is responsible for rendering the
## Notes

- This implementation was extracted from the `advancedSettings` plugin.
- The type for a `UiSettingMetadata` is limited due to the permissive nature of the [`UiSettingsParam` type](packages/core/ui-settings/core-ui-settings-common/src/ui_settings.ts).
- The type for a `UiSettingMetadata` is limited due to the permissive nature of the [`UiSettingsParam` type](src/core/packages/ui-settings/common/src/ui_settings.ts).
- The source includes notations of several bugs which will surface if the assumptions about default settings from Kibana change.

## Testing
Expand Down
Loading
Loading