Commit graph

21 commits

Author SHA1 Message Date
SkyZeroZx
75fc16b261 feat(migrations): Adds support for CommonModule to standalone migration (#64138)
Introduces a migration that replaces CommonModule usage with individual imports from @angular/common, aligning with Angular's standalone component approach and improving module import clarity

PR Close #64138
2025-10-15 10:37:37 -07:00
SkyZeroZx
861cee34e0 feat(migrations): Adds migration for deprecated router testing module (#64217)
Introduces a schematic to replace deprecated router testing imports

PR Close #64217
2025-10-13 11:09:29 -07:00
SkyZeroZx
1ffcfb625a feat(migrations): Adds migration for deprecated router testing module (#64217)
Introduces a schematic to replace deprecated router testing imports

PR Close #64217
2025-10-13 11:09:29 -07:00
aparziale
8dc8914c8a feat(migrations): add migration to convert ngStyle to use style (#63517)
Add migration to convert ngStyle to use style

PR Close #63517
2025-09-15 20:16:16 +00:00
aparziale
6ddb250391 feat(migrations): add migration to convert ngClass to use class (#62983)
feat #61661 - add migration to convert ngClass to use class

PR Close #62983
2025-08-21 11:41:32 -07:00
Matthieu Riegler
9630d79d1a refactor(migrations): keep the control flow migration as ng generate. (#61773)
this way `ng generate @angular/core:control-flow` which has been fairly documented, remains valid.

PR Close #61773
2025-06-03 07:12:59 -04:00
Paul Gschwendtner
b763059bdd build: migrate packages/core/schematics to ts_project (#61370)
Migrates `packages/core/schematics` to `ts_project`. As part of this,
this commit cleans up some of the mixed module types and tsconfigs in
the folder. A single tsconfig (and it's test variant) are now used.

For the shipped schematics, we explicitly use the `.cjs` extension, so
that the bundles are properly recognized as CommonJS; even if they are
part of the `type: module` `@angular/core` package.

The `package.json` with `type: commonjs` is removed from
`packages/core/schematics` as it's no longer needed given the explicit
extension & caused issues as schematics are compiled with ESM but are
only later bundled for shipping & some tests as ESM.

PR Close #61370
2025-05-16 11:02:07 +00:00
Matthieu Riegler
e40b5c9ebd refactor(core): run the control flow migration during ng update (#60492)
The migration had to be run manually before this change. It is now part of the update process when migrating to v20.

PR Close #60492
2025-03-28 15:46:41 +00:00
Enea Jahollari
1cd3a7db83 feat(migrations): add migration to convert templates to use self-closing tags (#57342)
This schematic helps developers to convert their templates to use self-closing tags mostly as a aesthetic change.

PR Close #57342
2025-02-18 17:33:59 +00:00
Kristiyan Kostadinov
d298d25426 feat(migrations): add schematic to clean up unused imports (#59353)
In v19 we added a warning about unused standalone imports, however we didn't do anything about existing code which means that users have to clean it up manually. These changes add the `ng g @angular/core:cleanup-unused-imports` schematic which will remove the unused dependencies automatically.

There isn't any new detection code since all the manipulations are based on the produced diagnostics, but there's a bit of code to remove the import declarations from the file as well.

Fixes #58849.

PR Close #59353
2025-01-06 16:21:26 +00:00
Pawel Kozlowski
2bfc64daf1 feat(migrations): expose output as function migration (#58299)
This commit exposes a new ng generate schematic that migrates
outputs from the decorator version to the output function.

PR Close #58299
2024-10-22 07:41:41 -07:00
Kristiyan Kostadinov
dff4de0f75 feat(migrations): add a combined migration for all signals APIs (#58259)
Adds a combined `@angular/core:signals` migration that combines all of the signals-related migrations into one for the apps that want to do it all in one go.

All of the heavy-lifting was already done by the individual migrations, these changes only chain them together for a more convenient developer experience.

PR Close #58259
2024-10-18 11:52:54 +00:00
Paul Gschwendtner
b6bc93803c feat(migrations): add schematic to migrate to signal queries (#58032)
This commit adds an automated `ng generate` schematic/migration for
converting decorator queries to signal queries, as good as possible.

PR Close #58032
2024-10-02 11:25:39 +00:00
Paul Gschwendtner
59fe9bc772 feat(migrations): introduce signal input migration as ng generate schematic (#57805)
Introduces a new `ng generate` schematic for migration `@Input()`
declarations to signal inputs.

This migration is the same that is also integrated into the
VSCode extension.

Note: In a follow-up the documentation for this will be improved, and a
flag to report reasons on why certain inputs weren't migrated, is added.

PR Close #57805
2024-09-16 18:06:49 +02:00
Alan Agius
3896f86865 refactor(migrations): switch from esbuild to Rollup for schematics bundling (#57602)
Replaces esbuild with Rollup for bundling schematics to support code splitting, as esbuild does not handle code splitting when targeting CommonJS modules.

**Before:**
```
du -sh dist/bin/packages/core/npm_package/schematics
7.7M    dist/bin/packages/core/npm_package/schematics
```

**After:**
```
du -sh dist/bin/packages/core/npm_package/schematics
3.1M    dist/bin/packages/core/npm_package/schematics
```

PR Close #57602
2024-09-03 09:07:03 -07:00
Enea Jahollari
147eee4253 feat(migrations): add migration to convert standalone component routes to be lazy loaded (#56428)
This schematic helps developers to convert eagerly loaded component routes to lazy loaded routes

PR Close #56428
2024-07-30 20:00:37 +00:00
Kristiyan Kostadinov
166166d79e fix(migrations): add alias to inject migration (#57127)
Adds a shorter alias to the inject migration.

PR Close #57127
2024-07-26 10:00:32 -07:00
Kristiyan Kostadinov
fab673a1dd feat(core): add ng generate schematic to convert to inject (#57056)
Adds the new `ng generate @angular/core:inject-migration` schematic that will convert existing code from constructor-based injection to injection using the `inject` function. The migration also has a few options that should help reduce compilation errors.

This migration is slightly different than our usual ones in that it may have to update entire class or constructor declarations. We don't go through the `ts.factory.update*` APIs for this, because it can cause the entire declaration to be re-formatted. Instead, this migration tries to insert strings in a way that won't affect the user's formatting.

PR Close #57056
2024-07-22 14:39:45 -07:00
Jessica Janiuk
50275e58b8 feat(core): Add schematic to migrate control flow syntax (#52035)
This adds the migration to run to migrate to the block control flow syntax. It includes ngIf, ngFor, and ngSwitch.

PR Close #52035
2023-10-10 11:33:00 -07:00
Kristiyan Kostadinov
a154db8a81 feat(core): add ng generate schematic to convert declarations to standalone (#48790)
Implements a new `ng generate @angular/core:standalone` schematic that allows the user to convert all the declarations in a set of NgModules to standalone.

PR Close #48790
2023-01-24 16:48:19 +00:00
Kristiyan Kostadinov
b37a624985 build: set up ng generate schematics for core (#48790)
Adds the necessary boilerplate to allow for `ng generate` schematics to be included with `@angular/core`.

PR Close #48790
2023-01-24 16:48:19 +00:00