@@ -8,9 +8,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
8
8
# Add NodeJS rules
9
9
http_archive (
10
10
name = "build_bazel_rules_nodejs" ,
11
- patches = ["//tools:multiple-node-versions.patch" ],
12
- sha256 = "f7037c8e295fdc921f714962aee7c496110052511e2b14076bd8e2d46bc9819c" ,
13
- urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/4.4.5/rules_nodejs-4.4.5.tar.gz" ],
11
+ sha256 = "3ceb1e5b5dcad5fa2ad8870a20201cfbb9c9c63cac4055c9ab370034c765297f" ,
12
+ urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.3.0/rules_nodejs-5.3.0.tar.gz" ],
14
13
)
15
14
16
15
# Add sass rules
@@ -28,10 +27,10 @@ http_archive(
28
27
# for declaring Bazel build setting flags.
29
28
http_archive (
30
29
name = "bazel_skylib" ,
31
- sha256 = "191ea53b19b7e49b5b63d0ef81d1a6278227f9ac2c09fed1c2b3a75d573f1eeb " ,
32
- strip_prefix = "bazel-skylib-b2ed61686ebca2a44d44857fef5b3e1d31cc2483 " ,
30
+ sha256 = "a9c5d3a22461ed7063aa7b088f9c96fa0aaaa8b6984b601f84d705adc47d8a58 " ,
31
+ strip_prefix = "bazel-skylib-8334f938c1574ef6f1f7a38a03550a31df65274e " ,
33
32
urls = [
34
- "https://github.com/bazelbuild/bazel-skylib/archive/b2ed61686ebca2a44d44857fef5b3e1d31cc2483 .tar.gz" ,
33
+ "https://github.com/bazelbuild/bazel-skylib/archive/8334f938c1574ef6f1f7a38a03550a31df65274e .tar.gz" ,
35
34
],
36
35
)
37
36
@@ -52,27 +51,42 @@ load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
52
51
53
52
bazel_skylib_workspace ()
54
53
55
- load ("@build_bazel_rules_nodejs//:index .bzl" , "node_repositories" , "yarn_install " )
54
+ load ("@build_bazel_rules_nodejs//:repositories .bzl" , "build_bazel_rules_nodejs_dependencies " )
56
55
57
- node_repositories (
58
- # TOOD: Bring this in sync with CircleCI and nvmrc once we are on `rules_nodejs`#v5.
59
- node_version = "16.10.0" ,
60
- package_json = ["//:package.json" ],
56
+ build_bazel_rules_nodejs_dependencies ()
57
+
58
+ load ("@rules_nodejs//nodejs:repositories.bzl" , "nodejs_register_toolchains" )
59
+
60
+ nodejs_register_toolchains (
61
+ name = "nodejs" ,
62
+ node_version = "16.14.0" ,
61
63
)
62
64
65
+ load ("@build_bazel_rules_nodejs//:index.bzl" , "yarn_install" )
63
66
load ("//tools:integration.bzl" , "create_npm_package_archive_build_file" )
64
67
65
68
yarn_install (
66
69
name = "npm" ,
67
70
# We add the postinstall patches file here so that Yarn will rerun whenever
68
71
# the file is modified.
69
72
data = [
73
+ "//:.yarn/releases/yarn-1.22.17.cjs" ,
74
+ "//:.yarnrc" ,
70
75
"//:tools/postinstall/apply-patches.js" ,
76
+ "//:tools/postinstall/devmode-es2020-bazel.patch" ,
71
77
],
78
+ # Currently disabled due to:
79
+ # 1. Missing Windows support currently.
80
+ # 2. Incompatibilites with the `ts_library` rule.
81
+ exports_directories_only = False ,
72
82
# Add archive targets for some NPM packages that are needed in integration tests.
73
83
manual_build_file_contents = create_npm_package_archive_build_file (),
74
84
package_json = "//:package.json" ,
75
85
quiet = False ,
86
+ # We prefer to symlink the `node_modules` to only maintain a single install.
87
+ # See https://github.com/angular/dev-infra/pull/446#issuecomment-1059820287 for details.
88
+ symlink_node_modules = True ,
89
+ yarn = "//:.yarn/releases/yarn-1.22.17.cjs" ,
76
90
yarn_lock = "//:yarn.lock" ,
77
91
)
78
92
@@ -106,4 +120,6 @@ _dev_infra_browser_repositories()
106
120
107
121
load ("@build_bazel_rules_nodejs//toolchains/esbuild:esbuild_repositories.bzl" , "esbuild_repositories" )
108
122
109
- esbuild_repositories ()
123
+ esbuild_repositories (
124
+ npm_repository = "npm" ,
125
+ )
0 commit comments