Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# This file should be checked into version control along with the pnpm-lock.yaml file.
.npmrc=-1406867100
modules/testing/builder/package.json=973445093
package.json=1689924778
package.json=-149318065
packages/angular/build/package.json=1250379839
packages/angular/cli/package.json=-1917515334
packages/angular/pwa/package.json=1108903917
Expand All @@ -17,6 +17,6 @@ packages/angular_devkit/schematics/package.json=673943597
packages/angular_devkit/schematics_cli/package.json=-2026655035
packages/ngtools/webpack/package.json=605871936
packages/schematics/angular/package.json=251715148
pnpm-lock.yaml=751686031
pnpm-lock.yaml=610919784
pnpm-workspace.yaml=-1056556036
yarn.lock=1471859413
yarn.lock=1260513060
7 changes: 2 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,10 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
node: [18, 20, 22]
node: [20, 22]
subset: [npm, esbuild]
shard: [0, 1, 2, 3, 4, 5]
exclude:
# Skip Node.js v18 tests on Windows
- os: windows-latest
node: 18
# Skip Node.js v20 tests on Windows
- os: windows-latest
node: 20
Expand Down Expand Up @@ -130,7 +127,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
node: [18]
node: [22]
subset: [npm, esbuild]
shard: [0, 1, 2, 3, 4, 5]
runs-on: ${{ matrix.os }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
node: [18]
node: [22]
subset: [npm, esbuild]
shard: [0, 1, 2, 3, 4, 5]
runs-on: ${{ matrix.os }}
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.19.1
20.11.1
39 changes: 12 additions & 27 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
workspace(name = "angular_cli")

DEFAULT_NODE_VERSION = "18.19.1"
DEFAULT_NODE_VERSION = "20.11.1"

# Workaround for: https://github.com/bazel-contrib/bazel-lib/issues/968.
# Override toolchain for tar on windows.
Expand Down Expand Up @@ -67,43 +67,28 @@ rules_pkg_dependencies()
# Setup the Node.js toolchain
load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains")

NODE_18_REPO = {
"18.19.1-darwin_arm64": ("node-v18.19.1-darwin-arm64.tar.gz", "node-v18.19.1-darwin-arm64", "0c7249318868877032ed21cc0ed450015ee44b31b9b281955521cd3fc39fbfa3"),
"18.19.1-darwin_amd64": ("node-v18.19.1-darwin-x64.tar.gz", "node-v18.19.1-darwin-x64", "ab67c52c0d215d6890197c951e1bd479b6140ab630212b96867395e21d813016"),
"18.19.1-linux_arm64": ("node-v18.19.1-linux-arm64.tar.xz", "node-v18.19.1-linux-arm64", "228ad1eee660fba3f9fd2cccf02f05b8ebccc294d27f22c155d20b233a9d76b3"),
"18.19.1-linux_ppc64le": ("node-v18.19.1-linux-ppc64le.tar.xz", "node-v18.19.1-linux-ppc64le", "2e5812b8fc00548e2e8ab9daa88ace13974c16b6ba5595a7a50c35f848f7d432"),
"18.19.1-linux_s390x": ("node-v18.19.1-linux-s390x.tar.xz", "node-v18.19.1-linux-s390x", "15106acf4c9e3aca02416dd89fb5c71af77097042455a73f9caa064c1988ead5"),
"18.19.1-linux_amd64": ("node-v18.19.1-linux-x64.tar.xz", "node-v18.19.1-linux-x64", "f35f24edd4415cd609a2ebc03be03ed2cfe211d7333d55c752d831754fb849f0"),
"18.19.1-windows_amd64": ("node-v18.19.1-win-x64.zip", "node-v18.19.1-win-x64", "ff08f8fe253fba9274992d7052e9d9a70141342d7b36ddbd6e84cbe823e312c6"),
NODE_20_REPO = {
"20.11.1-darwin_arm64": ("node-v20.11.1-darwin-arm64.tar.gz", "node-v20.11.1-darwin-arm64", "e0065c61f340e85106a99c4b54746c5cee09d59b08c5712f67f99e92aa44995d"),
"20.11.1-darwin_amd64": ("node-v20.11.1-darwin-x64.tar.gz", "node-v20.11.1-darwin-x64", "c52e7fb0709dbe63a4cbe08ac8af3479188692937a7bd8e776e0eedfa33bb848"),
"20.11.1-linux_arm64": ("node-v20.11.1-linux-arm64.tar.xz", "node-v20.11.1-linux-arm64", "c957f29eb4e341903520caf362534f0acd1db7be79c502ae8e283994eed07fe1"),
"20.11.1-linux_ppc64le": ("node-v20.11.1-linux-ppc64le.tar.xz", "node-v20.11.1-linux-ppc64le", "51343cacf5cdf5c4b5e93e919d19dd373d6ef43d5f2c666eae299f26e31d08b5"),
"20.11.1-linux_s390x": ("node-v20.11.1-linux-s390x.tar.xz", "node-v20.11.1-linux-s390x", "b32616b705cd0ddbb230b95c693e3d7a37becc2ced9bcadea8dc824cceed6be0"),
"20.11.1-linux_amd64": ("node-v20.11.1-linux-x64.tar.xz", "node-v20.11.1-linux-x64", "d8dab549b09672b03356aa2257699f3de3b58c96e74eb26a8b495fbdc9cf6fbe"),
"20.11.1-windows_amd64": ("node-v20.11.1-win-x64.zip", "node-v20.11.1-win-x64", "bc032628d77d206ffa7f133518a6225a9c5d6d9210ead30d67e294ff37044bda"),
}

nodejs_register_toolchains(
name = "node18",
# 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 = NODE_18_REPO,
node_version = "18.19.1",
)

# Set the default nodejs toolchain to the latest supported major version
nodejs_register_toolchains(
name = "nodejs",
# 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 = NODE_18_REPO,
node_repositories = NODE_20_REPO,
node_version = DEFAULT_NODE_VERSION,
)

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.11.1-darwin_arm64": ("node-v20.11.1-darwin-arm64.tar.gz", "node-v20.11.1-darwin-arm64", "e0065c61f340e85106a99c4b54746c5cee09d59b08c5712f67f99e92aa44995d"),
"20.11.1-darwin_amd64": ("node-v20.11.1-darwin-x64.tar.gz", "node-v20.11.1-darwin-x64", "c52e7fb0709dbe63a4cbe08ac8af3479188692937a7bd8e776e0eedfa33bb848"),
"20.11.1-linux_arm64": ("node-v20.11.1-linux-arm64.tar.xz", "node-v20.11.1-linux-arm64", "c957f29eb4e341903520caf362534f0acd1db7be79c502ae8e283994eed07fe1"),
"20.11.1-linux_ppc64le": ("node-v20.11.1-linux-ppc64le.tar.xz", "node-v20.11.1-linux-ppc64le", "51343cacf5cdf5c4b5e93e919d19dd373d6ef43d5f2c666eae299f26e31d08b5"),
"20.11.1-linux_s390x": ("node-v20.11.1-linux-s390x.tar.xz", "node-v20.11.1-linux-s390x", "b32616b705cd0ddbb230b95c693e3d7a37becc2ced9bcadea8dc824cceed6be0"),
"20.11.1-linux_amd64": ("node-v20.11.1-linux-x64.tar.xz", "node-v20.11.1-linux-x64", "d8dab549b09672b03356aa2257699f3de3b58c96e74eb26a8b495fbdc9cf6fbe"),
"20.11.1-windows_amd64": ("node-v20.11.1-win-x64.zip", "node-v20.11.1-win-x64", "bc032628d77d206ffa7f133518a6225a9c5d6d9210ead30d67e294ff37044bda"),
},
node_repositories = NODE_20_REPO,
node_version = "20.11.1",
)

