commitshow 0.3.5 → 0.3.9
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/lib/colors.js +6 -1
- package/dist/lib/render.js +119 -153
- package/package.json +1 -1
package/dist/lib/colors.js
CHANGED
|
@@ -11,7 +11,12 @@ function rgb(r, g, b) {
|
|
|
11
11
|
}
|
|
12
12
|
export const c = {
|
|
13
13
|
gold: rgb(0xF0, 0xC0, 0x40),
|
|
14
|
-
goldDeep: rgb(0xD4, 0xA8, 0x38), // slightly darker · used for
|
|
14
|
+
goldDeep: rgb(0xD4, 0xA8, 0x38), // slightly darker · used for box drawing
|
|
15
|
+
// Big-digit hero ink · uses brand gold so the ANSI Shadow numeral reads
|
|
16
|
+
// as a commit.show mark, not a Claude Code mascot. (Earlier peach pass
|
|
17
|
+
// matched the Claude Code logo too literally — CEO pulled it back to
|
|
18
|
+
// brand on 2026-05-02.)
|
|
19
|
+
pixelInk: rgb(0xF0, 0xC0, 0x40),
|
|
15
20
|
cream: rgb(0xF8, 0xF5, 0xEE),
|
|
16
21
|
teal: rgb(0x00, 0xD4, 0xAA),
|
|
17
22
|
scarlet: rgb(0xC8, 0x10, 0x2E),
|
package/dist/lib/render.js
CHANGED
|
@@ -23,176 +23,142 @@ function scoreBar(value, max) {
|
|
|
23
23
|
const tone = scoreTone(Math.round((value / max) * 100));
|
|
24
24
|
return tone('▰'.repeat(filled)) + c.muted('▱'.repeat(empty));
|
|
25
25
|
}
|
|
26
|
-
// 10-row × 8-col chunky pixel digit set · two-cell-thick 7-segment digital
|
|
27
|
-
// numerals. CEO referenced the Claude Code "CLAUDE CODE" pixel-grid logo:
|
|
28
|
-
// thick block strokes, segment thickness 2 in pixel space, segments visibly
|
|
29
|
-
// chunky enough to read as a pixel-art numeral on a wide terminal. Solid
|
|
30
|
-
// '█' only — no half-blocks — so the digits stay opaque on every monospace
|
|
31
|
-
// font. Each digit fits in 8 columns; a 3-digit "100" still lands inside
|
|
32
|
-
// the 58-char box with breathing room.
|
|
33
26
|
const BIG_DIGITS = {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
'██ ██',
|
|
43
|
-
'████████',
|
|
44
|
-
'████████',
|
|
27
|
+
"0": [
|
|
28
|
+
"11111",
|
|
29
|
+
"10001",
|
|
30
|
+
"10001",
|
|
31
|
+
"10001",
|
|
32
|
+
"10001",
|
|
33
|
+
"10001",
|
|
34
|
+
"11111",
|
|
45
35
|
],
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
' ██',
|
|
55
|
-
' ██',
|
|
56
|
-
' ██',
|
|
36
|
+
"1": [
|
|
37
|
+
"00100",
|
|
38
|
+
"01100",
|
|
39
|
+
"00100",
|
|
40
|
+
"00100",
|
|
41
|
+
"00100",
|
|
42
|
+
"00100",
|
|
43
|
+
"01110",
|
|
57
44
|
],
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
'██ ',
|
|
67
|
-
'████████',
|
|
68
|
-
'████████',
|
|
45
|
+
"2": [
|
|
46
|
+
"11111",
|
|
47
|
+
"00001",
|
|
48
|
+
"00001",
|
|
49
|
+
"11111",
|
|
50
|
+
"10000",
|
|
51
|
+
"10000",
|
|
52
|
+
"11111",
|
|
69
53
|
],
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
' ██',
|
|
79
|
-
'████████',
|
|
80
|
-
'████████',
|
|
54
|
+
"3": [
|
|
55
|
+
"11111",
|
|
56
|
+
"00001",
|
|
57
|
+
"00001",
|
|
58
|
+
"11111",
|
|
59
|
+
"00001",
|
|
60
|
+
"00001",
|
|
61
|
+
"11111",
|
|
81
62
|
],
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
' ██',
|
|
91
|
-
' ██',
|
|
92
|
-
' ██',
|
|
63
|
+
"4": [
|
|
64
|
+
"10001",
|
|
65
|
+
"10001",
|
|
66
|
+
"10001",
|
|
67
|
+
"11111",
|
|
68
|
+
"00001",
|
|
69
|
+
"00001",
|
|
70
|
+
"00001",
|
|
93
71
|
],
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
' ██',
|
|
103
|
-
'████████',
|
|
104
|
-
'████████',
|
|
72
|
+
"5": [
|
|
73
|
+
"11111",
|
|
74
|
+
"10000",
|
|
75
|
+
"10000",
|
|
76
|
+
"11111",
|
|
77
|
+
"00001",
|
|
78
|
+
"00001",
|
|
79
|
+
"11111",
|
|
105
80
|
],
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
'██ ██',
|
|
115
|
-
'████████',
|
|
116
|
-
'████████',
|
|
81
|
+
"6": [
|
|
82
|
+
"11111",
|
|
83
|
+
"10000",
|
|
84
|
+
"10000",
|
|
85
|
+
"11111",
|
|
86
|
+
"10001",
|
|
87
|
+
"10001",
|
|
88
|
+
"11111",
|
|
117
89
|
],
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
' ██',
|
|
127
|
-
' ██',
|
|
128
|
-
' ██',
|
|
90
|
+
"7": [
|
|
91
|
+
"11111",
|
|
92
|
+
"00001",
|
|
93
|
+
"00001",
|
|
94
|
+
"00001",
|
|
95
|
+
"00001",
|
|
96
|
+
"00001",
|
|
97
|
+
"00001",
|
|
129
98
|
],
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
'██ ██',
|
|
139
|
-
'████████',
|
|
140
|
-
'████████',
|
|
99
|
+
"8": [
|
|
100
|
+
"11111",
|
|
101
|
+
"10001",
|
|
102
|
+
"10001",
|
|
103
|
+
"11111",
|
|
104
|
+
"10001",
|
|
105
|
+
"10001",
|
|
106
|
+
"11111",
|
|
141
107
|
],
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
' ██',
|
|
151
|
-
'████████',
|
|
152
|
-
'████████',
|
|
108
|
+
"9": [
|
|
109
|
+
"11111",
|
|
110
|
+
"10001",
|
|
111
|
+
"10001",
|
|
112
|
+
"11111",
|
|
113
|
+
"00001",
|
|
114
|
+
"00001",
|
|
115
|
+
"11111",
|
|
153
116
|
],
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
'██ ',
|
|
163
|
-
'██ ',
|
|
164
|
-
'██ ',
|
|
117
|
+
"/": [
|
|
118
|
+
"00001",
|
|
119
|
+
"00001",
|
|
120
|
+
"00010",
|
|
121
|
+
"00100",
|
|
122
|
+
"01000",
|
|
123
|
+
"10000",
|
|
124
|
+
"10000",
|
|
165
125
|
],
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
' ',
|
|
175
|
-
' ',
|
|
176
|
-
' ',
|
|
126
|
+
" ": [
|
|
127
|
+
"00000",
|
|
128
|
+
"00000",
|
|
129
|
+
"00000",
|
|
130
|
+
"00000",
|
|
131
|
+
"00000",
|
|
132
|
+
"00000",
|
|
133
|
+
"00000",
|
|
177
134
|
],
|
|
178
135
|
};
|
|
179
|
-
const BIG_ROWS =
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
136
|
+
const BIG_ROWS = 7;
|
|
137
|
+
const PIXEL_FILL = "█"; // 1 char per pixel · halves width vs ██ so 3-digit scores stay inside narrow PC grid columns
|
|
138
|
+
const PIXEL_BLANK = " ";
|
|
139
|
+
const PIXEL_GAP = " "; // visible seam between pixels — the "block" feel
|
|
140
|
+
const DIGIT_GAP = " "; // wider gap between digits so they read as separate numerals
|
|
141
|
+
function digitToRows(d) {
|
|
142
|
+
const m = BIG_DIGITS[d] ?? BIG_DIGITS[" "];
|
|
143
|
+
return m.map(row => row.split("").map(c => c === "1" ? PIXEL_FILL : PIXEL_BLANK).join(PIXEL_GAP));
|
|
144
|
+
}
|
|
145
|
+
/** Render a string ("68", "100", "82/100") as a pixel-grid block numeral. */
|
|
185
146
|
function bigText(text) {
|
|
186
|
-
const rows = Array.from({ length: BIG_ROWS }, () =>
|
|
187
|
-
const
|
|
188
|
-
for (let i = 0; i <
|
|
189
|
-
const
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
147
|
+
const rows = Array.from({ length: BIG_ROWS }, () => "");
|
|
148
|
+
const chars = text.split("");
|
|
149
|
+
for (let i = 0; i < chars.length; i++) {
|
|
150
|
+
const glyph = digitToRows(chars[i]);
|
|
151
|
+
for (let r = 0; r < BIG_ROWS; r++) {
|
|
152
|
+
rows[r] += glyph[r] + (i < chars.length - 1 ? DIGIT_GAP : "");
|
|
153
|
+
}
|
|
193
154
|
}
|
|
194
155
|
return rows;
|
|
195
156
|
}
|
|
157
|
+
function bigTextWidth(text) {
|
|
158
|
+
if (text.length === 0)
|
|
159
|
+
return 0;
|
|
160
|
+
return [...bigText(text)[0]].length;
|
|
161
|
+
}
|
|
196
162
|
function pad(s, w) {
|
|
197
163
|
return s.length >= w ? s.slice(0, w) : s + ' '.repeat(w - s.length);
|
|
198
164
|
}
|
|
@@ -313,7 +279,7 @@ export function renderAudit(view) {
|
|
|
313
279
|
const bigWidth = bigRows[0].length;
|
|
314
280
|
const leftPad = Math.floor((58 - bigWidth) / 2);
|
|
315
281
|
for (const row of bigRows) {
|
|
316
|
-
lines.push(' ' + ' '.repeat(leftPad) + c.
|
|
282
|
+
lines.push(' ' + ' '.repeat(leftPad) + c.pixelInk(row));
|
|
317
283
|
}
|
|
318
284
|
// Breathing room between the hero ASCII and the small caption. Without
|
|
319
285
|
// it the "/ 100 · walk-on · strong" line glues to the bottom of the
|