b3b7b5d5e5
- CHANGELOG Unveroeffentlicht -> Neu - Anwenderhandbuch: Fenster nach einem Versionswechsel - Entwicklerdoku: erweiterte Importregel fuer @/lib/changelog, Versionsquelle, Endpunkte, Spalte, Folge fuer die Freigabe - Kopfkommentare changelog.ts und next.config.ts angepasst Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
48 lines
1.7 KiB
TypeScript
48 lines
1.7 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 Server-Code `@/lib/changelog` importiert:
|
|
// die Server-Seite (changelog/page.tsx) und die 'use server'-Datei
|
|
// lib/release-notice-actions.ts (quick-260925-bow) — 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);
|