Paul Gschwendtner 6dd88aadac fix(dev-infra): api-golden tool does not specify a tsconfig and breaks for consumers (#42737)
Tools that are shipped as a Bazel rule with the shared dev-infra
tool require a specific `tsconfig` as otherwise `ts_library` will
accidentally look for a tsconfig in `@npm//:tsconfig` and the build
will fail. We bring in our dev-infra tsconfig and reference it
explicitly.

PR Close #42737
2021-07-02 10:08:03 -07:00

36 lines
878 B
Python

load("@npm//@bazel/typescript:index.bzl", "ts_library")
package(default_visibility = ["//visibility:public"])
exports_files([
"index.ts",
"index_npm_packages.ts",
])
ts_library(
name = "api-golden",
srcs = [
"find_entry_points.ts",
"index.ts",
"index_npm_packages.ts",
"test_api_report.ts",
],
# A tsconfig needs to be specified as otherwise `ts_library` will look for the config
# in `//:package.json` and this breaks when the BUILD file is copied to `@npm//`.
tsconfig = "//dev-infra:tsconfig.json",
deps = [
"@npm//@bazel/runfiles",
"@npm//@microsoft/api-extractor",
"@npm//@types/node",
"@npm//chalk",
"@npm//tslib",
"@npm//typescript",
],
)
# Expose the sources in the dev-infra NPM package.
filegroup(
name = "files",
srcs = glob(["*"]),
)