From 544b270d317ad6f434e09fe3e19a0bdf5958815b Mon Sep 17 00:00:00 2001 From: Tomasz Kajtoch Date: Thu, 14 Nov 2024 13:08:59 +0100 Subject: [PATCH] add `@kbn/react-kibana-context-theme` to shared deps --- .../core/base/core-base-common/BUILD.bazel | 35 +++++++++++++++++ packages/kbn-ui-shared-deps-src/BUILD.bazel | 1 + .../kbn-ui-shared-deps-src/src/definitions.js | 1 + packages/kbn-ui-shared-deps-src/src/entry.js | 1 + .../react/kibana_context/common/BUILD.bazel | 36 ++++++++++++++++++ .../react/kibana_context/root/BUILD.bazel | 37 ++++++++++++++++++ .../react/kibana_context/theme/BUILD.bazel | 38 +++++++++++++++++++ 7 files changed, 149 insertions(+) create mode 100644 packages/core/base/core-base-common/BUILD.bazel create mode 100644 packages/react/kibana_context/common/BUILD.bazel create mode 100644 packages/react/kibana_context/root/BUILD.bazel create mode 100644 packages/react/kibana_context/theme/BUILD.bazel diff --git a/packages/core/base/core-base-common/BUILD.bazel b/packages/core/base/core-base-common/BUILD.bazel new file mode 100644 index 0000000000000..30c3b1ae616f4 --- /dev/null +++ b/packages/core/base/core-base-common/BUILD.bazel @@ -0,0 +1,35 @@ +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") + +SRCS = glob( + [ + "**/*.ts", + "**/*.tsx", + ], + exclude = [ + "**/test_helpers.ts", + "**/*.config.js", + "**/*.mock.*", + "**/*.test.*", + "**/*.stories.*", + "**/__snapshots__/**", + "**/integration_tests/**", + "**/mocks/**", + "**/scripts/**", + "**/storybook/**", + "**/test_fixtures/**", + "**/test_helpers/**", + ], +) + +DEPS = [ + "@npm//react", + "@npm//tslib", +] + +js_library( + name = "core-base-common", + package_name = "@kbn/core-base-common", + srcs = ["package.json"] + SRCS, + deps = DEPS, + visibility = ["//visibility:public"], +) diff --git a/packages/kbn-ui-shared-deps-src/BUILD.bazel b/packages/kbn-ui-shared-deps-src/BUILD.bazel index d2e67ccd14ac6..b0d7bb65843d9 100644 --- a/packages/kbn-ui-shared-deps-src/BUILD.bazel +++ b/packages/kbn-ui-shared-deps-src/BUILD.bazel @@ -39,6 +39,7 @@ webpack_cli( "//packages/shared-ux/error_boundary", "//packages/kbn-rison", "//packages/shared-ux/code_editor/impl:code_editor", + "//packages/react/kibana_context/theme", ], output_dir = True, args = [ diff --git a/packages/kbn-ui-shared-deps-src/src/definitions.js b/packages/kbn-ui-shared-deps-src/src/definitions.js index f56baf1731ac9..2c391dd18d1bc 100644 --- a/packages/kbn-ui-shared-deps-src/src/definitions.js +++ b/packages/kbn-ui-shared-deps-src/src/definitions.js @@ -105,6 +105,7 @@ const externals = { '@kbn/esql-ast': '__kbnSharedDeps__.KbnEsqlAst', '@kbn/ebt-tools': '__kbnSharedDeps__.KbnEbtTools', '@elastic/apm-rum-core': '__kbnSharedDeps__.ElasticApmRumCore', + '@kbn/react-kibana-context-theme': '__kbnSharedDeps__.KbnReactKibanaContextTheme', }; module.exports = { distDir, jsFilename, cssDistFilename, externals }; diff --git a/packages/kbn-ui-shared-deps-src/src/entry.js b/packages/kbn-ui-shared-deps-src/src/entry.js index f87c2e7d75ead..25432fcfe399e 100644 --- a/packages/kbn-ui-shared-deps-src/src/entry.js +++ b/packages/kbn-ui-shared-deps-src/src/entry.js @@ -78,3 +78,4 @@ export const KbnCodeEditor = require('@kbn/code-editor'); export const KbnEsqlAst = require('@kbn/esql-ast'); export const KbnEbtTools = require('@kbn/ebt-tools'); export const ElasticApmRumCore = require('@elastic/apm-rum-core'); +export const KbnReactKibanaContextTheme = require('@kbn/react-kibana-context-theme'); diff --git a/packages/react/kibana_context/common/BUILD.bazel b/packages/react/kibana_context/common/BUILD.bazel new file mode 100644 index 0000000000000..43f20a833d07f --- /dev/null +++ b/packages/react/kibana_context/common/BUILD.bazel @@ -0,0 +1,36 @@ +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") + +SRCS = glob( + [ + "**/*.ts", + "**/*.tsx", + ], + exclude = [ + "**/test_helpers.ts", + "**/*.config.js", + "**/*.mock.*", + "**/*.test.*", + "**/*.stories.*", + "**/__snapshots__/**", + "**/integration_tests/**", + "**/mocks/**", + "**/scripts/**", + "**/storybook/**", + "**/test_fixtures/**", + "**/test_helpers/**", + ], +) + +DEPS = [ + "@npm//react", + "@npm//tslib", + "@npm//@elastic/eui", +] + +js_library( + name = "common", + package_name = "@kbn/react-kibana-context-common", + srcs = ["package.json"] + SRCS, + deps = DEPS, + visibility = ["//visibility:public"], +) diff --git a/packages/react/kibana_context/root/BUILD.bazel b/packages/react/kibana_context/root/BUILD.bazel new file mode 100644 index 0000000000000..1c47c25bc20a9 --- /dev/null +++ b/packages/react/kibana_context/root/BUILD.bazel @@ -0,0 +1,37 @@ +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") + +SRCS = glob( + [ + "**/*.ts", + "**/*.tsx", + ], + exclude = [ + "**/test_helpers.ts", + "**/*.config.js", + "**/*.mock.*", + "**/*.test.*", + "**/*.stories.*", + "**/__snapshots__/**", + "**/integration_tests/**", + "**/mocks/**", + "**/scripts/**", + "**/storybook/**", + "**/test_fixtures/**", + "**/test_helpers/**", + ], +) + +DEPS = [ + "@npm//react", + "@npm//tslib", + "@npm//@elastic/eui", + "//packages/core/base/core-base-common", +] + +js_library( + name = "root", + package_name = "@kbn/react-kibana-context-root", + srcs = ["package.json"] + SRCS, + deps = DEPS, + visibility = ["//visibility:public"], +) diff --git a/packages/react/kibana_context/theme/BUILD.bazel b/packages/react/kibana_context/theme/BUILD.bazel new file mode 100644 index 0000000000000..504477ad7a0ed --- /dev/null +++ b/packages/react/kibana_context/theme/BUILD.bazel @@ -0,0 +1,38 @@ +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") + +SRCS = glob( + [ + "**/*.ts", + "**/*.tsx", + ], + exclude = [ + "**/test_helpers.ts", + "**/*.config.js", + "**/*.mock.*", + "**/*.test.*", + "**/*.stories.*", + "**/__snapshots__/**", + "**/integration_tests/**", + "**/mocks/**", + "**/scripts/**", + "**/storybook/**", + "**/test_fixtures/**", + "**/test_helpers/**", + ], +) + +BUNDLER_DEPS = [ + "@npm//react", + "@npm//tslib", + "@npm//react-use", + "//packages/react/kibana_context/common", + "//packages/react/kibana_context/root", +] + +js_library( + name = "theme", + package_name = "@kbn/react-kibana-context-theme", + srcs = ["package.json"] + SRCS, + deps = BUNDLER_DEPS, + visibility = ["//visibility:public"], +)