changelog-tool 1.0.0 → 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 +17 -2
- package/cli.mjs +12 -5
- package/package.json +2 -4
- package/parse.mjs +1 -1
- package/test/parse.mjs +6 -1
package/changelog.md
CHANGED
@@ -1,6 +1,21 @@
|
|
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
|
+
|
13
|
+
1.0.1 (2023-06-30)
|
14
|
+
------------------
|
15
|
+
|
16
|
+
* Fix bug in parsing link references with more than 1 character
|
17
|
+
|
18
|
+
|
4
19
|
1.0.0 (2023-06-20)
|
5
20
|
------------------
|
6
21
|
|
@@ -88,5 +103,5 @@ First stable release! Just kidding, it was already stable.
|
|
88
103
|
|
89
104
|
* Implemented the 'help' and 'init' commands
|
90
105
|
|
91
|
-
[1]: https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#link
|
92
|
-
|
106
|
+
[1]: https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#link
|
107
|
+
"Markdown cheatsheet: Links"
|
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.
|
3
|
+
"version": "1.2.0",
|
4
4
|
"description": "A CLI tool for manipulating changelogs",
|
5
5
|
"type": "module",
|
6
6
|
"main": "index.mjs",
|
@@ -19,8 +19,6 @@
|
|
19
19
|
"changelog",
|
20
20
|
"markdown"
|
21
21
|
],
|
22
|
-
"author": "Evert Pot (https://evertpot.com/)",
|
23
|
-
"license": "MIT",
|
24
22
|
"engine": {
|
25
23
|
"node": ">16"
|
26
24
|
},
|
@@ -29,6 +27,6 @@
|
|
29
27
|
},
|
30
28
|
"devDependencies": {
|
31
29
|
"@types/node": "^18.11.19",
|
32
|
-
"typescript": "^
|
30
|
+
"typescript": "^5.8.3"
|
33
31
|
}
|
34
32
|
}
|
package/parse.mjs
CHANGED
@@ -14,7 +14,7 @@ export async function parseFile(filename) {
|
|
14
14
|
|
15
15
|
}
|
16
16
|
|
17
|
-
const linkReferenceRe = /^\[([a-zA-Z0-9])
|
17
|
+
const linkReferenceRe = /^\[([a-zA-Z0-9]+)\]:/;
|
18
18
|
const versionRe = /^([0-9\.]{3,}(?:-(?:alpha|beta)\.[0-9]+)?) \(([0-9]{4}-[0-9]{2}-[0-9]{2}|\?\?\?\?-\?\?-\?\?)\)$/;
|
19
19
|
|
20
20
|
|
package/test/parse.mjs
CHANGED
@@ -116,9 +116,9 @@ Here's another line.
|
|
116
116
|
[1]: https://evertpot.com/ "My Blog"
|
117
117
|
[2]: https://indieweb.social/@evert "My Mastodon account, but it's split
|
118
118
|
over two lines"
|
119
|
+
[blabla]: http://example
|
119
120
|
`;
|
120
121
|
|
121
|
-
debugger;
|
122
122
|
const result = await parse(input);
|
123
123
|
|
124
124
|
assert.deepEqual({
|
@@ -131,5 +131,10 @@ Here's another line.
|
|
131
131
|
href: 'https://indieweb.social/@evert',
|
132
132
|
title: 'My Mastodon account, but it\'s split over two lines',
|
133
133
|
}, result.links[1]);
|
134
|
+
assert.deepEqual({
|
135
|
+
name: 'blabla',
|
136
|
+
href: 'http://example',
|
137
|
+
title: null,
|
138
|
+
}, result.links[2]);
|
134
139
|
|
135
140
|
});
|