debug-time-machine-cli
Version:
๐ Debug Time Machine CLI - ์์ ์๋ํ๋ React ๋๋ฒ๊น ๋๊ตฌ
265 lines (253 loc) โข 6.64 kB
TypeScript
import { Command } from 'commander';
interface IInitOptions$1 {
name?: string;
template?: 'react' | 'node' | 'express';
}
/**
* Init ๋ช
๋ น์ด - ์๋ก์ด ํ๋ก์ ํธ ์ด๊ธฐํ
*/
declare function initCommand(options: IInitOptions$1): Promise<void>;
interface IInitOptions {
name?: string;
template: 'react' | 'node' | 'express';
}
interface IStartOptions {
port: string;
host: string;
}
interface IRecordOptions {
output: string;
duration: string;
}
interface IReplayOptions {
input: string;
speed: string;
}
interface IProjectTemplate {
name: string;
description: string;
files: ITemplateFile[];
dependencies: string[];
devDependencies: string[];
scripts: Record<string, string>;
}
interface ITemplateFile {
path: string;
content: string;
}
interface ICliState {
currentProject?: string;
isRecording: boolean;
isReplaying: boolean;
serverPort?: number;
serverHost?: string;
}
type TCommandResult = {
success: boolean;
message?: string;
data?: unknown;
};
interface IProgressOptions {
total: number;
current: number;
message: string;
}
/**
* Start ๋ช
๋ น์ด - Debug Time Machine ์๋ฒ ์์
*/
declare function startCommand(options: IStartOptions): Promise<TCommandResult>;
/**
* ์๋ฒ ์ค๋จ ํธ๋ค๋ฌ
*/
declare function handleServerShutdown(): void;
/**
* start-with-app ๋ช
๋ น์ด ์คํ
*/
declare function startWithAppCommand(appCommand: string, options: any): Promise<void>;
/**
* Commander ๋ช
๋ น์ด ์์ฑ
*/
declare function createStartWithAppCommand(): Command;
/**
* Record ๋ช
๋ น์ด - ์ ํ๋ฆฌ์ผ์ด์
์ํ ๊ธฐ๋ก
*/
declare function recordCommand(options: IRecordOptions): Promise<TCommandResult>;
/**
* ๊ธฐ๋ก ์ค๋จ ํธ๋ค๋ฌ
*/
declare function handleRecordingStop(): void;
/**
* Replay ๋ช
๋ น์ด - ๊ธฐ๋ก๋ ์ํ ์ฌ์
*/
declare function replayCommand(options: IReplayOptions): Promise<TCommandResult>;
/**
* ์ฌ์ ์ค๋จ ํธ๋ค๋ฌ
*/
declare function handleReplayStop(): void;
/**
* ๋ก๊ฑฐ ํด๋์ค - ์ฝ์ ์ถ๋ ฅ์ ๊ด๋ฆฌํฉ๋๋ค
*/
declare class Logger {
private static _spinner;
/**
* ์ฑ๊ณต ๋ฉ์์ง ์ถ๋ ฅ
*/
static success(message: string): void;
/**
* ์๋ฌ ๋ฉ์์ง ์ถ๋ ฅ
*/
static error(message: string): void;
/**
* ๊ฒฝ๊ณ ๋ฉ์์ง ์ถ๋ ฅ
*/
static warning(message: string): void;
/**
* ์ ๋ณด ๋ฉ์์ง ์ถ๋ ฅ
*/
static info(message: string): void;
/**
* ๋๋ฒ๊ทธ ๋ฉ์์ง ์ถ๋ ฅ
*/
static debug(message: string): void;
/**
* ์คํผ๋ ์์
*/
static startSpinner(message: string): void;
/**
* ์คํผ๋ ์ฑ๊ณต์ผ๋ก ์ข
๋ฃ
*/
static succeedSpinner(message?: string): void;
/**
* ์คํผ๋ ์คํจ๋ก ์ข
๋ฃ
*/
static failSpinner(message?: string): void;
/**
* ์คํผ๋ ์ค๋จ
*/
static stopSpinner(): void;
/**
* ์ ๋ชฉ ์ถ๋ ฅ
*/
static title(message: string): void;
/**
* ๋ถ์ ๋ชฉ ์ถ๋ ฅ
*/
static subtitle(message: string): void;
/**
* ๋น ์ค ์ถ๋ ฅ
*/
static newLine(): void;
}
/**
* ํ์ผ ์ ํธ๋ฆฌํฐ ํด๋์ค
*/
declare class FileUtils {
/**
* ๋๋ ํ ๋ฆฌ๊ฐ ์กด์ฌํ๋์ง ํ์ธ
*/
static directoryExists(dirPath: string): Promise<boolean>;
/**
* ํ์ผ์ด ์กด์ฌํ๋์ง ํ์ธ
*/
static fileExists(filePath: string): Promise<boolean>;
/**
* ๋๋ ํ ๋ฆฌ ์์ฑ
*/
static createDirectory(dirPath: string): Promise<void>;
/**
* ํ์ผ ์ฐ๊ธฐ
*/
static writeFile(filePath: string, content: string): Promise<void>;
/**
* ํ์ผ ์ฝ๊ธฐ
*/
static readFile(filePath: string): Promise<string>;
/**
* JSON ํ์ผ ์ฝ๊ธฐ
*/
static readJsonFile<T>(filePath: string): Promise<T>;
/**
* JSON ํ์ผ ์ฐ๊ธฐ
*/
static writeJsonFile(filePath: string, data: unknown): Promise<void>;
/**
* ํ์ผ ๋ณต์ฌ
*/
static copyFile(src: string, dest: string): Promise<void>;
/**
* ๋๋ ํ ๋ฆฌ ๋ณต์ฌ
*/
static copyDirectory(src: string, dest: string): Promise<void>;
/**
* ํ์ผ ๋๋ ๋๋ ํ ๋ฆฌ ์ญ์
*/
static remove(targetPath: string): Promise<void>;
/**
* ์๋ ๊ฒฝ๋ก๋ฅผ ์ ๋ ๊ฒฝ๋ก๋ก ๋ณํ
*/
static resolvePath(...paths: string[]): string;
/**
* ํ์ฌ ์์
๋๋ ํ ๋ฆฌ ๋ฐํ
*/
static getCurrentDirectory(): string;
}
/**
* ํ
ํ๋ฆฟ ์ ํธ๋ฆฌํฐ ํด๋์ค
*/
declare class TemplateUtils {
/**
* React ํ
ํ๋ฆฟ ๋ฐํ
*/
static getReactTemplate(projectName: string): IProjectTemplate;
/**
* Node.js ํ
ํ๋ฆฟ ๋ฐํ
*/
static getNodeTemplate(projectName: string): IProjectTemplate;
/**
* Express ํ
ํ๋ฆฟ ๋ฐํ
*/
static getExpressTemplate(projectName: string): IProjectTemplate;
private static _generateReactPackageJson;
private static _generateReactIndexHtml;
private static _generateReactMainTsx;
private static _generateReactAppTsx;
private static _generateViteEnvDts;
private static _generateViteConfig;
private static _generateReactTsConfig;
private static _generateNodePackageJson;
private static _generateNodeIndexTs;
private static _generateExpressPackageJson;
private static _generateExpressIndexTs;
private static _generateExpressServerTs;
private static _generateNodeTsConfig;
}
/**
* ๊ฒ์ฆ ์ ํธ๋ฆฌํฐ ํด๋์ค
*/
declare class ValidationUtils {
/**
* ํ๋ก์ ํธ ์ด๋ฆ ๊ฒ์ฆ
*/
static validateProjectName(name: string): boolean;
/**
* ํฌํธ ๋ฒํธ ๊ฒ์ฆ
*/
static validatePort(port: string): boolean;
/**
* ํธ์คํธ ์ฃผ์ ๊ฒ์ฆ
*/
static validateHost(host: string): boolean;
/**
* ํ์ผ ๊ฒฝ๋ก ๊ฒ์ฆ
*/
static validateFilePath(filePath: string): boolean;
/**
* ์ฌ์ ์๋ ๊ฒ์ฆ
*/
static validateSpeed(speed: string): boolean;
/**
* ์๊ฐ ๊ฒ์ฆ (์ด ๋จ์)
*/
static validateDuration(duration: string): boolean;
}
export { FileUtils, type ICliState, type IInitOptions, type IProgressOptions, type IProjectTemplate, type IRecordOptions, type IReplayOptions, type IStartOptions, type ITemplateFile, Logger, type TCommandResult, TemplateUtils, ValidationUtils, createStartWithAppCommand, handleRecordingStop, handleReplayStop, handleServerShutdown, initCommand, recordCommand, replayCommand, startCommand, startWithAppCommand };