Expand All @@ -125,7 +110,7 @@ nodejs_register_toolchains(
load("@aspect_rules_js//js:toolchains.bzl", "rules_js_register_toolchains")

rules_js_register_toolchains(
node_repositories = NODE_18_REPO,
node_repositories = NODE_20_REPO,
node_version = DEFAULT_NODE_VERSION,
)

Expand Down
2 changes: 1 addition & 1 deletion constants.bzl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Engine versions to stamp in a release package.json
RELEASE_ENGINES_NODE = "^18.19.1 || ^20.11.1 || >=22.0.0"
RELEASE_ENGINES_NODE = "^20.11.1 || >=22.0.0"
RELEASE_ENGINES_NPM = "^6.11.0 || ^7.5.6 || >=8.0.0"
RELEASE_ENGINES_YARN = ">= 1.13.0"

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"url": "https://github.com/angular/angular-cli.git"
},
"engines": {
"node": "^18.19.1 || ^20.11.1 || >=22.0.0",
"node": "^20.11.1 || >=22.0.0",
"npm": "Please use yarn instead of NPM to install dependencies"
},
"author": "Angular Authors",
Expand Down Expand Up @@ -93,7 +93,7 @@
"@types/less": "^3.0.3",
"@types/loader-utils": "^2.0.0",
"@types/lodash": "^4.17.0",
"@types/node": "^18.13.0",
"@types/node": "^20.17.19",
"@types/npm-package-arg": "^6.1.0",
"@types/pacote": "^11.1.3",
"@types/picomatch": "^3.0.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/angular/cli/bin/ng.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ if (version[0] % 2 === 1) {
);

