subconscious-cli 4.0.5 → 4.0.6
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/branding.js +15 -20
- package/bin/colors.js +4 -3
- package/bin/update-check.js +8 -8
- package/package.json +1 -1
package/bin/branding.js
CHANGED
|
@@ -1,24 +1,19 @@
|
|
|
1
1
|
import { BRAND_ORANGE, colorEnabled } from './colors.js';
|
|
2
2
|
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
'
|
|
8
|
-
'
|
|
9
|
-
'
|
|
10
|
-
'
|
|
11
|
-
'
|
|
12
|
-
'
|
|
13
|
-
'
|
|
14
|
-
'
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
' ####### #######',
|
|
18
|
-
' ####### #######',
|
|
19
|
-
' ####### #######',
|
|
20
|
-
' ###### #####',
|
|
21
|
-
].join('\n');
|
|
3
|
+
// The compact terminal raster used by Subconscious Code. It preserves the
|
|
4
|
+
// proportions of logo.svg while remaining crisp in an 8-row terminal cell.
|
|
5
|
+
export const LOGO_GLYPH = '✻';
|
|
6
|
+
export const LOGO_ART_SMALL_LINES = [
|
|
7
|
+
' ███▄ ▄███',
|
|
8
|
+
' ████ ████',
|
|
9
|
+
' ██',
|
|
10
|
+
'▄██▄▄ ▄██▄ ▄▄██▄',
|
|
11
|
+
'▀███▀ ▀██▀ ▀███▀',
|
|
12
|
+
' ██',
|
|
13
|
+
' ████ ████',
|
|
14
|
+
' ███▀ ▀███',
|
|
15
|
+
];
|
|
16
|
+
export const LOGO_ART_SMALL = LOGO_ART_SMALL_LINES.join('\n');
|
|
22
17
|
|
|
23
18
|
const BOLD = '\x1b[1m';
|
|
24
19
|
const RESET = '\x1b[0m';
|
|
@@ -33,6 +28,6 @@ export function renderBanner(options = {}) {
|
|
|
33
28
|
// still get the same logo without ANSI styling.
|
|
34
29
|
if (!isTTY || term === 'dumb') return ` ${title}`;
|
|
35
30
|
|
|
36
|
-
const logo = color ? `${BRAND_ORANGE}${
|
|
31
|
+
const logo = color ? `${BRAND_ORANGE}${LOGO_ART_SMALL}${RESET}` : LOGO_ART_SMALL;
|
|
37
32
|
return `${logo}\n\n ${title}`;
|
|
38
33
|
}
|
package/bin/colors.js
CHANGED
|
@@ -14,7 +14,8 @@ const rgb = (red, green, blue) =>
|
|
|
14
14
|
colorEnabled ? `\x1b[38;2;${red};${green};${blue}m` : '';
|
|
15
15
|
const bgRgb = (red, green, blue) =>
|
|
16
16
|
colorEnabled ? `\x1b[48;2;${red};${green};${blue}m` : '';
|
|
17
|
-
|
|
17
|
+
// Match the Subconscious Code brand palette exactly (#FF5C27).
|
|
18
|
+
export const BRAND_ORANGE = '\x1b[38;2;255;92;39m';
|
|
18
19
|
|
|
19
20
|
export const c = {
|
|
20
21
|
reset: ansi(0),
|
|
@@ -27,8 +28,8 @@ export const c = {
|
|
|
27
28
|
magenta: ansi(35),
|
|
28
29
|
black: ansi(30),
|
|
29
30
|
orange: colorEnabled ? BRAND_ORANGE : '',
|
|
30
|
-
orangeSoft: rgb(
|
|
31
|
-
bgOrange: bgRgb(255, 92,
|
|
31
|
+
orangeSoft: rgb(184, 74, 30),
|
|
32
|
+
bgOrange: bgRgb(255, 92, 39),
|
|
32
33
|
underline: ansi(4),
|
|
33
34
|
inverse: ansi(7),
|
|
34
35
|
};
|
package/bin/update-check.js
CHANGED
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
import fs from 'node:fs/promises';
|
|
2
2
|
import { spawn } from 'node:child_process';
|
|
3
3
|
import readline from 'node:readline';
|
|
4
|
+
import { LOGO_ART_SMALL_LINES } from './branding.js';
|
|
4
5
|
import { c, colorEnabled } from './colors.js';
|
|
5
6
|
|
|
6
7
|
export const PACKAGE_NAME = 'subconscious-cli';
|
|
7
8
|
export const UPDATE_CHECK_TIMEOUT_MS = 1500;
|
|
8
9
|
const UPDATE_ACTIONS = ['Update now', 'Skip for now'];
|
|
9
|
-
const UPDATE_LOGO =
|
|
10
|
-
' ● ●',
|
|
11
|
-
' ╲ ╱ ',
|
|
12
|
-
'●─── ╳ ───●',
|
|
13
|
-
' ╱ ╲ ',
|
|
14
|
-
' ● ●',
|
|
15
|
-
];
|
|
10
|
+
const UPDATE_LOGO = LOGO_ART_SMALL_LINES;
|
|
16
11
|
|
|
17
12
|
function parseVersion(version) {
|
|
18
13
|
const match = String(version)
|
|
@@ -94,11 +89,16 @@ export async function fetchLatestVersion(options = {}) {
|
|
|
94
89
|
export function renderUpdateNotice(installedVersion, latestVersion) {
|
|
95
90
|
const logoWidth = Math.max(...UPDATE_LOGO.map((line) => line.length));
|
|
96
91
|
const textWidth = 24;
|
|
97
|
-
const gap = '
|
|
92
|
+
const gap = ' ';
|
|
98
93
|
const innerWidth = logoWidth + gap.length + textWidth + 2;
|
|
99
94
|
const border = `${c.orange}╭${'─'.repeat(innerWidth)}╮${c.reset}`;
|
|
100
95
|
const bottom = `${c.orange}╰${'─'.repeat(innerWidth)}╯${c.reset}`;
|
|
96
|
+
// Match SC's splash composition by bottom-aligning the copy beside the
|
|
97
|
+
// eight-row logo, with a two-cell gutter between the two columns.
|
|
101
98
|
const text = [
|
|
99
|
+
{ raw: '', value: '' },
|
|
100
|
+
{ raw: '', value: '' },
|
|
101
|
+
{ raw: '', value: '' },
|
|
102
102
|
{ raw: 'Subconscious CLI', value: `${c.orange}${c.bold}Subconscious CLI${c.reset}` },
|
|
103
103
|
{ raw: 'Update available', value: `${c.bold}Update available${c.reset}` },
|
|
104
104
|
{ raw: '', value: '' },
|