create-flow-os 0.0.1-dev.1771779476 → 0.0.1-dev.1771779802
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 +1 -1
- package/package.json +1 -1
- package/profiles/client/package.json +3 -3
- package/profiles/full/package.json +3 -3
- package/profiles/client/scripts/build.ts +0 -14
- package/profiles/client/scripts/dev.ts +0 -45
- package/profiles/client/scripts/preview.ts +0 -14
- package/profiles/full/scripts/build.ts +0 -14
- package/profiles/full/scripts/dev.ts +0 -45
- package/profiles/full/scripts/preview.ts +0 -14
package/bin/index.js
CHANGED
|
@@ -1065,7 +1065,7 @@ async function main() {
|
|
|
1065
1065
|
await rm(projectPathNew, { recursive: true, force: true });
|
|
1066
1066
|
const createSpinner = _2();
|
|
1067
1067
|
createSpinner.start(c2.cyan(ICON.rocket + " Creating project\u2026"));
|
|
1068
|
-
await copyWithExclude(profileDir, projectPathNew, ["node_modules", ".git", "packages"]);
|
|
1068
|
+
await copyWithExclude(profileDir, projectPathNew, ["node_modules", ".git", "packages", "scripts", "LICENSE", "README.md"]);
|
|
1069
1069
|
createSpinner.stop(c2.cyan(ICON.rocket + " Project created"));
|
|
1070
1070
|
const extraDeps = {};
|
|
1071
1071
|
for (const id of selected) {
|
package/package.json
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"dev": "
|
|
8
|
-
"build": "tsc -b &&
|
|
9
|
-
"preview": "
|
|
7
|
+
"dev": "flow-os-dev",
|
|
8
|
+
"build": "tsc -b && flow-os-build",
|
|
9
|
+
"preview": "flow-os-preview",
|
|
10
10
|
"start": "bun node_modules/@flow.os/server/start.ts",
|
|
11
11
|
"lint": "oxlint .",
|
|
12
12
|
"fmt": "oxfmt",
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"dev": "
|
|
8
|
-
"build": "tsc -b &&
|
|
9
|
-
"preview": "
|
|
7
|
+
"dev": "flow-os-dev",
|
|
8
|
+
"build": "tsc -b && flow-os-build",
|
|
9
|
+
"preview": "flow-os-preview",
|
|
10
10
|
"start": "bun node_modules/@flow.os/server/start.ts",
|
|
11
11
|
"lint": "oxlint .",
|
|
12
12
|
"fmt": "oxfmt",
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bun
|
|
2
|
-
import { pathToFileURL } from 'node:url';
|
|
3
|
-
import { join } from 'node:path';
|
|
4
|
-
import { build } from 'vite';
|
|
5
|
-
|
|
6
|
-
const cwd = process.cwd();
|
|
7
|
-
const configPath = join(cwd, 'flow.config.ts');
|
|
8
|
-
const mod = await import(pathToFileURL(configPath).href).catch((e: Error) => {
|
|
9
|
-
console.error('Flow: could not load flow.config.ts:', e.message);
|
|
10
|
-
process.exit(1);
|
|
11
|
-
});
|
|
12
|
-
const getConfig = mod.default;
|
|
13
|
-
const config = typeof getConfig === 'function' ? await getConfig() : getConfig;
|
|
14
|
-
await build(config);
|
|
@@ -1,45 +0,0 @@
|
|
|
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
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { pathToFileURL } from 'node:url';
|
|
8
|
-
import { join } from 'node:path';
|
|
9
|
-
import { createServer } from 'vite';
|
|
10
|
-
import net from 'node:net';
|
|
11
|
-
|
|
12
|
-
const cwd = process.cwd();
|
|
13
|
-
const configPath = join(cwd, 'flow.config.ts');
|
|
14
|
-
const configUrl = pathToFileURL(configPath).href;
|
|
15
|
-
|
|
16
|
-
function isPortFree(port: number): Promise<boolean> {
|
|
17
|
-
return new Promise((resolve) => {
|
|
18
|
-
const s = net.createServer();
|
|
19
|
-
s.once('error', () => resolve(false));
|
|
20
|
-
s.once('listening', () => {
|
|
21
|
-
s.close(() => resolve(true));
|
|
22
|
-
});
|
|
23
|
-
s.listen(port, '127.0.0.1');
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
async function findFreePort(from: number, to: number): Promise<number> {
|
|
28
|
-
for (let p = from; p <= to; p++) {
|
|
29
|
-
if (await isPortFree(p)) return p;
|
|
30
|
-
}
|
|
31
|
-
throw new Error(`Nessuna porta libera tra ${from} e ${to}`);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const port = await findFreePort(3000, 3020);
|
|
35
|
-
process.env.FLOW_DEV_PORT = String(port);
|
|
36
|
-
|
|
37
|
-
const mod = await import(configUrl).catch((e: Error) => {
|
|
38
|
-
console.error('Flow: could not load flow.config.ts:', e.message);
|
|
39
|
-
process.exit(1);
|
|
40
|
-
});
|
|
41
|
-
const getConfig = mod.default;
|
|
42
|
-
const config = typeof getConfig === 'function' ? await getConfig() : getConfig;
|
|
43
|
-
const server = await createServer(config);
|
|
44
|
-
await server.listen();
|
|
45
|
-
server.watcher.on('change', () => {});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bun
|
|
2
|
-
import { pathToFileURL } from 'node:url';
|
|
3
|
-
import { join } from 'node:path';
|
|
4
|
-
import { preview } from 'vite';
|
|
5
|
-
|
|
6
|
-
const cwd = process.cwd();
|
|
7
|
-
const configPath = join(cwd, 'flow.config.ts');
|
|
8
|
-
const mod = await import(pathToFileURL(configPath).href).catch((e: Error) => {
|
|
9
|
-
console.error('Flow: could not load flow.config.ts:', e.message);
|
|
10
|
-
process.exit(1);
|
|
11
|
-
});
|
|
12
|
-
const getConfig = mod.default;
|
|
13
|
-
const config = typeof getConfig === 'function' ? await getConfig() : getConfig;
|
|
14
|
-
await preview(config);
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bun
|
|
2
|
-
import { pathToFileURL } from 'node:url';
|
|
3
|
-
import { join } from 'node:path';
|
|
4
|
-
import { build } from 'vite';
|
|
5
|
-
|
|
6
|
-
const cwd = process.cwd();
|
|
7
|
-
const configPath = join(cwd, 'flow.config.ts');
|
|
8
|
-
const mod = await import(pathToFileURL(configPath).href).catch((e: Error) => {
|
|
9
|
-
console.error('Flow: could not load flow.config.ts:', e.message);
|
|
10
|
-
process.exit(1);
|
|
11
|
-
});
|
|
12
|
-
const getConfig = mod.default;
|
|
13
|
-
const config = typeof getConfig === 'function' ? await getConfig() : getConfig;
|
|
14
|
-
await build(config);
|
|
@@ -1,45 +0,0 @@
|
|
|
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
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { pathToFileURL } from 'node:url';
|
|
8
|
-
import { join } from 'node:path';
|
|
9
|
-
import { createServer } from 'vite';
|
|
10
|
-
import net from 'node:net';
|
|
11
|
-
|
|
12
|
-
const cwd = process.cwd();
|
|
13
|
-
const configPath = join(cwd, 'flow.config.ts');
|
|
14
|
-
const configUrl = pathToFileURL(configPath).href;
|
|
15
|
-
|
|
16
|
-
function isPortFree(port: number): Promise<boolean> {
|
|
17
|
-
return new Promise((resolve) => {
|
|
18
|
-
const s = net.createServer();
|
|
19
|
-
s.once('error', () => resolve(false));
|
|
20
|
-
s.once('listening', () => {
|
|
21
|
-
s.close(() => resolve(true));
|
|
22
|
-
});
|
|
23
|
-
s.listen(port, '127.0.0.1');
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
async function findFreePort(from: number, to: number): Promise<number> {
|
|
28
|
-
for (let p = from; p <= to; p++) {
|
|
29
|
-
if (await isPortFree(p)) return p;
|
|
30
|
-
}
|
|
31
|
-
throw new Error(`Nessuna porta libera tra ${from} e ${to}`);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const port = await findFreePort(3000, 3020);
|
|
35
|
-
process.env.FLOW_DEV_PORT = String(port);
|
|
36
|
-
|
|
37
|
-
const mod = await import(configUrl).catch((e: Error) => {
|
|
38
|
-
console.error('Flow: could not load flow.config.ts:', e.message);
|
|
39
|
-
process.exit(1);
|
|
40
|
-
});
|
|
41
|
-
const getConfig = mod.default;
|
|
42
|
-
const config = typeof getConfig === 'function' ? await getConfig() : getConfig;
|
|
43
|
-
const server = await createServer(config);
|
|
44
|
-
await server.listen();
|
|
45
|
-
server.watcher.on('change', () => {});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bun
|
|
2
|
-
import { pathToFileURL } from 'node:url';
|
|
3
|
-
import { join } from 'node:path';
|
|
4
|
-
import { preview } from 'vite';
|
|
5
|
-
|
|
6
|
-
const cwd = process.cwd();
|
|
7
|
-
const configPath = join(cwd, 'flow.config.ts');
|
|
8
|
-
const mod = await import(pathToFileURL(configPath).href).catch((e: Error) => {
|
|
9
|
-
console.error('Flow: could not load flow.config.ts:', e.message);
|
|
10
|
-
process.exit(1);
|
|
11
|
-
});
|
|
12
|
-
const getConfig = mod.default;
|
|
13
|
-
const config = typeof getConfig === 'function' ? await getConfig() : getConfig;
|
|
14
|
-
await preview(config);
|