feat(core): drop support for Node.js 12 (#45286)

Node.js v12 will become EOL on 2022-04-30. As a result, Angular CLI v14 will no longer support Node.js v12.

BREAKING CHANGE:

Support for Node.js v12 has been removed as it will become EOL on 2022-04-30. Please use Node.js v14.15 or later.

PR Close #45286
This commit is contained in:
Alan Agius 2022-03-07 16:43:13 +01:00 committed by Andrew Kushnir
parent f58b8a94d4
commit 6eaaefd22e
29 changed files with 33 additions and 54 deletions

View file

@ -12,7 +12,7 @@
},
"//engines-comment": "Keep this in sync with /package.json and /aio/package.json",
"engines": {
"node": "^12.20.0 || >=14.0.0",
"node": ">=14.0.0",
"yarn": ">=1.21.1 <2",
"npm": "Please use yarn instead of NPM to install dependencies"
},

View file

@ -44,7 +44,7 @@ describe('sourcemaps', function() {
const decoder = new SourceMapConsumer(JSON.parse(sourceMapData) as RawSourceMap);
const originalPosition = decoder.originalPositionFor({line: errorLine, column: errorColumn});
const sourceCodeLines = readFileSync(require.resolve('../../src/sourcemap/index.ts'), {
encoding: 'UTF-8'
encoding: 'utf-8'
}).split('\n');
expect(sourceCodeLines[originalPosition.line - 1])
.toMatch(/throw new Error\(\'Sourcemap test\'\)/);

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": "^12.20.0 || ^14.15.0 || >=16.10.0",
"node": "^14.15.0 || >=16.10.0",
"yarn": ">=1.22.4 <2",
"npm": "Please use yarn instead of NPM to install dependencies"
},
@ -96,7 +96,7 @@
"@types/jasmine-ajax": "^3.3.1",
"@types/jasminewd2": "^2.0.8",
"@types/multimatch": "^4.0.0",
"@types/node": "^12.11.1",
"@types/node": "^14.15.0",
"@types/resize-observer-browser": "^0.1.5",
"@types/selenium-webdriver": "3.0.7",
"@types/semver": "^7.3.4",

View file

@ -5,7 +5,7 @@
"author": "angular",
"license": "MIT",
"engines": {
"node": "^12.20.0 || ^14.15.0 || >=16.10.0"
"node": "^14.15.0 || >=16.10.0"
},
"dependencies": {
"tslib": "^2.3.0"

View file

@ -5,7 +5,7 @@
"author": "angular",
"license": "MIT",
"engines": {
"node": "^12.20.0 || ^14.15.0 || >=16.10.0"
"node": "^14.15.0 || >=16.10.0"
},
"bin": {
"api-extractor": "./src/api-extractor/index.js",

View file

@ -5,7 +5,7 @@
"author": "angular",
"license": "MIT",
"engines": {
"node": "^12.20.0 || ^14.15.0 || >=16.10.0"
"node": "^14.15.0 || >=16.10.0"
},
"locales": "locales",
"dependencies": {

View file

@ -82,6 +82,6 @@ export const sendMessageToWorker = (workerId: number, msg: MessageToWorker): Pro
}
return new Promise((resolve, reject) => {
worker.send(msg, (err: Error|null) => (err === null) ? resolve() : reject(err));
worker.send(msg, undefined, (err: Error|null) => (err === null) ? resolve() : reject(err));
});
};

View file

@ -79,7 +79,7 @@
],
"license": "MIT",
"engines": {
"node": "^12.20.0 || ^14.15.0 || >=16.10.0"
"node": "^14.15.0 || >=16.10.0"
},
"bugs": {
"url": "https://github.com/angular/angular/issues"

View file

@ -5,7 +5,7 @@
"author": "angular",
"license": "MIT",
"engines": {
"node": "^12.20.0 || ^14.15.0 || >=16.10.0"
"node": "^14.15.0 || >=16.10.0"
},
"dependencies": {
"tslib": "^2.3.0"

View file

@ -5,7 +5,7 @@
"author": "angular",
"license": "MIT",
"engines": {
"node": "^12.20.0 || ^14.15.0 || >=16.10.0"
"node": "^14.15.0 || >=16.10.0"
},
"exports": {
"./schematics/*": {

View file

@ -11,9 +11,6 @@ import '@angular/compiler';
import * as fs from 'fs';
import * as path from 'path';
const UTF8 = {
encoding: 'utf-8'
};
const PACKAGE = 'angular/packages/core/test/bundling/animations';
describe('treeshaking with uglify', () => {
@ -22,7 +19,7 @@ describe('treeshaking with uglify', () => {
// always pass)
const contentPath = require.resolve(path.join(PACKAGE, 'bundle.debug.min.js'));
beforeAll(() => {
content = fs.readFileSync(contentPath, UTF8);
content = fs.readFileSync(contentPath, {encoding: 'utf-8'});
});
it('should drop unused TypeScript helpers', () => {

View file

@ -12,16 +12,13 @@ import {withBody} from '@angular/private/testing';
import * as fs from 'fs';
import * as path from 'path';
const UTF8 = {
encoding: 'utf-8'
};
const PACKAGE = 'angular/packages/core/test/bundling/cyclic_import';
describe('treeshaking with uglify', () => {
let content: string;
const contentPath = require.resolve(path.join(PACKAGE, 'bundle.debug.min.js'));
beforeAll(() => {
content = fs.readFileSync(contentPath, UTF8);
content = fs.readFileSync(contentPath, {encoding: 'utf-8'});
});
describe('functional test in domino', () => {

View file

@ -11,9 +11,6 @@ import '@angular/compiler';
import * as fs from 'fs';
import * as path from 'path';
const UTF8 = {
encoding: 'utf-8'
};
const PACKAGE = 'angular/packages/core/test/bundling/forms_reactive';
describe('treeshaking with uglify', () => {
@ -22,7 +19,7 @@ describe('treeshaking with uglify', () => {
// always pass)
const contentPath = require.resolve(path.join(PACKAGE, 'bundle.debug.min.js'));
beforeAll(() => {
content = fs.readFileSync(contentPath, UTF8);
content = fs.readFileSync(contentPath, {encoding: 'utf-8'});
});
it('should drop unused TypeScript helpers', () => {

View file

@ -11,9 +11,6 @@ import '@angular/compiler';
import * as fs from 'fs';
import * as path from 'path';
const UTF8 = {
encoding: 'utf-8'
};
const PACKAGE = 'angular/packages/core/test/bundling/forms_template_driven';
describe('treeshaking with uglify', () => {
@ -22,7 +19,7 @@ describe('treeshaking with uglify', () => {
// always pass)
const contentPath = require.resolve(path.join(PACKAGE, 'bundle.debug.min.js'));
beforeAll(() => {
content = fs.readFileSync(contentPath, UTF8);
content = fs.readFileSync(contentPath, {encoding: 'utf-8'});
});
it('should drop unused TypeScript helpers', () => {

View file

@ -12,16 +12,13 @@ import {withBody} from '@angular/private/testing';
import * as fs from 'fs';
import * as path from 'path';
const UTF8 = {
encoding: 'utf-8'
};
const PACKAGE = 'angular/packages/core/test/bundling/hello_world';
describe('treeshaking with uglify', () => {
let content: string;
const contentPath = require.resolve(path.join(PACKAGE, 'bundle.debug.min.js'));
beforeAll(() => {
content = fs.readFileSync(contentPath, UTF8);
content = fs.readFileSync(contentPath, {encoding: 'utf-8'});
});
it('should drop unused TypeScript helpers', () => {

View file

@ -11,16 +11,13 @@ import '@angular/compiler';
import * as fs from 'fs';
import * as path from 'path';
const UTF8 = {
encoding: 'utf-8'
};
const PACKAGE = 'angular/packages/core/test/bundling/hello_world_r2';
describe('treeshaking with uglify', () => {
let content: string;
const contentPath = require.resolve(path.join(PACKAGE, 'bundle.debug.min.js'));
beforeAll(() => {
content = fs.readFileSync(contentPath, UTF8);
content = fs.readFileSync(contentPath, {encoding: 'utf-8'});
});
it('should drop unused TypeScript helpers', () => {

View file

@ -11,9 +11,6 @@ import '@angular/compiler';
import * as fs from 'fs';
import * as path from 'path';
const UTF8 = {
encoding: 'utf-8'
};
const PACKAGE = 'angular/packages/core/test/bundling/router';
describe('treeshaking with uglify', () => {
@ -22,7 +19,7 @@ describe('treeshaking with uglify', () => {
// always pass)
const contentPath = require.resolve(path.join(PACKAGE, 'bundle.debug.min.js'));
beforeAll(() => {
content = fs.readFileSync(contentPath, UTF8);
content = fs.readFileSync(contentPath, {encoding: 'utf-8'});
});
it('should drop unused TypeScript helpers', () => {

View file

@ -5,7 +5,7 @@
"author": "angular",
"license": "MIT",
"engines": {
"node": "^12.20.0 || ^14.15.0 || >=16.10.0"
"node": "^14.15.0 || >=16.10.0"
},
"dependencies": {
"tslib": "^2.3.0"

View file

@ -5,7 +5,7 @@
"author": "angular",
"license": "MIT",
"engines": {
"node": "^12.20.0 || ^14.15.0 || >=16.10.0"
"node": "^14.15.0 || >=16.10.0"
},
"dependencies": {
"tslib": "^2.3.0"

View file

@ -7,7 +7,7 @@
"author": "angular",
"license": "MIT",
"engines": {
"node": "^12.20.0 || ^14.15.0 || >=16.10.0"
"node": "^14.15.0 || >=16.10.0"
},
"repository": {
"type": "git",

View file

@ -16,7 +16,7 @@
"author": "angular",
"license": "MIT",
"engines": {
"node": "^12.20.0 || ^14.15.0 || >=16.10.0"
"node": "^14.15.0 || >=16.10.0"
},
"repository": {
"type": "git",

View file

@ -5,7 +5,7 @@
"author": "angular",
"license": "MIT",
"engines": {
"node": "^12.20.0 || ^14.15.0 || >=16.10.0"
"node": "^14.15.0 || >=16.10.0"
},
"dependencies": {
"tslib": "^2.3.0"

View file

@ -5,7 +5,7 @@
"author": "angular",
"license": "MIT",
"engines": {
"node": "^12.20.0 || ^14.15.0 || >=16.10.0"
"node": "^14.15.0 || >=16.10.0"
},
"dependencies": {
"tslib": "^2.3.0"

View file

@ -5,7 +5,7 @@
"author": "angular",
"license": "MIT",
"engines": {
"node": "^12.20.0 || ^14.15.0 || >=16.10.0"
"node": "^14.15.0 || >=16.10.0"
},
"peerDependencies": {
"@angular/animations": "0.0.0-PLACEHOLDER",

View file

@ -14,7 +14,7 @@
"author": "angular",
"license": "MIT",
"engines": {
"node": "^12.20.0 || ^14.15.0 || >=16.10.0"
"node": "^14.15.0 || >=16.10.0"
},
"bugs": {
"url": "https://github.com/angular/angular/issues"

View file

@ -5,7 +5,7 @@
"author": "angular",
"license": "MIT",
"engines": {
"node": "^12.20.0 || ^14.15.0 || >=16.10.0"
"node": "^14.15.0 || >=16.10.0"
},
"exports": {
"./ngsw-worker.js": {

View file

@ -5,7 +5,7 @@
"author": "angular",
"license": "MIT",
"engines": {
"node": "^12.20.0 || ^14.15.0 || >=16.10.0"
"node": "^14.15.0 || >=16.10.0"
},
"dependencies": {
"tslib": "^2.3.0"

View file

@ -57,7 +57,7 @@ module.exports = function getMappings(bundlePath) {
};
function getFile(filePath) {
return fs.readFileSync(path.resolve(process.cwd(), filePath), 'UTF-8');
return fs.readFileSync(path.resolve(process.cwd(), filePath), 'utf-8');
}
function decodeLines(sourceMap) {

View file

@ -2469,10 +2469,10 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-11.15.54.tgz#59ed60e7b0d56905a654292e8d73275034eb6283"
integrity sha512-1RWYiq+5UfozGsU6MwJyFX6BtktcT10XRjvcAQmskCtMcW3tPske88lM/nHv7BQG1w9KBXI1zPGuu5PnNCX14g==
"@types/node@^12.11.1":
version "12.20.46"
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.46.tgz#7e49dee4c54fd19584e6a9e0da5f3dc2e9136bc7"
integrity sha512-cPjLXj8d6anFPzFvOPxS3fvly3Shm5nTfl6g8X5smexixbuGUf7hfr21J5tX9JW+UPStp/5P5R8qrKL5IyVJ+A==
"@types/node@^14.15.0":
version "14.18.12"
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.12.tgz#0d4557fd3b94497d793efd4e7d92df2f83b4ef24"
integrity sha512-q4jlIR71hUpWTnGhXWcakgkZeHa3CCjcQcnuzU8M891BAWA2jHiziiWEPEkdS5pFsz7H9HJiy8BrK7tBRNrY7A==
"@types/normalize-package-data@^2.4.0":
version "2.4.1"