create-flow-os 0.0.1-dev.1771669831 → 0.0.1-dev.1771670377

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 (37) hide show
  1. package/bin/index.js +13 -8
  2. package/package.json +1 -1
  3. package/profiles/client/Dockerfile +3 -3
  4. package/profiles/client/dev.ts +16 -3
  5. package/profiles/client/package.json +3 -3
  6. package/profiles/client/packages/client/config.ts +1 -1
  7. package/profiles/client/tsconfig.json +1 -1
  8. package/profiles/full/Dockerfile +3 -3
  9. package/profiles/full/dev.ts +16 -3
  10. package/profiles/full/package.json +3 -3
  11. package/profiles/full/packages/client/config.ts +1 -1
  12. package/profiles/full/tsconfig.json +1 -1
  13. package/profiles/server/Dockerfile +3 -3
  14. package/profiles/server/dev.ts +16 -3
  15. package/profiles/server/package.json +3 -3
  16. package/profiles/server/tsconfig.json +1 -1
  17. /package/profiles/client/packages/{flow.os → core}/dom.ts +0 -0
  18. /package/profiles/client/packages/{flow.os → core}/for.ts +0 -0
  19. /package/profiles/client/packages/{flow.os → core}/index.ts +0 -0
  20. /package/profiles/client/packages/{flow.os → core}/lifecycle.ts +0 -0
  21. /package/profiles/client/packages/{flow.os → core}/package.json +0 -0
  22. /package/profiles/client/packages/{flow.os → core}/show-switch.ts +0 -0
  23. /package/profiles/client/packages/{flow.os → core}/state.ts +0 -0
  24. /package/profiles/full/packages/{flow.os → core}/dom.ts +0 -0
  25. /package/profiles/full/packages/{flow.os → core}/for.ts +0 -0
  26. /package/profiles/full/packages/{flow.os → core}/index.ts +0 -0
  27. /package/profiles/full/packages/{flow.os → core}/lifecycle.ts +0 -0
  28. /package/profiles/full/packages/{flow.os → core}/package.json +0 -0
  29. /package/profiles/full/packages/{flow.os → core}/show-switch.ts +0 -0
  30. /package/profiles/full/packages/{flow.os → core}/state.ts +0 -0
  31. /package/profiles/server/packages/{flow.os → core}/dom.ts +0 -0
  32. /package/profiles/server/packages/{flow.os → core}/for.ts +0 -0
  33. /package/profiles/server/packages/{flow.os → core}/index.ts +0 -0
  34. /package/profiles/server/packages/{flow.os → core}/lifecycle.ts +0 -0
  35. /package/profiles/server/packages/{flow.os → core}/package.json +0 -0
  36. /package/profiles/server/packages/{flow.os → core}/show-switch.ts +0 -0
  37. /package/profiles/server/packages/{flow.os → core}/state.ts +0 -0
