Files
DrSmoothl 61e3867197 chore(release): single-source app version + add pnpm bump
- WebUI sidebar/login display and OneBot get_version_info now read the
  root package.json version via Vite `define`, removing hardcoded
  literals in webui/src/types.ts and core/onebot/actions/info.ts.
- tools/bump-version.mjs (exposed as `pnpm bump <ver>`) syncs the
  version field across the root and all five workspace packages.
- Bump everything to 1.7.8.
2026-05-13 16:51:44 +08:00

39 lines
1.1 KiB
TypeScript

import fs from 'node:fs';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import tailwindcss from '@tailwindcss/vite';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
// Single source of truth for the user-facing app version: monorepo root package.json.
const rootPkg = JSON.parse(
fs.readFileSync(path.resolve(__dirname, '../../package.json'), 'utf-8'),
) as { version: string };
export default defineConfig({
plugins: [tailwindcss(), react()],
resolve: {
alias: {
'@': path.resolve(__dirname, 'src'),
},
},
define: {
__APP_VERSION__: JSON.stringify(rootPkg.version),
},
server: {
port: 5178,
strictPort: false,
proxy: {
'/api': { target: 'http://localhost:5099', changeOrigin: true, ws: true },
'/avatar': { target: 'http://localhost:5099', changeOrigin: true },
},
},
build: {
// Emit into the monorepo-root dist/client so the bundled core can serve it via Hono.
outDir: '../../dist/client',
emptyOutDir: true,
},
});