Skip to content

Commit e6b62a1

Browse files
committed
refactor(@angular/cli): remove unused package-tree utilities
This commit removes the unused `package-tree.ts` utilities, including `getProjectDependencies`, `readPackageJson`, and `PackageTreeNode`. The `findPackageJson` function, which was the only remaining used part, has been moved directly into `commands/update/cli.ts` where it is consumed.
1 parent 2f0599a commit e6b62a1

File tree

2 files changed

+11
-87
lines changed

2 files changed

+11
-87
lines changed

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import {
2929
import { colors } from '../../utilities/color';
3030
import { disableVersionCheck } from '../../utilities/environment-options';
3131
import { assertIsError } from '../../utilities/error';
32-
import { findPackageJson } from '../../utilities/package-tree';
3332
import {
3433
checkCLIVersion,
3534
coerceVersionNumber,
@@ -697,3 +696,14 @@ async function readPackageManifest(manifestPath: string): Promise<PackageManifes
697696
return undefined;
698697
}
699698
}
699+
700+
function findPackageJson(workspaceDir: string, packageName: string): string | undefined {
701+
try {
702+
const projectRequire = createRequire(path.join(workspaceDir, 'package.json'));
703+
const packageJsonPath = projectRequire.resolve(`${packageName}/package.json`);
704+
705+
return packageJsonPath;
706+
} catch {
707+
return undefined;
708+
}
709+
}

packages/angular/cli/src/utilities/package-tree.ts

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

0 commit comments

Comments
 (0)