Skip to content

Commit 45471db

Browse files
devversionatscott
authored andcommitted
refactor(dev-infra): allow for consumption with rules_nodejs v2.0.0 (angular#37968)
With `rules_nodejs` v2.0.0 being in RC phase currently, we should make sure that the package is compatible so that we can use it in the components repo in combination with rules_nodejs v2.0.0. In v2.0.0 of the NodeJS rules, Bazel workspaces are recommended to no longer be symlinked under a separate repository. Instead, bazel rules and targets should be accessed directly from the user-selected NPM repository. Usually `@npm`, so that the import changes to `@npm//@angular/dev-infra-private/<..>`. PR Close angular#37968
1 parent 387e838 commit 45471db

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

dev-infra/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ genrule(
3838
pkg_npm(
3939
name = "npm_package",
4040
srcs = [
41-
"BUILD.bazel",
41+
"index.bzl",
4242
"//dev-infra/bazel:files",
4343
"//dev-infra/benchmark:files",
4444
],

dev-infra/index.bzl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Copyright Google LLC All Rights Reserved.
2+
#
3+
# Use of this source code is governed by an MIT-style license that can be
4+
# found in the LICENSE file at https://angular.io/license
5+
6+
# File is currently empty but serves as indicator for `rules_nodejs` and instructs it to
7+
# preserve the content output in the NPM install workspace. This allows consumers to use
8+
# rules and targets from within Bazel. e.g. by using `@npm//@angular/dev-infra-private/<..>`.
9+
# See: https://github.com/bazelbuild/rules_nodejs/commit/4f508b1a0be1f5444e9c13b0439e649449792fef.

0 commit comments

Comments
 (0)