55 lines
804 B
Python
55 lines
804 B
Python
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")
|
|
|
|
PKG_BASE_NAME = "kbn-spec-to-console"
|
|
PKG_REQUIRE_NAME = "@kbn/spec-to-console"
|
|
|
|
SOURCE_FILES = glob(
|
|
[
|
|
"bin/**/*",
|
|
"lib/**/*",
|
|
"index.js"
|
|
],
|
|
exclude = [
|
|
"**/*.test.*",
|
|
"**/__fixtures__/**",
|
|
],
|
|
)
|
|
|
|
SRCS = SOURCE_FILES
|
|
|
|
filegroup(
|
|
name = "srcs",
|
|
srcs = SRCS,
|
|
)
|
|
|
|
NPM_MODULE_EXTRA_FILES = [
|
|
"package.json",
|
|
"README.md",
|
|
]
|
|
|
|
DEPS = []
|
|
|
|
js_library(
|
|
name = PKG_BASE_NAME,
|
|
srcs = NPM_MODULE_EXTRA_FILES + [
|
|
":srcs",
|
|
],
|
|
deps = DEPS,
|
|
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"],
|
|
)
|