diff --git a/.circleci/config.yml b/.circleci/config.yml index a0bc02bf0ed8..9bcb7b69abcf 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -262,7 +262,9 @@ jobs: - run: sudo cp .circleci/bazel.rc /etc/bazel.bazelrc - run: command: yarn bazel:test - no_output_timeout: 20m + # This timeout provides time for the actual tests to timeout and report status + # instead of CircleCI stopping the job without test failure information. + no_output_timeout: 40m - fail_fast snapshot_publish: diff --git a/WORKSPACE b/WORKSPACE index e9f7bb6b82df..edb922bece11 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -14,12 +14,22 @@ http_archive( ], ) +http_archive( + name = "io_bazel_rules_webtesting", + sha256 = "e9abb7658b6a129740c0b3ef6f5a2370864e102a5ba5ffca2cea565829ed825a", + urls = ["https://github.com/bazelbuild/rules_webtesting/releases/download/0.3.5/rules_webtesting.tar.gz"], +) + http_archive( name = "build_bazel_rules_nodejs", - sha256 = "d63ecec7192394f5cc4ad95a115f8a6c9de55c60d56c1f08da79c306355e4654", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/4.6.1/rules_nodejs-4.6.1.tar.gz"], + sha256 = "3ceb1e5b5dcad5fa2ad8870a20201cfbb9c9c63cac4055c9ab370034c765297f", + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.3.0/rules_nodejs-5.3.0.tar.gz"], ) +load("@build_bazel_rules_nodejs//:repositories.bzl", "build_bazel_rules_nodejs_dependencies") + +build_bazel_rules_nodejs_dependencies() + http_archive( name = "rules_pkg", sha256 = "62eeb544ff1ef41d786e329e1536c1d541bb9bcad27ae984d57f18f314018e66", @@ -38,33 +48,25 @@ load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies") rules_pkg_dependencies() -# Check the bazel version and download npm dependencies -load("@build_bazel_rules_nodejs//:index.bzl", "check_bazel_version", "check_rules_nodejs_version", "node_repositories", "yarn_install") - -# Bazel version must be at least the following version because: -# - 0.26.0 managed_directories feature added which is required for nodejs rules 0.30.0 -# - 0.27.0 has a fix for managed_directories after `rm -rf node_modules` -check_bazel_version( - message = """ -You no longer need to install Bazel on your machine. -Angular has a dependency on the @bazel/bazelisk package which supplies it. -Try running `yarn bazel` instead. - (If you did run that, check that you've got a fresh `yarn install`) -""", - minimum_bazel_version = "4.0.0", -) - -check_rules_nodejs_version(minimum_version_string = "2.0.0") - # Setup the Node.js toolchain -node_repositories( +load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains") + +nodejs_register_toolchains( + name = "nodejs", node_version = "14.17.1", - package_json = ["//:package.json"], ) +load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install") + yarn_install( name = "npm", + data = [ + "//:.yarn/releases/yarn-1.22.17.cjs", + "//:.yarnrc", + ], + exports_directories_only = False, package_json = "//:package.json", + yarn = "//:.yarn/releases/yarn-1.22.17.cjs", yarn_lock = "//:yarn.lock", ) diff --git a/package.json b/package.json index 3efc5fa3ec8c..4e99a58d7fc5 100644 --- a/package.json +++ b/package.json @@ -88,9 +88,9 @@ "@babel/runtime": "7.17.8", "@babel/template": "7.16.7", "@bazel/bazelisk": "1.11.0", - "@bazel/buildifier": "4.2.5", - "@bazel/jasmine": "4.6.1", - "@bazel/typescript": "4.6.1", + "@bazel/buildifier": "5.0.1", + "@bazel/concatjs": "5.3.0", + "@bazel/jasmine": "5.3.0", "@discoveryjs/json-ext": "0.5.7", "@types/babel__core": "7.1.19", "@types/babel__template": "7.4.1", diff --git a/tests/angular_devkit/core/node/jobs/BUILD.bazel b/tests/angular_devkit/core/node/jobs/BUILD.bazel index c0d1cba3fe47..3614dd5b09f1 100644 --- a/tests/angular_devkit/core/node/jobs/BUILD.bazel +++ b/tests/angular_devkit/core/node/jobs/BUILD.bazel @@ -1,4 +1,4 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_library") +load("//tools:defaults.bzl", "ts_library") # Copyright Google Inc. All Rights Reserved. # @@ -15,8 +15,6 @@ ts_library( "**/*.ts", ], ), - devmode_module = "commonjs", - devmode_target = "es2018", deps = [ "//packages/angular_devkit/core", "@npm//@types/node", diff --git a/tests/angular_devkit/schematics/tools/file-system-engine-host/BUILD.bazel b/tests/angular_devkit/schematics/tools/file-system-engine-host/BUILD.bazel index 4303f26c5887..38d1670e2448 100644 --- a/tests/angular_devkit/schematics/tools/file-system-engine-host/BUILD.bazel +++ b/tests/angular_devkit/schematics/tools/file-system-engine-host/BUILD.bazel @@ -1,4 +1,4 @@ -load("@npm//@bazel/typescript:index.bzl", "ts_library") +load("//tools:defaults.bzl", "ts_library") # Copyright Google Inc. All Rights Reserved. # @@ -21,8 +21,6 @@ ts_library( "**/*.js", ], ), - devmode_module = "commonjs", - devmode_target = "es2018", deps = [ "//packages/angular_devkit/schematics", # ":testing", diff --git a/tools/defaults.bzl b/tools/defaults.bzl index 6651baca0d31..edee9bc5c1e1 100644 --- a/tools/defaults.bzl +++ b/tools/defaults.bzl @@ -1,6 +1,6 @@ """Re-export of some bazel rules with repository-wide defaults.""" -load("@npm//@bazel/typescript:index.bzl", _ts_library = "ts_library") +load("@npm//@bazel/concatjs/internal:build_defs.bzl", _ts_library = "ts_library_macro") load("@build_bazel_rules_nodejs//:index.bzl", "copy_to_bin", _pkg_npm = "pkg_npm") load("@rules_pkg//:pkg.bzl", "pkg_tar") load("@npm//@angular/dev-infra-private/bazel:extract_js_module_output.bzl", "extract_js_module_output") diff --git a/yarn.lock b/yarn.lock index 7139f59093ec..64e23c5e96df 100644 --- a/yarn.lock +++ b/yarn.lock @@ -178,7 +178,6 @@ "@angular/dev-infra-private@https://github.com/angular/dev-infra-private-builds.git#5e484f9c4ab6b47f84263d115d6cf9e13ce4f32a": version "0.0.0-104c49ad795097101ab3aa268a8e9af2cdf04a8d" - uid "5e484f9c4ab6b47f84263d115d6cf9e13ce4f32a" resolved "https://github.com/angular/dev-infra-private-builds.git#5e484f9c4ab6b47f84263d115d6cf9e13ce4f32a" dependencies: "@angular-devkit/build-angular" "14.0.0-next.3" @@ -1221,12 +1220,7 @@ resolved "https://registry.yarnpkg.com/@bazel/bazelisk/-/bazelisk-1.11.0.tgz#f98d8438b4c14e3328126618b96775d271caa5f8" integrity sha512-lxiQzVqSGDG0PIDQGJdVDjp7T+50p5NnM4EnRJa76mkZp6u5ul19GJNKhPKi81TZQALZEZDxAgxVqQKkWTUOxA== -"@bazel/buildifier@4.2.5": - version "4.2.5" - resolved "https://registry.yarnpkg.com/@bazel/buildifier/-/buildifier-4.2.5.tgz#de51339613e2ca1f39dda6ade8b0062e6575b3e1" - integrity sha512-lTg3YEuCO1e7dCc/fLUWu5R7KOHmpPDSkoSeT+rPrszFfxqrWGJTSxZbtk/4AJZnuC3p704po8RUJinPtmxTmQ== - -"@bazel/buildifier@^5.0.1": +"@bazel/buildifier@5.0.1", "@bazel/buildifier@^5.0.1": version "5.0.1" resolved "https://registry.yarnpkg.com/@bazel/buildifier/-/buildifier-5.0.1.tgz#8946848cf2c28717ec8fb4ff46e424aeba82be74" integrity sha512-3eMWxdFtcQf+Jw55PZqD/I9N785wp6QQ2k/SZst7R64KAGrS8Ke1EhPXaZHZBkXao5GXrm6SNLDV287xg2kguA== @@ -1240,15 +1234,24 @@ source-map-support "0.5.9" tsutils "3.21.0" +"@bazel/concatjs@5.3.0": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@bazel/concatjs/-/concatjs-5.3.0.tgz#40abb0690d4109ece1e67a514fba8cd54fced691" + integrity sha512-mLxGpz7JsRIXb1TTi8p56/1IM7FqcN2deUchuXIiSmIUq+85vYcV3UMnR6HZeJh5PGBCwxDNeqkZ/hUAVojaSw== + dependencies: + protobufjs "6.8.8" + source-map-support "0.5.9" + tsutils "3.21.0" + "@bazel/esbuild@4.6.0": version "4.6.0" resolved "https://registry.yarnpkg.com/@bazel/esbuild/-/esbuild-4.6.0.tgz#68bf9506c104ed4076a0227c4066e3f5df847ee3" integrity sha512-pu4wSBNokYKLisHlXdHxu3UX19vFL4wNQJ45cyekfiWF2szWjWR8x/ZP15a49ChmvP6aelwrURahuhhgzfluOQ== -"@bazel/jasmine@4.6.1": - version "4.6.1" - resolved "https://registry.yarnpkg.com/@bazel/jasmine/-/jasmine-4.6.1.tgz#f1b618d8190fe30db03e6613255704c92c90c8b7" - integrity sha512-SkzBYh4f4BALB6du3/g0Z3lu3N9jcH3kVQHxqwmKkBHCp9Nny0xzhhEje/o5ncSNt+SMwIPwBrTGMPQnUUfmfg== +"@bazel/jasmine@5.3.0": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@bazel/jasmine/-/jasmine-5.3.0.tgz#2fc450deebb4f886a6f46cdce2fa0b5826e49fd0" + integrity sha512-USGQ9sdEOmeCbOJt5mNu2eGd12F/fIEG+tuhw5CXWZ7aYBFLCub2LlQ2vAcXSFWbtZjNwjTvCcGi35cqUyzAcw== dependencies: c8 "~7.5.0" jasmine-reporters "~2.5.0" @@ -1279,17 +1282,6 @@ source-map-support "0.5.9" tsutils "3.21.0" -"@bazel/typescript@4.6.1": - version "4.6.1" - resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-4.6.1.tgz#5c674698bda53006d784cb40ba1e2cb1263ecc20" - integrity sha512-T/2mOB9lSySaIQH47JsbKE8UG7eEChFltXCVNw2xk1+Eu7ym+osSIjaXoQVBPmAl/6qmIEzTyBIjFPEU2ohVrw== - dependencies: - "@bazel/worker" "4.6.1" - protobufjs "6.8.8" - semver "5.6.0" - source-map-support "0.5.9" - tsutils "3.21.0" - "@bazel/worker@4.6.0": version "4.6.0" resolved "https://registry.yarnpkg.com/@bazel/worker/-/worker-4.6.0.tgz#0a4332be547fcd94fa5da1dfa200a28a6bf5fc5b" @@ -1297,13 +1289,6 @@ dependencies: google-protobuf "^3.6.1" -"@bazel/worker@4.6.1": - version "4.6.1" - resolved "https://registry.yarnpkg.com/@bazel/worker/-/worker-4.6.1.tgz#96925f5819344225d4fe40ffa630a3c5f4847a0b" - integrity sha512-D6TsHxGSljmlLoz8FXL1+ISh8XnDuRkBpT6Mz0wD62eWajUZASTfX9I4HNiLNbsWY4Omc7nKXI+j4R8/BLciFg== - dependencies: - google-protobuf "^3.6.1" - "@bcoe/v8-coverage@^0.2.3": version "0.2.3" resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" @@ -9313,7 +9298,6 @@ sass@1.49.9, sass@^1.49.9: "sauce-connect-proxy@https://saucelabs.com/downloads/sc-4.6.4-linux.tar.gz": version "0.0.0" - uid "992e2cb0d91e54b27a4f5bbd2049f3b774718115" resolved "https://saucelabs.com/downloads/sc-4.6.4-linux.tar.gz#992e2cb0d91e54b27a4f5bbd2049f3b774718115" saucelabs@^1.5.0: