create-flow-os 0.0.31 → 0.0.32
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/package.json +2 -2
- package/src/init/index.ts +3 -2
- package/src/init/ui.ts +47 -19
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-flow-os",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.32",
|
|
4
4
|
"license": "PolyForm-Shield-1.0.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@flow-os/client": "^0.0.
|
|
7
|
+
"@flow-os/client": "^0.0.32"
|
|
8
8
|
},
|
|
9
9
|
"bin": {
|
|
10
10
|
"create-flow-os": "./src/index.ts"
|
package/src/init/index.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { join, dirname } from "path";
|
|
|
7
7
|
import { fileURLToPath } from "url";
|
|
8
8
|
import { libsWithConfig, toShortName, toPkgName } from "./lib";
|
|
9
9
|
import { initLib, fetchFlowPackageVersions } from "./scaffold";
|
|
10
|
-
import { box, bannerBox, withLoading, colors,
|
|
10
|
+
import { box, bannerBox, withLoading, colors, headerLogo } from "./ui";
|
|
11
11
|
|
|
12
12
|
const { V, Y, E, R, B } = colors;
|
|
13
13
|
|
|
@@ -50,7 +50,8 @@ await withLoading(async (onStep) => {
|
|
|
50
50
|
const iconOk = V + "◆" + R;
|
|
51
51
|
const iconUnrec = Y + "?" + R;
|
|
52
52
|
const iconFail = E + "✕" + R;
|
|
53
|
-
const
|
|
53
|
+
const logoLines = headerLogo().split("\n");
|
|
54
|
+
const lines: string[] = [...logoLines, "", B + "Initialized:" + R, ...toInit.map((l) => iconOk + " " + V + l + R)];
|
|
54
55
|
const out: string[] = [];
|
|
55
56
|
out.push(bannerBox("Flow OS", lines, V));
|
|
56
57
|
if (skipped.length) out.push(box([B + "Unrecognized:" + R, ...skipped.map((l) => iconUnrec + " " + Y + l + R)], Y));
|
package/src/init/ui.ts
CHANGED
|
@@ -19,12 +19,12 @@ export function pad(s: string, w: number): string {
|
|
|
19
19
|
return s + " ".repeat(Math.max(0, w - stripAnsi(s).length));
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
/** Riquadro chiuso
|
|
23
|
-
export function bannerBox(title: string, lines: string[], color: string, w =
|
|
22
|
+
/** Riquadro chiuso con Flow OS centrato nel bordo superiore */
|
|
23
|
+
export function bannerBox(title: string, lines: string[], color: string, w = 92): string {
|
|
24
24
|
const c = color;
|
|
25
|
-
const inner =
|
|
26
|
-
const
|
|
27
|
-
const top = c + "╔" + inner + "═".repeat(
|
|
25
|
+
const inner = ` ${title} `;
|
|
26
|
+
const halfPad = Math.max(0, Math.floor((w - 2 - stripAnsi(inner).length) / 2));
|
|
27
|
+
const top = c + "╔" + "═".repeat(halfPad) + inner + "═".repeat(w - 2 - halfPad - stripAnsi(inner).length) + "╗" + R;
|
|
28
28
|
const bottom = c + "╚" + "═".repeat(w) + "╝" + R;
|
|
29
29
|
const body = lines.map((l) => c + "║" + R + " " + pad(l, w - 2) + c + "║" + R).join("\n");
|
|
30
30
|
return "\n" + top + "\n" + body + "\n" + bottom + "\n";
|
|
@@ -84,18 +84,46 @@ export async function withLoading<T>(
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
87
|
+
const W = "\x1b[97m"; // bianco
|
|
88
|
+
|
|
89
|
+
export const colors = { V, Y, E, R, B, DIM, W };
|
|
90
|
+
|
|
91
|
+
/** Icona layers: 3 quadrati arrotondati sovrapposti (bianco) + Flow OS grande a fianco */
|
|
92
|
+
const LAYERS_ICON = [
|
|
93
|
+
" ▄▄▄▄▄▄",
|
|
94
|
+
" ▄▄▄▄▄▄▄▄",
|
|
95
|
+
" ▄▄▄▄▄▄▄▄▄▄",
|
|
96
|
+
" ▀▀▀▀▀▀▀▀▀▀",
|
|
97
|
+
" ▄▄▄▄▄▄",
|
|
98
|
+
" ▄▄▄▄▄▄▄▄",
|
|
99
|
+
" ▄▄▄▄▄▄▄▄▄▄",
|
|
100
|
+
" ▀▀▀▀▀▀▀▀▀▀",
|
|
101
|
+
" ▄▄▄▄▄▄",
|
|
102
|
+
" ▄▄▄▄▄▄▄▄",
|
|
103
|
+
" ▄▄▄▄▄▄▄▄▄▄",
|
|
104
|
+
" ▀▀▀▀▀▀▀▀▀▀",
|
|
105
|
+
];
|
|
106
|
+
|
|
107
|
+
const FLOW_OS_TEXT = [
|
|
108
|
+
" ███████╗██╗ ██████╗ ██╗ ██╗ ██████╗ ███████╗",
|
|
109
|
+
" ██╔════╝██║ ██╔═══██╗██║ ██║ ██╔══██╗██╔════╝",
|
|
110
|
+
" █████╗ ██║ ██║ ██║██║ █╗ ██║ ██║ ██║███████╗",
|
|
111
|
+
" ██╔══╝ ██║ ██║ ██║██║███╗██║ ██║ ██║╚════██║",
|
|
112
|
+
" ██║ ███████╗╚██████╔╝╚███╔███╔╝ ██║ ██║███████║",
|
|
113
|
+
" ╚═╝ ╚══════╝ ╚═════╝ ╚══╝╚══╝ ╚█████╔╝ ╚══════╝",
|
|
114
|
+
];
|
|
115
|
+
|
|
116
|
+
export function headerLogo(): string {
|
|
117
|
+
const layersLines = LAYERS_ICON;
|
|
118
|
+
const textLines = FLOW_OS_TEXT;
|
|
119
|
+
const maxLines = Math.max(layersLines.length, textLines.length);
|
|
120
|
+
const layersW = 20;
|
|
121
|
+
const out: string[] = [];
|
|
122
|
+
for (let i = 0; i < maxLines; i++) {
|
|
123
|
+
const l = layersLines[i] ?? "";
|
|
124
|
+
const t = textLines[i] ?? "";
|
|
125
|
+
const pad = " ".repeat(Math.max(0, layersW - l.length));
|
|
126
|
+
out.push(W + l + pad + " " + t + R);
|
|
127
|
+
}
|
|
128
|
+
return out.join("\n");
|
|
101
129
|
}
|