fuckingtech/vite.config.ts
Elias Rhouzlane 5e0ebd2f94 chore: port to autokit 39 (client-db 17, admin 24, operator 11), server components kept
Replaces the legacy Bureau CMS stack (@bureaudouble/bureau, deno-sqlite-blob, Fresh-style RSC)
with the fleet layout: a defineProgram schema over the legacy tables (rows carry over by id), the
timeline-selected blob database (autokit.sqlite), the operator CLI and mf predeploy, the
package-shipped admin with a plugin per table, and the /api rpc/mcp/openapi door.

The pages still render as server components, wired like wtfutures: one Autokit session per
process, the request's db minted once in a createStart request middleware, read as context.db by
each page's server function and handed to the server components as a db prop; the rsc graph never
imports the session module (tests/one-session.test.ts).

French stays at / and English at /en, now through Autokit's locales: the *_en columns became the
translationsJson bag beside their French base text. The integer order columns of persons, roles
and resources became order keys (drag-to-reorder in the admin); media columns are stored-media
lists resolved through autokit-media. The age gate is the same shared page for every visitor: a
head script marks a visitor who already answered, before the first paint.
2026-10-31 19:08:41 +01:00

43 lines
1.4 KiB
TypeScript

import {
autokitLintJsPlugins,
autokitLintRules,
autokitVitePreset,
} from "@bureaudouble/autokit/vite";
import tailwindcss from "@tailwindcss/vite";
import { tanstackStart } from "@tanstack/react-start/plugin/vite";
import viteReact from "@vitejs/plugin-react";
import rsc from "@vitejs/plugin-rsc";
import { defineConfig } from "vite-plus";
export default defineConfig({
lint: {
options: { typeAware: true, typeCheck: true },
settings: { tailwindcss: { entryPoint: "main.css", timeout: 180_000 } },
jsPlugins: [...autokitLintJsPlugins],
rules: Object.fromEntries(
Object.entries(autokitLintRules).filter(([rule]) => rule !== "react/react-compiler"),
),
ignorePatterns: ["_spec/**", "public/**"],
},
fmt: {
ignorePatterns: ["src/routeTree.gen.ts", ".tanstack-start/", ".tanstack/", "public/", "_spec/"],
},
optimizeDeps: { exclude: ["@base-ui/react"] },
environments: {
rsc: {
resolve: {
// Email HTML uses React DOM's server renderer, outside the react-server condition.
external: ["@bureaudouble/render-email"],
},
},
},
resolve: { tsconfigPaths: true },
server: { port: Number(process.env["SERVER_PORT"] ?? 61616), strictPort: true },
plugins: [
tailwindcss(),
...autokitVitePreset(),
tanstackStart({ router: { addExtensions: true }, rsc: { enabled: true } }),
rsc(),
viteReact(),
],
});