Skip to content

Commit 4b62346

Browse files
alan-agius4clydin
authored andcommitted
feat(@angular/cli): drop support for Node.js versions older than 14.20
Node.js 14.20 and newer support generating UUID using the crypto module. See: https://nodejs.org/docs/latest-v14.x/api/crypto.html#crypto_crypto_randomuuid_options BREAKING CHANGE: Node.js versions older than 14.20 are no longer supported.
1 parent 676a0b3 commit 4b62346

File tree

14 files changed

+24
-27
lines changed

14 files changed

+24
-27
lines changed

.circleci/dynamic_config.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ parameters:
2323
## IMPORTANT
2424
# Windows needs its own cache key because binaries in node_modules are different.
2525
# See https://circleci.com/docs/2.0/caching/#restoring-cache for how prefixes work in CircleCI.
26-
var_1: &cache_key v1-angular_devkit-14.19-{{ checksum "yarn.lock" }}
26+
var_1: &cache_key v1-angular_devkit-14.20-{{ checksum "yarn.lock" }}
2727
var_1_win: &cache_key_win v1-angular_devkit-win-16.10-{{ checksum "yarn.lock" }}
28-
var_3: &default_nodeversion '14.19'
28+
var_3: &default_nodeversion '14.20'
2929
var_3_major: &default_nodeversion_major '14'
3030
# The major version of node toolchains. See tools/toolchain_info.bzl
3131
# NOTE: entries in this array may be repeated elsewhere in the file, find them before adding more
@@ -404,7 +404,7 @@ workflows:
404404

405405
- e2e-tests:
406406
name: e2e-cli-<< matrix.subset >>
407-
nodeversion: '14.15'
407+
nodeversion: '14.20'
408408
matrix:
409409
parameters:
410410
subset: *all_e2e_subsets
@@ -421,7 +421,7 @@ workflows:
421421
matrix:
422422
alias: e2e-cli
423423
parameters:
424-
nodeversion: ['14.15', '16.10']
424+
nodeversion: ['14.20', '16.10']
425425
subset: *all_e2e_subsets
426426
requires:
427427
- build

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
14.17.0
1+
14.20.0

WORKSPACE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains")
5353

5454
nodejs_register_toolchains(
5555
name = "nodejs",
56-
node_version = "14.17.1",
56+
node_version = "14.20.0",
5757
)
5858

5959
load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install")
@@ -91,7 +91,7 @@ register_jq_toolchains(version = "1.6")
9191

9292
nodejs_register_toolchains(
9393
name = "node14",
94-
node_version = "14.17.1",
94+
node_version = "14.20.0",
9595
)
9696

