Skip to content

Conversation

@clydin
Copy link
Member

@clydin clydin commented Jan 9, 2026

The 'ng add' command now attempts to use '.angular/cache' or 'node_modules' as the base for temporary directories when acquiring packages. This ensures that the package manager can inherit project-specific configuration (like '.npmrc' or '.yarnrc') during the installation of temporary packages.

… manager abstraction

This change introduces the ability to specify a base temporary directory when creating a `PackageManager` instance. This allows for creating temporary directories within the project structure (e.g., `node_modules/.tmp`), which enables package managers to correctly inherit project-specific configurations like `.npmrc` or `.yarnrc` during operations like `acquireTempPackage`.
@clydin clydin force-pushed the package-managers/temp-package-dir branch 9 times, most recently from d89b476 to f1c95a4 Compare January 9, 2026 20:27
@clydin clydin marked this pull request as ready for review January 12, 2026 15:07
@alan-agius4 alan-agius4 added target: rc This PR is targeted for the next release-candidate action: merge The PR is ready for merge by the caretaker labels Jan 12, 2026
The 'ng add' command now attempts to use '.angular/cache' or 'node_modules' as the base for temporary directories when acquiring packages. This ensures that the package manager can inherit project-specific configuration (like '.npmrc' or '.yarnrc') during the installation of temporary packages.

The implementation uses a fallback strategy, checking for candidate directories and defaulting to the system's temporary directory if none are found.
…on in ng add

This change enhances the error handling in the 'ng add' command's 'installPackageTask'. It now specifically catches 'PackageManagerError' exceptions and surfaces the standard output or standard error from the underlying package manager process. This provides users with more actionable information when a package installation fails.
…directory

This change adds support for copying package manager configuration files (like `bunfig.toml`) from the project root to the temporary directory used for acquiring packages. This is particularly necessary for Bun, which does not automatically inherit configuration from parent directories when running in a separate temporary location.
@clydin clydin force-pushed the package-managers/temp-package-dir branch from da53acc to 30dafa2 Compare January 12, 2026 18:06
@clydin clydin merged commit d58c714 into angular:main Jan 12, 2026
34 checks passed
@clydin
Copy link
Member Author

clydin commented Jan 12, 2026

This PR was merged into the repository. The changes were merged into the following branches:

@clydin clydin deleted the package-managers/temp-package-dir branch January 12, 2026 19:40
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: rc This PR is targeted for the next release-candidate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants