build: 优化 Docker/Workflow 构建,使用 Next.js 环境变量注入版本和构建时间,并移除对 package.json 的硬编码替换

This commit is contained in:
ryan
2026-06-11 20:18:49 +08:00
parent 7c125ccef2
commit 50533e1837
11 changed files with 37 additions and 46 deletions
@@ -2,6 +2,7 @@
import {Info, Server} from "lucide-react"
import packageJson from "../../../package.json"
import {APP_VERSION, APP_BUILD_DATE} from "@/lib/app-info"
import {apiConfig} from "@/lib/services"
import {Card, CardContent, CardDescription, CardHeader, CardTitle} from "@/components/ui/card"
@@ -36,8 +37,8 @@ export function InfoTab({ systemConfigsLength, authSourcesLength }: InfoTabProps
</CardHeader>
<CardContent className="pt-4">
<InfoRow label="应用名称" value={packageJson.name} />
<InfoRow label="版本号" value={packageJson.version} />
<InfoRow label="构建时间" value={packageJson.buildDate} />
<InfoRow label="版本号" value={APP_VERSION} />
{APP_BUILD_DATE && <InfoRow label="构建时间" value={APP_BUILD_DATE} />}
<InfoRow label="Next.js" value={(packageJson as { dependencies?: Record<string, string> }).dependencies?.next} />
<InfoRow label="React" value={(packageJson as { dependencies?: Record<string, string> }).dependencies?.react} />
</CardContent>