A Vite + React 18 + TypeScript SPA, same-origin with the API (no CORS, no Go server changes). Full management parity with the urapt CLI: - First-run setup (admin bootstrap via needs_setup), login/logout - Repositories: list, create, tabbed detail (overview edit/delete, members CRUD, distributions/components/architectures manager, package list + .deb upload + detail + delete, apt-config panel) - API tokens: show-once creation + revoke - Admin users: toggle admin / delete - Settings + dark mode Stack: Tailwind + shadcn/ui (New York), React Router v7 (lazy routes), TanStack Query v5, Zustand, Vitest. Hand-written typed API client mirroring shared/api + shared/models. Dev proxy forwards /api + /apt to a local urapt-server; deploy behind nginx/Caddy (see urapt-web/README).
50 lines
1.3 KiB
TypeScript
50 lines
1.3 KiB
TypeScript
/// <reference types="vitest/config" />
|
|
import { defineConfig } from "vite";
|
|
import react from "@vitejs/plugin-react";
|
|
import path from "node:path";
|
|
|
|
const SERVER_TARGET = process.env.URAPT_SERVER ?? "http://localhost:8080";
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
resolve: {
|
|
alias: {
|
|
"@": path.resolve(__dirname, "./src"),
|
|
},
|
|
},
|
|
server: {
|
|
port: 5173,
|
|
proxy: {
|
|
// Same-origin dev: forward API + APT endpoints to a local urapt-server.
|
|
"/api": { target: SERVER_TARGET, changeOrigin: true },
|
|
"/apt": { target: SERVER_TARGET, changeOrigin: true },
|
|
},
|
|
},
|
|
build: {
|
|
chunkSizeWarningLimit: 600,
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks: {
|
|
"react-vendor": ["react", "react-dom", "react-router-dom"],
|
|
"query-vendor": ["@tanstack/react-query"],
|
|
"radix-vendor": [
|
|
"@radix-ui/react-dialog",
|
|
"@radix-ui/react-dropdown-menu",
|
|
"@radix-ui/react-select",
|
|
"@radix-ui/react-tabs",
|
|
"@radix-ui/react-toast",
|
|
"@radix-ui/react-tooltip",
|
|
],
|
|
},
|
|
},
|
|
},
|
|
},
|
|
test: {
|
|
globals: true,
|
|
environment: "jsdom",
|
|
setupFiles: ["./src/test/setup.ts"],
|
|
css: false,
|
|
},
|
|
});
|