@nbtca/prompt 1.1.0 → 1.1.1
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/core/logo.js +35 -58
- package/dist/logo/ca-dotmatrix.txt +16 -0
- package/package.json +1 -1
- package/dist/logo/logo.txt +0 -12
package/dist/core/logo.js
CHANGED
|
@@ -1,70 +1,47 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* Startup logo: a high-precision braille dot-matrix render of the NBTCA emblem
|
|
3
|
+
* (generated from CA-logo.svg), shown with the brand blue->cyan gradient.
|
|
4
|
+
* Falls back to plain ASCII on terminals without Unicode/braille support.
|
|
4
5
|
*/
|
|
5
6
|
import { readFileSync } from 'fs';
|
|
6
7
|
import { fileURLToPath } from 'url';
|
|
7
8
|
import { dirname, join } from 'path';
|
|
8
9
|
import gradient from 'gradient-string';
|
|
9
|
-
|
|
10
|
-
const __dirname = dirname(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Display description text (instant, no animation)
|
|
24
|
-
*/
|
|
25
|
-
function printDescription() {
|
|
26
|
-
const tagline = 'To be at the intersection of technology and liberal arts.';
|
|
27
|
-
console.log();
|
|
28
|
-
if (process.env['NO_COLOR']) {
|
|
29
|
-
console.log(tagline);
|
|
10
|
+
import { useUnicodeIcons } from './icons.js';
|
|
11
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
12
|
+
const TAGLINE = 'To be at the intersection of technology and liberal arts.';
|
|
13
|
+
// Brand gradient: emblem blue -> sky -> cyan.
|
|
14
|
+
const brand = gradient([
|
|
15
|
+
{ color: '#124689', pos: 0 },
|
|
16
|
+
{ color: '#0ea5e9', pos: 0.55 },
|
|
17
|
+
{ color: '#06b6d4', pos: 1 },
|
|
18
|
+
]);
|
|
19
|
+
function readArt(file) {
|
|
20
|
+
try {
|
|
21
|
+
return readFileSync(join(__dirname, '../logo', file), 'utf-8').replace(/\s+$/, '');
|
|
30
22
|
}
|
|
31
|
-
|
|
32
|
-
|
|
23
|
+
catch {
|
|
24
|
+
return null;
|
|
33
25
|
}
|
|
34
|
-
console.log();
|
|
35
26
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
27
|
+
function paint(text, color) {
|
|
28
|
+
if (!color)
|
|
29
|
+
return text;
|
|
30
|
+
// multiline keeps the gradient aligned down the whole block; fall back to a
|
|
31
|
+
// per-line gradient if the installed gradient-string lacks .multiline.
|
|
32
|
+
const fn = brand;
|
|
33
|
+
return typeof fn.multiline === 'function'
|
|
34
|
+
? fn.multiline(text)
|
|
35
|
+
: text.split('\n').map((line) => brand(line)).join('\n');
|
|
36
|
+
}
|
|
39
37
|
export function printLogo() {
|
|
40
|
-
if (!process.stdout.isTTY)
|
|
38
|
+
if (!process.stdout.isTTY)
|
|
41
39
|
return;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
catch {
|
|
53
|
-
// iTerm2 logo read failed, continue trying ASCII logo
|
|
54
|
-
}
|
|
55
|
-
try {
|
|
56
|
-
const asciiLogoPath = join(__dirname, '../logo/ascii-logo.txt');
|
|
57
|
-
const asciiContent = readFileSync(asciiLogoPath, 'utf-8');
|
|
58
|
-
console.log();
|
|
59
|
-
const lines = asciiContent.split('\n').filter(line => line.trim());
|
|
60
|
-
lines.forEach(line => {
|
|
61
|
-
console.log(createBlueGradient(line));
|
|
62
|
-
});
|
|
63
|
-
printDescription();
|
|
64
|
-
}
|
|
65
|
-
catch {
|
|
66
|
-
console.log();
|
|
67
|
-
console.log(createBlueGradient(' NBTCA'));
|
|
68
|
-
printDescription();
|
|
69
|
-
}
|
|
40
|
+
const color = !process.env['NO_COLOR'];
|
|
41
|
+
const art = useUnicodeIcons() ? readArt('ca-dotmatrix.txt') : readArt('ascii-logo.txt');
|
|
42
|
+
console.log();
|
|
43
|
+
console.log(paint(art ?? 'NBTCA', color));
|
|
44
|
+
console.log();
|
|
45
|
+
console.log(color ? brand(TAGLINE) : TAGLINE);
|
|
46
|
+
console.log();
|
|
70
47
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣴⡶⢞⢛⣛⣛⣛⣛⣛⡳⠶⣦⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀
|
|
2
|
+
⠀⠀⠀⠀⠀⢀⣤⠾⡋⠁⠘⢽⣛⣿⣯⣿⣭⣯⣿⣛⡁⢴⣮⡝⠷⣤⡀⠀⠀⠀⠀⠀
|
|
3
|
+
⠀⠀⠀⢀⣴⢟⣵⡿⣻⡵⠞⠋⠉⠀⠀⠀⠀⠀⠀⠉⠙⠳⢮⣟⢷⣎⡻⣦⡀⠀⠀⠀
|
|
4
|
+
⠀⠀⣠⡟⣵⡦⣩⠞⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠳⣝⢿⣎⣻⣄⠀⠀
|
|
5
|
+
⠀⣰⠏⣼⣎⣾⡥⠶⠶⠶⠶⢤⣀⠀⠀⠀⠀⠀⣠⡤⠶⠶⠶⠦⣄⡈⢷⣻⣯⠹⣆⠀
|
|
6
|
+
⢰⣟⣾⣿⣾⣥⠀⢀⣀⣀⣀⡀⠈⠳⡄⠀⣴⣯⣅⠀⢀⣀⣀⣀⠀⠙⢮⣷⡹⣃⢻⡆
|
|
7
|
+
⣾⢱⣬⣿⣿⣿⠟⠋⠉⠀⠈⠉⠳⣄⣿⠐⣿⣿⣿⠞⠉⠉⠉⠉⠙⢦⣀⡟⣧⠿⠬⣷
|
|
8
|
+
⣿⢸⡅⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⢰⣶⣿
|
|
9
|
+
⣿⢨⣁⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⢸⢿⣿
|
|
10
|
+
⢿⡸⣿⢿⡄⣧⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⠃⢠⡟⠈⢉⡿
|
|
11
|
+
⠸⣧⢷⣏⢷⠘⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⠏⠀⡾⣭⡷⣿⠇
|
|
12
|
+
⠀⠹⣎⢽⣎⢷⡘⢧⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⠋⢀⡾⣵⡦⣰⠏⠀
|
|
13
|
+
⠀⠀⠙⣧⡻⣷⣝⢦⡙⠲⣤⣀⠀⠀⠀⠀⠀⠀⠀⢀⣠⡴⠋⢁⡴⣫⣌⢛⣼⠋⠀⠀
|
|
14
|
+
⠀⠀⠀⠈⠻⣮⡿⣡⣽⡳⢤⣍⡙⠓⠒⠶⠖⠒⠛⢉⣡⡤⣞⣫⣦⢙⣵⠟⠁⠀⠀⠀
|
|
15
|
+
⠀⠀⠀⠀⠀⠈⠛⢷⣍⡁⠷⣞⣭⣟⣟⣟⣛⢛⣿⣭⣵⠆⢛⣩⡷⠛⠁⠀⠀⠀⠀⠀
|
|
16
|
+
⠀⠀⠀⠀⠀⠀⠀⠀⠈⠙⠻⠶⢯⣭⣭⣭⣭⣭⣭⡽⠶⠟⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀
|
package/package.json
CHANGED
package/dist/logo/logo.txt
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
⠀⠀⠀⠀⠀⠀⣀⠤⡐⣒⣈⡉⡉⠁⠒⠂⠤⣀⠀⠀⠀⠀⠀⠀
|
|
2
|
-
⠀⠀⠀⢀⠔⣋⠄⣀⠤⠜⠒⠒⠒⠒⠣⠤⣁⢤⢙⠢⡀⠀⠀⠀
|
|
3
|
-
⠀⠀⡴⣡⠈⡥⠊⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠑⢬⡠⡈⢦⠀⠀
|
|
4
|
-
⠀⡜⡀⢪⠮⠐⠒⠂⠠⢀⠀⠀⠀⡀⠄⠐⠒⠀⠄⡑⡔⢀⢣⠀
|
|
5
|
-
⠸⠀⢳⣷⣆⠠⠀⠀⠠⡀⠱⠀⣾⣶⣀⠤⠀⠠⢄⠈⠞⡈⡀⠇
|
|
6
|
-
⡇⠄⠸⠉⠁⠀⠀⠀⠀⠈⠈⠀⠉⠉⠀⠀⠀⠀⠀⠁⠀⠇⣠⢸
|
|
7
|
-
⡇⠍⢠⢀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡄⢋⢸
|
|
8
|
-
⢱⠀⠘⡄⠆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠇⢠⠃⠀⡎
|
|
9
|
-
⠀⢆⢺⠐⡌⢀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠎⢠⢢⡁⡰⠀
|
|
10
|
-
⠀⠈⠣⡂⢪⠢⡁⠢⢀⡀⠀⠀⠀⠀⣀⠠⠒⢁⠔⠅⢈⠜⠁⠀
|
|
11
|
-
⠀⠀⠀⠙⠢⡀⠴⠑⢂⠤⠉⢉⡉⠁⠤⠐⠊⠤⢅⠔⠋⠀⠀⠀
|
|
12
|
-
⠀⠀⠀⠀⠀⠈⠑⠢⠤⣐⣘⣒⣁⣒⣐⠤⠔⠊⠁⠀⠀⠀⠀⠀
|