angular/packages/compiler-cli/ngcc/src
George Kalpakas d4e949f45c fix(ngcc): cope with packages following APF v14+ (#45833)
In PR #45405, the Angular Package Format (APF) was updated so that
secondary entry-points (such as `@angular/common/http`) do not have
their own `package.json` file, as they used to. Instead, the paths to
their various formats and types are exposed via the primary
`package.json` file's `exports` property. As an example, see the v13
[@angular/common/http/package.json][1] and compare it with the v14
[@angular/common/package.json > exports][2].

Previously, `ngcc` was not able to analyze such v14+ entry-points and
would instead error as it considered such entry-points missing.

This commit addresses the issue by detecting this situation and
synthesizing a `package.json` file for the secondary entry-points based
on the `exports` property of the primary `package.json` file. This data
is only used by `ngcc` in order to determine that the entry-point does
not need further processing, since it is already in Ivy format.

[1]: https://unpkg.com/browse/@angular/common@13.3.5/http/package.json
[2]: https://unpkg.com/browse/@angular/common@14.0.0-next.15/package.json

PR Close #45833
2022-05-06 09:51:14 -07:00
..
analysis Revert "feat(compiler-cli): exclude abstract classes from strictInjectionParameters requirement (#44615)" (#45862) 2022-05-03 17:03:25 -07:00
dependencies fix(ngcc): cope with packages following APF v14+ (#45833) 2022-05-06 09:51:14 -07:00
entry_point_finder refactor: add override keyword to members implementing abstract declarations (#42512) 2021-07-12 13:11:17 -07:00
execution refactor(ngcc): move loadPackageJson() and related types to utils.ts (#45833) 2022-05-06 09:51:14 -07:00
host fix(ngcc): correctly resolve UMD dependencies (#44381) 2021-12-07 08:33:00 -05:00
locking build: enable useUnknownInCatchVariables (#44679) 2022-02-01 18:17:29 +00:00
migrations refactor(compiler): remove usages of deprecated AST creation functions (#45134) 2022-02-22 10:22:47 -08:00
packages fix(ngcc): cope with packages following APF v14+ (#45833) 2022-05-06 09:51:14 -07:00
rendering build: enable useUnknownInCatchVariables (#44679) 2022-02-01 18:17:29 +00:00
writing fix(ngcc): cope with packages following APF v14+ (#45833) 2022-05-06 09:51:14 -07:00
command_line_options.ts refactor: update yargs to new API for ESM compatibility (#43431) 2021-10-01 18:28:45 +00:00
constants.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
main.ts refactor(ngcc): support processing only the typings files of packages (#40976) 2021-02-24 14:23:14 -08:00
ngcc_options.ts refactor(ngcc): support processing only the typings files of packages (#40976) 2021-02-24 14:23:14 -08:00
path_mappings.ts refactor(compiler-cli): update to use new file-system interfaces (#40281) 2021-01-08 09:34:44 -08:00
utils.ts fix(ngcc): cope with packages following APF v14+ (#45833) 2022-05-06 09:51:14 -07:00