From ea0e832e5f82c07ab468bd27f404c8ea4d1b72d9 Mon Sep 17 00:00:00 2001 From: Greg Magolan Date: Mon, 18 Mar 2019 14:50:52 -0700 Subject: [PATCH] build(bazel): update to nodejs rules 0.27.6 (#29375) PR Close #29375 --- WORKSPACE | 4 ++-- integration/bazel/WORKSPACE | 4 ++-- integration/bazel/src/package.json | 2 +- package.json | 6 ++--- packages/bazel/package.json | 2 +- .../src/builders/files/WORKSPACE.template | 8 ++++--- packages/bazel/src/schematics/ng-add/index.ts | 2 +- tools/testing/init_node_spec.ts | 19 +++------------ yarn.lock | 24 +++++++++---------- 9 files changed, 30 insertions(+), 41 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index bebdde2429..6bd0fcb082 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -15,8 +15,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # Fetch rules_nodejs so we can install our npm dependencies http_archive( name = "build_bazel_rules_nodejs", - sha256 = "251a023b6c5c5c97db1bfe24652dc19dad05f4da68f8e1821d92d911fa3f4ef4", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.27.4/rules_nodejs-0.27.4.tar.gz"], + sha256 = "35511e7e9aa7d6fcfd429200a6e9b40733ebdd40ab1420935079798e9903c904", + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.27.6/rules_nodejs-0.27.6.tar.gz"], ) # Check the bazel version and download npm dependencies diff --git a/integration/bazel/WORKSPACE b/integration/bazel/WORKSPACE index 719938acea..481d821fef 100644 --- a/integration/bazel/WORKSPACE +++ b/integration/bazel/WORKSPACE @@ -5,8 +5,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # Fetch rules_nodejs so we can install our npm dependencies http_archive( name = "build_bazel_rules_nodejs", - sha256 = "251a023b6c5c5c97db1bfe24652dc19dad05f4da68f8e1821d92d911fa3f4ef4", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.27.4/rules_nodejs-0.27.4.tar.gz"], + sha256 = "35511e7e9aa7d6fcfd429200a6e9b40733ebdd40ab1420935079798e9903c904", + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.27.6/rules_nodejs-0.27.6.tar.gz"], ) # Fetch sass rules for compiling sass files diff --git a/integration/bazel/src/package.json b/integration/bazel/src/package.json index 42b8a0aa7a..0ede69aab8 100644 --- a/integration/bazel/src/package.json +++ b/integration/bazel/src/package.json @@ -18,7 +18,7 @@ "@angular/bazel": "packages-dist:bazel", "@angular/compiler": "packages-dist:compiler", "@angular/compiler-cli": "packages-dist:compiler-cli", - "@bazel/karma": "0.27.4", + "@bazel/karma": "0.27.6", "@types/jasmine": "2.8.8", "@types/source-map": "0.5.1", "protractor": "5.1.2", diff --git a/package.json b/package.json index 6ced349aa4..e021d612b8 100644 --- a/package.json +++ b/package.json @@ -36,9 +36,9 @@ "@angular-devkit/core": "^7.3.2", "@angular-devkit/schematics": "^7.3.2", "@angular/bazel": "file:./tools/npm/@angular_bazel", - "@bazel/jasmine": "0.27.4", - "@bazel/karma": "0.27.4", - "@bazel/typescript": "0.27.4", + "@bazel/jasmine": "0.27.6", + "@bazel/karma": "0.27.6", + "@bazel/typescript": "0.27.6", "@microsoft/api-extractor": "^7.0.21", "@schematics/angular": "^7.3.5", "@types/angular": "^1.6.47", diff --git a/packages/bazel/package.json b/packages/bazel/package.json index 3122871b88..e5a04e93c5 100644 --- a/packages/bazel/package.json +++ b/packages/bazel/package.json @@ -22,7 +22,7 @@ "@angular-devkit/architect": "^0.13.4", "@angular-devkit/core": "^7.0.4", "@angular-devkit/schematics": "^7.3.0-rc.0", - "@bazel/typescript": "^0.27.4", + "@bazel/typescript": "^0.27.6", "@microsoft/api-extractor": "^7.0.21", "@schematics/angular": "^7.3.5", "@types/node": "6.0.84", diff --git a/packages/bazel/src/builders/files/WORKSPACE.template b/packages/bazel/src/builders/files/WORKSPACE.template index c6ddd11b4a..92f26a9342 100644 --- a/packages/bazel/src/builders/files/WORKSPACE.template +++ b/packages/bazel/src/builders/files/WORKSPACE.template @@ -12,18 +12,20 @@ workspace(name = "project") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -RULES_NODEJS_VERSION = "0.27.4" +RULES_NODEJS_VERSION = "0.27.6" +RULES_NODEJS_SHA256 = "35511e7e9aa7d6fcfd429200a6e9b40733ebdd40ab1420935079798e9903c904" http_archive( name = "build_bazel_rules_nodejs", - sha256 = "251a023b6c5c5c97db1bfe24652dc19dad05f4da68f8e1821d92d911fa3f4ef4", + sha256 = RULES_NODEJS_SHA256, url = "https://github.com/bazelbuild/rules_nodejs/releases/download/%s/rules_nodejs-%s.tar.gz" % (RULES_NODEJS_VERSION, RULES_NODEJS_VERSION), ) # Rules for compiling sass RULES_SASS_VERSION = "1.17.2" +RULES_SASS_SHA256 = "e5316ee8a09d1cbb732d3938b400836bf94dba91a27476e9e27706c4c0edae1f" http_archive( name = "io_bazel_rules_sass", - sha256 = "e5316ee8a09d1cbb732d3938b400836bf94dba91a27476e9e27706c4c0edae1f", + sha256 = RULES_SASS_SHA256, url = "https://github.com/bazelbuild/rules_sass/archive/%s.zip" % RULES_SASS_VERSION, strip_prefix = "rules_sass-%s" % RULES_SASS_VERSION, ) diff --git a/packages/bazel/src/schematics/ng-add/index.ts b/packages/bazel/src/schematics/ng-add/index.ts index 7e38393170..5d776509ff 100755 --- a/packages/bazel/src/schematics/ng-add/index.ts +++ b/packages/bazel/src/schematics/ng-add/index.ts @@ -49,7 +49,7 @@ function addDevDependenciesToPackageJson(options: Schema) { '@angular/bazel': angularCoreVersion, '@bazel/bazel': '^0.23.0', '@bazel/ibazel': '^0.9.0', - '@bazel/karma': '^0.27.4', + '@bazel/karma': '^0.27.6', }; const recorder = host.beginUpdate(packageJson); diff --git a/tools/testing/init_node_spec.ts b/tools/testing/init_node_spec.ts index 0dc2b82471..e28b9c5c3a 100644 --- a/tools/testing/init_node_spec.ts +++ b/tools/testing/init_node_spec.ts @@ -15,22 +15,9 @@ import 'zone.js/dist/fake-async-test.js'; import 'zone.js/dist/task-tracking.js'; import 'reflect-metadata/Reflect'; -// We must first initialize jasmine-core before calling -// requiring `zone.js/dist/jasmine-patch.js` which patches -// jasmine ENV with code which understands ProxyZone. -// jasmine_node_test under Bazel will check if `jasmineCore.boot(jasmineCore)` -// has been called and re-use the env if it has. -// See https://github.com/bazelbuild/rules_nodejs/pull/539 -let jasmineCore: any = null; -try { - // Under Bazel we want to use the jasmine-core version that is - // a transive dep of @bazel/typescript. Attempt to require under - // its nested node_modules incase it was not hoisted. - jasmineCore = require('@bazel/jasmine/node_modules/jasmine-core'); -} catch (_) { - jasmineCore = require('jasmine-core'); -} -jasmineCore.boot(jasmineCore); +// Initialize jasmine with @bazel/jasmine boot() function. This will initialize +// global.jasmine so that it can be patched by zone.js jasmine-patch.js. +require('@bazel/jasmine').boot(); import 'zone.js/dist/jasmine-patch.js'; (global as any).isNode = true; diff --git a/yarn.lock b/yarn.lock index 703a9a433c..c2a4f1d22e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -127,17 +127,17 @@ resolved "https://registry.yarnpkg.com/@bazel/ibazel/-/ibazel-0.9.0.tgz#fd60023acd36313d304cc2f8c2e181b88b5445cd" integrity sha512-E31cefDcdJsx/oii6p/gqKZXSVw0kEg1O73DD2McFcSvnf/p1GYWcQtVgdRQmlviBEytJkJgdX8rtThitRvcow== -"@bazel/jasmine@0.27.4": - version "0.27.4" - resolved "https://registry.yarnpkg.com/@bazel/jasmine/-/jasmine-0.27.4.tgz#1b6548def3d35ed14799681cab27a01d776d2835" - integrity sha512-rFNZTFYWVSYqK5CqfBtbC7TL2FofIEYfM5Q8gWol8Lc6ChLjI5574jtmqWyJDMjRskKmJUDz4m5gaiE+BoKHeA== +"@bazel/jasmine@0.27.6": + version "0.27.6" + resolved "https://registry.yarnpkg.com/@bazel/jasmine/-/jasmine-0.27.6.tgz#421f9f050df4cb6031574880b987a242bcd05b1a" + integrity sha512-Kk6vAWOCtuzEoCH3lJNmwUJUHaQWGjZLWDK2nkrJmP/364nXULdDgPC53d0anztrRQ5jy3K8SZj15Bzt5kEC3A== dependencies: jasmine "~3.3.1" -"@bazel/karma@0.27.4": - version "0.27.4" - resolved "https://registry.yarnpkg.com/@bazel/karma/-/karma-0.27.4.tgz#06c36515740f9d2cbcacb2783dd2f9b5c50ed386" - integrity sha512-6dIKxsktWaLMj1G7rV/6GCi4O6z75t57O+alD+WVThsKdqGdQ9PH6qRcw7VnUo+J9d6GA5Kr922b6XAE8m1q2g== +"@bazel/karma@0.27.6": + version "0.27.6" + resolved "https://registry.yarnpkg.com/@bazel/karma/-/karma-0.27.6.tgz#1a9877231b1cde33fe606a7537aa56dbf18bf529" + integrity sha512-24DwyZuily2vAbS8w64dxvUBv1ugK6AN4LEZUurAtjyYDjuaN5G7hdD6p+qDR+BFO4z19tUeGWR9wfJSaFIj+g== dependencies: jasmine-core "2.8.0" karma "^4.0.0" @@ -151,10 +151,10 @@ semver "5.6.0" tmp "0.0.33" -"@bazel/typescript@0.27.4": - version "0.27.4" - resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-0.27.4.tgz#412e438338675aeab34dcf5e57ed5e0705e8fed4" - integrity sha512-DvonqvUyiwgADRUMO4hpJlk/24LbBjPsNevPyHDKF3x2hH0IGH0NQ0MrulNHCY7xkg7vfMF4lLaHoCnuXhrVzA== +"@bazel/typescript@0.27.6": + version "0.27.6" + resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-0.27.6.tgz#9f426053390a2c2d0eddcd9dd9328cfee4be55b6" + integrity sha512-Ha/Dvr43wWXyljEduYIoR/9Zaqgwq+h9llOiVfOpm3JF2S5X5xHJFI/7zUi1kpFc1FAqz43eVrI13OWa8Br+Eg== dependencies: protobufjs "5.0.3" semver "5.6.0"