@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 CHANGED
@@ -1,70 +1,47 @@
1
1
  /**
2
- * Smart logo display module
3
- * Attempts to display iTerm2 image format logo, falls back to ASCII art
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
- const __filename = fileURLToPath(import.meta.url);
10
- const __dirname = dirname(__filename);
11
- /**
12
- * Create blue-toned gradient effect
13
- */
14
- function createBlueGradient(text) {
15
- const blueGradient = gradient([
16
- { color: '#1e3a8a', pos: 0 }, // Deep blue
17
- { color: '#0ea5e9', pos: 0.5 }, // Sky blue
18
- { color: '#06b6d4', pos: 1 } // Cyan
19
- ]);
20
- return blueGradient(text);
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
- else {
32
- console.log(createBlueGradient(tagline));
23
+ catch {
24
+ return null;
33
25
  }
34
- console.log();
35
26
  }
36
- /**
37
- * Attempt to read and display logo file
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
- try {
44
- const logoPath = join(__dirname, '../logo/logo.txt');
45
- const logoContent = readFileSync(logoPath, 'utf-8');
46
- if (logoContent && logoContent.length > 100) {
47
- console.log(logoContent);
48
- printDescription();
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nbtca/prompt",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "exports": {
@@ -1,12 +0,0 @@
1
- ⠀⠀⠀⠀⠀⠀⣀⠤⡐⣒⣈⡉⡉⠁⠒⠂⠤⣀⠀⠀⠀⠀⠀⠀
2
- ⠀⠀⠀⢀⠔⣋⠄⣀⠤⠜⠒⠒⠒⠒⠣⠤⣁⢤⢙⠢⡀⠀⠀⠀
3
- ⠀⠀⡴⣡⠈⡥⠊⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠑⢬⡠⡈⢦⠀⠀
4
- ⠀⡜⡀⢪⠮⠐⠒⠂⠠⢀⠀⠀⠀⡀⠄⠐⠒⠀⠄⡑⡔⢀⢣⠀
5
- ⠸⠀⢳⣷⣆⠠⠀⠀⠠⡀⠱⠀⣾⣶⣀⠤⠀⠠⢄⠈⠞⡈⡀⠇
6
- ⡇⠄⠸⠉⠁⠀⠀⠀⠀⠈⠈⠀⠉⠉⠀⠀⠀⠀⠀⠁⠀⠇⣠⢸
7
- ⡇⠍⢠⢀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡄⢋⢸
8
- ⢱⠀⠘⡄⠆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠇⢠⠃⠀⡎
9
- ⠀⢆⢺⠐⡌⢀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠎⢠⢢⡁⡰⠀
10
- ⠀⠈⠣⡂⢪⠢⡁⠢⢀⡀⠀⠀⠀⠀⣀⠠⠒⢁⠔⠅⢈⠜⠁⠀
11
- ⠀⠀⠀⠙⠢⡀⠴⠑⢂⠤⠉⢉⡉⠁⠤⠐⠊⠤⢅⠔⠋⠀⠀⠀
12
- ⠀⠀⠀⠀⠀⠈⠑⠢⠤⣐⣘⣒⣁⣒⣐⠤⠔⠊⠁⠀⠀⠀⠀⠀