feat(app): 添加版本更新弹窗功能

- 在顶部导航栏和用户状态组件中集成版本更新弹窗
- 实现版本检查钩子,支持检查最新版本和更新日志
- 解析 CHANGELOG.md 文件并展示版本更新时间线
- 添加版本更新弹窗 UI 组件,显示当前版本和最新版本
- 在 Dockerfile 中更新 bun 版本依赖
- 调整 Next.js 配置以解析版本信息并注入环境变量
- 更新待测试文档中的版本更新功能描述
This commit is contained in:
HouYunFei
2026-05-20 15:25:57 +08:00
parent 2ab499bc54
commit 7a27684e3c
11 changed files with 241 additions and 8 deletions
+24
View File
@@ -0,0 +1,24 @@
export type ReleaseInfo = {
version: string;
date: string;
items: { type: string; content: string }[];
};
export function parseChangelog(content: string): ReleaseInfo[] {
return content
.split(/^## /m)
.slice(1)
.map((block) => {
const [title = "", ...lines] = block.trim().split("\n");
const [, version = title.trim(), date = ""] = title.match(/^(.+?)(?:\s+-\s+(.+))?$/) || [];
return {
version: version.trim(),
date: date.trim(),
items: lines
.map((line) => line.trim().match(/^\+\s+\[(.+?)\]\s+(.+)$/))
.filter((match): match is RegExpMatchArray => Boolean(match))
.map((match) => ({ type: match[1], content: match[2] })),
};
})
.filter((release) => release.items.length);
}