commitshow 0.3.21 → 0.3.23
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/render.js +190 -10
- package/package.json +1 -1
package/dist/lib/render.js
CHANGED
|
@@ -223,6 +223,175 @@ function bigText(text) {
|
|
|
223
223
|
}
|
|
224
224
|
return rows;
|
|
225
225
|
}
|
|
226
|
+
// XL digit font · 12×12 chunky pixel art for the trophy big-score. Only
|
|
227
|
+
// uses `█` and ` ` so horizontal scaling stays clean (ANSI Shadow's
|
|
228
|
+
// box-drawing chars don't tile when doubled — `╔╔` reads as garbage).
|
|
229
|
+
// Designed proportionally (≈ 1:1.3 visual ratio because terminal cells
|
|
230
|
+
// are ~2:1 H:W) so a 2-digit score reads as "scaled up", not
|
|
231
|
+
// "elongated". Used by bigTextXL · NOT by bigText (which still does
|
|
232
|
+
// ANSI Shadow for any future banner use).
|
|
233
|
+
const XL_ROWS = 12;
|
|
234
|
+
const BIG_DIGITS_XL = {
|
|
235
|
+
"0": [
|
|
236
|
+
" ████████ ",
|
|
237
|
+
" ██ ██ ",
|
|
238
|
+
"██ ██",
|
|
239
|
+
"██ ██",
|
|
240
|
+
"██ ██",
|
|
241
|
+
"██ ██",
|
|
242
|
+
"██ ██",
|
|
243
|
+
"██ ██",
|
|
244
|
+
"██ ██",
|
|
245
|
+
"██ ██",
|
|
246
|
+
" ██ ██ ",
|
|
247
|
+
" ████████ ",
|
|
248
|
+
],
|
|
249
|
+
"1": [
|
|
250
|
+
" ██ ",
|
|
251
|
+
" ███ ",
|
|
252
|
+
" ████ ",
|
|
253
|
+
" ██ ",
|
|
254
|
+
" ██ ",
|
|
255
|
+
" ██ ",
|
|
256
|
+
" ██ ",
|
|
257
|
+
" ██ ",
|
|
258
|
+
" ██ ",
|
|
259
|
+
" ██ ",
|
|
260
|
+
" ██ ",
|
|
261
|
+
"████████████",
|
|
262
|
+
],
|
|
263
|
+
"2": [
|
|
264
|
+
" ████████ ",
|
|
265
|
+
"██ ██",
|
|
266
|
+
" ██",
|
|
267
|
+
" ██ ",
|
|
268
|
+
" ██ ",
|
|
269
|
+
" ██ ",
|
|
270
|
+
" ██ ",
|
|
271
|
+
" ██ ",
|
|
272
|
+
" ██ ",
|
|
273
|
+
" ██ ",
|
|
274
|
+
"██ ",
|
|
275
|
+
"████████████",
|
|
276
|
+
],
|
|
277
|
+
"3": [
|
|
278
|
+
" ████████ ",
|
|
279
|
+
"██ ██",
|
|
280
|
+
" ██",
|
|
281
|
+
" ██",
|
|
282
|
+
" ██",
|
|
283
|
+
" ████████ ",
|
|
284
|
+
" ██",
|
|
285
|
+
" ██",
|
|
286
|
+
" ██",
|
|
287
|
+
" ██",
|
|
288
|
+
"██ ██",
|
|
289
|
+
" ████████ ",
|
|
290
|
+
],
|
|
291
|
+
"4": [
|
|
292
|
+
"██ ██",
|
|
293
|
+
"██ ██",
|
|
294
|
+
"██ ██",
|
|
295
|
+
"██ ██",
|
|
296
|
+
"██ ██",
|
|
297
|
+
"██ ██",
|
|
298
|
+
"████████████",
|
|
299
|
+
" ██",
|
|
300
|
+
" ██",
|
|
301
|
+
" ██",
|
|
302
|
+
" ██",
|
|
303
|
+
" ██",
|
|
304
|
+
],
|
|
305
|
+
"5": [
|
|
306
|
+
"████████████",
|
|
307
|
+
"██ ",
|
|
308
|
+
"██ ",
|
|
309
|
+
"██ ",
|
|
310
|
+
"██ ",
|
|
311
|
+
"███████████ ",
|
|
312
|
+
" ██",
|
|
313
|
+
" ██",
|
|
314
|
+
" ██",
|
|
315
|
+
" ██",
|
|
316
|
+
"██ ██",
|
|
317
|
+
" ████████ ",
|
|
318
|
+
],
|
|
319
|
+
"6": [
|
|
320
|
+
" ████████ ",
|
|
321
|
+
"██ ██",
|
|
322
|
+
"██ ",
|
|
323
|
+
"██ ",
|
|
324
|
+
"██ ",
|
|
325
|
+
"███████████ ",
|
|
326
|
+
"██ ██",
|
|
327
|
+
"██ ██",
|
|
328
|
+
"██ ██",
|
|
329
|
+
"██ ██",
|
|
330
|
+
"██ ██",
|
|
331
|
+
" ████████ ",
|
|
332
|
+
],
|
|
333
|
+
"7": [
|
|
334
|
+
"████████████",
|
|
335
|
+
"████████████",
|
|
336
|
+
" ██",
|
|
337
|
+
" ██",
|
|
338
|
+
" ██ ",
|
|
339
|
+
" ██ ",
|
|
340
|
+
" ██ ",
|
|
341
|
+
" ██ ",
|
|
342
|
+
" ██ ",
|
|
343
|
+
" ██ ",
|
|
344
|
+
" ██ ",
|
|
345
|
+
" ██ ",
|
|
346
|
+
],
|
|
347
|
+
"8": [
|
|
348
|
+
" ████████ ",
|
|
349
|
+
"██ ██",
|
|
350
|
+
"██ ██",
|
|
351
|
+
"██ ██",
|
|
352
|
+
"██ ██",
|
|
353
|
+
" ████████ ",
|
|
354
|
+
"██ ██",
|
|
355
|
+
"██ ██",
|
|
356
|
+
"██ ██",
|
|
357
|
+
"██ ██",
|
|
358
|
+
"██ ██",
|
|
359
|
+
" ████████ ",
|
|
360
|
+
],
|
|
361
|
+
"9": [
|
|
362
|
+
" ████████ ",
|
|
363
|
+
"██ ██",
|
|
364
|
+
"██ ██",
|
|
365
|
+
"██ ██",
|
|
366
|
+
"██ ██",
|
|
367
|
+
" ███████████",
|
|
368
|
+
" ██",
|
|
369
|
+
" ██",
|
|
370
|
+
" ██",
|
|
371
|
+
" ██",
|
|
372
|
+
"██ ██",
|
|
373
|
+
" ████████ ",
|
|
374
|
+
],
|
|
375
|
+
" ": [
|
|
376
|
+
" ", " ", " ", " ", " ", " ",
|
|
377
|
+
" ", " ", " ", " ", " ", " ",
|
|
378
|
+
],
|
|
379
|
+
};
|
|
380
|
+
/** XL render · 12-row chunky pixel art, used by the trophy. 1-space
|
|
381
|
+
* gutter between glyphs, no leading/trailing pad (each glyph already
|
|
382
|
+
* carries internal whitespace). */
|
|
383
|
+
function bigTextXL(text) {
|
|
384
|
+
const rows = Array.from({ length: XL_ROWS }, () => '');
|
|
385
|
+
const GAP = ' ';
|
|
386
|
+
for (let i = 0; i < text.length; i++) {
|
|
387
|
+
const ch = text[i];
|
|
388
|
+
const glyph = BIG_DIGITS_XL[ch] ?? BIG_DIGITS_XL[' '];
|
|
389
|
+
for (let r = 0; r < XL_ROWS; r++) {
|
|
390
|
+
rows[r] += glyph[r] + (i < text.length - 1 ? GAP : '');
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
return rows;
|
|
394
|
+
}
|
|
226
395
|
/** Visible (rune) length — counts Unicode code points so the centering math
|
|
227
396
|
* treats `█` and `╔` as one column each, matching how monospace terminals
|
|
228
397
|
* render the ANSI Shadow font. */
|
|
@@ -301,11 +470,22 @@ export function renderAudit(view) {
|
|
|
301
470
|
const WALK_ON_AUDIT_MAX = 50;
|
|
302
471
|
const isWalkOn = p.status === 'preview';
|
|
303
472
|
const total = p.score_total ?? 0;
|
|
304
|
-
// Header · Claude Code-style welcome strip. Rounded corners (╭ ╮ ╰ ╯)
|
|
305
|
-
// + ✻ glyph match the visual signature Claude Code uses on launch.
|
|
306
|
-
// The ✻ is part of the wordmark line, not a separate panel — keeps
|
|
307
|
-
// the header to a single tight row.
|
|
308
473
|
const lines = [];
|
|
474
|
+
// Big COMMIT.SHOW ANSI Shadow banner. The wordmark needs ~105 cells
|
|
475
|
+
// including indent — show it whenever the terminal can fit it. Falls
|
|
476
|
+
// back to the small Claude-style strip below on narrow terminals so
|
|
477
|
+
// the brand still lands. COLUMNS env var is a fallback when stdout
|
|
478
|
+
// isn't a TTY (CI logs · piped output).
|
|
479
|
+
const cols = process.stdout.columns
|
|
480
|
+
?? (process.env.COLUMNS ? Number(process.env.COLUMNS) : 80);
|
|
481
|
+
const bannerRows = bigText('COMMIT.SHOW');
|
|
482
|
+
if (cols >= bannerRows[0].length + 2) {
|
|
483
|
+
for (const r of bannerRows)
|
|
484
|
+
lines.push(' ' + c.gold(r));
|
|
485
|
+
lines.push('');
|
|
486
|
+
}
|
|
487
|
+
// Claude Code-style welcome strip · rounded corners + ✻ glyph. Always
|
|
488
|
+
// shown so the brand mark lands even when the big banner doesn't fit.
|
|
309
489
|
const roundTop = c.muted('╭' + '─'.repeat(INSIDE_W) + '╮');
|
|
310
490
|
const roundBottom = c.muted('╰' + '─'.repeat(INSIDE_W) + '╯');
|
|
311
491
|
lines.push(roundTop);
|
|
@@ -456,12 +636,12 @@ export function renderAudit(view) {
|
|
|
456
636
|
// showing project identity, score, and brand mark in one frame.
|
|
457
637
|
const band = total >= 75 ? 'strong' : total >= 50 ? 'mid' : 'weak';
|
|
458
638
|
const bandTone = scoreTone(total);
|
|
459
|
-
//
|
|
460
|
-
//
|
|
461
|
-
//
|
|
462
|
-
//
|
|
463
|
-
//
|
|
464
|
-
const bigRows = bigText(String(total))
|
|
639
|
+
// Original ANSI Shadow at 6-row native size · the box-drawing chars
|
|
640
|
+
// (╔ ╗ ║ ═ ╚ ╝) give an embossed 3D feel that pure-block scaling
|
|
641
|
+
// (BIG_DIGITS_XL · 0.3.22) flattens out. Reverted on user note that
|
|
642
|
+
// "입체효과가 없어졌다". Keep the gold gradient on top for the
|
|
643
|
+
// metallic finish — that part was approved.
|
|
644
|
+
const bigRows = bigText(String(total));
|
|
465
645
|
const bigWidth = bigRows[0].length;
|
|
466
646
|
// Trophy: name strip + big digits + caption inside one ╔═╗ frame so a
|
|
467
647
|
// crop of just the trophy tells the whole story (project · score · band).
|