build: upgrade to node 14 (#41544)

Upgrade local development environment for the angular repo to use node 14
dropping node 10 from supported for development within the angular repo.

PR Close #41544
This commit is contained in:
Joey Perrott 2021-04-12 12:01:58 -07:00 committed by Zach Arend
parent 0bc539af29
commit ee615e0744
9 changed files with 15 additions and 17 deletions

View File

@ -22,15 +22,15 @@ version: 2.1
# **NOTE 1 **: If you change the cache key prefix, also sync the cache_key_fallback to match.
# **NOTE 2 **: Keep the static part of the cache key as prefix to enable correct fallbacks.
# See https://circleci.com/docs/2.0/caching/#restoring-cache for how prefixes work in CircleCI.
var_3: &cache_key v4-angular-node-12-{{ checksum ".bazelversion" }}-{{ checksum "yarn.lock" }}-{{ checksum "WORKSPACE" }}-{{ checksum "packages/bazel/package.bzl" }}-{{ checksum "aio/yarn.lock" }}
var_3: &cache_key v4-angular-node-14-{{ checksum ".bazelversion" }}-{{ checksum "yarn.lock" }}-{{ checksum "WORKSPACE" }}-{{ checksum "packages/bazel/package.bzl" }}-{{ checksum "aio/yarn.lock" }}
# We invalidate the cache if the Bazel version changes because otherwise the `bazelisk` cache
# folder will contain all previously used versions and ultimately cause the cache restoring to
# be slower due to its growing size.
var_4: &cache_key_fallback v4-angular-node-12-{{ checksum ".bazelversion" }}
var_4: &cache_key_fallback v4-angular-node-14-{{ checksum ".bazelversion" }}
# Windows needs its own cache key because binaries in node_modules are different.
var_3_win: &cache_key_win v4-angular-win-node-12-{{ checksum ".bazelversion" }}-{{ checksum "yarn.lock" }}-{{ checksum "WORKSPACE" }}-{{ checksum "packages/bazel/package.bzl" }}-{{ checksum "aio/yarn.lock" }}
var_4_win: &cache_key_win_fallback v4-angular-win-node-12-{{ checksum ".bazelversion" }}
var_3_win: &cache_key_win v4-angular-win-node-14-{{ checksum ".bazelversion" }}-{{ checksum "yarn.lock" }}-{{ checksum "WORKSPACE" }}-{{ checksum "packages/bazel/package.bzl" }}-{{ checksum "aio/yarn.lock" }}
var_4_win: &cache_key_win_fallback v4-angular-win-node-14-{{ checksum ".bazelversion" }}
# Cache key for the `components-repo-unit-tests` job. **Note** when updating the SHA in the
# cache keys also update the SHA for the "COMPONENTS_REPO_COMMIT" environment variable.
@ -77,7 +77,7 @@ executors:
type: string
default: medium
docker:
- image: circleci/node:12.14.1@sha256:f9de24fc0017059cc42ef7d07db060008af65a98b1f0cdd1ef3339213226bf6d
- image: circleci/node:14.16.1@sha256:951e12268fe692615bfd155c327bd910e10c99db98404badd03879f984c32b31
resource_class: << parameters.resource_class >>
working_directory: ~/ng
@ -95,7 +95,7 @@ executors:
machine:
# Windows preview image that includes the following:
# - Visual Studio 2019 build tools
# - Node 12
# - Node 14
# - yarn 1.17
# - Python 3 3.7.4
image: windows-server-2019-vs2019:201908-02

View File

@ -41,8 +41,8 @@ copy .circleci\bazel.windows.rc ${Env:USERPROFILE}\.bazelrc
####################################################################################################
# Install specific version of node.
####################################################################################################
nvm install 12.14.1
nvm use 12.14.1
nvm install 14.16.1
nvm use 14.16.1
# These Bazel prereqs aren't needed because the CircleCI image already includes them.
# choco install yarn --version 1.16.0 --no-progress

View File

@ -1,7 +1,7 @@
# Image metadata and config.
# Ideally, the Node.js version should match what we use on CI.
# See `executors > default-executor` in `.circleci/config.yml`.
FROM circleci/node:12-browsers
FROM circleci/node:14-browsers
LABEL name="Angular dev environment" \

2
.nvmrc
View File

@ -1 +1 @@
12.14.1
14.16.1

View File

@ -21,7 +21,7 @@ check_rules_nodejs_version(minimum_version_string = "2.2.0")
# Setup the Node.js toolchain
node_repositories(
node_version = "12.14.1",
node_version = "14.16.1",
package_json = ["//:package.json"],
)

View File

@ -84,7 +84,7 @@
},
"//engines-comment": "Keep this in sync with /package.json and /aio/tools/examples/shared/package.json",
"engines": {
"node": ">=10.19.0 <16.0.0",
"node": ">=12.14.1 <16.0.0",
"yarn": ">=1.22.4 <2",
"npm": "Please use yarn instead of NPM to install dependencies"
},

View File

@ -12,10 +12,9 @@
},
"//engines-comment": "Keep this in sync with /package.json and /aio/package.json",
"engines": {
"node": ">=10.19.0 <16.0.0",
"node": ">=12.14.1 <16.0.0",
"yarn": ">=1.21.1 <2",
"npm": "Please use yarn instead of NPM to install dependencies"
},
"keywords": [],
"author": "",

View File

@ -26,8 +26,7 @@ load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories", "yarn_install
# Setup the Node.js toolchain
node_repositories(
# Use same node version as root angular WORKSPACE since
# we share node_module packages and some require node >= 10.15.0
node_version = "12.14.1",
node_version = "14.16.1",
yarn_version = "1.12.1",
)

View File

@ -8,7 +8,7 @@
"license": "MIT",
"//engines-comment": "Keep this in sync with /aio/package.json and /aio/tools/examples/shared/package.json",
"engines": {
"node": ">=10.19.0 <16.0.0",
"node": ">=12.14.1 <16.0.0",
"yarn": ">=1.22.4 <2",
"npm": "Please use yarn instead of NPM to install dependencies"
},