diff --git a/.dumi/theme/common/ComponentChangelog/ComponentChangelog.tsx b/.dumi/theme/common/ComponentChangelog/ComponentChangelog.tsx
index 26cf85cadc..32d05d513f 100644
--- a/.dumi/theme/common/ComponentChangelog/ComponentChangelog.tsx
+++ b/.dumi/theme/common/ComponentChangelog/ComponentChangelog.tsx
@@ -20,6 +20,7 @@ interface ChangelogInfo {
version: string;
changelog: string;
refs: string[];
+ contributors: string[];
releaseDate: string;
}
@@ -160,14 +161,30 @@ const ParseChangelog: React.FC<{ changelog: string }> = (props) => {
return {parsedChangelog};
};
-const RefLinks: React.FC<{ refs: string[] }> = ({ refs }) => {
+const RefLinks: React.FC<{ refs: string[]; contributors: string[] }> = ({ refs, contributors }) => {
const { styles } = useStyle();
+
return (
<>
{refs?.map((ref) => (
-
- #{ref.match(/[^/]+$/)?.[0]}
-
+
+
+ #{ref.match(/[^/]+$/)?.[0]}
+
+
+ ))}
+ {contributors?.map((contributor) => (
+
+
+ @{contributor}
+
+
))}
>
);
@@ -178,7 +195,7 @@ const RenderChangelogList: React.FC<{ changelogList: ChangelogInfo[] }> = ({ cha
const { styles } = useStyle();
const len = changelogList.length;
for (let i = 0; i < len; i += 1) {
- const { refs, changelog } = changelogList[i];
+ const { refs, changelog, contributors } = changelogList[i];
// Check if the next line is an image link and append it to the current line
if (i + 1 < len && changelogList[i + 1].changelog.trim().startsWith(' = ({ cha
elements.push(
-
+
= ({ cha
elements.push(
-
+
,
);
}
diff --git a/scripts/generate-component-changelog.ts b/scripts/generate-component-changelog.ts
index ec0cc8f04f..e1d615dc06 100644
--- a/scripts/generate-component-changelog.ts
+++ b/scripts/generate-component-changelog.ts
@@ -101,7 +101,13 @@ const miscKeys = [
// Changelog map
const componentChangelog: Record<
string,
- { version: string; changelog: string; refs: string[]; releaseDate: string }[]
+ {
+ version: string;
+ changelog: string;
+ refs: string[];
+ releaseDate: string;
+ contributors: string[];
+ }[]
> = {};
Object.keys(componentNameMap).forEach((name) => {
componentChangelog[name] = [];
@@ -127,6 +133,20 @@ const miscKeys = [
lastReleaseDate = matchReleaseDate[1];
}
+ // Get Contributor name
+ const contributors: string[] = [];
+ const usernameMatches = line.match(/\[@([^\]]+)\]/g);
+
+ if (usernameMatches) {
+ usernameMatches.forEach((match) => {
+ const usernameMatch = match.match(/\[@([^\]]+)\]/);
+ if (usernameMatch) {
+ const username = usernameMatch[1];
+ contributors.push(username);
+ }
+ });
+ }
+
// Start when get version
if (!lastVersion) {
continue;
@@ -184,6 +204,7 @@ const miscKeys = [
changelog: changelogLine,
refs,
releaseDate: lastReleaseDate,
+ contributors,
});
matched = true;
}