@house365/comate 0.2.9 → 0.2.10
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/bin/init-run.mjs +57 -9
- package/package.json +1 -1
package/bin/init-run.mjs
CHANGED
|
@@ -235,18 +235,66 @@ export function banner(version, { ci = isCI() } = {}) {
|
|
|
235
235
|
'╚██████╗╚██████╔╝██║ ╚═╝ ██║██║ ██║ ██║ ███████╗',
|
|
236
236
|
' ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚══════╝',
|
|
237
237
|
];
|
|
238
|
-
//
|
|
239
|
-
//
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
238
|
+
// Trailing padding keeps the source rows aligned; strip it so a colour run
|
|
239
|
+
// doesn't sit behind spaces the terminal may highlight on select.
|
|
240
|
+
const trim = (line) => line.replace(/\s+$/, '');
|
|
241
|
+
// Centred under the art, not under the terminal: the wordmark is fixed-width,
|
|
242
|
+
// so centring against art[0] holds at any window size. Computed rather than
|
|
243
|
+
// hardcoded because the version string changes length on every release.
|
|
244
|
+
const tagline = `${tag} - AI coding almost there!`;
|
|
245
|
+
const indent = ' '.repeat(2 + Math.max(0, Math.round((art[0].length - tagline.length) / 2)));
|
|
246
|
+
if (process.env.NO_COLOR) {
|
|
247
|
+
return ['', ...art.map((l) => ` ${trim(l)}`), '', `${indent}${tagline}`, ''].join('\n');
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// 24-bit SGR. Truecolor is not universal, but the two terminals that matter
|
|
251
|
+
// here (Windows Terminal, VS Code) both support it, and one that doesn't
|
|
252
|
+
// degrades to its nearest palette entry rather than breaking.
|
|
253
|
+
const sgr = ([r, g, b]) => `\x1B[38;2;${r};${g};${b}m`;
|
|
254
|
+
const RESET = '\x1B[0m';
|
|
255
|
+
|
|
256
|
+
// Polished chrome under a cyan→magenta rim light: [face, edge] per row. The
|
|
257
|
+
// ramp shifts hue rather than dropping brightness — every row stays high
|
|
258
|
+
// luminance, which is what keeps it reading as lit metal instead of fading
|
|
259
|
+
// out. An earlier darkening ramp went muddy across the bottom half.
|
|
260
|
+
const ramp = [
|
|
261
|
+
[[255, 255, 255], [150, 240, 255]],
|
|
262
|
+
[[214, 248, 255], [ 56, 214, 255]],
|
|
263
|
+
[[168, 214, 255], [ 92, 148, 255]],
|
|
264
|
+
[[186, 160, 255], [148, 100, 255]],
|
|
265
|
+
[[233, 150, 255], [200, 76, 255]],
|
|
266
|
+
[[255, 150, 224], [255, 72, 178]],
|
|
267
|
+
];
|
|
268
|
+
|
|
269
|
+
// Blocks are the lit face, box-drawing pieces are the bevelled edge. Two
|
|
270
|
+
// shades per row is the whole trick: it gives every glyph a rim, which is
|
|
271
|
+
// what separates brushed metal from a flat decal.
|
|
272
|
+
const emboss = (line, [face, edge]) => {
|
|
273
|
+
let out = '';
|
|
274
|
+
let cur = null;
|
|
275
|
+
for (const ch of line) {
|
|
276
|
+
const want = ch === ' ' ? null : ch === '█' ? face : edge;
|
|
277
|
+
if (want !== cur) {
|
|
278
|
+
out += want ? sgr(want) : RESET;
|
|
279
|
+
cur = want;
|
|
280
|
+
}
|
|
281
|
+
out += ch;
|
|
282
|
+
}
|
|
283
|
+
return out + RESET;
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
// The tagline picks up the ramp instead of going dim grey: the name in the
|
|
287
|
+
// white highlight so it stays the thing you read first, the strapline in the
|
|
288
|
+
// magenta rim so the line closes the gradient the art opened. Dropping \x1B[2m
|
|
289
|
+
// matters — dim on a saturated colour is what made this read as washed out.
|
|
290
|
+
const nameLit = `${sgr(ramp[0][0])}${tag}${RESET}`;
|
|
291
|
+
const strap = `${sgr(ramp[5][1])} - AI coding almost there!${RESET}`;
|
|
292
|
+
|
|
243
293
|
return [
|
|
244
294
|
'',
|
|
245
|
-
|
|
246
|
-
// reset doesn't sit behind spaces the terminal may highlight on select.
|
|
247
|
-
...art.map((line) => ` ${brand(line.replace(/\s+$/, ''))}`),
|
|
295
|
+
...art.map((line, i) => ` ${emboss(trim(line), ramp[i])}`),
|
|
248
296
|
'',
|
|
249
|
-
|
|
297
|
+
`${indent}${nameLit}${strap}`,
|
|
250
298
|
'',
|
|
251
299
|
].join('\n');
|
|
252
300
|
}
|