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
38 lines
1.3 KiB
Python
38 lines
1.3 KiB
Python
load("//tools:defaults.bzl", "jasmine_node_test", "ts_library")
|
|
|
|
ts_library(
|
|
name = "test_lib",
|
|
testonly = True,
|
|
srcs = glob(["**/*.ts"]),
|
|
data = [
|
|
"test-migrations.json",
|
|
"//packages/core/schematics:migrations.json",
|
|
],
|
|
deps = [
|
|
"//packages/core/schematics/migrations/injectable-pipe",
|
|
"//packages/core/schematics/migrations/injectable-pipe/google3",
|
|
"//packages/core/schematics/migrations/missing-injectable",
|
|
"//packages/core/schematics/migrations/missing-injectable/google3",
|
|
"//packages/core/schematics/migrations/move-document",
|
|
"//packages/core/schematics/migrations/renderer-to-renderer2",
|
|
"//packages/core/schematics/migrations/renderer-to-renderer2/google3",
|
|
"//packages/core/schematics/migrations/static-queries",
|
|
"//packages/core/schematics/migrations/static-queries/google3",
|
|
"//packages/core/schematics/migrations/template-var-assignment",
|
|
"//packages/core/schematics/migrations/template-var-assignment/google3",
|
|
"//packages/core/schematics/utils",
|
|
"@npm//@angular-devkit/core",
|
|
"@npm//@angular-devkit/schematics",
|
|
"@npm//@types/shelljs",
|
|
"@npm//tslint",
|
|
],
|
|
)
|
|
|
|
jasmine_node_test(
|
|
name = "test",
|
|
deps = [
|
|
":test_lib",
|
|
"@npm//shelljs",
|
|
],
|
|
)
|