Skip to content

Commit cd4022c

Browse files
committed
refactor: use node: protocol for remaining Node.js built-in imports
Update remaining bare Node.js built-in module imports across packages to use the node: protocol.
1 parent 1529cb0 commit cd4022c

9 files changed

Lines changed: 9 additions & 10 deletions

File tree

‎packages/angular/build/src/builders/dev-server/tests/options/proxy-config_spec.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ async function createProxyServer(body = 'TEST_API_RETURN') {
402402
await new Promise<void>((resolve) => proxyServer.listen(0, '127.0.0.1', resolve));
403403

404404
return {
405-
address: proxyServer.address() as import('net').AddressInfo,
405+
address: proxyServer.address() as import('node:net').AddressInfo,
406406
close: () => new Promise<void>((resolve) => proxyServer.close(() => resolve())),
407407
};
408408
}

‎packages/angular/cli/bin/ng.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/* eslint-disable import/no-unassigned-import */
1212
'use strict';
1313

14-
const path = require('path');
14+
const path = require('node:path');
1515
const nodeUtils = require('./version');
1616

1717
// Error if the external CLI appears to be used inside a google3 context.

‎packages/angular/cli/src/commands/mcp/devserver.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.dev/license
77
*/
88

9-
import type { ChildProcess } from 'child_process';
9+
import type { ChildProcess } from 'node:child_process';
1010
import { type Host, processStreamLines } from './host';
1111

1212
// Log messages that we want to catch to identify the build status.

‎packages/angular/cli/src/commands/mcp/host.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@
1313
* test-specific implementations.
1414
*/
1515

16-
import { existsSync as nodeExistsSync } from 'fs';
1716
import { ChildProcess, spawn } from 'node:child_process';
18-
import { Stats, realpathSync } from 'node:fs';
17+
import { Stats, existsSync as nodeExistsSync, realpathSync } from 'node:fs';
1918
import { glob as nodeGlob, readFile as nodeReadFile, stat } from 'node:fs/promises';
2019
import { createRequire } from 'node:module';
2120
import { createServer } from 'node:net';

‎packages/angular/cli/src/commands/mcp/tools/devserver/devserver_spec.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
* found in the LICENSE file at https://angular.dev/license
77
*/
88

9-
import { EventEmitter } from 'events';
109
import type { ChildProcess } from 'node:child_process';
10+
import { EventEmitter } from 'node:events';
1111
import type { MockHost } from '../../testing/mock-host';
1212
import {
1313
MockMcpToolContext,

‎packages/angular/cli/src/commands/update/cli_spec.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import assert from 'node:assert';
1010
import { mkdir, mkdtemp, rm, writeFile } from 'node:fs/promises';
11-
import path from 'path';
11+
import path from 'node:path';
1212
import { resolveFallbackMigrations } from './cli';
1313
import type { PackageVersionInfo, UpdatePlan } from './update-resolver';
1414

‎packages/angular_devkit/build_angular/src/builders/dev-server/tests/options/proxy-config_spec.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ async function createProxyServer() {
267267
await new Promise<void>((resolve) => proxyServer.listen(0, '127.0.0.1', resolve));
268268

269269
return {
270-
address: proxyServer.address() as import('net').AddressInfo,
270+
address: proxyServer.address() as import('node:net').AddressInfo,
271271
close: () => new Promise<void>((resolve) => proxyServer.close(() => resolve())),
272272
};
273273
}

‎packages/angular_devkit/build_angular/src/builders/ssr-dev-server/specs/proxy_spec.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ describe('Serve SSR Builder - Proxy', () => {
9191

9292
try {
9393
await new Promise<void>((resolve) => proxyServer.listen(0, '127.0.0.1', resolve));
94-
const proxyAddress = proxyServer.address() as import('net').AddressInfo;
94+
const proxyAddress = proxyServer.address() as import('node:net').AddressInfo;
9595

9696
host.writeMultipleFiles({
9797
'proxy.config.json': `{ "/api/*": { "logLevel": "debug","target": "http://127.0.0.1:${proxyAddress.port}" } }`,

‎packages/schematics/angular/migrations/migrate-karma-to-vitest/migration.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import type { json } from '@angular-devkit/core';
1010
import { Rule, SchematicContext, Tree, chain } from '@angular-devkit/schematics';
1111
import { join } from 'node:path/posix';
12-
import { isDeepStrictEqual } from 'util';
12+
import { isDeepStrictEqual } from 'node:util';
1313
import { DependencyType, ExistingBehavior, addDependency } from '../../utility/dependency';
1414
import { JSONFile } from '../../utility/json-file';
1515
import { latestVersions } from '../../utility/latest-versions';

0 commit comments

Comments
 (0)