ba06db98c5
- CHANGELOG.md (Wurzel): Unveroeffentlicht (bwo + dyv + diese Seite, 8 Punkte) und 1.0.0 – 2026-09-15 (11 Punkte aus den Handbuechern), Alltagssprache, echte Umlaute - next.config.ts liest CHANGELOG.md zur Bauzeit nach env.TESSERA_CHANGELOG_MD; .dockerignore-Ausnahme !CHANGELOG.md und COPY-Zeile im Web-Dockerfile - lib/changelog.ts: filterChangelogForChannel (live ohne Unveroeffentlicht, beta/dev mit "Noch nicht freigegeben (Beta)", leerer Abschnitt ausgeblendet), 10 Tests - Server-Seite /changelog (MDEditor.Markdown + rehype-sanitize, Hinweis auf Beta, Leer-Text), 3 Tests; Versionszeile ist Link mit aria-label, 2 Tests - de/en: sidebar.whatsNew und Namensraum changelog; Web-Suite 49/309, tsc 0 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018N9CD3ebPKm1b32bPpBknY
46 lines
1.6 KiB
TypeScript
46 lines
1.6 KiB
TypeScript
import { readFileSync } from 'node:fs';
|
|
import path from 'node:path';
|
|
import type { NextConfig } from 'next';
|
|
import createNextIntlPlugin from 'next-intl/plugin';
|
|
|
|
// Bauzeit-Einbettung der Aenderungsliste (quick-260916-dcz): CHANGELOG.md aus
|
|
// dem Wurzelverzeichnis wird hier gelesen und als `env.TESSERA_CHANGELOG_MD`
|
|
// abgelegt. Next.js ersetzt `process.env.TESSERA_CHANGELOG_MD` fuer webpack UND
|
|
// Turbopack ueber denselben Define-Mechanismus. Der Text bleibt nur im
|
|
// Server-Bundle, weil ausschliesslich die Server-Seite (changelog/page.tsx)
|
|
// `@/lib/changelog` importiert — Importdisziplin, kein Client-Chunk.
|
|
|
|
const withNextIntl = createNextIntlPlugin('./src/i18n/request.ts');
|
|
|
|
function readChangelog(): string {
|
|
const file = path.resolve(__dirname, '../../CHANGELOG.md');
|
|
try {
|
|
return readFileSync(file, 'utf8');
|
|
} catch (error) {
|
|
const reason = error instanceof Error ? error.message : String(error);
|
|
throw new Error(
|
|
`CHANGELOG.md konnte nicht gelesen werden (${file}): ${reason}. ` +
|
|
'Die Datei muss im Wurzelverzeichnis liegen; im Docker-Bau braucht sie die Ausnahme ' +
|
|
'`!CHANGELOG.md` in .dockerignore und die Zeile `COPY CHANGELOG.md ./` in apps/web/Dockerfile.',
|
|
);
|
|
}
|
|
}
|
|
|
|
const nextConfig: NextConfig = {
|
|
output: 'standalone' as const,
|
|
env: {
|
|
TESSERA_CHANGELOG_MD: readChangelog(),
|
|
},
|
|
async rewrites() {
|
|
const apiUrl = process.env.API_INTERNAL_URL || 'http://api:3001';
|
|
return [
|
|
{
|
|
source: '/api-proxy/:path*',
|
|
destination: `${apiUrl}/:path*`,
|
|
},
|
|
];
|
|
},
|
|
};
|
|
|
|
export default withNextIntl(nextConfig);
|