diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5c5912c252d8..676c12d00981 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -109,7 +109,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest] - node: [18] + node: [18, 20] subset: [npm, yarn, esbuild] shard: [0, 1, 2, 3, 4, 5] exclude: @@ -142,7 +142,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - node: [18] + node: [18, 20] subset: [npm, yarn, esbuild] shard: [0, 1, 2, 3, 4, 5] runs-on: ${{ matrix.os }} diff --git a/WORKSPACE b/WORKSPACE index 3562c7ac73ed..8cc7420c1e3f 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -62,6 +62,21 @@ nodejs_register_toolchains( node_version = "18.13.0", ) +nodejs_register_toolchains( + name = "node20", + # The below can be removed once @rules_nodejs/nodejs is updated to latest which contains https://github.com/bazelbuild/rules_nodejs/pull/3701 + node_repositories = { + "20.9.0-darwin_arm64": ("node-v20.9.0-darwin-arm64.tar.gz", "node-v20.9.0-darwin-arm64", "31d2d46ae8d8a3982f54e2ff1e60c2e4a8e80bf78a3e8b46dcaac95ac5d7ce6a"), + "20.9.0-darwin_amd64": ("node-v20.9.0-darwin-x64.tar.gz", "node-v20.9.0-darwin-x64", "fc5b73f2a78c17bbe926cdb1447d652f9f094c79582f1be6471b4b38a2e1ccc8"), + "20.9.0-linux_arm64": ("node-v20.9.0-linux-arm64.tar.xz", "node-v20.9.0-linux-arm64", "ced3ecece4b7c3a664bca3d9e34a0e3b9a31078525283a6fdb7ea2de8ca5683b"), + "20.9.0-linux_ppc64le": ("node-v20.9.0-linux-ppc64le.tar.xz", "node-v20.9.0-linux-ppc64le", "3c6cea5d614cfbb95d92de43fbc2f8ecd66e431502fe5efc4f3c02637897bd45"), + "20.9.0-linux_s390x": ("node-v20.9.0-linux-s390x.tar.xz", "node-v20.9.0-linux-s390x", "af1f4e63756ff685d452166c4d5ba93a308e816ee7c46015b5e086163d9f011b"), + "20.9.0-linux_amd64": ("node-v20.9.0-linux-x64.tar.xz", "node-v20.9.0-linux-x64", "9033989810bf86220ae46b1381bdcdc6c83a0294869ba2ad39e1061f1e69217a"), + "20.9.0-windows_amd64": ("node-v20.9.0-win-x64.zip", "node-v20.9.0-win-x64", "70d87dad2378c63216ff83d5a754c61d2886fc39d32ce0d2ea6de763a22d3780"), + }, + node_version = "20.9.0", +) + load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install") yarn_install( diff --git a/constants.bzl b/constants.bzl index bdc915d3f658..39df98292c0e 100644 --- a/constants.bzl +++ b/constants.bzl @@ -1,5 +1,5 @@ # Engine versions to stamp in a release package.json -RELEASE_ENGINES_NODE = ">=18.13.0" +RELEASE_ENGINES_NODE = "^18.13.0 || >=20.9.0" RELEASE_ENGINES_NPM = "^6.11.0 || ^7.5.6 || >=8.0.0" RELEASE_ENGINES_YARN = ">= 1.13.0" diff --git a/package.json b/package.json index 0b62732e5d48..a5c6d3601f11 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "url": "https://github.com/angular/angular-cli.git" }, "engines": { - "node": "^18.13.0", + "node": "^18.13.0 || ^20.9.0", "yarn": ">=1.21.1 <2", "npm": "Please use yarn instead of NPM to install dependencies" }, diff --git a/tools/toolchain_info.bzl b/tools/toolchain_info.bzl index febfe353fe5c..2effef87efe3 100644 --- a/tools/toolchain_info.bzl +++ b/tools/toolchain_info.bzl @@ -4,6 +4,7 @@ # the order will match against the order in the TOOLCHAIN_VERSION list. TOOLCHAINS_NAMES = [ "node18", + "node20", ] # this is the list of toolchains that should be used and are registered with nodejs_register_toolchains in the WORKSPACE file @@ -13,6 +14,11 @@ TOOLCHAINS_VERSIONS = [ "@bazel_tools//src/conditions:darwin": "@node18_darwin_amd64//:node_toolchain", "@bazel_tools//src/conditions:windows": "@node18_windows_amd64//:node_toolchain", }), + select({ + "@bazel_tools//src/conditions:linux_x86_64": "@node20_linux_amd64//:node_toolchain", + "@bazel_tools//src/conditions:darwin": "@node20_darwin_amd64//:node_toolchain", + "@bazel_tools//src/conditions:windows": "@node20_windows_amd64//:node_toolchain", + }), ] # A default toolchain for use when only one is necessary