From a770aa231d0404963f08287202224f232875912c Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Wed, 20 Mar 2019 13:47:58 +0000 Subject: [PATCH] refactor(ivy): move ngcc into a higher level folder (#29092) PR Close #29092 --- packages/common/BUILD.bazel | 2 +- packages/compiler-cli/BUILD.bazel | 2 +- .../compiler-cli/{src => }/ngcc/BUILD.bazel | 0 .../compiler-cli/{src => }/ngcc/README.md | 6 +-- packages/compiler-cli/{src => }/ngcc/index.ts | 0 .../compiler-cli/{src => }/ngcc/main-ngcc.ts | 0 .../ngcc/src/analysis/decoration_analyzer.ts | 14 +++---- .../module_with_providers_analyzer.ts | 6 +-- .../src/analysis/ngcc_references_registry.ts | 6 +-- .../analysis/private_declarations_analyzer.ts | 2 +- .../src/analysis/switch_marker_analyzer.ts | 0 .../{src => }/ngcc/src/constants.ts | 0 .../ngcc/src/host/decorated_class.ts | 2 +- .../{src => }/ngcc/src/host/esm2015_host.ts | 2 +- .../{src => }/ngcc/src/host/esm5_host.ts | 2 +- .../{src => }/ngcc/src/host/ngcc_host.ts | 2 +- .../compiler-cli/{src => }/ngcc/src/main.ts | 0 .../ngcc/src/packages/build_marker.ts | 0 .../ngcc/src/packages/bundle_program.ts | 0 .../ngcc/src/packages/dependency_host.ts | 0 .../ngcc/src/packages/dependency_resolver.ts | 0 .../ngcc/src/packages/entry_point.ts | 0 .../ngcc/src/packages/entry_point_bundle.ts | 2 +- .../ngcc/src/packages/entry_point_finder.ts | 0 .../ngcc/src/packages/transformer.ts | 0 .../ngcc/src/rendering/esm5_renderer.ts | 0 .../ngcc/src/rendering/esm_renderer.ts | 2 +- .../src/rendering/ngcc_import_rewriter.ts | 2 +- .../{src => }/ngcc/src/rendering/renderer.ts | 2 +- .../compiler-cli/{src => }/ngcc/src/utils.ts | 0 .../{src => }/ngcc/test/BUILD.bazel | 41 +++++++++++++++++-- .../test/analysis/decoration_analyzer_spec.ts | 6 +-- .../module_with_providers_analyzer_spec.ts | 0 .../private_declarations_analyzer_spec.ts | 2 +- .../test/analysis/references_registry_spec.ts | 8 ++-- .../analysis/switch_marker_analyzer_spec.ts | 0 .../{src => }/ngcc/test/helpers/utils.ts | 6 +-- .../host/esm2015_host_import_helper_spec.ts | 2 +- .../ngcc/test/host/esm2015_host_spec.ts | 2 +- .../test/host/esm5_host_import_helper_spec.ts | 2 +- .../ngcc/test/host/esm5_host_spec.ts | 2 +- .../{src => }/ngcc/test/host/util.ts | 2 +- .../test/integration}/ngcc_spec.ts | 34 ++++++++++----- .../ngcc/test/packages/build_marker_spec.ts | 0 .../test/packages/dependency_host_spec.ts | 0 .../test/packages/dependency_resolver_spec.ts | 0 .../test/packages/entry_point_finder_spec.ts | 0 .../ngcc/test/packages/entry_point_spec.ts | 0 .../test/rendering/esm2015_renderer_spec.ts | 2 +- .../ngcc/test/rendering/esm5_renderer_spec.ts | 2 +- .../ngcc/test/rendering/renderer_spec.ts | 0 packages/compiler-cli/package.json | 2 +- packages/compiler-cli/test/BUILD.bazel | 1 + packages/compiler-cli/test/ngcc/BUILD.bazel | 33 --------------- packages/core/BUILD.bazel | 2 +- 55 files changed, 108 insertions(+), 95 deletions(-) rename packages/compiler-cli/{src => }/ngcc/BUILD.bazel (100%) rename packages/compiler-cli/{src => }/ngcc/README.md (76%) rename packages/compiler-cli/{src => }/ngcc/index.ts (100%) rename packages/compiler-cli/{src => }/ngcc/main-ngcc.ts (100%) rename packages/compiler-cli/{src => }/ngcc/src/analysis/decoration_analyzer.ts (95%) rename packages/compiler-cli/{src => }/ngcc/src/analysis/module_with_providers_analyzer.ts (96%) rename packages/compiler-cli/{src => }/ngcc/src/analysis/ngcc_references_registry.ts (89%) rename packages/compiler-cli/{src => }/ngcc/src/analysis/private_declarations_analyzer.ts (98%) rename packages/compiler-cli/{src => }/ngcc/src/analysis/switch_marker_analyzer.ts (100%) rename packages/compiler-cli/{src => }/ngcc/src/constants.ts (100%) rename packages/compiler-cli/{src => }/ngcc/src/host/decorated_class.ts (93%) rename packages/compiler-cli/{src => }/ngcc/src/host/esm2015_host.ts (99%) rename packages/compiler-cli/{src => }/ngcc/src/host/esm5_host.ts (99%) rename packages/compiler-cli/{src => }/ngcc/src/host/ngcc_host.ts (97%) rename packages/compiler-cli/{src => }/ngcc/src/main.ts (100%) rename packages/compiler-cli/{src => }/ngcc/src/packages/build_marker.ts (100%) rename packages/compiler-cli/{src => }/ngcc/src/packages/bundle_program.ts (100%) rename packages/compiler-cli/{src => }/ngcc/src/packages/dependency_host.ts (100%) rename packages/compiler-cli/{src => }/ngcc/src/packages/dependency_resolver.ts (100%) rename packages/compiler-cli/{src => }/ngcc/src/packages/entry_point.ts (100%) rename packages/compiler-cli/{src => }/ngcc/src/packages/entry_point_bundle.ts (97%) rename packages/compiler-cli/{src => }/ngcc/src/packages/entry_point_finder.ts (100%) rename packages/compiler-cli/{src => }/ngcc/src/packages/transformer.ts (100%) rename packages/compiler-cli/{src => }/ngcc/src/rendering/esm5_renderer.ts (100%) rename packages/compiler-cli/{src => }/ngcc/src/rendering/esm_renderer.ts (98%) rename packages/compiler-cli/{src => }/ngcc/src/rendering/ngcc_import_rewriter.ts (97%) rename packages/compiler-cli/{src => }/ngcc/src/rendering/renderer.ts (99%) rename packages/compiler-cli/{src => }/ngcc/src/utils.ts (100%) rename packages/compiler-cli/{src => }/ngcc/test/BUILD.bazel (51%) rename packages/compiler-cli/{src => }/ngcc/test/analysis/decoration_analyzer_spec.ts (97%) rename packages/compiler-cli/{src => }/ngcc/test/analysis/module_with_providers_analyzer_spec.ts (100%) rename packages/compiler-cli/{src => }/ngcc/test/analysis/private_declarations_analyzer_spec.ts (99%) rename packages/compiler-cli/{src => }/ngcc/test/analysis/references_registry_spec.ts (87%) rename packages/compiler-cli/{src => }/ngcc/test/analysis/switch_marker_analyzer_spec.ts (100%) rename packages/compiler-cli/{src => }/ngcc/test/helpers/utils.ts (95%) rename packages/compiler-cli/{src => }/ngcc/test/host/esm2015_host_import_helper_spec.ts (99%) rename packages/compiler-cli/{src => }/ngcc/test/host/esm2015_host_spec.ts (99%) rename packages/compiler-cli/{src => }/ngcc/test/host/esm5_host_import_helper_spec.ts (99%) rename packages/compiler-cli/{src => }/ngcc/test/host/esm5_host_spec.ts (99%) rename packages/compiler-cli/{src => }/ngcc/test/host/util.ts (93%) rename packages/compiler-cli/{test/ngcc => ngcc/test/integration}/ngcc_spec.ts (73%) rename packages/compiler-cli/{src => }/ngcc/test/packages/build_marker_spec.ts (100%) rename packages/compiler-cli/{src => }/ngcc/test/packages/dependency_host_spec.ts (100%) rename packages/compiler-cli/{src => }/ngcc/test/packages/dependency_resolver_spec.ts (100%) rename packages/compiler-cli/{src => }/ngcc/test/packages/entry_point_finder_spec.ts (100%) rename packages/compiler-cli/{src => }/ngcc/test/packages/entry_point_spec.ts (100%) rename packages/compiler-cli/{src => }/ngcc/test/rendering/esm2015_renderer_spec.ts (99%) rename packages/compiler-cli/{src => }/ngcc/test/rendering/esm5_renderer_spec.ts (99%) rename packages/compiler-cli/{src => }/ngcc/test/rendering/renderer_spec.ts (100%) delete mode 100644 packages/compiler-cli/test/ngcc/BUILD.bazel diff --git a/packages/common/BUILD.bazel b/packages/common/BUILD.bazel index f1c5a910ef..8002aac074 100644 --- a/packages/common/BUILD.bazel +++ b/packages/common/BUILD.bazel @@ -34,9 +34,9 @@ ng_package( visibility = [ "//packages/bazel/test/ng_package:__pkg__", "//packages/compiler-cli/integrationtest:__pkg__", + "//packages/compiler-cli/ngcc/test:__pkg__", "//packages/compiler-cli/test:__pkg__", "//packages/compiler-cli/test/diagnostics:__pkg__", - "//packages/compiler-cli/test/ngcc:__pkg__", "//packages/compiler-cli/test/transformers:__pkg__", "//packages/compiler/test:__pkg__", "//packages/language-service/test:__pkg__", diff --git a/packages/compiler-cli/BUILD.bazel b/packages/compiler-cli/BUILD.bazel index 72dc853589..69297df81f 100644 --- a/packages/compiler-cli/BUILD.bazel +++ b/packages/compiler-cli/BUILD.bazel @@ -60,6 +60,6 @@ npm_package( ], deps = [ ":compiler-cli", - "//packages/compiler-cli/src/ngcc", + "//packages/compiler-cli/ngcc", ], ) diff --git a/packages/compiler-cli/src/ngcc/BUILD.bazel b/packages/compiler-cli/ngcc/BUILD.bazel similarity index 100% rename from packages/compiler-cli/src/ngcc/BUILD.bazel rename to packages/compiler-cli/ngcc/BUILD.bazel diff --git a/packages/compiler-cli/src/ngcc/README.md b/packages/compiler-cli/ngcc/README.md similarity index 76% rename from packages/compiler-cli/src/ngcc/README.md rename to packages/compiler-cli/ngcc/README.md index 10bb08fac0..f03e235a45 100644 --- a/packages/compiler-cli/src/ngcc/README.md +++ b/packages/compiler-cli/ngcc/README.md @@ -10,7 +10,7 @@ This conversion will allow such "legacy" packages to be used by the Ivy renderin The project is built using Bazel: ```bash -yarn bazel build //packages/compiler-cli/src/ngcc +yarn bazel build //packages/compiler-cli/ngcc ``` ## Unit Testing @@ -18,7 +18,7 @@ yarn bazel build //packages/compiler-cli/src/ngcc The unit tests are built and run using Bazel: ```bash -yarn bazel test //packages/compiler-cli/src/ngcc/test +yarn bazel test //packages/compiler-cli/ngcc/test ``` ## Integration Testing @@ -26,5 +26,5 @@ yarn bazel test //packages/compiler-cli/src/ngcc/test There are tests that check the behavior of the overall executable: ```bash -yarn bazel test //packages/compiler-cli/test/ngcc +yarn bazel test //packages/compiler-cli/ngcc/test:integration ``` diff --git a/packages/compiler-cli/src/ngcc/index.ts b/packages/compiler-cli/ngcc/index.ts similarity index 100% rename from packages/compiler-cli/src/ngcc/index.ts rename to packages/compiler-cli/ngcc/index.ts diff --git a/packages/compiler-cli/src/ngcc/main-ngcc.ts b/packages/compiler-cli/ngcc/main-ngcc.ts similarity index 100% rename from packages/compiler-cli/src/ngcc/main-ngcc.ts rename to packages/compiler-cli/ngcc/main-ngcc.ts diff --git a/packages/compiler-cli/src/ngcc/src/analysis/decoration_analyzer.ts b/packages/compiler-cli/ngcc/src/analysis/decoration_analyzer.ts similarity index 95% rename from packages/compiler-cli/src/ngcc/src/analysis/decoration_analyzer.ts rename to packages/compiler-cli/ngcc/src/analysis/decoration_analyzer.ts index 27fce6c820..1e193edab7 100644 --- a/packages/compiler-cli/src/ngcc/src/analysis/decoration_analyzer.ts +++ b/packages/compiler-cli/ngcc/src/analysis/decoration_analyzer.ts @@ -10,13 +10,13 @@ import * as path from 'canonical-path'; import * as fs from 'fs'; import * as ts from 'typescript'; -import {BaseDefDecoratorHandler, ComponentDecoratorHandler, DirectiveDecoratorHandler, InjectableDecoratorHandler, NgModuleDecoratorHandler, PipeDecoratorHandler, ReferencesRegistry, ResourceLoader} from '../../../ngtsc/annotations'; -import {CycleAnalyzer, ImportGraph} from '../../../ngtsc/cycles'; -import {AbsoluteModuleStrategy, LocalIdentifierStrategy, LogicalProjectStrategy, ModuleResolver, NOOP_DEFAULT_IMPORT_RECORDER, ReferenceEmitter} from '../../../ngtsc/imports'; -import {PartialEvaluator} from '../../../ngtsc/partial_evaluator'; -import {AbsoluteFsPath, LogicalFileSystem} from '../../../ngtsc/path'; -import {LocalModuleScopeRegistry, MetadataDtsModuleScopeResolver} from '../../../ngtsc/scope'; -import {CompileResult, DecoratorHandler, DetectResult, HandlerPrecedence} from '../../../ngtsc/transform'; +import {BaseDefDecoratorHandler, ComponentDecoratorHandler, DirectiveDecoratorHandler, InjectableDecoratorHandler, NgModuleDecoratorHandler, PipeDecoratorHandler, ReferencesRegistry, ResourceLoader} from '../../../src/ngtsc/annotations'; +import {CycleAnalyzer, ImportGraph} from '../../../src/ngtsc/cycles'; +import {AbsoluteModuleStrategy, LocalIdentifierStrategy, LogicalProjectStrategy, ModuleResolver, NOOP_DEFAULT_IMPORT_RECORDER, ReferenceEmitter} from '../../../src/ngtsc/imports'; +import {PartialEvaluator} from '../../../src/ngtsc/partial_evaluator'; +import {AbsoluteFsPath, LogicalFileSystem} from '../../../src/ngtsc/path'; +import {LocalModuleScopeRegistry, MetadataDtsModuleScopeResolver} from '../../../src/ngtsc/scope'; +import {CompileResult, DecoratorHandler, DetectResult, HandlerPrecedence} from '../../../src/ngtsc/transform'; import {DecoratedClass} from '../host/decorated_class'; import {NgccReflectionHost} from '../host/ngcc_host'; import {isDefined} from '../utils'; diff --git a/packages/compiler-cli/src/ngcc/src/analysis/module_with_providers_analyzer.ts b/packages/compiler-cli/ngcc/src/analysis/module_with_providers_analyzer.ts similarity index 96% rename from packages/compiler-cli/src/ngcc/src/analysis/module_with_providers_analyzer.ts rename to packages/compiler-cli/ngcc/src/analysis/module_with_providers_analyzer.ts index 6155c19890..aa9cacc84d 100644 --- a/packages/compiler-cli/src/ngcc/src/analysis/module_with_providers_analyzer.ts +++ b/packages/compiler-cli/ngcc/src/analysis/module_with_providers_analyzer.ts @@ -7,9 +7,9 @@ */ import * as ts from 'typescript'; -import {ReferencesRegistry} from '../../../ngtsc/annotations'; -import {Reference} from '../../../ngtsc/imports'; -import {Declaration} from '../../../ngtsc/reflection'; +import {ReferencesRegistry} from '../../../src/ngtsc/annotations'; +import {Reference} from '../../../src/ngtsc/imports'; +import {Declaration} from '../../../src/ngtsc/reflection'; import {NgccReflectionHost} from '../host/ngcc_host'; import {isDefined} from '../utils'; diff --git a/packages/compiler-cli/src/ngcc/src/analysis/ngcc_references_registry.ts b/packages/compiler-cli/ngcc/src/analysis/ngcc_references_registry.ts similarity index 89% rename from packages/compiler-cli/src/ngcc/src/analysis/ngcc_references_registry.ts rename to packages/compiler-cli/ngcc/src/analysis/ngcc_references_registry.ts index 08a7f86e24..ddfd746b28 100644 --- a/packages/compiler-cli/src/ngcc/src/analysis/ngcc_references_registry.ts +++ b/packages/compiler-cli/ngcc/src/analysis/ngcc_references_registry.ts @@ -7,9 +7,9 @@ */ import * as ts from 'typescript'; -import {ReferencesRegistry} from '../../../ngtsc/annotations'; -import {Reference} from '../../../ngtsc/imports'; -import {Declaration, ReflectionHost} from '../../../ngtsc/reflection'; +import {ReferencesRegistry} from '../../../src/ngtsc/annotations'; +import {Reference} from '../../../src/ngtsc/imports'; +import {Declaration, ReflectionHost} from '../../../src/ngtsc/reflection'; import {hasNameIdentifier} from '../utils'; /** diff --git a/packages/compiler-cli/src/ngcc/src/analysis/private_declarations_analyzer.ts b/packages/compiler-cli/ngcc/src/analysis/private_declarations_analyzer.ts similarity index 98% rename from packages/compiler-cli/src/ngcc/src/analysis/private_declarations_analyzer.ts rename to packages/compiler-cli/ngcc/src/analysis/private_declarations_analyzer.ts index 465c069534..ff7d3ce2cc 100644 --- a/packages/compiler-cli/src/ngcc/src/analysis/private_declarations_analyzer.ts +++ b/packages/compiler-cli/ngcc/src/analysis/private_declarations_analyzer.ts @@ -7,7 +7,7 @@ */ import * as ts from 'typescript'; -import {Declaration} from '../../../ngtsc/reflection'; +import {Declaration} from '../../../src/ngtsc/reflection'; import {NgccReflectionHost} from '../host/ngcc_host'; import {hasNameIdentifier, isDefined} from '../utils'; import {NgccReferencesRegistry} from './ngcc_references_registry'; diff --git a/packages/compiler-cli/src/ngcc/src/analysis/switch_marker_analyzer.ts b/packages/compiler-cli/ngcc/src/analysis/switch_marker_analyzer.ts similarity index 100% rename from packages/compiler-cli/src/ngcc/src/analysis/switch_marker_analyzer.ts rename to packages/compiler-cli/ngcc/src/analysis/switch_marker_analyzer.ts diff --git a/packages/compiler-cli/src/ngcc/src/constants.ts b/packages/compiler-cli/ngcc/src/constants.ts similarity index 100% rename from packages/compiler-cli/src/ngcc/src/constants.ts rename to packages/compiler-cli/ngcc/src/constants.ts diff --git a/packages/compiler-cli/src/ngcc/src/host/decorated_class.ts b/packages/compiler-cli/ngcc/src/host/decorated_class.ts similarity index 93% rename from packages/compiler-cli/src/ngcc/src/host/decorated_class.ts rename to packages/compiler-cli/ngcc/src/host/decorated_class.ts index 985ef0a596..2047d5af72 100644 --- a/packages/compiler-cli/src/ngcc/src/host/decorated_class.ts +++ b/packages/compiler-cli/ngcc/src/host/decorated_class.ts @@ -7,7 +7,7 @@ */ import * as ts from 'typescript'; -import {Decorator} from '../../../ngtsc/reflection'; +import {Decorator} from '../../../src/ngtsc/reflection'; /** * A simple container that holds the details of a decorated class that has been diff --git a/packages/compiler-cli/src/ngcc/src/host/esm2015_host.ts b/packages/compiler-cli/ngcc/src/host/esm2015_host.ts similarity index 99% rename from packages/compiler-cli/src/ngcc/src/host/esm2015_host.ts rename to packages/compiler-cli/ngcc/src/host/esm2015_host.ts index 408064d9d9..674137f7df 100644 --- a/packages/compiler-cli/src/ngcc/src/host/esm2015_host.ts +++ b/packages/compiler-cli/ngcc/src/host/esm2015_host.ts @@ -8,7 +8,7 @@ import * as ts from 'typescript'; -import {ClassMember, ClassMemberKind, CtorParameter, Decorator, Import, TypeScriptReflectionHost, reflectObjectLiteral} from '../../../ngtsc/reflection'; +import {ClassMember, ClassMemberKind, CtorParameter, Decorator, Import, TypeScriptReflectionHost, reflectObjectLiteral} from '../../../src/ngtsc/reflection'; import {BundleProgram} from '../packages/bundle_program'; import {findAll, getNameText, isDefined} from '../utils'; diff --git a/packages/compiler-cli/src/ngcc/src/host/esm5_host.ts b/packages/compiler-cli/ngcc/src/host/esm5_host.ts similarity index 99% rename from packages/compiler-cli/src/ngcc/src/host/esm5_host.ts rename to packages/compiler-cli/ngcc/src/host/esm5_host.ts index a485bcd932..628b6be1c2 100644 --- a/packages/compiler-cli/src/ngcc/src/host/esm5_host.ts +++ b/packages/compiler-cli/ngcc/src/host/esm5_host.ts @@ -8,7 +8,7 @@ import * as ts from 'typescript'; -import {ClassMember, ClassMemberKind, Declaration, Decorator, FunctionDefinition, Parameter, reflectObjectLiteral} from '../../../ngtsc/reflection'; +import {ClassMember, ClassMemberKind, Declaration, Decorator, FunctionDefinition, Parameter, reflectObjectLiteral} from '../../../src/ngtsc/reflection'; import {getNameText, hasNameIdentifier} from '../utils'; import {Esm2015ReflectionHost, ParamInfo, getPropertyValueFromSymbol, isAssignmentStatement} from './esm2015_host'; diff --git a/packages/compiler-cli/src/ngcc/src/host/ngcc_host.ts b/packages/compiler-cli/ngcc/src/host/ngcc_host.ts similarity index 97% rename from packages/compiler-cli/src/ngcc/src/host/ngcc_host.ts rename to packages/compiler-cli/ngcc/src/host/ngcc_host.ts index 38076c9d5e..4d538e66df 100644 --- a/packages/compiler-cli/src/ngcc/src/host/ngcc_host.ts +++ b/packages/compiler-cli/ngcc/src/host/ngcc_host.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ import * as ts from 'typescript'; -import {ReflectionHost} from '../../../ngtsc/reflection'; +import {ReflectionHost} from '../../../src/ngtsc/reflection'; import {DecoratedClass} from './decorated_class'; export const PRE_R3_MARKER = '__PRE_R3__'; diff --git a/packages/compiler-cli/src/ngcc/src/main.ts b/packages/compiler-cli/ngcc/src/main.ts similarity index 100% rename from packages/compiler-cli/src/ngcc/src/main.ts rename to packages/compiler-cli/ngcc/src/main.ts diff --git a/packages/compiler-cli/src/ngcc/src/packages/build_marker.ts b/packages/compiler-cli/ngcc/src/packages/build_marker.ts similarity index 100% rename from packages/compiler-cli/src/ngcc/src/packages/build_marker.ts rename to packages/compiler-cli/ngcc/src/packages/build_marker.ts diff --git a/packages/compiler-cli/src/ngcc/src/packages/bundle_program.ts b/packages/compiler-cli/ngcc/src/packages/bundle_program.ts similarity index 100% rename from packages/compiler-cli/src/ngcc/src/packages/bundle_program.ts rename to packages/compiler-cli/ngcc/src/packages/bundle_program.ts diff --git a/packages/compiler-cli/src/ngcc/src/packages/dependency_host.ts b/packages/compiler-cli/ngcc/src/packages/dependency_host.ts similarity index 100% rename from packages/compiler-cli/src/ngcc/src/packages/dependency_host.ts rename to packages/compiler-cli/ngcc/src/packages/dependency_host.ts diff --git a/packages/compiler-cli/src/ngcc/src/packages/dependency_resolver.ts b/packages/compiler-cli/ngcc/src/packages/dependency_resolver.ts similarity index 100% rename from packages/compiler-cli/src/ngcc/src/packages/dependency_resolver.ts rename to packages/compiler-cli/ngcc/src/packages/dependency_resolver.ts diff --git a/packages/compiler-cli/src/ngcc/src/packages/entry_point.ts b/packages/compiler-cli/ngcc/src/packages/entry_point.ts similarity index 100% rename from packages/compiler-cli/src/ngcc/src/packages/entry_point.ts rename to packages/compiler-cli/ngcc/src/packages/entry_point.ts diff --git a/packages/compiler-cli/src/ngcc/src/packages/entry_point_bundle.ts b/packages/compiler-cli/ngcc/src/packages/entry_point_bundle.ts similarity index 97% rename from packages/compiler-cli/src/ngcc/src/packages/entry_point_bundle.ts rename to packages/compiler-cli/ngcc/src/packages/entry_point_bundle.ts index d04da8fe7e..0153376360 100644 --- a/packages/compiler-cli/src/ngcc/src/packages/entry_point_bundle.ts +++ b/packages/compiler-cli/ngcc/src/packages/entry_point_bundle.ts @@ -7,7 +7,7 @@ */ import * as ts from 'typescript'; -import {AbsoluteFsPath} from '../../../ngtsc/path'; +import {AbsoluteFsPath} from '../../../src/ngtsc/path'; import {BundleProgram, makeBundleProgram} from './bundle_program'; import {EntryPoint, EntryPointFormat} from './entry_point'; diff --git a/packages/compiler-cli/src/ngcc/src/packages/entry_point_finder.ts b/packages/compiler-cli/ngcc/src/packages/entry_point_finder.ts similarity index 100% rename from packages/compiler-cli/src/ngcc/src/packages/entry_point_finder.ts rename to packages/compiler-cli/ngcc/src/packages/entry_point_finder.ts diff --git a/packages/compiler-cli/src/ngcc/src/packages/transformer.ts b/packages/compiler-cli/ngcc/src/packages/transformer.ts similarity index 100% rename from packages/compiler-cli/src/ngcc/src/packages/transformer.ts rename to packages/compiler-cli/ngcc/src/packages/transformer.ts diff --git a/packages/compiler-cli/src/ngcc/src/rendering/esm5_renderer.ts b/packages/compiler-cli/ngcc/src/rendering/esm5_renderer.ts similarity index 100% rename from packages/compiler-cli/src/ngcc/src/rendering/esm5_renderer.ts rename to packages/compiler-cli/ngcc/src/rendering/esm5_renderer.ts diff --git a/packages/compiler-cli/src/ngcc/src/rendering/esm_renderer.ts b/packages/compiler-cli/ngcc/src/rendering/esm_renderer.ts similarity index 98% rename from packages/compiler-cli/src/ngcc/src/rendering/esm_renderer.ts rename to packages/compiler-cli/ngcc/src/rendering/esm_renderer.ts index b3736f38b6..fd38bb8333 100644 --- a/packages/compiler-cli/src/ngcc/src/rendering/esm_renderer.ts +++ b/packages/compiler-cli/ngcc/src/rendering/esm_renderer.ts @@ -13,7 +13,7 @@ import {CompiledClass} from '../analysis/decoration_analyzer'; import {RedundantDecoratorMap, Renderer, stripExtension} from './renderer'; import {EntryPointBundle} from '../packages/entry_point_bundle'; import {ExportInfo} from '../analysis/private_declarations_analyzer'; -import {isDtsPath} from '../../../ngtsc/util/src/typescript'; +import {isDtsPath} from '../../../src/ngtsc/util/src/typescript'; export class EsmRenderer extends Renderer { constructor( diff --git a/packages/compiler-cli/src/ngcc/src/rendering/ngcc_import_rewriter.ts b/packages/compiler-cli/ngcc/src/rendering/ngcc_import_rewriter.ts similarity index 97% rename from packages/compiler-cli/src/ngcc/src/rendering/ngcc_import_rewriter.ts rename to packages/compiler-cli/ngcc/src/rendering/ngcc_import_rewriter.ts index dc63243859..09a6f669e9 100644 --- a/packages/compiler-cli/src/ngcc/src/rendering/ngcc_import_rewriter.ts +++ b/packages/compiler-cli/ngcc/src/rendering/ngcc_import_rewriter.ts @@ -7,7 +7,7 @@ * found in the LICENSE file at https://angular.io/license */ -import {ImportRewriter, validateAndRewriteCoreSymbol} from '../../../ngtsc/imports'; +import {ImportRewriter, validateAndRewriteCoreSymbol} from '../../../src/ngtsc/imports'; export class NgccFlatImportRewriter implements ImportRewriter { shouldImportSymbol(symbol: string, specifier: string): boolean { diff --git a/packages/compiler-cli/src/ngcc/src/rendering/renderer.ts b/packages/compiler-cli/ngcc/src/rendering/renderer.ts similarity index 99% rename from packages/compiler-cli/src/ngcc/src/rendering/renderer.ts rename to packages/compiler-cli/ngcc/src/rendering/renderer.ts index ec535adf26..bc0ee48ca8 100644 --- a/packages/compiler-cli/src/ngcc/src/rendering/renderer.ts +++ b/packages/compiler-cli/ngcc/src/rendering/renderer.ts @@ -15,7 +15,7 @@ import * as ts from 'typescript'; import {NoopImportRewriter, ImportRewriter, R3SymbolsImportRewriter, NOOP_DEFAULT_IMPORT_RECORDER} from '@angular/compiler-cli/src/ngtsc/imports'; import {CompileResult} from '@angular/compiler-cli/src/ngtsc/transform'; -import {translateStatement, translateType, ImportManager} from '../../../ngtsc/translator'; +import {translateStatement, translateType, ImportManager} from '../../../src/ngtsc/translator'; import {NgccFlatImportRewriter} from './ngcc_import_rewriter'; import {CompiledClass, CompiledFile, DecorationAnalyses} from '../analysis/decoration_analyzer'; import {ModuleWithProvidersInfo, ModuleWithProvidersAnalyses} from '../analysis/module_with_providers_analyzer'; diff --git a/packages/compiler-cli/src/ngcc/src/utils.ts b/packages/compiler-cli/ngcc/src/utils.ts similarity index 100% rename from packages/compiler-cli/src/ngcc/src/utils.ts rename to packages/compiler-cli/ngcc/src/utils.ts diff --git a/packages/compiler-cli/src/ngcc/test/BUILD.bazel b/packages/compiler-cli/ngcc/test/BUILD.bazel similarity index 51% rename from packages/compiler-cli/src/ngcc/test/BUILD.bazel rename to packages/compiler-cli/ngcc/test/BUILD.bazel index 3f19cbe32f..8e7f1efd6b 100644 --- a/packages/compiler-cli/src/ngcc/test/BUILD.bazel +++ b/packages/compiler-cli/ngcc/test/BUILD.bazel @@ -5,17 +5,19 @@ package(default_visibility = ["//visibility:public"]) ts_library( name = "test_lib", testonly = True, - srcs = glob([ - "**/*.ts", - ]), + srcs = glob( + ["**/*.ts"], + exclude = ["integration/**/*.ts"], + ), deps = [ - "//packages/compiler-cli/src/ngcc", + "//packages/compiler-cli/ngcc", "//packages/compiler-cli/src/ngtsc/imports", "//packages/compiler-cli/src/ngtsc/partial_evaluator", "//packages/compiler-cli/src/ngtsc/path", "//packages/compiler-cli/src/ngtsc/reflection", "//packages/compiler-cli/src/ngtsc/testing", "//packages/compiler-cli/src/ngtsc/transform", + "//packages/compiler-cli/test:test_utils", "@npm//@types/convert-source-map", "@npm//@types/mock-fs", "@npm//canonical-path", @@ -34,3 +36,34 @@ jasmine_node_test( "@npm//convert-source-map", ], ) + +ts_library( + name = "integration_lib", + testonly = True, + srcs = glob( + ["integration/**/*.ts"], + ), + deps = [ + "//packages/compiler-cli/ngcc", + "//packages/compiler-cli/test:test_utils", + "@npm//@types/mock-fs", + ], +) + +jasmine_node_test( + name = "integration", + bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"], + data = [ + "//packages/common:npm_package", + "//packages/core:npm_package", + "@npm//rxjs", + ], + deps = [ + ":integration_lib", + "//packages/common", + "//tools/testing:node_no_angular", + "@npm//canonical-path", + "@npm//convert-source-map", + "@npm//shelljs", + ], +) diff --git a/packages/compiler-cli/src/ngcc/test/analysis/decoration_analyzer_spec.ts b/packages/compiler-cli/ngcc/test/analysis/decoration_analyzer_spec.ts similarity index 97% rename from packages/compiler-cli/src/ngcc/test/analysis/decoration_analyzer_spec.ts rename to packages/compiler-cli/ngcc/test/analysis/decoration_analyzer_spec.ts index 79a453c216..b3ae542714 100644 --- a/packages/compiler-cli/src/ngcc/test/analysis/decoration_analyzer_spec.ts +++ b/packages/compiler-cli/ngcc/test/analysis/decoration_analyzer_spec.ts @@ -7,9 +7,9 @@ */ import * as ts from 'typescript'; -import {AbsoluteFsPath} from '../../../ngtsc/path'; -import {Decorator} from '../../../ngtsc/reflection'; -import {DecoratorHandler, DetectResult} from '../../../ngtsc/transform'; +import {AbsoluteFsPath} from '../../../src/ngtsc/path'; +import {Decorator} from '../../../src/ngtsc/reflection'; +import {DecoratorHandler, DetectResult} from '../../../src/ngtsc/transform'; import {CompiledClass, DecorationAnalyses, DecorationAnalyzer} from '../../src/analysis/decoration_analyzer'; import {NgccReferencesRegistry} from '../../src/analysis/ngcc_references_registry'; import {Esm2015ReflectionHost} from '../../src/host/esm2015_host'; diff --git a/packages/compiler-cli/src/ngcc/test/analysis/module_with_providers_analyzer_spec.ts b/packages/compiler-cli/ngcc/test/analysis/module_with_providers_analyzer_spec.ts similarity index 100% rename from packages/compiler-cli/src/ngcc/test/analysis/module_with_providers_analyzer_spec.ts rename to packages/compiler-cli/ngcc/test/analysis/module_with_providers_analyzer_spec.ts diff --git a/packages/compiler-cli/src/ngcc/test/analysis/private_declarations_analyzer_spec.ts b/packages/compiler-cli/ngcc/test/analysis/private_declarations_analyzer_spec.ts similarity index 99% rename from packages/compiler-cli/src/ngcc/test/analysis/private_declarations_analyzer_spec.ts rename to packages/compiler-cli/ngcc/test/analysis/private_declarations_analyzer_spec.ts index 98e6879093..05504261d5 100644 --- a/packages/compiler-cli/src/ngcc/test/analysis/private_declarations_analyzer_spec.ts +++ b/packages/compiler-cli/ngcc/test/analysis/private_declarations_analyzer_spec.ts @@ -8,7 +8,7 @@ import * as ts from 'typescript'; -import {Reference} from '../../../ngtsc/imports'; +import {Reference} from '../../../src/ngtsc/imports'; import {NgccReferencesRegistry} from '../../src/analysis/ngcc_references_registry'; import {PrivateDeclarationsAnalyzer} from '../../src/analysis/private_declarations_analyzer'; import {Esm2015ReflectionHost} from '../../src/host/esm2015_host'; diff --git a/packages/compiler-cli/src/ngcc/test/analysis/references_registry_spec.ts b/packages/compiler-cli/ngcc/test/analysis/references_registry_spec.ts similarity index 87% rename from packages/compiler-cli/src/ngcc/test/analysis/references_registry_spec.ts rename to packages/compiler-cli/ngcc/test/analysis/references_registry_spec.ts index 5f75dae924..a6c92ce3d1 100644 --- a/packages/compiler-cli/src/ngcc/test/analysis/references_registry_spec.ts +++ b/packages/compiler-cli/ngcc/test/analysis/references_registry_spec.ts @@ -8,10 +8,10 @@ import * as ts from 'typescript'; -import {Reference} from '../../../ngtsc/imports'; -import {PartialEvaluator} from '../../../ngtsc/partial_evaluator'; -import {TypeScriptReflectionHost} from '../../../ngtsc/reflection'; -import {getDeclaration, makeProgram} from '../../../ngtsc/testing/in_memory_typescript'; +import {Reference} from '../../../src/ngtsc/imports'; +import {PartialEvaluator} from '../../../src/ngtsc/partial_evaluator'; +import {TypeScriptReflectionHost} from '../../../src/ngtsc/reflection'; +import {getDeclaration, makeProgram} from '../../../src/ngtsc/testing/in_memory_typescript'; import {NgccReferencesRegistry} from '../../src/analysis/ngcc_references_registry'; describe('NgccReferencesRegistry', () => { diff --git a/packages/compiler-cli/src/ngcc/test/analysis/switch_marker_analyzer_spec.ts b/packages/compiler-cli/ngcc/test/analysis/switch_marker_analyzer_spec.ts similarity index 100% rename from packages/compiler-cli/src/ngcc/test/analysis/switch_marker_analyzer_spec.ts rename to packages/compiler-cli/ngcc/test/analysis/switch_marker_analyzer_spec.ts diff --git a/packages/compiler-cli/src/ngcc/test/helpers/utils.ts b/packages/compiler-cli/ngcc/test/helpers/utils.ts similarity index 95% rename from packages/compiler-cli/src/ngcc/test/helpers/utils.ts rename to packages/compiler-cli/ngcc/test/helpers/utils.ts index 917ac21422..441fdb1d18 100644 --- a/packages/compiler-cli/src/ngcc/test/helpers/utils.ts +++ b/packages/compiler-cli/ngcc/test/helpers/utils.ts @@ -7,13 +7,13 @@ */ import * as ts from 'typescript'; -import {AbsoluteFsPath} from '../../../ngtsc/path'; -import {makeProgram} from '../../../ngtsc/testing/in_memory_typescript'; +import {AbsoluteFsPath} from '../../../src/ngtsc/path'; +import {makeProgram} from '../../../src/ngtsc/testing/in_memory_typescript'; import {BundleProgram} from '../../src/packages/bundle_program'; import {EntryPointFormat} from '../../src/packages/entry_point'; import {EntryPointBundle} from '../../src/packages/entry_point_bundle'; -export {getDeclaration} from '../../../ngtsc/testing/in_memory_typescript'; +export {getDeclaration} from '../../../src/ngtsc/testing/in_memory_typescript'; diff --git a/packages/compiler-cli/src/ngcc/test/host/esm2015_host_import_helper_spec.ts b/packages/compiler-cli/ngcc/test/host/esm2015_host_import_helper_spec.ts similarity index 99% rename from packages/compiler-cli/src/ngcc/test/host/esm2015_host_import_helper_spec.ts rename to packages/compiler-cli/ngcc/test/host/esm2015_host_import_helper_spec.ts index 348d2d2efc..58a541cb1a 100644 --- a/packages/compiler-cli/src/ngcc/test/host/esm2015_host_import_helper_spec.ts +++ b/packages/compiler-cli/ngcc/test/host/esm2015_host_import_helper_spec.ts @@ -8,7 +8,7 @@ import * as ts from 'typescript'; -import {ClassMemberKind, Import} from '../../../ngtsc/reflection'; +import {ClassMemberKind, Import} from '../../../src/ngtsc/reflection'; import {Esm2015ReflectionHost} from '../../src/host/esm2015_host'; import {convertToDirectTsLibImport, getDeclaration, makeTestProgram} from '../helpers/utils'; diff --git a/packages/compiler-cli/src/ngcc/test/host/esm2015_host_spec.ts b/packages/compiler-cli/ngcc/test/host/esm2015_host_spec.ts similarity index 99% rename from packages/compiler-cli/src/ngcc/test/host/esm2015_host_spec.ts rename to packages/compiler-cli/ngcc/test/host/esm2015_host_spec.ts index 850cde1841..c23961455c 100644 --- a/packages/compiler-cli/src/ngcc/test/host/esm2015_host_spec.ts +++ b/packages/compiler-cli/ngcc/test/host/esm2015_host_spec.ts @@ -8,7 +8,7 @@ import * as ts from 'typescript'; -import {ClassMemberKind, Import} from '../../../ngtsc/reflection'; +import {ClassMemberKind, Import} from '../../../src/ngtsc/reflection'; import {Esm2015ReflectionHost} from '../../src/host/esm2015_host'; import {getDeclaration, makeTestBundleProgram, makeTestProgram} from '../helpers/utils'; diff --git a/packages/compiler-cli/src/ngcc/test/host/esm5_host_import_helper_spec.ts b/packages/compiler-cli/ngcc/test/host/esm5_host_import_helper_spec.ts similarity index 99% rename from packages/compiler-cli/src/ngcc/test/host/esm5_host_import_helper_spec.ts rename to packages/compiler-cli/ngcc/test/host/esm5_host_import_helper_spec.ts index ede5edc814..fb4b7d8752 100644 --- a/packages/compiler-cli/src/ngcc/test/host/esm5_host_import_helper_spec.ts +++ b/packages/compiler-cli/ngcc/test/host/esm5_host_import_helper_spec.ts @@ -8,7 +8,7 @@ import * as ts from 'typescript'; -import {ClassMemberKind, Import} from '../../../ngtsc/reflection'; +import {ClassMemberKind, Import} from '../../../src/ngtsc/reflection'; import {Esm5ReflectionHost} from '../../src/host/esm5_host'; import {convertToDirectTsLibImport, getDeclaration, makeTestProgram} from '../helpers/utils'; diff --git a/packages/compiler-cli/src/ngcc/test/host/esm5_host_spec.ts b/packages/compiler-cli/ngcc/test/host/esm5_host_spec.ts similarity index 99% rename from packages/compiler-cli/src/ngcc/test/host/esm5_host_spec.ts rename to packages/compiler-cli/ngcc/test/host/esm5_host_spec.ts index c5e3253802..0c1c67ac0a 100644 --- a/packages/compiler-cli/src/ngcc/test/host/esm5_host_spec.ts +++ b/packages/compiler-cli/ngcc/test/host/esm5_host_spec.ts @@ -8,7 +8,7 @@ import * as ts from 'typescript'; -import {ClassMemberKind, Import} from '../../../ngtsc/reflection'; +import {ClassMemberKind, Import} from '../../../src/ngtsc/reflection'; import {Esm2015ReflectionHost} from '../../src/host/esm2015_host'; import {Esm5ReflectionHost} from '../../src/host/esm5_host'; import {getDeclaration, makeTestBundleProgram, makeTestProgram} from '../helpers/utils'; diff --git a/packages/compiler-cli/src/ngcc/test/host/util.ts b/packages/compiler-cli/ngcc/test/host/util.ts similarity index 93% rename from packages/compiler-cli/src/ngcc/test/host/util.ts rename to packages/compiler-cli/ngcc/test/host/util.ts index 008eef7b45..eb59c9038d 100644 --- a/packages/compiler-cli/src/ngcc/test/host/util.ts +++ b/packages/compiler-cli/ngcc/test/host/util.ts @@ -9,7 +9,7 @@ import * as ts from 'typescript'; -import {CtorParameter} from '../../../ngtsc/reflection'; +import {CtorParameter} from '../../../src/ngtsc/reflection'; /** * Check that a given list of `CtorParameter`s has `typeValueReference`s of specific `ts.Identifier` diff --git a/packages/compiler-cli/test/ngcc/ngcc_spec.ts b/packages/compiler-cli/ngcc/test/integration/ngcc_spec.ts similarity index 73% rename from packages/compiler-cli/test/ngcc/ngcc_spec.ts rename to packages/compiler-cli/ngcc/test/integration/ngcc_spec.ts index be09793aca..0f33444a12 100644 --- a/packages/compiler-cli/test/ngcc/ngcc_spec.ts +++ b/packages/compiler-cli/ngcc/test/integration/ngcc_spec.ts @@ -11,8 +11,8 @@ import * as mockFs from 'mock-fs'; import {join} from 'path'; const Module = require('module'); -import {mainNgcc} from '../../src/ngcc/src/main'; -import {getAngularPackagesFromRunfiles} from '../runfile_helpers'; +import {mainNgcc} from '../../src/main'; +import {getAngularPackagesFromRunfiles, resolveNpmTreeArtifact} from '../../../test/runfile_helpers'; describe('ngcc main()', () => { beforeEach(createMockFileSystem); @@ -41,7 +41,10 @@ describe('ngcc main()', () => { function createMockFileSystem() { - mockFs({'/node_modules/@angular': loadAngularPackages()}); + mockFs({ + '/node_modules/@angular': loadAngularPackages(), + '/node_modules/rxjs': loadDirectory(resolveNpmTreeArtifact('rxjs', 'index.js')), + }); spyOn(Module, '_resolveFilename').and.callFake(mockResolve); } @@ -84,22 +87,31 @@ interface Directory { [pathSegment: string]: string|Directory; } -function mockResolve(p: string): string|null { - if (existsSync(p)) { - const stat = statSync(p); +function mockResolve(request: string): string|null { + if (existsSync(request)) { + const stat = statSync(request); if (stat.isFile()) { - return p; + return request; } else if (stat.isDirectory()) { - const pIndex = mockResolve(p + '/index'); + const pIndex = mockResolve(request + '/index'); if (pIndex && existsSync(pIndex)) { return pIndex; } } } for (const ext of ['.js', '.d.ts']) { - if (existsSync(p + ext)) { - return p + ext; + if (existsSync(request + ext)) { + return request + ext; } } - return null; + if (request.indexOf('/node_modules') === 0) { + // We already tried adding node_modules so give up. + return null; + } else { + return mockResolve(join('/node_modules', request)); + } } + +function loadPackage(packageName: string) { + return JSON.parse(readFileSync(`/node_modules/${packageName}/package.json`, 'utf8')); +} \ No newline at end of file diff --git a/packages/compiler-cli/src/ngcc/test/packages/build_marker_spec.ts b/packages/compiler-cli/ngcc/test/packages/build_marker_spec.ts similarity index 100% rename from packages/compiler-cli/src/ngcc/test/packages/build_marker_spec.ts rename to packages/compiler-cli/ngcc/test/packages/build_marker_spec.ts diff --git a/packages/compiler-cli/src/ngcc/test/packages/dependency_host_spec.ts b/packages/compiler-cli/ngcc/test/packages/dependency_host_spec.ts similarity index 100% rename from packages/compiler-cli/src/ngcc/test/packages/dependency_host_spec.ts rename to packages/compiler-cli/ngcc/test/packages/dependency_host_spec.ts diff --git a/packages/compiler-cli/src/ngcc/test/packages/dependency_resolver_spec.ts b/packages/compiler-cli/ngcc/test/packages/dependency_resolver_spec.ts similarity index 100% rename from packages/compiler-cli/src/ngcc/test/packages/dependency_resolver_spec.ts rename to packages/compiler-cli/ngcc/test/packages/dependency_resolver_spec.ts diff --git a/packages/compiler-cli/src/ngcc/test/packages/entry_point_finder_spec.ts b/packages/compiler-cli/ngcc/test/packages/entry_point_finder_spec.ts similarity index 100% rename from packages/compiler-cli/src/ngcc/test/packages/entry_point_finder_spec.ts rename to packages/compiler-cli/ngcc/test/packages/entry_point_finder_spec.ts diff --git a/packages/compiler-cli/src/ngcc/test/packages/entry_point_spec.ts b/packages/compiler-cli/ngcc/test/packages/entry_point_spec.ts similarity index 100% rename from packages/compiler-cli/src/ngcc/test/packages/entry_point_spec.ts rename to packages/compiler-cli/ngcc/test/packages/entry_point_spec.ts diff --git a/packages/compiler-cli/src/ngcc/test/rendering/esm2015_renderer_spec.ts b/packages/compiler-cli/ngcc/test/rendering/esm2015_renderer_spec.ts similarity index 99% rename from packages/compiler-cli/src/ngcc/test/rendering/esm2015_renderer_spec.ts rename to packages/compiler-cli/ngcc/test/rendering/esm2015_renderer_spec.ts index f982cd09b6..24b0ee0b67 100644 --- a/packages/compiler-cli/src/ngcc/test/rendering/esm2015_renderer_spec.ts +++ b/packages/compiler-cli/ngcc/test/rendering/esm2015_renderer_spec.ts @@ -8,7 +8,7 @@ import {dirname} from 'canonical-path'; import MagicString from 'magic-string'; import * as ts from 'typescript'; -import {AbsoluteFsPath} from '../../../ngtsc/path'; +import {AbsoluteFsPath} from '../../../src/ngtsc/path'; import {DecorationAnalyzer} from '../../src/analysis/decoration_analyzer'; import {NgccReferencesRegistry} from '../../src/analysis/ngcc_references_registry'; import {SwitchMarkerAnalyzer} from '../../src/analysis/switch_marker_analyzer'; diff --git a/packages/compiler-cli/src/ngcc/test/rendering/esm5_renderer_spec.ts b/packages/compiler-cli/ngcc/test/rendering/esm5_renderer_spec.ts similarity index 99% rename from packages/compiler-cli/src/ngcc/test/rendering/esm5_renderer_spec.ts rename to packages/compiler-cli/ngcc/test/rendering/esm5_renderer_spec.ts index 4d6704a5d0..338fd2e21a 100644 --- a/packages/compiler-cli/src/ngcc/test/rendering/esm5_renderer_spec.ts +++ b/packages/compiler-cli/ngcc/test/rendering/esm5_renderer_spec.ts @@ -8,7 +8,7 @@ import {dirname} from 'canonical-path'; import MagicString from 'magic-string'; import * as ts from 'typescript'; -import {AbsoluteFsPath} from '../../../ngtsc/path'; +import {AbsoluteFsPath} from '../../../src/ngtsc/path'; import {DecorationAnalyzer} from '../../src/analysis/decoration_analyzer'; import {NgccReferencesRegistry} from '../../src/analysis/ngcc_references_registry'; import {SwitchMarkerAnalyzer} from '../../src/analysis/switch_marker_analyzer'; diff --git a/packages/compiler-cli/src/ngcc/test/rendering/renderer_spec.ts b/packages/compiler-cli/ngcc/test/rendering/renderer_spec.ts similarity index 100% rename from packages/compiler-cli/src/ngcc/test/rendering/renderer_spec.ts rename to packages/compiler-cli/ngcc/test/rendering/renderer_spec.ts diff --git a/packages/compiler-cli/package.json b/packages/compiler-cli/package.json index 618a0f8d31..c1fcaaa607 100644 --- a/packages/compiler-cli/package.json +++ b/packages/compiler-cli/package.json @@ -5,7 +5,7 @@ "main": "index.js", "typings": "index.d.ts", "bin": { - "ivy-ngcc": "./src/ngcc/main-ngcc.js", + "ivy-ngcc": "./ngcc/main-ngcc.js", "ngc": "./src/main.js", "ng-xi18n": "./src/extract_i18n.js" }, diff --git a/packages/compiler-cli/test/BUILD.bazel b/packages/compiler-cli/test/BUILD.bazel index 9f8a8cee66..63ce1a1591 100644 --- a/packages/compiler-cli/test/BUILD.bazel +++ b/packages/compiler-cli/test/BUILD.bazel @@ -12,6 +12,7 @@ ts_library( ], visibility = [ ":__subpackages__", + "//packages/compiler-cli/ngcc/test:__subpackages__", "//packages/language-service/test:__subpackages__", ], deps = [ diff --git a/packages/compiler-cli/test/ngcc/BUILD.bazel b/packages/compiler-cli/test/ngcc/BUILD.bazel deleted file mode 100644 index 6409276bc9..0000000000 --- a/packages/compiler-cli/test/ngcc/BUILD.bazel +++ /dev/null @@ -1,33 +0,0 @@ -load("//tools:defaults.bzl", "jasmine_node_test", "ts_library") - -# Integration tests -ts_library( - name = "ngcc_lib", - testonly = True, - srcs = glob([ - "**/*_spec.ts", - ]), - deps = [ - "//packages/compiler-cli/src/ngcc", - "//packages/compiler-cli/test:test_utils", - "@npm//@types/mock-fs", - ], -) - -jasmine_node_test( - name = "ngcc", - bootstrap = ["angular/tools/testing/init_node_no_angular_spec.js"], - data = [ - "//packages/common:npm_package", - "//packages/core:npm_package", - ], - deps = [ - ":ngcc_lib", - "//tools/testing:node_no_angular", - "@npm//@types/mock-fs", - "@npm//canonical-path", - "@npm//convert-source-map", - "@npm//shelljs", - "@npm//yargs", - ], -) diff --git a/packages/core/BUILD.bazel b/packages/core/BUILD.bazel index a722331a72..7118c5df4c 100644 --- a/packages/core/BUILD.bazel +++ b/packages/core/BUILD.bazel @@ -40,9 +40,9 @@ ng_package( visibility = [ "//packages/bazel/test/ng_package:__pkg__", "//packages/compiler-cli/integrationtest:__pkg__", + "//packages/compiler-cli/ngcc/test:__pkg__", "//packages/compiler-cli/test:__pkg__", "//packages/compiler-cli/test/diagnostics:__pkg__", - "//packages/compiler-cli/test/ngcc:__pkg__", "//packages/compiler-cli/test/transformers:__pkg__", "//packages/compiler/test:__pkg__", "//packages/language-service/test:__pkg__",