changelog-tool 1.0.1 → 1.2.0
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/changelog.md +9 -0
- package/cli.mjs +12 -5
- package/package.json +2 -2
package/changelog.md
CHANGED
@@ -1,6 +1,15 @@
|
|
1
1
|
Changelog
|
2
2
|
=========
|
3
3
|
|
4
|
+
1.2.0 (2025-05-12)
|
5
|
+
------------------
|
6
|
+
|
7
|
+
* Added `--force` flag, which ignores errors when calling changelog release.
|
8
|
+
|
9
|
+
Note: v1.1.0 was skipped. A few years ago this version was accidentally
|
10
|
+
published on NPM so we need to skip it.
|
11
|
+
|
12
|
+
|
4
13
|
1.0.1 (2023-06-30)
|
5
14
|
------------------
|
6
15
|
|
package/cli.mjs
CHANGED
@@ -6,7 +6,6 @@ import * as url from 'node:url';
|
|
6
6
|
import { readPackageVersion, exists, calculateNextVersion, isGit, isGitClean, runCommand } from './util.mjs';
|
7
7
|
import { Changelog, VersionLog, LogItem } from './changelog.mjs';
|
8
8
|
import { parseFile } from './parse.mjs';
|
9
|
-
import { execSync } from 'node:child_process';
|
10
9
|
|
11
10
|
const filename = 'changelog.md';
|
12
11
|
|
@@ -52,7 +51,11 @@ async function main() {
|
|
52
51
|
nowrap: {
|
53
52
|
type: 'boolean',
|
54
53
|
description: 'Don\'t wrap "show" output'
|
55
|
-
}
|
54
|
+
},
|
55
|
+
force: {
|
56
|
+
type: 'boolean',
|
57
|
+
description: 'Ignore some errors and try anyway.',
|
58
|
+
},
|
56
59
|
},
|
57
60
|
allowPositionals: true,
|
58
61
|
});
|
@@ -241,7 +244,7 @@ async function add({message, changeType}) {
|
|
241
244
|
console.log(`${changelog.versions.length} changelogs saved to ${filename}`);
|
242
245
|
}
|
243
246
|
|
244
|
-
async function release() {
|
247
|
+
async function release(force = false) {
|
245
248
|
const changelog = await parseChangelog();
|
246
249
|
|
247
250
|
let lastVersion = changelog.versions[0];
|
@@ -254,8 +257,12 @@ async function release() {
|
|
254
257
|
const useGit = await isGit();
|
255
258
|
|
256
259
|
if (useGit) {
|
257
|
-
if (!
|
258
|
-
|
260
|
+
if (!isGitClean()) {
|
261
|
+
if (force) {
|
262
|
+
console.warn('Warning: Git working directory is not clean. Ignoring.');
|
263
|
+
} else {
|
264
|
+
throw new Error('Current git working directory is not clean. Please commit your changes first');
|
265
|
+
}
|
259
266
|
}
|
260
267
|
}
|
261
268
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "changelog-tool",
|
3
|
-
"version": "1.0
|
3
|
+
"version": "1.2.0",
|
4
4
|
"description": "A CLI tool for manipulating changelogs",
|
5
5
|
"type": "module",
|
6
6
|
"main": "index.mjs",
|
@@ -27,6 +27,6 @@
|
|
27
27
|
},
|
28
28
|
"devDependencies": {
|
29
29
|
"@types/node": "^18.11.19",
|
30
|
-
"typescript": "^
|
30
|
+
"typescript": "^5.8.3"
|
31
31
|
}
|
32
32
|
}
|