Changelog resource following Keep a Changelog format.
- Source:
Methods
(inner) getVersion(resource, cb)
Get version value from the changelog's latest release.
It's common for the latest release of a changelog to be 'Unreleased', in
order to indicate that it's the one currently in progress. Hence the
version is resolved in this order:
1. when latest release has a version number, use that version
2. when latest release is 'Unreleased' (version is undefined after
parsing), use the previous release's version
3. otherwise default to '0.0.0'
Parameters:
| Name | Type | Description | ||||||
|---|---|---|---|---|---|---|---|---|
resource |
Object
|
resource configuration
|
||||||
cb |
function
|
standard cb(err, result) callback, result is the version value |
(inner) setPostReleaseVersion(version, resource, opts, cb)
Add a new Unreleased section to the top of the changelog.
The version value is not written to the changelog, Unreleased section
represents the next pre-release version instead.
Parameters:
| Name | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
version |
String
|
post-release version value, unused | ||||||||||||
resource |
Object
|
resource configuration
|
||||||||||||
opts |
Object
|
optional settings
|
||||||||||||
cb |
function
|
standard cb(err, result) callback |
(inner) setReleaseVersion(version, resource, opts, cb)
Set release version on the latest release within the changelog, with date
set to current date.
Parameters:
| Name | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
version |
String
|
version value to set | ||||||||||||
resource |
Object
|
resource configuration
|
||||||||||||
opts |
Object
|
optional settings
|
||||||||||||
cb |
function
|
standard cb(err, result) callback |