@flow-os/client 0.0.46 → 0.0.47-dev.1772043545

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@flow-os/client",
3
- "version": "0.0.46",
3
+ "version": "0.0.47-dev.1772043545",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
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[95m';
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,8 +149,8 @@ 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;95m';
153
- const U = '\x1b[95m';
152
+ const T = '\x1b[1;38;2;255;0;135m'; // bold #ff0087
153
+ const U = '\x1b[38;2;255;0;135m';
154
154
  const W = 46;
155
155
  const proto = useHttps ? 'https' : 'http';
156
156
  const local = `${proto}://localhost:${port}`;
@@ -159,14 +159,16 @@ 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 top = '' + ''.repeat(W) + '';
163
- const bottom = '╰' + '─'.repeat(W) + '╯';
164
- const titleLine = '│' + ' '.repeat(PAD_LEFT) + pad(T + 'Flow OS' + R, W - PAD_LEFT) + '│';
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) + '╯';
165
167
  const localContent = iconLocal + ' Local: ' + U + local + R;
166
168
  const localLine = '│' + ' '.repeat(PAD_LEFT) + pad(localContent, W - PAD_LEFT) + '│';
167
169
  const netContent = network ? iconNetwork + ' Network: ' + U + network + R : iconNetwork + ' Network: (not exposed)';
168
170
  const networkLine = '│' + ' '.repeat(PAD_LEFT) + pad(netContent, W - PAD_LEFT) + '│';
169
- const banner = '\x1b[2A\r\x1b[K\n' + top + '\n' + titleLine + '\n' + localLine + '\n' + networkLine + '\n' + bottom + '\n\n';
171
+ const banner = '\x1b[2A\r\x1b[K\n' + top + '\n' + localLine + '\n' + networkLine + '\n' + bottom + '\n\n';
170
172
  process.stdout.write(banner);
171
173
  resolve();
172
174
  });
@@ -0,0 +1,5 @@
1
+ declare module '@flow-os/server' {
2
+ import type { Plugin } from 'vite';
3
+ export function flowServer(): Plugin;
4
+ export function Route<T>(fn: (req: T) => unknown): (req: T) => Promise<Response>;
5
+ }
@@ -1,6 +1,10 @@
1
1
  import type { Plugin } from 'vite';
2
2
 
3
3
  export async function server(): Promise<Plugin | null> {
4
- const has = await Bun.file(`${process.cwd()}/server/package.json`).exists();
5
- return has ? { name: 'flow-os:server' } : null;
6
- }
4
+ try {
5
+ const { flowServer } = await import('@flow-os/server');
6
+ return flowServer();
7
+ } catch {
8
+ return null;
9
+ }
10
+ }