Skip to content

Commit 853624e

Browse files
committed
fix(@angular/cli): address reviewer feedback for PR #33718
- Add JSDoc to `resolveFallbackMigrations` in `ng update` documenting why the post-installation disk check is needed for fallback migrations (private registries like GitHub Packages stripping custom non-npm metadata). - Avoid cleaning up temporary dependencies during `ng add` if they are part of `BUILT_IN_SCHEMATICS`, preventing an inefficient install-uninstall-reinstall cycle. TAG=agy CONV=b92ba928-67b0-4f4b-a79a-ce19e5098641
1 parent c957ded commit 853624e

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ export default class AddCommandModule
261261
if (localManifest['ng-add']?.save === false) {
262262
shouldCleanUp = true;
263263
}
264-
} else {
264+
} else if (!Object.hasOwn(BUILT_IN_SCHEMATICS, result.collectionName)) {
265265
await this.cleanUpTemporaryDependency(result.collectionName);
266266
shouldCleanUp = false;
267267
}

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,15 @@ async function readPackageManifest(manifestPath: string): Promise<PackageManifes
707707
}
708708
}
709709

710+
/**
711+
* Resolves migrations from installed package manifests on disk when they were omitted
712+
* from the initial update plan.
713+
*
714+
* This fallback is necessary because private package registries (such as GitHub Packages)
715+
* frequently strip custom non-npm metadata properties (like `ng-update`) from their remote
716+
* registry API responses. By inspecting `node_modules/<package>/package.json` after installation,
717+
* we ensure that any migration collections defined by the package are discovered and queued.
718+
*/
710719
export async function resolveFallbackMigrations(
711720
workspaceRoot: string,
712721
plan: UpdatePlan,

0 commit comments

Comments
 (0)