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.
- package/bin/index.js +13 -8
- package/package.json +1 -1
- package/profiles/client/Dockerfile +3 -3
- package/profiles/client/dev.ts +16 -3
- package/profiles/client/package.json +3 -3
- package/profiles/client/packages/client/config.ts +1 -1
- package/profiles/client/tsconfig.json +1 -1
- package/profiles/full/Dockerfile +3 -3
- package/profiles/full/dev.ts +16 -3
- package/profiles/full/package.json +3 -3
- package/profiles/full/packages/client/config.ts +1 -1
- package/profiles/full/tsconfig.json +1 -1
- package/profiles/server/Dockerfile +3 -3
- package/profiles/server/dev.ts +16 -3
- package/profiles/server/package.json +3 -3
- package/profiles/server/tsconfig.json +1 -1
- /package/profiles/client/packages/{flow.os → core}/dom.ts +0 -0
- /package/profiles/client/packages/{flow.os → core}/for.ts +0 -0
- /package/profiles/client/packages/{flow.os → core}/index.ts +0 -0
- /package/profiles/client/packages/{flow.os → core}/lifecycle.ts +0 -0
- /package/profiles/client/packages/{flow.os → core}/package.json +0 -0
- /package/profiles/client/packages/{flow.os → core}/show-switch.ts +0 -0
- /package/profiles/client/packages/{flow.os → core}/state.ts +0 -0
- /package/profiles/full/packages/{flow.os → core}/dom.ts +0 -0
- /package/profiles/full/packages/{flow.os → core}/for.ts +0 -0
- /package/profiles/full/packages/{flow.os → core}/index.ts +0 -0
- /package/profiles/full/packages/{flow.os → core}/lifecycle.ts +0 -0
- /package/profiles/full/packages/{flow.os → core}/package.json +0 -0
- /package/profiles/full/packages/{flow.os → core}/show-switch.ts +0 -0
- /package/profiles/full/packages/{flow.os → core}/state.ts +0 -0
- /package/profiles/server/packages/{flow.os → core}/dom.ts +0 -0
- /package/profiles/server/packages/{flow.os → core}/for.ts +0 -0
- /package/profiles/server/packages/{flow.os → core}/index.ts +0 -0
- /package/profiles/server/packages/{flow.os → core}/lifecycle.ts +0 -0
- /package/profiles/server/packages/{flow.os → core}/package.json +0 -0
- /package/profiles/server/packages/{flow.os → core}/show-switch.ts +0 -0
- /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
|
|
925
|
+
const CONTENT_W = 46;
|
|
926
|
+
const BORDER_W = 50;
|
|
925
927
|
const introLine = (content) => {
|
|
926
928
|
const plain = stripAnsi(content);
|
|
927
|
-
const
|
|
928
|
-
|
|
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(
|
|
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(
|
|
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,10 +1,10 @@
|
|
|
1
|
-
# DEV: packages/
|
|
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/
|
|
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/
|
|
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; \
|
package/profiles/client/dev.ts
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
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
|
|
9
|
-
"preview": "bun
|
|
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/
|
|
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
|
-
|
|
46
|
+
alias[`@flow.os/${name}`] = abs;
|
|
47
47
|
}
|
|
48
48
|
return alias;
|
|
49
49
|
}
|
package/profiles/full/Dockerfile
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# DEV: packages/
|
|
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/
|
|
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/
|
|
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; \
|
package/profiles/full/dev.ts
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
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
|
|
9
|
-
"preview": "bun
|
|
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/
|
|
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
|
-
|
|
46
|
+
alias[`@flow.os/${name}`] = abs;
|
|
47
47
|
}
|
|
48
48
|
return alias;
|
|
49
49
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# DEV: packages/
|
|
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/
|
|
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/
|
|
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; \
|
package/profiles/server/dev.ts
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
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
|
|
9
|
-
"preview": "bun
|
|
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/
|
|
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
|
},
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|