create-flow-os 0.0.1-dev.1771840262 → 0.0.1-dev.1771979366
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 +8 -23
- package/{profiles/server/packages/style → src/create}/index.ts +31 -30
- package/src/index.ts +14 -0
- package/src/init/index.ts +66 -0
- package/src/init/lib.ts +36 -0
- package/src/init/scaffold.ts +43 -0
- package/LICENSE +0 -97
- package/README.md +0 -26
- package/bin/index.js +0 -1215
- package/config.json +0 -89
- package/lib/utils.ts +0 -91
- package/packages/client/client/root.css +0 -9
- package/packages/client/client/root.tsx +0 -6
- package/packages/client/client/routes/404.tsx +0 -24
- package/packages/client/client/routes/index.tsx +0 -48
- package/packages/server/server/routes/hello.get.ts +0 -3
- package/profiles/client/.dockerignore +0 -12
- package/profiles/client/.oxfmtrc.json +0 -7
- package/profiles/client/.oxlintrc.json +0 -13
- package/profiles/client/.vscode/settings.json +0 -12
- package/profiles/client/Dockerfile +0 -26
- package/profiles/client/README.md +0 -34
- package/profiles/client/bun.lock +0 -352
- package/profiles/client/client/root.css +0 -9
- package/profiles/client/client/root.tsx +0 -6
- package/profiles/client/client/routes/404.tsx +0 -24
- package/profiles/client/client/routes/about.tsx +0 -7
- package/profiles/client/client/routes/index.tsx +0 -48
- package/profiles/client/flow.config.ts +0 -6
- package/profiles/client/index.html +0 -5
- package/profiles/client/package.json +0 -32
- package/profiles/client/packages/client/LICENSE +0 -97
- package/profiles/client/packages/client/build/config.ts +0 -211
- package/profiles/client/packages/client/build/vite.ts +0 -98
- package/profiles/client/packages/client/features/attrs.ts +0 -32
- package/profiles/client/packages/client/features/class-flow.ts +0 -116
- package/profiles/client/packages/client/features/index.ts +0 -8
- package/profiles/client/packages/client/features/pseudo-injector.ts +0 -40
- package/profiles/client/packages/client/features/style-flow.ts +0 -106
- package/profiles/client/packages/client/features/style.ts +0 -27
- package/profiles/client/packages/client/features/utils.ts +0 -4
- package/profiles/client/packages/client/features/viewport.ts +0 -20
- package/profiles/client/packages/client/index.ts +0 -7
- package/profiles/client/packages/client/package.json +0 -48
- package/profiles/client/packages/client/runtime/dom.ts +0 -2
- package/profiles/client/packages/client/runtime/jsx-dev-runtime.ts +0 -1
- package/profiles/client/packages/client/runtime/jsx-runtime.ts +0 -1
- package/profiles/client/packages/client/runtime/jsx-types.d.ts +0 -66
- package/profiles/client/packages/client/runtime/jsx.ts +0 -101
- package/profiles/client/packages/client/scripts/build.ts +0 -14
- package/profiles/client/packages/client/scripts/preview.ts +0 -14
- package/profiles/client/packages/client/scripts/start-dev.ts +0 -49
- package/profiles/client/packages/core/LICENSE +0 -97
- package/profiles/client/packages/core/dom.ts +0 -43
- package/profiles/client/packages/core/for.ts +0 -42
- package/profiles/client/packages/core/index.ts +0 -5
- package/profiles/client/packages/core/lifecycle.ts +0 -6
- package/profiles/client/packages/core/package.json +0 -16
- package/profiles/client/packages/core/show-switch.ts +0 -56
- package/profiles/client/packages/core/state.ts +0 -56
- package/profiles/client/packages/router/LICENSE +0 -97
- package/profiles/client/packages/router/index.ts +0 -20
- package/profiles/client/packages/router/matcher.ts +0 -105
- package/profiles/client/packages/router/package.json +0 -15
- package/profiles/client/packages/router/router.ts +0 -185
- package/profiles/client/packages/router/types.ts +0 -34
- package/profiles/client/packages/router/utils.ts +0 -45
- package/profiles/client/packages/style/LICENSE +0 -97
- package/profiles/client/packages/style/breakpoints.ts +0 -20
- package/profiles/client/packages/style/extension/.vscodeignore +0 -5
- package/profiles/client/packages/style/extension/flow-style-colors-0.0.1.vsix +0 -0
- package/profiles/client/packages/style/extension/out/extension.js +0 -130
- package/profiles/client/packages/style/extension/package.json +0 -24
- package/profiles/client/packages/style/extension/src/extension.ts +0 -146
- package/profiles/client/packages/style/extension/tsconfig.json +0 -12
- package/profiles/client/packages/style/index.ts +0 -30
- package/profiles/client/packages/style/package.json +0 -20
- package/profiles/client/packages/style/react.ts +0 -68
- package/profiles/client/packages/style/resolve.ts +0 -127
- package/profiles/client/packages/style/server.ts +0 -299
- package/profiles/client/packages/style/shorthand.ts +0 -96
- package/profiles/client/packages/style/style-builder/button.ts +0 -41
- package/profiles/client/packages/style/style-builder/constants.ts +0 -16
- package/profiles/client/packages/style/style-builder/dom.ts +0 -18
- package/profiles/client/packages/style/style-builder/index.ts +0 -48
- package/profiles/client/packages/style/style-builder/panel.ts +0 -69
- package/profiles/client/packages/style/style-builder/position.ts +0 -25
- package/profiles/client/packages/style/visual-builder.ts +0 -822
- package/profiles/client/packages/style/vite-plugin.ts +0 -86
- package/profiles/client/tsconfig.json +0 -30
- package/profiles/full/.dockerignore +0 -12
- package/profiles/full/.oxfmtrc.json +0 -7
- package/profiles/full/.oxlintrc.json +0 -13
- package/profiles/full/.vscode/settings.json +0 -12
- package/profiles/full/Dockerfile +0 -26
- package/profiles/full/README.md +0 -34
- package/profiles/full/bun.lock +0 -352
- package/profiles/full/client/root.css +0 -9
- package/profiles/full/client/root.tsx +0 -6
- package/profiles/full/client/routes/404.tsx +0 -24
- package/profiles/full/client/routes/about.tsx +0 -7
- package/profiles/full/client/routes/index.tsx +0 -48
- package/profiles/full/flow.config.ts +0 -6
- package/profiles/full/index.html +0 -5
- package/profiles/full/package.json +0 -33
- package/profiles/full/packages/client/LICENSE +0 -97
- package/profiles/full/packages/client/build/config.ts +0 -211
- package/profiles/full/packages/client/build/vite.ts +0 -98
- package/profiles/full/packages/client/features/attrs.ts +0 -32
- package/profiles/full/packages/client/features/class-flow.ts +0 -116
- package/profiles/full/packages/client/features/index.ts +0 -8
- package/profiles/full/packages/client/features/pseudo-injector.ts +0 -40
- package/profiles/full/packages/client/features/style-flow.ts +0 -106
- package/profiles/full/packages/client/features/style.ts +0 -27
- package/profiles/full/packages/client/features/utils.ts +0 -4
- package/profiles/full/packages/client/features/viewport.ts +0 -20
- package/profiles/full/packages/client/index.ts +0 -7
- package/profiles/full/packages/client/package.json +0 -48
- package/profiles/full/packages/client/runtime/dom.ts +0 -2
- package/profiles/full/packages/client/runtime/jsx-dev-runtime.ts +0 -1
- package/profiles/full/packages/client/runtime/jsx-runtime.ts +0 -1
- package/profiles/full/packages/client/runtime/jsx-types.d.ts +0 -66
- package/profiles/full/packages/client/runtime/jsx.ts +0 -101
- package/profiles/full/packages/client/scripts/build.ts +0 -14
- package/profiles/full/packages/client/scripts/preview.ts +0 -14
- package/profiles/full/packages/client/scripts/start-dev.ts +0 -49
- package/profiles/full/packages/core/LICENSE +0 -97
- package/profiles/full/packages/core/dom.ts +0 -43
- package/profiles/full/packages/core/for.ts +0 -42
- package/profiles/full/packages/core/index.ts +0 -5
- package/profiles/full/packages/core/lifecycle.ts +0 -6
- package/profiles/full/packages/core/package.json +0 -16
- package/profiles/full/packages/core/show-switch.ts +0 -56
- package/profiles/full/packages/core/state.ts +0 -56
- package/profiles/full/packages/router/LICENSE +0 -97
- package/profiles/full/packages/router/index.ts +0 -20
- package/profiles/full/packages/router/matcher.ts +0 -105
- package/profiles/full/packages/router/package.json +0 -15
- package/profiles/full/packages/router/router.ts +0 -185
- package/profiles/full/packages/router/types.ts +0 -34
- package/profiles/full/packages/router/utils.ts +0 -45
- package/profiles/full/packages/server/LICENSE +0 -97
- package/profiles/full/packages/server/core.ts +0 -140
- package/profiles/full/packages/server/index.ts +0 -24
- package/profiles/full/packages/server/package.json +0 -32
- package/profiles/full/packages/server/plugin.ts +0 -79
- package/profiles/full/packages/server/production.ts +0 -75
- package/profiles/full/packages/server/scripts/start.ts +0 -11
- package/profiles/full/packages/style/LICENSE +0 -97
- package/profiles/full/packages/style/breakpoints.ts +0 -20
- package/profiles/full/packages/style/extension/.vscodeignore +0 -5
- package/profiles/full/packages/style/extension/flow-style-colors-0.0.1.vsix +0 -0
- package/profiles/full/packages/style/extension/out/extension.js +0 -130
- package/profiles/full/packages/style/extension/package.json +0 -24
- package/profiles/full/packages/style/extension/src/extension.ts +0 -146
- package/profiles/full/packages/style/extension/tsconfig.json +0 -12
- package/profiles/full/packages/style/index.ts +0 -30
- package/profiles/full/packages/style/package.json +0 -20
- package/profiles/full/packages/style/react.ts +0 -68
- package/profiles/full/packages/style/resolve.ts +0 -127
- package/profiles/full/packages/style/server.ts +0 -299
- package/profiles/full/packages/style/shorthand.ts +0 -96
- package/profiles/full/packages/style/style-builder/button.ts +0 -41
- package/profiles/full/packages/style/style-builder/constants.ts +0 -16
- package/profiles/full/packages/style/style-builder/dom.ts +0 -18
- package/profiles/full/packages/style/style-builder/index.ts +0 -48
- package/profiles/full/packages/style/style-builder/panel.ts +0 -69
- package/profiles/full/packages/style/style-builder/position.ts +0 -25
- package/profiles/full/packages/style/visual-builder.ts +0 -822
- package/profiles/full/packages/style/vite-plugin.ts +0 -86
- package/profiles/full/server/routes/hello.get.ts +0 -3
- package/profiles/full/tsconfig.json +0 -30
- package/profiles/server/.dockerignore +0 -12
- package/profiles/server/.oxfmtrc.json +0 -7
- package/profiles/server/.oxlintrc.json +0 -13
- package/profiles/server/.vscode/settings.json +0 -12
- package/profiles/server/Dockerfile +0 -26
- package/profiles/server/README.md +0 -34
- package/profiles/server/bun.lock +0 -352
- package/profiles/server/flow.config.ts +0 -7
- package/profiles/server/index.html +0 -5
- package/profiles/server/package.json +0 -30
- package/profiles/server/packages/core/LICENSE +0 -97
- package/profiles/server/packages/core/dom.ts +0 -43
- package/profiles/server/packages/core/for.ts +0 -42
- package/profiles/server/packages/core/index.ts +0 -5
- package/profiles/server/packages/core/lifecycle.ts +0 -6
- package/profiles/server/packages/core/package.json +0 -16
- package/profiles/server/packages/core/show-switch.ts +0 -56
- package/profiles/server/packages/core/state.ts +0 -56
- package/profiles/server/packages/router/LICENSE +0 -97
- package/profiles/server/packages/router/index.ts +0 -20
- package/profiles/server/packages/router/matcher.ts +0 -105
- package/profiles/server/packages/router/package.json +0 -15
- package/profiles/server/packages/router/router.ts +0 -185
- package/profiles/server/packages/router/types.ts +0 -34
- package/profiles/server/packages/router/utils.ts +0 -45
- package/profiles/server/packages/server/LICENSE +0 -97
- package/profiles/server/packages/server/core.ts +0 -140
- package/profiles/server/packages/server/index.ts +0 -24
- package/profiles/server/packages/server/package.json +0 -32
- package/profiles/server/packages/server/plugin.ts +0 -79
- package/profiles/server/packages/server/production.ts +0 -75
- package/profiles/server/packages/server/scripts/start.ts +0 -11
- package/profiles/server/packages/style/LICENSE +0 -97
- package/profiles/server/packages/style/breakpoints.ts +0 -20
- package/profiles/server/packages/style/extension/.vscodeignore +0 -5
- package/profiles/server/packages/style/extension/flow-style-colors-0.0.1.vsix +0 -0
- package/profiles/server/packages/style/extension/out/extension.js +0 -130
- package/profiles/server/packages/style/extension/package.json +0 -24
- package/profiles/server/packages/style/extension/src/extension.ts +0 -146
- package/profiles/server/packages/style/extension/tsconfig.json +0 -12
- package/profiles/server/packages/style/package.json +0 -20
- package/profiles/server/packages/style/react.ts +0 -68
- package/profiles/server/packages/style/resolve.ts +0 -127
- package/profiles/server/packages/style/server.ts +0 -299
- package/profiles/server/packages/style/shorthand.ts +0 -96
- package/profiles/server/packages/style/style-builder/button.ts +0 -41
- package/profiles/server/packages/style/style-builder/constants.ts +0 -16
- package/profiles/server/packages/style/style-builder/dom.ts +0 -18
- package/profiles/server/packages/style/style-builder/index.ts +0 -48
- package/profiles/server/packages/style/style-builder/panel.ts +0 -69
- package/profiles/server/packages/style/style-builder/position.ts +0 -25
- package/profiles/server/packages/style/visual-builder.ts +0 -822
- package/profiles/server/packages/style/vite-plugin.ts +0 -86
- package/profiles/server/server/routes/hello.get.ts +0 -3
- package/profiles/server/tsconfig.json +0 -30
- package/templates/flow.config.client.ts +0 -6
- package/templates/flow.config.full.ts +0 -6
- package/templates/flow.config.server.ts +0 -7
package/package.json
CHANGED
|
@@ -1,33 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-flow-os",
|
|
3
|
-
"version": "0.0.1-dev.
|
|
3
|
+
"version": "0.0.1-dev.1771979366",
|
|
4
|
+
"license": "PolyForm-Shield-1.0.0",
|
|
4
5
|
"type": "module",
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"@flow-os/client": ">=0.0.1-dev.0"
|
|
8
|
+
},
|
|
5
9
|
"bin": {
|
|
6
|
-
"create-flow-os": "
|
|
10
|
+
"create-flow-os": "./src/index.ts"
|
|
7
11
|
},
|
|
8
|
-
"files": [
|
|
9
|
-
"bin",
|
|
10
|
-
"config.json",
|
|
11
|
-
"lib",
|
|
12
|
-
"templates",
|
|
13
|
-
"profiles",
|
|
14
|
-
"packages",
|
|
15
|
-
"LICENSE"
|
|
16
|
-
],
|
|
17
|
-
"license": "PolyForm-Shield-1.0.0",
|
|
18
12
|
"scripts": {
|
|
19
|
-
"
|
|
20
|
-
"create": "bun index.ts",
|
|
21
|
-
"build": "bun build ./index.ts --outdir=bin --target=bun",
|
|
22
|
-
"publish:dev": "bun scripts/publish-dev.ts",
|
|
23
|
-
"version": "bun scripts/version.ts",
|
|
24
|
-
"release": "bun scripts/publish.ts"
|
|
25
|
-
},
|
|
26
|
-
"dependencies": {
|
|
27
|
-
"@clack/prompts": "^0.8.2",
|
|
28
|
-
"picocolors": "^1.1.1"
|
|
13
|
+
"create": "bun run src/create/index.ts"
|
|
29
14
|
},
|
|
30
15
|
"devDependencies": {
|
|
31
|
-
"bun-types": "
|
|
16
|
+
"bun-types": "^1.3.9"
|
|
32
17
|
}
|
|
33
18
|
}
|
|
@@ -1,30 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
// ───────────────────────────────────────────────────────────────────────────────
|
|
9
|
-
//
|
|
10
|
-
// ───────────────────────────────────────────────────────────────────────────────
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
//
|
|
15
|
-
|
|
16
|
-
// ───────────────────────────────────────────────────────────────────────────────
|
|
17
|
-
|
|
18
|
-
//
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
// ───────────────────────────────────────────────────────────────────────────────
|
|
24
|
-
|
|
25
|
-
//
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
|
|
3
|
+
// ───────────────────────────────────────────────────────────────────────────────
|
|
4
|
+
// Usage: bun create flow-os [nome] | bunx create flow-os [nome]
|
|
5
|
+
// Nuovo progetto: client/server/full, scelta librerie, scaffold, merge
|
|
6
|
+
// ───────────────────────────────────────────────────────────────────────────────
|
|
7
|
+
|
|
8
|
+
// ───────────────────────────────────────────────────────────────────────────────
|
|
9
|
+
// Args
|
|
10
|
+
// ───────────────────────────────────────────────────────────────────────────────
|
|
11
|
+
|
|
12
|
+
// nome = process.argv[2] ?? "my-flow-app"
|
|
13
|
+
|
|
14
|
+
// ───────────────────────────────────────────────────────────────────────────────
|
|
15
|
+
// Prompt
|
|
16
|
+
// ───────────────────────────────────────────────────────────────────────────────
|
|
17
|
+
|
|
18
|
+
// - tipo: client | server | full
|
|
19
|
+
// - librerie da includere
|
|
20
|
+
|
|
21
|
+
// ───────────────────────────────────────────────────────────────────────────────
|
|
22
|
+
// Scaffold
|
|
23
|
+
// ───────────────────────────────────────────────────────────────────────────────
|
|
24
|
+
|
|
25
|
+
// - crea cartella progetto
|
|
26
|
+
// - per ogni package scelto: init + config sub-packages
|
|
27
|
+
// - merge diff con altri packages
|
|
28
|
+
|
|
29
|
+
// ───────────────────────────────────────────────────────────────────────────────
|
|
30
|
+
|
|
31
|
+
export {};
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
|
|
3
|
+
// create flow-os [nome] → create/
|
|
4
|
+
// create flow-os init [lib] → init/
|
|
5
|
+
|
|
6
|
+
const subcommand = process.argv[2];
|
|
7
|
+
|
|
8
|
+
if (subcommand === "init") {
|
|
9
|
+
await import("./init/index.ts");
|
|
10
|
+
} else {
|
|
11
|
+
await import("./create/index.ts");
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
|
|
3
|
+
import { join, dirname } from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import { libsWithConfig, toShortName } from "./lib";
|
|
6
|
+
import { initLib } from "./scaffold";
|
|
7
|
+
|
|
8
|
+
// ───────────────────────────────────────────────────────────────────────────────
|
|
9
|
+
// Usage: bun create flow-os init [lib...] | bunx create flow-os init [lib...]
|
|
10
|
+
// ───────────────────────────────────────────────────────────────────────────────
|
|
11
|
+
|
|
12
|
+
// ───────────────────────────────────────────────────────────────────────────────
|
|
13
|
+
// ANSI: violet (ok), yellow (unrecognized), red (error/failure)
|
|
14
|
+
// 38;5;226 = golden yellow (più vivo di 93)
|
|
15
|
+
// ───────────────────────────────────────────────────────────────────────────────
|
|
16
|
+
const V = "\x1b[95m";
|
|
17
|
+
const Y = "\x1b[38;5;226m";
|
|
18
|
+
const E = "\x1b[91m";
|
|
19
|
+
const R = "\x1b[0m";
|
|
20
|
+
const B = "\x1b[1m";
|
|
21
|
+
|
|
22
|
+
// Icone: ◆ ok, ? unrecognized, ✕ failure
|
|
23
|
+
|
|
24
|
+
// ───────────────────────────────────────────────────────────────────────────────
|
|
25
|
+
// Box: contorno colorato, padding, strip ANSI per calcolo larghezza
|
|
26
|
+
// ───────────────────────────────────────────────────────────────────────────────
|
|
27
|
+
const strip = (s: string) => s.replace(/\x1b\[[0-9;]*m/g, "").replace(/\n/g, "");
|
|
28
|
+
const pad = (s: string, w: number) => s + " ".repeat(Math.max(0, w - strip(s).length));
|
|
29
|
+
const box = (lines: string[], color: string, w = 52) => {
|
|
30
|
+
const c = color;
|
|
31
|
+
const top = c + "╭" + "─".repeat(w) + "╮" + R;
|
|
32
|
+
const bottom = c + "╰" + "─".repeat(w) + "╯" + R;
|
|
33
|
+
const body = lines.map((l) => c + "│" + R + " ".repeat(2) + pad(l, w - 2) + c + "│" + R).join("\n");
|
|
34
|
+
return "\n" + top + "\n" + body + "\n" + bottom + "\n";
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
// ───────────────────────────────────────────────────────────────────────────────
|
|
38
|
+
// Args: libs richieste (dedup), disponibili, filtro
|
|
39
|
+
// ───────────────────────────────────────────────────────────────────────────────
|
|
40
|
+
const libs = [...new Set(process.argv.slice(3))];
|
|
41
|
+
const cwd = process.cwd();
|
|
42
|
+
const cliRoot = join(dirname(fileURLToPath(import.meta.url)), "..", "..");
|
|
43
|
+
const available = libsWithConfig(cliRoot).map(toShortName);
|
|
44
|
+
const toInit = libs.filter((l) => available.includes(l));
|
|
45
|
+
const skipped = libs.filter((l) => !available.includes(l));
|
|
46
|
+
|
|
47
|
+
if (!toInit.length) {
|
|
48
|
+
console.error(box([E + "usa " + (available.join(" | ") || "(nessuna lib con config)") + R], E));
|
|
49
|
+
process.exit(1);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// ───────────────────────────────────────────────────────────────────────────────
|
|
53
|
+
// Execute: init libs, poi output box
|
|
54
|
+
// ───────────────────────────────────────────────────────────────────────────────
|
|
55
|
+
const done = new Set<string>();
|
|
56
|
+
for (const lib of toInit) initLib(lib, cwd, done);
|
|
57
|
+
|
|
58
|
+
const iconOk = V + "◆" + R;
|
|
59
|
+
const iconUnrec = Y + "?" + R;
|
|
60
|
+
const iconFail = E + "✕" + R;
|
|
61
|
+
const out: string[] = [];
|
|
62
|
+
out.push(box([B + "Initialized:" + R, ...toInit.map((l) => iconOk + " " + V + l + R)], V));
|
|
63
|
+
if (skipped.length) out.push(box([B + "Unrecognized:" + R, ...skipped.map((l) => iconUnrec + " " + Y + l + R)], Y));
|
|
64
|
+
console.log(out.join(""));
|
|
65
|
+
|
|
66
|
+
export {};
|
package/src/init/lib.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import { join, dirname } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
|
|
5
|
+
const FLOW_PREFIX = "@flow-os/";
|
|
6
|
+
|
|
7
|
+
export function pkgRoot(pkgName: string): string {
|
|
8
|
+
const url = import.meta.resolve(pkgName);
|
|
9
|
+
const entry = fileURLToPath(url);
|
|
10
|
+
let d = dirname(entry);
|
|
11
|
+
while (d !== dirname(d)) {
|
|
12
|
+
if (existsSync(join(d, "package.json"))) return d;
|
|
13
|
+
d = dirname(d);
|
|
14
|
+
}
|
|
15
|
+
return dirname(entry);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function flowDeps(root: string): string[] {
|
|
19
|
+
const pkg = JSON.parse(readFileSync(join(root, "package.json"), "utf-8"));
|
|
20
|
+
const deps = { ...pkg.dependencies, ...pkg.peerDependencies } as Record<string, string>;
|
|
21
|
+
return Object.keys(deps).filter((k) => k.startsWith(FLOW_PREFIX));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function libsWithConfig(cliRoot: string): string[] {
|
|
25
|
+
const pkg = JSON.parse(readFileSync(join(cliRoot, "package.json"), "utf-8"));
|
|
26
|
+
const deps = Object.keys(pkg.dependencies ?? {}).filter((k) => k.startsWith(FLOW_PREFIX));
|
|
27
|
+
return deps.filter((name) => existsSync(join(pkgRoot(name), "config")));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function toShortName(name: string): string {
|
|
31
|
+
return name.replace(FLOW_PREFIX, "");
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function toPkgName(lib: string): string {
|
|
35
|
+
return lib.startsWith(FLOW_PREFIX) ? lib : `${FLOW_PREFIX}${lib}`;
|
|
36
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { existsSync, cpSync, readFileSync, writeFileSync, readdirSync } from "node:fs";
|
|
2
|
+
import { join, basename } from "node:path";
|
|
3
|
+
import { pkgRoot, flowDeps, toPkgName, toShortName } from "./lib.ts";
|
|
4
|
+
|
|
5
|
+
const SKIP = new Set(["node_modules", ".git", ".vite", "package.json"]);
|
|
6
|
+
|
|
7
|
+
function copyConfig(configDir: string, cwd: string): void {
|
|
8
|
+
for (const e of readdirSync(configDir, { withFileTypes: true })) {
|
|
9
|
+
if (SKIP.has(e.name)) continue;
|
|
10
|
+
cpSync(join(configDir, e.name), join(cwd, e.name), { recursive: e.isDirectory() });
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function mergePkg(configDir: string, cwd: string): void {
|
|
15
|
+
const configPkg = join(configDir, "package.json");
|
|
16
|
+
if (!existsSync(configPkg)) return;
|
|
17
|
+
const targetPath = join(cwd, "package.json");
|
|
18
|
+
const config = JSON.parse(readFileSync(configPkg, "utf-8"));
|
|
19
|
+
const target = existsSync(targetPath)
|
|
20
|
+
? JSON.parse(readFileSync(targetPath, "utf-8"))
|
|
21
|
+
: { ...config, name: basename(cwd) || "flow-app" };
|
|
22
|
+
target.dependencies = { ...target.dependencies, ...config.dependencies };
|
|
23
|
+
target.devDependencies = { ...target.devDependencies, ...config.devDependencies };
|
|
24
|
+
target.scripts = { ...target.scripts, ...config.scripts };
|
|
25
|
+
writeFileSync(targetPath, JSON.stringify(target, null, 2));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function initLib(lib: string, cwd: string, done: Set<string>): void {
|
|
29
|
+
const pkgName = toPkgName(lib);
|
|
30
|
+
if (done.has(pkgName)) return;
|
|
31
|
+
|
|
32
|
+
const root = pkgRoot(pkgName);
|
|
33
|
+
const configDir = join(root, "config");
|
|
34
|
+
if (!existsSync(configDir)) return;
|
|
35
|
+
|
|
36
|
+
for (const sub of flowDeps(root)) {
|
|
37
|
+
initLib(toShortName(sub), cwd, done);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
copyConfig(configDir, cwd);
|
|
41
|
+
mergePkg(configDir, cwd);
|
|
42
|
+
done.add(pkgName);
|
|
43
|
+
}
|
package/LICENSE
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
Flow OS Framework and all packages in this repository are licensed under the
|
|
2
|
-
PolyForm Shield License 1.0.0. This license applies to the entire repository
|
|
3
|
-
(framework, packages/*, client, server, and any other code herein).
|
|
4
|
-
|
|
5
|
-
Required Notice: Copyright (c) Flow OS. All rights reserved.
|
|
6
|
-
|
|
7
|
-
-------------------------------------------------------------------------------
|
|
8
|
-
|
|
9
|
-
# PolyForm Shield License 1.0.0
|
|
10
|
-
|
|
11
|
-
## Acceptance
|
|
12
|
-
|
|
13
|
-
In order to get any license under these terms, you must agree to them as both strict obligations and conditions to all your licenses.
|
|
14
|
-
|
|
15
|
-
## Copyright License
|
|
16
|
-
|
|
17
|
-
The licensor grants you a copyright license for the software to do everything you might do with the software that would otherwise infringe the licensor's copyright in it for any permitted purpose. However, you may only distribute the software according to [Distribution License](#distribution-license) and make changes or new works based on the software according to [Changes and New Works License](#changes-and-new-works-license).
|
|
18
|
-
|
|
19
|
-
## Distribution License
|
|
20
|
-
|
|
21
|
-
The licensor grants you an additional copyright license to distribute copies of the software. Your license to distribute covers distributing the software with changes and new works permitted by [Changes and New Works License](#changes-and-new-works-license).
|
|
22
|
-
|
|
23
|
-
## Notices
|
|
24
|
-
|
|
25
|
-
You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms or the URL for them above, as well as copies of any plain-text lines beginning with `Required Notice:` that the licensor provided with the software. For example:
|
|
26
|
-
|
|
27
|
-
> Required Notice: Copyright Yoyodyne, Inc. (http://example.com)
|
|
28
|
-
|
|
29
|
-
## Changes and New Works License
|
|
30
|
-
|
|
31
|
-
The licensor grants you an additional copyright license to make changes and new works based on the software for any permitted purpose.
|
|
32
|
-
|
|
33
|
-
## Patent License
|
|
34
|
-
|
|
35
|
-
The licensor grants you a patent license for the software that covers patent claims the licensor can license, or becomes able to license, that you would infringe by using the software.
|
|
36
|
-
|
|
37
|
-
## Noncompete
|
|
38
|
-
|
|
39
|
-
Any purpose is a permitted purpose, except for providing any product that competes with the software or any product the licensor or any of its affiliates provides using the software.
|
|
40
|
-
|
|
41
|
-
## Competition
|
|
42
|
-
|
|
43
|
-
Goods and services compete even when they provide functionality through different kinds of interfaces or for different technical platforms. Applications can compete with services, libraries with plugins, frameworks with development tools, and so on, even if they're written in different programming languages or for different computer architectures. Goods and services compete even when provided free of charge. If you market a product as a practical substitute for the software or another product, it definitely competes.
|
|
44
|
-
|
|
45
|
-
## New Products
|
|
46
|
-
|
|
47
|
-
If you are using the software to provide a product that does not compete, but the licensor or any of its affiliates brings your product into competition by providing a new version of the software or another product using the software, you may continue using versions of the software available under these terms beforehand to provide your competing product, but not any later versions.
|
|
48
|
-
|
|
49
|
-
## Discontinued Products
|
|
50
|
-
|
|
51
|
-
You may begin using the software to compete with a product or service that the licensor or any of its affiliates has stopped providing, unless the licensor includes a plain-text line beginning with `Licensor Line of Business:` with the software that mentions that line of business. For example:
|
|
52
|
-
|
|
53
|
-
> Licensor Line of Business: YoyodyneCMS Content Management System (http://example.com/cms)
|
|
54
|
-
|
|
55
|
-
Licensor Line of Business: Flow OS application framework and development tooling (create-flow, @flow.os/* packages, and related framework components).
|
|
56
|
-
|
|
57
|
-
## Sales of Business
|
|
58
|
-
|
|
59
|
-
If the licensor or any of its affiliates sells a line of business developing the software or using the software to provide a product, the buyer can also enforce [Noncompete](#noncompete) for that product.
|
|
60
|
-
|
|
61
|
-
## Fair Use
|
|
62
|
-
|
|
63
|
-
You may have "fair use" rights for the software under the law. These terms do not limit them.
|
|
64
|
-
|
|
65
|
-
## No Other Rights
|
|
66
|
-
|
|
67
|
-
These terms do not allow you to sublicense or transfer any of your licenses to anyone else, or prevent the licensor from granting licenses to anyone else. These terms do not imply any other licenses.
|
|
68
|
-
|
|
69
|
-
## Patent Defense
|
|
70
|
-
|
|
71
|
-
If you make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
|
|
72
|
-
|
|
73
|
-
## Violations
|
|
74
|
-
|
|
75
|
-
The first time you are notified in writing that you have violated any of these terms, or done anything with the software not covered by your licenses, your licenses can nonetheless continue if you come into full compliance with these terms, and take practical steps to correct past violations, within 32 days of receiving notice. Otherwise, all your licenses end immediately.
|
|
76
|
-
|
|
77
|
-
## No Liability
|
|
78
|
-
|
|
79
|
-
***As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.***
|
|
80
|
-
|
|
81
|
-
## Definitions
|
|
82
|
-
|
|
83
|
-
The **licensor** is the individual or entity offering these terms, and the **software** is the software the licensor makes available under these terms.
|
|
84
|
-
|
|
85
|
-
A **product** can be a good or service, or a combination of them.
|
|
86
|
-
|
|
87
|
-
**You** refers to the individual or entity agreeing to these terms.
|
|
88
|
-
|
|
89
|
-
**Your company** is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all its affiliates.
|
|
90
|
-
|
|
91
|
-
**Affiliates** means the other organizations than an organization has control over, is under the control of, or is under common control with.
|
|
92
|
-
|
|
93
|
-
**Control** means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
|
|
94
|
-
|
|
95
|
-
**Your licenses** are all the licenses granted to you for the software under these terms.
|
|
96
|
-
|
|
97
|
-
**Use** means anything you do with the software requiring one of your licenses.
|
package/README.md
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
# create-flow-os
|
|
2
|
-
|
|
3
|
-
CLI per generare progetti Flow.os da profili e pacchetti.
|
|
4
|
-
|
|
5
|
-
## Cosa modificare
|
|
6
|
-
|
|
7
|
-
- **`config.json`** — unica configurazione da editare: profili, pacchetti, dipendenze, tag `@flow:`.
|
|
8
|
-
- **`index.ts`** — entry della CLI create (solo se cambi logica di scaffold).
|
|
9
|
-
- **`lib/utils.ts`** — helper condivisi (copy, transform, findPackageDir).
|
|
10
|
-
- **`templates/`** — `flow.config.client.ts`, `flow.config.server.ts`, `flow.config.full.ts` (usati da gen per i profili; full = server: true + flowStyleBuilder).
|
|
11
|
-
|
|
12
|
-
## Cosa non toccare
|
|
13
|
-
|
|
14
|
-
- **`scripts/`** — `gen.ts` (genera profiles + packages da config), `publish-dev.ts`, `publish.ts`, `version.ts`.
|
|
15
|
-
- **`bin/`** — output di `bun run build`; non editare.
|
|
16
|
-
- **`profiles/`** e **`packages/`** — generati da `bun run gen`; eventuali modifiche vanno fatte nei sorgenti del repo e nei tag nei file, poi rigenerare.
|
|
17
|
-
|
|
18
|
-
## Comandi
|
|
19
|
-
|
|
20
|
-
- `bun run gen` — rigenera profiles e packages da `config.json`.
|
|
21
|
-
- `bun run build` — compila `index.ts` in `bin/`.
|
|
22
|
-
- `bun run publish:dev` — gen + build + publish su tag `dev`.
|
|
23
|
-
- `bun run version -- patch|minor|major|X.Y.Z` — imposta versioni.
|
|
24
|
-
- `bun run release` — publish su tag `latest`.
|
|
25
|
-
|
|
26
|
-
Il README non è incluso nei file pubblicati su npm (`files` in package.json).
|