Skip to content

Commit b8dff61

Browse files
author
Angular Builds
committed
33ed6e8 refactor: move builtin module imports to use node: prefix imports
1 parent 926327e commit b8dff61

38 files changed

+120
-120
lines changed

package.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
22
"name": "@angular-devkit/build-angular",
3-
"version": "19.2.0-next.2+sha-c0c1670",
3+
"version": "19.2.0-next.2+sha-33ed6e8",
44
"description": "Angular Webpack Build Facade",
55
"main": "src/index.js",
66
"typings": "src/index.d.ts",
77
"builders": "builders.json",
88
"dependencies": {
99
"@ampproject/remapping": "2.3.0",
10-
"@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#c0c1670",
11-
"@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#c0c1670",
12-
"@angular-devkit/core": "github:angular/angular-devkit-core-builds#c0c1670",
13-
"@angular/build": "github:angular/angular-build-builds#c0c1670",
10+
"@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#33ed6e8",
11+
"@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#33ed6e8",
12+
"@angular-devkit/core": "github:angular/angular-devkit-core-builds#33ed6e8",
13+
"@angular/build": "github:angular/angular-build-builds#33ed6e8",
1414
"@babel/core": "7.26.9",
1515
"@babel/generator": "7.26.9",
1616
"@babel/helper-annotate-as-pure": "7.25.9",
@@ -21,7 +21,7 @@
2121
"@babel/preset-env": "7.26.9",
2222
"@babel/runtime": "7.26.9",
2323
"@discoveryjs/json-ext": "0.6.3",
24-
"@ngtools/webpack": "github:angular/ngtools-webpack-builds#c0c1670",
24+
"@ngtools/webpack": "github:angular/ngtools-webpack-builds#33ed6e8",
2525
"@vitejs/plugin-basic-ssl": "1.2.0",
2626
"ansi-colors": "4.1.3",
2727
"autoprefixer": "10.4.20",
@@ -70,7 +70,7 @@
7070
"@angular/localize": "^19.0.0 || ^19.2.0-next.0",
7171
"@angular/platform-server": "^19.0.0 || ^19.2.0-next.0",
7272
"@angular/service-worker": "^19.0.0 || ^19.2.0-next.0",
73-
"@angular/ssr": "github:angular/angular-ssr-builds#c0c1670",
73+
"@angular/ssr": "github:angular/angular-ssr-builds#33ed6e8",
7474
"@web/test-runner": "^0.20.0",
7575
"browser-sync": "^3.0.2",
7676
"jest": "^29.5.0",
@@ -91,7 +91,7 @@
9191
"@angular/service-worker": {
9292
"optional": true
9393
},
94-
"@angular/ssr": "github:angular/angular-ssr-builds#c0c1670",
94+
"@angular/ssr": "github:angular/angular-ssr-builds#33ed6e8",
9595
"@web/test-runner": {
9696
"optional": true
9797
},

src/builders/app-shell/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4545
Object.defineProperty(exports, "__esModule", { value: true });
4646
const private_1 = require("@angular/build/private");
4747
const architect_1 = require("@angular-devkit/architect");
48-
const fs = __importStar(require("fs"));
49-
const path = __importStar(require("path"));
48+
const fs = __importStar(require("node:fs"));
49+
const path = __importStar(require("node:path"));
5050
const piscina_1 = __importDefault(require("piscina"));
5151
const utils_1 = require("../../utils");
5252
const error_1 = require("../../utils/error");

src/builders/browser/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ const private_1 = require("@angular/build/private");
4646
const architect_1 = require("@angular-devkit/architect");
4747
const build_webpack_1 = require("@angular-devkit/build-webpack");
4848
const webpack_1 = require("@ngtools/webpack");
49-
const fs = __importStar(require("fs"));
50-
const path = __importStar(require("path"));
49+
const fs = __importStar(require("node:fs"));
50+
const path = __importStar(require("node:path"));
5151
const rxjs_1 = require("rxjs");
5252
const configs_1 = require("../../tools/webpack/configs");
5353
const async_chunks_1 = require("../../tools/webpack/utils/async-chunks");

src/builders/dev-server/webpack-server.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ exports.serveWebpackBrowser = serveWebpackBrowser;
4444
const private_1 = require("@angular/build/private");
4545
const build_webpack_1 = require("@angular-devkit/build-webpack");
4646
const core_1 = require("@angular-devkit/core");
47-
const path = __importStar(require("path"));
47+
const path = __importStar(require("node:path"));
48+
const url = __importStar(require("node:url"));
4849
const rxjs_1 = require("rxjs");
49-
const url = __importStar(require("url"));
5050
const configs_1 = require("../../tools/webpack/configs");
5151
const index_html_webpack_plugin_1 = require("../../tools/webpack/plugins/index-html-webpack-plugin");
5252
const service_worker_plugin_1 = require("../../tools/webpack/plugins/service-worker-plugin");

src/builders/extract-i18n/ivy-extract-loader.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ var __importStar = (this && this.__importStar) || (function () {
4141
})();
4242
Object.defineProperty(exports, "__esModule", { value: true });
4343
exports.default = localizeExtractLoader;
44-
const nodePath = __importStar(require("path"));
44+
const nodePath = __importStar(require("node:path"));
4545
const load_esm_1 = require("../../utils/load-esm");
4646
function localizeExtractLoader(content, map) {
4747
// This loader is not cacheable due to how message extraction works.

src/builders/karma/application_builder.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ exports.execute = execute;
4747
exports.writeTestFiles = writeTestFiles;
4848
const build_1 = require("@angular/build");
4949
const private_1 = require("@angular/build/private");
50-
const crypto_1 = require("crypto");
5150
const fast_glob_1 = __importDefault(require("fast-glob"));
52-
const fs = __importStar(require("fs/promises"));
53-
const path = __importStar(require("path"));
51+
const node_crypto_1 = require("node:crypto");
52+
const fs = __importStar(require("node:fs/promises"));
53+
const path = __importStar(require("node:path"));
5454
const rxjs_1 = require("rxjs");
5555
const utils_1 = require("../../utils");
5656
const schema_1 = require("../browser-esbuild/schema");
@@ -276,7 +276,7 @@ async function initializeApplication(options, context, karmaOptions, transforms
276276
if (transforms.webpackConfiguration) {
277277
context.logger.warn(`This build is using the application builder but transforms.webpackConfiguration was provided. The transform will be ignored.`);
278278
}
279-
const outputPath = path.join(context.workspaceRoot, 'dist/test-out', (0, crypto_1.randomUUID)());
279+
const outputPath = path.join(context.workspaceRoot, 'dist/test-out', (0, node_crypto_1.randomUUID)());
280280
const projectSourceRoot = await getProjectSourceRoot(context);
281281
const [karma, entryPoints] = await Promise.all([
282282
Promise.resolve().then(() => __importStar(require('karma'))),

src/builders/karma/browser_builder.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ var __importStar = (this && this.__importStar) || (function () {
4242
Object.defineProperty(exports, "__esModule", { value: true });
4343
exports.execute = execute;
4444
const private_1 = require("@angular/build/private");
45-
const path = __importStar(require("path"));
45+
const path = __importStar(require("node:path"));
4646
const rxjs_1 = require("rxjs");
4747
const configs_1 = require("../../tools/webpack/configs");
4848
const webpack_browser_config_1 = require("../../utils/webpack-browser-config");

src/builders/karma/find-tests-plugin.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
1111
};
1212
Object.defineProperty(exports, "__esModule", { value: true });
1313
exports.FindTestsPlugin = void 0;
14-
const assert_1 = __importDefault(require("assert"));
1514
const mini_css_extract_plugin_1 = require("mini-css-extract-plugin");
15+
const node_assert_1 = __importDefault(require("node:assert"));
1616
const find_tests_1 = require("./find-tests");
1717
/**
1818
* The name of the plugin provided to Webpack when tapping Webpack compiler hooks.
@@ -42,7 +42,7 @@ class FindTestsPlugin {
4242
entrypoint.import = [...originalImport, ...specFiles];
4343
}
4444
else {
45-
(0, assert_1.default)(this.compilation, 'Compilation cannot be undefined.');
45+
(0, node_assert_1.default)(this.compilation, 'Compilation cannot be undefined.');
4646
this.compilation
4747
.getLogger(mini_css_extract_plugin_1.pluginName)
4848
.error(`Specified patterns: "${include.join(', ')}" did not match any spec files.`);

src/builders/karma/find-tests.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
4343
exports.findTests = findTests;
4444
exports.getTestEntrypoints = getTestEntrypoints;
4545
const fast_glob_1 = __importStar(require("fast-glob"));
46-
const fs_1 = require("fs");
47-
const path_1 = require("path");
46+
const node_fs_1 = require("node:fs");
47+
const node_path_1 = require("node:path");
4848
/* Go through all patterns and find unique list of files */
4949
async function findTests(include, exclude, workspaceRoot, projectSourceRoot) {
5050
const matchingTestsPromises = include.map((pattern) => findMatchingTests(pattern, exclude, workspaceRoot, projectSourceRoot));
@@ -61,7 +61,7 @@ function getTestEntrypoints(testFiles, { projectSourceRoot, workspaceRoot }) {
6161
.replace(/^[./\\]+/, '')
6262
// Replace any path separators with dashes.
6363
.replace(/[/\\]/g, '-');
64-
const baseName = `spec-${(0, path_1.basename)(relativePath, (0, path_1.extname)(relativePath))}`;
64+
const baseName = `spec-${(0, node_path_1.basename)(relativePath, (0, node_path_1.extname)(relativePath))}`;
6565
let uniqueName = baseName;
6666
let suffix = 2;
6767
while (seen.has(uniqueName)) {
@@ -91,26 +91,26 @@ function removeRoots(path, roots) {
9191
return path.substring(root.length);
9292
}
9393
}
94-
return (0, path_1.basename)(path);
94+
return (0, node_path_1.basename)(path);
9595
}
9696
async function findMatchingTests(pattern, ignore, workspaceRoot, projectSourceRoot) {
9797
// normalize pattern, glob lib only accepts forward slashes
9898
let normalizedPattern = normalizePath(pattern);
9999
normalizedPattern = removeLeadingSlash(normalizedPattern);
100-
const relativeProjectRoot = normalizePath((0, path_1.relative)(workspaceRoot, projectSourceRoot) + '/');
100+
const relativeProjectRoot = normalizePath((0, node_path_1.relative)(workspaceRoot, projectSourceRoot) + '/');
101101
// remove relativeProjectRoot to support relative paths from root
102102
// such paths are easy to get when running scripts via IDEs
103103
normalizedPattern = removeRelativeRoot(normalizedPattern, relativeProjectRoot);
104104
// special logic when pattern does not look like a glob
105105
if (!(0, fast_glob_1.isDynamicPattern)(normalizedPattern)) {
106-
if (await isDirectory((0, path_1.join)(projectSourceRoot, normalizedPattern))) {
106+
if (await isDirectory((0, node_path_1.join)(projectSourceRoot, normalizedPattern))) {
107107
normalizedPattern = `${normalizedPattern}/**/*.spec.@(ts|tsx)`;
108108
}
109109
else {
110110
// see if matching spec file exists
111-
const fileExt = (0, path_1.extname)(normalizedPattern);
111+
const fileExt = (0, node_path_1.extname)(normalizedPattern);
112112
// Replace extension to `.spec.ext`. Example: `src/app/app.component.ts`-> `src/app/app.component.spec.ts`
113-
const potentialSpec = (0, path_1.join)(projectSourceRoot, (0, path_1.dirname)(normalizedPattern), `${(0, path_1.basename)(normalizedPattern, fileExt)}.spec${fileExt}`);
113+
const potentialSpec = (0, node_path_1.join)(projectSourceRoot, (0, node_path_1.dirname)(normalizedPattern), `${(0, node_path_1.basename)(normalizedPattern, fileExt)}.spec${fileExt}`);
114114
if (await exists(potentialSpec)) {
115115
return [potentialSpec];
116116
}
@@ -126,7 +126,7 @@ async function findMatchingTests(pattern, ignore, workspaceRoot, projectSourceRo
126126
}
127127
async function isDirectory(path) {
128128
try {
129-
const stats = await fs_1.promises.stat(path);
129+
const stats = await node_fs_1.promises.stat(path);
130130
return stats.isDirectory();
131131
}
132132
catch {
@@ -135,7 +135,7 @@ async function isDirectory(path) {
135135
}
136136
async function exists(path) {
137137
try {
138-
await fs_1.promises.access(path, fs_1.constants.F_OK);
138+
await node_fs_1.promises.access(path, node_fs_1.constants.F_OK);
139139
return true;
140140
}
141141
catch {

src/builders/karma/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ exports.execute = execute;
4444
const private_1 = require("@angular/build/private");
4545
const architect_1 = require("@angular-devkit/architect");
4646
const core_1 = require("@angular-devkit/core");
47-
const module_1 = require("module");
48-
const path = __importStar(require("path"));
47+
const node_module_1 = require("node:module");
48+
const path = __importStar(require("node:path"));
4949
const rxjs_1 = require("rxjs");
5050
const schema_1 = require("./schema");
5151
/**
@@ -101,7 +101,7 @@ function getBuiltInKarmaConfig(workspaceRoot, projectName, useEsbuild) {
101101
if (/[A-Z]/.test(coverageFolderName)) {
102102
coverageFolderName = core_1.strings.dasherize(coverageFolderName);
103103
}
104-
const workspaceRootRequire = (0, module_1.createRequire)(workspaceRoot + '/');
104+
const workspaceRootRequire = (0, node_module_1.createRequire)(workspaceRoot + '/');
105105
// Any changes to the config here need to be synced to: packages/schematics/angular/config/files/karma.conf.js.template
106106
return {
107107
basePath: '',

src/builders/prerender/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
4646
exports.execute = execute;
4747
const private_1 = require("@angular/build/private");
4848
const architect_1 = require("@angular-devkit/architect");
49-
const fs = __importStar(require("fs"));
49+
const fs = __importStar(require("node:fs"));
5050
const promises_1 = require("node:fs/promises");
51+
const path = __importStar(require("node:path"));
5152
const ora_1 = __importDefault(require("ora"));
52-
const path = __importStar(require("path"));
5353
const piscina_1 = __importDefault(require("piscina"));
5454
const utils_1 = require("../../utils");
5555
const environment_options_1 = require("../../utils/environment-options");

src/builders/protractor/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
4343
exports.execute = execute;
4444
const architect_1 = require("@angular-devkit/architect");
4545
const core_1 = require("@angular-devkit/core");
46-
const path_1 = require("path");
47-
const url = __importStar(require("url"));
46+
const node_path_1 = require("node:path");
47+
const url = __importStar(require("node:url"));
4848
const utils_1 = require("../../utils");
4949
const error_1 = require("../../utils/error");
5050
function runProtractor(root, options) {
@@ -61,7 +61,7 @@ function runProtractor(root, options) {
6161
// process. To work around this we run it in a subprocess.
6262
// https://github.com/angular/protractor/issues/4160
6363
return (0, utils_1.runModuleAsObservableFork)(root, 'protractor/built/launcher', 'init', [
64-
(0, path_1.resolve)(root, options.protractorConfig),
64+
(0, node_path_1.resolve)(root, options.protractorConfig),
6565
additionalProtractorConfig,
6666
]).toPromise();
6767
}

src/builders/ssr-dev-server/index.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ exports.log = log;
4545
const private_1 = require("@angular/build/private");
4646
const architect_1 = require("@angular-devkit/architect");
4747
const core_1 = require("@angular-devkit/core");
48-
const path_1 = require("path");
48+
const node_path_1 = require("node:path");
49+
const url = __importStar(require("node:url"));
4950
const rxjs_1 = require("rxjs");
50-
const url = __importStar(require("url"));
5151
const utils_1 = require("./utils");
5252
/** Log messages to ignore and not rely to the logger */
5353
const IGNORED_STDOUT_MESSAGES = [
@@ -166,7 +166,7 @@ function log({ stderr, stdout }, logger) {
166166
}
167167
function startNodeServer(serverOutput, port, logger, inspectMode = false) {
168168
const outputPath = serverOutput.outputPath;
169-
const path = (0, path_1.join)(outputPath, 'main.js');
169+
const path = (0, node_path_1.join)(outputPath, 'main.js');
170170
const env = { ...process.env, PORT: '' + port };
171171
const args = ['--enable-source-maps', `"${path}"`];
172172
if (inspectMode) {
@@ -290,8 +290,8 @@ function getSslConfig(root, options) {
290290
const { ssl, sslCert, sslKey } = options;
291291
if (ssl && sslCert && sslKey) {
292292
return {
293-
key: (0, path_1.resolve)(root, sslKey),
294-
cert: (0, path_1.resolve)(root, sslCert),
293+
key: (0, node_path_1.resolve)(root, sslKey),
294+
cert: (0, node_path_1.resolve)(root, sslCert),
295295
};
296296
}
297297
return ssl;

src/builders/ssr-dev-server/utils.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Use of this source code is governed by an MIT-style license that can be
66
* found in the LICENSE file at https://angular.dev/license
77
*/
8-
import { SpawnOptions } from 'child_process';
8+
import { SpawnOptions } from 'node:child_process';
99
import { Observable } from 'rxjs';
1010
export declare function getAvailablePort(): Promise<number>;
1111
export declare function spawnAsObservable(command: string, args?: string[], options?: SpawnOptions): Observable<{

src/builders/ssr-dev-server/utils.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
1313
exports.getAvailablePort = getAvailablePort;
1414
exports.spawnAsObservable = spawnAsObservable;
1515
exports.waitUntilServerIsListening = waitUntilServerIsListening;
16-
const child_process_1 = require("child_process");
17-
const net_1 = require("net");
16+
const node_child_process_1 = require("node:child_process");
17+
const node_net_1 = require("node:net");
1818
const rxjs_1 = require("rxjs");
1919
const tree_kill_1 = __importDefault(require("tree-kill"));
2020
function getAvailablePort() {
2121
return new Promise((resolve, reject) => {
22-
const server = (0, net_1.createServer)();
22+
const server = (0, node_net_1.createServer)();
2323
server
2424
.unref()
2525
.on('error', reject)
@@ -31,7 +31,7 @@ function getAvailablePort() {
3131
}
3232
function spawnAsObservable(command, args = [], options = {}) {
3333
return new rxjs_1.Observable((obs) => {
34-
const proc = (0, child_process_1.spawn)(command, args, options);
34+
const proc = (0, node_child_process_1.spawn)(command, args, options);
3535
if (proc.stdout) {
3636
proc.stdout.on('data', (data) => obs.next({ stdout: data.toString() }));
3737
}
@@ -56,7 +56,7 @@ function spawnAsObservable(command, args = [], options = {}) {
5656
function waitUntilServerIsListening(port, host) {
5757
const allowedErrorCodes = ['ECONNREFUSED', 'ECONNRESET'];
5858
return new rxjs_1.Observable((obs) => {
59-
const client = (0, net_1.createConnection)({ host, port }, () => {
59+
const client = (0, node_net_1.createConnection)({ host, port }, () => {
6060
obs.next(undefined);
6161
obs.complete();
6262
}).on('error', (err) => obs.error(err));

src/tools/webpack/configs/common.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
4646
exports.getCommonConfig = getCommonConfig;
4747
const webpack_1 = require("@ngtools/webpack");
4848
const copy_webpack_plugin_1 = __importDefault(require("copy-webpack-plugin"));
49-
const path = __importStar(require("path"));
49+
const path = __importStar(require("node:path"));
5050
const webpack_2 = require("webpack");
5151
const webpack_subresource_integrity_1 = require("webpack-subresource-integrity");
5252
const environment_options_1 = require("../../../utils/environment-options");

0 commit comments

Comments
 (0)