create-flow-os 0.0.31 → 0.0.33
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 -3
- package/src/init/ui.ts +56 -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.33",
|
|
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.33"
|
|
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,
|
|
10
|
+
import { box, withLoading, colors, headerLogo } from "./ui";
|
|
11
11
|
|
|
12
12
|
const { V, Y, E, R, B } = colors;
|
|
13
13
|
|
|
@@ -50,9 +50,9 @@ await withLoading(async (onStep) => {
|
|
|
50
50
|
const iconOk = V + "◆" + R;
|
|
51
51
|
const iconUnrec = Y + "?" + R;
|
|
52
52
|
const iconFail = E + "✕" + R;
|
|
53
|
-
const lines: string[] = [asciiLogo(V), "", B + "Initialized:" + R, ...toInit.map((l) => iconOk + " " + V + l + R)];
|
|
54
53
|
const out: string[] = [];
|
|
55
|
-
out.push(
|
|
54
|
+
out.push(headerLogo() + "\n");
|
|
55
|
+
out.push(box([B + "Initialized:" + R, ...toInit.map((l) => iconOk + " " + V + l + R)], V));
|
|
56
56
|
if (skipped.length) out.push(box([B + "Unrecognized:" + R, ...skipped.map((l) => iconUnrec + " " + Y + l + R)], Y));
|
|
57
57
|
console.log(out.join(""));
|
|
58
58
|
|
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,55 @@ 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, vista isometrica con shading ▓▒░ */
|
|
92
|
+
const LAYERS_ICON = [
|
|
93
|
+
" ▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ",
|
|
94
|
+
" ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ",
|
|
95
|
+
" ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ",
|
|
96
|
+
" ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ",
|
|
97
|
+
" ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ",
|
|
98
|
+
" ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ",
|
|
99
|
+
" ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ",
|
|
100
|
+
" ▓▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ",
|
|
101
|
+
" ▓▒▒▒▒▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ",
|
|
102
|
+
" ▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ",
|
|
103
|
+
" ░▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒ ",
|
|
104
|
+
" ▒▒▒░░░░░░▓▒▒▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒░▒▒▒▓▓▓▓ ",
|
|
105
|
+
" ▒▒▒▒▒░░░░░░░░▓▒▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░▒▒▒▒▓▓▓▓▓▓▓ ",
|
|
106
|
+
" ▓▒▒▒▒▒▒▒▒▒░░░░░░░░░▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░▒▒▒▓▓▓▓▓▓▓▓▓▓▓ ",
|
|
107
|
+
" ▒▒▒▒▒▓▓▒▒▒▒▒▒░░░░░░░░░▒▒▓▓▓▓▓▓▓▓▓▓▓▒░░░▒▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ",
|
|
108
|
+
" ▒▒▒▒▒▒▒▒▒▓▓▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░▒▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ",
|
|
109
|
+
" ▒▒▒▒▒▒▒▒▒▒▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ",
|
|
110
|
+
" ▒░░░▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓▒▒▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒▓▓ ",
|
|
111
|
+
" ▒▒▒▒░░░░░░▒▒▒▒▒▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒░▒▒▒▓▓▓▓▓▓ ",
|
|
112
|
+
" ▒▒▒▒▒▒▒░░░░░░░▓▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒░▒▒▒▓▓▓▓▓▓▓▓▓ ",
|
|
113
|
+
" ▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░▒▒▓▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒░░▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓ ",
|
|
114
|
+
" ▒▒▒▒▒▒▒▓▓▒▒▒▒▒▒░░░░░░░▓▓▓▓▓▓▓▓▓▓▓▓▒░░▒▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ",
|
|
115
|
+
" ▒▒▒▒▒▒▒▒▒▒▓▓▒▒▒▒▒▒▒░░░░░░▒░▒▒▒▒▒░░▒▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ",
|
|
116
|
+
" ▒▒▒▒▒▒▒▒▒▒▒▓▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ",
|
|
117
|
+
" ▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ",
|
|
118
|
+
" ▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ",
|
|
119
|
+
" ▒▒▒▒▒▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ",
|
|
120
|
+
" ▒▒▒▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ",
|
|
121
|
+
" ▒▒▒▒▓▓▓▓▓▓▓▓▓ ",
|
|
122
|
+
];
|
|
123
|
+
|
|
124
|
+
const FLOW_OS_TEXT = [
|
|
125
|
+
" ███████╗██╗ ██████╗ ██╗ ██╗ ╔█████═╗███████╗",
|
|
126
|
+
" ██╔════╝██║ ██╔═══██╗██║ ██║ ██ ██║██╔════╝",
|
|
127
|
+
" █████╗ ██║ ██║ ██║██║ █╗ ██║ ██ ██║███████╗",
|
|
128
|
+
" ██╔══╝ ██║ ██║ ██║██║███╗██║ ██ ██║╚════██║",
|
|
129
|
+
" ██║ ███████╗╚██████╔╝╚███╔███╔╝ ╚█████═╝███████║",
|
|
130
|
+
" ╚═╝ ╚══════╝ ╚═════╝ ╚══╝╚══╝ ╚══════╝",
|
|
131
|
+
];
|
|
132
|
+
|
|
133
|
+
/** Logo (ASCII utente) sopra, scritta Flow OS sotto, entrambi fuori dal box */
|
|
134
|
+
export function headerLogo(): string {
|
|
135
|
+
const logo = LAYERS_ICON.map((l) => W + l + R).join("\n");
|
|
136
|
+
const text = FLOW_OS_TEXT.map((t) => W + t + R).join("\n");
|
|
137
|
+
return logo + "\n\n" + text;
|
|
101
138
|
}
|