angular-cn/packages/core/schematics/test
Paul Gschwendtner 59607dc495 fix(core): undecorated-classes-with-di migration should handle libraries generated with CLI versions past v6.2.0 (#35824)
The options for `flatModuleId` and `flatModuleOutFile` had been removed in the CLI
from generated libraries with 718ee15b9a.

This has been done because `ng-packagr` (which is used to build the
libraries) automatically set these options in-memory when it compiles the library.
No migration has been created for this because there was no actual need to get rid of
this. Keeping the options in the library `tsconfig` does not cause any problems unless
the `tsconfig` is used outside of `ng-packagr`. This was not anticipated, but is now
commonly done in `ng update` migrations.

The `ng update` migrations try to create an instance of the `AngularCompilerProgram` by
simply parsing the `tsconfig`. The migrations make the valid assumption that `tsconfig` files
are not incomplete/invalid. They _definitely_ are in the file system though. It just works for
libraries because `ng-packagr` in-memory completes the invalid `tsconfig` files, so that they
can be passed to the `@angular/compiler-cli`.

We can't have this logic in the `ng update` migrations because it's
out-of-scope for individual migrations to distinguish between libraries
and applications. Also it would be out-of-scope to parse the
`ng-packagr` configuration and handle the tsconfig in-memory completion.

As a workaround though, we can remove the flat-module bundle options
in-memory when creating the compiler program. This is acceptable since
we don't emit the program and the flat module bundles are not needed.

Fixes #34985.

PR Close #35824
2020-03-06 12:40:18 -05:00
..
google3 build: update tslint to latest version (#35800) 2020-03-03 09:20:48 -08:00
BUILD.bazel fix(core): remove ngcc postinstall migration (#33727) 2019-11-12 14:03:48 -08:00
dynamic_queries_migration_spec.ts test(core): fix schematics calls to run synchronously (#34364) 2019-12-12 13:14:29 -08:00
helpers.ts feat(core): add undecorated classes migration schematic (#31650) 2019-08-13 14:40:52 -07:00
line_mappings_spec.ts feat(core): template-var-assignment update schematic (#29608) 2019-04-02 15:47:32 -07:00
missing_injectable_migration_spec.ts test(core): fix schematics calls to run synchronously (#34364) 2019-12-12 13:14:29 -08:00
module_with_providers_migration_spec.ts test(core): fix schematics calls to run synchronously (#34364) 2019-12-12 13:14:29 -08:00
move_document_migration_spec.ts test(core): fix schematics calls to run synchronously (#34364) 2019-12-12 13:14:29 -08:00
project_tsconfig_paths_spec.ts refactor(core): migrations should parse cli workspace config as json5 (#30582) 2019-05-21 17:26:22 -07:00
renderer_to_renderer2_migration_spec.ts fix(core): renderer-to-renderer2 migration not migrating methods (#33571) 2019-11-05 22:05:17 +00:00
static_queries_migration_template_spec.ts test(core): fix schematics calls to run synchronously (#34364) 2019-12-12 13:14:29 -08:00
static_queries_migration_usage_spec.ts test(core): fix schematics calls to run synchronously (#34364) 2019-12-12 13:14:29 -08:00
template_var_assignment_migration_spec.ts test(core): remove "enableIvy" compiler option from migration tests (#32954) 2019-10-02 14:53:41 -07:00
undecorated_classes_with_decorated_fields_migration_spec.ts test: clean up explicit dynamic query usages (#33015) 2019-10-17 16:10:10 -04:00
undecorated_classes_with_di_migration_spec.ts fix(core): undecorated-classes-with-di migration should handle libraries generated with CLI versions past v6.2.0 (#35824) 2020-03-06 12:40:18 -05:00