You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

conventional-changelog-cli

Package Overview
Dependencies
Maintainers
1
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.1 to 1.0.0

27

CHANGELOG.md

@@ -0,1 +1,28 @@

<a name="1.0.0"></a>
# [1.0.0](https://github.com/stevemao/conventional-changelog-cli/compare/v0.0.1...v1.0.0) (2016-02-05)
### Bug Fixes
* **infile:** do not print the latest release twice if infile ENOENT ([e664087](https://github.com/stevemao/conventional-changelog-cli/commit/e664087))
### Features
* **flags:** add config and remove uncommon ones ([abc2b83](https://github.com/stevemao/conventional-changelog-cli/commit/abc2b83))
* **help:** improve the flag names and add more descriptions ([f59d6d9](https://github.com/stevemao/conventional-changelog-cli/commit/f59d6d9))
* **infile:** warn if infile does not exist ([443eb64](https://github.com/stevemao/conventional-changelog-cli/commit/443eb64))
* add --output-unreleased ([d479ff4](https://github.com/stevemao/conventional-changelog-cli/commit/d479ff4))
### BREAKING CHANGES
* help: `overwrite` is now called `same-file`.
Fixes https://github.com/ajoslin/conventional-changelog/issues/100
* flags: `--git-raw-commits-opts`, `--parser-opts` and `--writer-opts` are removed as they are considered uncommon, use `--config` is easier as people can write all options within one file and they can learn from existing presets.
Fixes https://github.com/ajoslin/conventional-changelog/issues/100
<a name="0.0.1"></a>

@@ -2,0 +29,0 @@ ## 0.0.1 (2016-01-30)

79

cli.js

@@ -17,17 +17,34 @@ #!/usr/bin/env node

'Example',
' conventional-changelog -i CHANGELOG.md --overwrite',
' conventional-changelog -i CHANGELOG.md --same-file',
'',
'Options',
' -i, --infile Read the CHANGELOG from this file',
' -o, --outfile Write the CHANGELOG to this file. If unspecified, it prints to stdout',
' -w, --overwrite Overwrite the infile',
' -p, --preset Name of the preset you want to use',
'',
' -o, --outfile Write the CHANGELOG to this file',
' If unspecified, it prints to stdout',
'',
' -s, --same-file Outputting to the infile so you don\'t need to specify the same file as outfile',
'',
' -p, --preset Name of the preset you want to use. Must be one of the following:',
' angular, atom, codemirror, ember, eslint, express, jquery, jscs or jshint',
'',
' -k, --pkg A filepath of where your package.json is located',
' -a, --append Should the generated block be appended',
' Default is the closest package.json from cwd',
'',
' -a, --append Should the newer release be appended to the older release',
' Default: false',
'',
' -r, --release-count How many releases to be generated from the latest',
' If 0, the whole changelog will be regenerated and the outfile will be overwritten',
' Default: 1',
'',
' -u, --output-unreleased Output unreleased changelog',
'',
' -v, --verbose Verbose output',
' -c, --context A filepath of a javascript that is used to define template variables',
' --git-raw-commits-opts A filepath of a javascript that is used to define git-raw-commits options',
' --parser-opts A filepath of a javascript that is used to define conventional-commits-parser options',
' --writer-opts A filepath of a javascript that is used to define conventional-changelog-writer options'
' Default: false',
'',
' -n, --config A filepath of your config script',
' This value is ignored if preset is specified',
'',
' -c, --context A filepath of a json that is used to define template variables'
]

@@ -38,3 +55,3 @@ }, {

o: 'outfile',
w: 'overwrite',
s: 'sameFile',
p: 'preset',

@@ -44,3 +61,5 @@ k: 'pkg',

r: 'releaseCount',
u: 'outputUnreleased',
v: 'verbose',
n: 'config',
c: 'context'

@@ -53,3 +72,3 @@ }

var outfile = flags.outfile;
var overwrite = flags.overwrite;
var sameFile = flags.sameFile;
var append = flags.append;

@@ -59,8 +78,8 @@ var releaseCount = flags.releaseCount;

if (infile && infile === outfile) {
overwrite = true;
} else if (overwrite) {
sameFile = true;
} else if (sameFile) {
if (infile) {
outfile = infile;
} else {
console.error('Nothing to overwrite');
console.error('infile must be provided if same-file flag presents.');
process.exit(1);

@@ -76,3 +95,4 @@ }

append: append,
releaseCount: releaseCount
releaseCount: releaseCount,
outputUnreleased: flags.outputUnreleased
}, _.isUndefined);

@@ -85,5 +105,2 @@

var templateContext;
var gitRawCommitsOpts;
var parserOpts;
var writerOpts;

@@ -97,13 +114,5 @@ var outStream;

if (flags.gitRawCommitsOpts) {
gitRawCommitsOpts = require(resolve(process.cwd(), flags.gitRawCommitsOpts));
if (flags.config) {
options.config = require(resolve(process.cwd(), flags.config));
}
if (flags.parserOpts) {
parserOpts = require(resolve(process.cwd(), flags.parserOpts));
}
if (flags.writerOpts) {
writerOpts = require(resolve(process.cwd(), flags.writerOpts));
}
} catch (err) {

@@ -114,3 +123,3 @@ console.error('Failed to get file. ' + err);

var changelogStream = conventionalChangelog (options, templateContext, gitRawCommitsOpts, parserOpts, writerOpts)
var changelogStream = conventionalChangelog(options, templateContext)
.on('error', function (err) {

@@ -127,3 +136,3 @@ if (flags.verbose) {

if (outfile) {
outStream = fs.createWriteStream (outfile);
outStream = fs.createWriteStream(outfile);
} else {

@@ -140,6 +149,12 @@ outStream = process.stdout;

.on('error', function () {
noInputFile();
if (flags.verbose) {
console.warn('infile does not exist.');
}
if (sameFile) {
noInputFile();
}
});
if (overwrite) {
if (sameFile) {
if (options.append) {

@@ -146,0 +161,0 @@ changelogStream

{
"name": "conventional-changelog-cli",
"version": "0.0.1",
"version": "1.0.0",
"description": "Generate a changelog from git metadata",

@@ -34,7 +34,7 @@ "homepage": "https://github.com/stevemao/conventional-changelog-cli",

"nyc": "^5.0.1",
"shelljs": "^0.5.3"
"shelljs": "^0.6.0"
},
"dependencies": {
"add-stream": "^1.0.0",
"conventional-changelog": "^0.5.3",
"conventional-changelog": "^1.0.0",
"lodash": "^4.1.0",

@@ -46,3 +46,3 @@ "meow": "^3.7.0",

"test": "nyc mocha --timeout 30000 && npm run-script lint",
"lint": "jshint *.js --exclude node_modules && jscs *.js",
"lint": "jshint test *.js --exclude node_modules && jscs test *.js",
"coveralls": "nyc report --reporter=text-lcov | coveralls"

@@ -49,0 +49,0 @@ },

@@ -1,2 +0,5 @@

# conventional-changelog-cli [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage percentage][coveralls-image]][coveralls-url]
# conventional-changelog-cli
[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage percentage][coveralls-image]][coveralls-url]
> Generate a changelog from git metadata

@@ -10,3 +13,3 @@

$ cd my-project
$ conventional-changelog -p angular -i CHANGELOG.md -w
$ conventional-changelog -p angular -i CHANGELOG.md -s
```

@@ -19,3 +22,3 @@

```sh
$ conventional-changelog -p angular -i CHANGELOG.md -w -r 0
$ conventional-changelog -p angular -i CHANGELOG.md -s -r 0
```

@@ -25,7 +28,9 @@

All available command line parameters can be listed using [CLI](#cli) : `conventional-changelog --help`.
All available command line parameters can be listed using CLI: `conventional-changelog --help`.
**Hint:** You can alias your command or add it to your package.json. EG: `"changelog": "conventional-changelog -p angular -i CHANGELOG.md -w -r 0"`.
**Hint:** You can alias your command or add it to your package.json. EG: `"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0"`.
To fully customize the tool, please checkout [conventional-changelog](https://github.com/ajoslin/conventional-changelog) and [conventional-changelog-core](https://github.com/stevemao/conventional-changelog-core) docs. You can find more details there.
## Recommended workflow

@@ -66,2 +71,3 @@

- [conventional-changelog](https://github.com/ajoslin/conventional-changelog) - API of this module
- [conventional-github-releaser](https://github.com/stevemao/conventional-github-releaser) - Make a new GitHub release from git metadata

@@ -76,3 +82,3 @@ - [conventional-recommended-bump](https://github.com/stevemao/conventional-recommended-bump) - Get a recommended version bump based on conventional commits

MIT © [Steve Mao]()
MIT © [Steve Mao](https://github.com/stevemao)

@@ -79,0 +85,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc