Methods
(private) checkChangelogFile(gren) → {Promise}
Check if the changelog file exists
Parameters:
Name | Type | Description |
---|---|---|
gren |
GithubReleaseNotes |
Returns:
- Type
- Promise
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(gren, body)
Create the changelog file
Parameters:
Name | Type | Description |
---|---|---|
gren |
GithubReleaseNotes | |
body |
string | The body of the file |
(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
(private) filterBlockIssue(gren, range, issue) → {Boolean}
Filter the issue based on the date range, or if is in the release milestone.
Parameters:
Name | Type | Description |
---|---|---|
gren |
GithubReleaseNotes | |
range |
Array | The release ranges |
issue |
Object | GitHub issue |
Returns:
- Type
- Boolean
(private) filterIssue(gren, issue) → {Boolean}
Filter the issue based on gren options and labels
Parameters:
Name | Type | Description |
---|---|---|
gren |
GithubReleaseNotes | |
issue |
Object |
Returns:
- Type
- Boolean
formatDate(date) → {string}
Format a date into a string
Parameters:
Name | Type | Description |
---|---|---|
date |
Date |
Returns:
- Type
- string
(private) generate(placeholders, string) → {string}
Generate the templated string based on a placeholders Object
Parameters:
Name | Type | Description |
---|---|---|
placeholders |
Object | All the keys/values to update |
string |
string | function | The string or the function that needs to be replaced |
- Since:
- 0.6.0
- Source:
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>
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) 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
getReleaseBlocks(gren) → {Promise}
Generate release blocks based on issues or commit messages depending on the option.
Parameters:
Name | Type | Description |
---|---|---|
gren |
GithubReleaseNotes |
Returns:
Resolving the release blocks
- Type
- Promise
(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) groupBy(gren, issues) → {Array}
Create groups of issues based on labels
Parameters:
Name | Type | Description |
---|---|---|
gren |
GithubReleaseNotes | |
issues |
Array | The array of all the issues. |
Returns:
- Type
- Array
(private) groupByLabel(gren, issues) → {string}
Group the issues based on their first label
Parameters:
Name | Type | Description |
---|---|---|
gren |
GithubReleaseNotes | |
issues |
Array |
Returns:
- Type
- string
(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
sortObject(object) → {Object}
Sort an object by its keys
Parameters:
Name | Type | Description |
---|---|---|
object |
Object |
Returns:
- Type
- Object
(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) templateCommits(message) → {string}
Return the templated commit message
Parameters:
Name | Type | Description |
---|---|---|
message |
string |
Returns:
- Type
- string
(private) templateGroups(gren, groups) → {string}
Generates the template for the groups
Parameters:
Name | Type | Description |
---|---|---|
gren |
GithubReleaseNotes | |
groups |
Object | The groups to template e.g. { 'bugs': [{...}, {...}, {...}] } |
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
(private) templateReleases(gren, releases) → {string}
Generate the releases bodies from a release Objects Array
Parameters:
Name | Type | Description |
---|---|---|
gren |
GithubReleaseNotes | |
releases |
Array | The release Objects Array coming from GitHub |
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