create-flow-os 0.0.30 → 0.0.31
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 +3 -5
- package/src/init/index.ts +5 -6
- package/src/init/ui.ts +19 -17
- package/logo.png +0 -0
package/package.json
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-flow-os",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.31",
|
|
4
4
|
"license": "PolyForm-Shield-1.0.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@flow-os/client": "^0.0.
|
|
8
|
-
"terminal-image": "^4.2.0"
|
|
7
|
+
"@flow-os/client": "^0.0.31"
|
|
9
8
|
},
|
|
10
9
|
"bin": {
|
|
11
10
|
"create-flow-os": "./src/index.ts"
|
|
@@ -22,7 +21,6 @@
|
|
|
22
21
|
"vite": ">=7.3.0"
|
|
23
22
|
},
|
|
24
23
|
"files": [
|
|
25
|
-
"src"
|
|
26
|
-
"logo.png"
|
|
24
|
+
"src"
|
|
27
25
|
]
|
|
28
26
|
}
|
package/src/init/index.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
+
// Clear subito per nascondere resolving/installing di Bun
|
|
3
|
+
process.stdout.write("\x1b[2J\x1b[H");
|
|
2
4
|
|
|
3
5
|
import * as readline from "readline";
|
|
4
6
|
import { join, dirname } from "path";
|
|
5
7
|
import { fileURLToPath } from "url";
|
|
6
8
|
import { libsWithConfig, toShortName, toPkgName } from "./lib";
|
|
7
9
|
import { initLib, fetchFlowPackageVersions } from "./scaffold";
|
|
8
|
-
import { box, bannerBox, withLoading, colors,
|
|
10
|
+
import { box, bannerBox, withLoading, colors, asciiLogo } from "./ui";
|
|
9
11
|
|
|
10
12
|
const { V, Y, E, R, B } = colors;
|
|
11
13
|
|
|
@@ -37,9 +39,8 @@ if (!toInit.length) {
|
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
// ───────────────────────────────────────────────────────────────────────────────
|
|
40
|
-
// Execute:
|
|
42
|
+
// Execute: init con loading UI
|
|
41
43
|
// ───────────────────────────────────────────────────────────────────────────────
|
|
42
|
-
process.stdout.write("\x1b[2J\x1b[H");
|
|
43
44
|
const pkgNames = toInit.map(toPkgName);
|
|
44
45
|
await withLoading(async (onStep) => {
|
|
45
46
|
const versions = await fetchFlowPackageVersions(pkgNames);
|
|
@@ -49,10 +50,8 @@ await withLoading(async (onStep) => {
|
|
|
49
50
|
const iconOk = V + "◆" + R;
|
|
50
51
|
const iconUnrec = Y + "?" + R;
|
|
51
52
|
const iconFail = E + "✕" + R;
|
|
52
|
-
const
|
|
53
|
-
const lines: string[] = [B + "Initialized:" + R, ...toInit.map((l) => iconOk + " " + V + l + R)];
|
|
53
|
+
const lines: string[] = [asciiLogo(V), "", B + "Initialized:" + R, ...toInit.map((l) => iconOk + " " + V + l + R)];
|
|
54
54
|
const out: string[] = [];
|
|
55
|
-
if (logo) process.stdout.write("\n" + logo + "\n");
|
|
56
55
|
out.push(bannerBox("Flow OS", lines, V));
|
|
57
56
|
if (skipped.length) out.push(box([B + "Unrecognized:" + R, ...skipped.map((l) => iconUnrec + " " + Y + l + R)], Y));
|
|
58
57
|
console.log(out.join(""));
|
package/src/init/ui.ts
CHANGED
|
@@ -19,14 +19,14 @@ 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
|
|
23
|
-
export function bannerBox(title: string, lines: string[], color: string, w =
|
|
22
|
+
/** Riquadro chiuso: ╔═══ Flow OS ═══╗ con contenuto */
|
|
23
|
+
export function bannerBox(title: string, lines: string[], color: string, w = 74): string {
|
|
24
24
|
const c = color;
|
|
25
|
-
const inner =
|
|
26
|
-
const
|
|
27
|
-
const top = c + "
|
|
28
|
-
const bottom = c + "
|
|
29
|
-
const body = lines.map((l) => c + "
|
|
25
|
+
const inner = `═══ ${title} ═══`;
|
|
26
|
+
const padLen = Math.max(0, w - stripAnsi(inner).length - 2);
|
|
27
|
+
const top = c + "╔" + inner + "═".repeat(padLen) + "╗" + R;
|
|
28
|
+
const bottom = c + "╚" + "═".repeat(w) + "╝" + R;
|
|
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";
|
|
31
31
|
}
|
|
32
32
|
|
|
@@ -86,14 +86,16 @@ export async function withLoading<T>(
|
|
|
86
86
|
|
|
87
87
|
export const colors = { V, Y, E, R, B, DIM };
|
|
88
88
|
|
|
89
|
-
/**
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
89
|
+
/** Logo ASCII pixel-style Flow OS (nessuna dipendenza, istantaneo) */
|
|
90
|
+
const ASCII_LOGO = `
|
|
91
|
+
███████╗██╗ ██████╗ ██╗ ██╗ ██████╗ ███████╗
|
|
92
|
+
██╔════╝██║ ██╔═══██╗██║ ██║ ██╔══██╗██╔════╝
|
|
93
|
+
█████╗ ██║ ██║ ██║██║ █╗ ██║ ██████╔╝███████╗
|
|
94
|
+
██╔══╝ ██║ ██║ ██║██║███╗██║ ██╔══██╗╚════██║
|
|
95
|
+
██║ ███████╗╚██████╔╝╚███╔███╔╝ ██║ ██║███████║
|
|
96
|
+
╚═╝ ╚══════╝ ╚═════╝ ╚══╝╚══╝ ╚═╝ ╚═╝╚══════╝
|
|
97
|
+
`.trim();
|
|
98
|
+
|
|
99
|
+
export function asciiLogo(color: string): string {
|
|
100
|
+
return ASCII_LOGO.split("\n").map((l) => color + l + R).join("\n");
|
|
99
101
|
}
|
package/logo.png
DELETED
|
Binary file
|