Skip to content

Commit ce4e1e5

Browse files
MeAkibdgp1130
authored andcommitted
refactor(@angular/cli): remove unused code and exports
Remove the `findWorkspaceFile` utility in `utilities/project.ts`, which has been unreferenced since the global configuration handling refactor in 746d0c5, and remove the `export` keyword from eleven symbols that are only referenced within their defining file. None of these are public API: the package declares no `exports` field and has no public API golden.
1 parent af423fd commit ce4e1e5

9 files changed

Lines changed: 11 additions & 67 deletions

File tree

‎packages/angular/cli/src/analytics/analytics.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { isTTY } from '../utilities/tty';
2020
/**
2121
* This is the ultimate safelist for checking if a package name is safe to report to analytics.
2222
*/
23-
export const analyticsPackageSafelist = [
23+
const analyticsPackageSafelist = [
2424
/^@angular\//,
2525
/^@angular-devkit\//,
2626
/^@nguniversal\//,

‎packages/angular/cli/src/commands/mcp/mcp-server.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ const STABLE_TOOLS = [
4848
* The set of tools that are available but not enabled by default.
4949
* These tools are considered experimental and may have limitations.
5050
*/
51-
export const EXPERIMENTAL_TOOLS: readonly AnyMcpToolDeclaration[] = [] as const;
51+
const EXPERIMENTAL_TOOLS: readonly AnyMcpToolDeclaration[] = [] as const;
5252

5353
/**
5454
* Experimental tools that are grouped together under a single name.
5555
*
5656
* Used for enabling them as a group.
5757
*/
58-
export const EXPERIMENTAL_TOOL_GROUPS: Record<string, readonly AnyMcpToolDeclaration[]> = {
58+
const EXPERIMENTAL_TOOL_GROUPS: Record<string, readonly AnyMcpToolDeclaration[]> = {
5959
'all': EXPERIMENTAL_TOOLS,
6060
'devserver': [],
6161
};
@@ -176,7 +176,7 @@ for equivalent actions.
176176
return server;
177177
}
178178

179-
export function assembleToolDeclarations(
179+
function assembleToolDeclarations(
180180
stableDeclarations: readonly AnyMcpToolDeclaration[],
181181
experimentalDeclarations: readonly AnyMcpToolDeclaration[],
182182
options: {

‎packages/angular/cli/src/commands/mcp/tools/onpush-zoneless-migration/analyze-for-unsupported-zone-uses.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export async function analyzeForUnsupportedZoneUses(
3939
* @param ngZoneImport The import specifier for `NgZone`.
4040
* @returns A list of nodes that are unsupported `NgZone` usages.
4141
*/
42-
export async function findUnsupportedZoneUsages(
42+
async function findUnsupportedZoneUsages(
4343
sourceFile: SourceFile,
4444
ngZoneImport: ImportSpecifier,
4545
): Promise<Node[]> {

‎packages/angular/cli/src/commands/mcp/tools/onpush-zoneless-migration/migrate-test-file.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export async function migrateTestFile(
4444
return createFixResponseForZoneTests(sourceFile);
4545
}
4646

47-
export async function searchForGlobalZoneless(startPath: string, host: Host): Promise<boolean> {
47+
async function searchForGlobalZoneless(startPath: string, host: Host): Promise<boolean> {
4848
const angularJsonDir = findAngularJsonDir(startPath, host);
4949
if (!angularJsonDir) {
5050
// Cannot determine project root, fallback to original behavior or assume false.

‎packages/angular/cli/src/commands/mcp/tools/onpush-zoneless-migration/ts-utils.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ function getImportSpecifiers(
104104
* @param nodes Array of import specifiers to search through.
105105
* @param specifierName Name of the specifier to look for.
106106
*/
107-
export function findImportSpecifier(
107+
function findImportSpecifier(
108108
nodes: ts.NodeArray<ts.ImportSpecifier>,
109109
specifierName: string,
110110
): ts.ImportSpecifier | undefined {

‎packages/angular/cli/src/commands/update/update-resolver.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ function isReleaseAgeSatisfied(
9191
return Date.now() - publishTime >= minReleaseAge;
9292
}
9393

94-
export async function getSatisfyingVersion(
94+
async function getSatisfyingVersion(
9595
registryClient: RegistryClient,
9696
metadata: PackageMetadata,
9797
range: string,
@@ -368,7 +368,7 @@ function _getUpdateMetadata(
368368
return result;
369369
}
370370

371-
export function isPnpActive(workspaceRoot: string): boolean {
371+
function isPnpActive(workspaceRoot: string): boolean {
372372
return (
373373
process.versions.pnp !== undefined ||
374374
existsSync(path.join(workspaceRoot, '.pnp.cjs')) ||

‎packages/angular/cli/src/commands/update/utilities/cli-version.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export async function checkCLIVersion(
7979
* @param next Whether to use the next version.
8080
* @returns The version or tag to use for the CLI update runner.
8181
*/
82-
export function getCLIUpdateRunnerVersion(
82+
function getCLIUpdateRunnerVersion(
8383
packagesToUpdate: string[] | undefined,
8484
next: boolean,
8585
): string | number {

‎packages/angular/cli/src/utilities/config.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const currentDirectory = import.meta.dirname;
5252
// In bundled ESM output, files are located in `lib/` directly adjacent to `config/schema.json`
5353
// whereas in unbundled development/tests, `config.js` is in `src/utilities/`.
5454
const bundledSchemaPath = path.join(currentDirectory, 'config/schema.json');
55-
export const workspaceSchemaPath = existsSync(bundledSchemaPath)
55+
const workspaceSchemaPath = existsSync(bundledSchemaPath)
5656
? bundledSchemaPath
5757
: path.join(currentDirectory, '../../lib/config/schema.json');
5858

‎packages/angular/cli/src/utilities/project.ts‎

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)