angular/packages/compiler-cli/ngcc/test
JoostK e4839939b0 test(ngcc): don't use the workspace typescript version to generate integration test fixtures (#44448)
Now that ViewEngine libraries can no longer be created, the latest
TypeScript version that ngcc should be able to process is TypeScript 4.3,
i.e. the version of TypeScript that was supported in Angular 12.
However, ngcc's integration tests used the TypeScript version of the
workspace to create the JavaScript files from TypeScript sources on
demand. This introduces friction when upgrading the TypeScript version
within the workspace, as changes to TypeScript's emit format may affect
ngcc's ability to process it correctly.

The on demand creation of JavaScript files was convenient for authoring
tests, but it also helped to detect incompatibilities with newer
versions of TypeScript. Now that ngcc no longer has to process newer
versions of TypeScript, we want to pin the integration suite to use
JavaScript code as if it were compiled using TypeScript 4.3, i.e. a
version of TypeScript that is actually supported by ngcc.

This commit updates the integration test to inline all the generated
files directly in the tests, instead of compiling them on demand. This
was done by temporarily installing TypeScript 4.3 and using it to create
the `loadTestFiles` statement from the original TypeScript inputs.

An alternative could have been to install TypeScript 4.3 as an actual
dependency in the workspace and using that to continue compiling the
integration suite on demand, but this brings some overhead in package
installations (TypeScript is ~60MB) and the authoring aspect of ngcc
integration test is expected to diminish, now that ngcc's support is no
longer a moving target.

PR Close #44448
2021-12-14 16:08:28 -05:00
..
analysis refactor(ngcc): remove Ivy switch marker transform (#43891) 2021-11-24 19:26:25 +00:00
dependencies fix(ngcc): correctly resolve UMD dependencies (#44381) 2021-12-07 08:33:00 -05:00
entry_point_finder fix(compiler-cli): ensure ngcc can handle wildcard base-paths (#41033) 2021-03-01 15:25:44 -08:00
execution feat(core): support TypeScript 4.5 (#44164) 2021-11-30 11:59:02 -05:00
helpers fix(ngcc): correctly resolve UMD dependencies (#44381) 2021-12-07 08:33:00 -05:00
host test(ngcc): run more tests against more supported UMD formats (#44245) 2021-11-29 12:38:05 -05:00
integration test(ngcc): don't use the workspace typescript version to generate integration test fixtures (#44448) 2021-12-14 16:08:28 -05:00
locking fix(ngcc): ensure that ngcc does not write a lock-file into node_modules package directories (#44228) 2021-11-22 17:55:13 +00:00
migrations refactor: make all imports compatible with ESM/CJS output. (#43431) 2021-10-01 18:28:45 +00:00
packages refactor(ngcc): make it easy to support more UMD wrapper function formats (#44245) 2021-11-29 12:38:05 -05:00
rendering fix(ngcc): correctly resolve UMD dependencies (#44381) 2021-12-07 08:33:00 -05:00
writing refactor(ngcc): support processing only the typings files of packages (#40976) 2021-02-24 14:23:14 -08:00
BUILD.bazel build: remove "ivy-only" bazel tag (#43862) 2021-10-19 10:06:55 -07:00
ngcc_options_spec.ts refactor(compiler-cli): do not use __filename or __dirname global for ESM compatibility (#43431) 2021-10-01 18:28:45 +00:00
utils_spec.ts refactor: make all imports compatible with ESM/CJS output. (#43431) 2021-10-01 18:28:45 +00:00