create-flow-os 0.0.38 → 0.0.40
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 +12 -9
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-flow-os",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.40",
|
|
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.40"
|
|
8
8
|
},
|
|
9
9
|
"bin": {
|
|
10
10
|
"create-flow-os": "./src/index.ts"
|
package/src/init/index.ts
CHANGED
|
@@ -7,9 +7,9 @@ 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 } from "./ui";
|
|
11
11
|
|
|
12
|
-
const { V, Y, E, R, B } = colors;
|
|
12
|
+
const { V, V_LIGHT, Y, E, R, B } = colors;
|
|
13
13
|
|
|
14
14
|
// ───────────────────────────────────────────────────────────────────────────────
|
|
15
15
|
// Args: libs da argv o prompt interattivo
|
|
@@ -51,7 +51,7 @@ const iconOk = V + "◆" + R;
|
|
|
51
51
|
const iconUnrec = Y + "?" + R;
|
|
52
52
|
const iconFail = E + "✕" + R;
|
|
53
53
|
const out: string[] = [];
|
|
54
|
-
out.push(bannerBox("Flow OS", [B + "Initialized:" + R, ...toInit.map((l) => iconOk + " " +
|
|
54
|
+
out.push(bannerBox("Flow OS", [B + "Initialized:" + R, ...toInit.map((l) => iconOk + " " + V_LIGHT + l + R)], V_LIGHT));
|
|
55
55
|
if (skipped.length) out.push(box([B + "Unrecognized:" + R, ...skipped.map((l) => iconUnrec + " " + Y + l + R)], Y));
|
|
56
56
|
console.log(out.join(""));
|
|
57
57
|
|
package/src/init/ui.ts
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* UI per init: loading spinner e box coerenti con flow-os
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
const V = "\x1b[95m";
|
|
5
|
+
const V = "\x1b[95m"; // magenta scuro
|
|
6
|
+
const V_LIGHT = "\x1b[38;5;177m"; // magenta medio (non troppo chiaro)
|
|
6
7
|
const Y = "\x1b[38;5;226m";
|
|
7
8
|
const E = "\x1b[91m";
|
|
8
9
|
const R = "\x1b[0m";
|
|
@@ -19,15 +20,17 @@ export function pad(s: string, w: number): string {
|
|
|
19
20
|
return s + " ".repeat(Math.max(0, w - stripAnsi(s).length));
|
|
20
21
|
}
|
|
21
22
|
|
|
22
|
-
/** Riquadro chiuso con Flow OS in grassetto nel bordo superiore
|
|
23
|
-
export function bannerBox(title: string, lines: string[], color: string, w =
|
|
23
|
+
/** Riquadro chiuso con Flow OS in grassetto nel bordo superiore */
|
|
24
|
+
export function bannerBox(title: string, lines: string[], color: string, w = 68): string {
|
|
24
25
|
const c = color;
|
|
25
|
-
const inner = " " + B + title + R + " ";
|
|
26
|
+
const inner = " " + c + B + title + R + " "; // titolo subito dopo ╔, stesso colore
|
|
26
27
|
const innerLen = stripAnsi(inner).length;
|
|
27
|
-
const top = c + "╔" + inner + "═".repeat(Math.max(0, w - 2 - innerLen)) + "╗" + R;
|
|
28
|
-
const bottom = c + "╚" + "═".repeat(w) + "╝" + R;
|
|
29
|
-
const
|
|
30
|
-
|
|
28
|
+
const top = c + "╔" + inner + c + "═".repeat(Math.max(0, w - 2 - innerLen)) + "╗" + R;
|
|
29
|
+
const bottom = c + "╚" + "═".repeat(w - 2) + "╝" + R;
|
|
30
|
+
const spacer = c + "║" + R + " " + " ".repeat(w - 2) + c + "║" + R; // riga vuota
|
|
31
|
+
const bodyLines = lines.map((l) => c + "║" + R + " " + pad(l, w - 2) + c + "║" + R);
|
|
32
|
+
const body = "\n" + spacer + "\n" + bodyLines.join("\n");
|
|
33
|
+
return "\n" + top + body + "\n" + bottom + "\n";
|
|
31
34
|
}
|
|
32
35
|
|
|
33
36
|
export function box(lines: string[], color: string, w = 52): string {
|
|
@@ -86,7 +89,7 @@ export async function withLoading<T>(
|
|
|
86
89
|
|
|
87
90
|
const W = "\x1b[97m"; // bianco
|
|
88
91
|
|
|
89
|
-
export const colors = { V, Y, E, R, B, DIM, W };
|
|
92
|
+
export const colors = { V, V_LIGHT, Y, E, R, B, DIM, W };
|
|
90
93
|
|
|
91
94
|
/** Icona layers: 3 quadrati arrotondati sovrapposti, vista isometrica con shading ▓▒░ */
|
|
92
95
|
|