FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

build: update to rules_nodejs 0.32.2 (#31325) · javascriptStudy111/angular@361109d · GitHub

Commit 361109d

Browse files
authored andcommitted
build: update to rules_nodejs 0.32.2 (angular#31325)
Brings in ts_library fixes required to get angular/angular building after 0.32.0: typescript: exclude typescript lib declarations in node_module_library transitive_declarations typescript: remove override of @bazel/tsetse (+1 squashed commit) @npm//node_modules/foobar:foobar.js labels changed to @npm//:node_modules/foobar/foobar.js with fix for bazel-contrib/rules_nodejs#802 also updates to rules_rass commit compatible with rules_nodejs 0.32.0 PR Close angular#31325
1 parent b7a099d commit 361109d

71 files changed

Lines changed: 392 additions & 422 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.bazelignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.git
12
node_modules
23
dist
34
aio/content

‎.bazelrc‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
# Make compilation fast, by keeping a few copies of the compilers
66
# running as daemons, and cache SourceFile AST's to reduce parse time.
77
build --strategy=AngularTemplateCompile=worker
8-
# TODO(alexeagle): re-enable after fixing worker instability with rxjs typings
9-
# build --strategy=TypeScriptCompile=worker
10-
build --strategy=TypeScriptCompile=standalone
8+
build --strategy=TypeScriptCompile=worker
119

1210
# Enable debugging tests with --config=debug
1311
test:debug --test_arg=--node_options=--inspect-brk --test_output=streamed --test_strategy=exclusive --test_timeout=9999 --nocache_test_results

‎BUILD.bazel‎

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ filegroup(
1818
name = "web_test_bootstrap_scripts",
1919
# do not sort
2020
srcs = [
21-
"@npm//node_modules/core-js:client/core.js",
22-
"@npm//node_modules/zone.js:dist/zone.js",
23-
"@npm//node_modules/zone.js:dist/zone-testing.js",
24-
"@npm//node_modules/zone.js:dist/task-tracking.js",
21+
"@npm//:node_modules/core-js/client/core.js",
22+
"@npm//:node_modules/zone.js/dist/zone.js",
23+
"@npm//:node_modules/zone.js/dist/zone-testing.js",
24+
"@npm//:node_modules/zone.js/dist/task-tracking.js",
2525
"//:test-events.js",
2626
"//:shims_for_IE.js",
2727
# Including systemjs because it defines `__eval`, which produces correct stack traces.
28-
"@npm//node_modules/systemjs:dist/system.src.js",
29-
"@npm//node_modules/reflect-metadata:Reflect.js",
28+
"@npm//:node_modules/systemjs/dist/system.src.js",
29+
"@npm//:node_modules/reflect-metadata/Reflect.js",
3030
],
3131
)
3232

@@ -35,15 +35,15 @@ filegroup(
3535
srcs = [
3636
# We also declare the unminfied AngularJS files since these can be used for
3737
# local debugging (e.g. see: packages/upgrade/test/common/test_helpers.ts)
38-
"@npm//node_modules/angular:angular.js",
39-
"@npm//node_modules/angular:angular.min.js",
40-
"@npm//node_modules/angular-1.5:angular.js",
41-
"@npm//node_modules/angular-1.5:angular.min.js",
42-
"@npm//node_modules/angular-1.6:angular.js",
43-
"@npm//node_modules/angular-1.6:angular.min.js",
44-
"@npm//node_modules/angular-mocks:angular-mocks.js",
45-
"@npm//node_modules/angular-mocks-1.5:angular-mocks.js",
46-
"@npm//node_modules/angular-mocks-1.6:angular-mocks.js",
38+
"@npm//:node_modules/angular/angular.js",
39+
"@npm//:node_modules/angular/angular.min.js",
40+
"@npm//:node_modules/angular-1.5/angular.js",
41+
"@npm//:node_modules/angular-1.5/angular.min.js",
42+
"@npm//:node_modules/angular-1.6/angular.js",
43+
"@npm//:node_modules/angular-1.6/angular.min.js",
44+
"@npm//:node_modules/angular-mocks/angular-mocks.js",
45+
"@npm//:node_modules/angular-mocks-1.5/angular-mocks.js",
46+
"@npm//:node_modules/angular-mocks-1.6/angular-mocks.js",
4747
],
4848
)
4949

‎WORKSPACE‎

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
1818
# Fetch rules_nodejs so we can install our npm dependencies
1919
http_archive(
2020
name = "build_bazel_rules_nodejs",
21-
sha256 = "e04a82a72146bfbca2d0575947daa60fda1878c8d3a3afe868a8ec39a6b968bb",
22-
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.31.1/rules_nodejs-0.31.1.tar.gz"],
21+
sha256 = "6d4edbf28ff6720aedf5f97f9b9a7679401bf7fca9d14a0fff80f644a99992b4",
22+
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.32.2/rules_nodejs-0.32.2.tar.gz"],
2323
)
2424

2525
# Check the bazel version and download npm dependencies
@@ -47,7 +47,10 @@ Try running `yarn bazel` instead.
4747
# - 0.27.12 Adds NodeModuleSources provider for transtive npm deps support
4848
# - 0.30.0 yarn_install now uses symlinked node_modules with new managed directories Bazel 0.26.0 feature
4949
# - 0.31.1 entry_point attribute of nodejs_binary & rollup_bundle is now a label
50-
check_rules_nodejs_version(minimum_version_string = "0.31.1")
50+
# - 0.32.0 yarn_install and npm_install no longer puts build files under symlinked node_modules
51+
# - 0.32.1 remove override of @bazel/tsetse & exclude typescript lib declarations in node_module_library transitive_declarations
52+
# - 0.32.2 resolves bug in @bazel/hide-bazel-files postinstall step
53+
check_rules_nodejs_version(minimum_version_string = "0.32.2")
5154

5255
# Setup the Node.js toolchain
5356
node_repositories(
@@ -71,19 +74,7 @@ node_repositories(
7174

7275
yarn_install(
7376
name = "npm",
74-
data = [
75-
"//:tools/npm/@angular_bazel/index.js",
76-
"//:tools/npm/@angular_bazel/package.json",
77-
"//:tools/postinstall-patches.js",
78-
"//:tools/yarn/check-yarn.js",
79-
],
8077
package_json = "//:package.json",
81-
# Don't install devDependencies, they are large and not used under Bazel
82-
prod_only = True,
83-
# Temporarily disable node_modules symlinking until the fix for
84-
# https://github.com/bazelbuild/bazel/issues/8487 makes it into a
85-
# future Bazel release
86-
symlink_node_modules = False,
8778
yarn_lock = "//:yarn.lock",
8879
)
8980

‎integration/bazel/.bazelrc‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,3 @@ build --symlink_prefix=/
2020
# Turn on managed directories feature in Bazel
2121
# This allows us to avoid installing a second copy of node_modules
2222
common --experimental_allow_incremental_repository_updates
23-
24-
# Temporary flag to for using nodejs rules 0.31.1 with Bazel 0.27.0
25-
# TODO(gregmagolan): remove after updating to next nodejs rules release
26-
common --incompatible_depset_is_not_iterable=false

‎integration/bazel/WORKSPACE‎

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
88
# Fetch rules_nodejs so we can install our npm dependencies
99
http_archive(
1010
name = "build_bazel_rules_nodejs",
11-
sha256 = "e04a82a72146bfbca2d0575947daa60fda1878c8d3a3afe868a8ec39a6b968bb",
12-
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.31.1/rules_nodejs-0.31.1.tar.gz"],
11+
sha256 = "6d4edbf28ff6720aedf5f97f9b9a7679401bf7fca9d14a0fff80f644a99992b4",
12+
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.32.2/rules_nodejs-0.32.2.tar.gz"],
1313
)
1414

1515
# Fetch sass rules for compiling sass files
16-
# TODO: change back to upstream release after https://github.com/bazelbuild/rules_sass/pull/87 merged and released
1716
http_archive(
1817
name = "io_bazel_rules_sass",
19-
strip_prefix = "rules_sass-9862dfc96a4a1f66fe171ef5e043b29853e8445b",
20-
url = "https://github.com/manekinekko/rules_sass/archive/9862dfc96a4a1f66fe171ef5e043b29853e8445b.zip",
18+
sha256 = "4f05239080175a3f4efa8982d2b7775892d656bb47e8cf56914d5f9441fb5ea6",
19+
strip_prefix = "rules_sass-86ca977cf2a8ed481859f83a286e164d07335116",
20+
url = "https://github.com/bazelbuild/rules_sass/archive/86ca977cf2a8ed481859f83a286e164d07335116.zip",
2121
)
2222

2323
# Check the bazel version and download npm dependencies
@@ -39,7 +39,14 @@ Try running `yarn bazel` instead.
3939

4040
# Setup the Node.js toolchain
4141
node_repositories(
42-
node_version = "10.9.0",
42+
# Use same node version as root angular WORKSPACE since
43+
# we share node_module packages and some require node >= 10.15.0
44+
node_repositories = {
45+
"10.16.0-darwin_amd64": ("node-v10.16.0-darwin-x64.tar.gz", "node-v10.16.0-darwin-x64", "6c009df1b724026d84ae9a838c5b382662e30f6c5563a0995532f2bece39fa9c"),
46+
"10.16.0-linux_amd64": ("node-v10.16.0-linux-x64.tar.xz", "node-v10.16.0-linux-x64", "1827f5b99084740234de0c506f4dd2202a696ed60f76059696747c34339b9d48"),
47+
"10.16.0-windows_amd64": ("node-v10.16.0-win-x64.zip", "node-v10.16.0-win-x64", "aa22cb357f0fb54ccbc06b19b60e37eefea5d7dd9940912675d3ed988bf9a059"),
48+
},
49+
node_version = "10.16.0",
4350
yarn_version = "1.12.1",
4451
)
4552

‎integration/bazel/package.json‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@
2323
"@angular/compiler": "file:../../dist/packages-dist/compiler",
2424
"@angular/compiler-cli": "file:../../dist/packages-dist/compiler-cli",
2525
"@bazel/bazel": "file:../../node_modules/@bazel/bazel",
26-
"@bazel/karma": "0.30.1",
27-
"@bazel/typescript": "0.30.1",
26+
"@bazel/hide-bazel-files": "0.32.2",
27+
"@bazel/karma": "0.32.2",
28+
"@bazel/typescript": "0.32.2",
2829
"@types/jasmine": "2.8.8",
2930
"@types/source-map": "0.5.1",
3031
"protractor": "5.1.2",
3132
"typescript": "3.4.2"
3233
},
3334
"scripts": {
3435
"test": "bazel build ... --noshow_progress && bazel test ...",
35-
"postinstall": "ngc -p ./angular-metadata.tsconfig.json",
36-
"//": "TODO(gregmagolan): figure out how to keep dependencies here up to date with the root package.json"
36+
"postinstall": "ngc -p ./angular-metadata.tsconfig.json"
3737
}
3838
}

‎integration/bazel/src/BUILD.bazel‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ filegroup(
2626
name = "rxjs_umd_modules",
2727
srcs = [
2828
# do not sort
29-
"@npm//node_modules/rxjs:bundles/rxjs.umd.js",
29+
"@npm//:node_modules/rxjs/bundles/rxjs.umd.js",
3030
":rxjs_shims.js",
3131
],
3232
)
@@ -40,7 +40,7 @@ ts_devserver(
4040
],
4141
serving_path = "/bundle.min.js",
4242
static_files = [
43-
"@npm//node_modules/zone.js:dist/zone.min.js",
43+
"@npm//:node_modules/zone.js/dist/zone.min.js",
4444
],
4545
deps = ["//src"],
4646
)
@@ -64,7 +64,7 @@ web_package(
6464
name = "prodapp",
6565
assets = [
6666
# do not sort
67-
"@npm//node_modules/zone.js:dist/zone.min.js",
67+
"@npm//:node_modules/zone.js/dist/zone.min.js",
6868
":bundle.min.js",
6969
],
7070
data = [

‎integration/bazel/src/hello-world/BUILD.bazel‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ ts_library(
4646
ts_web_test_suite(
4747
name = "test",
4848
bootstrap = [
49-
"@npm//node_modules/zone.js:dist/zone-testing-bundle.js",
50-
"@npm//node_modules/reflect-metadata:Reflect.js",
49+
"@npm//:node_modules/zone.js/dist/zone-testing-bundle.js",
50+
"@npm//:node_modules/reflect-metadata/Reflect.js",
5151
],
5252
browsers = [
5353
"@io_bazel_rules_webtesting//browsers:chromium-local",

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL