@soybeanjs/changelog 0.4.3 → 0.4.4
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.
- package/README.md +2 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.js +5 -11
- package/package.json +31 -30
package/README.md
CHANGED
|
@@ -15,8 +15,8 @@ import {
|
|
|
15
15
|
getChangelogMarkdown,
|
|
16
16
|
getTotalChangelogMarkdown,
|
|
17
17
|
generateChangelog,
|
|
18
|
-
generateTotalChangelog
|
|
19
|
-
} from
|
|
18
|
+
generateTotalChangelog
|
|
19
|
+
} from '@soybeanjs/changelog';
|
|
20
20
|
|
|
21
21
|
// get the changelog markdown by two git tags
|
|
22
22
|
getChangelogMarkdown();
|
package/dist/index.d.ts
CHANGED
|
@@ -89,8 +89,7 @@ interface ChangelogOption {
|
|
|
89
89
|
emoji: boolean;
|
|
90
90
|
/** The section titles */
|
|
91
91
|
titles: {
|
|
92
|
-
/** The title of breaking changes section */
|
|
93
|
-
breakingChanges: string;
|
|
92
|
+
/** The title of breaking changes section */breakingChanges: string;
|
|
94
93
|
};
|
|
95
94
|
/** The output file path of the changelog */
|
|
96
95
|
output: string;
|
package/dist/index.js
CHANGED
|
@@ -222,26 +222,20 @@ function getHeaders(githubToken) {
|
|
|
222
222
|
};
|
|
223
223
|
}
|
|
224
224
|
async function getResolvedAuthorLogin(github, commitHashes, email) {
|
|
225
|
+
const { repo, token } = github;
|
|
225
226
|
let login = "";
|
|
227
|
+
if (!token) return login;
|
|
226
228
|
try {
|
|
227
|
-
login = (await ofetch(`https://
|
|
229
|
+
login = (await ofetch(`https://api.github.com/search/users?q=${encodeURIComponent(email)}`, { headers: getHeaders(token) })).items[0].login;
|
|
228
230
|
} catch (e) {
|
|
229
231
|
consola.log("e: ", e);
|
|
230
232
|
}
|
|
231
233
|
if (login) return login;
|
|
232
|
-
const { repo, token } = github;
|
|
233
|
-
if (!token) return login;
|
|
234
234
|
if (commitHashes.length) try {
|
|
235
235
|
login = (await ofetch(`https://api.github.com/repos/${repo}/commits/${commitHashes[0]}`, { headers: getHeaders(token) }))?.author?.login || "";
|
|
236
236
|
} catch (e) {
|
|
237
237
|
consola.log("e: ", e);
|
|
238
238
|
}
|
|
239
|
-
if (login) return login;
|
|
240
|
-
try {
|
|
241
|
-
login = (await ofetch(`https://api.github.com/search/users?q=${encodeURIComponent(email)}`, { headers: getHeaders(token) })).items[0].login;
|
|
242
|
-
} catch (e) {
|
|
243
|
-
consola.log("e: ", e);
|
|
244
|
-
}
|
|
245
239
|
return login;
|
|
246
240
|
}
|
|
247
241
|
async function getGitCommitsAndResolvedAuthors(commits, github, resolvedLogins) {
|
|
@@ -526,8 +520,8 @@ async function getTotalChangelogMarkdown(options, showProgress = true) {
|
|
|
526
520
|
if (showProgress) bar = new SingleBar({ format: "generate total changelog: [{bar}] {percentage}% | ETA: {eta}s | {value}/{total}" }, Presets.shades_classic);
|
|
527
521
|
const tags = getFromToTags(opts.tags);
|
|
528
522
|
if (tags.length === 0) {
|
|
529
|
-
const { markdown
|
|
530
|
-
return markdown
|
|
523
|
+
const { markdown } = await getChangelogMarkdown(opts);
|
|
524
|
+
return markdown;
|
|
531
525
|
}
|
|
532
526
|
bar?.start(tags.length, 0);
|
|
533
527
|
let markdown = "";
|
package/package.json
CHANGED
|
@@ -1,25 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soybeanjs/changelog",
|
|
3
|
-
"
|
|
4
|
-
"version": "0.4.3",
|
|
3
|
+
"version": "0.4.4",
|
|
5
4
|
"description": "generate changelog form git tags and commits for github",
|
|
5
|
+
"homepage": "https://github.com/soybeanjs/changelog",
|
|
6
|
+
"bugs": {
|
|
7
|
+
"url": "https://github.com/soybeanjs/changelog/issues"
|
|
8
|
+
},
|
|
9
|
+
"license": "MIT",
|
|
6
10
|
"author": {
|
|
7
11
|
"name": "Soybean",
|
|
8
12
|
"email": "soybeanjs@outlook.com",
|
|
9
13
|
"url": "https://github.com/soybeanjs"
|
|
10
14
|
},
|
|
11
|
-
"license": "MIT",
|
|
12
|
-
"homepage": "https://github.com/soybeanjs/changelog",
|
|
13
15
|
"repository": {
|
|
14
16
|
"url": "https://github.com/soybeanjs/changelog.git"
|
|
15
17
|
},
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
"
|
|
20
|
-
"registry": "https://registry.npmjs.org/"
|
|
21
|
-
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist"
|
|
20
|
+
],
|
|
21
|
+
"type": "module",
|
|
22
22
|
"sideEffects": false,
|
|
23
|
+
"main": "./dist/index.js",
|
|
24
|
+
"module": "./dist/index.js",
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
23
26
|
"exports": {
|
|
24
27
|
".": {
|
|
25
28
|
"types": "./dist/index.d.ts",
|
|
@@ -27,34 +30,27 @@
|
|
|
27
30
|
"require": "./dist/index.js"
|
|
28
31
|
}
|
|
29
32
|
},
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
"types": "./dist/index.d.ts",
|
|
33
|
-
"files": [
|
|
34
|
-
"dist"
|
|
35
|
-
],
|
|
36
|
-
"engines": {
|
|
37
|
-
"node": ">=18",
|
|
38
|
-
"pnpm": ">=9"
|
|
33
|
+
"publishConfig": {
|
|
34
|
+
"registry": "https://registry.npmjs.org/"
|
|
39
35
|
},
|
|
40
36
|
"dependencies": {
|
|
41
|
-
"@soybeanjs/eslint-config": "1.7.5",
|
|
42
37
|
"cli-progress": "3.12.0",
|
|
43
38
|
"convert-gitmoji": "0.1.5",
|
|
44
|
-
"dayjs": "1.11.
|
|
39
|
+
"dayjs": "1.11.20",
|
|
45
40
|
"execa": "9.6.1",
|
|
46
41
|
"ofetch": "1.5.1",
|
|
47
|
-
"semver": "7.7.
|
|
42
|
+
"semver": "7.7.4"
|
|
48
43
|
},
|
|
49
44
|
"devDependencies": {
|
|
50
|
-
"@soybeanjs/cli": "1.
|
|
45
|
+
"@soybeanjs/cli": "1.6.1",
|
|
51
46
|
"@types/cli-progress": "3.11.6",
|
|
52
|
-
"@types/node": "25.0
|
|
47
|
+
"@types/node": "25.5.0",
|
|
53
48
|
"@types/semver": "7.7.1",
|
|
54
|
-
"
|
|
55
|
-
"
|
|
49
|
+
"lint-staged": "16.4.0",
|
|
50
|
+
"oxfmt": "^0.41.0",
|
|
51
|
+
"oxlint": "^1.56.0",
|
|
56
52
|
"simple-git-hooks": "2.13.1",
|
|
57
|
-
"tsdown": "0.
|
|
53
|
+
"tsdown": "0.21.4",
|
|
58
54
|
"tsx": "4.21.0",
|
|
59
55
|
"typescript": "5.9.3"
|
|
60
56
|
},
|
|
@@ -63,17 +59,22 @@
|
|
|
63
59
|
"pre-commit": "pnpm typecheck && pnpm lint-staged"
|
|
64
60
|
},
|
|
65
61
|
"lint-staged": {
|
|
66
|
-
"*": "
|
|
62
|
+
"*": "oxlint --fix && oxfmt"
|
|
63
|
+
},
|
|
64
|
+
"engines": {
|
|
65
|
+
"node": ">=18",
|
|
66
|
+
"pnpm": ">=9"
|
|
67
67
|
},
|
|
68
68
|
"scripts": {
|
|
69
69
|
"build": "tsdown && pnpm build-pkg",
|
|
70
70
|
"build-pkg": "pnpm -r --filter='./packages/*' run build",
|
|
71
71
|
"cleanup": "soy cleanup",
|
|
72
72
|
"commit": "soy git-commit",
|
|
73
|
-
"
|
|
73
|
+
"fmt": "oxfmt",
|
|
74
|
+
"lint": "oxlint --fix",
|
|
74
75
|
"publish-pkg": "pnpm -r publish --access public",
|
|
75
76
|
"release": "soy release",
|
|
76
77
|
"typecheck": "tsc --noEmit --skipLibCheck",
|
|
77
|
-
"
|
|
78
|
+
"upkg": "soy ncu"
|
|
78
79
|
}
|
|
79
80
|
}
|