Introduces a new migration schematic that follows the given migration plan: https://hackmd.io/@alx/S1XKqMZeS. First case: The schematic detects decorated directives which inherit a constructor. The migration ensures that all base classes until the class with the explicit constructor are properly decorated with "@Directive()" or "@Component". In case one of these classes is not decorated, the schematic adds the abstract "@Directive()" decorator automatically. Second case: The schematic detects undecorated declarations and copies the inherited "@Directive()", "@Component" or "@Pipe" decorator to the undecorated derived class. This involves non-trivial import rewriting, identifier aliasing and AOT metadata serializing (as decorators are not always part of source files) PR Close #31650
34 lines
1.0 KiB
Python
34 lines
1.0 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/missing-injectable",
|
|
"//packages/core/schematics/migrations/move-document",
|
|
"//packages/core/schematics/migrations/renderer-to-renderer2",
|
|
"//packages/core/schematics/migrations/static-queries",
|
|
"//packages/core/schematics/migrations/template-var-assignment",
|
|
"//packages/core/schematics/migrations/undecorated-classes-with-di",
|
|
"//packages/core/schematics/utils",
|
|
"@npm//@angular-devkit/core",
|
|
"@npm//@angular-devkit/schematics",
|
|
"@npm//@types/shelljs",
|
|
"@npm//tslint",
|
|
],
|
|
)
|
|
|
|
jasmine_node_test(
|
|
name = "google3",
|
|
deps = [
|
|
":test_lib",
|
|
"@npm//shelljs",
|
|
],
|
|
)
|