Skip to content

Commit 40903ac

Browse files
committed
refactor(@angular/cli): Change modernize to only return instructions.
The modernize tool was simplified to only return instructions on how to run the schematics, instead of running them directly. This gives the user more control over the process. The test file was updated to reflect this change, and the BUILD.bazel file was updated to remove unnecessary dependencies from the test target.
1 parent 474427a commit 40903ac

3 files changed

Lines changed: 8 additions & 13 deletions

File tree

packages/angular/cli/BUILD.bazel

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,7 @@ ts_project(
128128
"//:node_modules/@types/jasmine",
129129
"//:node_modules/@types/semver",
130130
"//:node_modules/@types/yargs",
131-
"//:node_modules/rxjs",
132131
"//:node_modules/semver",
133-
"//:node_modules/typescript",
134-
"//packages/angular_devkit/schematics/testing",
135132
],
136133
)
137134

@@ -166,4 +163,4 @@ npm_package(
166163
":angular-cli",
167164
":license",
168165
],
169-
)
166+
)

packages/angular/cli/src/commands/mcp/mcp-server.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,4 @@ export async function createMcpServer(
6161
}
6262

6363
return server;
64-
<<<<<<< HEAD
6564
}
66-
=======
67-
}
68-
69-
>>>>>>> 44e2d8b7a (refactor(@angular/cli): split MCP server into multiple files.)

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ describe('Modernize Tool', () => {
1616
});
1717

1818
expect(instructions).toEqual([
19-
'To run the self-closing-tags-migration migration, execute the following command: `ng generate @angular/core:self-closing-tags-migration`.\nFor more information, see https://angular.dev/reference/migrations/self-closing-tags.',
19+
'To run the self-closing-tags-migration migration, execute the following command: `ng generate @angular/core:self-closing-tags-migration`.' +
20+
'\nFor more information, see https://angular.dev/reference/migrations/self-closing-tags.',
2021
]);
2122
});
2223

@@ -26,8 +27,10 @@ describe('Modernize Tool', () => {
2627
});
2728

2829
const expectedInstructions = [
29-
'To run the self-closing-tags-migration migration, execute the following command: `ng generate @angular/core:self-closing-tags-migration`.\nFor more information, see https://angular.dev/reference/migrations/self-closing-tags.',
30-
'To run the test-bed-get migration, execute the following command: `ng generate @angular/core:test-bed-get`.\nFor more information, see https://angular.dev/guide/testing/dependency-injection.',
30+
'To run the self-closing-tags-migration migration, execute the following command: `ng generate @angular/core:self-closing-tags-migration`.' +
31+
'\nFor more information, see https://angular.dev/reference/migrations/self-closing-tags.',
32+
'To run the test-bed-get migration, execute the following command: `ng generate @angular/core:test-bed-get`.' +
33+
'\nFor more information, see https://angular.dev/guide/testing/dependency-injection.',
3134
];
3235

3336
expect(instructions?.sort()).toEqual(expectedInstructions.sort());
@@ -52,4 +55,4 @@ describe('Modernize Tool', () => {
5255
'Run the commands in the order listed below, verifying that your code builds and runs between each step:',
5356
);
5457
});
55-
});
58+
});

0 commit comments

Comments
 (0)