kibana/packages/kbn-babel-code-parser/BUILD.bazel
Tiago Costa f69d63e8be
fix(NA): windows ts_project outside sandbox compilation (#100947)
* 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>
2021-06-03 17:53:39 +01:00

74 lines
1.2 KiB
Python

load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")
load("@npm//@babel/cli:index.bzl", "babel")
PKG_BASE_NAME = "kbn-babel-code-parser"
PKG_REQUIRE_NAME = "@kbn/babel-code-parser"
SOURCE_FILES = glob(
[
"src/**/*",
],
exclude = [
"**/*.test.*"
],
)
SRCS = SOURCE_FILES
filegroup(
name = "srcs",
srcs = SRCS,
)
NPM_MODULE_EXTRA_FILES = [
"package.json",
"README.md",
]
DEPS = [
"//packages/kbn-babel-preset",
"@npm//@babel/parser",
"@npm//@babel/traverse",
"@npm//lodash",
]
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)",
"--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"],
)