refactor(launcher): split CLI flow into command modules

Isolate process-side effects behind adapter seams and keep wrapper behavior stable while improving command-level testability.
This commit is contained in:
2026-02-21 17:14:58 -08:00
parent 05be13be9e
commit c749430c77
14 changed files with 773 additions and 372 deletions

View File

@@ -0,0 +1,21 @@
export interface ProcessAdapter {
platform(): NodeJS.Platform;
onSignal(signal: NodeJS.Signals, handler: () => void): void;
writeStdout(text: string): void;
exit(code: number): never;
setExitCode(code: number): void;
}
export const nodeProcessAdapter: ProcessAdapter = {
platform: () => process.platform,
onSignal: (signal, handler) => {
process.on(signal, handler);
},
writeStdout: (text) => {
process.stdout.write(text);
},
exit: (code) => process.exit(code),
setExitCode: (code) => {
process.exitCode = code;
},
};