Skip to content

Commit

Permalink
refactor(fancy): better start color and icon
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Apr 11, 2023
1 parent 99c2a4f commit 5a01d53
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
4 changes: 4 additions & 0 deletions examples/prompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ async function main() {
{ value: "gh-action", label: "GitHub Action" },
],
});

await consola.start("Creating project...");
await new Promise((resolve) => setTimeout(resolve, 1000));
await consola.success("Project created!");
}

main();
9 changes: 9 additions & 0 deletions examples/spinner.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { consola } from "./utils";

async function main() {
await consola.start("Creating project...");
await new Promise((resolve) => setTimeout(resolve, 1000));
await consola.success("Project created!");
}

main();
4 changes: 2 additions & 2 deletions src/reporters/fancy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const TYPE_COLOR_MAP: { [k in LogType]?: string } = {
fail: "red",
success: "green",
ready: "green",
start: "yellow",
start: "magenta",
};

export const LEVEL_COLOR_MAP: { [k in LogLevel]?: string } = {
Expand All @@ -31,7 +31,7 @@ const TYPE_ICONS: { [k in LogType]?: string } = {
debug: s("⚙", "D"),
trace: s("→", "→"),
fail: s("✖", "×"),
start: s("", "S"),
start: s("", "o"),
log: "",
};

Expand Down

0 comments on commit 5a01d53

Please sign in to comment.