create-flow-os 0.0.1-dev.1771670224 → 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 +7 -4
- package/package.json +1 -1
- package/profiles/client/dev.ts +16 -3
- package/profiles/full/dev.ts +16 -3
- package/profiles/server/dev.ts +16 -3
package/bin/index.js
CHANGED
|
@@ -922,12 +922,15 @@ function optsForProfile(config, profileId) {
|
|
|
922
922
|
}
|
|
923
923
|
async function main() {
|
|
924
924
|
const devBadge = useDevTag ? c2.dim(" \xB7 dev") : "";
|
|
925
|
-
const CONTENT_W =
|
|
926
|
-
const BORDER_W =
|
|
925
|
+
const CONTENT_W = 46;
|
|
926
|
+
const BORDER_W = 50;
|
|
927
927
|
const introLine = (content) => {
|
|
928
928
|
const plain = stripAnsi(content);
|
|
929
|
-
const
|
|
930
|
-
|
|
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");
|
|
931
934
|
};
|
|
932
935
|
const introBorder = (ch) => c2.dim(" " + (ch === "t" ? "\u256D" : "\u2570") + "\u2500".repeat(BORDER_W) + (ch === "t" ? "\u256E" : "\u256F"));
|
|
933
936
|
const singleLine = "Create " + c2.bold(c2.cyan("Flow OS")) + devBadge + " application";
|
package/package.json
CHANGED
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();
|
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();
|
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();
|