@modern-js/plugin-changeset 2.21.2-alpha.1 → 2.21.2-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -77,15 +77,15 @@ function getReleaseInfo(commit, commitObj) {
|
|
|
77
77
|
}
|
|
78
78
|
function getReleaseNoteLine(commit, customReleaseNoteFunction, lang = "en") {
|
|
79
79
|
if (customReleaseNoteFunction === null || customReleaseNoteFunction === void 0 ? void 0 : customReleaseNoteFunction.getReleaseNoteLine) {
|
|
80
|
-
return customReleaseNoteFunction.getReleaseNoteLine(commit);
|
|
80
|
+
return customReleaseNoteFunction.getReleaseNoteLine(commit, lang);
|
|
81
81
|
}
|
|
82
82
|
const { repository, pullRequestId, summary, summary_zh, author } = commit;
|
|
83
|
-
const pullRequest = pullRequestId ? `https://github.com/${repository}/pull/${pullRequestId}` : "";
|
|
83
|
+
const pullRequest = pullRequestId && repository ? `https://github.com/${repository}/pull/${pullRequestId}` : "";
|
|
84
84
|
if (lang === "en") {
|
|
85
|
-
return `- ${summary} by @${author}${pullRequest ? ` in ${pullRequest}` : ""}
|
|
85
|
+
return `- ${summary}${author ? ` by @${author}` : ""}${pullRequest ? ` in ${pullRequest}` : ""}
|
|
86
86
|
`;
|
|
87
87
|
}
|
|
88
|
-
return `- ${summary_zh} 由 @${author}
|
|
88
|
+
return `- ${summary_zh}${author ? ` 由 @${author} 实现` : ""}${pullRequest ? `, 详情可查看 ${pullRequest}` : ""}
|
|
89
89
|
`;
|
|
90
90
|
}
|
|
91
91
|
async function genReleaseNote(options) {
|
|
@@ -54,15 +54,15 @@ export function getReleaseInfo(commit, commitObj) {
|
|
|
54
54
|
}
|
|
55
55
|
export function getReleaseNoteLine(commit, customReleaseNoteFunction, lang = "en") {
|
|
56
56
|
if (customReleaseNoteFunction === null || customReleaseNoteFunction === void 0 ? void 0 : customReleaseNoteFunction.getReleaseNoteLine) {
|
|
57
|
-
return customReleaseNoteFunction.getReleaseNoteLine(commit);
|
|
57
|
+
return customReleaseNoteFunction.getReleaseNoteLine(commit, lang);
|
|
58
58
|
}
|
|
59
59
|
const { repository, pullRequestId, summary, summary_zh, author } = commit;
|
|
60
|
-
const pullRequest = pullRequestId ? `https://github.com/${repository}/pull/${pullRequestId}` : "";
|
|
60
|
+
const pullRequest = pullRequestId && repository ? `https://github.com/${repository}/pull/${pullRequestId}` : "";
|
|
61
61
|
if (lang === "en") {
|
|
62
|
-
return `- ${summary} by @${author}${pullRequest ? ` in ${pullRequest}` : ""}
|
|
62
|
+
return `- ${summary}${author ? ` by @${author}` : ""}${pullRequest ? ` in ${pullRequest}` : ""}
|
|
63
63
|
`;
|
|
64
64
|
}
|
|
65
|
-
return `- ${summary_zh} 由 @${author}
|
|
65
|
+
return `- ${summary_zh}${author ? ` 由 @${author} 实现` : ""}${pullRequest ? `, 详情可查看 ${pullRequest}` : ""}
|
|
66
66
|
`;
|
|
67
67
|
}
|
|
68
68
|
export async function genReleaseNote(options) {
|
|
@@ -27,7 +27,7 @@ interface ReleaseNoteOptions {
|
|
|
27
27
|
}
|
|
28
28
|
export type CustomReleaseNoteFunction = {
|
|
29
29
|
getReleaseInfo?: (commit: string, commitObj: Commit) => Commit | Promise<Commit>;
|
|
30
|
-
getReleaseNoteLine?: (commit: Commit) => string | Promise<string>;
|
|
30
|
+
getReleaseNoteLine?: (commit: Commit, lang?: 'en' | 'zh') => string | Promise<string>;
|
|
31
31
|
} | undefined;
|
|
32
32
|
export declare const ChangesTitle = "What's Changed";
|
|
33
33
|
export declare const ChangesZhTitle = "\u66F4\u65B0\u5185\u5BB9";
|