ci / rust (push) Successful in 2m40s
Rewrites CLAUDE.md as the current-architecture reference, drops the registry from INSTALL/PRODUCT/DESIGN and the web README, deletes the registry Dockerfile, and marks the dated design specs superseded where they describe the registry, JWT auth, or cross-host attach. The installer loses its configure step — every config field now has a default, so a daemon starts with no config file at all.
40 lines
1.0 KiB
TypeScript
40 lines
1.0 KiB
TypeScript
import { defineConfig, loadEnv } from "vite";
|
|
|
|
// Where the dev proxy forwards `/api/*` (and the events WS) to. Default to a
|
|
// local daemon on 127.0.0.1:7070. Override with:
|
|
// MAESTRO_DAEMON_URL=http://laptop.lan:7070
|
|
// `ws://`/`wss://` forms are normalised to http/https, since the proxy needs an
|
|
// HTTP base URL.
|
|
function resolveProxyTarget(raw: string | undefined): string {
|
|
if (!raw) return "http://127.0.0.1:7070";
|
|
return raw
|
|
.replace(/^wss:\/\//, "https://")
|
|
.replace(/^ws:\/\//, "http://")
|
|
.replace(/\/+$/, "");
|
|
}
|
|
|
|
export default defineConfig(({ mode }) => {
|
|
const env = loadEnv(mode, process.cwd(), "");
|
|
const target = resolveProxyTarget(env.MAESTRO_DAEMON_URL);
|
|
const secure = target.startsWith("https://");
|
|
return {
|
|
build: {
|
|
target: "es2022",
|
|
outDir: "dist",
|
|
emptyOutDir: true,
|
|
sourcemap: false,
|
|
},
|
|
server: {
|
|
port: 5173,
|
|
proxy: {
|
|
"/api": {
|
|
target,
|
|
changeOrigin: secure,
|
|
ws: true,
|
|
secure: false,
|
|
},
|
|
},
|
|
},
|
|
};
|
|
});
|