You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(@angular/cli): Make modernize use the file system
- Refactors the `modernize` tool to run all schematics on a temporary directory on the file system instead of using the `SchematicTestRunner` and a virtual file system.
- This fixes issues with migrations that require access to the real file system, such as the `control-flow-migration`.
- Extracts the core logic into a separate `runModernization` function to improve testability.
- Adds a new test suite (`modernize_spec.ts`) to cover the refactored logic, including tests for default transformations, file system setup, and updated file content.
'Converts the application to use standalone components, directives, and pipes. This is a three-step process. After each step, you should verify that your application builds and runs correctly.',
59
56
instructions: `This migration requires running a cli schematic multiple times. Run the commands in the order listed below, verifying that your code builds and runs between each step:
60
57
61
-
1. Run
62
-
`ngg @angular/core:standalone` andselect
58
+
1. Run \`ng g @angular/core:standalone\` and select "Convert all components, directives and pipes to standalone"
59
+
2. Run \`ng g @angular/core:standalone\` and select "Remove unnecessary NgModule classes"
60
+
3. Run \`ng g @angular/core:standalone\` and select "Bootstrap the project using standalone APIs"
'This tool modernizes Angular code by applying the latest best practices and syntax improvements, ensuring it is idiomatic, readable, and maintainable.\n\n'+
153
+
'</Purpose>\n'+
154
+
'<Use Cases>\n'+
155
+
'* After generating new code: Run this tool immediately after creating new Angular components, directives, or services to ensure they adhere to modern standards.\n'+
156
+
'* On existing code: Apply to existing TypeScript files (.ts) and Angular templates (.ng.html) to update them with the latest features, such as the new built-in control flow syntax.\n\n'+
157
+
'* When the user asks for a specific transformation: When the transformation list is populated, these specific ones will be ran on the inputs.\n'+
'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.',
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.',
'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.',
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.',
0 commit comments