squidcloudctl 3.0.0 → 3.0.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/lib/output/banner.js +34 -12
- package/package.json +3 -3
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
2
|
import gradient from 'gradient-string';
|
|
3
|
-
/* ANSI-shadow lettering
|
|
4
|
-
|
|
3
|
+
/* ANSI-shadow lettering, sized to the terminal. Wide screens get the full
|
|
4
|
+
SQUIDCLOUD mark; narrow ones (phones, split panes) get stacked or inline
|
|
5
|
+
variants so nothing ever wraps into garbage. */
|
|
5
6
|
const GLYPHS = {
|
|
6
7
|
S: ['███████╗', '██╔════╝', '███████╗', '╚════██║', '███████║', '╚══════╝'],
|
|
7
8
|
Q: [' ██████╗ ', '██╔═══██╗', '██║ ██║', '██║▄▄ ██║', '╚██████╔╝', ' ╚══▀▀═╝ '],
|
|
@@ -12,25 +13,46 @@ const GLYPHS = {
|
|
|
12
13
|
L: ['██╗ ', '██║ ', '██║ ', '██║ ', '███████╗', '╚══════╝'],
|
|
13
14
|
O: [' ██████╗ ', '██╔═══██╗', '██║ ██║', '██║ ██║', '╚██████╔╝', ' ╚═════╝ '],
|
|
14
15
|
};
|
|
15
|
-
|
|
16
|
+
function wordRows(word) {
|
|
16
17
|
return [0, 1, 2, 3, 4, 5].map((r) => word.split('').map((ch) => GLYPHS[ch]?.[r] ?? '').join(''));
|
|
17
18
|
}
|
|
18
19
|
const squidGradient = gradient(['#4FC3F7', '#7C4DFF']);
|
|
19
20
|
const fogGradient = gradient(['#e4e4e7', '#a1a1aa']);
|
|
21
|
+
export function terminalColumns() {
|
|
22
|
+
return process.stdout.columns || process.stderr.columns || 80;
|
|
23
|
+
}
|
|
24
|
+
/** Compact single-line wordmark for narrow terminals. */
|
|
25
|
+
export function renderWordmark() {
|
|
26
|
+
return squidGradient('◆ SQUIDCLOUD CTL');
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Renders the biggest variant that fits the current terminal width:
|
|
30
|
+
* ≥ 86 cols full SQUIDCLOUD
|
|
31
|
+
* ≥ 46 cols SQUID / CLOUD stacked
|
|
32
|
+
* < 46 cols inline wordmark
|
|
33
|
+
*/
|
|
20
34
|
export function renderBanner(opts = {}) {
|
|
21
|
-
const
|
|
22
|
-
const colored = lines.map((l) => fogGradient(l));
|
|
35
|
+
const cols = opts.width ?? terminalColumns();
|
|
23
36
|
const out = [];
|
|
24
|
-
|
|
25
|
-
|
|
37
|
+
if (!process.stdout.isTTY && cols === 80) {
|
|
38
|
+
// Non-TTY (piped/CI): keep it tiny and predictable.
|
|
39
|
+
out.push(renderWordmark());
|
|
40
|
+
}
|
|
41
|
+
else if (cols >= 86) {
|
|
42
|
+
out.push(...wordRows('SQUIDCLOUD').map((l) => fogGradient(l.replace(/\s+$/, ''))));
|
|
43
|
+
}
|
|
44
|
+
else if (cols >= 48) {
|
|
45
|
+
out.push(...wordRows('SQUID').map((l) => fogGradient(l.replace(/\s+$/, ''))));
|
|
46
|
+
out.push('');
|
|
47
|
+
out.push(...wordRows('CLOUD').map((l) => squidGradient(l.replace(/\s+$/, ''))));
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
out.push(renderWordmark());
|
|
51
|
+
}
|
|
26
52
|
if (opts.tagline !== false) {
|
|
27
53
|
out.push('');
|
|
28
|
-
out.push(` ${squidGradient('SQUIDCLOUD CTL')} ${chalk.dim('encrypted storage · shares · secrets
|
|
54
|
+
out.push(` ${squidGradient('SQUIDCLOUD CTL')} ${chalk.dim('encrypted storage · shares · secrets')}`);
|
|
29
55
|
}
|
|
30
56
|
out.push('');
|
|
31
57
|
return out.join('\n');
|
|
32
58
|
}
|
|
33
|
-
/** Compact one-line wordmark for tight contexts. */
|
|
34
|
-
export function renderWordmark() {
|
|
35
|
-
return squidGradient('■ SQUIDCLOUD CTL');
|
|
36
|
-
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "squidcloudctl",
|
|
3
|
-
"version": "3.0.
|
|
4
|
-
"description": "SquidCloud CLI (squidcloudctl)
|
|
3
|
+
"version": "3.0.1",
|
|
4
|
+
"description": "SquidCloud CLI (squidcloudctl) — encrypted storage, shares and secrets from your terminal",
|
|
5
5
|
"main": "dist/bin/squidcloud.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"squidcloudctl": "dist/bin/squidcloud.js",
|
|
@@ -40,4 +40,4 @@
|
|
|
40
40
|
"gradient-string": "^3.0.0",
|
|
41
41
|
"ora": "^9.4.1"
|
|
42
42
|
}
|
|
43
|
-
}
|
|
43
|
+
}
|