66 lines
942 B
Python
66 lines
942 B
Python
|
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")
|
||
|
|
||
|
PKG_BASE_NAME = "elastic-safer-lodash-set"
|
||
|
PKG_REQUIRE_NAME = "@elastic/safer-lodash-set"
|
||
|
|
||
|
SOURCE_FILES = glob(
|
||
|
[
|
||
|
"fp/**/*",
|
||
|
"lodash/**/*",
|
||
|
"index.js",
|
||
|
"set.js",
|
||
|
"setWith.js",
|
||
|
],
|
||
|
exclude = [
|
||
|
"**/*.d.ts"
|
||
|
],
|
||
|
)
|
||
|
|
||
|
TYPE_FILES = glob([
|
||
|
"fp/**/*.d.ts",
|
||
|
"index.d.ts",
|
||
|
"set.d.ts",
|
||
|
"setWith.d.ts",
|
||
|
])
|
||
|
|
||
|
SRCS = SOURCE_FILES + TYPE_FILES
|
||
|
|
||
|
filegroup(
|
||
|
name = "srcs",
|
||
|
srcs = SRCS,
|
||
|
)
|
||
|
|
||
|
NPM_MODULE_EXTRA_FILES = [
|
||
|
"package.json",
|
||
|
"README.md",
|
||
|
]
|
||
|
|
||
|
DEPS = [
|
||
|
"@npm//lodash",
|
||
|
]
|
||
|
|
||
|
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"],
|
||
|
)
|