create-flow-os 0.0.28 → 0.0.30
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/logo.png +0 -0
- package/package.json +8 -3
- package/src/init/index.ts +7 -3
- package/src/init/ui.ts +23 -0
- package/.dockerignore +0 -5
- package/.vscode/settings.json +0 -6
- package/Dockerfile +0 -14
- package/config/flow.ts +0 -3
- package/index.html +0 -13
- package/prova.ts +0 -0
- package/prova.tsx +0 -2
- package/tsconfig.json +0 -15
package/logo.png
ADDED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-flow-os",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.30",
|
|
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.30",
|
|
8
|
+
"terminal-image": "^4.2.0"
|
|
8
9
|
},
|
|
9
10
|
"bin": {
|
|
10
11
|
"create-flow-os": "./src/index.ts"
|
|
@@ -19,5 +20,9 @@
|
|
|
19
20
|
"@types/node": "^25.3.0",
|
|
20
21
|
"bun-types": "^1.3.9",
|
|
21
22
|
"vite": ">=7.3.0"
|
|
22
|
-
}
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"src",
|
|
26
|
+
"logo.png"
|
|
27
|
+
]
|
|
23
28
|
}
|
package/src/init/index.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { join, dirname } from "path";
|
|
|
5
5
|
import { fileURLToPath } from "url";
|
|
6
6
|
import { libsWithConfig, toShortName, toPkgName } from "./lib";
|
|
7
7
|
import { initLib, fetchFlowPackageVersions } from "./scaffold";
|
|
8
|
-
import { box, withLoading, colors } from "./ui";
|
|
8
|
+
import { box, bannerBox, withLoading, colors, loadLogo } from "./ui";
|
|
9
9
|
|
|
10
10
|
const { V, Y, E, R, B } = colors;
|
|
11
11
|
|
|
@@ -37,8 +37,9 @@ if (!toInit.length) {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
// ───────────────────────────────────────────────────────────────────────────────
|
|
40
|
-
// Execute: init con loading UI
|
|
40
|
+
// Execute: clear schermo (nasconde resolving/installing di Bun), init con loading UI
|
|
41
41
|
// ───────────────────────────────────────────────────────────────────────────────
|
|
42
|
+
process.stdout.write("\x1b[2J\x1b[H");
|
|
42
43
|
const pkgNames = toInit.map(toPkgName);
|
|
43
44
|
await withLoading(async (onStep) => {
|
|
44
45
|
const versions = await fetchFlowPackageVersions(pkgNames);
|
|
@@ -48,8 +49,11 @@ await withLoading(async (onStep) => {
|
|
|
48
49
|
const iconOk = V + "◆" + R;
|
|
49
50
|
const iconUnrec = Y + "?" + R;
|
|
50
51
|
const iconFail = E + "✕" + R;
|
|
52
|
+
const logo = await loadLogo(join(cliRoot, "logo.png"));
|
|
53
|
+
const lines: string[] = [B + "Initialized:" + R, ...toInit.map((l) => iconOk + " " + V + l + R)];
|
|
51
54
|
const out: string[] = [];
|
|
52
|
-
|
|
55
|
+
if (logo) process.stdout.write("\n" + logo + "\n");
|
|
56
|
+
out.push(bannerBox("Flow OS", lines, V));
|
|
53
57
|
if (skipped.length) out.push(box([B + "Unrecognized:" + R, ...skipped.map((l) => iconUnrec + " " + Y + l + R)], Y));
|
|
54
58
|
console.log(out.join(""));
|
|
55
59
|
|
package/src/init/ui.ts
CHANGED
|
@@ -19,6 +19,17 @@ 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 stile Claude Code: ╭─── Flow OS ────────╮ con contenuto */
|
|
23
|
+
export function bannerBox(title: string, lines: string[], color: string, w = 72): string {
|
|
24
|
+
const c = color;
|
|
25
|
+
const inner = `─── ${title} `;
|
|
26
|
+
const dashes = "─".repeat(Math.max(0, w - inner.length - 2));
|
|
27
|
+
const top = c + "╭" + inner + dashes + "╮" + 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
|
+
return "\n" + top + "\n" + body + "\n" + bottom + "\n";
|
|
31
|
+
}
|
|
32
|
+
|
|
22
33
|
export function box(lines: string[], color: string, w = 52): string {
|
|
23
34
|
const c = color;
|
|
24
35
|
const top = c + "╭" + "─".repeat(w) + "╮" + R;
|
|
@@ -74,3 +85,15 @@ export async function withLoading<T>(
|
|
|
74
85
|
}
|
|
75
86
|
|
|
76
87
|
export const colors = { V, Y, E, R, B, DIM };
|
|
88
|
+
|
|
89
|
+
/** Carica logo PNG se esiste; ritorna stringa ANSI o "" */
|
|
90
|
+
export async function loadLogo(logoPath: string): Promise<string> {
|
|
91
|
+
const { existsSync } = await import("fs");
|
|
92
|
+
if (!existsSync(logoPath)) return "";
|
|
93
|
+
try {
|
|
94
|
+
const terminalImage = (await import("terminal-image")).default;
|
|
95
|
+
return await terminalImage.file(logoPath, { width: "50%", height: 8 });
|
|
96
|
+
} catch {
|
|
97
|
+
return "";
|
|
98
|
+
}
|
|
99
|
+
}
|
package/.dockerignore
DELETED
package/.vscode/settings.json
DELETED
package/Dockerfile
DELETED
package/config/flow.ts
DELETED
package/index.html
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="it">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8"/>
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
|
6
|
-
<title>Flow</title>
|
|
7
|
-
<style>html,body{margin:0;padding:0;min-height:100vh}#app{min-height:100vh;box-sizing:border-box}*,*::before,*::after{box-sizing:inherit}</style>
|
|
8
|
-
</head>
|
|
9
|
-
<body>
|
|
10
|
-
<div id="app"></div>
|
|
11
|
-
<script type="module">document.getElementById('app').innerHTML='<h1>Flow</h1><p>Dev server ready.</p>';</script>
|
|
12
|
-
</body>
|
|
13
|
-
</html>
|
package/prova.ts
DELETED
|
File without changes
|
package/prova.tsx
DELETED
package/tsconfig.json
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"types": ["bun-types", "node"],
|
|
4
|
-
"target": "ESNext",
|
|
5
|
-
"module": "ESNext",
|
|
6
|
-
"moduleResolution": "bundler",
|
|
7
|
-
"strict": true,
|
|
8
|
-
"skipLibCheck": true,
|
|
9
|
-
"noEmit": true,
|
|
10
|
-
"esModuleInterop": true,
|
|
11
|
-
"isolatedModules": true
|
|
12
|
-
},
|
|
13
|
-
"include": ["src/**/*.ts"],
|
|
14
|
-
"exclude": ["node_modules"]
|
|
15
|
-
}
|