refactor(ivy): ngcc - remove redundant entryPoint
argument from writeBundle()
(#32052)
The entry-point is already available through the `bundle` argument, so passing it separately is redundant. PR Close #32052
This commit is contained in:

committed by
Alex Rickabaugh

parent
ed70f73794
commit
93d27eefd5
@ -171,7 +171,7 @@ export function mainNgcc(
|
||||
logger.info(`Compiling ${entryPoint.name} : ${formatProperty} as ${format}`);
|
||||
|
||||
const transformedFiles = transformer.transform(bundle);
|
||||
fileWriter.writeBundle(entryPoint, bundle, transformedFiles, formatProperty);
|
||||
fileWriter.writeBundle(bundle, transformedFiles, formatProperty);
|
||||
|
||||
onTaskCompleted(task, TaskProcessingOutcome.Processed);
|
||||
};
|
||||
|
@ -6,7 +6,7 @@
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
import {EntryPoint, EntryPointJsonProperty} from '../packages/entry_point';
|
||||
import {EntryPointJsonProperty} from '../packages/entry_point';
|
||||
import {EntryPointBundle} from '../packages/entry_point_bundle';
|
||||
import {FileToWrite} from '../rendering/utils';
|
||||
|
||||
@ -15,6 +15,6 @@ import {FileToWrite} from '../rendering/utils';
|
||||
*/
|
||||
export interface FileWriter {
|
||||
writeBundle(
|
||||
entryPoint: EntryPoint, bundle: EntryPointBundle, transformedFiles: FileToWrite[],
|
||||
bundle: EntryPointBundle, transformedFiles: FileToWrite[],
|
||||
formatProperty: EntryPointJsonProperty): void;
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
import {FileSystem, absoluteFrom, dirname} from '../../../src/ngtsc/file_system';
|
||||
import {EntryPoint, EntryPointJsonProperty} from '../packages/entry_point';
|
||||
import {EntryPointJsonProperty} from '../packages/entry_point';
|
||||
import {EntryPointBundle} from '../packages/entry_point_bundle';
|
||||
import {FileToWrite} from '../rendering/utils';
|
||||
import {FileWriter} from './file_writer';
|
||||
@ -20,7 +20,7 @@ export class InPlaceFileWriter implements FileWriter {
|
||||
constructor(protected fs: FileSystem) {}
|
||||
|
||||
writeBundle(
|
||||
_entryPoint: EntryPoint, _bundle: EntryPointBundle, transformedFiles: FileToWrite[],
|
||||
_bundle: EntryPointBundle, transformedFiles: FileToWrite[],
|
||||
_formatProperty?: EntryPointJsonProperty) {
|
||||
transformedFiles.forEach(file => this.writeFileAndBackup(file));
|
||||
}
|
||||
|
@ -26,9 +26,10 @@ const NGCC_DIRECTORY = '__ivy_ngcc__';
|
||||
*/
|
||||
export class NewEntryPointFileWriter extends InPlaceFileWriter {
|
||||
writeBundle(
|
||||
entryPoint: EntryPoint, bundle: EntryPointBundle, transformedFiles: FileToWrite[],
|
||||
bundle: EntryPointBundle, transformedFiles: FileToWrite[],
|
||||
formatProperty: EntryPointJsonProperty) {
|
||||
// The new folder is at the root of the overall package
|
||||
const entryPoint = bundle.entryPoint;
|
||||
const ngccFolder = join(entryPoint.package, NGCC_DIRECTORY);
|
||||
this.copyBundle(bundle, entryPoint.package, ngccFolder);
|
||||
transformedFiles.forEach(file => this.writeFile(file, entryPoint.package, ngccFolder));
|
||||
|
Reference in New Issue
Block a user