package/bin/index.js CHANGED
@@ -794,10 +794,11 @@ function transformPackageJson(pkg, projectName, extraPackages = {}, useWorkspace
794
794
  const next = {};
795
795
  for (const [k3, v3] of Object.entries(deps)) {
796
796
  const isFlow = k3.startsWith("@flow.os/") || k3 === "@flow.os";
797
- if (v3 === "workspace:*")
797
+ if (v3 === "workspace:*" || isFlow && typeof v3 === "string" && (v3.startsWith("file:./packages/") || v3.startsWith("file:../"))) {
798
798
  next[k3] = useWorkspace && isFlow ? "workspace:*" : "^0.0.1";
799
- else
799
+ } else {
800
800
  next[k3] = v3;
801
+ }
801
802
  }
802
803
  for (const [k3, v3] of Object.entries(extraPackages)) {
803
804
  if (!(k3 in next))
@@ -921,17 +922,21 @@ function optsForProfile(config, profileId) {
921
922
  }
922
923
  async function main() {
923
924
  const devBadge = useDevTag ? c2.dim(" \xB7 dev") : "";
924
- const introW = 44;
925
+ const CONTENT_W = 46;
926
+ const BORDER_W = 50;
925
927
  const introLine = (content) => {
926
928
  const plain = stripAnsi(content);
927
- const pad = Math.max(0, introW - plain.length);
928
- return c2.dim(" \u2502 ") + content + " ".repeat(pad) + c2.dim(" \u2502");
929
+ const len = plain.length;
930
+ const pad = Math.max(0, CONTENT_W - len);
931
+ const left = Math.floor(pad / 2);
932
+ const right = pad - left;
933
+ return c2.dim(" \u2502 ") + " ".repeat(left) + content + " ".repeat(right) + c2.dim(" \u2502");
929
934
  };
930
- const introBorder = (ch) => c2.dim(" " + (ch === "t" ? "\u256D" : "\u2570") + "\u2500".repeat(introW) + (ch === "t" ? "\u256E" : "\u256F"));
935
+ const introBorder = (ch) => c2.dim(" " + (ch === "t" ? "\u256D" : "\u2570") + "\u2500".repeat(BORDER_W) + (ch === "t" ? "\u256E" : "\u256F"));
936
+ const singleLine = "Create " + c2.bold(c2.cyan("Flow OS")) + devBadge + " application";
931
937
  console.log(`
932
938
  ` + introBorder("t") + `
933
- ` + introLine(c2.bold(c2.cyan("Flow OS")) + devBadge) + `
934
- ` + introLine("Create " + c2.bold(c2.cyan("Flow OS")) + " application") + `
939
+ ` + introLine(singleLine) + `
935
940
  ` + introBorder("b") + `
936
941
  `);
937
942
  const config = await Bun.file(join2(DIR, "config.json")).json();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-flow-os",
3
- "version": "0.0.1-dev.1771669831",
3
+ "version": "0.0.1-dev.1771670377",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "create-flow-os": "bin/index.js"
@@ -1,10 +1,10 @@
1
- # DEV: packages/flow.os → workaround Bun workspace (doppio install).
1
+ # DEV: packages/core → workaround Bun workspace (doppio install).
2
2
  # PROD: install → build → start (PORT da env)
3
3
 
4
4
  FROM oven/bun:1 AS builder
5
5
  WORKDIR /app
6
6
  COPY . .
7
- RUN if [ -d packages ] && [ -f packages/flow.os/package.json ]; then \
7
+ RUN if [ -d packages ] && [ -f packages/core/package.json ]; then \
8
8
  bun install || true && bun install; \
9
9
  else \
10
10
  bun install --frozen-lockfile; \
@@ -17,7 +17,7 @@ WORKDIR /app
17
17
  ENV NODE_ENV=production
18
18
  ENV PORT=3000
19
19
  COPY --from=builder /app/out/ ./
20
- RUN if [ -d packages ] && [ -f packages/flow.os/package.json ]; then \
20
+ RUN if [ -d packages ] && [ -f packages/core/package.json ]; then \
21
21
  bun install --frozen-lockfile --production || true && bun install --frozen-lockfile --production; \
22
22
  else \
23
23
  bun install --frozen-lockfile --production; \
@@ -1,5 +1,18 @@
1
1
  #!/usr/bin/env bun
2
- import { pathToFileURL } from 'node:url';
3
- import { join } from 'node:path';
2
+ /**
3
+ * Dev server: carica flow.config.ts e avvia il server (non dipende da file nel package @flow.os/client).
4
+ */
5
+ import { pathToFileURL } from "node:url";
6
+ import { join } from "node:path";
7
+ import { createServer } from "vite";
4
8
 
5
- await import(pathToFileURL(join(import.meta.dir, 'node_modules/@flow.os/client/start-dev.ts')).href);
9
+ const cwd = import.meta.dir;
10
+ const configUrl = pathToFileURL(join(cwd, "flow.config.ts")).href;
11
+ const mod = await import(configUrl).catch((e: Error) => {
12
+ console.error("Flow: could not load flow.config.ts:", e.message);
13
+ process.exit(1);
14
+ });
15
+ const getConfig = mod.default;
16
+ const config = typeof getConfig === "function" ? await getConfig() : getConfig;
17
+ const server = await createServer(config);
18
+ await server.listen();
@@ -5,8 +5,8 @@
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "bun dev.ts",
8
- "build": "tsc -b && bun packages/client/build.ts",
9
- "preview": "bun packages/client/preview.ts",
8
+ "build": "tsc -b && bun node_modules/@flow.os/client/build.ts",
9
+ "preview": "bun node_modules/@flow.os/client/preview.ts",
10
10
  "start": "bun node_modules/@flow.os/server/start.ts",
11
11
  "lint": "oxlint .",
12
12
  "fmt": "oxfmt",
@@ -16,7 +16,7 @@
16
16
  "dependencies": {
17
17
  "@flow.os/client": "file:./packages/client",
18
18
  "@flow.os/server": "^0.0.1",
19
- "@flow.os/core": "file:./packages/flow.os",
19
+ "@flow.os/core": "file:./packages/core",
20
20
  "@flow.os/router": "file:./packages/router",
21
21
  "@flow.os/style": "file:./packages/style"
22
22
  },
@@ -43,7 +43,7 @@ function resolveAlias(): Record<string, string> {
43
43
  const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8')) as { name?: string };
44
44
  if (pkg.name?.startsWith('@flow.os/') || pkg.name === '@flow.os') alias[pkg.name] = abs;
45
45
  } catch {}
46
- if (name !== 'flow.os') alias[`@flow.os/${name}`] = abs;
46
+ alias[`@flow.os/${name}`] = abs;
47
47
  }
48
48
  return alias;
49
49
  }
@@ -22,7 +22,7 @@
22
22
  "paths": {
23
23
  "~/*": ["client/*"],
24
24
  "~server/*": ["server/*"],
25
- "@flow.os/core": ["packages/flow.os/index.ts"],
25
+ "@flow.os/core": ["packages/core/index.ts"],
26
26
  "@flow.os/*": ["packages/*"]
27
27
  }
28
28
  },
