Skip to content

Commit

Permalink
fix(@angular/cli): recommend optional application update migration du…
Browse files Browse the repository at this point in the history
…ring v19 update

The optional application builder migration will now default to enabled and
recommended during the update process (`ng update`) for v19. The migration
is still optional and can be unselected if preferred when updating.

(cherry picked from commit 7c6cb95)
  • Loading branch information
clydin committed Nov 1, 2024
1 parent 834c8d7 commit b847d44
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/angular/cli/src/commands/update/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ interface MigrationSchematicDescription
extends SchematicDescription<FileSystemCollectionDescription, FileSystemSchematicDescription> {
version?: string;
optional?: boolean;
recommended?: boolean;
documentation?: string;
}

Expand Down Expand Up @@ -1138,6 +1139,7 @@ export default class UpdateCommandModule extends CommandModule<UpdateCommandArgs
return {
name: `[${colors.white(migration.name)}] ${title}${documentation ? ` (${documentation})` : ''}`,
value: migration.name,
checked: migration.recommended,
};
}),
null,
Expand Down
2 changes: 1 addition & 1 deletion packages/angular/cli/src/utilities/prompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export async function askQuestion(

export async function askChoices(
message: string,
choices: { name: string; value: string }[],
choices: { name: string; value: string; checked?: boolean }[],
noTTYResponse: string[] | null,
): Promise<string[] | null> {
if (!isTTY()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"factory": "./use-application-builder/migration",
"description": "Migrate application projects to the new build system. Application projects that are using the '@angular-devkit/build-angular' package's 'browser' and/or 'browser-esbuild' builders will be migrated to use the new 'application' builder. You can read more about this, including known issues and limitations, here: https://angular.dev/tools/cli/build-system-migration",
"optional": true,
"recommended": true,
"documentation": "tools/cli/build-system-migration"
},
"update-workspace-config": {
Expand Down

0 comments on commit b847d44

Please sign in to comment.