SKA: Categorise remaining packages (#205875)

## Summary

* Delete unused package `@kbn/formatters`
* Delete unused package `@kbn/response-ops-feature-flag-service`
* Flag `@kbn/generate-console-definitions` as `devOnly: true`
* Flag `@kbn/plugin-check` as `devOnly: true`
* Flag `@kbn/set-map` as `devOnly: true`
* Flag `@kbn/synthetics-private-location` as `devOnly: true`
* Categorise `@kbn/calculate-auto` as `platform/shared`
* Categorise `@kbn/charts-theme` as `platform/shared`
* Categorise `@kbn/saved-search-component` as `platform/shared`
* Categorise `@kbn/use-tracked-promise` as `platform/shared`
* Categorise `@kbn/charts-theme` as `platform/shared`
* Categorise `@kbn/response-ops-rule-form` as `platform/shared`
This commit is contained in:
Gerard Soldevila 2025-01-08 22:20:14 +01:00 committed by GitHub
parent 63c0d185ef
commit 2be928c489
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
32 changed files with 35 additions and 279 deletions

2
.github/CODEOWNERS vendored
View file

@ -146,7 +146,6 @@ packages/kbn-eslint-plugin-telemetry @elastic/obs-knowledge-team
packages/kbn-expect @elastic/kibana-operations @elastic/appex-qa
packages/kbn-failed-test-reporter-cli @elastic/kibana-operations @elastic/appex-qa
packages/kbn-find-used-node-modules @elastic/kibana-operations
packages/kbn-formatters @elastic/obs-ux-logs-team
packages/kbn-ftr-common-functional-services @elastic/kibana-operations @elastic/appex-qa
packages/kbn-ftr-common-functional-ui-services @elastic/appex-qa
packages/kbn-ftr-screenshot-filename @elastic/kibana-operations @elastic/appex-qa
@ -222,7 +221,6 @@ packages/react/kibana_context/root @elastic/appex-sharedux
packages/react/kibana_context/styled @elastic/appex-sharedux
packages/react/kibana_context/theme @elastic/appex-sharedux
packages/react/kibana_mount @elastic/appex-sharedux
packages/response-ops/feature_flag_service @elastic/response-ops
packages/response-ops/rule_form @elastic/response-ops
packages/serverless/project_switcher @elastic/appex-sharedux
packages/serverless/settings/common @elastic/appex-sharedux @elastic/kibana-management

View file

@ -2,6 +2,8 @@
"type": "plugin",
"id": "@kbn/grid-example-plugin",
"owner": "@elastic/kibana-presentation",
"group": "platform",
"visibility": "private",
"description": "Temporary example app used to build out the new Dashboard layout system",
"plugin": {
"id": "gridExample",

View file

@ -539,11 +539,9 @@
"@kbn/fleet-plugin": "link:x-pack/platform/plugins/shared/fleet",
"@kbn/flot-charts": "link:src/platform/packages/shared/kbn-flot-charts",
"@kbn/foo-plugin": "link:x-pack/test/ui_capabilities/common/plugins/foo_plugin",
"@kbn/formatters": "link:packages/kbn-formatters",
"@kbn/ftr-apis-plugin": "link:src/platform/plugins/private/ftr_apis",
"@kbn/functional-with-es-ssl-cases-test-plugin": "link:x-pack/test/functional_with_es_ssl/plugins/cases",
"@kbn/gen-ai-streaming-response-example-plugin": "link:x-pack/examples/gen_ai_streaming_response_example",
"@kbn/generate-console-definitions": "link:packages/kbn-generate-console-definitions",
"@kbn/generate-csv": "link:src/platform/packages/private/kbn-generate-csv",
"@kbn/global-search-bar-plugin": "link:x-pack/platform/plugins/private/global_search_bar",
"@kbn/global-search-plugin": "link:x-pack/platform/plugins/shared/global_search",
@ -719,7 +717,6 @@
"@kbn/painless-lab-plugin": "link:x-pack/platform/plugins/private/painless_lab",
"@kbn/palettes": "link:packages/kbn-palettes",
"@kbn/panel-loader": "link:src/platform/packages/private/kbn-panel-loader",
"@kbn/plugin-check": "link:packages/kbn-plugin-check",
"@kbn/portable-dashboards-example": "link:examples/portable_dashboards_example",
"@kbn/preboot-example-plugin": "link:examples/preboot_example",
"@kbn/presentation-containers": "link:src/platform/packages/shared/presentation/presentation_containers",
@ -761,7 +758,6 @@
"@kbn/resizable-layout": "link:src/platform/packages/shared/kbn-resizable-layout",
"@kbn/resizable-layout-examples-plugin": "link:examples/resizable_layout_examples",
"@kbn/resolver-test-plugin": "link:x-pack/test/plugin_functional/plugins/resolver_test",
"@kbn/response-ops-feature-flag-service": "link:packages/response-ops/feature_flag_service",
"@kbn/response-ops-rule-form": "link:packages/response-ops/rule_form",
"@kbn/response-ops-rule-params": "link:src/platform/packages/shared/response-ops/rule_params",
"@kbn/response-stream-plugin": "link:examples/response_stream",
@ -874,7 +870,6 @@
"@kbn/serverless-types": "link:packages/serverless/types",
"@kbn/session-notifications-plugin": "link:test/plugin_functional/plugins/session_notifications",
"@kbn/session-view-plugin": "link:x-pack/solutions/security/plugins/session_view",
"@kbn/set-map": "link:packages/kbn-set-map",
"@kbn/share-examples-plugin": "link:examples/share_examples",
"@kbn/share-plugin": "link:src/platform/plugins/shared/share",
"@kbn/shared-svg": "link:src/platform/packages/shared/kbn-shared-svg",
@ -948,7 +943,6 @@
"@kbn/streams-plugin": "link:x-pack/solutions/observability/plugins/streams",
"@kbn/streams-schema": "link:x-pack/packages/kbn-streams-schema",
"@kbn/synthetics-plugin": "link:x-pack/solutions/observability/plugins/synthetics",
"@kbn/synthetics-private-location": "link:x-pack/packages/kbn-synthetics-private-location",
"@kbn/task-manager-fixture-plugin": "link:x-pack/test/alerting_api_integration/common/plugins/task_manager_fixture",
"@kbn/task-manager-performance-plugin": "link:x-pack/test/plugin_api_perf/plugins/task_manager_performance",
"@kbn/task-manager-plugin": "link:x-pack/platform/plugins/shared/task_manager",
@ -1464,6 +1458,7 @@
"@kbn/ftr-screenshot-filename": "link:packages/kbn-ftr-screenshot-filename",
"@kbn/gen-ai-functional-testing": "link:packages/kbn-gen-ai-functional-testing",
"@kbn/generate": "link:packages/kbn-generate",
"@kbn/generate-console-definitions": "link:packages/kbn-generate-console-definitions",
"@kbn/get-repo-files": "link:packages/kbn-get-repo-files",
"@kbn/import-locator": "link:packages/kbn-import-locator",
"@kbn/import-resolver": "link:packages/kbn-import-resolver",
@ -1489,6 +1484,7 @@
"@kbn/peggy-loader": "link:packages/kbn-peggy-loader",
"@kbn/performance-testing-dataset-extractor": "link:packages/kbn-performance-testing-dataset-extractor",
"@kbn/picomatcher": "link:packages/kbn-picomatcher",
"@kbn/plugin-check": "link:packages/kbn-plugin-check",
"@kbn/plugin-generator": "link:packages/kbn-plugin-generator",
"@kbn/plugin-helpers": "link:packages/kbn-plugin-helpers",
"@kbn/product-doc-artifact-builder": "link:x-pack/packages/ai-infra/product-doc-artifact-builder",
@ -1503,12 +1499,14 @@
"@kbn/scout-reporting": "link:packages/kbn-scout-reporting",
"@kbn/security-api-integration-helpers": "link:x-pack/test/security_api_integration/packages/helpers",
"@kbn/serverless-storybook-config": "link:packages/serverless/storybook/config",
"@kbn/set-map": "link:packages/kbn-set-map",
"@kbn/some-dev-log": "link:packages/kbn-some-dev-log",
"@kbn/sort-package-json": "link:packages/kbn-sort-package-json",
"@kbn/stdio-dev-helpers": "link:packages/kbn-stdio-dev-helpers",
"@kbn/storybook": "link:packages/kbn-storybook",
"@kbn/styled-components-mapping-cli": "link:packages/kbn-styled-components-mapping-cli",
"@kbn/synthetics-e2e": "link:x-pack/solutions/observability/plugins/synthetics/e2e",
"@kbn/synthetics-private-location": "link:x-pack/packages/kbn-synthetics-private-location",
"@kbn/telemetry-tools": "link:packages/kbn-telemetry-tools",
"@kbn/test": "link:packages/kbn-test",
"@kbn/test-eui-helpers": "link:packages/kbn-test-eui-helpers",

View file

@ -1,5 +1,7 @@
{
"type": "shared-common",
"id": "@kbn/calculate-auto",
"owner": "@elastic/obs-ux-management-team"
"owner": "@elastic/obs-ux-management-team",
"group": "platform",
"visibility": "shared"
}

View file

@ -1,5 +1,7 @@
{
"type": "shared-common",
"id": "@kbn/charts-theme",
"owner": "@elastic/kibana-visualizations"
"owner": "@elastic/kibana-visualizations",
"group": "platform",
"visibility": "shared"
}

View file

@ -1,3 +0,0 @@
# @kbn/formatters
Utilities for formatting common fields and values.

View file

@ -1,10 +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".
*/
export { formatBytes } from './src/bytes_formatter';

View file

@ -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/kbn-formatters'],
};

View file

@ -1,5 +0,0 @@
{
"type": "shared-common",
"id": "@kbn/formatters",
"owner": "@elastic/obs-ux-logs-team"
}

View file

@ -1,6 +0,0 @@
{
"name": "@kbn/formatters",
"private": true,
"version": "1.0.0",
"license": "Elastic License 2.0 OR AGPL-3.0-only OR SSPL-1.0"
}

View file

@ -1,37 +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".
*/
import { formatBytes } from '.';
describe('BytesFormatter', () => {
it('should format bytes correctly', () => {
const result = formatBytes(1000);
expect(result).toBe('1000 Bytes');
});
it('should format bytes correctly if 0 is sent', () => {
const result = formatBytes(0);
expect(result).toBe('0 Bytes');
});
it('should format bytes correctly into KB', () => {
const result = formatBytes(10000);
expect(result).toBe('10 KB');
});
it('should format bytes correctly into MB', () => {
const result = formatBytes(1048576);
expect(result).toBe('1 MB');
});
it('should format bytes correctly with decimals', () => {
const result = formatBytes(10000, 3);
expect(result).toBe('9.766 KB');
});
});

View file

@ -1,20 +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".
*/
export const formatBytes = (bytes: number, decimals = 0) => {
if (bytes === 0) return '0 Bytes';
const k = 1024;
const dm = decimals < 0 ? 0 : decimals;
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
const i = Math.floor(Math.log(bytes) / Math.log(k));
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
};

View file

@ -1,17 +0,0 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types",
"types": [
"jest",
"node",
]
},
"include": [
"**/*.ts",
],
"exclude": [
"target/**/*"
],
"kbn_references": []
}

