@alleyinteractive/changelog-extractor 0.3.0 → 0.4.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/README.md +16 -4
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/cli.js +35 -9
- package/src/parser.js +3 -2
package/README.md
CHANGED
|
@@ -21,8 +21,6 @@ as both a **GitHub Action** and a **CLI tool**.
|
|
|
21
21
|
|
|
22
22
|
#### Extract All Versions
|
|
23
23
|
|
|
24
|
-
### Extract All Versions
|
|
25
|
-
|
|
26
24
|
By default, the action returns all versions in the changelog:
|
|
27
25
|
|
|
28
26
|
```yaml
|
|
@@ -36,7 +34,7 @@ By default, the action returns all versions in the changelog:
|
|
|
36
34
|
echo '${{ fromJson(steps.changelog.outputs.result)[0].contents }}'
|
|
37
35
|
```
|
|
38
36
|
|
|
39
|
-
|
|
37
|
+
#### Extract Specific Version
|
|
40
38
|
|
|
41
39
|
```yaml
|
|
42
40
|
- name: Extract v1.14.0 Changelog
|
|
@@ -47,7 +45,7 @@ By default, the action returns all versions in the changelog:
|
|
|
47
45
|
version: '1.14.0' # or 'v1.14.0'
|
|
48
46
|
```
|
|
49
47
|
|
|
50
|
-
|
|
48
|
+
#### Create Release from Latest Version
|
|
51
49
|
|
|
52
50
|
```yaml
|
|
53
51
|
name: Release
|
|
@@ -141,6 +139,20 @@ npm install -g @alleyinteractive/changelog-extractor
|
|
|
141
139
|
changelog-extractor
|
|
142
140
|
```
|
|
143
141
|
|
|
142
|
+
By default, the CLI outputs JSON to stdout. You can also specify other output
|
|
143
|
+
formats using the `--format` option:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
# JSON output (default)
|
|
147
|
+
npx @alleyinteractive/changelog-extractor --format json
|
|
148
|
+
|
|
149
|
+
# Pretty-printed dump
|
|
150
|
+
npx @alleyinteractive/changelog-extractor --format dump
|
|
151
|
+
|
|
152
|
+
# Plain text output
|
|
153
|
+
npx @alleyinteractive/changelog-extractor --format text
|
|
154
|
+
```
|
|
155
|
+
|
|
144
156
|
## Supported Changelog Format
|
|
145
157
|
|
|
146
158
|
This action parses changelogs following the
|
package/dist/index.js
CHANGED
|
@@ -27342,8 +27342,9 @@ function parseChangelog(changelogContent, version = null) {
|
|
|
27342
27342
|
let currentSectionContent = [];
|
|
27343
27343
|
let generalContent = []; // Content without section headers
|
|
27344
27344
|
|
|
27345
|
-
// Regex to match version headers: ## v1.14.0
|
|
27346
|
-
const versionRegex =
|
|
27345
|
+
// Regex to match version headers: ## v1.14.0, ## [1.14.0] - 2024-04-29, or ## 2024-04-29
|
|
27346
|
+
const versionRegex =
|
|
27347
|
+
/^##\s+\[?v?(\d+\.\d+\.\d+(?:-[^\s\]]+)?|\d{4}-\d{2}-\d{2})\]?\s*(?:-\s*(.*))?$/;
|
|
27347
27348
|
// Regex to match section headers: ### Added, ### Changed, etc.
|
|
27348
27349
|
const sectionRegex = /^###\s+(.+)$/;
|
|
27349
27350
|
|