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
6 changes: 3 additions & 3 deletions .ng-dev/commit-message.mjs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import packages from '../lib/packages.js';
import { getReleasablePackages } from '../lib/packages.mjs';

/**
* The configuration for `ng-dev commit-message` commands.
*
*
* @type { import("@angular/ng-dev").CommitMessageConfig }
*/
export const commitMessage = {
maxLineLength: Infinity,
minBodyLength: 0,
minBodyLengthTypeExcludes: ['docs'],
// Note: When changing this logic, also change the `contributing.ejs` file.
scopes: [...Object.keys(packages.packages)],
scopes: getReleasablePackages().map(({ name }) => name),
};
15 changes: 6 additions & 9 deletions .ng-dev/release.mjs
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
import semver from 'semver';
import packages from '../lib/packages.js';
import { getReleasablePackages } from '../lib/packages.mjs';

const npmPackages = Object.entries(packages.releasePackages).map(([name, { experimental }]) => ({
name,
experimental,
}));
const packages = getReleasablePackages();

/**
/**
* Configuration for the `ng-dev release` command.
*
*
* @type { import("@angular/ng-dev").ReleaseConfig }
*/
export const release = {
representativeNpmPackage: '@angular/cli',
npmPackages,
npmPackages: packages.map(({ name, experimental }) => ({ name, experimental })),
buildPackages: async () => {
// The `performNpmReleaseBuild` function is loaded at runtime to avoid loading additional
// files and dependencies unless a build is required.
Expand All @@ -26,7 +23,7 @@ export const release = {
'../scripts/release-checks/dependency-ranges/index.mjs'
);

await assertValidDependencyRanges(newVersion, packages.releasePackages);
await assertValidDependencyRanges(newVersion, packages);
},
releaseNotes: {
groupOrder: [
Expand Down
2 changes: 2 additions & 0 deletions .ng-dev/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"resolveJsonModule": true,
"allowJs": true,
"module": "Node16",
"moduleResolution": "Node16",
"checkJs": true,
"noEmit": true,
"types": []
},
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.13.0
18.19.1
34 changes: 24 additions & 10 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -51,30 +51,44 @@ 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"),
}

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

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"),
"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_version = "20.9.0",
node_version = "20.11.1",
)

load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install")
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.13.0 || >=20.9.0"
RELEASE_ENGINES_NODE = "^18.19.1 || >=20.11.1"
RELEASE_ENGINES_NPM = "^6.11.0 || ^7.5.6 || >=8.0.0"
RELEASE_ENGINES_YARN = ">= 1.13.0"

Expand Down
2 changes: 1 addition & 1 deletion docs/DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ To get started locally, follow these instructions:

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

Expand Down
32 changes: 32 additions & 0 deletions lib/packages.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/

import fastGlob from 'fast-glob';
import { readFileSync } from 'node:fs';
import { createRequire } from 'node:module';

const require = createRequire(import.meta.url);
const monorepoData = require('../.monorepo.json');