View file

@ -1,5 +1,6 @@
{
"type": "shared-common",
"id": "@kbn/generate-console-definitions",
"owner": "@elastic/kibana-management"
"owner": "@elastic/kibana-management",
"devOnly": true
}

View file

@ -1,5 +1,7 @@
{
"type": "shared-browser",
"id": "@kbn/grid-layout",
"owner": "@elastic/kibana-presentation"
"owner": "@elastic/kibana-presentation",
"group": "platform",
"visibility": "private"
}

View file

@ -1,5 +1,7 @@
{
"type": "shared-common",
"id": "@kbn/palettes",
"owner": "@elastic/kibana-visualizations"
"owner": "@elastic/kibana-visualizations",
"group": "platform",
"visibility": "shared"
}

View file

@ -1,5 +1,6 @@
{
"type": "shared-server",
"id": "@kbn/plugin-check",
"owner": "@elastic/appex-sharedux"
"owner": "@elastic/appex-sharedux",
"devOnly": true
}

View file

@ -1,5 +1,7 @@
{
"type": "shared-browser",
"id": "@kbn/saved-search-component",
"owner": "@elastic/obs-ux-logs-team"
"owner": "@elastic/obs-ux-logs-team",
"group": "platform",
"visibility": "shared"
}

View file

@ -1,5 +1,6 @@
{
"type": "shared-common",
"id": "@kbn/set-map",
"owner": "@elastic/kibana-operations"
"owner": "@elastic/kibana-operations",
"devOnly": true
}

