Methods
clearTasks(gren)
Clears all the tasks that are still running
Parameters:
Name | Type | Description |
---|---|---|
gren |
GithubReleaseNotes |
(private) commitMessages(commits) → {Array.<String>}
Transforms the commits to commit messages
Parameters:
Name | Type | Description |
---|---|---|
commits |
Array.<Object> | The array of object containing the commits |
Returns:
- Type
- Array.<String>
(private) compareIssueLabels(ignoreLabels, labels) → {boolean}
Compare the ignored labels with the passed ones
Parameters:
Name | Type | Description |
---|---|---|
ignoreLabels |
Array | The labels to ignore |
labels |
Array | The labels to check |
Returns:
If the labels array contain any of the ignore ones
- Type
- boolean
convertStringToArray(arrayLike) → {Array}
Converts an array like string to an actual Array, converting also underscores to spaces
Parameters:
Name | Type | Description |
---|---|---|
arrayLike |
string | The string of items e.g. "wont_fix, duplicate, bug" |
Returns:
The items with spaces instead of underscores.
- Type
- Array
(private) createChangelog(body) → {boolean}
Create the CHANGELOG.md file
Parameters:
Name | Type | Description |
---|---|---|
body |
string |
Returns:
- Type
- boolean
(private) createRelease(gren, releaseOptions) → {Promise}
Create a release from a given tag (in the options)
Parameters:
Name | Type | Description |
---|---|---|
gren |
GithubReleaseNotes | The gren object |
releaseOptions |
Object | The options to build the release: |
Returns:
- Type
- Promise
Example
{
"tag_name": "1.0.0",
"target_commitish": "master",
"name": "v1.0.0",
"body": "Description of the release",
"draft": false,
"prerelease": false
}
(private) createReleaseRanges(gren, releaseDates) → {Array}
Create the ranges of release dates
Parameters:
Name | Type | Description |
---|---|---|
gren |
GithubReleaseNotes | |
releaseDates |
Array | The release dates |
Returns:
- Type
- Array
dashToCamelCase(value) → {string}
Transforms a dasherize string into a camel case one.
Parameters:
Name | Type | Description |
---|---|---|
value |
string | The dasherize string |
Returns:
The camel case string
- Type
- string
(private) editRelease(gren, releaseId, releaseOptions) → {Promise}
Edit a release from a given tag (in the options)
Parameters:
Name | Type | Description |
---|---|---|
gren |
GithubReleaseNotes | The gren object |
releaseId |
number | The id of the release to edit |
releaseOptions |
Object | The options to build the release: |
Returns:
- Type
- Promise
Example
{
"tag_name": "v1.0.0",
"target_commitish": "master",
"name": "v1.0.0",
"body": "Description of the release",
"draft": false,
"prerelease": false
}
(private) executeCommand(command, callback) → {Promise}
Execute a command in the bash and run a callback
Parameters:
Name | Type | Description |
---|---|---|
command |
string | The command to execute |
callback |
function | The callback which returns the stdout |
- Since:
- 0.5.0
- Source:
Returns:
- Type
- Promise
formatDate(date) → {string}
Format a date into a string
Parameters:
Name | Type | Description |
---|---|---|
date |
Date |
Returns:
- Type
- string
(private) generateCommitsBody(message) → {string}
Return a commit messages generated body
Parameters:
Name | Type | Description |
---|---|---|
message |
string |
Returns:
- Type
- string
(private) generateOptions() → {Array.<Promise>}
Generate the GithubReleaseNotes getting the options from the git config
Returns:
- Type
- Array.<Promise>
(private) generateReleaseDatesChangelogBody() → {Array.<Promise>}
Generate a CHANGELOG.md file based on Time and issues
Returns:
- Type
- Array.<Promise>
getBashOptions(args) → {Object}
Create a literal object of the node module options
Parameters:
Name | Type | Description |
---|---|---|
args |
Array | The array of arguments (the module arguments start from index 2) |
Returns:
The object containg the key/value options
- Type
- Object
(private) getClosedIssues(gren, releaseRanges) → {Promise}
Get all the closed issues from the current repo
Parameters:
Name | Type | Description |
---|---|---|
gren |
GithubReleaseNotes | The gren object |
releaseRanges |
Array | The array of date ranges |
Returns:
The promise which resolves the list of the issues
- Type
- Promise
(private) getCommitBlocks(gren, releaseRanges) → {Array.<Promise>}
Get the blocks of commits based on release dates
Parameters:
Name | Type | Description |
---|---|---|
gren |
GithubReleaseNotes | |
releaseRanges |
Array | The array of date ranges |
Returns:
- Type
- Array.<Promise>
(private) getCommitsBetweenTwo(gren, since, until) → {Promise}
Gets all the commits between two dates
Parameters:
Name | Type | Description |
---|---|---|
gren |
GithubReleaseNotes | The gren object |
since |
string | The since date in ISO |
until |
string | The until date in ISO |
Returns:
The promise which resolves the [Array] commit messages
- Type
- Promise
getConfigFromFile(path) → {Object}
Get configuration from the one of the config files
Parameters:
Name | Type | Description |
---|---|---|
path |
string | Path where to look for config files |
Returns:
The configuration from the first found file or empty object
- Type
- Object
(private) getIssueBlocks(gren, releaseRanges) → {Array.<Promise>}
Get the blocks of issues based on release dates
Parameters:
Name | Type | Description |
---|---|---|
gren |
GithubReleaseNotes | |
releaseRanges |
Array | The array of date ranges |
Returns:
- Type
- Array.<Promise>
(private) getLastTags(gren) → {Promise}
Get all the tags of the repo
Parameters:
Name | Type | Description |
---|---|---|
gren |
GithubReleaseNotes | The gren object |
Returns:
- Type
- Promise
(private) getLastTwoReleases(gren) → {Promise}
Get the latest releases
Parameters:
Name | Type | Description |
---|---|---|
gren |
GithubReleaseNotes | The gren object |
Returns:
The promise which resolves the tag name of the release
- Type
- Promise
(private) getListReleases(gren) → {Promise}
Get all releases
Parameters:
Name | Type | Description |
---|---|---|
gren |
GithubReleaseNotes | The gren object |
Returns:
The promise which resolves an array of releases
- Type
- Promise
(private) getReleaseDates(releases) → {Array}
Get all releases
Parameters:
Name | Type | Description |
---|---|---|
releases |
Array.<Object> | A list of release Objects |
Returns:
The list of the dates
- Type
- Array
(private) getSelectedTags(selectedTags, tags) → {Boolean|Array}
Get the tags information from the given ones, and adds the next one in case only one is given
Parameters:
Name | Type | Description |
---|---|---|
selectedTags |
Array | string | |
tags |
Array.<Object> |
Returns:
- Type
- Boolean | Array
(private) getTagDates(gren, tags) → {Array.<Promise>}
Get the dates of the last two tags
Parameters:
Name | Type | Description |
---|---|---|
gren |
GithubReleaseNotes | The gren object |
tags |
Array.<Object> | List of all the tags in the repo |
Returns:
The promises which returns the dates
- Type
- Array.<Promise>
(private) hasNetwork() → {Promise}
Check if there is connectivity
Returns:
- Type
- Promise
isInRange(value, min, max) → {Boolean}
Check if e value is between a min and a max
Parameters:
Name | Type | Description |
---|---|---|
value |
number | |
min |
number | |
max |
number |
Returns:
- Type
- Boolean
(private) prepareRelease(gren, tags) → {Promise}
Creates the options to make the release
Parameters:
Name | Type | Description |
---|---|---|
gren |
GithubReleaseNotes | The gren object |
tags |
Array.<Object> | The collection of tags |
Returns:
- Type
- Promise
printTask(name)
Print a task name in a custom format
Parameters:
Name | Type | Description |
---|---|---|
name |
string | The name of the task |
repo(callback) → {Promise}
Get repo informations
Parameters:
Name | Type | Description |
---|---|---|
callback |
function |
- Since:
- 0.5.0
- Source:
Returns:
The promise that resolves repo informations ({user: user, name: name})
- Type
- Promise
requireConfig(filepath) → {Object|boolean}
Gets the content from a filepath a returns an object
Parameters:
Name | Type | Description |
---|---|---|
filepath |
string |
Returns:
- Type
- Object | boolean
(private) sortReleasesByDate(releaseDates) → {Array}
Sort releases by dates
Parameters:
Name | Type | Description |
---|---|---|
releaseDates |
Array |
Returns:
- Type
- Array
task(taskName) → {function}
Outputs the task status
Parameters:
Name | Type | Description |
---|---|---|
taskName |
string | The task name |
Returns:
The function to be fired when is loaded
- Type
- function
(private) templateBlock(block) → {string}
Generate the MD template a block
Parameters:
Name | Type | Description |
---|---|---|
block |
Object | ({name: 'v1.2.3', body: []}) |
Returns:
- Type
- string
(private) templateChangelog(blocks) → {string}
Generate the Changelog MD template
Parameters:
Name | Type | Description |
---|---|---|
blocks |
Array.<Object> |
Returns:
- Type
- string
(private) templateCommits(message) → {string}
Return a string with a - to be a bulvar list (used for a mapping)
Parameters:
Name | Type | Description |
---|---|---|
message |
string |
Returns:
- Type
- string
(private) templateIssue(issue) → {string}
Generate the MD template for each issue
Parameters:
Name | Type | Description |
---|---|---|
issue |
Object |
Returns:
- Type
- string
(private) templateIssueBody(blocks) → {string}
Generate the Changelog issues body template
Parameters:
Name | Type | Description |
---|---|---|
blocks |
Array.<Object> |
Returns:
- Type
- string
(private) templateLabels(issue) → {string}
Generate the MD template from all the labels of a specific issue
Parameters:
Name | Type | Description |
---|---|---|
issue |
Object |
Returns:
- Type
- string
token(callback) → {Promise}
Get token informations
Parameters:
Name | Type | Description |
---|---|---|
callback |
function |
- Since:
- 0.5.0
- Source:
Returns:
The promise that resolves token informations ({token: token})
- Type
- Promise
user(callback) → {Promise}
Get user informations
Parameters:
Name | Type | Description |
---|---|---|
callback |
function |
- Since:
- 0.5.0
- Source:
Returns:
The promise that resolves user informations ({ user: username})
- Type
- Promise