* chore(NA): moving @kbn/tinymath into bazel * chore(NA): fixed jest tests * chore(NA): simplified tsconfig file Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
72 lines
1,016 B
Python
72 lines
1,016 B
Python
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")
|
|
load("@npm//pegjs:index.bzl", "pegjs")
|
|
|
|
PKG_BASE_NAME = "kbn-tinymath"
|
|
PKG_REQUIRE_NAME = "@kbn/tinymath"
|
|
|
|
SOURCE_FILES = glob(
|
|
[
|
|
"src/**/*",
|
|
]
|
|
)
|
|
|
|
TYPE_FILES = [
|
|
"index.d.ts",
|
|
]
|
|
|
|
SRCS = SOURCE_FILES + TYPE_FILES
|
|
|
|
filegroup(
|
|
name = "srcs",
|
|
srcs = SRCS,
|
|
)
|
|
|
|
NPM_MODULE_EXTRA_FILES = [
|
|
"package.json",
|
|
"README.md",
|
|
]
|
|
|
|
DEPS = [
|
|
"@npm//lodash",
|
|
]
|
|
|
|
pegjs(
|
|
name = "grammar",
|
|
data = [
|
|
":grammar/grammar.pegjs"
|
|
],
|
|
output_dir = True,
|
|
args = [
|
|
"-o",
|
|
"$(@D)/index.js",
|
|
"./%s/grammar/grammar.pegjs" % package_name()
|
|
],
|
|
)
|
|
|
|
js_library(
|
|
name = PKG_BASE_NAME,
|
|
srcs = [
|
|
":srcs",
|
|
":grammar"
|
|
],
|
|
deps = DEPS,
|
|
package_name = PKG_REQUIRE_NAME,
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
pkg_npm(
|
|
name = "npm_module",
|
|
srcs = NPM_MODULE_EXTRA_FILES,
|
|
deps = [
|
|
":%s" % PKG_BASE_NAME,
|
|
]
|
|
)
|
|
|
|
filegroup(
|
|
name = "build",
|
|
srcs = [
|
|
":npm_module",
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
)
|