@@ -1,10 +1,10 @@
1
- # DEV: packages/flow.os → workaround Bun workspace (doppio install).
1
+ # DEV: packages/core → workaround Bun workspace (doppio install).
2
2
  # PROD: install → build → start (PORT da env)
3
3
 
4
4
  FROM oven/bun:1 AS builder
5
5
  WORKDIR /app
6
6
  COPY . .
7
- RUN if [ -d packages ] && [ -f packages/flow.os/package.json ]; then \
7
+ RUN if [ -d packages ] && [ -f packages/core/package.json ]; then \
8
8
  bun install || true && bun install; \
9
9
  else \
10
10
  bun install --frozen-lockfile; \
@@ -17,7 +17,7 @@ WORKDIR /app
17
17
  ENV NODE_ENV=production
18
18
  ENV PORT=3000
19
19
  COPY --from=builder /app/out/ ./
20
- RUN if [ -d packages ] && [ -f packages/flow.os/package.json ]; then \
20
+ RUN if [ -d packages ] && [ -f packages/core/package.json ]; then \
21
21
  bun install --frozen-lockfile --production || true && bun install --frozen-lockfile --production; \
22
22
  else \
23
23
  bun install --frozen-lockfile --production; \
@@ -1,5 +1,18 @@
1
1
  #!/usr/bin/env bun
2
- import { pathToFileURL } from 'node:url';
3
- import { join } from 'node:path';
2
+ /**
3
+ * Dev server: carica flow.config.ts e avvia il server (non dipende da file nel package @flow.os/client).
4
+ */
5
+ import { pathToFileURL } from "node:url";
6
+ import { join } from "node:path";
7
+ import { createServer } from "vite";
4
8
 
5
- await import(pathToFileURL(join(import.meta.dir, 'node_modules/@flow.os/client/start-dev.ts')).href);
9
+ const cwd = import.meta.dir;
10
+ const configUrl = pathToFileURL(join(cwd, "flow.config.ts")).href;
11
+ const mod = await import(configUrl).catch((e: Error) => {
12
+ console.error("Flow: could not load flow.config.ts:", e.message);
13
+ process.exit(1);
14
+ });
15
+ const getConfig = mod.default;
16
+ const config = typeof getConfig === "function" ? await getConfig() : getConfig;
17
+ const server = await createServer(config);
18
+ await server.listen();
@@ -5,8 +5,8 @@
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "bun dev.ts",
8
- "build": "tsc -b && bun packages/client/build.ts",
9
- "preview": "bun packages/client/preview.ts",
8
+ "build": "tsc -b && bun node_modules/@flow.os/client/build.ts",
9
+ "preview": "bun node_modules/@flow.os/client/preview.ts",
10
10
  "start": "bun node_modules/@flow.os/server/start.ts",
11
11
  "lint": "oxlint .",
12
12
  "fmt": "oxfmt",
@@ -16,7 +16,7 @@
16
16
  "dependencies": {
17
17
  "@flow.os/client": "file:./packages/client",
18
18
  "@flow.os/server": "file:./packages/server",
19
- "@flow.os/core": "file:./packages/flow.os",
19
+ "@flow.os/core": "file:./packages/core",
20
20
  "@flow.os/router": "file:./packages/router",
21
21
  "@flow.os/style": "file:./packages/style"
22
22
  },
