fix(ivy): ngcc - correctly update package.json when createNewEntryPointFormats is true (#32052)

Previously, when run with `createNewEntryPointFormats: true`, `ngcc`
would only update `package.json` with the new entry-point for the first
format property that mapped to a format-path. Subsequent properties
mapping to the same format-path would be detected as processed and not
have their new entry-point format recorded in `package.json`.

This commit fixes this by ensuring `package.json` is updated for all
matching format properties, when writing an `EntryPointBundle`.

PR Close #32052
This commit is contained in:
George Kalpakas
2019-08-08 03:23:46 +03:00
committed by Alex Rickabaugh
parent 93d27eefd5
commit 29d3b68554
7 changed files with 152 additions and 44 deletions

View File

@ -29,13 +29,6 @@ export type ExecuteFn = (analyzeFn: AnalyzeFn, createCompileFn: CreateCompileFn)
/** Represents metadata related to the processing of an entry-point. */
export interface EntryPointProcessingMetadata {
/**
* A mapping from a format property (i.e. an `EntryPointJsonProperty`) to the list of format
* properties that point to the same format-path and as a result need to be marked as processed,
* once the former is processed.
*/
propertyToPropertiesToMarkAsProcessed: Map<EntryPointJsonProperty, EntryPointJsonProperty[]>;
/**
* Whether the typings for the entry-point have been successfully processed (or were already
* processed).
@ -60,6 +53,13 @@ export interface Task {
*/
formatProperty: EntryPointJsonProperty;
/**
* The list of all format properties (including `task.formatProperty`) that should be marked as
* processed once the taksk has been completed, because they point to the format-path that will be
* processed as part of the task.
*/
formatPropertiesToMarkAsProcessed: EntryPointJsonProperty[];
/** Whether to also process typings for this entry-point as part of the task. */
processDts: boolean;
}