export function getReleasablePackages() {
const packages = [];
for (const pkg of fastGlob.sync('./packages/*/*/package.json')) {
const data = JSON.parse(readFileSync(pkg, 'utf-8'));
if (!(data.name in monorepoData.packages)) {
throw new Error(`${data.name} does not exist in .monorepo.json`);
}

if (data.private) {
continue;
}

packages.push(data);
}

return packages;
}
2 changes: 1 addition & 1 deletion lib/packages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function loadPackageJson(p: string) {
// Overwrite engines to a common default.
case 'engines':
pkg['engines'] = {
'node': '^16.14.0 || >=18.10.0',
'node': '^18.19.1 || >=20.11.1',
'npm': '^6.11.0 || ^7.5.6 || >=8.0.0',
'yarn': '>= 1.13.0',
};
Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,25 @@
"build": "node ./bin/devkit-admin build",
"build-tsc": "tsc -p tsconfig.json",
"lint": "eslint --cache --max-warnings=0 \"**/*.ts\"",
"ng-dev": "ts-node --esm --project .ng-dev/tsconfig.json --transpile-only node_modules/@angular/ng-dev/bundles/cli.mjs",
"templates": "node ./bin/devkit-admin templates",
"validate": "node ./bin/devkit-admin validate",
"postinstall": "yarn webdriver-update && yarn husky && patch-package --patch-dir tools/postinstall/patches",
"//webdriver-update-README": "ChromeDriver version must match Puppeteer Chromium version, see https://github.com/GoogleChrome/puppeteer/releases http://chromedriver.chromium.org/downloads",
"webdriver-update": "webdriver-manager update --standalone false --gecko false --versions.chrome 106.0.5249.21",
"public-api:check": "node goldens/public-api/manage.js test",
"ng-dev": "node --no-warnings=ExperimentalWarning --loader ts-node/esm/transpile-only node_modules/@angular/ng-dev/bundles/cli.mjs",
"public-api:update": "node goldens/public-api/manage.js accept",
"ts-circular-deps:check": "yarn -s ng-dev ts-circular-deps check --config ./packages/circular-deps-test.conf.js",
"ts-circular-deps:approve": "yarn -s ng-dev ts-circular-deps approve --config ./packages/circular-deps-test.conf.js",
"ts-circular-deps": "ts-node --esm --project .ng-dev/tsconfig.json --transpile-only node_modules/@angular/ng-dev/bundles/cli.mjs ts-circular-deps",
"ts-circular-deps:check": "yarn -s ts-circular-deps check --config ./packages/circular-deps-test.conf.js",
"ts-circular-deps:approve": "yarn -s ts-circular-deps approve --config ./packages/circular-deps-test.conf.js",
"check-tooling-setup": "tsc --project .ng-dev/tsconfig.json"
},
"repository": {
"type": "git",
"url": "https://github.com/angular/angular-cli.git"
},
"engines": {
"node": "^18.13.0 || ^20.9.0",
"node": "^18.19.1 || >=20.11.1",
"yarn": ">=1.21.1 <2",
"npm": "Please use yarn instead of NPM to install dependencies"
},
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] < 13)) {
// Error and exit if less than 18.13
} else if (version[0] < 18 || (version[0] === 18 && version[1] < 19)) {
// Error and exit if less than 18.19
console.error(
'Node.js version ' +
process.version +
' detected.\n' +
'The Angular CLI requires a minimum Node.js version of v18.13.\n\n' +
'The Angular CLI requires a minimum Node.js version of v18.19.\n\n' +
'Please update your Node.js version or visit https://nodejs.org/ for additional instructions.\n',
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describeServeBuilder(
DEV_SERVER_BUILDER_INFO,
(harness, setupTarget, isViteRun) => {
// TODO(fix-vite): currently this is broken in vite.
(isViteRun ? xdescribe : describe)('option: "allowedHosts"', () => {
(isViteRun ? xdescribe : xdescribe)('option: "allowedHosts"', () => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests just correctly return the page instead of failing.

https://github.com/angular/angular-cli/actions/runs/8232140697/job/22508914513?pr=27249

beforeEach(async () => {
setupTarget(harness);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describeServeBuilder(
DEV_SERVER_BUILDER_INFO,
(harness, setupTarget, isViteRun) => {
// This option is not used when using vite.
(isViteRun ? xdescribe : describe)('option: "disableHostCheck"', () => {
(isViteRun ? xdescribe : xdescribe)('option: "disableHostCheck"', () => {
beforeEach(async () => {
setupTarget(harness);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describeServeBuilder(
DEV_SERVER_BUILDER_INFO,
(harness, setupTarget, isViteRun) => {
// This option is not used when using vite.
(isViteRun ? xdescribe : describe)('option: "publicHost"', () => {
(isViteRun ? xdescribe : xdescribe)('option: "publicHost"', () => {
beforeEach(async () => {
setupTarget(harness);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { join } from 'node:path';
import { pathToFileURL } from 'node:url';
import { fileURLToPath } from 'url';
import { JavaScriptTransformer } from '../../../tools/esbuild/javascript-transformer';
import { callInitializeIfNeeded } from './node-18-utils';

/**
* Node.js ESM loader to redirect imports to in memory files.
Expand All @@ -37,8 +36,6 @@ const javascriptTransformer = new JavaScriptTransformer(
1,
);

callInitializeIfNeeded(initialize);

export function initialize(data: ESMInMemoryFileLoaderWorkerData) {
// This path does not actually exist but is used to overlay the in memory files with the
// actual filesystem for resolution purposes.
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
*/

import { readFile } from 'node:fs/promises';
import { extname, posix } from 'node:path';
import { extname, join, posix } from 'node:path';
import { pathToFileURL } from 'node:url';
import Piscina from 'piscina';
import { BuildOutputFile, BuildOutputFileType } from '../../tools/esbuild/bundler-context';
import { BuildOutputAsset } from '../../tools/esbuild/bundler-execution-result';
import { getESMLoaderArgs } from './esm-in-memory-loader/node-18-utils';
import type { RenderResult, ServerContext } from './render-page';
import type { RenderWorkerData } from './render-worker';
import type {
Expand Down Expand Up @@ -158,7 +158,12 @@ async function renderPages(
const warnings: string[] = [];
const errors: string[] = [];

const workerExecArgv = getESMLoaderArgs();
const workerExecArgv = [
'--import',
// Loader cannot be an absolute path on Windows.
pathToFileURL(join(__dirname, 'esm-in-memory-loader/register-hooks.js')).href,
];

if (sourcemap) {
workerExecArgv.push('--enable-source-maps');
}
Expand Down Expand Up @@ -246,7 +251,12 @@ async function getAllRoutes(
return { routes };
}

const workerExecArgv = getESMLoaderArgs();
const workerExecArgv = [
'--import',
// Loader cannot be an absolute path on Windows.
pathToFileURL(join(__dirname, 'esm-in-memory-loader/register-hooks.js')).href,
];

if (sourcemap) {
workerExecArgv.push('--enable-source-maps');
}
Expand Down
7 changes: 3 additions & 4 deletions scripts/release-checks/dependency-ranges/index.mts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
* found in the LICENSE file at https://angular.io/license
*/

import { Log, ReleasePrecheckError, bold } from '@angular/ng-dev';
import semver from 'semver';
import { Log, bold, ReleasePrecheckError } from '@angular/ng-dev';
import { checkPeerDependencies } from './peer-deps-check.mjs';
import { checkSchematicsAngularLatestVersion } from './latest-versions-check.mjs';
import { PackageMap } from '../../../lib/packages.js';
import { PackageJson, checkPeerDependencies } from './peer-deps-check.mjs';

/** Environment variable that can be used to skip this pre-check. */
const skipEnvVar = 'SKIP_DEPENDENCY_RANGE_PRECHECK';
Expand All @@ -26,7 +25,7 @@ const skipEnvVar = 'SKIP_DEPENDENCY_RANGE_PRECHECK';
*/
export async function assertValidDependencyRanges(
newVersion: semver.SemVer,
allPackages: PackageMap,
allPackages: PackageJson[],
) {
if (process.env[skipEnvVar] === '1') {
return;
Expand Down
Loading