Skip to content

Commit c0f7e0d

Browse files
committed
feat(@angular/cli): Expand the transformation list for the modernize tool
This includes a refactor that centralizes the transformation list, and makes it possible to pick specific ones.
1 parent c4d7ef8 commit c0f7e0d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

packages/angular/cli/src/commands/mcp/tools/modernize.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ const TRANSFORMATIONS = [
9595
},
9696
] as const;
9797

98+
const ALL_TRANSFORMATIONS = TRANSFORMATIONS.map((t) => t.name);
99+
98100
export function registerModernizeTool(server: McpServer): void {
99101
server.registerTool(
100102
'modernize',
@@ -132,7 +134,7 @@ export function registerModernizeTool(server: McpServer): void {
132134
// infers `ALL_TRANSFORMATIONS` as `string[]`. The `as` cast is a
133135
// workaround to satisfy Zod's type checker.
134136
transformations: z
135-
.array(z.enum(TRANSFORMATIONS.map((t) => t.name) as [string, ...string[]]))
137+
.array(z.enum(ALL_TRANSFORMATIONS as [string, ...string[]]))
136138
.optional(),
137139
mode: z
138140
.enum(['convert-to-standalone', 'prune-ng-modules', 'standalone-bootstrap'])

0 commit comments

Comments
 (0)