View file

@ -1,5 +1,7 @@
{
"type": "shared-common",
"id": "@kbn/use-tracked-promise",
"owner": "@elastic/obs-ux-logs-team"
"owner": "@elastic/obs-ux-logs-team",
"group": "platform",
"visibility": "shared"
}

View file

@ -1,27 +0,0 @@
# @kbn/response-ops-feature-flags
This packages exposes a feature flag service that is used in the ResponseOps plugins and packages to handle feature flags.
## Usage
### Create feature flag service
```
const featureFlagService = createFeatureFlagService(['test.myFeature', 'test.myFeature.subFeature']); // TS will infer the types automatically
```
or
```
type FeatureFlagValues = 'test.myFeature' | 'test.myOtherFeature'
const featureFlagService = createFeatureFlagService<FeatureFlagValues>(['test.myFeature']);
```
### Checking the existence of a feature flag
```
const featureFlagService = createFeatureFlagService(['test.myFeature', 'test.myFeature.subFeature']);
if (featureFlagService.isFeatureFlagSet('test.myFeature')) {
// my feature code
}
```

View file

@ -1,30 +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".
*/
import { createFeatureFlagService } from './feature_flag_service';
type FeatureFlagValues = 'test.myFeature' | 'test.myOtherFeature';
describe('FeatureFlagService', () => {
it('returns true if the feature exists', () => {
const featureFlagService = createFeatureFlagService(['test.myFeature']);
expect(featureFlagService.isFeatureFlagSet('test.myFeature')).toBe(true);
});
it('returns false if the feature does not exist', () => {
const featureFlagService = createFeatureFlagService(['test.myFeature']);
// @ts-expect-error: foo is not part of the valid feature flags
expect(featureFlagService.isFeatureFlagSet('foo')).toBe(false);
});
it('returns true if the feature exists (as typed)', () => {
const featureFlagService = createFeatureFlagService<FeatureFlagValues>(['test.myFeature']);
expect(featureFlagService.isFeatureFlagSet('test.myFeature')).toBe(true);
});
});

