* fix(NA): windows ts_project outside sandbox compilation adding tsconfig paths for packages * chore(NA): missing @kbn paths for node_modules so types can work * chore(NA): missing @kbn paths for node_modules so types can work * chore(NA): organizing deps on non ts_project packages * chore(NA): change order to find @kbn packages on node_modules first * chore(NA): add @kbn/expect typings setting on package.json * chore(NA): fix typechecking * chore(NA): add missing change on tsconfig file * chore(NA): unblock windows build by not depending on the pkg_npm rule symlink in the package.json * chore(NA): add missing depedencies on BUILD.bazel file for io-ts-list-types * chore(NA): remove rootDirs configs * chore(NA): change kbn/monaco targets order * chore(NA): update kbn-monaco build Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> # Conflicts: # package.json
90 lines
1.5 KiB
Python
90 lines
1.5 KiB
Python
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")
|
|
load("@npm//@babel/cli:index.bzl", "babel")
|
|
|
|
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",
|
|
]
|
|
|
|
DEPS = [
|
|
"//packages/kbn-babel-preset",
|
|
"@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//tar-fs",
|
|
"@npm//tree-kill",
|
|
"@npm//yauzl",
|
|
"@npm//zlib"
|
|
]
|
|
|
|
babel(
|
|
name = "target",
|
|
data = DEPS + [
|
|
":srcs",
|
|
".babelrc",
|
|
],
|
|
output_dir = True,
|
|
# the following arg paths includes $(execpath) as babel runs on the sandbox root
|
|
args = [
|
|
"./%s/src" % package_name(),
|
|
"--config-file",
|
|
"./%s/.babelrc" % package_name(),
|
|
"--out-dir",
|
|
"$(@D)",
|
|
"--extensions",
|
|
".ts,.js",
|
|
"--copy-files",
|
|
"--quiet"
|
|
],
|
|
)
|
|
|
|
js_library(
|
|
name = PKG_BASE_NAME,
|
|
srcs = NPM_MODULE_EXTRA_FILES,
|
|
deps = DEPS + [":target"],
|
|
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"],
|
|
)
|