Skip to content

Commit

Permalink
Revert "build: upgrade angular build, integration/bazel and @angular/…
Browse files Browse the repository at this point in the history
…bazel package to rule_nodejs 2.2.0 (#37727)" (#39097)

This reverts commit db56cf1.

PR Close #39097
  • Loading branch information
josephperrott committed Oct 2, 2020
1 parent db56cf1 commit c214cad
Show file tree
Hide file tree
Showing 63 changed files with 536 additions and 833 deletions.
4 changes: 2 additions & 2 deletions .bazelrc
Expand Up @@ -74,8 +74,8 @@ test --test_output=errors
# Trick bazel into treating BUILD files under integration/bazel as being regular files
# This lets us glob() up all the files inside this integration test to make them inputs to tests
# (Note, we cannot use common --deleted_packages because the bazel version command doesn't support it)
build --deleted_packages=integration/bazel,integration/bazel/src,integration/bazel/src/hello-world,integration/bazel/test,integration/bazel/tools,integration/bazel/test/e2e
query --deleted_packages=integration/bazel,integration/bazel/src,integration/bazel/src/hello-world,integration/bazel/test,integration/bazel/tools,integration/bazel/test/e2e
build --deleted_packages=integration/bazel,integration/bazel/src,integration/bazel/src/hello-world,integration/bazel/test,integration/bazel/test/e2e
query --deleted_packages=integration/bazel,integration/bazel/src,integration/bazel/src/hello-world,integration/bazel/test,integration/bazel/test/e2e

################################
# Temporary Settings for Ivy #
Expand Down
13 changes: 3 additions & 10 deletions .circleci/config.yml
Expand Up @@ -862,16 +862,9 @@ workflows:
- build-npm-packages
- build-ivy-npm-packages
- legacy-unit-tests-saucelabs
# Temporarily disabled components-repo-unit-tests to update rules_nodejs to 2.0.0. Breaking changes in
# rules_nodejs create a dependency sandwich between angular/angular & angular/components that are very
# difficult and time consuming to resolve and involve patching @angular/bazel in components repo such
# as https://github.com/angular/components/commit/9e7ba251207df77164d73d66620e619bcbc4d2ad. It is simpler to
# 1) land angular/angular upgrade to rule_nodejs 2.0.0 which has breaking changes
# 2) land angular/components upgrade to rules_nodejs 2.0.0 using the @angular/bazel builds snapshot
# 3) update angular/angular to the landed components commit and re-enable these tests
# - components-repo-unit-tests:
# requires:
# - build-npm-packages
- components-repo-unit-tests:
requires:
- build-npm-packages
- test_zonejs:
requires:
- setup
Expand Down
6 changes: 0 additions & 6 deletions BUILD.bazel
Expand Up @@ -47,9 +47,3 @@ filegroup(
"@npm//:node_modules/angular-mocks-1.6/angular-mocks.js",
],
)

# Detect if the build is running under --stamp
config_setting(
name = "stamp",
values = {"stamp": "true"},
)
20 changes: 15 additions & 5 deletions WORKSPACE
Expand Up @@ -8,16 +8,16 @@ 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 = "4952ef879704ab4ad6729a29007e7094aef213ea79e9f2e94cbe1c9a753e63ef",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/2.2.0/rules_nodejs-2.2.0.tar.gz"],
sha256 = "84abf7ac4234a70924628baa9a73a5a5cbad944c4358cf9abdb4aab29c9a5b77",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/1.7.0/rules_nodejs-1.7.0.tar.gz"],
)

# Check the rules_nodejs version and download npm dependencies
# Note: bazel (version 2 and after) will check the .bazelversion file so we don't need to
# assert on that.
load("@build_bazel_rules_nodejs//:index.bzl", "check_rules_nodejs_version", "node_repositories", "yarn_install")

check_rules_nodejs_version(minimum_version_string = "2.2.0")
check_rules_nodejs_version(minimum_version_string = "1.7.0")

