Introduces a new migration schematic for adding the "@Injectable()" decorator to provider classes which are currently not migrated. Previously in ViewEngine, classes which are declared as providers sometimes don't require the "@Injectable()" decorator (e.g. https://stackblitz.com/edit/angular-hpo7gw) With Ivy, provider classes need to be explicitly decorated with the "@Injectable()" decorator if they are declared as providers of a given module. This commit introduces a migration schematic which automatically adds the explicit decorator to places where the decorator is currently missing. The migration logic is designed in a CLI devkit and TSlint agnostic way so that we can also have this migration run as part of a public CLI migration w/ `ng update`. This will be handled as part of a follow-up to reiterate on console output etc. Resolves FW-1371 PR Close #30956
15 lines
573 B
JSON
15 lines
573 B
JSON
{
|
|
// Migrations which are not publicly enabled but still run as part of tests need to
|
|
// be part of a schematic collection in order to be able to run it.
|
|
"schematics": {
|
|
"migration-injectable-pipe": {
|
|
"description": "Migrates all Pipe classes so that they have an Injectable annotation",
|
|
"factory": "../migrations/injectable-pipe/index"
|
|
},
|
|
"migration-missing-injectable": {
|
|
"description": "Migrates all declared undecorated providers with the @Injectable decorator",
|
|
"factory": "../migrations/missing-injectable/index"
|
|
}
|
|
}
|
|
}
|