github-release-notes
Advanced tools
Comparing version 0.9.0 to 0.10.0
#!/usr/bin/env node | ||
'use strict'; | ||
require('../github-release-notes'); | ||
var _commander = require('commander'); | ||
var _commander2 = _interopRequireDefault(_commander); | ||
var _package = require('../package.json'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var argvWithVersion = function argvWithVersion(argvs) { | ||
var vPos = argvs.indexOf('-v'); | ||
if (vPos > -1) { | ||
argvs[vPos] = '-V'; | ||
} | ||
return argvs; | ||
}; | ||
_commander2.default.version(_package.version).description('gren (\uD83E\uDD16 ) ' + _package.description).usage('<command> [options]').command('release', 'Release into chunk').alias('r').command('changelog', 'Write a motherfucking changelog').alias('c').command('examples', 'Show few examples of stuff that you can do <cmd>').parse(argvWithVersion(process.argv)); |
'use strict'; | ||
var GithubReleaseNotes = require('./src/gren'); | ||
var gren = new GithubReleaseNotes(); | ||
var utils = require('./src/utils'); | ||
var action = utils.getBashOptions(process.argv)['action']; | ||
gren.init() | ||
.then(function() { | ||
return gren[action || 'release'](); | ||
}) | ||
.catch(function(error) { | ||
utils.clearTasks(gren); | ||
console.error(error); | ||
}); | ||
const gren = require('./bin/gren.js'); |
138
package.json
{ | ||
"name": "github-release-notes", | ||
"version": "0.9.0", | ||
"description": "Node module to publish release notes based on commits between the last two tags.", | ||
"main": "./github-release-notes.js", | ||
"scripts": { | ||
"start": "node github-release-notes.js", | ||
"test": "grunt test", | ||
"docs": "node_modules/.bin/jsdoc -c .jsdoc.conf.json --verbose" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/alexcanessa/github-release-notes.git" | ||
}, | ||
"preferGlobal": "true", | ||
"bin": { | ||
"gren": "bin/gren.js" | ||
}, | ||
"keywords": [ | ||
"Github", | ||
"Release", | ||
"notes", | ||
"Tag", | ||
"Changelog", | ||
"Changelog Generator", | ||
"Issues", | ||
"Commits" | ||
], | ||
"author": "alexcanessa", | ||
"contributors": [ | ||
"Alex Canessa <canessa.alex@gmail.com>" | ||
], | ||
"license": "ISC", | ||
"bugs": { | ||
"url": "https://github.com/alexcanessa/github-release-notes/issues" | ||
}, | ||
"homepage": "https://github.com/alexcanessa/github-release-notes#readme", | ||
"dependencies": { | ||
"chalk": "^1.1.3", | ||
"connectivity": "^1.0.0", | ||
"es6-promise": "^3.2.1", | ||
"github-api": "^3.0.0", | ||
"minimist": "^1.2.0", | ||
"object-assign-deep": "0.0.4", | ||
"require-yaml": "0.0.1" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^3.6.0", | ||
"eslint-config-standard": "^6.0.1", | ||
"eslint-plugin-promise": "^3.5.0", | ||
"eslint-plugin-standard": "^2.0.0", | ||
"grunt": "^1.0.1", | ||
"grunt-contrib-nodeunit": "^1.0.0", | ||
"grunt-eslint": "^19.0.0", | ||
"jsdoc": "^3.4.3", | ||
"minami": "^1.1.1" | ||
} | ||
"name": "github-release-notes", | ||
"version": "0.10.0", | ||
"description": "Creates a release from a tag and uses issues or commits to creating the release notes. It also can generate a CHANGELOG.md file based on the release notes (or generate a brand new).", | ||
"main": "./github-release-notes.js", | ||
"scripts": { | ||
"start": "node github-release-notes.js", | ||
"test": "nyc mocha --compilers=js:babel-register", | ||
"coverage": "nyc --reporter=lcov --reporter=text mocha --compilers=js:babel-register", | ||
"options": "node tasks/_generate-options.js", | ||
"examples": "node tasks/_generate-examples.js", | ||
"docs": "npm run options && npm run examples && node_modules/.bin/jsdoc -c .jsdoc.conf.json --verbose" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/github-tools/github-release-notes.git" | ||
}, | ||
"directories": { | ||
"bin": "./bin", | ||
"lib": "./lib", | ||
"dest": "./dest" | ||
}, | ||
"preferGlobal": "true", | ||
"bin": { | ||
"gren": "bin/gren.js" | ||
}, | ||
"keywords": [ | ||
"Github", | ||
"Release", | ||
"notes", | ||
"Tag", | ||
"Changelog", | ||
"Changelog Generator", | ||
"Issues", | ||
"Commits" | ||
], | ||
"author": "alexcanessa", | ||
"contributors": [ | ||
"Alex Canessa <canessa.alex@gmail.com>" | ||
], | ||
"license": "ISC", | ||
"bugs": { | ||
"url": "https://github.com/alexcanessa/github-release-notes/issues" | ||
}, | ||
"homepage": "https://github.com/alexcanessa/github-release-notes#readme", | ||
"dependencies": { | ||
"chalk": "^2.1.0", | ||
"commander": "^2.11.0", | ||
"connectivity": "^1.0.0", | ||
"github-api": "^3.0.0", | ||
"minimist": "^1.2.0", | ||
"object-assign-deep": "^0.3.1", | ||
"require-yaml": "0.0.1" | ||
}, | ||
"devDependencies": { | ||
"babel-cli": "^6.24.1", | ||
"babel-eslint": "^8.0.0", | ||
"babel-plugin-istanbul": "^4.1.5", | ||
"babel-preset-env": "^1.4.0", | ||
"babel-preset-es2015": "^6.24.1", | ||
"babel-register": "^6.24.1", | ||
"chai": "^4.1.2", | ||
"eslint-config-semistandard": "^11.0.0", | ||
"eslint-config-standard": "^10.2.1", | ||
"eslint-plugin-babel": "^4.1.1", | ||
"eslint-plugin-import": "^2.6.0", | ||
"eslint-plugin-node": "^5.1.0", | ||
"eslint-plugin-promise": "^3.5.0", | ||
"eslint-plugin-standard": "^3.0.1", | ||
"gulp": "^3.9.1", | ||
"gulp-babel": "^7.0.0", | ||
"gulp-chmod": "^2.0.0", | ||
"gulp-eslint": "^4.0.0", | ||
"gulp-gh-pages": "^0.5.4", | ||
"gulp-if": "^2.0.2", | ||
"gulp-sass": "^3.1.0", | ||
"gulp-watch": "^4.3.11", | ||
"gulp-zip": "^4.0.0", | ||
"jsdoc": "^3.4.3", | ||
"minami": "^1.2.3", | ||
"nyc": "^11.2.1", | ||
"yamljs": "^0.3.0" | ||
} | ||
} |
181
README.md
@@ -1,12 +0,108 @@ | ||
# Github Release Notes | ||
# `gren` 🤖 | ||
> Github release notes and changelog generator | ||
[![npm version](https://badge.fury.io/js/github-release-notes.svg)](https://badge.fury.io/js/github-release-notes) | ||
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com) | ||
[![Build Status](https://travis-ci.org/github-tools/github-release-notes.svg?branch=master)](https://travis-ci.org/github-tools/github-release-notes) | ||
[![Join the chat at https://gitter.im/github-release-notes/Lobby](https://badges.gitter.im/github-release-notes/Lobby.svg)](https://gitter.im/github-release-notes/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | ||
[![Codecov](https://codecov.io/gh/github-tools/github-release-notes/branch/master/graph/badge.svg)](https://codecov.io/gh/github-tools/github-release-notes/) | ||
[![npm downloads](https://img.shields.io/npm/dy/github-release-notes.svg)](https://www.npmjs.com/package/github-release-notes) | ||
> Node module that generates release notes based on commit messages or closed issues between tags. It also can create a full changelog or add the latest release notes to the existing changelog file. | ||
## Motivation | ||
If you want to include it in a task, you can use [grunt-github-release-notes](https://github.com/github-tools/grunt-github-release-notes) | ||
Everyone loves neat, transparent, informative release notes. | ||
Everyone would also rather avoid maintaining them. What a hassle to have to evaluate what issues have been solved between two points in project's timeline, what types of problems they were, are they important to inform the users about, what issues solved them etc. | ||
Wouldn't it be great to get fantastic release notes compiled for you automaticaly based on all the hard work you put into your GitHub issues and pull requests. | ||
## OK, what can `gren` do for me? | ||
`gren` is a small helpful robot that will do for you just that! To put simply, it can create a release from a tag and compile the release notes using issues or commits. | ||
It also can generate a `CHANGELOG.md` file based on the release notes (or generate a brand new). | ||
- [The Concept](#the-concept) | ||
- [Feed 🤖](#feed-gren-) | ||
- [Installation](#installation) | ||
- [Basic Usage](#basic-usage) | ||
- [Configuration file](#configuration-file) | ||
- [Full Documentation](https://github-tools.github.io/github-release-notes) | ||
## The Concept | ||
The main motivation for bringing `gren` to life was the need for auto generating release notes for every tag in a project. | ||
The process, [as explained here](https://help.github.com/articles/creating-releases/), requires to go to your project's releases page in GitHub, draft that tag as a new release and manually add what I remembered has changed. | ||
Let `gren` take care of that for you. It automates this process and also writes release notes for you, creating something like this: | ||
> ## v0.6.0 (14/03/2017) | ||
> | ||
> #### Framework Enhancements: | ||
> | ||
> - [#32](https://github.com/github-tools/github-release-notes/issues/32) Unwrap github-api promises | ||
> - [#26](https://github.com/github-tools/github-release-notes/issues/26) Use external config file | ||
> - [#23](https://github.com/github-tools/github-release-notes/issues/23) Introduce templates for the issues | ||
> - [#19](https://github.com/github-tools/github-release-notes/issues/19) Add an "ignore label" flag | ||
> - [#12](https://github.com/github-tools/github-release-notes/issues/12) Add the chance to rebuild the history of release notes | ||
> | ||
> #### Bug Fixes: | ||
> | ||
> - [#29](https://github.com/github-tools/github-release-notes/issues/29) Remove escaping character on regex | ||
> - [#24](https://github.com/github-tools/github-release-notes/issues/24) The changelog action doesn't compile latest release | ||
_(yes, this is one of_ 🤖 _'s actual releases)_ | ||
## Feed `gren` 🤖 | ||
Where is the data coming from? There are two options: | ||
### `issues` (⭐) | ||
If you manage your project with issues, that's where all the information about a change are. | ||
Issue labels increase the level of depth of what the release notes should show, helping `gren` to group the notes. | ||
_e.g. if you see the example above, the issues are grouped by the two labels `enhancement` and `bug`, then customised via a config file._ | ||
`gren` generates those notes by collecting all the issues closed between a tag (defaults to latest) and the tag before it (or a tag that you specify). | ||
If you want to be more accurate on the issues that belong to a release, you can group them in [milestones](https://github-tools.github.io/github-release-notes/examples.html#milestones) and use only the issues that belong to that Milestone. | ||
> The output above is a result of release notes built from issues. | ||
#### Help 🤖 to write wondeful stuff (issues) | ||
In order to have spliendid generated release notes, we reccomend to follow these convensions: | ||
1. Start the title with a verb (e.g. Change header styles) | ||
2. Use the imperative mood in the title (e.g. Fix, not Fixed or Fixes header styles) | ||
3. Use labels wisely and assign one label per issue. `gren` has the [option to ignore issues](#) _(alex: put link to options)_ that have a specified issues. | ||
### `commits` | ||
The simplest way of getting data is from the commits you write. | ||
Even though it doesn't require a machine-readable commit, still would be better to have them in a nice format. | ||
The output would then use commit messages (title + description) to look something like: | ||
> ## v0.9.0 (17/05/2017) | ||
> | ||
> - Filter milestones (#75) | ||
> * Create milestones data-source option | ||
> * Add documentation for the milestones option | ||
> - Support GitHub enterprise (#73) | ||
> * Support GitHub enterprise | ||
> * Add api-url to options documentation | ||
> - Update CHANGELOG.md | ||
#### Help 🤖 to write wondeful stuff (commits) | ||
In order to have spliendid generated release notes, we reccomend to follow these convensions: | ||
1. Start the subject line with a verb (e.g. Change header styles) | ||
2. Use the imperative mood in the subject line (e.g. Fix, not Fixed or Fixes header styles) | ||
3. Limit the subject line to about 50 characters | ||
4. Do not end the subject line with a period | ||
5. Separate subject from body with a blank line | ||
6. Wrap the body at 72 characters | ||
7. Use the body to explain _what_ and _why_ not _how_ | ||
## Installation | ||
@@ -20,6 +116,6 @@ | ||
## Setup | ||
### Setup | ||
First generate a `github token` at [this link](https://help.github.com/articles/creating-an-access-token-for-command-line-use/). _You only need "repo" scope._ | ||
Then add this to `~/.bash_profile` or `~/.zshrc`): | ||
First, generate a `GitHub token`, _with **repo** scope_, at [this link](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/). | ||
Then add this line to `~/.bash_profile` (or `~/.zshrc`): | ||
@@ -32,30 +128,77 @@ ```shell | ||
`gren` gets the repo information directly from the folder where `git` is initialised. | ||
```shell | ||
# Navigate to your project directory | ||
cd ~/Path/to/repo | ||
# Run the task | ||
gren | ||
# Run the task (see below) | ||
gren release | ||
``` | ||
Otherwise, you can run it anywhere passing the repo information: | ||
Otherwise, you can run it _anywhere_ passing the repo information: | ||
```shell | ||
gren --username=[username] --repo=[repo name] | ||
gren release --username=[username] --repo=[repo name] | ||
``` | ||
To use a specific token you can specify it as option: | ||
If you don't want to save the token, you can specify one as an option: | ||
```shell | ||
gren --token=[your token] | ||
gren release --token=[your token] | ||
``` | ||
### Demo | ||
### [See all the options here](https://github-tools.github.io/github-release-notes/options.html) | ||
![gren demo](./docs/images/examples/exec_gren.gif) | ||
### Commands | ||
### Actions | ||
There are two main commands that can be ran with 🤖: | ||
**Gren** has two main usages: `release` and `changelog`. | ||
You can select the action with the `--action` option. | ||
#### `gren release` | ||
[See full documentation here](https://github-tools.github.io/github-release-notes) | ||
`gren` will look for the latest tag, draft a new release using the issues closed between when that tag and the one before were created and publish that release in your **release** panel in your GitHub repo. ([@see how to feed 🤖](#feed-gren-)). | ||
#### `gren changelog` | ||
Create a `CHANGELOG.md` file using all the release notes of the repo _(like the ones generated by_ 🤖 _)._ | ||
If the file exists already, use the `--override` option to proceed. | ||
```shell | ||
gren changelog --override | ||
``` | ||
To generate a brand new release notes, using the same approach as per the releases, you have to run the command with the `--generate` option. | ||
```shell | ||
gren changelog --generate | ||
``` | ||
### Help! 🆘 | ||
`gren` is using [Commander.js](https://github.com/tj/commander.js) which generates the `--help` section. | ||
To trigger the help of a command, run: | ||
```shell | ||
# General usage | ||
gren --help | ||
# Command usage | ||
gren help release # or gren release --help | ||
``` | ||
It's also possible to see all the examples [here](https://github-tools.github.io/github-release-notes/examples.html) or directly in the terminal: | ||
```shell | ||
gren examples release | ||
``` | ||
## Configuration file | ||
You can create a configuration file where the task will be ran, where to specify your options. [See how to set up the config file](https://github-tools.github.io/github-release-notes/options.html#configuration-file) | ||
The accepted file extensions are the following: | ||
- `.grenrc` | ||
- `.grenrc.json` | ||
- `.grenrc.yml` | ||
- `.grenrc.yaml` | ||
- `.grenrc.js` | ||
### [See full documentation here](https://github-tools.github.io/github-release-notes) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Copyleft License
License(Experimental) Copyleft license information was found.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
Non-permissive License
License(Experimental) A license not known to be considered permissive was found.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
232241
21
1789
203
27
3
70
4
2
+ Addedcommander@^2.11.0
+ Addedansi-styles@3.2.1(transitive)
+ Addedchalk@2.4.2(transitive)
+ Addedcolor-convert@1.9.3(transitive)
+ Addedcolor-name@1.1.3(transitive)
+ Addedcommander@2.20.3(transitive)
+ Addedhas-flag@3.0.0(transitive)
+ Addedobject-assign-deep@0.3.1(transitive)
+ Addedsupports-color@5.5.0(transitive)
- Removedes6-promise@^3.2.1
- Removedansi-regex@2.1.1(transitive)
- Removedansi-styles@2.2.1(transitive)
- Removedchalk@1.1.3(transitive)
- Removedes6-promise@3.3.1(transitive)
- Removedhas-ansi@2.0.0(transitive)
- Removedobject-assign@2.0.0(transitive)
- Removedobject-assign-deep@0.0.4(transitive)
- Removedstrip-ansi@3.0.1(transitive)
- Removedsupports-color@2.0.0(transitive)
- Removedunderscore@1.7.0(transitive)
Updatedchalk@^2.1.0
Updatedobject-assign-deep@^0.3.1