Skip to content

Commit f8e1d12

Browse files
authored
chore(auto-release-collection): adapt to the new version of Vue3 for Web release (#660)
* chore(auto-release-collection): add Vue3 for Chat * chore: fix name * fix: desc * 更新 constants.ts
1 parent 044dcbd commit f8e1d12

File tree

3 files changed

+44
-9
lines changed

3 files changed

+44
-9
lines changed

packages/auto-release-collection/src/constants.ts

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,71 @@ export const submodules = {
22
'tdesign-vue': {
33
title: '## Vue2 for Web 发布',
44
changelogUrl: 'https://raw.githubusercontent.com/Tencent/tdesign-vue/refs/heads/main/CHANGELOG.md',
5+
tagPrefix: '',
6+
repo: 'Tencent/tdesign-vue',
57
},
68
'tdesign-vue-next': {
79
title: '## Vue3 for Web 发布',
8-
changelogUrl: 'https://raw.githubusercontent.com/Tencent/tdesign-vue-next/refs/heads/main/packages/tdesign-vue-next/CHANGELOG.md',
10+
changelogUrl:
11+
'https://raw.githubusercontent.com/Tencent/tdesign-vue-next/refs/heads/main/packages/tdesign-vue-next/CHANGELOG.md',
12+
tagPrefix: 'tdesign-vue-next@',
13+
repo: 'Tencent/tdesign-vue-next',
914
},
1015
'tdesign-react': {
1116
title: '## React for Web 发布 ',
12-
changelogUrl: 'https://raw.githubusercontent.com/Tencent/tdesign-react/refs/heads/main/packages/tdesign-react/CHANGELOG.md',
17+
changelogUrl:
18+
'https://raw.githubusercontent.com/Tencent/tdesign-react/refs/heads/main/packages/tdesign-react/CHANGELOG.md',
19+
tagPrefix: '',
20+
repo: 'Tencent/tdesign-react',
1321
},
1422
'tdesign-miniprogram': {
1523
title: '## Miniprogram for WeChat 发布',
1624
changelogUrl: 'https://raw.githubusercontent.com/Tencent/tdesign-miniprogram/refs/heads/main/CHANGELOG.md',
25+
tagPrefix: '',
26+
repo: 'Tencent/tdesign-miniprogram',
1727
},
1828
'tdesign-mobile-vue': {
1929
title: '## Vue3 for Mobile 发布',
2030
changelogUrl: 'https://raw.githubusercontent.com/Tencent/tdesign-mobile-vue/refs/heads/main/CHANGELOG.md',
31+
tagPrefix: '',
32+
repo: 'Tencent/tdesign-mobile-vue',
2133
},
2234
'tdesign-flutter': {
2335
title: '## Flutter for Mobile 发布',
2436
changelogUrl: 'https://raw.githubusercontent.com/Tencent/tdesign-flutter/refs/heads/main/tdesign-site/CHANGELOG.md',
37+
tagPrefix: '',
38+
repo: 'Tencent/tdesign-flutter',
2539
},
2640
'tdesign-mobile-react': {
2741
title: '## React for Mobile 发布',
2842
changelogUrl: 'https://raw.githubusercontent.com/Tencent/tdesign-mobile-react/refs/heads/main/CHANGELOG.md',
43+
tagPrefix: '',
44+
repo: 'Tencent/tdesign-mobile-react',
2945
},
3046
'tdesign-vue-starter': {
3147
title: '## Vue for Starter 发布 ',
3248
changelogUrl: 'https://raw.githubusercontent.com/Tencent/tdesign-vue-starter/refs/heads/main/CHANGELOG.md',
49+
tagPrefix: '',
50+
repo: 'Tencent/tdesign-vue-starter',
3351
},
3452
'tdesign-vue-next-starter': {
35-
title: '## Vue-next for Starter 发布 ',
53+
title: '## Vue3 for Starter 发布 ',
3654
changelogUrl: 'https://raw.githubusercontent.com/Tencent/tdesign-vue-next-starter/refs/heads/main/CHANGELOG.md',
55+
tagPrefix: '',
56+
repo: 'Tencent/tdesign-vue-next-starter',
3757
},
3858
'tdesign-react-starter': {
3959
title: '## React for Starter 发布 ',
4060
changelogUrl: 'https://raw.githubusercontent.com/Tencent/tdesign-react-starter/refs/heads/main/CHANGELOG.md',
61+
tagPrefix: '',
62+
repo: 'Tencent/tdesign-react-starter',
63+
},
64+
'@tdesign-vue-next/chat': {
65+
title: '## Vue3 for Chat 发布',
66+
changelogUrl:
67+
'https://raw.githubusercontent.com/Tencent/tdesign-vue-next/refs/heads/main/packages/tdesign-vue-next-chat/CHANGELOG.md',
68+
tagPrefix: '@tdesign-vue-next/chat@',
69+
repo: 'Tencent/tdesign-vue-next',
4170
},
4271
};
4372

@@ -54,4 +83,5 @@ export const submodulesKeys: SubmoduleItem[] = [
5483
'tdesign-vue-starter',
5584
'tdesign-vue-next-starter',
5685
'tdesign-react-starter',
86+
//'@tdesign-vue-next/chat',
5787
];

packages/auto-release-collection/src/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@ const fetchPromises = submodulesKeys.map(async (project) => {
2828
const date = new Date(dateMatch[0]);
2929
// 检查日期是否在指定范围内,[2024-06-01, 2024-06-07] 闭区间
3030
if (date >= new Date(START_DATE) && date <= new Date(END_DATE)) {
31-
const desc = getProjectDesc(project, tag[0], submodules[project]['title'], '详情见:');
31+
const desc = getProjectDesc(
32+
submodules[project].repo,
33+
`${submodules[project].tagPrefix}${tag[0]}`,
34+
submodules[project]['title'],
35+
'详情见:',
36+
);
3237
projectOutput.push(`${desc[0]}\n${versionContent}\n${desc[1]}\n`);
3338
}
3439
}

packages/auto-release-collection/src/utils.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ export function getVersionContent(version: string, markdown: string) {
2727
* @param {string} prefixDesc
2828
* @param {string} suffixDesc
2929
*/
30-
export function getProjectDesc(project: SubmoduleItem, tag: string, prefixDesc: string, suffixDesc: string) {
30+
export function getProjectDesc(project: string, tag: string, prefixDesc: string, suffixDesc: string) {
3131
return [
32-
`${prefixDesc} [${tag}](https://github.com/Tencent/${project}/releases/tag/${tag})`,
33-
`${suffixDesc} https://github.com/Tencent/${project}/releases/tag/${tag}`,
32+
`${prefixDesc} [${tag}](https://github.com/${project}/releases/tag/${tag})`,
33+
`${suffixDesc} https://github.com/${project}/releases/tag/${tag}`,
3434
];
3535
}
3636

@@ -65,8 +65,8 @@ export function getReleaseData() {
6565
let tagDay = today.getDate();
6666
console.log('today', tagDay);
6767

68-
const tagYear = (today.getMonth() === 0 && today.getDate() === 1) ? today.getFullYear() - 1 : today.getFullYear();
69-
const tagMonth = (today.getMonth() === 0 && tagDay === 1) ? 12 : today.getMonth() + (tagDay === 1 ? 0 : 1);
68+
const tagYear = today.getMonth() === 0 && today.getDate() === 1 ? today.getFullYear() - 1 : today.getFullYear();
69+
const tagMonth = today.getMonth() === 0 && tagDay === 1 ? 12 : today.getMonth() + (tagDay === 1 ? 0 : 1);
7070

7171
const monthShort = new Date(tagYear, tagMonth - 1).toLocaleString('en-US', { month: 'short' });
7272

0 commit comments

Comments
 (0)