create-flow-os 0.0.37 → 0.0.38

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 CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "create-flow-os",
3
- "version": "0.0.37",
3
+ "version": "0.0.38",
4
4
  "license": "PolyForm-Shield-1.0.0",
5
5
  "type": "module",
6
6
  "dependencies": {
7
- "@flow-os/client": "^0.0.37"
7
+ "@flow-os/client": "^0.0.38"
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, withLoading, colors, headerLogo } from "./ui";
10
+ import { box, bannerBox, withLoading, colors, headerLogo } from "./ui";
11
11
 
12
12
  const { V, Y, E, R, B } = colors;
13
13
 
@@ -51,8 +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(headerLogo() + "\n");
55
- out.push(box([B + "Initialized:" + R, ...toInit.map((l) => iconOk + " " + V + l + R)], V));
54
+ out.push(bannerBox("Flow OS", [B + "Initialized:" + R, ...toInit.map((l) => iconOk + " " + V + l + R)], V));
56
55
  if (skipped.length) out.push(box([B + "Unrecognized:" + R, ...skipped.map((l) => iconUnrec + " " + Y + l + R)], Y));
57
56
  console.log(out.join(""));
58
57
 
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 con Flow OS centrato nel bordo superiore */
22
+ /** Riquadro chiuso con Flow OS in grassetto nel bordo superiore a sinistra */
23
23
  export function bannerBox(title: string, lines: string[], color: string, w = 92): string {
24
24
  const c = color;
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;
25
+ const inner = " " + B + title + R + " ";
26
+ const innerLen = stripAnsi(inner).length;
27
+ const top = c + "╔" + inner + "═".repeat(Math.max(0, w - 2 - innerLen)) + "╗" + 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";