create-flow-os 0.0.13-dev.1772013358 → 0.0.13-dev.1772013904
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/.dockerignore +5 -0
- package/.vscode/settings.json +6 -0
- package/Dockerfile +14 -0
- package/config/flow.ts +3 -0
- package/index.html +13 -0
- package/package.json +9 -4
- package/src/index.ts +3 -3
- package/src/init/index.ts +18 -6
- package/src/init/lib.ts +3 -3
- package/src/init/scaffold.ts +3 -3
- package/tsconfig.json +15 -0
package/.dockerignore
ADDED
package/Dockerfile
ADDED
package/config/flow.ts
ADDED
package/index.html
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
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/package.json
CHANGED
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-flow-os",
|
|
3
|
-
"version": "0.0.13-dev.
|
|
3
|
+
"version": "0.0.13-dev.1772013904",
|
|
4
4
|
"license": "PolyForm-Shield-1.0.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@flow-os/client": "
|
|
7
|
+
"@flow-os/client": "^0.0.11"
|
|
8
8
|
},
|
|
9
9
|
"bin": {
|
|
10
10
|
"create-flow-os": "./src/index.ts"
|
|
11
11
|
},
|
|
12
12
|
"scripts": {
|
|
13
|
-
"create": "bun run src/create/index.ts"
|
|
13
|
+
"create": "bun run src/create/index.ts",
|
|
14
|
+
"dev": "flow-os dev",
|
|
15
|
+
"build": "flow-os build",
|
|
16
|
+
"start": "bun run server/start.ts"
|
|
14
17
|
},
|
|
15
18
|
"devDependencies": {
|
|
16
|
-
"
|
|
19
|
+
"@types/node": "^25.3.0",
|
|
20
|
+
"bun-types": "^1.3.9",
|
|
21
|
+
"vite": ">=7.3.0"
|
|
17
22
|
}
|
|
18
23
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
|
|
3
|
-
// create flow-os [nome]
|
|
4
|
-
// create flow-os
|
|
3
|
+
// create flow-os [nome] → create/
|
|
4
|
+
// create flow-os i [lib] → init (i = init)
|
|
5
5
|
|
|
6
6
|
const subcommand = process.argv[2];
|
|
7
7
|
|
|
8
|
-
if (subcommand === "init") {
|
|
8
|
+
if (subcommand === "init" || subcommand === "i") {
|
|
9
9
|
await import("./init/index.ts");
|
|
10
10
|
} else {
|
|
11
11
|
await import("./create/index.ts");
|
package/src/init/index.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
3
|
+
import * as readline from "readline";
|
|
4
|
+
import { join, dirname } from "path";
|
|
5
|
+
import { fileURLToPath } from "url";
|
|
5
6
|
import { libsWithConfig, toShortName } from "./lib";
|
|
6
7
|
import { initLib } from "./scaffold";
|
|
7
8
|
|
|
8
9
|
// ───────────────────────────────────────────────────────────────────────────────
|
|
9
|
-
// Usage: bun create flow-os
|
|
10
|
+
// Usage: bun create flow-os i [lib...] | bun create flow-os i (prompt interattivo)
|
|
10
11
|
// ───────────────────────────────────────────────────────────────────────────────
|
|
11
12
|
|
|
12
13
|
// ───────────────────────────────────────────────────────────────────────────────
|
|
13
14
|
// ANSI: violet (ok), yellow (unrecognized), red (error/failure)
|
|
14
|
-
// 38;5;226 = golden yellow (più vivo di 93)
|
|
15
15
|
// ───────────────────────────────────────────────────────────────────────────────
|
|
16
16
|
const V = "\x1b[95m";
|
|
17
17
|
const Y = "\x1b[38;5;226m";
|
|
@@ -35,12 +35,24 @@ const box = (lines: string[], color: string, w = 52) => {
|
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
// ───────────────────────────────────────────────────────────────────────────────
|
|
38
|
-
// Args: libs
|
|
38
|
+
// Args: libs da argv o prompt interattivo
|
|
39
39
|
// ───────────────────────────────────────────────────────────────────────────────
|
|
40
|
-
const libs = [...new Set(process.argv.slice(3))];
|
|
41
40
|
const cwd = process.cwd();
|
|
42
41
|
const cliRoot = join(dirname(fileURLToPath(import.meta.url)), "..", "..");
|
|
43
42
|
const available = libsWithConfig(cliRoot).map(toShortName);
|
|
43
|
+
|
|
44
|
+
let libs = [...new Set(process.argv.slice(3))];
|
|
45
|
+
|
|
46
|
+
if (!libs.length && available.length) {
|
|
47
|
+
console.log(box([B + "Packages disponibili:" + R, ...available.map((l) => V + "◆" + R + " " + l)], V));
|
|
48
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
49
|
+
const answer = await new Promise<string>((resolve) =>
|
|
50
|
+
rl.question(V + "Seleziona (spazio o virgola): " + R, resolve)
|
|
51
|
+
);
|
|
52
|
+
rl.close();
|
|
53
|
+
libs = answer.split(/[\s,]+/).map((s) => s.trim()).filter(Boolean);
|
|
54
|
+
}
|
|
55
|
+
|
|
44
56
|
const toInit = libs.filter((l) => available.includes(l));
|
|
45
57
|
const skipped = libs.filter((l) => !available.includes(l));
|
|
46
58
|
|
package/src/init/lib.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { existsSync, readFileSync } from "
|
|
2
|
-
import { join, dirname } from "
|
|
3
|
-
import { fileURLToPath } from "
|
|
1
|
+
import { existsSync, readFileSync } from "fs";
|
|
2
|
+
import { join, dirname } from "path";
|
|
3
|
+
import { fileURLToPath } from "url";
|
|
4
4
|
|
|
5
5
|
const FLOW_PREFIX = "@flow-os/";
|
|
6
6
|
|
package/src/init/scaffold.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { existsSync, cpSync, readFileSync, writeFileSync, readdirSync } from "
|
|
2
|
-
import { join, basename, dirname } from "
|
|
3
|
-
import { fileURLToPath } from "
|
|
1
|
+
import { existsSync, cpSync, readFileSync, writeFileSync, readdirSync } from "fs";
|
|
2
|
+
import { join, basename, dirname } from "path";
|
|
3
|
+
import { fileURLToPath } from "url";
|
|
4
4
|
import { pkgRoot, flowDeps, toPkgName, toShortName } from "./lib.ts";
|
|
5
5
|
|
|
6
6
|
const SKIP = new Set(["node_modules", ".git", ".vite", "package.json"]);
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
}
|