feat(cli): scaffold @vue-tui/cli package with all modules
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
export type LogMode = "stdout" | "silent";
|
||||
|
||||
export interface Logger {
|
||||
mode: LogMode;
|
||||
info(msg: string): void;
|
||||
error(msg: string): void;
|
||||
}
|
||||
|
||||
export function createLogger(): Logger {
|
||||
let mode: LogMode = "stdout";
|
||||
return {
|
||||
get mode() {
|
||||
return mode;
|
||||
},
|
||||
set mode(m: LogMode) {
|
||||
mode = m;
|
||||
},
|
||||
info(msg: string) {
|
||||
if (mode === "stdout") process.stdout.write(msg + "\n");
|
||||
},
|
||||
error(msg: string) {
|
||||
if (mode === "stdout") process.stderr.write(msg + "\n");
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user