import { readFileSync } from "node:fs"; import path from "node:path"; import type { Metadata } from "next"; import { Changelog } from "yt-dlp-transcript-common/components/Changelog"; import { PageShell, PageHeading } from "../components/PageShell"; export const metadata: Metadata = { title: "Changelog", description: "What has changed in the published archive sites Archilyzer builds.", }; // The viewer's changelog — the one that describes what a VISITOR to a published // archive sees change. Read from the export package at build time, mirroring // export/app/changelog/page.tsx's readFileSync-from-cwd approach; `output: // "export"` means this runs once at build, never per request. // // It reaches outside this package (to ../export), which is fine: the source // tarball is a `git archive` of the whole monorepo, so the file is always // alongside. It is read defensively anyway — a missing changelog should degrade // to a sentence, not fail the build. function loadChangelog(): string | null { try { return readFileSync( path.join(/* turbopackIgnore: true */ process.cwd(), "..", "export", "CHANGELOG.md"), "utf8", ); } catch { return null; } } export default function ChangelogPage() { const source = loadChangelog(); return ( {source ? (
) : (

The changelog file wasn’t found in this build.

)}
); }