refactor: handle breaking changes in rules_nodejs 1.0.0 (#34589)

The major one that affects the angular repo is the removal of the bootstrap attribute in nodejs_binary, nodejs_test and jasmine_node_test in favor of using templated_args --node_options=--require=/path/to/script. The side-effect of this is that the bootstrap script does not get the require.resolve patches with explicitly loading the targets _loader.js file.

PR Close #34589
This commit is contained in:
Greg Magolan
2019-12-28 18:14:36 -08:00
committed by atscott
parent 96643e7ce2
commit 9bb349e1c8
69 changed files with 318 additions and 131 deletions

View File

@ -21,12 +21,13 @@ ts_library(
jasmine_node_test(
name = "test",
bootstrap = ["angular/tools/testing/init_node_spec.js"],
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"],
deps = [
":test_lib",
"//packages/platform-server",
"//packages/platform-server/testing",
"//packages/private/testing",
"//tools/testing:node",
"//tools/testing:node_es5",
],
)

View File

@ -22,12 +22,13 @@ ts_library(
jasmine_node_test(
name = "test",
bootstrap = ["angular/tools/testing/init_node_spec.js"],
tags = [
"ivy-only",
],
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"],
deps = [
":test_lib",
"//tools/testing:node",
"//tools/testing:node_es5",
],
)

View File

@ -33,13 +33,13 @@ ts_library(
jasmine_node_test(
name = "test",
bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"],
data = [
"//packages/compiler-cli/test/ngtsc/fake_core:npm_package",
],
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"],
deps = [
":test_lib",
"//tools/testing:node_no_angular",
"//tools/testing:node_no_angular_es5",
],
)
@ -64,7 +64,6 @@ ts_library(
jasmine_node_test(
name = "integration",
timeout = "long",
bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"],
data = [
"//packages/common:npm_package",
"//packages/core:npm_package",
@ -75,9 +74,10 @@ jasmine_node_test(
# Disabled in AOT mode because we want ngcc to compile non-AOT Angular packages.
"no-ivy-aot",
],
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"],
deps = [
":integration_lib",
"//tools/testing:node_no_angular",
"//tools/testing:node_no_angular_es5",
"@npm//canonical-path",
"@npm//convert-source-map",
],

View File

@ -29,9 +29,9 @@ ts_library(
jasmine_node_test(
name = "test",
bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"],
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"],
deps = [
":test_lib",
"//tools/testing:node_no_angular",
"//tools/testing:node_no_angular_es5",
],
)

View File

@ -21,9 +21,9 @@ ts_library(
jasmine_node_test(
name = "test",
bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"],
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"],
deps = [
":test_lib",
"//tools/testing:node_no_angular",
"//tools/testing:node_no_angular_es5",
],
)

View File

@ -19,9 +19,9 @@ ts_library(
jasmine_node_test(
name = "test",
bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"],
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"],
deps = [
":test_lib",
"//tools/testing:node_no_angular",
"//tools/testing:node_no_angular_es5",
],
)

View File

@ -18,9 +18,9 @@ ts_library(
jasmine_node_test(
name = "test",
bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"],
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"],
deps = [
":test_lib",
"//tools/testing:node_no_angular",
"//tools/testing:node_no_angular_es5",
],
)

View File

@ -22,9 +22,9 @@ ts_library(
jasmine_node_test(
name = "test",
bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"],
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"],
deps = [
":test_lib",
"//tools/testing:node_no_angular",
"//tools/testing:node_no_angular_es5",
],
)

View File

@ -23,9 +23,9 @@ ts_library(
jasmine_node_test(
name = "test",
bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"],
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"],
deps = [
":test_lib",
"//tools/testing:node_no_angular",
"//tools/testing:node_no_angular_es5",
],
)

View File

@ -24,9 +24,9 @@ ts_library(
jasmine_node_test(
name = "test",
bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"],
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"],
deps = [
":test_lib",
"//tools/testing:node_no_angular",
"//tools/testing:node_no_angular_es5",
],
)

View File

@ -20,9 +20,9 @@ ts_library(
jasmine_node_test(
name = "test",
bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"],
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"],
deps = [
":test_lib",
"//tools/testing:node_no_angular",
"//tools/testing:node_no_angular_es5",
],
)

View File

@ -24,9 +24,9 @@ ts_library(
jasmine_node_test(
name = "test",
bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"],
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"],
deps = [
":test_lib",
"//tools/testing:node_no_angular",
"//tools/testing:node_no_angular_es5",
],
)

View File

@ -17,9 +17,9 @@ ts_library(
jasmine_node_test(
name = "test",
bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"],
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"],
deps = [
":test_lib",
"//tools/testing:node_no_angular",
"//tools/testing:node_no_angular_es5",
],
)

View File

@ -24,9 +24,9 @@ ts_library(
jasmine_node_test(
name = "test",
bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"],
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"],
deps = [
":test_lib",
"//tools/testing:node_no_angular",
"//tools/testing:node_no_angular_es5",
],
)

View File

@ -20,9 +20,9 @@ ts_library(
jasmine_node_test(
name = "test",
bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"],
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"],
deps = [
":test_lib",
"//tools/testing:node_no_angular",
"//tools/testing:node_no_angular_es5",
],
)

View File

@ -40,7 +40,6 @@ ts_library(
jasmine_node_test(
name = "extract_i18n",
bootstrap = ["angular/tools/testing/init_node_spec.js"],
data = [
"//packages/core:npm_package",
],
@ -49,11 +48,13 @@ jasmine_node_test(
# tool will likely work differently.
"no-ivy-aot",
],
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"],
deps = [
":extract_i18n_lib",
"//packages/common:npm_package",
"//packages/core",
"//tools/testing:node",
"//tools/testing:node_es5",
"@npm//minimist",
],
)
@ -76,7 +77,6 @@ ts_library(
jasmine_node_test(
name = "ngc",
timeout = "long", # 900 seconds
bootstrap = ["angular/tools/testing/init_node_spec.js"],
data = [
"//packages/common:npm_package",
"//packages/core:npm_package",
@ -88,10 +88,12 @@ jasmine_node_test(
# own tests under //packages/compiler-cli/test/ngtsc.
"no-ivy-aot",
],
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"],
deps = [
":ngc_lib",
"//packages/core",
"//tools/testing:node",
"//tools/testing:node_es5",
"@npm//minimist",
"@npm//rxjs",
"@npm//tsickle",
@ -116,14 +118,15 @@ ts_library(
jasmine_node_test(
name = "perform_watch",
bootstrap = ["angular/tools/testing/init_node_spec.js"],
data = [
"//packages/core:npm_package",
],
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"],
deps = [
":perform_watch_lib",
"//packages/core",
"//tools/testing:node",
"//tools/testing:node_es5",
],
)
@ -143,13 +146,14 @@ ts_library(
jasmine_node_test(
name = "perform_compile",
bootstrap = ["angular/tools/testing/init_node_spec.js"],
data = [
"//packages/core:npm_package",
],
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"],
deps = [
":perform_compile_lib",
"//packages/core",
"//tools/testing:node",
"//tools/testing:node_es5",
],
)

View File

@ -18,7 +18,6 @@ ts_library(
jasmine_node_test(
name = "compliance",
bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"],
data = [
"//packages/compiler-cli/test/ngtsc/fake_core:npm_package",
],
@ -26,8 +25,9 @@ jasmine_node_test(
tags = [
"ivy-only",
],
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"],
deps = [
":test_lib",
"//tools/testing:node_no_angular",
"//tools/testing:node_no_angular_es5",
],
)

View File

@ -15,7 +15,6 @@ ts_library(
jasmine_node_test(
name = "check_types",
timeout = "long", # 900 seconds
bootstrap = ["angular/tools/testing/init_node_spec.js"],
data = [
"//packages/common:npm_package",
"//packages/core:npm_package",
@ -25,10 +24,12 @@ jasmine_node_test(
# compiler has its own typechecking implementation and tests.
"no-ivy-aot",
],
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"],
deps = [
":check_types_lib",
"//packages/core",
"//tools/testing:node",
"//tools/testing:node_es5",
],
)
@ -45,11 +46,10 @@ ts_library(
jasmine_node_test(
name = "typescript_version",
bootstrap = ["angular/tools/testing/init_node_spec.js"],
data = [
],
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"],
deps = [
":typescript_version_lib",
"//tools/testing:node",
"//tools/testing:node_es5",
],
)

View File

@ -16,12 +16,13 @@ ts_library(
jasmine_node_test(
name = "test",
bootstrap = ["angular/tools/testing/init_node_spec.js"],
data = [
],
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"],
deps = [
":test_lib",
"//packages/core",
"//tools/testing:node",
"//tools/testing:node_es5",
],
)

View File

@ -23,14 +23,14 @@ ts_library(
jasmine_node_test(
name = "ngtsc",
timeout = "long",
bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"],
data = [
"//packages/compiler-cli/test/ngtsc/fake_core:npm_package",
],
shard_count = 4,
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_no_angular_es5))"],
deps = [
":ngtsc_lib",
"//tools/testing:node_no_angular",
"//tools/testing:node_no_angular_es5",
"@npm//minimist",
],
)

View File

@ -19,7 +19,6 @@ ts_library(
jasmine_node_test(
name = "test",
timeout = "long", # 900 seconds
bootstrap = ["angular/tools/testing/init_node_spec.js"],
data = [
"//packages/common:npm_package",
"//packages/core:npm_package",
@ -30,10 +29,12 @@ jasmine_node_test(
# of these transformer utilities.
"no-ivy-aot",
],
templated_args = ["--node_options=--require=$(rlocation $(location //tools/testing:node_es5))"],
deps = [
":test_lib",
"//packages/core",
"//tools/testing:node",
"//tools/testing:node_es5",
"@npm//source-map",
],
)