From 8d6a37ff4d40226fd6617eb5826c71fdf04dc9b8 Mon Sep 17 00:00:00 2001 From: Gerard Soldevila Date: Tue, 10 Dec 2024 17:23:51 +0100 Subject: [PATCH] Relocating module `@kbn/utils` --- .github/CODEOWNERS | 2 +- package.json | 2 +- packages/kbn-babel-register/BUILD.bazel | 2 +- .../packages/private/kbn-repo-packages/package-map.json | 2 +- .../platform/packages/shared}/kbn-utils/README.md | 0 {packages => src/platform/packages/shared}/kbn-utils/index.ts | 0 .../platform/packages/shared}/kbn-utils/jest.config.js | 4 ++-- .../platform/packages/shared}/kbn-utils/kibana.jsonc | 0 .../platform/packages/shared}/kbn-utils/package.json | 0 .../packages/shared}/kbn-utils/src/json/index.test.ts | 0 .../platform/packages/shared}/kbn-utils/src/json/index.ts | 0 .../packages/shared}/kbn-utils/src/path/index.test.ts | 0 .../platform/packages/shared}/kbn-utils/src/path/index.ts | 0 .../shared}/kbn-utils/src/streams/concat_stream.test.ts | 0 .../packages/shared}/kbn-utils/src/streams/concat_stream.ts | 0 .../kbn-utils/src/streams/concat_stream_providers.test.ts | 0 .../shared}/kbn-utils/src/streams/concat_stream_providers.ts | 0 .../shared}/kbn-utils/src/streams/filter_stream.test.ts | 0 .../packages/shared}/kbn-utils/src/streams/filter_stream.ts | 0 .../platform/packages/shared}/kbn-utils/src/streams/index.ts | 0 .../shared}/kbn-utils/src/streams/intersperse_stream.test.ts | 0 .../shared}/kbn-utils/src/streams/intersperse_stream.ts | 0 .../shared}/kbn-utils/src/streams/list_stream.test.ts | 0 .../packages/shared}/kbn-utils/src/streams/list_stream.ts | 0 .../packages/shared}/kbn-utils/src/streams/map_stream.test.ts | 0 .../packages/shared}/kbn-utils/src/streams/map_stream.ts | 0 .../kbn-utils/src/streams/promise_from_streams.test.ts | 0 .../shared}/kbn-utils/src/streams/promise_from_streams.ts | 0 .../shared}/kbn-utils/src/streams/reduce_stream.test.ts | 0 .../packages/shared}/kbn-utils/src/streams/reduce_stream.ts | 0 .../shared}/kbn-utils/src/streams/replace_stream.test.ts | 0 .../packages/shared}/kbn-utils/src/streams/replace_stream.ts | 0 .../shared}/kbn-utils/src/streams/split_stream.test.ts | 0 .../packages/shared}/kbn-utils/src/streams/split_stream.ts | 0 .../platform/packages/shared}/kbn-utils/tsconfig.json | 2 +- tsconfig.base.json | 4 ++-- yarn.lock | 2 +- 37 files changed, 10 insertions(+), 10 deletions(-) rename {packages => src/platform/packages/shared}/kbn-utils/README.md (100%) rename {packages => src/platform/packages/shared}/kbn-utils/index.ts (100%) rename {packages => src/platform/packages/shared}/kbn-utils/jest.config.js (84%) rename {packages => src/platform/packages/shared}/kbn-utils/kibana.jsonc (100%) rename {packages => src/platform/packages/shared}/kbn-utils/package.json (100%) rename {packages => src/platform/packages/shared}/kbn-utils/src/json/index.test.ts (100%) rename {packages => src/platform/packages/shared}/kbn-utils/src/json/index.ts (100%) rename {packages => src/platform/packages/shared}/kbn-utils/src/path/index.test.ts (100%) rename {packages => src/platform/packages/shared}/kbn-utils/src/path/index.ts (100%) rename {packages => src/platform/packages/shared}/kbn-utils/src/streams/concat_stream.test.ts (100%) rename {packages => src/platform/packages/shared}/kbn-utils/src/streams/concat_stream.ts (100%) rename {packages => src/platform/packages/shared}/kbn-utils/src/streams/concat_stream_providers.test.ts (100%) rename {packages => src/platform/packages/shared}/kbn-utils/src/streams/concat_stream_providers.ts (100%) rename {packages => src/platform/packages/shared}/kbn-utils/src/streams/filter_stream.test.ts (100%) rename {packages => src/platform/packages/shared}/kbn-utils/src/streams/filter_stream.ts (100%) rename {packages => src/platform/packages/shared}/kbn-utils/src/streams/index.ts (100%) rename {packages => src/platform/packages/shared}/kbn-utils/src/streams/intersperse_stream.test.ts (100%) rename {packages => src/platform/packages/shared}/kbn-utils/src/streams/intersperse_stream.ts (100%) rename {packages => src/platform/packages/shared}/kbn-utils/src/streams/list_stream.test.ts (100%) rename {packages => src/platform/packages/shared}/kbn-utils/src/streams/list_stream.ts (100%) rename {packages => src/platform/packages/shared}/kbn-utils/src/streams/map_stream.test.ts (100%) rename {packages => src/platform/packages/shared}/kbn-utils/src/streams/map_stream.ts (100%) rename {packages => src/platform/packages/shared}/kbn-utils/src/streams/promise_from_streams.test.ts (100%) rename {packages => src/platform/packages/shared}/kbn-utils/src/streams/promise_from_streams.ts (100%) rename {packages => src/platform/packages/shared}/kbn-utils/src/streams/reduce_stream.test.ts (100%) rename {packages => src/platform/packages/shared}/kbn-utils/src/streams/reduce_stream.ts (100%) rename {packages => src/platform/packages/shared}/kbn-utils/src/streams/replace_stream.test.ts (100%) rename {packages => src/platform/packages/shared}/kbn-utils/src/streams/replace_stream.ts (100%) rename {packages => src/platform/packages/shared}/kbn-utils/src/streams/split_stream.test.ts (100%) rename {packages => src/platform/packages/shared}/kbn-utils/src/streams/split_stream.ts (100%) rename {packages => src/platform/packages/shared}/kbn-utils/tsconfig.json (83%) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 1e7668849e562..2a51f5ec0fe58 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -529,7 +529,6 @@ packages/kbn-unsaved-changes-prompt @elastic/kibana-management packages/kbn-use-tracked-promise @elastic/obs-ux-logs-team packages/kbn-user-profile-components @elastic/kibana-security packages/kbn-utility-types @elastic/kibana-core -packages/kbn-utils @elastic/kibana-operations packages/kbn-validate-next-docs-cli @elastic/kibana-operations packages/kbn-visualization-ui-components @elastic/kibana-visualizations packages/kbn-visualization-utils @elastic/kibana-visualizations @@ -626,6 +625,7 @@ src/platform/packages/shared/kbn-repo-info @elastic/kibana-operations src/platform/packages/shared/kbn-rison @elastic/kibana-operations src/platform/packages/shared/kbn-ui-theme @elastic/kibana-operations src/platform/packages/shared/kbn-utility-types-jest @elastic/kibana-operations +src/platform/packages/shared/kbn-utils @elastic/kibana-operations src/platform/plugins/shared/esql @elastic/kibana-esql src/platform/plugins/shared/esql_datagrid @elastic/kibana-esql src/plugins/advanced_settings @elastic/appex-sharedux @elastic/kibana-management diff --git a/package.json b/package.json index ea574398b30d7..06fcdfd47742c 100644 --- a/package.json +++ b/package.json @@ -1002,7 +1002,7 @@ "@kbn/user-profiles-consumer-plugin": "link:x-pack/test/security_api_integration/plugins/user_profiles_consumer", "@kbn/utility-types": "link:packages/kbn-utility-types", "@kbn/utility-types-jest": "link:src/platform/packages/shared/kbn-utility-types-jest", - "@kbn/utils": "link:packages/kbn-utils", + "@kbn/utils": "link:src/platform/packages/shared/kbn-utils", "@kbn/ux-plugin": "link:x-pack/plugins/observability_solution/ux", "@kbn/v8-profiler-examples-plugin": "link:examples/v8_profiler_examples", "@kbn/vis-default-editor-plugin": "link:src/plugins/vis_default_editor", diff --git a/packages/kbn-babel-register/BUILD.bazel b/packages/kbn-babel-register/BUILD.bazel index bfb19ff93a975..b64bf2eee0d46 100644 --- a/packages/kbn-babel-register/BUILD.bazel +++ b/packages/kbn-babel-register/BUILD.bazel @@ -25,7 +25,7 @@ SRCS = glob( # # To reference other packages use: # "//repo/relative/path/to/package" -# eg. "//packages/kbn-utils" +# eg. "//src/platform/packages/shared/kbn-utils" # # To reference a NPM package use: # "@npm//name-of-package" diff --git a/src/platform/packages/private/kbn-repo-packages/package-map.json b/src/platform/packages/private/kbn-repo-packages/package-map.json index 6dbe016b7ee3c..bffa0e5d6436a 100644 --- a/src/platform/packages/private/kbn-repo-packages/package-map.json +++ b/src/platform/packages/private/kbn-repo-packages/package-map.json @@ -4021,7 +4021,7 @@ ], [ "@kbn/utils", - "packages/kbn-utils" + "src/platform/packages/shared/kbn-utils" ], [ "@kbn/ux-plugin", diff --git a/packages/kbn-utils/README.md b/src/platform/packages/shared/kbn-utils/README.md similarity index 100% rename from packages/kbn-utils/README.md rename to src/platform/packages/shared/kbn-utils/README.md diff --git a/packages/kbn-utils/index.ts b/src/platform/packages/shared/kbn-utils/index.ts similarity index 100% rename from packages/kbn-utils/index.ts rename to src/platform/packages/shared/kbn-utils/index.ts diff --git a/packages/kbn-utils/jest.config.js b/src/platform/packages/shared/kbn-utils/jest.config.js similarity index 84% rename from packages/kbn-utils/jest.config.js rename to src/platform/packages/shared/kbn-utils/jest.config.js index 6ef6ab4154f1f..dd003e894844d 100644 --- a/packages/kbn-utils/jest.config.js +++ b/src/platform/packages/shared/kbn-utils/jest.config.js @@ -9,6 +9,6 @@ module.exports = { preset: '@kbn/test', - rootDir: '../..', - roots: ['/packages/kbn-utils'], + rootDir: '../../../../..', + roots: ['/src/platform/packages/shared/kbn-utils'], }; diff --git a/packages/kbn-utils/kibana.jsonc b/src/platform/packages/shared/kbn-utils/kibana.jsonc similarity index 100% rename from packages/kbn-utils/kibana.jsonc rename to src/platform/packages/shared/kbn-utils/kibana.jsonc diff --git a/packages/kbn-utils/package.json b/src/platform/packages/shared/kbn-utils/package.json similarity index 100% rename from packages/kbn-utils/package.json rename to src/platform/packages/shared/kbn-utils/package.json diff --git a/packages/kbn-utils/src/json/index.test.ts b/src/platform/packages/shared/kbn-utils/src/json/index.test.ts similarity index 100% rename from packages/kbn-utils/src/json/index.test.ts rename to src/platform/packages/shared/kbn-utils/src/json/index.test.ts diff --git a/packages/kbn-utils/src/json/index.ts b/src/platform/packages/shared/kbn-utils/src/json/index.ts similarity index 100% rename from packages/kbn-utils/src/json/index.ts rename to src/platform/packages/shared/kbn-utils/src/json/index.ts diff --git a/packages/kbn-utils/src/path/index.test.ts b/src/platform/packages/shared/kbn-utils/src/path/index.test.ts similarity index 100% rename from packages/kbn-utils/src/path/index.test.ts rename to src/platform/packages/shared/kbn-utils/src/path/index.test.ts diff --git a/packages/kbn-utils/src/path/index.ts b/src/platform/packages/shared/kbn-utils/src/path/index.ts similarity index 100% rename from packages/kbn-utils/src/path/index.ts rename to src/platform/packages/shared/kbn-utils/src/path/index.ts diff --git a/packages/kbn-utils/src/streams/concat_stream.test.ts b/src/platform/packages/shared/kbn-utils/src/streams/concat_stream.test.ts similarity index 100% rename from packages/kbn-utils/src/streams/concat_stream.test.ts rename to src/platform/packages/shared/kbn-utils/src/streams/concat_stream.test.ts diff --git a/packages/kbn-utils/src/streams/concat_stream.ts b/src/platform/packages/shared/kbn-utils/src/streams/concat_stream.ts similarity index 100% rename from packages/kbn-utils/src/streams/concat_stream.ts rename to src/platform/packages/shared/kbn-utils/src/streams/concat_stream.ts diff --git a/packages/kbn-utils/src/streams/concat_stream_providers.test.ts b/src/platform/packages/shared/kbn-utils/src/streams/concat_stream_providers.test.ts similarity index 100% rename from packages/kbn-utils/src/streams/concat_stream_providers.test.ts rename to src/platform/packages/shared/kbn-utils/src/streams/concat_stream_providers.test.ts diff --git a/packages/kbn-utils/src/streams/concat_stream_providers.ts b/src/platform/packages/shared/kbn-utils/src/streams/concat_stream_providers.ts similarity index 100% rename from packages/kbn-utils/src/streams/concat_stream_providers.ts rename to src/platform/packages/shared/kbn-utils/src/streams/concat_stream_providers.ts diff --git a/packages/kbn-utils/src/streams/filter_stream.test.ts b/src/platform/packages/shared/kbn-utils/src/streams/filter_stream.test.ts similarity index 100% rename from packages/kbn-utils/src/streams/filter_stream.test.ts rename to src/platform/packages/shared/kbn-utils/src/streams/filter_stream.test.ts diff --git a/packages/kbn-utils/src/streams/filter_stream.ts b/src/platform/packages/shared/kbn-utils/src/streams/filter_stream.ts similarity index 100% rename from packages/kbn-utils/src/streams/filter_stream.ts rename to src/platform/packages/shared/kbn-utils/src/streams/filter_stream.ts diff --git a/packages/kbn-utils/src/streams/index.ts b/src/platform/packages/shared/kbn-utils/src/streams/index.ts similarity index 100% rename from packages/kbn-utils/src/streams/index.ts rename to src/platform/packages/shared/kbn-utils/src/streams/index.ts diff --git a/packages/kbn-utils/src/streams/intersperse_stream.test.ts b/src/platform/packages/shared/kbn-utils/src/streams/intersperse_stream.test.ts similarity index 100% rename from packages/kbn-utils/src/streams/intersperse_stream.test.ts rename to src/platform/packages/shared/kbn-utils/src/streams/intersperse_stream.test.ts diff --git a/packages/kbn-utils/src/streams/intersperse_stream.ts b/src/platform/packages/shared/kbn-utils/src/streams/intersperse_stream.ts similarity index 100% rename from packages/kbn-utils/src/streams/intersperse_stream.ts rename to src/platform/packages/shared/kbn-utils/src/streams/intersperse_stream.ts diff --git a/packages/kbn-utils/src/streams/list_stream.test.ts b/src/platform/packages/shared/kbn-utils/src/streams/list_stream.test.ts similarity index 100% rename from packages/kbn-utils/src/streams/list_stream.test.ts rename to src/platform/packages/shared/kbn-utils/src/streams/list_stream.test.ts diff --git a/packages/kbn-utils/src/streams/list_stream.ts b/src/platform/packages/shared/kbn-utils/src/streams/list_stream.ts similarity index 100% rename from packages/kbn-utils/src/streams/list_stream.ts rename to src/platform/packages/shared/kbn-utils/src/streams/list_stream.ts diff --git a/packages/kbn-utils/src/streams/map_stream.test.ts b/src/platform/packages/shared/kbn-utils/src/streams/map_stream.test.ts similarity index 100% rename from packages/kbn-utils/src/streams/map_stream.test.ts rename to src/platform/packages/shared/kbn-utils/src/streams/map_stream.test.ts diff --git a/packages/kbn-utils/src/streams/map_stream.ts b/src/platform/packages/shared/kbn-utils/src/streams/map_stream.ts similarity index 100% rename from packages/kbn-utils/src/streams/map_stream.ts rename to src/platform/packages/shared/kbn-utils/src/streams/map_stream.ts diff --git a/packages/kbn-utils/src/streams/promise_from_streams.test.ts b/src/platform/packages/shared/kbn-utils/src/streams/promise_from_streams.test.ts similarity index 100% rename from packages/kbn-utils/src/streams/promise_from_streams.test.ts rename to src/platform/packages/shared/kbn-utils/src/streams/promise_from_streams.test.ts diff --git a/packages/kbn-utils/src/streams/promise_from_streams.ts b/src/platform/packages/shared/kbn-utils/src/streams/promise_from_streams.ts similarity index 100% rename from packages/kbn-utils/src/streams/promise_from_streams.ts rename to src/platform/packages/shared/kbn-utils/src/streams/promise_from_streams.ts diff --git a/packages/kbn-utils/src/streams/reduce_stream.test.ts b/src/platform/packages/shared/kbn-utils/src/streams/reduce_stream.test.ts similarity index 100% rename from packages/kbn-utils/src/streams/reduce_stream.test.ts rename to src/platform/packages/shared/kbn-utils/src/streams/reduce_stream.test.ts diff --git a/packages/kbn-utils/src/streams/reduce_stream.ts b/src/platform/packages/shared/kbn-utils/src/streams/reduce_stream.ts similarity index 100% rename from packages/kbn-utils/src/streams/reduce_stream.ts rename to src/platform/packages/shared/kbn-utils/src/streams/reduce_stream.ts diff --git a/packages/kbn-utils/src/streams/replace_stream.test.ts b/src/platform/packages/shared/kbn-utils/src/streams/replace_stream.test.ts similarity index 100% rename from packages/kbn-utils/src/streams/replace_stream.test.ts rename to src/platform/packages/shared/kbn-utils/src/streams/replace_stream.test.ts diff --git a/packages/kbn-utils/src/streams/replace_stream.ts b/src/platform/packages/shared/kbn-utils/src/streams/replace_stream.ts similarity index 100% rename from packages/kbn-utils/src/streams/replace_stream.ts rename to src/platform/packages/shared/kbn-utils/src/streams/replace_stream.ts diff --git a/packages/kbn-utils/src/streams/split_stream.test.ts b/src/platform/packages/shared/kbn-utils/src/streams/split_stream.test.ts similarity index 100% rename from packages/kbn-utils/src/streams/split_stream.test.ts rename to src/platform/packages/shared/kbn-utils/src/streams/split_stream.test.ts diff --git a/packages/kbn-utils/src/streams/split_stream.ts b/src/platform/packages/shared/kbn-utils/src/streams/split_stream.ts similarity index 100% rename from packages/kbn-utils/src/streams/split_stream.ts rename to src/platform/packages/shared/kbn-utils/src/streams/split_stream.ts diff --git a/packages/kbn-utils/tsconfig.json b/src/platform/packages/shared/kbn-utils/tsconfig.json similarity index 83% rename from packages/kbn-utils/tsconfig.json rename to src/platform/packages/shared/kbn-utils/tsconfig.json index 6baa222ef8c37..6912257f35e51 100644 --- a/packages/kbn-utils/tsconfig.json +++ b/src/platform/packages/shared/kbn-utils/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../../../../tsconfig.base.json", "compilerOptions": { "outDir": "target/types", "types": [ diff --git a/tsconfig.base.json b/tsconfig.base.json index 9688c02b5bc47..0ddd300317446 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -2014,8 +2014,8 @@ "@kbn/utility-types/*": ["packages/kbn-utility-types/*"], "@kbn/utility-types-jest": ["src/platform/packages/shared/kbn-utility-types-jest"], "@kbn/utility-types-jest/*": ["src/platform/packages/shared/kbn-utility-types-jest/*"], - "@kbn/utils": ["packages/kbn-utils"], - "@kbn/utils/*": ["packages/kbn-utils/*"], + "@kbn/utils": ["src/platform/packages/shared/kbn-utils"], + "@kbn/utils/*": ["src/platform/packages/shared/kbn-utils/*"], "@kbn/ux-plugin": ["x-pack/plugins/observability_solution/ux"], "@kbn/ux-plugin/*": ["x-pack/plugins/observability_solution/ux/*"], "@kbn/v8-profiler-examples-plugin": ["examples/v8_profiler_examples"], diff --git a/yarn.lock b/yarn.lock index eaeb0e0f9ad52..8e65590e87891 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7844,7 +7844,7 @@ version "0.0.0" uid "" -"@kbn/utils@link:packages/kbn-utils": +"@kbn/utils@link:src/platform/packages/shared/kbn-utils": version "0.0.0" uid ""