feat: refresh CLI output styling and progress

This commit is contained in:
Peter Steinberger
2026-01-08 05:19:57 +01:00
parent ab98ffe9fe
commit 28cd2e4c24
24 changed files with 652 additions and 273 deletions

View File

@@ -14,6 +14,8 @@ import {
import type { WizardProgress, WizardPrompter } from "./prompts.js";
import { WizardCancelledError } from "./prompts.js";
import { createCliProgress } from "../cli/progress.js";
import { theme } from "../terminal/theme.js";
function guardCancel<T>(value: T | symbol): T {
if (isCancel(value)) {
@@ -74,10 +76,22 @@ export function createClackPrompter(): WizardPrompter {
),
progress: (label: string): WizardProgress => {
const spin = spinner();
spin.start(label);
spin.start(theme.accent(label));
const osc = createCliProgress({
label,
indeterminate: true,
enabled: true,
fallback: "none",
});
return {
update: (message) => spin.message(message),
stop: (message) => spin.stop(message),
update: (message) => {
spin.message(theme.accent(message));
osc.setLabel(message);
},
stop: (message) => {
osc.done();
spin.stop(message);
},
};
},
};