fix(dev-infra): api-golden tool does not specify a tsconfig and breaks for consumers (#42749)

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 #42749
This commit is contained in:
Paul Gschwendtner
2021-07-01 21:41:53 +02:00
committed by atscott
parent a1e9ccb340
commit 3df4d898fa
2 changed files with 8 additions and 0 deletions
+5
View File
@@ -2,6 +2,8 @@ load("@build_bazel_rules_nodejs//:index.bzl", "pkg_npm")
load("@npm//@bazel/typescript:index.bzl", "ts_library")
load("//dev-infra:index.bzl", "ng_dev_rolled_up_generated_file")
exports_files(["tsconfig.json"])
ts_library(
name = "cli",
srcs = [
@@ -43,6 +45,9 @@ pkg_npm(
name = "npm_package",
srcs = [
"index.bzl",
# Some tools within `dev-infra` which are shipped as Bazel rules might
# rely on a tsconfig file. We bring the config into the NPM package.
"tsconfig.json",
"//dev-infra/bazel:files",
"//dev-infra/benchmark:files",
],
+3
View File
@@ -15,6 +15,9 @@ ts_library(
"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",