diff --git a/packages/core/schematics/BUILD.bazel b/packages/core/schematics/BUILD.bazel index 4c227c9316..23433e4a0d 100644 --- a/packages/core/schematics/BUILD.bazel +++ b/packages/core/schematics/BUILD.bazel @@ -10,6 +10,7 @@ npm_package( srcs = ["migrations.json"], visibility = ["//packages/core:__pkg__"], deps = [ + "//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", diff --git a/packages/core/schematics/migrations.json b/packages/core/schematics/migrations.json index e4255c52f8..aac7cb8d82 100644 --- a/packages/core/schematics/migrations.json +++ b/packages/core/schematics/migrations.json @@ -20,6 +20,11 @@ "description": "Migrates usages of Renderer to Renderer2", "factory": "./migrations/renderer-to-renderer2/index" }, + "migration-v9-missing-injectable": { + "version": "9-beta", + "description": "Decorates all declared undecorated provider classes with @Injectable", + "factory": "./migrations/missing-injectable/index" + }, "migration-v9-undecorated-classes-with-di": { "version": "9-beta", "description": "Decorates undecorated base classes of directives/components that use dependency injection. Copies metadata from base classes to derived directives/components/pipes that are not decorated.", diff --git a/packages/core/schematics/test/BUILD.bazel b/packages/core/schematics/test/BUILD.bazel index d863cfd32c..f342e28309 100644 --- a/packages/core/schematics/test/BUILD.bazel +++ b/packages/core/schematics/test/BUILD.bazel @@ -5,7 +5,6 @@ ts_library( testonly = True, srcs = glob(["**/*.ts"]), data = [ - "test-migrations.json", "//packages/core/schematics:migrations.json", ], deps = [ diff --git a/packages/core/schematics/test/missing_injectable_migration_spec.ts b/packages/core/schematics/test/missing_injectable_migration_spec.ts index d74fb88ac3..5614e7581c 100644 --- a/packages/core/schematics/test/missing_injectable_migration_spec.ts +++ b/packages/core/schematics/test/missing_injectable_migration_spec.ts @@ -21,7 +21,7 @@ describe('Missing injectable migration', () => { let warnOutput: string[]; beforeEach(() => { - runner = new SchematicTestRunner('test', require.resolve('./test-migrations.json')); + runner = new SchematicTestRunner('test', require.resolve('../migrations.json')); host = new TempScopedNodeJsSyncHost(); tree = new UnitTestTree(new HostTree(host)); @@ -61,7 +61,7 @@ describe('Missing injectable migration', () => { } async function runMigration() { - await runner.runSchematicAsync('migration-missing-injectable', {}, tree).toPromise(); + await runner.runSchematicAsync('migration-v9-missing-injectable', {}, tree).toPromise(); } it('should migrate type provider in NgModule', async() => { diff --git a/packages/core/schematics/test/test-migrations.json b/packages/core/schematics/test/test-migrations.json deleted file mode 100644 index dca30a068c..0000000000 --- a/packages/core/schematics/test/test-migrations.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - // 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-missing-injectable": { - "description": "Migrates all declared undecorated providers with the @Injectable decorator", - "factory": "../migrations/missing-injectable/index" - } - } -}