9797
nodejs_register_toolchains(

constants.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Engine versions to stamp in a release package.json
2-
RELEASE_ENGINES_NODE = "^14.15.0 || >=16.10.0"
2+
RELEASE_ENGINES_NODE = "^14.20.0 || >=16.10.0"
33
RELEASE_ENGINES_NPM = "^6.11.0 || ^7.5.6 || >=8.0.0"
44
RELEASE_ENGINES_YARN = ">= 1.13.0"
55

docs/DEVELOPER.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ To get started locally, follow these instructions:
66

77
1. If you haven't done it already, [make a fork of this repo](https://github.com/angular/angular-cli/fork).
88
1. Clone to your local computer using `git`.
9-
1. Make sure that you have Node `v14.15`, or `v16.10` installed. See instructions [here](https://nodejs.org/en/download/).
9+
1. Make sure that you have Node `v14.20`, or `v16.10` installed. See instructions [here](https://nodejs.org/en/download/).
1010
1. Make sure that you have `yarn` installed; see instructions [here](https://yarnpkg.com/lang/en/docs/install/).
1111
1. Run `yarn` (no arguments) from the root of your clone of this project to install dependencies.
1212

lib/packages.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ function loadPackageJson(p: string) {
8585
// Overwrite engines to a common default.
8686
case 'engines':
8787
pkg['engines'] = {
88-
'node': '^14.15.0 || >=16.10.0',
88+
'node': '^14.20.0 || >=16.10.0',
8989
'npm': '^6.11.0 || ^7.5.6 || >=8.0.0',
9090
'yarn': '>= 1.13.0',
9191
};

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"url": "https://github.com/angular/angular-cli.git"
4242
},
4343
"engines": {
44-
"node": "^14.15.0 || ^16.10.0",
44+
"node": "^14.20.0 || ^16.10.0",
4545
"yarn": ">=1.21.1 <2",
4646
"npm": "Please use yarn instead of NPM to install dependencies"
4747
},
@@ -120,7 +120,6 @@
120120
"@types/semver": "^7.3.12",
121121
"@types/tar": "^6.1.2",
122122
"@types/text-table": "^0.2.1",
123-
"@types/uuid": "^8.0.0",
124123
"@types/yargs": "^17.0.8",
125124
"@types/yargs-parser": "^21.0.0",
126125
"@types/yarnpkg__lockfile": "^1.1.5",

packages/angular/cli/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ ts_library(
6464
"@npm//@types/pacote",
6565
"@npm//@types/resolve",
6666
"@npm//@types/semver",
67-
"@npm//@types/uuid",
6867
"@npm//@types/yargs",
6968
"@npm//@types/yarnpkg__lockfile",
7069
"@npm//@yarnpkg/lockfile",

packages/angular/cli/bin/ng.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ if (version[0] % 2 === 1 && version[0] > 16) {
4141
(version[0] === 14 && version[1] < 15) ||
4242
(version[0] === 16 && version[1] < 10)
4343
) {
44-
// Error and exit if less than 14.15 or 15.x or less than 16.10
44+
// Error and exit if less than 14.20 or 15.x or less than 16.10
4545
console.error(
4646
'Node.js version ' +
4747
process.version +
4848
' detected.\n' +
49-
'The Angular CLI requires a minimum Node.js version of either v14.15, or v16.10.\n\n' +
49+
'The Angular CLI requires a minimum Node.js version of either v14.20, or v16.10.\n\n' +
5050
'Please update your Node.js version or visit https://nodejs.org/ for additional instructions.\n',
5151
);
5252

packages/angular/cli/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
"resolve": "1.22.1",
4141
"semver": "7.3.7",
4242
"symbol-observable": "4.0.0",
43-
"uuid": "9.0.0",
4443
"yargs": "17.6.0"
4544
},
4645
"devDependencies": {

packages/angular/cli/src/analytics/analytics.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
*/
88

99
import { analytics, json, tags } from '@angular-devkit/core';
10+
import { randomUUID } from 'crypto';
1011
import debug from 'debug';
11-
import { v4 as uuidV4 } from 'uuid';
1212
import { colors } from '../utilities/color';
1313
import { getWorkspace } from '../utilities/config';
1414
import { analyticsDisabled, analyticsShareDisabled } from '../utilities/environment-options';
@@ -78,7 +78,7 @@ export async function setAnalyticsConfig(global: boolean, value: string | boolea
7878
throw new Error(`Invalid config found at ${workspace.filePath}. CLI should be an object.`);
7979
}
8080

81-
cli.analytics = value === true ? uuidV4() : value;
81+
cli.analytics = value === true ? randomUUID() : value;
8282
await workspace.save();
8383
analyticsDebug('done');
8484
}

packages/angular/cli/src/commands/config/cli.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
*/
88

99
import { JsonValue } from '@angular-devkit/core';
10+
import { randomUUID } from 'crypto';
1011
import { join } from 'path';
11-
import { v4 as uuidV4 } from 'uuid';
1212
import { Argv } from 'yargs';
1313
import {
1414
CommandModule,
@@ -104,7 +104,7 @@ export class ConfigCommandModule
104104
throw new CommandModuleError('Confguration file cannot be found.');
105105
}
106106

107-
const normalizeUUIDValue = (v: string | undefined) => (v === '' ? uuidV4() : `${v}`);
107+
const normalizeUUIDValue = (v: string | undefined) => (v === '' ? randomUUID() : `${v}`);
108108

109109
const value =
110110
options.jsonPath === 'cli.analyticsSharing.uuid'

tools/test/expected_package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
}
3636
},
3737
"engines": {
38-
"node": "^14.15.0 || >=16.10.0",
38+
"node": "^14.20.0 || >=16.10.0",
3939
"npm": "^6.11.0 || ^7.5.6 || >=8.0.0",
4040
"yarn": ">= 1.13.0"
4141
}

yarn.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2661,7 +2661,7 @@
26612661
dependencies:
26622662
source-map "^0.6.1"
26632663

2664-
"@types/uuid@^8.0.0", "@types/uuid@^8.3.1":
2664+
"@types/uuid@^8.3.1":
26652665
version "8.3.4"
26662666
resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-8.3.4.tgz#bd86a43617df0594787d38b735f55c805becf1bc"
26672667
integrity sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw==
@@ -11176,11 +11176,6 @@ utils-merge@1.0.1:
1117611176
resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713"
1117711177
integrity sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==
1117811178

11179-
uuid@9.0.0, uuid@^9.0.0:
11180-
version "9.0.0"
11181-
resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.0.tgz#592f550650024a38ceb0c562f2f6aa435761efb5"
11182-
integrity sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==
11183-
1118411179
uuid@^3.3.2:
1118511180
version "3.4.0"
1118611181
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee"
@@ -11191,6 +11186,11 @@ uuid@^8.3.2:
1119111186
resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2"
1119211187
integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==
1119311188

11189+
uuid@^9.0.0:
11190+
version "9.0.0"
11191+
resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.0.tgz#592f550650024a38ceb0c562f2f6aa435761efb5"
11192+
integrity sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==
11193+
1119411194
v8-compile-cache-lib@^3.0.1:
1119511195
version "3.0.1"
1119611196
resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf"

0 commit comments

Comments
 (0)