View file

@ -1,26 +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".
*/
class FeatureFlag<T extends string = string> {
private readonly featureFlags = new Set<T>();
constructor(featureFlags: T[]) {
featureFlags.forEach((featureFlag) => this.featureFlags.add(featureFlag));
}
public isFeatureFlagSet(featureFlag: T): boolean {
return this.featureFlags.has(featureFlag);
}
}
export const createFeatureFlagService = <T extends string>(featureFlags: T[]) => {
return new FeatureFlag<(typeof featureFlags)[number]>(featureFlags);
};
export type FeatureFlagService<T extends string = string> = InstanceType<typeof FeatureFlag<T>>;

View file

@ -1,11 +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".
*/
export { createFeatureFlagService } from './feature_flag_service';
export type { FeatureFlagService } from './feature_flag_service';

View file

@ -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/jest_node',
rootDir: '../../..',
roots: ['<rootDir>/packages/response-ops/feature_flag_service'],
};

View file

@ -1,5 +0,0 @@
{
"type": "shared-common",
"id": "@kbn/response-ops-feature-flag-service",
"owner": "@elastic/response-ops"
}

View file

@ -1,6 +0,0 @@
{
"name": "@kbn/response-ops-feature-flag-service",
"private": true,
"version": "1.0.0",
"license": "Elastic License 2.0 OR AGPL-3.0-only OR SSPL-1.0"
}

