create-flow-os 0.0.1-dev.1771780350 → 0.0.1-dev.1771782345
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/README.md +22 -3
- package/bin/index.js +16 -10
- package/lib/utils.ts +91 -0
- package/package.json +7 -6
- package/profiles/client/package.json +1 -2
- package/profiles/{full/packages/client → client/packages/client/build}/config.ts +6 -6
- package/profiles/client/packages/client/index.ts +6 -4
- package/profiles/client/packages/client/package.json +15 -15
- package/profiles/client/packages/client/runtime/dom.ts +2 -0
- package/profiles/{full/packages/client → client/packages/client/runtime}/jsx.ts +2 -2
- package/profiles/client/packages/client/{start-dev.ts → scripts/start-dev.ts} +1 -4
- package/profiles/full/package.json +1 -1
- package/profiles/{client/packages/client → full/packages/client/build}/config.ts +6 -6
- package/profiles/full/packages/client/index.ts +6 -4
- package/profiles/full/packages/client/package.json +15 -15
- package/profiles/full/packages/client/runtime/dom.ts +2 -0
- package/profiles/{client/packages/client → full/packages/client/runtime}/jsx.ts +2 -2
- package/profiles/full/packages/client/{start-dev.ts → scripts/start-dev.ts} +1 -4
- package/profiles/full/packages/server/package.json +1 -1
- package/profiles/full/packages/server/scripts/start.ts +11 -0
- package/profiles/server/packages/server/package.json +1 -1
- package/profiles/server/packages/server/scripts/start.ts +11 -0
- package/templates/flow.config.server.ts +6 -0
- package/profiles/client/packages/client/dom.ts +0 -5
- package/profiles/client/packages/style/extension/README.md +0 -7
- package/profiles/full/packages/client/dom.ts +0 -5
- package/profiles/full/packages/server/start.ts +0 -15
- package/profiles/full/packages/style/extension/README.md +0 -7
- package/profiles/server/packages/server/start.ts +0 -15
- package/profiles/server/packages/style/extension/README.md +0 -7
- /package/profiles/client/packages/client/{vite.ts → build/vite.ts} +0 -0
- /package/profiles/client/packages/client/{jsx-dev-runtime.ts → runtime/jsx-dev-runtime.ts} +0 -0
- /package/profiles/client/packages/client/{jsx-runtime.ts → runtime/jsx-runtime.ts} +0 -0
- /package/profiles/client/packages/client/{jsx-types.d.ts → runtime/jsx-types.d.ts} +0 -0
- /package/profiles/client/packages/client/{build.ts → scripts/build.ts} +0 -0
- /package/profiles/client/packages/client/{preview.ts → scripts/preview.ts} +0 -0
- /package/profiles/full/packages/client/{vite.ts → build/vite.ts} +0 -0
- /package/profiles/full/packages/client/{jsx-dev-runtime.ts → runtime/jsx-dev-runtime.ts} +0 -0
- /package/profiles/full/packages/client/{jsx-runtime.ts → runtime/jsx-runtime.ts} +0 -0
- /package/profiles/full/packages/client/{jsx-types.d.ts → runtime/jsx-types.d.ts} +0 -0
- /package/profiles/full/packages/client/{build.ts → scripts/build.ts} +0 -0
- /package/profiles/full/packages/client/{preview.ts → scripts/preview.ts} +0 -0
- /package/{flow.config.client.ts → templates/flow.config.client.ts} +0 -0
package/README.md
CHANGED
|
@@ -1,7 +1,26 @@
|
|
|
1
1
|
# create-flow-os
|
|
2
2
|
|
|
3
|
-
CLI per
|
|
3
|
+
CLI per generare progetti Flow.os da profili e pacchetti.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Cosa modificare
|
|
6
6
|
|
|
7
|
-
|
|
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` (usati da gen per i profili).
|
|
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).
|
package/bin/index.js
CHANGED
|
@@ -782,7 +782,7 @@ var _2 = () => {
|
|
|
782
782
|
// index.ts
|
|
783
783
|
var import_picocolors3 = __toESM(require_picocolors(), 1);
|
|
784
784
|
|
|
785
|
-
// utils.ts
|
|
785
|
+
// lib/utils.ts
|
|
786
786
|
import { mkdir, readdir } from "fs/promises";
|
|
787
787
|
import { join } from "path";
|
|
788
788
|
function transformPackageJson(pkg, projectName, extraPackages = {}, useWorkspace = false) {
|
|
@@ -925,7 +925,11 @@ async function runDev(cwd) {
|
|
|
925
925
|
});
|
|
926
926
|
await devProc.exited;
|
|
927
927
|
}
|
|
928
|
-
var
|
|
928
|
+
var PROFILE_LABELS = {
|
|
929
|
+
full: "Full stack (client + server)",
|
|
930
|
+
client: "Client only",
|
|
931
|
+
server: "Server only"
|
|
932
|
+
};
|
|
929
933
|
function optsForProfile(config, profileId) {
|
|
930
934
|
return Object.entries(config.packages).filter(([, e2]) => {
|
|
931
935
|
const inc = e2.includeIn ?? [];
|
|
@@ -942,12 +946,13 @@ function optionalPackageIdsForProfile(config, profileId) {
|
|
|
942
946
|
const defaultIds = config.profiles[profileId]?.defaultPackages ?? [];
|
|
943
947
|
return optIds.filter((id) => !defaultIds.includes(id));
|
|
944
948
|
}
|
|
945
|
-
function profileFromArgv(argv2) {
|
|
949
|
+
function profileFromArgv(argv2, profileIds) {
|
|
950
|
+
const set = new Set(profileIds);
|
|
946
951
|
for (const arg of argv2) {
|
|
947
952
|
if (!arg.startsWith("--"))
|
|
948
953
|
continue;
|
|
949
954
|
const key = arg.slice(2);
|
|
950
|
-
if (
|
|
955
|
+
if (set.has(key))
|
|
951
956
|
return key;
|
|
952
957
|
}
|
|
953
958
|
return null;
|
|
@@ -982,6 +987,7 @@ async function main() {
|
|
|
982
987
|
} catch {}
|
|
983
988
|
}
|
|
984
989
|
const config = await Bun.file(join2(DIR, "config.json")).json();
|
|
990
|
+
const profileIds = Object.keys(config.profiles);
|
|
985
991
|
const hasDeps = Object.values(config.packages).every((e2) => Array.isArray(e2.deps));
|
|
986
992
|
if (!hasDeps) {
|
|
987
993
|
he(c2.dim("Run ") + c2.brand("bun run gen") + c2.dim(" from create-flow first."));
|
|
@@ -1001,7 +1007,7 @@ async function main() {
|
|
|
1001
1007
|
}
|
|
1002
1008
|
if (!name)
|
|
1003
1009
|
name = "my-flow-app";
|
|
1004
|
-
const profileFlag = profileFromArgv(argv);
|
|
1010
|
+
const profileFlag = profileFromArgv(argv, profileIds);
|
|
1005
1011
|
const optsFull = optsForProfile(config, "full");
|
|
1006
1012
|
let profileId;
|
|
1007
1013
|
let selected = [];
|
|
@@ -1015,13 +1021,13 @@ async function main() {
|
|
|
1015
1021
|
profileId = "full";
|
|
1016
1022
|
selected = optsFull.map(([id]) => id);
|
|
1017
1023
|
} else {
|
|
1024
|
+
const options = profileIds.map((id) => ({
|
|
1025
|
+
value: id,
|
|
1026
|
+
label: `${ICON[id] ?? ""} ${PROFILE_LABELS[id] ?? id}`.trim() || id
|
|
1027
|
+
}));
|
|
1018
1028
|
const choice = await le({
|
|
1019
1029
|
message: c2.muted("Template"),
|
|
1020
|
-
options
|
|
1021
|
-
{ value: "full", label: `${ICON.full} Full stack ${c2.dim("(client + server)")}` },
|
|
1022
|
-
{ value: "client", label: `${ICON.client} Client only` },
|
|
1023
|
-
{ value: "server", label: `${ICON.server} Server only` }
|
|
1024
|
-
]
|
|
1030
|
+
options
|
|
1025
1031
|
});
|
|
1026
1032
|
if (lD(choice))
|
|
1027
1033
|
process.exit(0);
|
package/lib/utils.ts
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { mkdir, readdir } from "node:fs/promises";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
|
|
4
|
+
export function transformPackageJson(
|
|
5
|
+
pkg: Record<string, unknown>,
|
|
6
|
+
projectName: string,
|
|
7
|
+
extraPackages: Record<string, string> = {},
|
|
8
|
+
useWorkspace = false
|
|
9
|
+
): Record<string, unknown> {
|
|
10
|
+
const out = { ...pkg };
|
|
11
|
+
out.name = projectName;
|
|
12
|
+
out.private = true;
|
|
13
|
+
delete out.workspaces;
|
|
14
|
+
const deps = (out.dependencies as Record<string, string>) || {};
|
|
15
|
+
const next: Record<string, string> = {};
|
|
16
|
+
for (const [k, v] of Object.entries(deps)) {
|
|
17
|
+
const isFlow = k.startsWith("@flow.os/") || k === "@flow.os";
|
|
18
|
+
if (v === "workspace:*" || (isFlow && typeof v === "string" && (v.startsWith("file:./packages/") || v.startsWith("file:../")))) {
|
|
19
|
+
next[k] = useWorkspace && isFlow ? "workspace:*" : "^0.0.1";
|
|
20
|
+
} else {
|
|
21
|
+
next[k] = v;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
for (const [k, v] of Object.entries(extraPackages)) {
|
|
25
|
+
if (!(k in next)) next[k] = v;
|
|
26
|
+
}
|
|
27
|
+
out.dependencies = next;
|
|
28
|
+
const devDeps = out.devDependencies as Record<string, string> | undefined;
|
|
29
|
+
if (devDeps) {
|
|
30
|
+
const nextDev: Record<string, string> = {};
|
|
31
|
+
for (const [k, v] of Object.entries(devDeps)) {
|
|
32
|
+
if (k === "vite-plugin-oxlint" || k === "oxlint" || k === "oxfmt") continue;
|
|
33
|
+
nextDev[k] = v;
|
|
34
|
+
}
|
|
35
|
+
out.devDependencies = nextDev;
|
|
36
|
+
}
|
|
37
|
+
return out;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** Scripts in created projects: drop monorepo-only; server start → "server". */
|
|
41
|
+
export function transformScriptsForCreatedProject(scripts: Record<string, string> | undefined): Record<string, string> | undefined {
|
|
42
|
+
if (!scripts) return scripts;
|
|
43
|
+
const drop = new Set(["release", "version"]);
|
|
44
|
+
const out: Record<string, string> = {};
|
|
45
|
+
for (const [key, value] of Object.entries(scripts)) {
|
|
46
|
+
if (drop.has(key)) continue;
|
|
47
|
+
let s = value;
|
|
48
|
+
if (key === "start" && /@flow\.os\/server\/start\.ts/.test(s)) s = "server";
|
|
49
|
+
out[key] = s;
|
|
50
|
+
}
|
|
51
|
+
return Object.keys(out).length ? out : undefined;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export async function copyWithExclude(srcDir: string, destDir: string, exclude: string[]): Promise<void> {
|
|
55
|
+
const set = new Set(exclude.map((e) => e.toLowerCase()));
|
|
56
|
+
async function w(dir: string, rel: string): Promise<void> {
|
|
57
|
+
const entries = await readdir(dir, { withFileTypes: true });
|
|
58
|
+
for (const ent of entries) {
|
|
59
|
+
const name = ent.name;
|
|
60
|
+
if (set.has(name.toLowerCase())) continue;
|
|
61
|
+
const relPath = rel ? join(rel, name) : name;
|
|
62
|
+
const srcPath = join(dir, name);
|
|
63
|
+
const destPath = join(destDir, relPath);
|
|
64
|
+
if (ent.isDirectory()) {
|
|
65
|
+
await mkdir(destPath, { recursive: true });
|
|
66
|
+
await w(srcPath, relPath);
|
|
67
|
+
} else {
|
|
68
|
+
await mkdir(join(destDir, rel), { recursive: true });
|
|
69
|
+
await Bun.write(destPath, Bun.file(srcPath));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
await mkdir(destDir, { recursive: true });
|
|
74
|
+
await w(srcDir, "");
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export async function findPackageDir(repoRoot: string, packageName: string): Promise<string | null> {
|
|
78
|
+
const packagesDir = join(repoRoot, "packages");
|
|
79
|
+
try {
|
|
80
|
+
const entries = await readdir(packagesDir, { withFileTypes: true });
|
|
81
|
+
for (const ent of entries) {
|
|
82
|
+
if (!ent.isDirectory()) continue;
|
|
83
|
+
const pkgPath = join(packagesDir, ent.name, "package.json");
|
|
84
|
+
try {
|
|
85
|
+
const pkg = (await Bun.file(pkgPath).json()) as { name?: string };
|
|
86
|
+
if (pkg.name === packageName) return join(packagesDir, ent.name);
|
|
87
|
+
} catch {}
|
|
88
|
+
}
|
|
89
|
+
} catch {}
|
|
90
|
+
return null;
|
|
91
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-flow-os",
|
|
3
|
-
"version": "0.0.1-dev.
|
|
3
|
+
"version": "0.0.1-dev.1771782345",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"create-flow-os": "bin/index.js"
|
|
@@ -8,19 +8,20 @@
|
|
|
8
8
|
"files": [
|
|
9
9
|
"bin",
|
|
10
10
|
"config.json",
|
|
11
|
-
"
|
|
11
|
+
"lib",
|
|
12
|
+
"templates",
|
|
12
13
|
"profiles",
|
|
13
14
|
"packages",
|
|
14
15
|
"LICENSE"
|
|
15
16
|
],
|
|
16
17
|
"license": "PolyForm-Shield-1.0.0",
|
|
17
18
|
"scripts": {
|
|
18
|
-
"gen": "bun gen.ts",
|
|
19
|
+
"gen": "bun scripts/gen.ts",
|
|
19
20
|
"create": "bun index.ts",
|
|
20
21
|
"build": "bun build ./index.ts --outdir=bin --target=bun",
|
|
21
|
-
"publish:dev": "bun publish-dev.ts",
|
|
22
|
-
"version": "bun version.ts",
|
|
23
|
-
"release": "bun publish.ts"
|
|
22
|
+
"publish:dev": "bun scripts/publish-dev.ts",
|
|
23
|
+
"version": "bun scripts/version.ts",
|
|
24
|
+
"release": "bun scripts/publish.ts"
|
|
24
25
|
},
|
|
25
26
|
"dependencies": {
|
|
26
27
|
"@clack/prompts": "^0.8.2",
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"dev": "flow-os-dev",
|
|
8
8
|
"build": "tsc -b && flow-os-build",
|
|
9
9
|
"preview": "flow-os-preview",
|
|
10
|
-
"start": "bun
|
|
10
|
+
"start": "bun packages/server/scripts/start.ts",
|
|
11
11
|
"lint": "oxlint .",
|
|
12
12
|
"fmt": "oxfmt",
|
|
13
13
|
"fmt:check": "oxfmt --check",
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@flow.os/client": "file:./packages/client",
|
|
19
|
-
"@flow.os/server": "^0.0.1",
|
|
20
19
|
"@flow.os/core": "file:./packages/core",
|
|
21
20
|
"@flow.os/router": "file:./packages/router",
|
|
22
21
|
"@flow.os/style": "file:./packages/style"
|
|
@@ -41,16 +41,17 @@ function getNetworkUrl(port: number): string | null {
|
|
|
41
41
|
return null;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
/**
|
|
44
|
+
/** Monorepo: alias a path assoluti (Rollup in Docker non segue symlink). Fuori monorepo ritorna {}. */
|
|
45
45
|
function resolveAlias(): Record<string, string> {
|
|
46
46
|
const root = path.resolve(process.cwd());
|
|
47
47
|
const packagesDir = path.join(root, 'packages');
|
|
48
48
|
if (!fs.existsSync(packagesDir)) return {};
|
|
49
49
|
const alias: Record<string, string> = {};
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
alias['@flow.os/client/jsx-
|
|
50
|
+
const clientRuntime = path.join(root, 'packages', 'client', 'runtime');
|
|
51
|
+
const jrx = path.join(clientRuntime, 'jsx-runtime.ts');
|
|
52
|
+
if (fs.existsSync(jrx)) {
|
|
53
|
+
alias['@flow.os/client/jsx-runtime'] = jrx;
|
|
54
|
+
alias['@flow.os/client/jsx-dev-runtime'] = path.join(clientRuntime, 'jsx-dev-runtime.ts');
|
|
54
55
|
}
|
|
55
56
|
for (const name of fs.readdirSync(packagesDir)) {
|
|
56
57
|
const dir = path.join(packagesDir, name);
|
|
@@ -89,7 +90,6 @@ const DEFAULTS = {
|
|
|
89
90
|
plugins: [] as Plugin[],
|
|
90
91
|
};
|
|
91
92
|
|
|
92
|
-
/** Banner Flow OS: sostituisce l'output di Vite con uno custom (Local + Network, box, colori). */
|
|
93
93
|
function flowServerUrlPlugin(hostEnabled: boolean): Plugin {
|
|
94
94
|
return {
|
|
95
95
|
name: 'flow:server-url',
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
/// <reference path="./jsx-types.d.ts" />
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
1
|
+
/// <reference path="./runtime/jsx-types.d.ts" />
|
|
2
|
+
// API pubblica: tutto da qui o da subpath (./config, ./vite, ./jsx-runtime, ./jsx-dev-runtime)
|
|
3
|
+
export { Fragment, jsx, jsxs, jsxDEV } from './runtime/jsx.js';
|
|
4
|
+
export { normalizeChild, setContent } from './runtime/dom.js';
|
|
5
|
+
export { default as config } from './build/config.js';
|
|
6
|
+
export { applyClassFlow, applyClassAndClassList, applyStyle, applyStyleFlow, applyAttrs } from './features/index.js';
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
"main": "./index.ts",
|
|
7
7
|
"types": "./index.ts",
|
|
8
8
|
"bin": {
|
|
9
|
-
"flow-os-dev": "./start-dev.ts",
|
|
10
|
-
"flow-os-build": "./build.ts",
|
|
11
|
-
"flow-os-preview": "./preview.ts"
|
|
9
|
+
"flow-os-dev": "./scripts/start-dev.ts",
|
|
10
|
+
"flow-os-build": "./scripts/build.ts",
|
|
11
|
+
"flow-os-preview": "./scripts/preview.ts"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@flow.os/core": "workspace:*",
|
|
@@ -25,24 +25,24 @@
|
|
|
25
25
|
"default": "./index.ts"
|
|
26
26
|
},
|
|
27
27
|
"./config": {
|
|
28
|
-
"types": "./config.ts",
|
|
29
|
-
"import": "./config.ts",
|
|
30
|
-
"default": "./config.ts"
|
|
28
|
+
"types": "./build/config.ts",
|
|
29
|
+
"import": "./build/config.ts",
|
|
30
|
+
"default": "./build/config.ts"
|
|
31
31
|
},
|
|
32
32
|
"./vite": {
|
|
33
|
-
"types": "./vite.ts",
|
|
34
|
-
"import": "./vite.ts",
|
|
35
|
-
"default": "./vite.ts"
|
|
33
|
+
"types": "./build/vite.ts",
|
|
34
|
+
"import": "./build/vite.ts",
|
|
35
|
+
"default": "./build/vite.ts"
|
|
36
36
|
},
|
|
37
37
|
"./jsx-runtime": {
|
|
38
|
-
"types": "./jsx.ts",
|
|
39
|
-
"import": "./jsx.ts",
|
|
40
|
-
"default": "./jsx.ts"
|
|
38
|
+
"types": "./runtime/jsx.ts",
|
|
39
|
+
"import": "./runtime/jsx.ts",
|
|
40
|
+
"default": "./runtime/jsx.ts"
|
|
41
41
|
},
|
|
42
42
|
"./jsx-dev-runtime": {
|
|
43
|
-
"types": "./jsx.ts",
|
|
44
|
-
"import": "./jsx.ts",
|
|
45
|
-
"default": "./jsx.ts"
|
|
43
|
+
"types": "./runtime/jsx.ts",
|
|
44
|
+
"import": "./runtime/jsx.ts",
|
|
45
|
+
"default": "./runtime/jsx.ts"
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/// <reference path="./jsx-types.d.ts" />
|
|
2
2
|
import { effect } from '@flow.os/core';
|
|
3
|
-
import { isGetter } from '
|
|
3
|
+
import { isGetter } from '../features/utils.js';
|
|
4
4
|
import {
|
|
5
5
|
applyClassFlow,
|
|
6
6
|
applyClassAndClassList,
|
|
7
7
|
applyStyle,
|
|
8
8
|
applyStyleFlow,
|
|
9
9
|
applyAttrs,
|
|
10
|
-
} from '
|
|
10
|
+
} from '../features/index.js';
|
|
11
11
|
|
|
12
12
|
export const Fragment = Symbol.for('flow.fragment');
|
|
13
13
|
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
/**
|
|
3
|
-
* Flow OS dev server runner. Loads flow.config.ts and starts the dev server.
|
|
4
|
-
* Trova una porta libera (3000, 3001, …) prima di avviare, così Vite non si blocca su "trying another one".
|
|
5
|
-
*/
|
|
2
|
+
/** Dev server: carica flow.config.ts e avvia Vite. Porta libera 3000–3020. */
|
|
6
3
|
|
|
7
4
|
import { pathToFileURL } from 'node:url';
|
|
8
5
|
import { join } from 'node:path';
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"dev": "flow-os-dev",
|
|
8
8
|
"build": "tsc -b && flow-os-build",
|
|
9
9
|
"preview": "flow-os-preview",
|
|
10
|
-
"start": "bun
|
|
10
|
+
"start": "bun packages/server/scripts/start.ts",
|
|
11
11
|
"lint": "oxlint .",
|
|
12
12
|
"fmt": "oxfmt",
|
|
13
13
|
"fmt:check": "oxfmt --check",
|
|
@@ -41,16 +41,17 @@ function getNetworkUrl(port: number): string | null {
|
|
|
41
41
|
return null;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
/**
|
|
44
|
+
/** Monorepo: alias a path assoluti (Rollup in Docker non segue symlink). Fuori monorepo ritorna {}. */
|
|
45
45
|
function resolveAlias(): Record<string, string> {
|
|
46
46
|
const root = path.resolve(process.cwd());
|
|
47
47
|
const packagesDir = path.join(root, 'packages');
|
|
48
48
|
if (!fs.existsSync(packagesDir)) return {};
|
|
49
49
|
const alias: Record<string, string> = {};
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
alias['@flow.os/client/jsx-
|
|
50
|
+
const clientRuntime = path.join(root, 'packages', 'client', 'runtime');
|
|
51
|
+
const jrx = path.join(clientRuntime, 'jsx-runtime.ts');
|
|
52
|
+
if (fs.existsSync(jrx)) {
|
|
53
|
+
alias['@flow.os/client/jsx-runtime'] = jrx;
|
|
54
|
+
alias['@flow.os/client/jsx-dev-runtime'] = path.join(clientRuntime, 'jsx-dev-runtime.ts');
|
|
54
55
|
}
|
|
55
56
|
for (const name of fs.readdirSync(packagesDir)) {
|
|
56
57
|
const dir = path.join(packagesDir, name);
|
|
@@ -89,7 +90,6 @@ const DEFAULTS = {
|
|
|
89
90
|
plugins: [] as Plugin[],
|
|
90
91
|
};
|
|
91
92
|
|
|
92
|
-
/** Banner Flow OS: sostituisce l'output di Vite con uno custom (Local + Network, box, colori). */
|
|
93
93
|
function flowServerUrlPlugin(hostEnabled: boolean): Plugin {
|
|
94
94
|
return {
|
|
95
95
|
name: 'flow:server-url',
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
/// <reference path="./jsx-types.d.ts" />
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
1
|
+
/// <reference path="./runtime/jsx-types.d.ts" />
|
|
2
|
+
// API pubblica: tutto da qui o da subpath (./config, ./vite, ./jsx-runtime, ./jsx-dev-runtime)
|
|
3
|
+
export { Fragment, jsx, jsxs, jsxDEV } from './runtime/jsx.js';
|
|
4
|
+
export { normalizeChild, setContent } from './runtime/dom.js';
|
|
5
|
+
export { default as config } from './build/config.js';
|
|
6
|
+
export { applyClassFlow, applyClassAndClassList, applyStyle, applyStyleFlow, applyAttrs } from './features/index.js';
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
"main": "./index.ts",
|
|
7
7
|
"types": "./index.ts",
|
|
8
8
|
"bin": {
|
|
9
|
-
"flow-os-dev": "./start-dev.ts",
|
|
10
|
-
"flow-os-build": "./build.ts",
|
|
11
|
-
"flow-os-preview": "./preview.ts"
|
|
9
|
+
"flow-os-dev": "./scripts/start-dev.ts",
|
|
10
|
+
"flow-os-build": "./scripts/build.ts",
|
|
11
|
+
"flow-os-preview": "./scripts/preview.ts"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@flow.os/core": "workspace:*",
|
|
@@ -25,24 +25,24 @@
|
|
|
25
25
|
"default": "./index.ts"
|
|
26
26
|
},
|
|
27
27
|
"./config": {
|
|
28
|
-
"types": "./config.ts",
|
|
29
|
-
"import": "./config.ts",
|
|
30
|
-
"default": "./config.ts"
|
|
28
|
+
"types": "./build/config.ts",
|
|
29
|
+
"import": "./build/config.ts",
|
|
30
|
+
"default": "./build/config.ts"
|
|
31
31
|
},
|
|
32
32
|
"./vite": {
|
|
33
|
-
"types": "./vite.ts",
|
|
34
|
-
"import": "./vite.ts",
|
|
35
|
-
"default": "./vite.ts"
|
|
33
|
+
"types": "./build/vite.ts",
|
|
34
|
+
"import": "./build/vite.ts",
|
|
35
|
+
"default": "./build/vite.ts"
|
|
36
36
|
},
|
|
37
37
|
"./jsx-runtime": {
|
|
38
|
-
"types": "./jsx.ts",
|
|
39
|
-
"import": "./jsx.ts",
|
|
40
|
-
"default": "./jsx.ts"
|
|
38
|
+
"types": "./runtime/jsx.ts",
|
|
39
|
+
"import": "./runtime/jsx.ts",
|
|
40
|
+
"default": "./runtime/jsx.ts"
|
|
41
41
|
},
|
|
42
42
|
"./jsx-dev-runtime": {
|
|
43
|
-
"types": "./jsx.ts",
|
|
44
|
-
"import": "./jsx.ts",
|
|
45
|
-
"default": "./jsx.ts"
|
|
43
|
+
"types": "./runtime/jsx.ts",
|
|
44
|
+
"import": "./runtime/jsx.ts",
|
|
45
|
+
"default": "./runtime/jsx.ts"
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/// <reference path="./jsx-types.d.ts" />
|
|
2
2
|
import { effect } from '@flow.os/core';
|
|
3
|
-
import { isGetter } from '
|
|
3
|
+
import { isGetter } from '../features/utils.js';
|
|
4
4
|
import {
|
|
5
5
|
applyClassFlow,
|
|
6
6
|
applyClassAndClassList,
|
|
7
7
|
applyStyle,
|
|
8
8
|
applyStyleFlow,
|
|
9
9
|
applyAttrs,
|
|
10
|
-
} from '
|
|
10
|
+
} from '../features/index.js';
|
|
11
11
|
|
|
12
12
|
export const Fragment = Symbol.for('flow.fragment');
|
|
13
13
|
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
/**
|
|
3
|
-
* Flow OS dev server runner. Loads flow.config.ts and starts the dev server.
|
|
4
|
-
* Trova una porta libera (3000, 3001, …) prima di avviare, così Vite non si blocca su "trying another one".
|
|
5
|
-
*/
|
|
2
|
+
/** Dev server: carica flow.config.ts e avvia Vite. Porta libera 3000–3020. */
|
|
6
3
|
|
|
7
4
|
import { pathToFileURL } from 'node:url';
|
|
8
5
|
import { join } from 'node:path';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
/** Entry produzione: statici + API. Uso: bunx @flow.os/server */
|
|
3
|
+
import { runProductionServer } from '../production.js';
|
|
4
|
+
|
|
5
|
+
const port = process.env['PORT'] ? Number(process.env['PORT']) : 3000;
|
|
6
|
+
runProductionServer({
|
|
7
|
+
routesDir: 'server/routes',
|
|
8
|
+
staticDir: 'dist',
|
|
9
|
+
port,
|
|
10
|
+
hostname: '0.0.0.0',
|
|
11
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
/** Entry produzione: statici + API. Uso: bunx @flow.os/server */
|
|
3
|
+
import { runProductionServer } from '../production.js';
|
|
4
|
+
|
|
5
|
+
const port = process.env['PORT'] ? Number(process.env['PORT']) : 3000;
|
|
6
|
+
runProductionServer({
|
|
7
|
+
routesDir: 'server/routes',
|
|
8
|
+
staticDir: 'dist',
|
|
9
|
+
port,
|
|
10
|
+
hostname: '0.0.0.0',
|
|
11
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server-only: no Vite client. When you add a frontend (e.g. React), add flow.config.ts
|
|
3
|
+
* with: import { config } from '@flow.os/client'; import { flowServer } from '@flow.os/server';
|
|
4
|
+
* export default config({ server: flowServer() });
|
|
5
|
+
*/
|
|
6
|
+
export default {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
# Flow Style — Color Picker
|
|
2
|
-
|
|
3
|
-
- **Pallino** (cerchio) prima di ogni colore `#hex` o `rgb(...)`.
|
|
4
|
-
- **Quadratino** dell’editor sul colore: **click** → picker nativo inline.
|
|
5
|
-
- Alternativa: **Ctrl+Shift+C** con cursore sul colore → input hex/rgb.
|
|
6
|
-
|
|
7
|
-
Installazione: Install from VSIX → `flow-style-colors-0.0.1.vsix`.
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bun
|
|
2
|
-
/**
|
|
3
|
-
* Entry produzione: lancia il server (statici + API).
|
|
4
|
-
* Uso: bunx @flow.os/server oppure "start": "bunx @flow.os/server" in package.json.
|
|
5
|
-
*/
|
|
6
|
-
import { runProductionServer } from './production.js';
|
|
7
|
-
|
|
8
|
-
const port = process.env['PORT'] ? Number(process.env['PORT']) : 3000;
|
|
9
|
-
|
|
10
|
-
runProductionServer({
|
|
11
|
-
routesDir: 'server/routes',
|
|
12
|
-
staticDir: 'dist',
|
|
13
|
-
port,
|
|
14
|
-
hostname: '0.0.0.0',
|
|
15
|
-
});
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
# Flow Style — Color Picker
|
|
2
|
-
|
|
3
|
-
- **Pallino** (cerchio) prima di ogni colore `#hex` o `rgb(...)`.
|
|
4
|
-
- **Quadratino** dell’editor sul colore: **click** → picker nativo inline.
|
|
5
|
-
- Alternativa: **Ctrl+Shift+C** con cursore sul colore → input hex/rgb.
|
|
6
|
-
|
|
7
|
-
Installazione: Install from VSIX → `flow-style-colors-0.0.1.vsix`.
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bun
|
|
2
|
-
/**
|
|
3
|
-
* Entry produzione: lancia il server (statici + API).
|
|
4
|
-
* Uso: bunx @flow.os/server oppure "start": "bunx @flow.os/server" in package.json.
|
|
5
|
-
*/
|
|
6
|
-
import { runProductionServer } from './production.js';
|
|
7
|
-
|
|
8
|
-
const port = process.env['PORT'] ? Number(process.env['PORT']) : 3000;
|
|
9
|
-
|
|
10
|
-
runProductionServer({
|
|
11
|
-
routesDir: 'server/routes',
|
|
12
|
-
staticDir: 'dist',
|
|
13
|
-
port,
|
|
14
|
-
hostname: '0.0.0.0',
|
|
15
|
-
});
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
# Flow Style — Color Picker
|
|
2
|
-
|
|
3
|
-
- **Pallino** (cerchio) prima di ogni colore `#hex` o `rgb(...)`.
|
|
4
|
-
- **Quadratino** dell’editor sul colore: **click** → picker nativo inline.
|
|
5
|
-
- Alternativa: **Ctrl+Shift+C** con cursore sul colore → input hex/rgb.
|
|
6
|
-
|
|
7
|
-
Installazione: Install from VSIX → `flow-style-colors-0.0.1.vsix`.
|
|
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
|