require('./bootstrap');
} else if (version[0] < 18 || (version[0] === 18 && version[1] < 19)) {
// Error and exit if less than 18.19
} else if (version[0] < 20 || (version[0] === 20 && version[1] < 11)) {
// Error and exit if less than 20.11
console.error(
'Node.js version ' +
process.version +
' detected.\n' +
'The Angular CLI requires a minimum Node.js version of v18.19.\n\n' +
'The Angular CLI requires a minimum Node.js version of v20.11.\n\n' +
'Please update your Node.js version or visit https://nodejs.org/ for additional instructions.\n',
);

Expand Down
2 changes: 1 addition & 1 deletion packages/angular/cli/lib/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { writeErrorToLogFile } from '../../src/utilities/log-file';

export { VERSION } from '../../src/utilities/version';

const MIN_NODEJS_VERSION = [18, 13] as const;
const MIN_NODEJS_VERSION = [20, 11] as const;

/* eslint-disable no-console */
export default async function (options: { cliArgs: string[] }) {
Expand Down
2 changes: 1 addition & 1 deletion packages/angular/cli/src/command-builder/command-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export async function runCommand(args: string[], logger: logging.Logger): Promis
.wrap(yargs.terminalWidth())
.parseAsync();

return process.exitCode ?? 0;
return +(process.exitCode ?? 0);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/angular/cli/src/commands/version/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ interface PartialPackageInfo {
/**
* Major versions of Node.js that are officially supported by Angular.
*/
const SUPPORTED_NODE_MAJORS = [18, 20, 22];
const SUPPORTED_NODE_MAJORS = [20, 22];

const PACKAGE_PATTERNS = [
/^@angular\/.*/,
Expand Down
12 changes: 1 addition & 11 deletions packages/angular/ssr/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,17 +326,7 @@ export class AngularServerApp {
return this.assets.getServerAsset(fileName).text();
});

// TODO(alanagius): remove once Node.js version 18 is no longer supported.
if (renderMode === RenderMode.Server && typeof crypto === 'undefined') {
// eslint-disable-next-line no-console
console.error(
`The global 'crypto' module is unavailable. ` +
`If you are running on Node.js, please ensure you are using version 20 or later, ` +
`which includes built-in support for the Web Crypto module.`,
);
}

if (renderMode === RenderMode.Server && typeof crypto !== 'undefined') {
if (renderMode === RenderMode.Server) {
// Only cache if we are running in SSR Mode.
const cacheKey = await sha256(html);
let htmlWithCriticalCss = this.criticalCssLRUCache.get(cacheKey);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"typescript": "~5.7.2"
},
"devDependencies": {
"@types/node": "^18.18.0",
"@types/node": "^20.17.19",
"@types/jasmine": "~5.1.0",
"jasmine": "^5.0.0"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"typescript": "~5.7.2"
},
"devDependencies": {
"@types/node": "^18.18.0",
"@types/node": "^20.17.19",
"@types/jasmine": "~5.1.0",
"jasmine": "~5.6.0"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"dependencies": {
"@types/express": "^4.17.17",
"@types/jasmine": "~5.1.0",
"@types/node": "^18.18.0",
"@types/node": "^20.17.19",
"browser-sync": "^3.0.0",
"express": "^4.18.2",
"jasmine-core": "~5.6.0",
Expand Down
Loading
Loading