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
This commit is contained in:
parent
e81efe6667
commit
6dd88aadac
|
@ -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",
|
||||
],
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue