create-flowdular 0.2.3 → 0.2.4
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/package.json
CHANGED
|
@@ -1,18 +1,51 @@
|
|
|
1
1
|
import { resolve } from 'node:path';
|
|
2
2
|
import { fileURLToPath } from 'node:url';
|
|
3
3
|
import { createServer } from 'vite';
|
|
4
|
+
import {
|
|
5
|
+
createOctaneLogger,
|
|
6
|
+
installOctaneConsoleBridge,
|
|
7
|
+
shouldUseColor,
|
|
8
|
+
createTheme,
|
|
9
|
+
printReady,
|
|
10
|
+
} from '@flowdular/sdk/dev-console';
|
|
4
11
|
|
|
5
12
|
const appRoot = resolve(fileURLToPath(new URL('..', import.meta.url)));
|
|
13
|
+
const verbose =
|
|
14
|
+
process.argv.includes('--verbose') ||
|
|
15
|
+
process.argv.includes('-v') ||
|
|
16
|
+
process.env.FD_DEV_VERBOSE === 'true';
|
|
17
|
+
const color = shouldUseColor();
|
|
18
|
+
const restoreConsole = installOctaneConsoleBridge(verbose, color);
|
|
6
19
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
20
|
+
let server;
|
|
21
|
+
try {
|
|
22
|
+
server = await createServer({
|
|
23
|
+
root: appRoot,
|
|
24
|
+
configFile: resolve(appRoot, 'vite.config.ts'),
|
|
25
|
+
customLogger: createOctaneLogger(verbose, color),
|
|
26
|
+
clearScreen: false,
|
|
27
|
+
});
|
|
28
|
+
await server.listen();
|
|
29
|
+
} catch (error) {
|
|
30
|
+
restoreConsole();
|
|
31
|
+
throw error;
|
|
32
|
+
}
|
|
33
|
+
printReady({
|
|
34
|
+
title: 'FLOWDULAR',
|
|
35
|
+
subtitle: 'development workspace',
|
|
36
|
+
theme: createTheme(color),
|
|
37
|
+
lines: [
|
|
38
|
+
[
|
|
39
|
+
'local',
|
|
40
|
+
server.resolvedUrls?.local?.[0] ?? 'http://localhost:4310/',
|
|
41
|
+
'info',
|
|
42
|
+
],
|
|
43
|
+
['diagnostics', verbose ? 'verbose' : 'quiet · use --verbose', 'muted'],
|
|
44
|
+
],
|
|
10
45
|
});
|
|
11
|
-
await server.listen();
|
|
12
|
-
server.printUrls();
|
|
13
46
|
|
|
14
47
|
/* Closing without exiting lets octane.config.ts release the database on the
|
|
15
48
|
same signal; the process ends once both have drained. */
|
|
16
|
-
const stop = () => void server.close();
|
|
49
|
+
const stop = () => void server.close().finally(restoreConsole);
|
|
17
50
|
process.once('SIGINT', stop);
|
|
18
51
|
process.once('SIGTERM', stop);
|