View file

@ -1,17 +0,0 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types",
"types": [
"jest",
"node"
]
},
"include": [
"**/*.ts",
],
"exclude": [
"target/**/*"
],
"kbn_references": []
}

View file

@ -1,5 +1,7 @@
{
"type": "shared-browser",
"id": "@kbn/response-ops-rule-form",
"owner": "@elastic/response-ops"
"owner": "@elastic/response-ops",
"group": "platform",
"visibility": "shared"
}

View file

@ -970,8 +970,6 @@
"@kbn/flot-charts/*": ["src/platform/packages/shared/kbn-flot-charts/*"],
"@kbn/foo-plugin": ["x-pack/test/ui_capabilities/common/plugins/foo_plugin"],
"@kbn/foo-plugin/*": ["x-pack/test/ui_capabilities/common/plugins/foo_plugin/*"],
"@kbn/formatters": ["packages/kbn-formatters"],
"@kbn/formatters/*": ["packages/kbn-formatters/*"],
"@kbn/ftr-apis-plugin": ["src/platform/plugins/private/ftr_apis"],
"@kbn/ftr-apis-plugin/*": ["src/platform/plugins/private/ftr_apis/*"],
"@kbn/ftr-common-functional-services": ["packages/kbn-ftr-common-functional-services"],
@ -1492,8 +1490,6 @@
"@kbn/resizable-layout-examples-plugin/*": ["examples/resizable_layout_examples/*"],
"@kbn/resolver-test-plugin": ["x-pack/test/plugin_functional/plugins/resolver_test"],
"@kbn/resolver-test-plugin/*": ["x-pack/test/plugin_functional/plugins/resolver_test/*"],
"@kbn/response-ops-feature-flag-service": ["packages/response-ops/feature_flag_service"],
"@kbn/response-ops-feature-flag-service/*": ["packages/response-ops/feature_flag_service/*"],
"@kbn/response-ops-rule-form": ["packages/response-ops/rule_form"],
"@kbn/response-ops-rule-form/*": ["packages/response-ops/rule_form/*"],
"@kbn/response-ops-rule-params": ["src/platform/packages/shared/response-ops/rule_params"],

View file

@ -1,5 +1,6 @@
{
"type": "shared-common",
"id": "@kbn/synthetics-private-location",
"owner": "@elastic/obs-ux-management-team"
"owner": "@elastic/obs-ux-management-team",
"devOnly": true
}

View file

@ -5793,10 +5793,6 @@
version "0.0.0"
uid ""
"@kbn/formatters@link:packages/kbn-formatters":
version "0.0.0"
uid ""
"@kbn/ftr-apis-plugin@link:src/platform/plugins/private/ftr_apis":
version "0.0.0"
uid ""
@ -6837,10 +6833,6 @@
version "0.0.0"
uid ""
"@kbn/response-ops-feature-flag-service@link:packages/response-ops/feature_flag_service":
version "0.0.0"
uid ""
"@kbn/response-ops-rule-form@link:packages/response-ops/rule_form":
version "0.0.0"
uid ""