feat(@angular/cli): show optional migrations during update process#24825
Merged
angular-robot[bot] merged 1 commit intoangular:mainfrom Mar 8, 2023
Merged
feat(@angular/cli): show optional migrations during update process#24825angular-robot[bot] merged 1 commit intoangular:mainfrom
angular-robot[bot] merged 1 commit intoangular:mainfrom
Conversation
2513389 to
0e1bfce
Compare
clydin
approved these changes
Mar 8, 2023
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 angular#23205
0e1bfce to
46d5385
Compare
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
When running
ng updatewe 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.
In case the terminal is non interactive, we will print the commands that need to be executed to run the optional migrations.
Note: Optional migrations are defined by setting the
optionalproperty totrue. Example:{ "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