import Link from "next/link" import { PageHeader } from "@/components/page-header" import { OpsPanel } from "@/components/ops-panel" import { buttonVariants } from "@/components/ui/button" import { formatAppVersionLabel, getAppVersion, getReleaseUrl } from "@/lib/app-version" import { formatCommitSubject, getReleaseCommitPreview, } from "@/lib/release-commits" import { readReleaseManifest } from "@/lib/release-manifest" import { cn } from "@/lib/utils" import { ExternalLinkIcon } from "lucide-react" export const dynamic = "force-dynamic" function formatPublishedAt(value: string | null, isProdBuild: boolean): string { if (value) { return "Дата манифеста: " + new Intl.DateTimeFormat("ru-RU", { dateStyle: "long", timeStyle: "short", }).format(new Date(value)) } return isProdBuild ? "Дата манифеста не указана" : "Локальная сборка" } export default function ReleasesPage() { const manifest = readReleaseManifest() const version = getAppVersion() const isProdBuild = !version.endsWith("-dev") const releaseUrl = getReleaseUrl() || manifest?.releaseUrl || null const commits = getReleaseCommitPreview(manifest?.commits ?? []) return (
Открыть релиз ) : null } />
{formatAppVersionLabel(version)} {isProdBuild ? formatPublishedAt(manifest?.version === version ? manifest.publishedAt : null, true) : "Локальная сборка"}

Версия формируется автоматически от базы v1.0.0 по Conventional Commits.

{!manifest ?

Метаданные релиза недоступны или повреждены. Дата, ссылка и список коммитов не подтверждены.

: manifest.version !== version && isProdBuild ?

Манифест относится к {formatAppVersionLabel(manifest.version)}; версия запущенной сборки отличается.

: null} 0 ? `Коммиты манифеста ${formatAppVersionLabel(manifest!.version)}: ${commits.length}.` : manifest ? "В манифесте нет коммитов. При публикации список формируется CI." : "Список коммитов не подтверждён." } contentClassName="px-5 pb-5" > {commits.length === 0 ? (

{manifest ? "Коммитов для отображения пока нет." : "Нет подтверждённых метаданных."}

) : (
    {commits.map((commit) => (
  • {commit.type} {commit.shortSha} {commit.author}

    {formatCommitSubject(commit.subject)}

  • ))}
)}
) }