Skip to content

Conversation

clydin
Copy link
Member

@clydin clydin commented Sep 25, 2025

Introduces a new abstraction layer for interacting with JavaScript package managers. This change centralizes all package-manager-specific logic into a single, reliable, and extensible interface. The primary motivation is to standardize package manager interactions for commands like ng add and ng update.

The new system is designed to be highly testable. All side-effectful operations (file system access, command execution) are abstracted behind a Host interface, allowing for comprehensive and reliable unit testing in complete isolation.

Key features include:

  • An improved package manager discovery process especially in monorepo scenarios.
  • A high-level API to install, add, and query packages from a registry.
  • Methods to fetch full package metadata and specific version manifests.
  • An acquireTempPackage method to support temporary, isolated package installations.

This abstraction paves the way for the eventual removal of several direct package dependencies, including ini, @yarnpkg/lockfile, and pacote.

@clydin clydin added the target: major This PR is targeted for the next major release label Sep 25, 2025
@clydin clydin marked this pull request as ready for review September 25, 2025 13:41
@clydin clydin force-pushed the cli/package-managers branch 2 times, most recently from 24e3f40 to 5d91591 Compare September 25, 2025 14:00
Introduces a new abstraction layer for interacting with JavaScript package managers.
This change centralizes all package-manager-specific logic into a single, reliable,
and extensible interface. The primary motivation is to standardize package manager
interactions for commands like `ng add` and `ng update`.

The new system is designed to be highly testable. All side-effectful operations
(file system access, command execution) are abstracted behind a `Host` interface,
allowing for comprehensive and reliable unit testing in complete isolation.

Key features include:
- An improved package manager discovery process especially in monorepo scenarios.
- A high-level API to install, add, and query packages from a registry.
- Methods to fetch full package metadata and specific version manifests.
- An `acquireTempPackage` method to support temporary, isolated package installations.

This abstraction paves the way for the eventual removal of several direct package
dependencies, including `ini`, `@yarnpkg/lockfile`, and `pacote`.
@clydin clydin force-pushed the cli/package-managers branch from 5d91591 to be37e8e Compare September 25, 2025 14:07
@clydin clydin added the action: merge The PR is ready for merge by the caretaker label Sep 25, 2025
@clydin clydin merged commit b69d85b into angular:main Sep 25, 2025
32 checks passed
@clydin clydin deleted the cli/package-managers branch September 25, 2025 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: @angular/cli target: major This PR is targeted for the next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants