vibe-janitor
Version:
A CLI tool that cleans AI-generated JavaScript/TypeScript projects efficiently and intelligently
64 lines (63 loc) • 1.52 kB
TypeScript
/**
* Options for asset sweeping
*/
export interface AssetSweeperOptions {
dryRun?: boolean;
verbose?: boolean;
includeImages?: boolean;
includeFonts?: boolean;
includeStyles?: boolean;
deleteUnused?: boolean;
}
/**
* Results from the asset sweeping process
*/
export interface AssetSweepResult {
unusedImages: string[];
unusedFonts: string[];
unusedStyles: string[];
totalSize: number;
deletedAssets: string[];
}
/**
* Manages detection and cleanup of unused static assets
*/
export declare class AssetSweeper {
private targetDir;
private options;
private sourceFiles;
private assets;
constructor(targetDir: string, options?: AssetSweeperOptions);
/**
* Find all source files that might reference assets
*/
private findSourceFiles;
/**
* Find all static assets in the project
*/
private findAssets;
/**
* Check if an asset is referenced in any source file
*/
private isAssetReferenced;
/**
* Find unused assets by checking for references in source files
*/
private findUnusedAssets;
/**
* Format file size in a human-readable way
*/
private formatSize;
/**
* Check if an asset is protected and should not be deleted
*/
private isProtectedAsset;
/**
* Delete unused assets if configured to do so
*/
private deleteUnusedAssets;
/**
* Run the asset sweeping process
*/
sweep(): Promise<AssetSweepResult>;
}