angular/packages/compiler-cli/src/ngtsc/transform
Paul Gschwendtner 93ce4d0483 refactor(compiler-cli): properly preserve file overview comments (#54983)
This commit updates the logic for preserving file overview comments
to be more reliable and less dependent on previous transforms.

Previously, with the old import manager, we had a utility called
`addImport` that always separated import statements and non-import
statements. This meant that the non-emitted statement from Tsickle
for the synthetic file-overview comments no longer lived at the
beginning of the file.

`addImports` tried to overcome this by adding another new non-emitted
statement *before* all imports. This then was later used by the
transform (or was assumed!) to attach the synthetic file overview
comments if the original tsickle AST Node is no longer at the top.

This logic can be improved, because the import manager shouldn't need to
bother about this fileoverview non-emitted statement, and the logic for
re-attaching the fileoverview comment should be local. This commit fixes
this and makes it a local transform.

PR Close #54983
2024-03-27 10:18:30 -07:00
..
src refactor(compiler-cli): properly preserve file overview comments (#54983) 2024-03-27 10:18:30 -07:00
test refactor(compiler-cli): introduce template semantics checker (#54714) 2024-03-11 11:01:43 -07:00
BUILD.bazel refactor(compiler-cli): introduce template semantics checker (#54714) 2024-03-11 11:01:43 -07:00
index.ts refactor(compiler-cli): delete old unused ImportManager (#54983) 2024-03-27 10:18:29 -07:00