- UX audit Fix 1-5: actionable MCP HandoffSurface (endpoint/discovery/onboarding), reachable approval loop (sidebar section + waiting-for-me badge), honest MCP entry labels, ROUTES SSOT for dashboard-testing/load-testing (+ link-integrity coverage) - scenario registry hub (/dashboard-testing/scenarios) built on ScenarioRegistryModel - admin MCP governance: read-only GET /api/admin/mcp/catalog (catalog x roles + DCR clients) + /admin/mcp page/model/api + ROUTES.admin.mcp + sidebar entry - full i18n sweep of dashboard-testing routes and scenario-* component trees (ru/en) - accumulated workspace: MCP OAuth/DCR, automation idempotency migration, docker/nginx, specs
46 lines
1.3 KiB
JavaScript
Executable File
46 lines
1.3 KiB
JavaScript
Executable File
import { sveltekit } from '@sveltejs/kit/vite';
|
|
import { defineConfig } from 'vite';
|
|
import { execSync } from 'child_process';
|
|
|
|
const APP_VERSION = (() => {
|
|
// 1. Use APP_VERSION env var (passed via Docker --build-arg or .env)
|
|
if (process.env.APP_VERSION && process.env.APP_VERSION !== '0.0.0') {
|
|
return process.env.APP_VERSION;
|
|
}
|
|
// 2. Fall back to latest git tag + short commit hash (works in local dev with .git)
|
|
try {
|
|
const tag = execSync('git describe --tags --abbrev=0', { encoding: 'utf8' }).trim();
|
|
const commit = execSync('git rev-parse --short HEAD', { encoding: 'utf8' }).trim();
|
|
return `${tag}+${commit}`;
|
|
} catch {
|
|
return '0.0.0';
|
|
}
|
|
})();
|
|
|
|
export default defineConfig({
|
|
define: {
|
|
__APP_VERSION__: JSON.stringify(APP_VERSION)
|
|
},
|
|
plugins: [sveltekit()],
|
|
server: {
|
|
proxy: {
|
|
'^/(mcp(?:/|$)|oauth/|\\.well-known/)': {
|
|
target: process.env.BACKEND_URL || 'http://127.0.0.1:8000',
|
|
changeOrigin: false
|
|
},
|
|
'/api': {
|
|
target: process.env.BACKEND_URL || 'http://127.0.0.1:8000',
|
|
changeOrigin: true,
|
|
secure: false,
|
|
rewrite: (path) => path.replace(/^\/api/, '/api')
|
|
},
|
|
'/ws': {
|
|
target: (process.env.BACKEND_URL || 'http://127.0.0.1:8000').replace(/^http/, 'ws'),
|
|
ws: true,
|
|
changeOrigin: true,
|
|
secure: false
|
|
}
|
|
}
|
|
}
|
|
});
|