@visualon/gitea-releaser 1.2.0 → 2.0.1
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/package.json +8 -7
- package/src/changelog/util.js +26 -13
- package/src/index.js +1 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visualon/gitea-releaser",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"gitea",
|
|
6
6
|
"forgejo",
|
|
@@ -28,26 +28,27 @@
|
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"clipanion": "4.0.0-rc.4",
|
|
31
|
-
"conventional-changelog
|
|
32
|
-
"conventional-changelog-
|
|
31
|
+
"conventional-changelog": "7.1.1",
|
|
32
|
+
"conventional-changelog-conventionalcommits": "9.1.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@containerbase/semantic-release-pnpm": "1.2.6",
|
|
36
|
-
"@types/
|
|
36
|
+
"@types/node": "22.13.14",
|
|
37
37
|
"husky": "9.1.7",
|
|
38
|
-
"lint-staged": "
|
|
38
|
+
"lint-staged": "16.2.4",
|
|
39
39
|
"markdownlint-cli2": "0.18.1",
|
|
40
40
|
"prettier": "3.6.2",
|
|
41
41
|
"prettier-plugin-packagejson": "2.5.19",
|
|
42
42
|
"semantic-release": "24.2.9"
|
|
43
43
|
},
|
|
44
44
|
"engines": {
|
|
45
|
-
"node": "^
|
|
45
|
+
"node": "^22.11.0 || ^24.10.0",
|
|
46
46
|
"pnpm": "^10.0.0"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
49
|
"lint:prettier": "prettier --cache --check --ignore-unknown .",
|
|
50
50
|
"prettier:fix": "prettier --cache --write --ignore-unknown .",
|
|
51
|
-
"start": "node src/index.js"
|
|
51
|
+
"start": "node src/index.js",
|
|
52
|
+
"test": "node --test test/**/*.js"
|
|
52
53
|
}
|
|
53
54
|
}
|
package/src/changelog/util.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import conventionalChangelogPreset from 'conventional-changelog-conventionalcommits';
|
|
2
|
-
import
|
|
2
|
+
import { ConventionalChangelog } from 'conventional-changelog';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* @type {import('conventional-changelog
|
|
5
|
+
* @type {import('conventional-changelog').Preset}
|
|
6
6
|
*/
|
|
7
7
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call
|
|
8
8
|
export const config = conventionalChangelogPreset({
|
|
@@ -59,15 +59,28 @@ export const config = conventionalChangelogPreset({
|
|
|
59
59
|
* @param {boolean|undefined} onTag
|
|
60
60
|
* @returns
|
|
61
61
|
*/
|
|
62
|
-
export function getChangelog(onTag = false) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
62
|
+
export async function getChangelog(onTag = false) {
|
|
63
|
+
const generator = new ConventionalChangelog()
|
|
64
|
+
.readPackage()
|
|
65
|
+
.config(config)
|
|
66
|
+
.writer({ headerPartial: '' })
|
|
67
|
+
.options({ releaseCount: onTag ? 2 : 1 });
|
|
68
|
+
|
|
69
|
+
// generator.options({
|
|
70
|
+
// debug(namespace, payload) {
|
|
71
|
+
// console.info(`[${namespace}]:`, payload);
|
|
72
|
+
// },
|
|
73
|
+
// warn(namespace, payload) {
|
|
74
|
+
// console.warn(`[${namespace}]:`, payload);
|
|
75
|
+
// },
|
|
76
|
+
// });
|
|
77
|
+
|
|
78
|
+
/** @type {string[]} */
|
|
79
|
+
const lines = [];
|
|
80
|
+
|
|
81
|
+
for await (const line of generator.write()) {
|
|
82
|
+
lines.push(line);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return lines.join('');
|
|
73
86
|
}
|
package/src/index.js
CHANGED
|
@@ -50,8 +50,7 @@ class GiteaReleaseCommand extends Command {
|
|
|
50
50
|
return 1;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
const
|
|
54
|
-
const changes = (await stream.toArray()).join('');
|
|
53
|
+
const changes = await getChangelog(true);
|
|
55
54
|
|
|
56
55
|
this.context.stdout.write(`Creating release ${tag}.\n`);
|
|
57
56
|
resp = await fetch(`${api}/repos/${repo}/releases`, {
|