2019-04-19 02:37:01 -04:00
|
|
|
# BEGIN-INTERNAL
|
2018-03-01 13:41:35 -05:00
|
|
|
load(
|
|
|
|
"@build_bazel_rules_nodejs//:defs.bzl",
|
|
|
|
"jasmine_node_test",
|
2018-06-04 13:45:27 -04:00
|
|
|
"npm_package",
|
2018-03-01 13:41:35 -05:00
|
|
|
)
|
2019-02-20 12:54:42 -05:00
|
|
|
load("@npm_bazel_typescript//:index.bzl", "ts_library")
|
2018-03-01 13:41:35 -05:00
|
|
|
|
|
|
|
ts_library(
|
|
|
|
name = "lib",
|
|
|
|
srcs = glob(["lib/*.ts"]),
|
|
|
|
module_name = "ts-api-guardian",
|
|
|
|
tsconfig = "//tools:tsconfig.json",
|
|
|
|
visibility = ["//visibility:public"],
|
2018-10-18 12:58:38 -04:00
|
|
|
deps = [
|
2019-04-09 21:08:13 -04:00
|
|
|
"@npm//@types/diff",
|
|
|
|
"@npm//@types/minimist",
|
|
|
|
"@npm//@types/node",
|
2019-04-23 08:47:18 -04:00
|
|
|
"@npm//chalk",
|
2019-04-09 21:08:13 -04:00
|
|
|
"@npm//diff",
|
|
|
|
"@npm//minimist",
|
|
|
|
"@npm//typescript",
|
2018-10-18 12:58:38 -04:00
|
|
|
],
|
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 = [
|
2019-04-19 02:37:01 -04:00
|
|
|
"BUILD.bazel",
|
2018-03-01 13:41:35 -05:00
|
|
|
"README.md",
|
|
|
|
"bin/ts-api-guardian",
|
2019-04-19 02:37:01 -04:00
|
|
|
"index.bzl",
|
2018-03-01 13:41:35 -05:00
|
|
|
"package.json",
|
|
|
|
],
|
2019-04-19 02:37:01 -04:00
|
|
|
replacements = {
|
2019-04-23 08:47:18 -04:00
|
|
|
"@angular//tools/ts-api-guardian:bin": "@npm_ts_api_guardian//:bin",
|
|
|
|
"@angular//tools/ts-api-guardian:lib": "@npm//ts-api-guardian",
|
2019-04-19 02:37:01 -04:00
|
|
|
"angular/tools/ts-api-guardian/": "npm_ts_api_guardian/",
|
|
|
|
},
|
2018-03-01 13:41:35 -05:00
|
|
|
deps = [
|
|
|
|
":lib",
|
|
|
|
":license",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
#######################################3
|
|
|
|
# Tests for this package
|
|
|
|
|
|
|
|
ts_library(
|
|
|
|
name = "test_lib",
|
|
|
|
testonly = True,
|
|
|
|
srcs = glob(["test/*.ts"]),
|
2018-10-04 16:14:14 -04:00
|
|
|
tsconfig = "//tools:tsconfig-test",
|
|
|
|
deps = [
|
|
|
|
":lib",
|
2019-04-09 21:08:13 -04:00
|
|
|
"@npm//@types/chai",
|
|
|
|
"@npm//@types/jasmine",
|
|
|
|
"@npm//@types/node",
|
|
|
|
"@npm//chai",
|
|
|
|
"@npm//jasmine",
|
|
|
|
"@npm//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-29 16:25:00 -04:00
|
|
|
# TODO: remove this once the boostrap.js workaround has been removed.
|
|
|
|
":package.json",
|
2018-03-01 13:41:35 -05:00
|
|
|
],
|
2018-08-02 00:02:36 -04:00
|
|
|
tags = ["local"],
|
2018-03-01 13:41:35 -05:00
|
|
|
)
|
2019-04-19 02:37:01 -04:00
|
|
|
# END-INTERNAL
|
|
|
|
|
2019-04-23 13:12:00 -04:00
|
|
|
filegroup(
|
|
|
|
name = "bin",
|
|
|
|
srcs = glob(["lib/*.js"]) + ["bin/ts-api-guardian"],
|
2019-04-19 02:37:01 -04:00
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|