Revert "build: update to rules_nodejs 0.32.2 (#31019)" (#31267)

This reverts commit a38433f36b.

Reason: this causes failures in g3 with i18n extraction. See #31267.

PR Close #31267
This commit is contained in:
Alex Rickabaugh
2019-06-25 13:11:54 -07:00
committed by Kara Erickson
parent 2c07820636
commit 660800ca4e
71 changed files with 422 additions and 392 deletions

View File

@ -36,11 +36,12 @@ def rules_angular_dev_dependencies():
#############################################
# Dependencies for generating documentation #
#############################################
# TODO(gregmagolan): update to upstream commit once https://github.com/bazelbuild/rules_sass/pull/87 lands
http_archive(
name = "io_bazel_rules_sass",
sha256 = "4f05239080175a3f4efa8982d2b7775892d656bb47e8cf56914d5f9441fb5ea6",
url = "https://github.com/bazelbuild/rules_sass/archive/86ca977cf2a8ed481859f83a286e164d07335116.zip",
strip_prefix = "rules_sass-86ca977cf2a8ed481859f83a286e164d07335116",
sha256 = "1c20d2ddc3d42712543e3b77bceac1bfea072849602569a6fc8b107e6d520ac6",
strip_prefix = "rules_sass-d033c0f9f7a2c75b73068f6647a5b0cc5070fd90",
url = "https://github.com/gregmagolan/rules_sass/archive/d033c0f9f7a2c75b73068f6647a5b0cc5070fd90.zip",
)
http_archive(

View File

@ -22,7 +22,7 @@ nodejs_binary(
"@npm//rollup-plugin-node-resolve",
"@npm//rollup-plugin-sourcemaps",
],
entry_point = "@npm//:node_modules/rollup/bin/rollup",
entry_point = "@npm//node_modules/rollup:bin/rollup",
install_source_map_support = False,
visibility = ["//visibility:public"],
)

View File

@ -15,8 +15,8 @@ workspace(
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
RULES_NODEJS_VERSION = "0.32.2"
RULES_NODEJS_SHA256 = "6d4edbf28ff6720aedf5f97f9b9a7679401bf7fca9d14a0fff80f644a99992b4"
RULES_NODEJS_VERSION = "0.31.1"
RULES_NODEJS_SHA256 = "e04a82a72146bfbca2d0575947daa60fda1878c8d3a3afe868a8ec39a6b968bb"
http_archive(
name = "build_bazel_rules_nodejs",
sha256 = RULES_NODEJS_SHA256,
@ -24,13 +24,16 @@ http_archive(
)
# Rules for compiling sass
RULES_SASS_VERSION = "86ca977cf2a8ed481859f83a286e164d07335116"
RULES_SASS_SHA256 = "4f05239080175a3f4efa8982d2b7775892d656bb47e8cf56914d5f9441fb5ea6"
RULES_SASS_VERSION = "3a4f31c74513ccfacce3f955b5c006352f7e9587"
RULES_SASS_SHA256 = "4c87befcb17282b039ba8341df9a6cc45f461bf05776dcf35c7e40c7e79ce374"
http_archive(
name = "io_bazel_rules_sass",
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,
# 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,
# TODO: change back to upstream release after https://github.com/bazelbuild/rules_sass/pull/87 merged and released
strip_prefix = "rules_sass-9862dfc96a4a1f66fe171ef5e043b29853e8445b",
url = "https://github.com/manekinekko/rules_sass/archive/9862dfc96a4a1f66fe171ef5e043b29853e8445b.zip",
)
####################################
@ -63,9 +66,12 @@ node_repositories(
yarn_install(
name = "npm",
# TODO(gregmagolan): fix rules_nodejs so that if @bazel/hide-bazel-files is detected then this is forced true
always_hide_bazel_files = True,
data = ["//:angular-metadata.tsconfig.json"],
package_json = "//:package.json",
# Temporarily disable node_modules symlinking until the fix for
# https://github.com/bazelbuild/bazel/issues/8487 makes it into a
# future Bazel release
symlink_node_modules = False,
yarn_lock = "//:yarn.lock",
)

View File

@ -33,3 +33,6 @@ build --define=compile=legacy
# Turn on managed directories feature in Bazel
# This allows us to avoid installing a second copy of node_modules
common --experimental_allow_incremental_repository_updates
# Compatibility flag for Bazel 0.27.0
common --incompatible_depset_is_not_iterable=false

View File

@ -59,7 +59,7 @@ web_package(
name = "prodapp",
assets = [
# do not sort
"@npm//:node_modules/zone.js/dist/zone.min.js",
"@npm//node_modules/zone.js:dist/zone.min.js",
":bundle.min.js",
":global_stylesheet",
],
@ -79,7 +79,7 @@ filegroup(
name = "rxjs_umd_modules",
srcs = [
# do not sort
"@npm//:node_modules/rxjs/bundles/rxjs.umd.js",
"@npm//node_modules/rxjs:bundles/rxjs.umd.js",
":rxjs_shims.js",
],
)
@ -90,11 +90,11 @@ ts_devserver(
entry_module = "project/src/main.dev",
serving_path = "/bundle.min.js",
scripts = [
"@npm//:node_modules/tslib/tslib.js",
"@npm//node_modules/tslib:tslib.js",
":rxjs_umd_modules",
],
static_files = [
"@npm//:node_modules/zone.js/dist/zone.min.js",
"@npm//node_modules/zone.js:dist/zone.min.js",
":global_stylesheet",
],
data = [
@ -132,15 +132,15 @@ ts_library(
ts_web_test_suite(
name = "test",
srcs = [
"@npm//:node_modules/tslib/tslib.js",
"@npm//node_modules/tslib:tslib.js",
],
runtime_deps = [
":initialize_testbed",
],
# do not sort
bootstrap = [
"@npm//:node_modules/zone.js/dist/zone-testing-bundle.js",
"@npm//:node_modules/reflect-metadata/Reflect.js",
"@npm//node_modules/zone.js:dist/zone-testing-bundle.js",
"@npm//node_modules/reflect-metadata:Reflect.js",
],
browsers = [
"@io_bazel_rules_webtesting//browsers:chromium-local",

View File

@ -13,6 +13,7 @@ load(
"DEFAULT_NG_COMPILER",
"DEFAULT_NG_XI18N",
"DEPS_ASPECTS",
"NodeModuleInfo",
"NodeModuleSources",
"TsConfigInfo",
"collect_node_modules_aspect",
@ -559,7 +560,13 @@ def ng_module_impl(ctx, ts_compile_actions):
providers = ts_compile_actions(
ctx,
is_library = True,
deps = ctx.attr.deps,
# Filter out the node_modules from deps passed to TypeScript compiler
# since they don't have the required providers.
# They were added to the action inputs for tsc_wrapped already.
# strict_deps checking currently skips node_modules.
# TODO(alexeagle): turn on strict deps checking when we have a real
# provider for JS/DTS inputs to ts_library.
deps = [d for d in ctx.attr.deps if not NodeModuleInfo in d],
compile_action = _prodmode_compile_action,
devmode_compile_action = _devmode_compile_action,
tsc_wrapped_tsconfig = _ngc_tsconfig,

View File

@ -173,7 +173,7 @@ def protractor_web_test(
data = [],
server = None,
tags = [],
protractor = "@npm//:node_modules/protractor/bin/protractor",
protractor = "@npm//node_modules/protractor:bin/protractor",
**kwargs):
"""Runs a protractor test in a browser.
@ -188,8 +188,8 @@ def protractor_web_test(
data: Runtime dependencies
server: Optional server executable target
tags: Standard Bazel tags, this macro adds one for ibazel
protractor: Protractor entry_point. Defaults to @npm//:node_modules/protractor/bin/protractor
but should be changed to @your_npm_workspace//:node_modules/protractor/bin/protractor if
protractor: Protractor entry_point. Defaults to @npm//node_modules/protractor:bin/protractor
but should be changed to @your_npm_workspace//node_modules/protractor:bin/protractor if
you are not using @npm for your npm dependencies.
**kwargs: passed through to `_protractor_web_test`
"""
@ -248,7 +248,7 @@ def protractor_web_test_suite(
visibility = None,
web_test_data = [],
wrapped_test_tags = None,
protractor = "@npm//:node_modules/protractor/bin/protractor",
protractor = "@npm//node_modules/protractor:bin/protractor",
**remaining_keyword_args):
"""Defines a test_suite of web_test targets that wrap a protractor_web_test target.
@ -282,8 +282,8 @@ def protractor_web_test_suite(
visibility: List of labels; optional.
web_test_data: Data dependencies for the web_test.
wrapped_test_tags: A list of test tag strings to use for the wrapped test
protractor: Protractor entry_point. Defaults to @npm//:node_modules/protractor/bin/protractor
but should be changed to @your_npm_workspace//:node_modules/protractor/bin/protractor if
protractor: Protractor entry_point. Defaults to @npm//node_modules/protractor:bin/protractor
but should be changed to @your_npm_workspace//node_modules/protractor:bin/protractor if
you are not using @npm for your npm dependencies.
**remaining_keyword_args: Arguments for the wrapped test target.
"""

View File

@ -49,10 +49,9 @@ function addDevDependenciesToPackageJson(options: Schema) {
const devDependencies: {[k: string]: string} = {
'@angular/bazel': angularCoreVersion,
'@bazel/bazel': '^0.27.0',
'@bazel/hide-bazel-files': '0.32.2',
'@bazel/ibazel': '^0.10.2',
'@bazel/karma': '0.32.2',
'@bazel/typescript': '0.32.2',
'@bazel/karma': '0.31.1',
'@bazel/typescript': '0.31.1',
};
const recorder = host.beginUpdate(packageJson);