From 54fc2ead4cbdaf489ab841a61a1afc5d9fe4efbf Mon Sep 17 00:00:00 2001 From: cruldra Date: Tue, 1 Sep 2026 19:09:02 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(vscode):=20=E6=91=98=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E6=9C=AA=E5=85=B3=E8=81=94=E6=8F=90=E4=BA=A4=E7=BD=AE?= =?UTF-8?q?=E9=A1=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vscode/package.json | 2 +- vscode/src/git/release.ts | 2 +- vscode/test/git/release.test.ts | 22 ++++------------------ 3 files changed, 6 insertions(+), 20 deletions(-) diff --git a/vscode/package.json b/vscode/package.json index 5b30fe6..7d761a5 100644 --- a/vscode/package.json +++ b/vscode/package.json @@ -2,7 +2,7 @@ "publisher": "clurdra", "name": "superpowers-vscode-clurdra", "displayName": "Superpowers-clurdra", - "version": "0.2.110", + "version": "0.2.111", "packageManager": "pnpm@10.27.0", "description": "Superpowers specs and plans Kanban explorer", "author": "clurdra", diff --git a/vscode/src/git/release.ts b/vscode/src/git/release.ts index 815afd4..1fac4ca 100644 --- a/vscode/src/git/release.ts +++ b/vscode/src/git/release.ts @@ -118,7 +118,7 @@ export function groupCommitsByPr(commits: UnreleasedCommit[]): ReleaseCommitGrou if (!authors.includes(c.author)) authors.push(c.author) } - out.push({ title: '未关联 PR', authors, commits: ungrouped }) + out.unshift({ title: '未关联 PR', authors, commits: ungrouped }) } return out } diff --git a/vscode/test/git/release.test.ts b/vscode/test/git/release.test.ts index 90f2384..60f7d40 100644 --- a/vscode/test/git/release.test.ts +++ b/vscode/test/git/release.test.ts @@ -72,24 +72,10 @@ describe('纯函数', () => { { sha: '5572c4f', subject: 'fix(membership): 年付月度发卡', author: 'chehongweo', date: '2026-08-31', body: '', pr: 260, prTitle: '连续包月会员订阅体系' }, { sha: 'c', subject: 'chore: lone', author: 'you', date: '2026-08-30', body: '' }, ]) - expect(groups).toEqual([ - { - pr: 260, - title: '连续包月会员订阅体系', - authors: ['chehongweo'], - commits: [ - { sha: '3e519ea', subject: 'fix(admin): 会员档位隐藏', author: 'chehongweo', date: '2026-08-31', body: '', pr: 260, prTitle: '连续包月会员订阅体系' }, - { sha: '5572c4f', subject: 'fix(membership): 年付月度发卡', author: 'chehongweo', date: '2026-08-31', body: '', pr: 260, prTitle: '连续包月会员订阅体系' }, - ], - }, - { - title: '未关联 PR', - authors: ['you'], - commits: [ - { sha: 'c', subject: 'chore: lone', author: 'you', date: '2026-08-30', body: '' }, - ], - }, - ]) + expect(groups.map(g => g.title)).toEqual(['未关联 PR', '连续包月会员订阅体系']) + expect(groups[0].commits.map(c => c.sha)).toEqual(['c']) + expect(groups[1].pr).toBe(260) + expect(groups[1].commits.map(c => c.sha)).toEqual(['3e519ea', '5572c4f']) }) })