@coat/cli
Version:
TODO: See #3
27 lines (26 loc) • 1.06 kB
TypeScript
import { CoatContext } from "../types/coat-context";
import { CoatManifestFile, CoatManifestGroupedFile } from "../types/coat-manifest-file";
/**
* Groups generated files by their normalized absolute path.
*
* Coat files are declared by a relative file path from the current coat
* project. In order to merge files correctly, they are grouped by
* their normalized absolute file path, in order to ensure that entries
* that relate to the same files are merged and placed correctly.
*
* Example with edge cases:
*
* There might be two files that are placed by coat:
* - file.json
* - folder-1/../file.json
*
* Both relate to the same file, but their paths are not equal. Normalizing
* and grouping them helps to merge them correctly and place them on the
* file system with the expected result.
*
* @param files The files that shall be grouped
* @param context The context of the current coat project
*/
export declare function groupFiles(files: CoatManifestFile[], context: CoatContext): {
[filePath: string]: CoatManifestGroupedFile;
};