@flow-os/client 0.0.46 → 0.0.47-dev.1772043681
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
package/src/cli/dev.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { join } from 'node:path';
|
|
|
7
7
|
import { createServer } from 'vite';
|
|
8
8
|
import { getCertificate } from '@vitejs/plugin-basic-ssl';
|
|
9
9
|
|
|
10
|
-
const V = '\x1b[
|
|
10
|
+
const V = '\x1b[38;2;255;0;135m'; // #ff0087
|
|
11
11
|
const R = '\x1b[0m';
|
|
12
12
|
const iconLocal = V + '◆' + R;
|
|
13
13
|
const iconNetwork = V + '◆' + R;
|
|
@@ -149,9 +149,9 @@ export async function dev() {
|
|
|
149
149
|
port = p;
|
|
150
150
|
process.env.FLOW_DEV_PORT = String(p);
|
|
151
151
|
httpServer.removeListener('error', onError);
|
|
152
|
-
const T = '\x1b[1;
|
|
153
|
-
const U = '\x1b[
|
|
154
|
-
const W =
|
|
152
|
+
const T = '\x1b[1;38;2;255;0;135m'; // bold #ff0087
|
|
153
|
+
const U = '\x1b[38;2;255;0;135m';
|
|
154
|
+
const W = 42;
|
|
155
155
|
const proto = useHttps ? 'https' : 'http';
|
|
156
156
|
const local = `${proto}://localhost:${port}`;
|
|
157
157
|
const network = host ? getNetworkUrl(port, useHttps) : null;
|
|
@@ -159,14 +159,17 @@ export async function dev() {
|
|
|
159
159
|
const PAD_LEFT = 2;
|
|
160
160
|
const strip = (s: string) => s.replace(/\x1b\[[0-9;]*m/g, '').replace(/\n/g, '');
|
|
161
161
|
const pad = (s: string, len: number) => s + ' '.repeat(Math.max(0, len - strip(s).length));
|
|
162
|
-
const
|
|
163
|
-
const
|
|
164
|
-
const
|
|
162
|
+
const inner = ' ' + T + 'Flow OS' + R + ' ';
|
|
163
|
+
const innerLen = strip(inner).length;
|
|
164
|
+
const half = Math.max(0, Math.floor((W - 2 - innerLen) / 2));
|
|
165
|
+
const top = '╭' + '─'.repeat(half) + inner + '─'.repeat(W - 2 - half - innerLen) + '╮';
|
|
166
|
+
const bottom = '╰' + '─'.repeat(W - 2) + '╯';
|
|
167
|
+
const emptyLine = '│' + ' '.repeat(PAD_LEFT) + ' '.repeat(W - PAD_LEFT) + '│';
|
|
165
168
|
const localContent = iconLocal + ' Local: ' + U + local + R;
|
|
166
169
|
const localLine = '│' + ' '.repeat(PAD_LEFT) + pad(localContent, W - PAD_LEFT) + '│';
|
|
167
170
|
const netContent = network ? iconNetwork + ' Network: ' + U + network + R : iconNetwork + ' Network: (not exposed)';
|
|
168
171
|
const networkLine = '│' + ' '.repeat(PAD_LEFT) + pad(netContent, W - PAD_LEFT) + '│';
|
|
169
|
-
const banner = '\x1b[2A\r\x1b[K\n' + top + '\n' +
|
|
172
|
+
const banner = '\x1b[2A\r\x1b[K\n' + top + '\n' + emptyLine + '\n' + localLine + '\n' + networkLine + '\n' + bottom + '\n\n';
|
|
170
173
|
process.stdout.write(banner);
|
|
171
174
|
resolve();
|
|
172
175
|
});
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { Plugin } from 'vite';
|
|
2
2
|
|
|
3
3
|
export async function server(): Promise<Plugin | null> {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
try {
|
|
5
|
+
const { flowServer } = await import('@flow-os/server');
|
|
6
|
+
return flowServer();
|
|
7
|
+
} catch {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
}
|