You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- README: example and output cover every visible parser case (verified)
- CHANGELOG: simplify preamble
- CONTRIBUTING: rewrite (code of conduct, contribution types)
- LICENSE: extend copyright year
Contributions welcome! Please check past issues and pull requests before you open your own issue or pull request to avoid duplicating a frequently asked question.
3
+
## Code of Conduct
4
4
5
-
In addition to improving the project, refactoring code, and implementing features, this project welcomes the following types of contributions:
5
+
This project is intended to be a safe, welcoming space for collaboration.
6
6
7
-
-**Ideas**: participate in an issue thread or start your own to have your voice heard.
8
-
-**Writing**: contribute your expertise in an area by helping expand the included content.
9
-
-**Copy editing**: fix typos, clarify language, and generally improve the quality of the content.
10
-
-**Formatting**: help keep content easy to read with consistent formatting.
11
-
12
-
## Install
13
-
14
-
Fork and clone the repo, then `npm install` to install all dependencies.
15
-
16
-
## Testing
17
-
18
-
Tests are run with `npm test`. Please ensure all tests are passing before submitting a pull request (unless you're creating a failing test to increase test coverage or show a problem).
19
-
20
-
## Code Style
21
-
22
-
This repository uses [Biome](https://biomejs.dev/) for linting and formatting. `npm test` runs the linter, and `npm run format` applies fixes and formatting for you.
7
+
All contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
23
8
24
-
---
9
+
Thank you for being kind to each other!
25
10
26
-
#Collaborating Guidelines
11
+
## Contributions welcome!
27
12
28
-
**This is an OPEN Open Source Project.**
13
+
**Before spending lots of time on something, ask for feedback on your idea first!**
29
14
30
-
## What?
15
+
Please search [issues](../../issues/) and [pull requests](../../pulls/) before adding something new! This helps avoid duplicating efforts and conversations.
31
16
32
-
Individuals making significant and valuable contributions are given commit-access to the project to contribute as they see fit. This project is more like an open wiki than a standard guarded open source project.
17
+
This project welcomes any kind of contribution! Here are a few suggestions:
33
18
34
-
## Rules
35
-
36
-
There are a few basic ground-rules for contributors:
37
-
38
-
1.**No `--force` pushes** or modifying the Git history in any way.
39
-
1.**Non-master branches** ought to be used for ongoing work.
40
-
1.**External API changes and significant modifications** ought to be subject to an **internal pull-request** to solicit feedback from other contributors.
41
-
1. Internal pull-requests to solicit feedback are *encouraged* for any other non-trivial contribution but left to the discretion of the contributor.
42
-
1. Contributors should attempt to adhere to the prevailing code style.
43
-
44
-
## Releases
45
-
46
-
Declaring formal releases remains the prerogative of the project maintainer.
47
-
48
-
## Changes to this arrangement
49
-
50
-
This is an experiment and feedback is welcome! This document may also be subject to pull-requests or changes by contributors where you believe you have something valuable to add or change.
19
+
-**Ideas**: participate in an issue thread or start your own to have your voice heard.
20
+
-**Writing**: contribute your expertise in an area by helping expand the included content.
21
+
-**Copy editing**: fix typos, clarify language, and generally improve the quality of the content.
22
+
-**Formatting**: help keep content easy to read with consistent formatting.
23
+
-**Code**: help maintain and improve the project codebase.
* A `format` option, documented in [the README](https://example.com).
148
+
* Support for **bold** entries.
155
149
156
-
##v1.3.0
150
+
### Fixed
157
151
158
-
* make it so
152
+
- A crash on empty input.
159
153
160
-
## [1.2.3](link)
161
-
* init
154
+
## 2.0.0 (2024-01-02)
162
155
163
-
[a.b.c]: http://altavista.com
156
+
* Drop support for Node 12.
157
+
158
+
# 1.5.0 - 02.11.2023
159
+
160
+
* An older entry under an H1 heading with a `DD.MM.YYYY` date.
161
+
162
+
## v1.0.0
163
+
164
+
* First stable release.
165
+
166
+
## [0.9.0](https://example.com/releases/0.9.0)
167
+
168
+
* Initial public prototype.
169
+
170
+
[2.1.0]: https://example.com/releases/2.1.0
164
171
```
165
172
166
173
Parsing the above example will return the following object:
167
174
168
175
```js
169
176
{
170
-
title:'changelog title',
171
-
description:'A cool description (optional).',
177
+
title:'Changelog',
178
+
description:'All notable changes to this project are documented in this file.',
172
179
versions: [
173
180
{ version:null,
174
-
title:'unreleased',
181
+
title:'Unreleased',
175
182
date:null,
176
-
body:'* foo',
183
+
body:'* Work in progress.',
177
184
parsed: {
178
185
_: [
179
-
'foo'
186
+
'Work in progress.'
180
187
]
181
188
}
182
189
},
183
-
{ version:'x.y.z',
184
-
title:'x.y.z - YYYY-MM-DD',
185
-
date:null,
186
-
body:'* bar',
190
+
{ version:'2.2.0-beta.1',
191
+
title:'2.2.0-beta.1 - 2024-03-20',
192
+
date:'2024-03-20',
193
+
body:'* Pre-release builds get a version too.',
187
194
parsed: {
188
195
_: [
189
-
'bar'
196
+
'Pre-release builds get a version too.'
190
197
]
191
198
}
192
199
},
193
-
{ version:'a.b.c',
194
-
title:'[a.b.c]',
195
-
date:null,
196
-
body:'### Changes\n\n* Update API\n* Fix bug #1',
200
+
{ version:'2.1.0',
201
+
title:'[2.1.0] - 2024-03-15',
202
+
date:'2024-03-15',
203
+
body:'### Added\n\n* A `format` option, documented in [the README](https://example.com).\n* Support for **bold** entries.\n\n### Fixed\n\n- A crash on empty input.',
197
204
parsed: {
198
205
_: [
199
-
'Update API',
200
-
'Fix bug #1'
206
+
'A format option, documented in the README.',
207
+
'Support for bold entries.',
208
+
'A crash on empty input.'
201
209
],
202
-
Changes: [
203
-
'Update API',
204
-
'Fix bug #1'
210
+
Added: [
211
+
'A format option, documented in the README.',
212
+
'Support for bold entries.'
213
+
],
214
+
Fixed: [
215
+
'A crash on empty input.'
205
216
]
206
217
}
207
218
},
208
-
{ version:'2.2.3-pre.1',
209
-
title:'2.2.3-pre.1 - 2013-02-14',
210
-
date:'2013-02-14',
211
-
body:'* Update API',
219
+
{ version:'2.0.0',
220
+
title:'2.0.0 (2024-01-02)',
221
+
date:'2024-01-02',
222
+
body:'* Drop support for Node 12.',
212
223
parsed: {
213
224
_: [
214
-
'Update API'
225
+
'Drop support for Node 12.'
215
226
]
216
227
}
217
228
},
218
-
{ version:'2.0.0-x.7.z.92',
219
-
title:'2.0.0-x.7.z.92 - 2013-02-14',
220
-
date:'2013-02-14',
221
-
body:'* bark bark\n* woof\n* arf',
229
+
{ version:'1.5.0',
230
+
title:'1.5.0 - 02.11.2023',
231
+
date:'02.11.2023',
232
+
body:'* An older entry under an H1 heading with a `DD.MM.YYYY` date.',
222
233
parsed: {
223
234
_: [
224
-
'bark bark',
225
-
'woof',
226
-
'arf'
235
+
'An older entry under an H1 heading with a DD.MM.YYYY date.'
@@ -253,6 +262,8 @@ Parsing the above example will return the following object:
253
262
254
263
Expects versions to be [semver](http://semver.org/) compliant, otherwise sets `version` to null.
255
264
265
+
Both `#` and `##` headings are treated as versions. The version number is read from the heading whether it is bare (`2.1.0`), `v`-prefixed (`v1.0.0`), or wrapped in brackets and optionally linked (`[0.9.0](...)`), and dates are recognized in common formats such as `YYYY-MM-DD`, `DD.MM.YYYY`, and parenthesized `(YYYY-MM-DD)`.
266
+
256
267
Each entry is available as an object in the `versions` array. The body of a given entry can be accessed using the following properties:
257
268
258
269
-`body` - A string containing all of the updates/changes/etc. for the current entry. This property includes both plain text and markdown.
0 commit comments