2018-03-01 13:41:35 -05:00
|
|
|
load(
|
|
|
|
"@build_bazel_rules_nodejs//:defs.bzl",
|
|
|
|
"jasmine_node_test",
|
|
|
|
"node_modules_filegroup",
|
2018-06-04 13:45:27 -04:00
|
|
|
"nodejs_binary",
|
|
|
|
"npm_package",
|
2018-03-01 13:41:35 -05:00
|
|
|
)
|
|
|
|
load("@build_bazel_rules_typescript//:defs.bzl", "ts_library")
|
|
|
|
|
|
|
|
exports_files(["bin/ts-api-guardian"])
|
|
|
|
|
|
|
|
ts_library(
|
|
|
|
name = "lib",
|
|
|
|
srcs = glob(["lib/*.ts"]),
|
|
|
|
module_name = "ts-api-guardian",
|
2018-10-18 12:58:38 -04:00
|
|
|
node_modules = "@ts-api-guardian_deps//typescript:typescript__typings",
|
2018-03-01 13:41:35 -05:00
|
|
|
tsconfig = "//tools:tsconfig.json",
|
|
|
|
visibility = ["//visibility:public"],
|
2018-10-18 12:58:38 -04:00
|
|
|
deps = [
|
|
|
|
"@ts-api-guardian_deps//@types/diff",
|
|
|
|
"@ts-api-guardian_deps//@types/minimist",
|
|
|
|
"@ts-api-guardian_deps//@types/node",
|
|
|
|
"@ts-api-guardian_deps//diff",
|
|
|
|
"@ts-api-guardian_deps//minimist",
|
|
|
|
"@ts-api-guardian_deps//typescript",
|
|
|
|
],
|
2018-03-01 13:41:35 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
# Copy Angular's license to govern ts-api-guardian as well.
|
|
|
|
# We use a genrule to put it in this package, so it will be in the right root directory.
|
|
|
|
genrule(
|
|
|
|
name = "license",
|
|
|
|
srcs = ["//:LICENSE"],
|
|
|
|
outs = ["LICENSE"],
|
|
|
|
cmd = "cp $< $@",
|
|
|
|
)
|
|
|
|
|
|
|
|
npm_package(
|
|
|
|
name = "ts-api-guardian",
|
|
|
|
srcs = [
|
|
|
|
"README.md",
|
|
|
|
"bin/ts-api-guardian",
|
|
|
|
"package.json",
|
|
|
|
],
|
|
|
|
deps = [
|
|
|
|
":lib",
|
|
|
|
":license",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
#######################################3
|
|
|
|
# Tests for this package
|
|
|
|
|
|
|
|
ts_library(
|
|
|
|
name = "test_lib",
|
|
|
|
testonly = True,
|
|
|
|
srcs = glob(["test/*.ts"]),
|
2018-10-18 12:58:38 -04:00
|
|
|
node_modules = "@ts-api-guardian_deps//typescript:typescript__typings",
|
2018-10-04 16:14:14 -04:00
|
|
|
tsconfig = "//tools:tsconfig-test",
|
|
|
|
deps = [
|
|
|
|
":lib",
|
2018-10-18 12:58:38 -04:00
|
|
|
"@ts-api-guardian_deps//@types/chai",
|
|
|
|
"@ts-api-guardian_deps//@types/jasmine",
|
|
|
|
"@ts-api-guardian_deps//@types/node",
|
|
|
|
"@ts-api-guardian_deps//chai",
|
|
|
|
"@ts-api-guardian_deps//jasmine",
|
|
|
|
"@ts-api-guardian_deps//typescript",
|
2018-10-04 16:14:14 -04:00
|
|
|
],
|
2018-03-01 13:41:35 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
jasmine_node_test(
|
|
|
|
name = "tests",
|
|
|
|
srcs = [":test_lib"],
|
|
|
|
bootstrap = ["angular/tools/ts-api-guardian/test/bootstrap.js"],
|
|
|
|
data = glob([
|
|
|
|
"test/fixtures/*.ts",
|
|
|
|
"test/fixtures/*.patch",
|
|
|
|
]) + [
|
|
|
|
":ts-api-guardian",
|
2018-10-18 12:58:38 -04:00
|
|
|
"@ts-api-guardian_deps//chalk",
|
2018-03-01 13:41:35 -05:00
|
|
|
],
|
2018-10-18 12:58:38 -04:00
|
|
|
node_modules = "@ts-api-guardian_deps//typescript:typescript__typings",
|
2018-08-02 00:02:36 -04:00
|
|
|
tags = ["local"],
|
2018-03-01 13:41:35 -05:00
|
|
|
)
|