angular-cli
angular-cli copied to clipboard
fix(@angular/cli): fix ng update for Yarn Pnp
Extend findPackageJson function to also work when using Yarn PnP
Fixes #26505
PR Checklist
Please check to confirm your PR fulfills the following requirements:
- [x] The commit message follows our guidelines: https://github.com/angular/angular-cli/blob/main/CONTRIBUTING.md#-commit-message-guidelines
- [ ] Tests for the changes have been added (for bug fixes / features)
- [ ] Docs have been added / updated (for bug fixes / features)
PR Type
What kind of change does this PR introduce?
- [x] Bugfix
- [ ] Feature
- [ ] Code style update (formatting, local variables)
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [ ] CI related changes
- [ ] Documentation content changes
- [ ] Other... Please describe:
What is the current behavior?
When trying to run ng update in a porject that uses Yarn PnP the cli does not detect the project dependencies because it cannot resolve the package.json paths.
Issue Number: 26505
What is the new behavior?
The cli resolves the package.json paths through .pnp.js when the project is using Yarn PnP.
Does this PR introduce a breaking change?
- [ ] Yes
- [x] No
Other information
Not sure if this is a desired solution.
Thank you for the contribution. It appears that Yarn PnP has an API available (https://yarnpkg.com/advanced/pnpapi). Would you be interested in converting this PR to use that?
@clydin Will do!