braeburn 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ui/header.js +25 -0
- package/package.json +1 -1
package/dist/ui/header.js
CHANGED
|
@@ -2,6 +2,19 @@ import chalk from "chalk";
|
|
|
2
2
|
import { LOGO_ART } from "../logo.js";
|
|
3
3
|
const LOGO_COLUMN_WIDTH = 32;
|
|
4
4
|
const LOGO_SEPARATOR = " ";
|
|
5
|
+
const MIN_SIDE_BY_SIDE_COLS = LOGO_COLUMN_WIDTH + LOGO_SEPARATOR.length + 20; // 56
|
|
6
|
+
function determineLogoLayout(logoLines) {
|
|
7
|
+
const cols = process.stdout.columns ?? 80;
|
|
8
|
+
const rows = process.stdout.rows ?? 24;
|
|
9
|
+
if (cols >= MIN_SIDE_BY_SIDE_COLS) {
|
|
10
|
+
return "side-by-side";
|
|
11
|
+
}
|
|
12
|
+
// Not wide enough for side-by-side — stack if there are enough rows.
|
|
13
|
+
if (rows >= logoLines.length + 6) {
|
|
14
|
+
return "stacked";
|
|
15
|
+
}
|
|
16
|
+
return "none";
|
|
17
|
+
}
|
|
5
18
|
function stepTrackerIcon(phase) {
|
|
6
19
|
if (phase === "complete")
|
|
7
20
|
return chalk.green("✓ ");
|
|
@@ -50,6 +63,18 @@ export function buildHeaderLines(options) {
|
|
|
50
63
|
return rightColumnLines;
|
|
51
64
|
}
|
|
52
65
|
const logoLines = LOGO_ART.split("\n");
|
|
66
|
+
const layout = determineLogoLayout(logoLines);
|
|
67
|
+
if (layout === "none") {
|
|
68
|
+
return rightColumnLines;
|
|
69
|
+
}
|
|
70
|
+
if (layout === "stacked") {
|
|
71
|
+
return [
|
|
72
|
+
...logoLines.map((line) => chalk.yellow(line)),
|
|
73
|
+
"",
|
|
74
|
+
...rightColumnLines,
|
|
75
|
+
];
|
|
76
|
+
}
|
|
77
|
+
// side-by-side
|
|
53
78
|
const totalLines = Math.max(logoLines.length, rightColumnLines.length);
|
|
54
79
|
const result = [];
|
|
55
80
|
for (let i = 0; i < totalLines; i++) {
|