@@ -12,7 +12,9 @@ http_archive(
1212 urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.8.4/rules_nodejs-5.8.4.tar.gz" ],
1313)
1414
15- # Add skylib which contains common Bazel utilities.
15+ # Add skylib which contains common Bazel utilities. Note that `rules_nodejs` would also
16+ # bring in the skylib repository but with an older version that does not support shorthands
17+ # for declaring Bazel build setting flags.
1618http_archive (
1719 name = "bazel_skylib" ,
1820 sha256 = "a9c5d3a22461ed7063aa7b088f9c96fa0aaaa8b6984b601f84d705adc47d8a58" ,
@@ -54,6 +56,8 @@ load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
5456
5557rules_js_dependencies ()
5658
59+ load ("@rules_nodejs//nodejs:repositories.bzl" , "nodejs_register_toolchains" )
60+
5761NODE_VERSION = "22.0.0"
5862
5963NODE_REPOSITORIES = {
@@ -66,17 +70,39 @@ NODE_REPOSITORIES = {
6670 "22.0.0-windows_amd64" : ("node-v22.0.0-win-x64.zip" , "node-v22.0.0-win-x64" , "32d639b47d4c0a651ff8f8d7d41a454168a3d4045be37985f9a810cf8cef6174" ),
6771}
6872
73+ nodejs_register_toolchains (
74+ name = "nodejs" ,
75+ node_repositories = NODE_REPOSITORIES ,
76+ node_version = NODE_VERSION ,
77+ )
78+
6979load ("@aspect_rules_js//js:toolchains.bzl" , "rules_js_register_toolchains" )
7080
7181rules_js_register_toolchains (
7282 node_repositories = NODE_REPOSITORIES ,
7383 node_version = NODE_VERSION ,
7484)
7585
86+ load ("@build_bazel_rules_nodejs//:index.bzl" , "yarn_install" )
87+
88+ # TODO(devversion): Remove this once `ng_package` is ported over to `rules_js`.
89+ yarn_install (
90+ name = "npm" ,
91+ data = [
92+ "//tools/bazel/legacy-rnjs:.yarn/patches/@angular-bazel-https-c46f484fb8.patch" ,
93+ "//tools/bazel/legacy-rnjs:.yarn/releases/yarn-4.5.0.cjs" ,
94+ "//tools/bazel/legacy-rnjs:.yarnrc.yml" ,
95+ ],
96+ exports_directories_only = False ,
97+ package_json = "//tools/bazel/legacy-rnjs:package.json" ,
98+ yarn = "//tools/bazel/legacy-rnjs:.yarn/releases/yarn-4.5.0.cjs" ,
99+ yarn_lock = "//tools/bazel/legacy-rnjs:yarn.lock" ,
100+ )
101+
76102load ("@aspect_rules_js//npm:repositories.bzl" , "npm_translate_lock" )
77103
78104npm_translate_lock (
79- name = "npm " ,
105+ name = "npm2 " ,
80106 custom_postinstalls = {
81107 "@angular/animations" : "node ../../@nginfra/angular-linking/index.mjs" ,
82108 "@angular/common" : "node ../../@nginfra/angular-linking/index.mjs" ,
@@ -149,7 +175,7 @@ npm_translate_lock(
149175 verify_node_modules_ignored = "//:.bazelignore" ,
150176)
151177
152- load ("@npm //:repositories.bzl" , "npm_repositories" )
178+ load ("@npm2 //:repositories.bzl" , "npm_repositories" )
153179
154180npm_repositories ()
155181
@@ -204,7 +230,7 @@ setup_dependencies_2()
204230
205231git_repository (
206232 name = "rules_angular" ,
207- commit = "005c80615934c891d729d5efc1ae661f9e3210c4 " ,
233+ commit = "514eda9ec00a6745dc11b2a62d7be2634199171e " ,
208234 remote = "https://github.com/devversion/rules_angular.git" ,
209235)
210236
0 commit comments