Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion packages/angular/cli/src/package-managers/package-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -878,6 +878,8 @@ export class PackageManager {
* resolutions which cannot be resolved in a standalone folder.
* 2. Rewrites the `packages:` block to include only the current directory (`'.'`),
* isolating the temporary installation from other projects in the monorepo.
* 3. Removes any `patchedDependencies`, as patches are relative paths and
* should not apply to the temporary install.
*
* All other settings (such as `minimumReleaseAge`, package extensions, etc.)
* are preserved intact.
Expand Down Expand Up @@ -910,7 +912,11 @@ function sanitizePnpmWorkspace(content: string): string {
}

// Identify blocks we want to remove or customize (e.g. 'overrides' or 'packages').
if (trimmed.startsWith('overrides:') || trimmed.startsWith('packages:')) {
if (
trimmed.startsWith('overrides:') ||
trimmed.startsWith('packages:') ||
trimmed.startsWith('patchedDependencies:')
) {
inBlockToRemove = true;
blockIndent = indent;
if (trimmed.startsWith('packages:')) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,9 @@ describe('PackageManager', () => {
' vitest:',
' peerDependencies:',
" '@vitest/coverage-v8': '*'",
'patchedDependencies:',
' old-package: patches/old-package.patch',
" '@scoped/package': other-path/@scoped__package.patch",
].join('\n');
const readFileSpy = spyOn(testHost, 'readFile').and.resolveTo(mockWorkspaceContent);
const writeFileSpy = spyOn(testHost, 'writeFile').and.resolveTo();
Expand Down
Loading