@modern-js/plugin-changeset 2.22.1-beta.2 → 2.22.1-beta.3
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.
|
@@ -84,16 +84,16 @@ function getCommitType(message) {
|
|
|
84
84
|
return CommitType.Other;
|
|
85
85
|
}
|
|
86
86
|
const AuthorMap = /* @__PURE__ */ new Map();
|
|
87
|
-
async function getReleaseInfo(commit, commitObj, authToken) {
|
|
87
|
+
async function getReleaseInfo(commit, commitObj, repo, authToken) {
|
|
88
88
|
const commitRegex = /(.*)\(#(\d*)\)/;
|
|
89
89
|
const [commitId, message, email] = commit.split("--");
|
|
90
90
|
const author = AuthorMap.get(email);
|
|
91
91
|
const token = authToken || process.env.GITHUB_AUTH_TOKEN;
|
|
92
92
|
if (author) {
|
|
93
93
|
commitObj.author = author;
|
|
94
|
-
} else if (token) {
|
|
94
|
+
} else if (repo && token) {
|
|
95
95
|
try {
|
|
96
|
-
const res = await _axios.default.get(`https://api.github.com/repos/
|
|
96
|
+
const res = await _axios.default.get(`https://api.github.com/repos/${repo}/commits/${commitId}`, {
|
|
97
97
|
method: "GET",
|
|
98
98
|
headers: {
|
|
99
99
|
"Content-Type": "application/json",
|
|
@@ -195,7 +195,7 @@ async function genReleaseNote(options) {
|
|
|
195
195
|
if (customReleaseNoteFunction === null || customReleaseNoteFunction === void 0 ? void 0 : customReleaseNoteFunction.getReleaseInfo) {
|
|
196
196
|
commitObj = await customReleaseNoteFunction.getReleaseInfo(stdout, commitObj);
|
|
197
197
|
} else {
|
|
198
|
-
commitObj = await getReleaseInfo(stdout, commitObj, options.authToken);
|
|
198
|
+
commitObj = await getReleaseInfo(stdout, commitObj, options.repo, options.authToken);
|
|
199
199
|
}
|
|
200
200
|
releaseNote[commitObj.type].en.push(commitObj);
|
|
201
201
|
if (commitObj.summary_zh) {
|
|
@@ -43,16 +43,16 @@ export function getCommitType(message) {
|
|
|
43
43
|
return CommitType.Other;
|
|
44
44
|
}
|
|
45
45
|
const AuthorMap = /* @__PURE__ */ new Map();
|
|
46
|
-
export async function getReleaseInfo(commit, commitObj, authToken) {
|
|
46
|
+
export async function getReleaseInfo(commit, commitObj, repo, authToken) {
|
|
47
47
|
const commitRegex = /(.*)\(#(\d*)\)/;
|
|
48
48
|
const [commitId, message, email] = commit.split("--");
|
|
49
49
|
const author = AuthorMap.get(email);
|
|
50
50
|
const token = authToken || process.env.GITHUB_AUTH_TOKEN;
|
|
51
51
|
if (author) {
|
|
52
52
|
commitObj.author = author;
|
|
53
|
-
} else if (token) {
|
|
53
|
+
} else if (repo && token) {
|
|
54
54
|
try {
|
|
55
|
-
const res = await axios.get(`https://api.github.com/repos/
|
|
55
|
+
const res = await axios.get(`https://api.github.com/repos/${repo}/commits/${commitId}`, {
|
|
56
56
|
method: "GET",
|
|
57
57
|
headers: {
|
|
58
58
|
"Content-Type": "application/json",
|
|
@@ -154,7 +154,7 @@ export async function genReleaseNote(options) {
|
|
|
154
154
|
if (customReleaseNoteFunction === null || customReleaseNoteFunction === void 0 ? void 0 : customReleaseNoteFunction.getReleaseInfo) {
|
|
155
155
|
commitObj = await customReleaseNoteFunction.getReleaseInfo(stdout, commitObj);
|
|
156
156
|
} else {
|
|
157
|
-
commitObj = await getReleaseInfo(stdout, commitObj, options.authToken);
|
|
157
|
+
commitObj = await getReleaseInfo(stdout, commitObj, options.repo, options.authToken);
|
|
158
158
|
}
|
|
159
159
|
releaseNote[commitObj.type].en.push(commitObj);
|
|
160
160
|
if (commitObj.summary_zh) {
|
|
@@ -47,7 +47,7 @@ export declare const CommitTypeZhTitle: {
|
|
|
47
47
|
other: string;
|
|
48
48
|
};
|
|
49
49
|
export declare function getCommitType(message: string): CommitType;
|
|
50
|
-
export declare function getReleaseInfo(commit: string, commitObj: Commit, authToken?: string): Promise<Commit>;
|
|
50
|
+
export declare function getReleaseInfo(commit: string, commitObj: Commit, repo?: string, authToken?: string): Promise<Commit>;
|
|
51
51
|
export declare function getReleaseNoteLine(commit: Commit, customReleaseNoteFunction?: CustomReleaseNoteFunction, lang?: 'en' | 'zh'): string | Promise<string>;
|
|
52
52
|
export declare function genReleaseNote(options: ReleaseNoteOptions): Promise<string>;
|
|
53
53
|
export {};
|