Pete Bacon Darwin 0accd1e68d refactor(compiler-cli): implement DeclarationNode node type (#38959)
Previously the `ConcreteDeclaration` and `InlineDeclaration` had
different properties for the underlying node type. And the `InlineDeclaration`
did not store a value that represented its declaration.

It turns out that a natural declaration node for an inline type is the
expression. For example in UMD/CommonJS this would be the `exports.<name>`
property access node.

So this expression is now used for the `node` of `InlineDeclaration` types
and the `expression` property is dropped.

To support this the codebase has been refactored to use a new `DeclarationNode`
type which is a union of `ts.Declaration|ts.Expression` instead of `ts.Declaration`
throughout.

PR Close #38959
2020-10-12 08:32:46 -07:00
..

ngcc migrations

There are some cases where source code needs to be migrated before ngtsc can compile it correctly.

For example, there are cases where ngtsc expects directives need to be explicitly attached to classes, whereas previously they were not required.

There are two ways this can happen:

  1. in a project being developed, the code can be migrated via a CLI schematic.
  2. in a package already published to npm, the code can be migrated as part of the ngcc compilation.

To create one of these migrations for ngcc, you should implement the Migration interface and add an instance of the class to the DecorationAnalyzer.migrations collection.

This folder is where we keep the Migration interface and the implemented migrations.

Each migration should have a unit test stored in the ../../test/migrations directory.