[6a3a178] | 1 | /// <amd-module name="@angular/compiler-cli/ngcc/src/packages/entry_point_manifest" />
|
---|
| 2 | import { AbsoluteFsPath, FileSystem, PathSegment } from '../../../src/ngtsc/file_system';
|
---|
| 3 | import { Logger } from '../../../src/ngtsc/logging';
|
---|
| 4 | import { EntryPointWithDependencies } from '../dependencies/dependency_host';
|
---|
| 5 | import { NgccConfiguration } from './configuration';
|
---|
| 6 | import { PackageJsonFormatProperties } from './entry_point';
|
---|
| 7 | /**
|
---|
| 8 | * Manages reading and writing a manifest file that contains a list of all the entry-points that
|
---|
| 9 | * were found below a given basePath.
|
---|
| 10 | *
|
---|
| 11 | * This is a super-set of the entry-points that are actually processed for a given run of ngcc,
|
---|
| 12 | * since some may already be processed, or excluded if they do not have the required format.
|
---|
| 13 | */
|
---|
| 14 | export declare class EntryPointManifest {
|
---|
| 15 | private fs;
|
---|
| 16 | private config;
|
---|
| 17 | private logger;
|
---|
| 18 | constructor(fs: FileSystem, config: NgccConfiguration, logger: Logger);
|
---|
| 19 | /**
|
---|
| 20 | * Try to get the entry-point info from a manifest file for the given `basePath` if it exists and
|
---|
| 21 | * is not out of date.
|
---|
| 22 | *
|
---|
| 23 | * Reasons for the manifest to be out of date are:
|
---|
| 24 | *
|
---|
| 25 | * * the file does not exist
|
---|
| 26 | * * the ngcc version has changed
|
---|
| 27 | * * the package lock-file (i.e. yarn.lock or package-lock.json) has changed
|
---|
| 28 | * * the project configuration has changed
|
---|
| 29 | * * one or more entry-points in the manifest are not valid
|
---|
| 30 | *
|
---|
| 31 | * @param basePath The path that would contain the entry-points and the manifest file.
|
---|
| 32 | * @returns an array of entry-point information for all entry-points found below the given
|
---|
| 33 | * `basePath` or `null` if the manifest was out of date.
|
---|
| 34 | */
|
---|
| 35 | readEntryPointsUsingManifest(basePath: AbsoluteFsPath): EntryPointWithDependencies[] | null;
|
---|
| 36 | /**
|
---|
| 37 | * Write a manifest file at the given `basePath`.
|
---|
| 38 | *
|
---|
| 39 | * The manifest includes the current ngcc version and hashes of the package lock-file and current
|
---|
| 40 | * project config. These will be used to check whether the manifest file is out of date. See
|
---|
| 41 | * `readEntryPointsUsingManifest()`.
|
---|
| 42 | *
|
---|
| 43 | * @param basePath The path where the manifest file is to be written.
|
---|
| 44 | * @param entryPoints A collection of entry-points to record in the manifest.
|
---|
| 45 | */
|
---|
| 46 | writeEntryPointManifest(basePath: AbsoluteFsPath, entryPoints: EntryPointWithDependencies[]): void;
|
---|
| 47 | private getEntryPointManifestPath;
|
---|
| 48 | private computeLockFileHash;
|
---|
| 49 | }
|
---|
| 50 | /**
|
---|
| 51 | * A specialized implementation of the `EntryPointManifest` that can be used to invalidate the
|
---|
| 52 | * current manifest file.
|
---|
| 53 | *
|
---|
| 54 | * It always returns `null` from the `readEntryPointsUsingManifest()` method, which forces a new
|
---|
| 55 | * manifest to be created, which will overwrite the current file when `writeEntryPointManifest()`
|
---|
| 56 | * is called.
|
---|
| 57 | */
|
---|
| 58 | export declare class InvalidatingEntryPointManifest extends EntryPointManifest {
|
---|
| 59 | readEntryPointsUsingManifest(_basePath: AbsoluteFsPath): EntryPointWithDependencies[] | null;
|
---|
| 60 | }
|
---|
| 61 | export declare type EntryPointPaths = [
|
---|
| 62 | string,
|
---|
| 63 | string,
|
---|
| 64 | Array<AbsoluteFsPath>?,
|
---|
| 65 | Array<AbsoluteFsPath | PathSegment>?,
|
---|
| 66 | Array<AbsoluteFsPath>?
|
---|
| 67 | ];
|
---|
| 68 | /**
|
---|
| 69 | * The JSON format of the manifest file that is written to disk.
|
---|
| 70 | */
|
---|
| 71 | export interface EntryPointManifestFile {
|
---|
| 72 | ngccVersion: string;
|
---|
| 73 | configFileHash: string;
|
---|
| 74 | lockFileHash: string;
|
---|
| 75 | entryPointPaths: EntryPointPaths[];
|
---|
| 76 | }
|
---|
| 77 | /** The JSON format of the entrypoint properties. */
|
---|
| 78 | export declare type NewEntryPointPropertiesMap = {
|
---|
| 79 | [Property in PackageJsonFormatProperties as `${Property}_ivy_ngcc`]?: string;
|
---|
| 80 | };
|
---|