fix(@angular/cli): discover migrations and schematics from installed packages when omitted by registry metadata - #33718
Closed
alan-agius4 wants to merge 3 commits into
Conversation
alan-agius4
force-pushed
the
fix-update-github-packages-migrations-fallback
branch
from
July 31, 2026 13:31
f2f94fc to
5942e69
Compare
alan-agius4
marked this pull request as ready for review
July 31, 2026 13:38
There was a problem hiding this comment.
Code Review
This pull request refactors the ng add command to streamline package installation and cleanup, and introduces a fallback mechanism in the ng update command to resolve migrations from installed package.json files when they are omitted from the update plan. Feedback on the changes highlights an inefficient install-uninstall-reinstall cycle for built-in schematics during cleanup, suggesting that we avoid cleaning up temporary dependencies if they are part of BUILT_IN_SCHEMATICS.
alan-agius4
force-pushed
the
fix-update-github-packages-migrations-fallback
branch
3 times, most recently
from
July 31, 2026 13:52
930915a to
a6b9487
Compare
…mitted by registry metadata Private package registries such as GitHub Packages frequently strip out custom non-npm metadata properties (e.g., ng-update or schematics) from their remote API responses. Previously, this caused ng update to skip migration execution during updates from those registries, even though ng update --migrate-only worked correctly. This commit adds a post-installation disk-fallback check in ng update: for any updated packages that were not scheduled for migrations from registry metadata, the CLI inspects node_modules/<package>/package.json on disk after installation. If an ng-update.migrations collection is found, it is automatically added to the migration queue and executed. Closes angular#33717
…nifest on disk for schematics Private package registries such as GitHub Packages frequently strip out custom non-npm metadata properties (such as schematics and ng-add) from their remote API responses. Previously, ng add skipped confirming and installing a package if the registry metadata did not report hasSchematics, causing ng add to fail on first run. This commit removes the early skip condition based on registry metadata so ng add always installs the target package to inspect its physical manifest on disk. If no schematics are found after installation, the CLI cleanly removes the temporary dependency. Closes angular#33060
alan-agius4
force-pushed
the
fix-update-github-packages-migrations-fallback
branch
from
July 31, 2026 14:09
a6b9487 to
c957ded
Compare
dgp1130
approved these changes
Jul 31, 2026
alan-agius4
added a commit
to alan-agius4/angular-cli
that referenced
this pull request
Jul 31, 2026
- 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
alan-agius4
force-pushed
the
fix-update-github-packages-migrations-fallback
branch
from
July 31, 2026 17:32
853624e to
8f5c175
Compare
… when omitted by registry metadata TAG=agy CONV=b92ba928-67b0-4f4b-a79a-ce19e5098641
alan-agius4
force-pushed
the
fix-update-github-packages-migrations-fallback
branch
from
July 31, 2026 17:51
8f5c175 to
78a2b68
Compare
Collaborator
Author
alan-agius4
added a commit
that referenced
this pull request
Jul 31, 2026
…mitted by registry metadata (#33718) Private package registries such as GitHub Packages frequently strip out custom non-npm metadata properties (e.g., ng-update or schematics) from their remote API responses. Previously, this caused ng update to skip migration execution during updates from those registries, even though ng update --migrate-only worked correctly. This commit adds a post-installation disk-fallback check in ng update: for any updated packages that were not scheduled for migrations from registry metadata, the CLI inspects node_modules/<package>/package.json on disk after installation. If an ng-update.migrations collection is found, it is automatically added to the migration queue and executed. Closes #33717 PR Close #33718
alan-agius4
added a commit
that referenced
this pull request
Jul 31, 2026
…nifest on disk for schematics (#33718) Private package registries such as GitHub Packages frequently strip out custom non-npm metadata properties (such as schematics and ng-add) from their remote API responses. Previously, ng add skipped confirming and installing a package if the registry metadata did not report hasSchematics, causing ng add to fail on first run. This commit removes the early skip condition based on registry metadata so ng add always installs the target package to inspect its physical manifest on disk. If no schematics are found after installation, the CLI cleanly removes the temporary dependency. Closes #33060 PR Close #33718
alan-agius4
added a commit
that referenced
this pull request
Jul 31, 2026
…nifest on disk for schematics (#33718) Private package registries such as GitHub Packages frequently strip out custom non-npm metadata properties (such as schematics and ng-add) from their remote API responses. Previously, ng add skipped confirming and installing a package if the registry metadata did not report hasSchematics, causing ng add to fail on first run. This commit removes the early skip condition based on registry metadata so ng add always installs the target package to inspect its physical manifest on disk. If no schematics are found after installation, the CLI cleanly removes the temporary dependency. Closes #33060 PR Close #33718
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR resolves issues where private package registries (such as GitHub Packages) strip custom non-npm metadata properties (
ng-updateandschematics) from their remote registry API responses.1.
ng update(#33717)ng update(packages/angular/cli/src/commands/update/cli.ts).node_modules/<package>/package.jsonon disk after installation.ng-update.migrationscollection is found, it is automatically queued and executed.ng updatedoes not execute migrations for GitHub Packages packages although--migrate-onlyworks and migration exists in build #337172.
ng add(#33060)skipcondition based on registry metadata song addalways installs the target package to inspect its physical manifest on disk (packages/angular/cli/src/commands/add/cli.ts).