kibana/packages/kbn-securitysolution-io-ts-types/BUILD.bazel
Kibana Machine c635144ebe
chore(NA): correctly setup dep order on js_library to fix windows build (#100420) (#100428)
Co-authored-by: Tiago Costa <tiagoffcc@hotmail.com>
2021-05-20 20:57:21 -04:00

94 lines
1.5 KiB
Python

load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")
PKG_BASE_NAME = "kbn-securitysolution-io-ts-types"
PKG_REQUIRE_NAME = "@kbn/securitysolution-io-ts-types"
SOURCE_FILES = glob(
[
"src/**/*.ts",
],
exclude = [
"**/*.test.*",
"**/*.mock.*"
],
)
SRCS = SOURCE_FILES
filegroup(
name = "srcs",
srcs = SRCS,
)
NPM_MODULE_EXTRA_FILES = [
"package.json",
"README.md",
]
SRC_DEPS = [
"//packages/kbn-securitysolution-io-ts-utils",
"//packages/elastic-datemath",
"@npm//fp-ts",
"@npm//io-ts",
"@npm//lodash",
"@npm//moment",
"@npm//tslib",
"@npm//uuid",
]
TYPES_DEPS = [
"@npm//@types/flot",
"@npm//@types/jest",
"@npm//@types/lodash",
"@npm//@types/node",
"@npm//@types/uuid"
]
DEPS = SRC_DEPS + TYPES_DEPS
ts_config(
name = "tsconfig",
src = "tsconfig.json",
deps = [
"//:tsconfig.base.json",
],
)
ts_project(
name = "tsc",
args = ['--pretty'],
srcs = SRCS,
deps = DEPS,
declaration = True,
declaration_map = True,
incremental = True,
out_dir = "target",
source_map = True,
root_dir = "src",
tsconfig = ":tsconfig",
)
js_library(
name = PKG_BASE_NAME,
srcs = NPM_MODULE_EXTRA_FILES,
deps = DEPS + [":tsc"],
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"],
)