diff --git a/packages/core/schematics/migrations/template-var-assignment/google3/BUILD.bazel b/packages/core/schematics/migrations/google3/BUILD.bazel similarity index 63% rename from packages/core/schematics/migrations/template-var-assignment/google3/BUILD.bazel rename to packages/core/schematics/migrations/google3/BUILD.bazel index 2beb6d06a4..63c73a028c 100644 --- a/packages/core/schematics/migrations/template-var-assignment/google3/BUILD.bazel +++ b/packages/core/schematics/migrations/google3/BUILD.bazel @@ -6,6 +6,10 @@ ts_library( tsconfig = "//packages/core/schematics:tsconfig.json", visibility = ["//packages/core/schematics/test:__pkg__"], deps = [ + "//packages/core/schematics/migrations/injectable-pipe", + "//packages/core/schematics/migrations/missing-injectable", + "//packages/core/schematics/migrations/missing-injectable/google3", + "//packages/core/schematics/migrations/static-queries", "//packages/core/schematics/migrations/template-var-assignment", "//packages/core/schematics/utils", "//packages/core/schematics/utils/tslint", diff --git a/packages/core/schematics/migrations/static-queries/google3/explicitQueryTimingRule.ts b/packages/core/schematics/migrations/google3/explicitQueryTimingRule.ts similarity index 88% rename from packages/core/schematics/migrations/static-queries/google3/explicitQueryTimingRule.ts rename to packages/core/schematics/migrations/google3/explicitQueryTimingRule.ts index 5bed32571a..4a218c8aca 100644 --- a/packages/core/schematics/migrations/static-queries/google3/explicitQueryTimingRule.ts +++ b/packages/core/schematics/migrations/google3/explicitQueryTimingRule.ts @@ -9,11 +9,11 @@ import {Replacement, RuleFailure, Rules} from 'tslint'; import * as ts from 'typescript'; -import {NgComponentTemplateVisitor} from '../../../utils/ng_component_template'; -import {NgQueryResolveVisitor} from '../angular/ng_query_visitor'; -import {QueryTiming} from '../angular/query-definition'; -import {QueryUsageStrategy} from '../strategies/usage_strategy/usage_strategy'; -import {getTransformedQueryCallExpr} from '../transform'; +import {NgComponentTemplateVisitor} from '../../utils/ng_component_template'; +import {NgQueryResolveVisitor} from '../static-queries/angular/ng_query_visitor'; +import {QueryTiming} from '../static-queries/angular/query-definition'; +import {QueryUsageStrategy} from '../static-queries/strategies/usage_strategy/usage_strategy'; +import {getTransformedQueryCallExpr} from '../static-queries/transform'; const FAILURE_MESSAGE = 'Query does not explicitly specify its timing. Read more here: ' + 'https://github.com/angular/angular/pull/28810'; diff --git a/packages/core/schematics/migrations/injectable-pipe/google3/injectablePipeRule.ts b/packages/core/schematics/migrations/google3/injectablePipeRule.ts similarity index 94% rename from packages/core/schematics/migrations/injectable-pipe/google3/injectablePipeRule.ts rename to packages/core/schematics/migrations/google3/injectablePipeRule.ts index ac3ba8e622..423c26bcba 100644 --- a/packages/core/schematics/migrations/injectable-pipe/google3/injectablePipeRule.ts +++ b/packages/core/schematics/migrations/google3/injectablePipeRule.ts @@ -9,8 +9,9 @@ import {Replacement, RuleFailure, Rules} from 'tslint'; import * as ts from 'typescript'; -import {InjectablePipeVisitor} from '../angular/injectable_pipe_visitor'; -import {INJECTABLE_DECORATOR_NAME, addImport, getNamedImports} from '../util'; +import {InjectablePipeVisitor} from '../injectable-pipe/angular/injectable_pipe_visitor'; +import {INJECTABLE_DECORATOR_NAME, addImport, getNamedImports} from '../injectable-pipe/util'; + /** * TSLint rule that flags `@Pipe` classes that haven't been marked as `@Injectable`. diff --git a/packages/core/schematics/migrations/missing-injectable/google3/noMissingInjectableRule.ts b/packages/core/schematics/migrations/google3/noMissingInjectableRule.ts similarity index 90% rename from packages/core/schematics/migrations/missing-injectable/google3/noMissingInjectableRule.ts rename to packages/core/schematics/migrations/google3/noMissingInjectableRule.ts index 1f596f6335..453ab55dc3 100644 --- a/packages/core/schematics/migrations/missing-injectable/google3/noMissingInjectableRule.ts +++ b/packages/core/schematics/migrations/google3/noMissingInjectableRule.ts @@ -8,9 +8,11 @@ import {RuleFailure, Rules} from 'tslint'; import * as ts from 'typescript'; -import {NgModuleCollector} from '../module_collector'; -import {MissingInjectableTransform} from '../transform'; -import {TslintUpdateRecorder} from './tslint_update_recorder'; + +import {TslintUpdateRecorder} from '../missing-injectable/google3/tslint_update_recorder'; +import {NgModuleCollector} from '../missing-injectable/module_collector'; +import {MissingInjectableTransform} from '../missing-injectable/transform'; + /** * TSLint rule that flags classes which are declared as providers in NgModules but diff --git a/packages/core/schematics/migrations/template-var-assignment/google3/noTemplateVariableAssignmentRule.ts b/packages/core/schematics/migrations/google3/noTemplateVariableAssignmentRule.ts similarity index 87% rename from packages/core/schematics/migrations/template-var-assignment/google3/noTemplateVariableAssignmentRule.ts rename to packages/core/schematics/migrations/google3/noTemplateVariableAssignmentRule.ts index 5b8f89d2f4..ff94e529a4 100644 --- a/packages/core/schematics/migrations/template-var-assignment/google3/noTemplateVariableAssignmentRule.ts +++ b/packages/core/schematics/migrations/google3/noTemplateVariableAssignmentRule.ts @@ -9,9 +9,9 @@ import {RuleFailure, Rules} from 'tslint'; import * as ts from 'typescript'; -import {NgComponentTemplateVisitor} from '../../../utils/ng_component_template'; -import {createHtmlSourceFile} from '../../../utils/tslint/tslint_html_source_file'; -import {analyzeResolvedTemplate} from '../analyze_template'; +import {NgComponentTemplateVisitor} from '../../utils/ng_component_template'; +import {createHtmlSourceFile} from '../../utils/tslint/tslint_html_source_file'; +import {analyzeResolvedTemplate} from '../template-var-assignment/analyze_template'; const FAILURE_MESSAGE = 'Found assignment to template variable. This does not work with Ivy and ' + 'needs to be updated.'; diff --git a/packages/core/schematics/migrations/injectable-pipe/BUILD.bazel b/packages/core/schematics/migrations/injectable-pipe/BUILD.bazel index b555201272..1f553e1f00 100644 --- a/packages/core/schematics/migrations/injectable-pipe/BUILD.bazel +++ b/packages/core/schematics/migrations/injectable-pipe/BUILD.bazel @@ -6,7 +6,7 @@ ts_library( tsconfig = "//packages/core/schematics:tsconfig.json", visibility = [ "//packages/core/schematics:__pkg__", - "//packages/core/schematics/migrations/injectable-pipe/google3:__pkg__", + "//packages/core/schematics/migrations/google3:__pkg__", "//packages/core/schematics/test:__pkg__", ], deps = [ diff --git a/packages/core/schematics/migrations/injectable-pipe/google3/BUILD.bazel b/packages/core/schematics/migrations/injectable-pipe/google3/BUILD.bazel deleted file mode 100644 index ffe09d7d9c..0000000000 --- a/packages/core/schematics/migrations/injectable-pipe/google3/BUILD.bazel +++ /dev/null @@ -1,13 +0,0 @@ -load("//tools:defaults.bzl", "ts_library") - -ts_library( - name = "google3", - srcs = glob(["**/*.ts"]), - tsconfig = "//packages/core/schematics:tsconfig.json", - visibility = ["//packages/core/schematics/test:__pkg__"], - deps = [ - "//packages/core/schematics/migrations/injectable-pipe", - "@npm//tslint", - "@npm//typescript", - ], -) diff --git a/packages/core/schematics/migrations/missing-injectable/BUILD.bazel b/packages/core/schematics/migrations/missing-injectable/BUILD.bazel index f0dcc07ad2..19d71dff7e 100644 --- a/packages/core/schematics/migrations/missing-injectable/BUILD.bazel +++ b/packages/core/schematics/migrations/missing-injectable/BUILD.bazel @@ -6,6 +6,7 @@ ts_library( tsconfig = "//packages/core/schematics:tsconfig.json", visibility = [ "//packages/core/schematics:__pkg__", + "//packages/core/schematics/migrations/google3:__pkg__", "//packages/core/schematics/migrations/missing-injectable/google3:__pkg__", "//packages/core/schematics/test:__pkg__", ], diff --git a/packages/core/schematics/migrations/missing-injectable/google3/BUILD.bazel b/packages/core/schematics/migrations/missing-injectable/google3/BUILD.bazel index 37beacee1f..e5e4217f55 100644 --- a/packages/core/schematics/migrations/missing-injectable/google3/BUILD.bazel +++ b/packages/core/schematics/migrations/missing-injectable/google3/BUILD.bazel @@ -4,7 +4,7 @@ ts_library( name = "google3", srcs = glob(["**/*.ts"]), tsconfig = "//packages/core/schematics:tsconfig.json", - visibility = ["//packages/core/schematics/test:__pkg__"], + visibility = ["//packages/core/schematics/migrations/google3:__pkg__"], deps = [ "//packages/core/schematics/migrations/missing-injectable", "@npm//tslint", diff --git a/packages/core/schematics/migrations/static-queries/BUILD.bazel b/packages/core/schematics/migrations/static-queries/BUILD.bazel index 25993f3bf4..528d322366 100644 --- a/packages/core/schematics/migrations/static-queries/BUILD.bazel +++ b/packages/core/schematics/migrations/static-queries/BUILD.bazel @@ -6,7 +6,7 @@ ts_library( tsconfig = "//packages/core/schematics:tsconfig.json", visibility = [ "//packages/core/schematics:__pkg__", - "//packages/core/schematics/migrations/static-queries/google3:__pkg__", + "//packages/core/schematics/migrations/google3:__pkg__", "//packages/core/schematics/test:__pkg__", ], deps = [ diff --git a/packages/core/schematics/migrations/static-queries/google3/BUILD.bazel b/packages/core/schematics/migrations/static-queries/google3/BUILD.bazel deleted file mode 100644 index 9467244813..0000000000 --- a/packages/core/schematics/migrations/static-queries/google3/BUILD.bazel +++ /dev/null @@ -1,14 +0,0 @@ -load("//tools:defaults.bzl", "ts_library") - -ts_library( - name = "google3", - srcs = glob(["**/*.ts"]), - tsconfig = "//packages/core/schematics:tsconfig.json", - visibility = ["//packages/core/schematics/test:__pkg__"], - deps = [ - "//packages/core/schematics/migrations/static-queries", - "//packages/core/schematics/utils", - "@npm//tslint", - "@npm//typescript", - ], -) diff --git a/packages/core/schematics/migrations/template-var-assignment/BUILD.bazel b/packages/core/schematics/migrations/template-var-assignment/BUILD.bazel index 5e0003affc..a08d0b4578 100644 --- a/packages/core/schematics/migrations/template-var-assignment/BUILD.bazel +++ b/packages/core/schematics/migrations/template-var-assignment/BUILD.bazel @@ -6,7 +6,7 @@ ts_library( tsconfig = "//packages/core/schematics:tsconfig.json", visibility = [ "//packages/core/schematics:__pkg__", - "//packages/core/schematics/migrations/template-var-assignment/google3:__pkg__", + "//packages/core/schematics/migrations/google3:__pkg__", "//packages/core/schematics/test:__pkg__", ], deps = [ diff --git a/packages/core/schematics/test/BUILD.bazel b/packages/core/schematics/test/BUILD.bazel index 4699ef653e..cacb572f91 100644 --- a/packages/core/schematics/test/BUILD.bazel +++ b/packages/core/schematics/test/BUILD.bazel @@ -9,17 +9,14 @@ ts_library( "//packages/core/schematics:migrations.json", ], deps = [ + "//packages/core/schematics/migrations/google3", "//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", diff --git a/packages/core/schematics/test/google3/explicit_query_timing_rule_spec.ts b/packages/core/schematics/test/google3/explicit_query_timing_rule_spec.ts index 24db264ce2..56686ca020 100644 --- a/packages/core/schematics/test/google3/explicit_query_timing_rule_spec.ts +++ b/packages/core/schematics/test/google3/explicit_query_timing_rule_spec.ts @@ -18,7 +18,7 @@ describe('Google3 explicitQueryTiming TSLint rule', () => { * the Bazel runfiles, because on Windows runfiles are not symlinked into the working directory. */ const rulesDirectory = - dirname(require.resolve('../../migrations/static-queries/google3/explicitQueryTimingRule')); + dirname(require.resolve('../../migrations/google3/explicitQueryTimingRule')); let tmpDir: string; diff --git a/packages/core/schematics/test/google3/injectable_pipe_spec.ts b/packages/core/schematics/test/google3/injectable_pipe_spec.ts index 6e9c318d89..2bf83a0937 100644 --- a/packages/core/schematics/test/google3/injectable_pipe_spec.ts +++ b/packages/core/schematics/test/google3/injectable_pipe_spec.ts @@ -12,8 +12,7 @@ import * as shx from 'shelljs'; import {Configuration, Linter} from 'tslint'; describe('Google3 injectable pipe TSLint rule', () => { - const rulesDirectory = - dirname(require.resolve('../../migrations/injectable-pipe/google3/injectablePipeRule')); + const rulesDirectory = dirname(require.resolve('../../migrations/google3/injectablePipeRule')); let tmpDir: string; diff --git a/packages/core/schematics/test/google3/missing_injectable_rule_spec.ts b/packages/core/schematics/test/google3/missing_injectable_rule_spec.ts index 085710bf76..f5cac83730 100644 --- a/packages/core/schematics/test/google3/missing_injectable_rule_spec.ts +++ b/packages/core/schematics/test/google3/missing_injectable_rule_spec.ts @@ -12,8 +12,8 @@ import * as shx from 'shelljs'; import {Configuration, Linter} from 'tslint'; describe('Google3 missing injectable tslint rule', () => { - const rulesDirectory = dirname( - require.resolve('../../migrations/missing-injectable/google3/noMissingInjectableRule')); + const rulesDirectory = + dirname(require.resolve('../../migrations/google3/noMissingInjectableRule')); let tmpDir: string; diff --git a/packages/core/schematics/test/google3/no_template_variable_assignment_rule_spec.ts b/packages/core/schematics/test/google3/no_template_variable_assignment_rule_spec.ts index 1f878e64a7..e06cbd1e0d 100644 --- a/packages/core/schematics/test/google3/no_template_variable_assignment_rule_spec.ts +++ b/packages/core/schematics/test/google3/no_template_variable_assignment_rule_spec.ts @@ -12,8 +12,8 @@ import * as shx from 'shelljs'; import {Configuration, Linter} from 'tslint'; describe('Google3 noTemplateVariableAssignment TSLint rule', () => { - const rulesDirectory = dirname(require.resolve( - '../../migrations/template-var-assignment/google3/noTemplateVariableAssignmentRule')); + const rulesDirectory = + dirname(require.resolve('../../migrations/google3/noTemplateVariableAssignmentRule')); let tmpDir: string; diff --git a/packages/core/schematics/utils/tslint/BUILD.bazel b/packages/core/schematics/utils/tslint/BUILD.bazel index cae69eca25..73b96009d1 100644 --- a/packages/core/schematics/utils/tslint/BUILD.bazel +++ b/packages/core/schematics/utils/tslint/BUILD.bazel @@ -5,7 +5,7 @@ ts_library( srcs = glob(["**/*.ts"]), tsconfig = "//packages/core/schematics:tsconfig.json", visibility = [ - "//packages/core/schematics/migrations/template-var-assignment/google3:__pkg__", + "//packages/core/schematics/migrations/google3:__pkg__", ], deps = ["@npm//typescript"], )