create-flow-os 0.0.1-dev.1771840262 → 0.0.1-dev.1771979233

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.
Files changed (230) hide show
  1. package/package.json +8 -23
  2. package/{profiles/server/packages/style → src/create}/index.ts +31 -30
  3. package/src/index.ts +14 -0
  4. package/src/init/index.ts +66 -0
  5. package/src/init/lib.ts +36 -0
  6. package/src/init/scaffold.ts +43 -0
  7. package/LICENSE +0 -97
  8. package/README.md +0 -26
  9. package/bin/index.js +0 -1215
  10. package/config.json +0 -89
  11. package/lib/utils.ts +0 -91
  12. package/packages/client/client/root.css +0 -9
  13. package/packages/client/client/root.tsx +0 -6
  14. package/packages/client/client/routes/404.tsx +0 -24
  15. package/packages/client/client/routes/index.tsx +0 -48
  16. package/packages/server/server/routes/hello.get.ts +0 -3
  17. package/profiles/client/.dockerignore +0 -12
  18. package/profiles/client/.oxfmtrc.json +0 -7
  19. package/profiles/client/.oxlintrc.json +0 -13
  20. package/profiles/client/.vscode/settings.json +0 -12
  21. package/profiles/client/Dockerfile +0 -26
  22. package/profiles/client/README.md +0 -34
  23. package/profiles/client/bun.lock +0 -352
  24. package/profiles/client/client/root.css +0 -9
  25. package/profiles/client/client/root.tsx +0 -6
  26. package/profiles/client/client/routes/404.tsx +0 -24
  27. package/profiles/client/client/routes/about.tsx +0 -7
  28. package/profiles/client/client/routes/index.tsx +0 -48
  29. package/profiles/client/flow.config.ts +0 -6
  30. package/profiles/client/index.html +0 -5
  31. package/profiles/client/package.json +0 -32
  32. package/profiles/client/packages/client/LICENSE +0 -97
  33. package/profiles/client/packages/client/build/config.ts +0 -211
  34. package/profiles/client/packages/client/build/vite.ts +0 -98
  35. package/profiles/client/packages/client/features/attrs.ts +0 -32
  36. package/profiles/client/packages/client/features/class-flow.ts +0 -116
  37. package/profiles/client/packages/client/features/index.ts +0 -8
  38. package/profiles/client/packages/client/features/pseudo-injector.ts +0 -40
  39. package/profiles/client/packages/client/features/style-flow.ts +0 -106
  40. package/profiles/client/packages/client/features/style.ts +0 -27
  41. package/profiles/client/packages/client/features/utils.ts +0 -4
  42. package/profiles/client/packages/client/features/viewport.ts +0 -20
  43. package/profiles/client/packages/client/index.ts +0 -7
  44. package/profiles/client/packages/client/package.json +0 -48
  45. package/profiles/client/packages/client/runtime/dom.ts +0 -2
  46. package/profiles/client/packages/client/runtime/jsx-dev-runtime.ts +0 -1
  47. package/profiles/client/packages/client/runtime/jsx-runtime.ts +0 -1
  48. package/profiles/client/packages/client/runtime/jsx-types.d.ts +0 -66
  49. package/profiles/client/packages/client/runtime/jsx.ts +0 -101
  50. package/profiles/client/packages/client/scripts/build.ts +0 -14
  51. package/profiles/client/packages/client/scripts/preview.ts +0 -14
  52. package/profiles/client/packages/client/scripts/start-dev.ts +0 -49
  53. package/profiles/client/packages/core/LICENSE +0 -97
  54. package/profiles/client/packages/core/dom.ts +0 -43
  55. package/profiles/client/packages/core/for.ts +0 -42
  56. package/profiles/client/packages/core/index.ts +0 -5
  57. package/profiles/client/packages/core/lifecycle.ts +0 -6
  58. package/profiles/client/packages/core/package.json +0 -16
  59. package/profiles/client/packages/core/show-switch.ts +0 -56
  60. package/profiles/client/packages/core/state.ts +0 -56
  61. package/profiles/client/packages/router/LICENSE +0 -97
  62. package/profiles/client/packages/router/index.ts +0 -20
  63. package/profiles/client/packages/router/matcher.ts +0 -105
  64. package/profiles/client/packages/router/package.json +0 -15
  65. package/profiles/client/packages/router/router.ts +0 -185
  66. package/profiles/client/packages/router/types.ts +0 -34
  67. package/profiles/client/packages/router/utils.ts +0 -45
  68. package/profiles/client/packages/style/LICENSE +0 -97
  69. package/profiles/client/packages/style/breakpoints.ts +0 -20
  70. package/profiles/client/packages/style/extension/.vscodeignore +0 -5
  71. package/profiles/client/packages/style/extension/flow-style-colors-0.0.1.vsix +0 -0
  72. package/profiles/client/packages/style/extension/out/extension.js +0 -130
  73. package/profiles/client/packages/style/extension/package.json +0 -24
  74. package/profiles/client/packages/style/extension/src/extension.ts +0 -146
  75. package/profiles/client/packages/style/extension/tsconfig.json +0 -12
  76. package/profiles/client/packages/style/index.ts +0 -30
  77. package/profiles/client/packages/style/package.json +0 -20
  78. package/profiles/client/packages/style/react.ts +0 -68
  79. package/profiles/client/packages/style/resolve.ts +0 -127
  80. package/profiles/client/packages/style/server.ts +0 -299
  81. package/profiles/client/packages/style/shorthand.ts +0 -96
  82. package/profiles/client/packages/style/style-builder/button.ts +0 -41
  83. package/profiles/client/packages/style/style-builder/constants.ts +0 -16
  84. package/profiles/client/packages/style/style-builder/dom.ts +0 -18
  85. package/profiles/client/packages/style/style-builder/index.ts +0 -48
  86. package/profiles/client/packages/style/style-builder/panel.ts +0 -69
  87. package/profiles/client/packages/style/style-builder/position.ts +0 -25
  88. package/profiles/client/packages/style/visual-builder.ts +0 -822
  89. package/profiles/client/packages/style/vite-plugin.ts +0 -86
  90. package/profiles/client/tsconfig.json +0 -30
  91. package/profiles/full/.dockerignore +0 -12
  92. package/profiles/full/.oxfmtrc.json +0 -7
  93. package/profiles/full/.oxlintrc.json +0 -13
  94. package/profiles/full/.vscode/settings.json +0 -12
  95. package/profiles/full/Dockerfile +0 -26
  96. package/profiles/full/README.md +0 -34
  97. package/profiles/full/bun.lock +0 -352
  98. package/profiles/full/client/root.css +0 -9
  99. package/profiles/full/client/root.tsx +0 -6
  100. package/profiles/full/client/routes/404.tsx +0 -24
  101. package/profiles/full/client/routes/about.tsx +0 -7
  102. package/profiles/full/client/routes/index.tsx +0 -48
  103. package/profiles/full/flow.config.ts +0 -6
  104. package/profiles/full/index.html +0 -5
  105. package/profiles/full/package.json +0 -33
  106. package/profiles/full/packages/client/LICENSE +0 -97
  107. package/profiles/full/packages/client/build/config.ts +0 -211
  108. package/profiles/full/packages/client/build/vite.ts +0 -98
  109. package/profiles/full/packages/client/features/attrs.ts +0 -32
  110. package/profiles/full/packages/client/features/class-flow.ts +0 -116
  111. package/profiles/full/packages/client/features/index.ts +0 -8
  112. package/profiles/full/packages/client/features/pseudo-injector.ts +0 -40
  113. package/profiles/full/packages/client/features/style-flow.ts +0 -106
  114. package/profiles/full/packages/client/features/style.ts +0 -27
  115. package/profiles/full/packages/client/features/utils.ts +0 -4
  116. package/profiles/full/packages/client/features/viewport.ts +0 -20
  117. package/profiles/full/packages/client/index.ts +0 -7
  118. package/profiles/full/packages/client/package.json +0 -48
  119. package/profiles/full/packages/client/runtime/dom.ts +0 -2
  120. package/profiles/full/packages/client/runtime/jsx-dev-runtime.ts +0 -1
  121. package/profiles/full/packages/client/runtime/jsx-runtime.ts +0 -1
  122. package/profiles/full/packages/client/runtime/jsx-types.d.ts +0 -66
  123. package/profiles/full/packages/client/runtime/jsx.ts +0 -101
  124. package/profiles/full/packages/client/scripts/build.ts +0 -14
  125. package/profiles/full/packages/client/scripts/preview.ts +0 -14
  126. package/profiles/full/packages/client/scripts/start-dev.ts +0 -49
  127. package/profiles/full/packages/core/LICENSE +0 -97
  128. package/profiles/full/packages/core/dom.ts +0 -43
  129. package/profiles/full/packages/core/for.ts +0 -42
  130. package/profiles/full/packages/core/index.ts +0 -5
  131. package/profiles/full/packages/core/lifecycle.ts +0 -6
  132. package/profiles/full/packages/core/package.json +0 -16
  133. package/profiles/full/packages/core/show-switch.ts +0 -56
  134. package/profiles/full/packages/core/state.ts +0 -56
  135. package/profiles/full/packages/router/LICENSE +0 -97
  136. package/profiles/full/packages/router/index.ts +0 -20
  137. package/profiles/full/packages/router/matcher.ts +0 -105
  138. package/profiles/full/packages/router/package.json +0 -15
  139. package/profiles/full/packages/router/router.ts +0 -185
  140. package/profiles/full/packages/router/types.ts +0 -34
  141. package/profiles/full/packages/router/utils.ts +0 -45
  142. package/profiles/full/packages/server/LICENSE +0 -97
  143. package/profiles/full/packages/server/core.ts +0 -140
  144. package/profiles/full/packages/server/index.ts +0 -24
  145. package/profiles/full/packages/server/package.json +0 -32
  146. package/profiles/full/packages/server/plugin.ts +0 -79
  147. package/profiles/full/packages/server/production.ts +0 -75
  148. package/profiles/full/packages/server/scripts/start.ts +0 -11
  149. package/profiles/full/packages/style/LICENSE +0 -97
  150. package/profiles/full/packages/style/breakpoints.ts +0 -20
  151. package/profiles/full/packages/style/extension/.vscodeignore +0 -5
  152. package/profiles/full/packages/style/extension/flow-style-colors-0.0.1.vsix +0 -0
  153. package/profiles/full/packages/style/extension/out/extension.js +0 -130
  154. package/profiles/full/packages/style/extension/package.json +0 -24
  155. package/profiles/full/packages/style/extension/src/extension.ts +0 -146
  156. package/profiles/full/packages/style/extension/tsconfig.json +0 -12
  157. package/profiles/full/packages/style/index.ts +0 -30
  158. package/profiles/full/packages/style/package.json +0 -20
  159. package/profiles/full/packages/style/react.ts +0 -68
  160. package/profiles/full/packages/style/resolve.ts +0 -127
  161. package/profiles/full/packages/style/server.ts +0 -299
  162. package/profiles/full/packages/style/shorthand.ts +0 -96
  163. package/profiles/full/packages/style/style-builder/button.ts +0 -41
  164. package/profiles/full/packages/style/style-builder/constants.ts +0 -16
  165. package/profiles/full/packages/style/style-builder/dom.ts +0 -18
  166. package/profiles/full/packages/style/style-builder/index.ts +0 -48
  167. package/profiles/full/packages/style/style-builder/panel.ts +0 -69
  168. package/profiles/full/packages/style/style-builder/position.ts +0 -25
  169. package/profiles/full/packages/style/visual-builder.ts +0 -822
  170. package/profiles/full/packages/style/vite-plugin.ts +0 -86
  171. package/profiles/full/server/routes/hello.get.ts +0 -3
  172. package/profiles/full/tsconfig.json +0 -30
  173. package/profiles/server/.dockerignore +0 -12
  174. package/profiles/server/.oxfmtrc.json +0 -7
  175. package/profiles/server/.oxlintrc.json +0 -13
  176. package/profiles/server/.vscode/settings.json +0 -12
  177. package/profiles/server/Dockerfile +0 -26
  178. package/profiles/server/README.md +0 -34
  179. package/profiles/server/bun.lock +0 -352
  180. package/profiles/server/flow.config.ts +0 -7
  181. package/profiles/server/index.html +0 -5
  182. package/profiles/server/package.json +0 -30
  183. package/profiles/server/packages/core/LICENSE +0 -97
  184. package/profiles/server/packages/core/dom.ts +0 -43
  185. package/profiles/server/packages/core/for.ts +0 -42
  186. package/profiles/server/packages/core/index.ts +0 -5
  187. package/profiles/server/packages/core/lifecycle.ts +0 -6
  188. package/profiles/server/packages/core/package.json +0 -16
  189. package/profiles/server/packages/core/show-switch.ts +0 -56
  190. package/profiles/server/packages/core/state.ts +0 -56
  191. package/profiles/server/packages/router/LICENSE +0 -97
  192. package/profiles/server/packages/router/index.ts +0 -20
  193. package/profiles/server/packages/router/matcher.ts +0 -105
  194. package/profiles/server/packages/router/package.json +0 -15
  195. package/profiles/server/packages/router/router.ts +0 -185
  196. package/profiles/server/packages/router/types.ts +0 -34
  197. package/profiles/server/packages/router/utils.ts +0 -45
  198. package/profiles/server/packages/server/LICENSE +0 -97
  199. package/profiles/server/packages/server/core.ts +0 -140
  200. package/profiles/server/packages/server/index.ts +0 -24
  201. package/profiles/server/packages/server/package.json +0 -32
  202. package/profiles/server/packages/server/plugin.ts +0 -79
  203. package/profiles/server/packages/server/production.ts +0 -75
  204. package/profiles/server/packages/server/scripts/start.ts +0 -11
  205. package/profiles/server/packages/style/LICENSE +0 -97
  206. package/profiles/server/packages/style/breakpoints.ts +0 -20
  207. package/profiles/server/packages/style/extension/.vscodeignore +0 -5
  208. package/profiles/server/packages/style/extension/flow-style-colors-0.0.1.vsix +0 -0
  209. package/profiles/server/packages/style/extension/out/extension.js +0 -130
  210. package/profiles/server/packages/style/extension/package.json +0 -24
  211. package/profiles/server/packages/style/extension/src/extension.ts +0 -146
  212. package/profiles/server/packages/style/extension/tsconfig.json +0 -12
  213. package/profiles/server/packages/style/package.json +0 -20
  214. package/profiles/server/packages/style/react.ts +0 -68
  215. package/profiles/server/packages/style/resolve.ts +0 -127
  216. package/profiles/server/packages/style/server.ts +0 -299
  217. package/profiles/server/packages/style/shorthand.ts +0 -96
  218. package/profiles/server/packages/style/style-builder/button.ts +0 -41
  219. package/profiles/server/packages/style/style-builder/constants.ts +0 -16
  220. package/profiles/server/packages/style/style-builder/dom.ts +0 -18
  221. package/profiles/server/packages/style/style-builder/index.ts +0 -48
  222. package/profiles/server/packages/style/style-builder/panel.ts +0 -69
  223. package/profiles/server/packages/style/style-builder/position.ts +0 -25
  224. package/profiles/server/packages/style/visual-builder.ts +0 -822
  225. package/profiles/server/packages/style/vite-plugin.ts +0 -86
  226. package/profiles/server/server/routes/hello.get.ts +0 -3
  227. package/profiles/server/tsconfig.json +0 -30
  228. package/templates/flow.config.client.ts +0 -6
  229. package/templates/flow.config.full.ts +0 -6
  230. 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.1771840262",
