mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
* [Step 3] Cleanup charts plugin * update JEST * [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
150 lines
3.3 KiB
Text
150 lines
3.3 KiB
Text
load("@npm//@bazel/typescript:index.bzl", "ts_config")
|
|
load("@build_bazel_rules_nodejs//:index.bzl", "js_library")
|
|
load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project")
|
|
|
|
PKG_DIRNAME = "kbn-coloring"
|
|
PKG_REQUIRE_NAME = "@kbn/coloring"
|
|
|
|
SOURCE_FILES = glob(
|
|
[
|
|
"src/**/*.scss",
|
|
"src/**/*.ts",
|
|
"src/**/*.tsx",
|
|
],
|
|
exclude = [
|
|
"**/*.test.*",
|
|
"**/*.stories.*",
|
|
],
|
|
)
|
|
|
|
SRCS = SOURCE_FILES
|
|
|
|
filegroup(
|
|
name = "srcs",
|
|
srcs = SRCS,
|
|
)
|
|
|
|
NPM_MODULE_EXTRA_FILES = [
|
|
"package.json",
|
|
]
|
|
|
|
# In this array place runtime dependencies, including other packages and NPM packages
|
|
# which must be available for this code to run.
|
|
#
|
|
# To reference other packages use:
|
|
# "//repo/relative/path/to/package"
|
|
# eg. "//packages/kbn-utils"
|
|
#
|
|
# To reference a NPM package use:
|
|
# "@npm//name-of-package"
|
|
# eg. "@npm//lodash"
|
|
RUNTIME_DEPS = [
|
|
"//packages/kbn-i18n",
|
|
"//packages/kbn-i18n-react",
|
|
"//packages/kbn-shared-ux-storybook",
|
|
"//packages/kbn-interpreter",
|
|
"//packages/kbn-utility-types",
|
|
"//packages/kbn-shared-ux-utility",
|
|
"@npm//chroma-js",
|
|
"@npm//@elastic/eui",
|
|
"@npm//react-use",
|
|
"@npm//react",
|
|
"@npm//@emotion/react",
|
|
"@npm//@emotion/css",
|
|
]
|
|
|
|
# In this array place dependencies necessary to build the types, which will include the
|
|
# :npm_module_types target of other packages and packages from NPM, including @types/*
|
|
# packages.
|
|
#
|
|
# To reference the types for another package use:
|
|
# "//repo/relative/path/to/package:npm_module_types"
|
|
# eg. "//packages/kbn-utils:npm_module_types"
|
|
#
|
|
# References to NPM packages work the same as RUNTIME_DEPS
|
|
TYPES_DEPS = [
|
|
"//packages/kbn-i18n:npm_module_types",
|
|
"//packages/kbn-i18n-react:npm_module_types",
|
|
"//packages/kbn-shared-ux-storybook:npm_module_types",
|
|
"//packages/kbn-interpreter:npm_module_types",
|
|
"//packages/kbn-utility-types:npm_module_types",
|
|
"//packages/kbn-shared-ux-utility:npm_module_types",
|
|
"@npm//@types/chroma-js",
|
|
"@npm//@types/react",
|
|
"@npm//@elastic/eui",
|
|
"@npm//react-use",
|
|
"@npm//@emotion/react",
|
|
"@npm//@emotion/css",
|
|
]
|
|
|
|
jsts_transpiler(
|
|
name = "target_node",
|
|
srcs = SRCS,
|
|
build_pkg_name = package_name(),
|
|
)
|
|
|
|
jsts_transpiler(
|
|
name = "target_web",
|
|
srcs = SRCS,
|
|
build_pkg_name = package_name(),
|
|
web = True,
|
|
additional_args = [
|
|
"--copy-files",
|
|
"--quiet"
|
|
],
|
|
)
|
|
|
|
ts_config(
|
|
name = "tsconfig",
|
|
src = "tsconfig.json",
|
|
deps = [
|
|
"//:tsconfig.base.json",
|
|
"//:tsconfig.bazel.json",
|
|
],
|
|
)
|
|
|
|
ts_project(
|
|
name = "tsc_types",
|
|
args = ['--pretty'],
|
|
srcs = SRCS,
|
|
deps = TYPES_DEPS,
|
|
declaration = True,
|
|
emit_declaration_only = True,
|
|
out_dir = "target_types",
|
|
root_dir = "src",
|
|
tsconfig = ":tsconfig",
|
|
)
|
|
|
|
js_library(
|
|
name = PKG_DIRNAME,
|
|
srcs = NPM_MODULE_EXTRA_FILES,
|
|
deps = RUNTIME_DEPS + [":target_node", ":target_web"],
|
|
package_name = PKG_REQUIRE_NAME,
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
pkg_npm(
|
|
name = "npm_module",
|
|
deps = [":" + PKG_DIRNAME],
|
|
)
|
|
|
|
filegroup(
|
|
name = "build",
|
|
srcs = [":npm_module"],
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
pkg_npm_types(
|
|
name = "npm_module_types",
|
|
srcs = SRCS,
|
|
deps = [":tsc_types"],
|
|
package_name = PKG_REQUIRE_NAME,
|
|
tsconfig = ":tsconfig",
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
filegroup(
|
|
name = "build_types",
|
|
srcs = [":npm_module_types"],
|
|
visibility = ["//visibility:public"],
|
|
)
|