@sprucelabs/spruce-cli
Version:
Command line interface for building Spruce skills.
62 lines (61 loc) • 2.92 kB
TypeScript
import LintService from '../../services/LintService';
import StaticTestFinder from './StaticTestFinder';
import { StaticToInstanceTestFileMigrator } from './StaticToInstanceTestFileMigrator';
export default class StaticToInstanceMigratorImpl implements StaticToInstanceMigrator {
static diskUtil: {
writeFile(destination: string, contents: string): void;
readDir(destination: string): string[];
readFile(source: string): string;
deleteFile(destination: string): void;
createDir(destination: string): void;
moveDir(source: string, destination: string): void;
moveFile(source: string, destination: string): void;
copyDir(source: string, destination: string): Promise<unknown>;
deleteDir(target: string): void;
doesFileExist(target: string): boolean;
isDir(target: string): boolean;
isDirPath(path: string): boolean;
isFile(target: string): boolean;
doesDirExist(target: string): boolean;
resolveHashSprucePath(cwd: string, ...filePath: string[]): string;
doesHashSprucePathExist(cwd: string, ...filePath: string[]): boolean;
resolveBuiltHashSprucePath(cwd: string, ...filePath: string[]): string;
doesBuiltHashSprucePathExist(cwd: string, ...filePath: string[]): boolean;
isFileDifferent(destination: string, contents: string): boolean;
deleteEmptyDirs(dir: string): void;
resolvePath(cwd: string, ...filePath: string[]): string;
resolveRelativePath(path1: string, path2: string): string;
resolveFile(...pathItems: string[]): string | false;
createTempDir(...files: string[]): string;
createRandomTempDir(): string;
hasFileChanged(...filePath: string[]): boolean;
markFileAsUnchanged(...filePath: string[]): void;
resolveCacheDirForDir(dir: string): string;
resolveFileInHashSpruceDir(cwd: string, ...filePath: string[]): string;
getFileChangedCacheFile(file: string): string;
};
static Class?: new (options: StaticToInstanceMigratorOptions) => StaticToInstanceMigrator;
private testFinder;
private testFileMigrator;
private lintService;
protected constructor(options: StaticToInstanceMigratorOptions);
static Migrator(options: StaticToInstanceMigratorOptions): StaticToInstanceMigrator;
run(lookupDir: string): Promise<{
totalTestsUpdated: number;
totalTestsSkipped: number;
}>;
private readFile;
private writeFile;
}
export interface StaticToInstanceMigratorOptions {
testFinder: StaticTestFinder;
testFileMigrator: StaticToInstanceTestFileMigrator;
lintService: LintService;
}
export interface StaticToInstanceMigratorResults {
totalTestsUpdated: number;
totalTestsSkipped: number;
}
export interface StaticToInstanceMigrator {
run(lookupDir: string): Promise<StaticToInstanceMigratorResults>;
}