3
+ "version": "0.0.1-dev.1771979233",
4
+ "license": "PolyForm-Shield-1.0.0",
4
5
  "type": "module",
6
+ "dependencies": {
7
+ "@flow-os/client": "0.0.1"
8
+ },
5
9
  "bin": {
6
- "create-flow-os": "bin/index.js"
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
- "gen": "bun scripts/gen.ts",
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": "~1.2.0"
16
+ "bun-types": "^1.3.9"
32
17
  }
33
18
  }
@@ -1,30 +1,31 @@
1
- // ───────────────────────────────────────────────────────────────────────────────
2
- // For other frameworks for wrapping App
3
- // <FlowStyle> <App /> </FlowStyle>
4
- // ───────────────────────────────────────────────────────────────────────────────
5
- export { flowStyle as FlowStyle } from './resolve.js';
6
-
7
-
8
- // ───────────────────────────────────────────────────────────────────────────────
9
- // Visual builder (UI)
10
- // ───────────────────────────────────────────────────────────────────────────────
11
- export { VisualStyleBuilder, initVisualStyleBuilder } from './visual-builder.js';
12
- export type { VisualStyleBuilderOptions } from './visual-builder.js';
13
-
14
- // Plugin Vite (node only): usa import('@flow.os/style/vite-plugin').styleFlowServerPlugin()
15
-
16
- // ───────────────────────────────────────────────────────────────────────────────
17
- // Flow Style Builder – sempre esportato da style; pulsante trascinabile + pannello
18
- // ───────────────────────────────────────────────────────────────────────────────
19
- export { initFlowStyleBuilder, flowStyleBuilder } from './style-builder/index.js';
20
- export type { FlowStyleBuilderOptions, FlowStyleBuilderPosition } from './style-builder/index.js';
21
-
22
-
23
- // ───────────────────────────────────────────────────────────────────────────────
24
- // For @flow.os/client internal use
25
- // ───────────────────────────────────────────────────────────────────────────────
26
- export { resolveLayer, resolvePseudoStyle, styleToCssText } from './resolve.js';
27
- export { VIEWPORT_KEYS, PSEUDO_KEYS, getViewportKeyFromWidth } from './breakpoints.js';
28
- export type { PlainLayer } from './resolve.js';
29
- export type { ViewportKey, PseudoKey } from './breakpoints.js';
30
- export type { StyleShorthandKey } from './shorthand.js';
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 {};
@@ -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).