UNPKG

debug-time-machine-cli

Version:

๐Ÿš€ Debug Time Machine CLI - ์™„์ „ ์ž๋™ํ™”๋œ React ๋””๋ฒ„๊น… ๋„๊ตฌ

265 lines (253 loc) โ€ข 6.64 kB
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 };