mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-03 12:54:29 +00:00
## Summary - Run `oxfmt .` across the entire codebase to establish formatted baseline - 299 files changed — mechanical formatting only, no logic changes - Double quotes, semicolons, 2-space indent, trailing commas, 100 print width Part 3/4 of [VA-851](https://linear.app/heygen/issue/VA-851/pre-migration-configure-eslint-prettier-and-conventional-commits) ## Test plan - [x] `pnpm format:check` — all 426 files pass - [x] `pnpm -r typecheck` — all packages pass - [x] `pnpm build` — all packages build - [x] All 348 tests pass
19 lines
577 B
TypeScript
19 lines
577 B
TypeScript
import { c } from "./colors.js";
|
|
|
|
const { stdout } = process;
|
|
|
|
export function renderProgress(percent: number, stage: string, row?: number): void {
|
|
const width = 25;
|
|
const filled = Math.floor(percent / (100 / width));
|
|
const empty = width - filled;
|
|
const bar = c.progress("\u2588".repeat(filled)) + c.dim("\u2591".repeat(empty));
|
|
|
|
const line = ` ${bar} ${c.bold(String(Math.round(percent)) + "%")} ${c.dim(stage)}`;
|
|
|
|
if (row !== undefined && stdout.isTTY) {
|
|
stdout.write(`\x1b[${row};1H\x1b[2K${line}`);
|
|
} else {
|
|
stdout.write(`\r\x1b[2K${line}`);
|
|
}
|
|
}
|