From c9b47f21822343286d056fd70aec882acc0ae788 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Sat, 3 Jul 2021 00:27:01 +0200 Subject: [PATCH] fix(dev-infra): missing `pkg_npm` substitution for top-level targets being accessed (#42754) Currently if a top-level target or file within `//dev-infra` is being referenced. like `//dev-infra:tsconfig`, then the label is not subsituted properly and breaks consumption of the built NPM package. PR Close #42754 --- dev-infra/BUILD.bazel | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dev-infra/BUILD.bazel b/dev-infra/BUILD.bazel index 8e9670d775..db10ba96d3 100644 --- a/dev-infra/BUILD.bazel +++ b/dev-infra/BUILD.bazel @@ -1,9 +1,12 @@ +# BEGIN-INTERNAL 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") +# END-INTERNAL exports_files(["tsconfig.json"]) +# BEGIN-INTERNAL ts_library( name = "cli", srcs = [ @@ -45,6 +48,7 @@ pkg_npm( name = "npm_package", srcs = [ "index.bzl", + "BUILD.bazel", # 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", @@ -55,6 +59,7 @@ pkg_npm( # angular/angular should not consume it's own packages, so we use # substitutions to replace these in the published version of dev-infra. "//dev-infra/": "@npm//@angular/dev-infra-private/", + "//dev-infra:": "@npm//@angular/dev-infra-private:", "//packages/benchpress": "@npm//@angular/benchpress", "//packages/bazel": "@npm//@angular/bazel", "//packages/zone.js/bundles:zone.umd.js": "@npm//zone.js", @@ -106,3 +111,4 @@ ng_dev_rolled_up_generated_file( "//dev-infra/release/build", ], ) +# END-INTERNAL