# Setup the Node.js toolchain
node_repositories(
Expand All @@ -39,18 +39,23 @@ yarn_install(
yarn_lock = "//:yarn.lock",
)

# Install all bazel dependencies of the @npm npm packages
load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies")

install_bazel_dependencies()

# Load angular dependencies
load("//packages/bazel:package.bzl", "rules_angular_dev_dependencies")

rules_angular_dev_dependencies()

# Load protractor dependencies
load("@npm//@bazel/protractor:package.bzl", "npm_bazel_protractor_dependencies")
load("@npm_bazel_protractor//:package.bzl", "npm_bazel_protractor_dependencies")

npm_bazel_protractor_dependencies()

# Load karma dependencies
load("@npm//@bazel/karma:package.bzl", "npm_bazel_karma_dependencies")
load("@npm_bazel_karma//:package.bzl", "npm_bazel_karma_dependencies")

npm_bazel_karma_dependencies()

Expand All @@ -63,6 +68,11 @@ load("//dev-infra/browsers:browser_repositories.bzl", "browser_repositories")

browser_repositories()

# Setup the rules_typescript tooolchain
load("@npm_bazel_typescript//:index.bzl", "ts_setup_workspace")

ts_setup_workspace()

# Setup the rules_sass toolchain
load("@io_bazel_rules_sass//sass:sass_repositories.bzl", "sass_repositories")

Expand Down
6 changes: 3 additions & 3 deletions dev-infra/BUILD.bazel
@@ -1,5 +1,5 @@
load("@build_bazel_rules_nodejs//:index.bzl", "pkg_npm")
load("@npm//@bazel/typescript:index.bzl", "ts_library")
load("@npm_bazel_typescript//:index.bzl", "ts_library")

ts_library(
name = "cli",
Expand Down Expand Up @@ -49,15 +49,15 @@ pkg_npm(
# substitutions to replace these in the published version of dev-infra.
"//dev-infra/": "@npm_angular_dev_infra_private//",
"//packages/benchpress": "@npm//@angular/benchpress",
"//packages/bazel": "@npm//@angular/bazel",
"//packages/bazel/": "@npm_angular_bazel//",
"//packages/zone.js/bundles:zone.umd.js": "@npm//:node_modules/zone.js/dist/zone.js",
"//packages/core": "@npm//@angular/core",
"//packages/platform-browser": "@npm//@angular/platform-browser",

# This substitution is particularly verbose because we need to make sure
# that only things available via Angular Bazel are imported from
# tools/defaults.bzl.
"load\(\"//tools:defaults.bzl\", \"ng_module\"\)": "load(\"@npm//@angular/bazel:index.bzl\", \"ng_module\")",
"load\(\"//tools:defaults.bzl\", \"ng_module\"\)": "load(\"@npm_angular_bazel//:index.bzl\", \"ng_module\")",
},
visibility = ["//visibility:public"],
deps = [
Expand Down
2 changes: 1 addition & 1 deletion dev-infra/benchmark/component_benchmark/benchmark_test.bzl
@@ -1,4 +1,4 @@
load("@npm//@bazel/protractor:index.bzl", "protractor_web_test_suite")
load("@npm_bazel_protractor//:index.bzl", "protractor_web_test_suite")

"""
Macro that can be used to define a benchmark test. This differentiates from
Expand Down
@@ -1,6 +1,6 @@
load("//dev-infra/benchmark/ng_rollup_bundle:ng_rollup_bundle.bzl", "ng_rollup_bundle")
load("//tools:defaults.bzl", "ng_module")
load("@npm//@bazel/typescript:index.bzl", "ts_devserver", "ts_library")
load("@npm_bazel_typescript//:index.bzl", "ts_devserver", "ts_library")
load(":benchmark_test.bzl", "benchmark_test")

def copy_default_file(origin, destination):
Expand Down
2 changes: 1 addition & 1 deletion dev-infra/benchmark/driver-utilities/BUILD.bazel
@@ -1,6 +1,6 @@
package(default_visibility = ["//visibility:public"])

load("@npm//@bazel/typescript:index.bzl", "ts_library")
load("@npm_bazel_typescript//:index.bzl", "ts_library")

ts_library(
name = "driver-utilities",
Expand Down
4 changes: 2 additions & 2 deletions dev-infra/benchmark/ng_rollup_bundle/ng_rollup_bundle.bzl
Expand Up @@ -4,8 +4,8 @@
# found in the LICENSE file at https://angular.io/license

load("@build_bazel_rules_nodejs//:index.bzl", "npm_package_bin")
load("@npm//@bazel/terser:index.bzl", "terser_minified")
load("@npm//@bazel/rollup:index.bzl", "rollup_bundle")
load("@npm_bazel_terser//:index.bzl", "terser_minified")
load("@npm_bazel_rollup//:index.bzl", "rollup_bundle")
load("//dev-infra/bazel:expand_template.bzl", "expand_template")

def ng_rollup_bundle(
Expand Down
2 changes: 1 addition & 1 deletion dev-infra/caretaker/BUILD.bazel
@@ -1,4 +1,4 @@
load("@npm//@bazel/typescript:index.bzl", "ts_library")
load("@npm_bazel_typescript//:index.bzl", "ts_library")

ts_library(
name = "caretaker",
Expand Down
2 changes: 1 addition & 1 deletion dev-infra/commit-message/BUILD.bazel
@@ -1,5 +1,5 @@
load("//tools:defaults.bzl", "jasmine_node_test")
load("@npm//@bazel/typescript:index.bzl", "ts_library")
load("@npm_bazel_typescript//:index.bzl", "ts_library")

ts_library(
name = "commit-message",
Expand Down
2 changes: 1 addition & 1 deletion dev-infra/format/BUILD.bazel
@@ -1,4 +1,4 @@
load("@npm//@bazel/typescript:index.bzl", "ts_library")
load("@npm_bazel_typescript//:index.bzl", "ts_library")

ts_library(
name = "format",
Expand Down
2 changes: 1 addition & 1 deletion dev-infra/ngbot/BUILD.bazel
@@ -1,4 +1,4 @@
load("@npm//@bazel/typescript:index.bzl", "ts_library")
load("@npm_bazel_typescript//:index.bzl", "ts_library")

ts_library(
name = "ngbot",
Expand Down
2 changes: 1 addition & 1 deletion dev-infra/pr/BUILD.bazel
@@ -1,4 +1,4 @@
load("@npm//@bazel/typescript:index.bzl", "ts_library")
load("@npm_bazel_typescript//:index.bzl", "ts_library")

ts_library(
name = "pr",
Expand Down
2 changes: 1 addition & 1 deletion dev-infra/pr/checkout/BUILD.bazel
@@ -1,4 +1,4 @@
load("@npm//@bazel/typescript:index.bzl", "ts_library")
load("@npm_bazel_typescript//:index.bzl", "ts_library")

ts_library(
name = "checkout",
Expand Down
2 changes: 1 addition & 1 deletion dev-infra/pr/common/BUILD.bazel
@@ -1,4 +1,4 @@
load("@npm//@bazel/typescript:index.bzl", "ts_library")
load("@npm_bazel_typescript//:index.bzl", "ts_library")

ts_library(
name = "common",
Expand Down
2 changes: 1 addition & 1 deletion dev-infra/pr/discover-new-conflicts/BUILD.bazel
@@ -1,4 +1,4 @@
load("@npm//@bazel/typescript:index.bzl", "ts_library")
load("@npm_bazel_typescript//:index.bzl", "ts_library")

ts_library(
name = "discover-new-conflicts",
Expand Down
2 changes: 1 addition & 1 deletion dev-infra/pr/merge/BUILD.bazel
@@ -1,4 +1,4 @@
load("@npm//@bazel/typescript:index.bzl", "ts_library")
load("@npm_bazel_typescript//:index.bzl", "ts_library")
load("//tools:defaults.bzl", "jasmine_node_test")

ts_library(
Expand Down
2 changes: 1 addition & 1 deletion dev-infra/pr/rebase/BUILD.bazel
@@ -1,4 +1,4 @@
load("@npm//@bazel/typescript:index.bzl", "ts_library")
load("@npm_bazel_typescript//:index.bzl", "ts_library")

ts_library(
name = "rebase",
Expand Down
2 changes: 1 addition & 1 deletion dev-infra/pullapprove/BUILD.bazel
@@ -1,4 +1,4 @@
load("@npm//@bazel/typescript:index.bzl", "ts_library")
load("@npm_bazel_typescript//:index.bzl", "ts_library")
load("//tools:defaults.bzl", "jasmine_node_test")

ts_library(
Expand Down
2 changes: 1 addition & 1 deletion dev-infra/release/BUILD.bazel
@@ -1,4 +1,4 @@
load("@npm//@bazel/typescript:index.bzl", "ts_library")
load("@npm_bazel_typescript//:index.bzl", "ts_library")

ts_library(
name = "release",
Expand Down
2 changes: 1 addition & 1 deletion dev-infra/release/build/BUILD.bazel
@@ -1,4 +1,4 @@
load("@npm//@bazel/typescript:index.bzl", "ts_library")
load("@npm_bazel_typescript//:index.bzl", "ts_library")
load("//tools:defaults.bzl", "jasmine_node_test")

ts_library(
Expand Down
2 changes: 1 addition & 1 deletion dev-infra/release/config/BUILD.bazel
@@ -1,4 +1,4 @@
load("@npm//@bazel/typescript:index.bzl", "ts_library")
load("@npm_bazel_typescript//:index.bzl", "ts_library")

ts_library(
name = "config",
Expand Down
2 changes: 1 addition & 1 deletion dev-infra/release/publish/BUILD.bazel
@@ -1,4 +1,4 @@
load("@npm//@bazel/typescript:index.bzl", "ts_library")
load("@npm_bazel_typescript//:index.bzl", "ts_library")

ts_library(
name = "publish",
Expand Down
2 changes: 1 addition & 1 deletion dev-infra/release/publish/test/BUILD.bazel
@@ -1,4 +1,4 @@
load("@npm//@bazel/typescript:index.bzl", "ts_library")
load("@npm_bazel_typescript//:index.bzl", "ts_library")
load("//tools:defaults.bzl", "jasmine_node_test")

ts_library(
Expand Down
2 changes: 1 addition & 1 deletion dev-infra/release/set-dist-tag/BUILD.bazel
@@ -1,4 +1,4 @@
load("@npm//@bazel/typescript:index.bzl", "ts_library")
load("@npm_bazel_typescript//:index.bzl", "ts_library")
load("//tools:defaults.bzl", "jasmine_node_test")

ts_library(
Expand Down
2 changes: 1 addition & 1 deletion dev-infra/release/versioning/BUILD.bazel
@@ -1,4 +1,4 @@
load("@npm//@bazel/typescript:index.bzl", "ts_library")
load("@npm_bazel_typescript//:index.bzl", "ts_library")

ts_library(
name = "versioning",
Expand Down
2 changes: 1 addition & 1 deletion dev-infra/ts-circular-dependencies/BUILD.bazel
@@ -1,4 +1,4 @@
load("@npm//@bazel/typescript:index.bzl", "ts_library")
load("@npm_bazel_typescript//:index.bzl", "ts_library")

ts_library(
name = "ts-circular-dependencies",
Expand Down
2 changes: 1 addition & 1 deletion dev-infra/utils/BUILD.bazel
@@ -1,4 +1,4 @@
load("@npm//@bazel/typescript:index.bzl", "ts_library")
load("@npm_bazel_typescript//:index.bzl", "ts_library")

ts_library(
name = "utils",
Expand Down
2 changes: 1 addition & 1 deletion dev-infra/utils/testing/BUILD.bazel
@@ -1,4 +1,4 @@
load("@npm//@bazel/typescript:index.bzl", "ts_library")
load("@npm_bazel_typescript//:index.bzl", "ts_library")

ts_library(
name = "testing",
Expand Down
1 change: 0 additions & 1 deletion integration/bazel/.bazelignore
@@ -1,2 +1 @@
node_modules
.yarn_local_cache
18 changes: 14 additions & 4 deletions integration/bazel/WORKSPACE
Expand Up @@ -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 = "4952ef879704ab4ad6729a29007e7094aef213ea79e9f2e94cbe1c9a753e63ef",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/2.2.0/rules_nodejs-2.2.0.tar.gz"],
sha256 = "84abf7ac4234a70924628baa9a73a5a5cbad944c4358cf9abdb4aab29c9a5b77",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/1.7.0/rules_nodejs-1.7.0.tar.gz"],
)

# Fetch sass rules for compiling sass files
Expand Down Expand Up @@ -48,13 +48,18 @@ yarn_install(
yarn_lock = "//:yarn.lock",
)

# Install all bazel dependencies of our npm packages
load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies")

install_bazel_dependencies()

# Load protractor dependencies
load("@npm//@bazel/protractor:package.bzl", "npm_bazel_protractor_dependencies")
load("@npm_bazel_protractor//:package.bzl", "npm_bazel_protractor_dependencies")

npm_bazel_protractor_dependencies()

# Load karma dependencies
load("@npm//@bazel/karma:package.bzl", "npm_bazel_karma_dependencies")
load("@npm_bazel_karma//:package.bzl", "npm_bazel_karma_dependencies")

npm_bazel_karma_dependencies()

Expand All @@ -70,6 +75,11 @@ browser_repositories(
firefox = True,
)

# Setup the rules_typescript tooolchain
load("@npm_bazel_typescript//:index.bzl", "ts_setup_workspace")

ts_setup_workspace()

# Setup the rules_sass toolchain
load("@io_bazel_rules_sass//sass:sass_repositories.bzl", "sass_repositories")

Expand Down
14 changes: 7 additions & 7 deletions integration/bazel/package.json
Expand Up @@ -16,18 +16,18 @@
"reflect-metadata": "0.1.12",
"rxjs": "file:../../node_modules/rxjs",
"tslib": "file:../../node_modules/tslib",
"zone.js": "file:../../dist/zone.js-dist/zone.js"
"zone.js": "file:../../dist/zone.js-dist"
},
"devDependencies": {
"@angular/bazel": "file:../../dist/packages-dist/bazel",
"@angular/compiler": "file:../../dist/packages-dist/compiler",
"@angular/compiler-cli": "file:../../dist/packages-dist/compiler-cli",
"@bazel/bazelisk": "file:../../node_modules/@bazel/bazelisk",
"@bazel/karma": "2.2.0",
"@bazel/protractor": "2.2.0",
"@bazel/rollup": "2.2.0",
"@bazel/terser": "2.2.0",
"@bazel/typescript": "2.2.0",
"@bazel/karma": "1.7.0",
"@bazel/protractor": "1.7.0",
"@bazel/rollup": "1.7.0",
"@bazel/terser": "1.7.0",
"@bazel/typescript": "1.7.0",
"@types/jasmine": "2.8.8",
"http-server": "0.12.0",
"karma": "4.4.1",
Expand All @@ -43,7 +43,7 @@
"rollup-plugin-node-resolve": "5.2.0",
"rollup-plugin-sourcemaps": "0.4.2",
"terser": "4.4.0",
"typescript": "file:../../node_modules/typescript"
"typescript": "3.8.3"
},
"scripts": {
"test": "bazelisk build ... --noshow_progress && bazelisk test ...",
Expand Down
8 changes: 4 additions & 4 deletions integration/bazel/src/BUILD.bazel
Expand Up @@ -2,10 +2,10 @@ package(default_visibility = ["//visibility:public"])

load("@build_bazel_rules_nodejs//:index.bzl", "pkg_web")
load("@npm//http-server:index.bzl", "http_server")
load("@npm//@angular/bazel:index.bzl", "ng_module")
load("@npm//@bazel/rollup:index.bzl", "rollup_bundle")
load("@npm//@bazel/terser:index.bzl", "terser_minified")
load("@npm//@bazel/typescript:index.bzl", "ts_devserver")
load("@npm_angular_bazel//:index.bzl", "ng_module")
load("@npm_bazel_rollup//:index.bzl", "rollup_bundle")
load("@npm_bazel_terser//:index.bzl", "terser_minified")
load("@npm_bazel_typescript//:index.bzl", "ts_devserver")

# Allow targets under sub-packages to reference the tsconfig.json file
exports_files(["tsconfig.json"])
Expand Down

0 comments on commit c214cad

Please sign in to comment.