Pax Historia-style sim where the LLM is the world engine.
- React 19 + Vite 6 + Tailwind v4 + shadcn/ui frontend
- Express single-port backend (/api + /sse + built client + SPA fallback)
- SQLite (better-sqlite3) persistence, one row per game
- MapLibre choropleth map (OpenFreeMap dark + ISO_A3 regions)
- Defensive turn loop: strip fences, balanced-{} extract, parse, clamp 0-100,
retry-once nudge, generic 'unclear' fallback; never crashes on bad output
- 5 seed presets (wwii-1939, coldwar-1955, modern-2025, no-wwii-1940, aegis-2400)
- LLM client over native fetch w/ injectable transport (mesh-bot pattern);
LLM_STUB=1 deterministic transport for tests/e2e
- Unit (vitest, 19) + deterministic Playwright e2e
- Multi-stage node:22-slim Docker + Traefik (history.dev.kkhost.pl:4321)
Co-Authored-By: OpenCode <opencode@users.noreply.github.com>
41 lines
1.2 KiB
JavaScript
41 lines
1.2 KiB
JavaScript
import js from '@eslint/js';
|
|
import tseslint from 'typescript-eslint';
|
|
import reactHooks from 'eslint-plugin-react-hooks';
|
|
import globals from 'globals';
|
|
|
|
// Flat config (ESLint 9). Browser code (src/) gets react-hooks + browser globals;
|
|
// everything else (server, shared, e2e, configs, scripts) gets node globals.
|
|
export default tseslint.config(
|
|
{
|
|
ignores: ['**/dist/**', '**/node_modules/**', 'server/dist/**'],
|
|
},
|
|
js.configs.recommended,
|
|
...tseslint.configs.recommended,
|
|
{
|
|
files: ['src/**/*.{ts,tsx}'],
|
|
plugins: { 'react-hooks': reactHooks },
|
|
languageOptions: { globals: { ...globals.browser, ...globals.es2022 } },
|
|
rules: {
|
|
...reactHooks.configs.recommended.rules,
|
|
// We intentionally pass handler objects to hooks that read them via a ref.
|
|
'react-hooks/exhaustive-deps': 'off',
|
|
},
|
|
},
|
|
{
|
|
files: [
|
|
'server/**/*.ts',
|
|
'shared/**/*.ts',
|
|
'e2e/**/*.ts',
|
|
'vite.config.ts',
|
|
'vitest.config.ts',
|
|
'playwright.config.ts',
|
|
'scripts/**/*.mjs',
|
|
],
|
|
languageOptions: { globals: { ...globals.node, ...globals.es2022 } },
|
|
rules: {
|
|
// Node 22 has fetch/AbortSignal/structuredClone as globals.
|
|
'no-undef': 'off',
|
|
},
|
|
},
|
|
);
|