Files
TUIkit/docs/next.config.ts
T
phranck bdb6d0c3f9 Chore: Fourth-pass optimization — bug fix, auto test counts, ESLint clean, constant extraction
- Fix: parseTerminalFormatting used undefined 'key' instead of 'partKey' (TS error)
- Fix: ESLint setState-in-effect errors (4→0) via cleanup patterns and hydration-sync
- Feat: Auto test/suite counts from Swift project at build-time (prebuild script + env vars)
- Refactor: ArchHighlight sub-component eliminates 4× duplicated pattern in page.tsx
- Refactor: BTN_PRIMARY/BTN_SECONDARY constants replace duplicated button classes
- Refactor: CRT geometry object centralizes repeated calc() layer positions
- Refactor: 13 magic numbers → named constants in TerminalScreen (timings, delays)
- Refactor: Icon component extended with custom SVG support (copy icon)
- Refactor: cloudGradient() helper replaces 6× duplicated radial-gradient strings
- Refactor: HIGHLIGHT constants object for syntax highlighter colors
- Refactor: text-glow CSS utility replaces duplicated textShadow inline styles
2026-02-02 15:38:33 +01:00

31 lines
770 B
TypeScript

import type { NextConfig } from "next";
import fs from "fs";
import path from "path";
/** Read project stats generated by the prebuild script. */
function readProjectStats(): { testCount: number; suiteCount: number } {
const statsPath = path.join(process.cwd(), "project-stats.json");
try {
const raw = fs.readFileSync(statsPath, "utf-8");
return JSON.parse(raw);
} catch {
return { testCount: 0, suiteCount: 0 };
}
}
const stats = readProjectStats();
const nextConfig: NextConfig = {
output: "export",
images: {
unoptimized: true,
},
env: {
TUIKIT_VERSION: process.env.TUIKIT_VERSION ?? "0.1.0",
TUIKIT_TEST_COUNT: String(stats.testCount),
TUIKIT_SUITE_COUNT: String(stats.suiteCount),
},
};
export default nextConfig;