2021-05-05 21:52:01 +02:00
|
|
|
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")
|
2021-08-03 23:02:56 +02:00
|
|
|
load("//src/dev/bazel:index.bzl", "jsts_transpiler")
|
2021-05-05 21:52:01 +02:00
|
|
|
|
|
|
|
PKG_BASE_NAME = "kbn-es"
|
|
|
|
PKG_REQUIRE_NAME = "@kbn/es"
|
|
|
|
|
|
|
|
SOURCE_FILES = glob(
|
|
|
|
[
|
|
|
|
"src/**/*",
|
|
|
|
],
|
|
|
|
exclude = [
|
|
|
|
"**/*.test.*",
|
|
|
|
"**/integration_tests/**",
|
|
|
|
"**/__fixtures__/**",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
SRCS = SOURCE_FILES
|
|
|
|
|
|
|
|
filegroup(
|
|
|
|
name = "srcs",
|
|
|
|
srcs = SRCS,
|
|
|
|
)
|
|
|
|
|
|
|
|
NPM_MODULE_EXTRA_FILES = [
|
|
|
|
"package.json",
|
|
|
|
"README.md",
|
|
|
|
]
|
|
|
|
|
2021-08-03 23:02:56 +02:00
|
|
|
RUNTIME_DEPS = [
|
2021-05-05 21:52:01 +02:00
|
|
|
"@npm//@elastic/elasticsearch",
|
|
|
|
"@npm//abort-controller",
|
|
|
|
"@npm//chalk",
|
|
|
|
"@npm//dedent",
|
|
|
|
"@npm//del",
|
|
|
|
"@npm//execa",
|
|
|
|
"@npm//getopts",
|
|
|
|
"@npm//glob",
|
|
|
|
"@npm//node-fetch",
|
|
|
|
"@npm//simple-git",
|
|
|
|
"@npm//tree-kill",
|
|
|
|
"@npm//zlib"
|
|
|
|
]
|
|
|
|
|
2021-08-03 23:02:56 +02:00
|
|
|
jsts_transpiler(
|
|
|
|
name = "target_node",
|
|
|
|
srcs = SRCS,
|
|
|
|
build_pkg_name = package_name(),
|
2021-05-05 21:52:01 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
js_library(
|
|
|
|
name = PKG_BASE_NAME,
|
|
|
|
srcs = NPM_MODULE_EXTRA_FILES,
|
2021-08-03 23:02:56 +02:00
|
|
|
deps = RUNTIME_DEPS + [":target_node"],
|
2021-05-05 21:52:01 +02:00
|
|
|
package_name = PKG_REQUIRE_NAME,
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
pkg_npm(
|
|
|
|
name = "npm_module",
|
|
|
|
deps = [
|
|
|
|
":%s" % PKG_BASE_NAME,
|
|
|
|
]
|
|
|
|
)
|
|
|
|
|
|
|
|
filegroup(
|
|
|
|
name = "build",
|
|
|
|
srcs = [
|
|
|
|
":npm_module",
|
|
|
|
],
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|