-
Notifications
You must be signed in to change notification settings - Fork 12k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(@angular/cli): show optional migrations during update process
When running `ng update` we now display optional migrations from packages. When the terminal is interactive, we prompt the users and ask them to choose which migrations they would like to run. ``` $ ng update @angular/core --from=14 --migrate-only --allow-dirty Using package manager: yarn Collecting installed dependencies... Found 22 dependencies. ** Executing migrations of package '@angular/core' ** ▸ Since Angular v15, the `RouterLink` contains the logic of the `RouterLinkWithHref` directive. This migration replaces all `RouterLinkWithHref` references with `RouterLink`. Migration completed (No changes made). ** Optional migrations of package '@angular/core' ** This package have 2 optional migrations that can be executed. Select the migrations that you'd like to run (Press <space> to select, <a> to toggle all, <i> to invert selection, and <enter> to proceed) ❯◯ Update server builds to use generate ESM output. ◯ Lorem ipsum dolor sit amet, consectetur adipiscing elit. ``` In case the terminal is non interactive, we will print the commands that need to be executed to run the optional migrations. ``` $ ng update @angular/core --from=14 --migrate-only --allow-dirty Using package manager: yarn Collecting installed dependencies... Found 22 dependencies. ** Executing migrations of package '@angular/core' ** ▸ Since Angular v15, the `RouterLink` contains the logic of the `RouterLinkWithHref` directive. This migration replaces all `RouterLinkWithHref` references with `RouterLink`. Migration completed (No changes made). ** Optional migrations of package '@angular/core' ** This package have 2 optional migrations that can be executed. ▸ Update server builds to use generate ESM output. ng update @angular/core --migration-only --name esm-server-builds ▸ Lorem ipsum dolor sit amet, consectetur adipiscing elit. ng update @angular/core --migration-only --name migration-v15-router-link-with-href ``` **Note:** Optional migrations are defined by setting the `optional` property to `true`. Example: ```json { "schematics": { "esm-server-builds": { "version": "15.0.0", "description": "Update server builds to use generate ESM output", "factory": "./migrations/relative-link-resolution/bundle", "optional": true } } ``` Closes #23205
- Loading branch information
1 parent
f2cba37
commit 7cb5689
Showing
2 changed files
with
162 additions
and
24 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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