@@ -43,7 +43,7 @@ function resolveAlias(): Record<string, string> {
43
43
  const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8')) as { name?: string };
44
44
  if (pkg.name?.startsWith('@flow.os/') || pkg.name === '@flow.os') alias[pkg.name] = abs;
45
45
  } catch {}
46
- if (name !== 'flow.os') alias[`@flow.os/${name}`] = abs;
46
+ alias[`@flow.os/${name}`] = abs;
47
47
  }
48
48
  return alias;
49
49
  }
@@ -22,7 +22,7 @@
22
22
  "paths": {
23
23
  "~/*": ["client/*"],
24
24
  "~server/*": ["server/*"],
25
- "@flow.os/core": ["packages/flow.os/index.ts"],
25
+ "@flow.os/core": ["packages/core/index.ts"],
26
26
  "@flow.os/*": ["packages/*"]
27
27
  }
28
28
  },
@@ -1,10 +1,10 @@
1
- # DEV: packages/flow.os → workaround Bun workspace (doppio install).
1
+ # DEV: packages/core → workaround Bun workspace (doppio install).
2
2
  # PROD: install → build → start (PORT da env)
3
3
 
4
4
  FROM oven/bun:1 AS builder
5
5
  WORKDIR /app
6
6
  COPY . .
7
- RUN if [ -d packages ] && [ -f packages/flow.os/package.json ]; then \
7
+ RUN if [ -d packages ] && [ -f packages/core/package.json ]; then \
8
8
  bun install || true && bun install; \
9
9
  else \
10
10
  bun install --frozen-lockfile; \
@@ -17,7 +17,7 @@ WORKDIR /app
17
17
  ENV NODE_ENV=production
18
18
  ENV PORT=3000
19
19
  COPY --from=builder /app/out/ ./
20
- RUN if [ -d packages ] && [ -f packages/flow.os/package.json ]; then \
20
+ RUN if [ -d packages ] && [ -f packages/core/package.json ]; then \
21
21
  bun install --frozen-lockfile --production || true && bun install --frozen-lockfile --production; \
22
22
  else \
23
23
  bun install --frozen-lockfile --production; \
@@ -1,5 +1,18 @@
1
1
  #!/usr/bin/env bun
2
- import { pathToFileURL } from 'node:url';
3
- import { join } from 'node:path';
2
+ /**
3
+ * Dev server: carica flow.config.ts e avvia il server (non dipende da file nel package @flow.os/client).
4
+ */
5
+ import { pathToFileURL } from "node:url";
6
+ import { join } from "node:path";
7
+ import { createServer } from "vite";
4
8
 
5
- await import(pathToFileURL(join(import.meta.dir, 'node_modules/@flow.os/client/start-dev.ts')).href);
9
+ const cwd = import.meta.dir;
10
+ const configUrl = pathToFileURL(join(cwd, "flow.config.ts")).href;
11
+ const mod = await import(configUrl).catch((e: Error) => {
12
+ console.error("Flow: could not load flow.config.ts:", e.message);
13
+ process.exit(1);
14
+ });
15
+ const getConfig = mod.default;
16
+ const config = typeof getConfig === "function" ? await getConfig() : getConfig;
17
+ const server = await createServer(config);
18
+ await server.listen();
@@ -5,8 +5,8 @@
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "bun dev.ts",
8
- "build": "tsc -b && bun packages/client/build.ts",
9
- "preview": "bun packages/client/preview.ts",
8
+ "build": "tsc -b && bun node_modules/@flow.os/client/build.ts",
9
+ "preview": "bun node_modules/@flow.os/client/preview.ts",
10
10
  "start": "bun node_modules/@flow.os/server/start.ts",
11
11
  "lint": "oxlint .",
12
12
  "fmt": "oxfmt",
@@ -16,7 +16,7 @@
16
16
  "dependencies": {
17
17
  "@flow.os/client": "^0.0.1",
18
18
  "@flow.os/server": "file:./packages/server",
19
- "@flow.os/core": "file:./packages/flow.os",
19
+ "@flow.os/core": "file:./packages/core",
20
20
  "@flow.os/router": "file:./packages/router",
21
21
  "@flow.os/style": "file:./packages/style"
22
22
  },
@@ -22,7 +22,7 @@
22
22
  "paths": {
23
23
  "~/*": ["client/*"],
24
24
  "~server/*": ["server/*"],
25
- "@flow.os/core": ["packages/flow.os/index.ts"],
25
+ "@flow.os/core": ["packages/core/index.ts"],
26
26
  "@flow.os/*": ["packages/*"]
27
27
  }
28
28
  },
File without changes
File without changes