Skip to content

Commit 52066ec

Browse files
committed
feat(release): surface the release & versioning map in the Overview panel
Adds the matching Overview card plus the ReleaseSummary / ReleaseAutomation types. Shows the current version with its scheme, the changelog file (click to open it), and the auto-publish pipeline with what kicks it off. Renders only when there is something real to report.
1 parent 88a8f74 commit 52066ec

2 files changed

Lines changed: 131 additions & 0 deletions

File tree

frontend/src/lib/api.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,32 @@ export interface LicenseSummary {
252252
notes: string[];
253253
}
254254

255+
export interface ReleaseAutomation {
256+
trigger: string; // "tag-push" | "release" | "manual" | ""
257+
trigger_zh: string; // plain-Chinese gloss of what kicks the release off
258+
target: string; // "PyPI" | "npm" | "GitHub Release" | "crates.io" | "RubyGems" | "Docker 镜像"
259+
path: string;
260+
line: number;
261+
}
262+
263+
export interface ReleaseSummary {
264+
version: string; // current version string, "" if none found
265+
version_source: string; // path the version was read from
266+
// "pyproject" | "package-json" | "cargo" | "setup-py" | "setup-cfg"
267+
// | "version-file" | "dunder" | "pom" | "gradle"
268+
version_source_kind: string;
269+
dynamic_from_vcs: boolean; // version derived from git tags at build time
270+
// "semver" | "zerover" | "calver" | "prerelease" | "twopart" | "single" | "other"
271+
scheme: string;
272+
scheme_zh: string;
273+
changelog_path: string;
274+
changelog_style: string; // "keepachangelog" | "versioned" | "freeform" | "none"
275+
changelog_style_zh: string;
276+
automation: ReleaseAutomation[];
277+
publish_targets: string[];
278+
notes: string[];
279+
}
280+
255281
export interface ComplexFile {
256282
path: string;
257283
complexity: number;
@@ -407,6 +433,7 @@ export interface ProjectMeta {
407433
doc_coverage?: DocCoverage;
408434
error_handling?: ErrorHandling;
409435
integrations?: Integrations;
436+
release?: ReleaseSummary;
410437
action_plan?: ActionPlan;
411438
dependencies?: Dependency[];
412439
api_map?: ApiMap;

frontend/src/pages/Overview.tsx

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,6 +1061,110 @@ export default function Overview() {
10611061
</section>
10621062
)}
10631063

1064+
{/* Release & versioning — how the project ships new versions, and what changed */}
1065+
{project?.release &&
1066+
(project.release.version ||
1067+
project.release.dynamic_from_vcs ||
1068+
project.release.changelog_path ||
1069+
project.release.automation.length > 0) && (
1070+
<section className="bg-white rounded-xl p-6 shadow-sm mb-6 border-l-4 border-violet-400">
1071+
<h2 className="text-lg font-semibold text-gray-900 mb-1">
1072+
{t("版本与发布(现在第几版、怎么发新版)", "Release & versioning")}
1073+
</h2>
1074+
<p className="text-sm text-gray-500 mb-4">
1075+
{t(
1076+
"想知道这个项目现在是第几版、出新版本时去哪看改了什么、新版又是怎么发出去的,看这里。",
1077+
"What version this is, where to see what changed between versions, and how a new release goes out.",
1078+
)}
1079+
</p>
1080+
1081+
<div className="mb-3">
1082+
<span className="text-xs rounded bg-violet-50 text-violet-700 px-1.5 py-0.5">
1083+
{t("当前版本", "Version")}
1084+
</span>
1085+
{project.release.version ? (
1086+
<>
1087+
<span className="ml-2 font-mono text-sm font-semibold text-gray-900">
1088+
{project.release.version}
1089+
</span>
1090+
{project.release.scheme_zh && (
1091+
<span className="ml-2 text-sm text-gray-600">
1092+
{project.release.scheme_zh}
1093+
</span>
1094+
)}
1095+
{project.release.version_source && (
1096+
<span className="ml-2 text-xs text-gray-400">
1097+
{project.release.version_source}
1098+
</span>
1099+
)}
1100+
</>
1101+
) : project.release.dynamic_from_vcs ? (
1102+
<span className="ml-2 text-sm text-gray-700">
1103+
{t("由 git tag 在打包时自动推导", "derived from git tags at build time")}
1104+
</span>
1105+
) : (
1106+
<span className="ml-2 text-sm text-gray-700">
1107+
{t("没找到写明的版本号", "no declared version found")}
1108+
</span>
1109+
)}
1110+
</div>
1111+
1112+
<div className="mb-3">
1113+
<span className="text-xs rounded bg-violet-50 text-violet-700 px-1.5 py-0.5">
1114+
{t("更新日志", "Changelog")}
1115+
</span>
1116+
{project.release.changelog_path ? (
1117+
<button
1118+
onClick={() => handleFileClick(project.release!.changelog_path)}
1119+
className="ml-2 text-left hover:text-blue-700"
1120+
>
1121+
<span className="font-mono text-sm text-violet-700">
1122+
{project.release.changelog_path}
1123+
</span>
1124+
{project.release.changelog_style_zh && (
1125+
<span className="ml-2 text-sm text-gray-600">
1126+
{project.release.changelog_style_zh}
1127+
</span>
1128+
)}
1129+
</button>
1130+
) : (
1131+
<span className="ml-2 text-sm text-gray-700">
1132+
{t(
1133+
"没有更新日志文件,只能翻提交记录或 Release 页面",
1134+
"no changelog file; check the commits or the Releases page",
1135+
)}
1136+
</span>
1137+
)}
1138+
</div>
1139+
1140+
{project.release.automation.length > 0 && (
1141+
<div>
1142+
<span className="text-xs rounded bg-violet-50 text-violet-700 px-1.5 py-0.5">
1143+
{t("自动发布", "Release pipeline")}
1144+
</span>
1145+
<ul className="mt-2 space-y-2">
1146+
{project.release.automation.map((a) => (
1147+
<li key={`${a.path}:${a.line}:${a.target}`}>
1148+
<button
1149+
onClick={() => handleFileClick(a.path)}
1150+
className="w-full text-left hover:text-blue-700"
1151+
>
1152+
<span className="text-sm font-semibold text-gray-900">{a.target}</span>
1153+
{a.trigger_zh && (
1154+
<span className="ml-2 text-sm text-gray-700">{a.trigger_zh}</span>
1155+
)}
1156+
<span className="ml-2 text-xs text-gray-400">
1157+
{a.path}:{a.line}
1158+
</span>
1159+
</button>
1160+
</li>
1161+
))}
1162+
</ul>
1163+
</div>
1164+
)}
1165+
</section>
1166+
)}
1167+
10641168
{/* Open-source license — what you're actually allowed to do with the code */}
10651169
{project?.licenses &&
10661170
(project.licenses.found.length > 0 ||

0 commit comments

Comments
 (0)