@baseplate-dev/sync
Version:
Library for syncing Baseplate descriptions
38 lines • 1.59 kB
TypeScript
import type ignore from 'ignore';
import type { TemplateInfo } from './metadata.js';
export interface TemplateMetadataFileEntry {
absolutePath: string;
templateInfo: TemplateInfo;
modifiedTime: Date;
}
/**
* Represents a template entry in .templates-info.json where the referenced file no longer exists.
*/
export interface OrphanedTemplateEntry {
/** Path where the file should have existed */
absolutePath: string;
/** Template/generator info from metadata */
templateInfo: TemplateInfo;
/** Path to the .templates-info.json file */
metadataFilePath: string;
/** Filename key in the metadata file */
fileName: string;
}
/**
* Result of reading template info files, including both valid entries and orphaned entries.
*/
export interface ReadTemplateInfoFilesResult {
/** Valid template entries where the file exists */
entries: TemplateMetadataFileEntry[];
/** Orphaned entries where the file no longer exists */
orphanedEntries: OrphanedTemplateEntry[];
}
/**
* Reads all templates info files in the output directory and returns template metadata entries.
*
* @param outputDirectory - The directory to read templates info files from.
* @param ignoreInstance - Optional ignore instance to filter out ignored paths
* @returns An object containing valid entries and orphaned entries (where the file no longer exists).
*/
export declare function readTemplateInfoFiles(outputDirectory: string, ignoreInstance?: ignore.Ignore): Promise<ReadTemplateInfoFilesResult>;
//# sourceMappingURL=read-template-info-files.d.ts.map