* chore(NA): moving @kbn/apm-utils into bazel * chore(NA): add kbn/apm-utils into package.json * chore(NA): missing standard on build file globs * chore(NA): be more explicit about incremental setting * chore(NA): include pretty in the args for ts_project rule * docs(NA): include package migration completion in the developer getting started Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
78 lines
1.2 KiB
Python
78 lines
1.2 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 = "elastic-datemath"
|
|
PKG_REQUIRE_NAME = "@elastic/datemath"
|
|
|
|
SOURCE_FILES = glob([
|
|
"src/index.ts",
|
|
])
|
|
|
|
SRCS = SOURCE_FILES
|
|
|
|
filegroup(
|
|
name = "srcs",
|
|
srcs = SRCS,
|
|
)
|
|
|
|
NPM_MODULE_EXTRA_FILES = [
|
|
"package.json",
|
|
"README.md",
|
|
]
|
|
|
|
SRC_DEPS = [
|
|
"@npm//moment",
|
|
]
|
|
|
|
TYPES_DEPS = [
|
|
"@npm//@types/node",
|
|
]
|
|
|
|
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 = [],
|
|
deps = [":tsc"] + 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"],
|
|
)
|