chore(package): re-init package with commitizen and standard-release

This commit is contained in:
Pavel Pertsev
2018-05-16 12:54:46 +03:00
parent cb4e7a5643
commit eaf2328575
10640 changed files with 609660 additions and 117 deletions

313
node_modules/conventional-changelog-core/CHANGELOG.md generated vendored Normal file
View File

@@ -0,0 +1,313 @@
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
<a name="2.0.11"></a>
## [2.0.11](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-core@2.0.10...conventional-changelog-core@2.0.11) (2018-04-16)
### Bug Fixes
* `tagPrefix` was not passed properly in conventional-changelog-core ([#300](https://github.com/conventional-changelog/conventional-changelog/issues/300)) ([be48f70](https://github.com/conventional-changelog/conventional-changelog/commit/be48f70))
<a name="2.0.10"></a>
## [2.0.10](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-core@2.0.9...conventional-changelog-core@2.0.10) (2018-03-28)
**Note:** Version bump only for package conventional-changelog-core
<a name="2.0.9"></a>
## [2.0.9](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-core@2.0.8...conventional-changelog-core@2.0.9) (2018-03-27)
**Note:** Version bump only for package conventional-changelog-core
<a name="2.0.8"></a>
## [2.0.8](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-core@2.0.7...conventional-changelog-core@2.0.8) (2018-03-27)
**Note:** Version bump only for package conventional-changelog-core
<a name="2.0.7"></a>
## [2.0.7](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-core@2.0.6...conventional-changelog-core@2.0.7) (2018-03-27)
**Note:** Version bump only for package conventional-changelog-core
<a name="2.0.6"></a>
## [2.0.6](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-core@2.0.5...conventional-changelog-core@2.0.6) (2018-03-22)
**Note:** Version bump only for package conventional-changelog-core
<a name="2.0.5"></a>
## [2.0.5](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-core@2.0.4...conventional-changelog-core@2.0.5) (2018-02-24)
**Note:** Version bump only for package conventional-changelog-core
<a name="2.0.4"></a>
## [2.0.4](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-core@2.0.3...conventional-changelog-core@2.0.4) (2018-02-20)
**Note:** Version bump only for package conventional-changelog-core
<a name="2.0.3"></a>
## [2.0.3](https://github.com/conventional-changelog/conventional-changelog-core/compare/conventional-changelog-core@2.0.2...conventional-changelog-core@2.0.3) (2018-02-13)
**Note:** Version bump only for package conventional-changelog-core
<a name="2.0.2"></a>
## [2.0.2](https://github.com/conventional-changelog/conventional-changelog-core/compare/conventional-changelog-core@2.0.1...conventional-changelog-core@2.0.2) (2018-02-13)
**Note:** Version bump only for package conventional-changelog-core
<a name="2.0.1"></a>
## [2.0.1](https://github.com/conventional-changelog/conventional-changelog-core/compare/conventional-changelog-core@2.0.0...conventional-changelog-core@2.0.1) (2018-02-05)
**Note:** Version bump only for package conventional-changelog-core
<a name="2.0.0"></a>
# [2.0.0](https://github.com/conventional-changelog/conventional-changelog-core/compare/conventional-changelog-core@1.9.5...conventional-changelog-core@2.0.0) (2018-01-29)
### Bug Fixes
* **writer:** normalize release headings ([#237](https://github.com/conventional-changelog/conventional-changelog-core/issues/237)) ([9e87dc3](https://github.com/conventional-changelog/conventional-changelog-core/commit/9e87dc3)), closes [/github.com/conventional-changelog/conventional-changelog/issues/214#issuecomment-326681934](https://github.com//github.com/conventional-changelog/conventional-changelog/issues/214/issues/issuecomment-326681934)
### BREAKING CHANGES
* **writer:** Logic for generating release headings has been changed to make all
heading levels the same (`##`/`h2`) for better compatibility with
screen readers and parsers, and to conform to HTML semantics. Patch
release titles are now wrapped in a `<small>` tag to maintain the
visual hierarchy of the previous style.
Fixes https://github.com/conventional-changelog/conventional-changelog/issues/214
<a name="1.9.5"></a>
## [1.9.5](https://github.com/conventional-changelog/conventional-changelog-core/compare/conventional-changelog-core@1.9.4...conventional-changelog-core@1.9.5) (2017-12-18)
**Note:** Version bump only for package conventional-changelog-core
<a name="1.9.4"></a>
## [1.9.4](https://github.com/conventional-changelog/conventional-changelog-core/compare/conventional-changelog-core@1.9.3...conventional-changelog-core@1.9.4) (2017-12-08)
**Note:** Version bump only for package conventional-changelog-core
<a name="1.9.3"></a>
## [1.9.3](https://github.com/conventional-changelog/conventional-changelog-core/compare/conventional-changelog-core@1.9.2...conventional-changelog-core@1.9.3) (2017-11-13)
**Note:** Version bump only for package conventional-changelog-core
<a name="1.9.2"></a>
## [1.9.2](https://github.com/conventional-changelog/conventional-changelog-core/compare/conventional-changelog-core@1.9.1...conventional-changelog-core@1.9.2) (2017-10-01)
<a name="1.9.1"></a>
## [1.9.1](https://github.com/conventional-changelog/conventional-changelog-core/compare/conventional-changelog-core@1.9.0...conventional-changelog-core@1.9.1) (2017-09-01)
<a name="1.9.0"></a>
# [1.9.0](https://github.com/conventional-changelog/conventional-changelog-core/compare/conventional-changelog-core@1.8.0...conventional-changelog-core@1.9.0) (2017-07-17)
### Features
* **context:** default currentTag may not prefix with v ([#179](https://github.com/conventional-changelog/conventional-changelog/issues/179)) ([431598a](https://github.com/conventional-changelog/conventional-changelog-core/commit/431598a))
<a name="1.8.0"></a>
# [1.8.0](https://github.com/conventional-changelog/conventional-changelog-core/compare/conventional-changelog-core@1.7.0...conventional-changelog-core@1.8.0) (2017-03-11)
### Features
* context.currentTag should take into account lerna tag format ([#178](https://github.com/conventional-changelog/conventional-changelog/issues/178)) ([f0e5875](https://github.com/conventional-changelog/conventional-changelog-core/commit/f0e5875))
<a name="1.5.0"></a>
# [1.5.0](https://github.com/conventional-changelog/conventional-changelog-core/compare/v1.4.0...v1.5.0) (2016-05-10)
### Features
* **context:** fallback to repoUrl([da0b096](https://github.com/conventional-changelog/conventional-changelog-core/commit/da0b096)), closes [#7](https://github.com/conventional-changelog/conventional-changelog-core/issues/7)
<a name="1.4.0"></a>
# [1.4.0](https://github.com/conventional-changelog/conventional-changelog-core/compare/v1.3.4...v1.4.0) (2016-05-08)
### Features
* **debug:** make options.debug as default writeOpts.debug([eeb7e8f](https://github.com/conventional-changelog/conventional-changelog-core/commit/eeb7e8f))
<a name="1.3.4"></a>
## [1.3.4](https://github.com/conventional-changelog/conventional-changelog-core/compare/v1.3.3...v1.3.4) (2016-05-07)
### Bug Fixes
* **mergeConfig:** respect issuePrefixes option ([4be052b](https://github.com/conventional-changelog/conventional-changelog-core/commit/4be052b)), closes [#6](https://github.com/conventional-changelog/conventional-changelog-core/issues/6) [#8](https://github.com/conventional-changelog/conventional-changelog-core/issues/8)
<a name="1.3.3"></a>
## [1.3.3](https://github.com/conventional-changelog/conventional-changelog-core/compare/v1.3.2...v1.3.3) (2016-04-19)
### Bug Fixes
* **unknownHost:** default context.repository ([eaa3b6f](https://github.com/conventional-changelog/conventional-changelog-core/commit/eaa3b6f))
<a name="1.3.2"></a>
## [1.3.2](https://github.com/conventional-changelog/conventional-changelog-core/compare/v1.3.1...v1.3.2) (2016-04-17)
<a name="1.3.1"></a>
## [1.3.1](https://github.com/conventional-changelog/conventional-changelog-core/compare/v1.3.0...v1.3.1) (2016-04-09)
### Bug Fixes
* **defaults:** context tags ([2571038](https://github.com/conventional-changelog/conventional-changelog-core/commit/2571038))
<a name="1.3.0"></a>
# [1.3.0](https://github.com/stevemao/conventional-changelog-core/compare/v1.2.0...v1.3.0) (2016-02-13)
### Features
* **debug:** add options.debug function ([aa56ae6](https://github.com/stevemao/conventional-changelog-core/commit/aa56ae6))
<a name="1.2.0"></a>
# [1.2.0](https://github.com/stevemao/conventional-changelog-core/compare/v1.1.0...v1.2.0) (2016-02-11)
### Features
* **merge:** ignore merge commits ([8f788dc](https://github.com/stevemao/conventional-changelog-core/commit/8f788dc))
<a name="1.1.0"></a>
# [1.1.0](https://github.com/stevemao/conventional-changelog-core/compare/v1.0.2...v1.1.0) (2016-02-08)
### Bug Fixes
* **default:** firstCommit and lastCommit should based on original unfiltered commits ([7fc49c9](https://github.com/stevemao/conventional-changelog-core/commit/7fc49c9)), closes [#2](https://github.com/stevemao/conventional-changelog-core/issues/2)
<a name="1.0.2"></a>
## [1.0.2](https://github.com/stevemao/conventional-changelog-core/compare/v1.0.1...v1.0.2) (2016-02-06)
### Bug Fixes
* **currentTag:** if unreleased, currentTag should be last commit hash ([e3d25ae](https://github.com/stevemao/conventional-changelog-core/commit/e3d25ae))
<a name="1.0.1"></a>
## [1.0.1](https://github.com/stevemao/conventional-changelog-core/compare/v1.0.0...v1.0.1) (2016-02-06)
### Bug Fixes
* **unreleased:** now it can output unreleased commits ([87b7340](https://github.com/stevemao/conventional-changelog-core/commit/87b7340))
<a name="1.0.0"></a>
# [1.0.0](https://github.com/stevemao/conventional-changelog-core/compare/v0.0.2...v1.0.0) (2016-02-05)
### Bug Fixes
* **oldNode:** git remote origin url feature is only available under node>=4 ([c69db53](https://github.com/stevemao/conventional-changelog-core/commit/c69db53))
### Features
* **pkg:** fallback to git remote origin url ([5b56952](https://github.com/stevemao/conventional-changelog-core/commit/5b56952))
* **unreleased:** option to output or not unreleased changelog ([9dfe8d8](https://github.com/stevemao/conventional-changelog-core/commit/9dfe8d8)), closes [ajoslin/conventional-changelog#120](https://github.com/ajoslin/conventional-changelog/issues/120)
### BREAKING CHANGES
* unreleased: If `context.version` is the same as the version of the last release, by default the unreleased chagnelog will not output.
<a name="0.0.2"></a>
## [0.0.2](https://github.com/stevemao/conventional-changelog-core/compare/v0.0.1...v0.0.2) (2016-01-30)
### Bug Fixes
* **error:** better error handling ([614ce1a](https://github.com/stevemao/conventional-changelog-core/commit/614ce1a)), closes [ajoslin/conventional-changelog#130](https://github.com/ajoslin/conventional-changelog/issues/130)
<a name="0.0.1"></a>
## 0.0.1 (2015-12-26)
### Features
* **config:** change preset to config ([85fd9d9](https://github.com/stevemao/conventional-changelog-core/commit/85fd9d9))
* **init:** extract core from conventional-changelog ([4a4bca3](https://github.com/stevemao/conventional-changelog-core/commit/4a4bca3))
### BREAKING CHANGES
* config: `options.preset` is removed in favour of `options.config`

21
node_modules/conventional-changelog-core/LICENSE.md generated vendored Normal file
View File

@@ -0,0 +1,21 @@
### MIT License
Copyright © [conventional-changelog team](https://github.com/conventional-changelog)
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

251
node_modules/conventional-changelog-core/README.md generated vendored Normal file
View File

@@ -0,0 +1,251 @@
# [![NPM version][npm-image]][npm-url] [![Build Status: Linux][travis-image]][travis-url] [![Build Status: Windows][appveyor-image]][appveyor-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage Status][coveralls-image]][coveralls-url]
> [conventional-changelog](https://github.com/conventional-changelog/conventional-changelog) core
You are probably looking for the [cli](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-cli) module. Or use one of the plugins if you are already using the tool: [grunt](https://github.com/btford/grunt-conventional-changelog)/[gulp](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/gulp-conventional-changelog)/[atom](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-atom).
## Usage
```sh
$ npm install --save conventional-changelog-core
```
```js
var conventionalChangelogCore = require('conventional-changelog-core');
conventionalChangelogCore()
.pipe(process.stdout); // or any writable stream
```
## API
### conventionalChangelogCore([options, [context, [gitRawCommitsOpts, [parserOpts, [writerOpts]]]]])
Returns a readable stream.
*Note:* [`options.transform`](#transform-1), [`options.pkg.transform`](#transform) and [`writerOpts.transform`](https://github.com/conventional-changelog/conventional-changelog-writer#transform) are different. If you have a better naming suggestion, please send a PR.
#### options
##### config
Type: `promise`, `function` or `object`
This should serve as default values for other arguments of `conventionalChangelogCore` so you don't need to rewrite the same or similar config across your projects. Any value in this could be overwritten.
If this is a promise (recommended if async), it should resolve with the config.
If this is a function, it expects a node style callback with the config object.
If this is an object, it is the config object. The config object should include `context`, `gitRawCommitsOpts`, `parserOpts` and `writerOpts`.
##### pkg
Type: `object`
###### path
Type: `string` Default: [closest package.json](https://github.com/sindresorhus/read-pkg-up).
The location of your "package.json".
###### transform
Type: `function` Default: pass through.
A function that takes `package.json` data as the argument and returns the modified data. Note this is performed before normalizing package.json data. Useful when you need to add a leading 'v' to your version or modify your repository url, etc.
##### append
Type: `boolean` Default: `false`
Should the log be appended to existing data.
##### releaseCount
Type: `number` Default: `1`
How many releases of changelog you want to generate. It counts from the upcoming release. Useful when you forgot to generate any previous changelog. Set to `0` to regenerate all.
##### debug
Type: `function` Default: `function() {}`
A debug function. EG: `console.debug.bind(console)`
##### warn
Type: `function` Default: `options.debug`
A warn function. EG: `grunt.verbose.writeln`
##### transform
Type: `function` Default: get the version (without leading 'v') from tag and format date.
###### function(commit, cb)
A transform function that applies after the parser and before the writer.
This is the place to modify the parsed commits.
####### commit
The commit from conventional-commits-parser.
####### cb
Callback when you are done.
####### this
`this` arg of through2.
##### outputUnreleased
Type: `boolean` Default: `true` if a different version than last release is given. Otherwise `false`.
If this value is `true` and `context.version` equals last release then `context.version` will be changed to `'Unreleased'`.
**NOTE:** You may want to combine this option with `releaseCount` set to `0` to always overwrite the whole CHANGELOG. `conventional-changelog` only outputs a CHANGELOG but doesn't read any existing one.
##### lernaPackage
Specify a package in lerna-style monorepo that the CHANGELOG should be generated for.
Lerna tags releases in the format `foo-package@1.0.0` and assumes that packages
are stored in the directory structure `./packages/foo-package`.
##### tagPrefix
Specify a prefix for the git tag that will be taken into account during the comparison.
For instance if your version tag is prefixed by `version/` instead of `v` you would specify `--tagPrefix=version/`
#### context
See the [conventional-changelog-writer](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-writer) docs. There are some defaults or changes:
##### host
Default: normalized host found in `package.json`.
##### version
Default: version found in `package.json`.
##### owner
Default: extracted from normalized `package.json` `repository.url` field.
##### repository
Default: extracted from normalized `package.json` `repository.url` field.
##### repoUrl
Default: The whole normalized repository url in `package.json`.
##### gitSemverTags
Type: `array`
All git semver tags found in the repository. You can't overwrite this value.
##### previousTag
Type: `string` Default: previous semver tag or the first commit hash if no previous tag.
##### currentTag
Type: `string` Default: current semver tag or `'v'` + version if no current tag.
##### packageData
Type: `object`
Your `package.json` data. You can't overwrite this value.
##### linkCompare
Type: `boolean` Default: `true` if `previousTag` and `currentTag` are truthy.
Should link to the page that compares current tag with previous tag?
#### gitRawCommitsOpts
See the [git-raw-commits](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/git-raw-commits) docs. There are some defaults:
##### format
Default: `'%B%n-hash-%n%H%n-gitTags-%n%d%n-committerDate-%n%ci'`
##### from
Default: based on `options.releaseCount`.
##### reverse
Default: `true` if `options.append` is truthy.
##### debug
Type: `function` Default: `options.debug`
#### parserOpts
See the [conventional-commits-parser](https://github.com/conventional-changelog/conventional-commits-parser) docs.
##### warn
Default: `options.warn`
#### writerOpts
See the [conventional-changelog-writer](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-writer) docs. There are some defaults:
##### finalizeContext
Finalize context is used for generating above context.
**NOTE:** If you overwrite this value the above context defaults will be gone.
##### debug
Type: `function` Default: `options.debug`
##### reverse
Default: `options.append`
##### doFlush
Default: `options.outputUnreleased`
## Notes for parent modules
This module has options `append` and `releaseCount`. However, it doesn't read your previous changelog. Reasons being:
1. The old logs is just to be appended or prepended to the newly generated logs, which is a very simple thing that could be done in the parent module.
2. We want it to be very flexible for the parent module. You could create a readable stream from the file or you could just read the file.
3. We want the duty of this module to be very minimum.
So, when you build a parent module, you need to read the old logs and append or prepend to them based on `options.append`. However, if `options.releaseCount` is `0` you need to ignore any previous logs. Please see [conventional-github-releaser](https://github.com/conventional-changelog/conventional-github-releaser) as an example.
Arguments passed to `conventionalChangelogCore` will be mutated.
## License
MIT
[npm-image]: https://badge.fury.io/js/conventional-changelog-core.svg
[npm-url]: https://npmjs.org/package/conventional-changelog-core
[travis-image]: https://travis-ci.org/conventional-changelog/conventional-changelog-core.svg?branch=master
[travis-url]: https://travis-ci.org/conventional-changelog/conventional-changelog-core
[appveyor-image]: https://ci.appveyor.com/api/projects/status/baoumm34w8c5o0hv/branch/master?svg=true
[appveyor-url]: https://ci.appveyor.com/project/stevemao/conventional-changelog-core/branch/master
[daviddm-image]: https://david-dm.org/conventional-changelog/conventional-changelog-core.svg?theme=shields.io
[daviddm-url]: https://david-dm.org/conventional-changelog/conventional-changelog-core
[coveralls-image]: https://coveralls.io/repos/conventional-changelog/conventional-changelog-core/badge.svg
[coveralls-url]: https://coveralls.io/r/conventional-changelog/conventional-changelog-core

View File

@@ -0,0 +1,21 @@
{
"issue": "issue",
"commit": "commits",
"referenceActions": [
"close",
"closes",
"closed",
"closing",
"fix",
"fixes",
"fixed",
"fixing",
"resolve",
"resolves",
"resolved",
"resolving"
],
"issuePrefixes": [
"#"
]
}

View File

@@ -0,0 +1,19 @@
{
"issue": "issues",
"commit": "commit",
"referenceActions": [
"close",
"closes",
"closed",
"fix",
"fixes",
"fixed",
"resolve",
"resolves",
"resolved"
],
"issuePrefixes": [
"#",
"gh-"
]
}

View File

@@ -0,0 +1,17 @@
{
"issue": "issues",
"commit": "commit",
"referenceActions": [
"close",
"closes",
"closed",
"closing",
"fix",
"fixes",
"fixed",
"fixing"
],
"issuePrefixes": [
"#"
]
}

79
node_modules/conventional-changelog-core/index.js generated vendored Normal file
View File

@@ -0,0 +1,79 @@
'use strict'
var gitRawCommits = require('git-raw-commits')
var conventionalCommitsParser = require('conventional-commits-parser')
var conventionalChangelogWriter = require('conventional-changelog-writer')
var stream = require('stream')
var through = require('through2')
var mergeConfig = require('./lib/merge-config')
function conventionalChangelog (options, context, gitRawCommitsOpts, parserOpts, writerOpts) {
writerOpts = writerOpts || {}
var readable = new stream.Readable({
objectMode: writerOpts.includeDetails
})
readable._read = function () {}
mergeConfig(options, context, gitRawCommitsOpts, parserOpts, writerOpts)
.then(function (data) {
options = data.options
context = data.context
gitRawCommitsOpts = data.gitRawCommitsOpts
parserOpts = data.parserOpts
writerOpts = data.writerOpts
gitRawCommits(gitRawCommitsOpts)
.on('error', function (err) {
err.message = 'Error in git-raw-commits: ' + err.message
setImmediate(readable.emit.bind(readable), 'error', err)
})
.pipe(conventionalCommitsParser(parserOpts))
.on('error', function (err) {
err.message = 'Error in conventional-commits-parser: ' + err.message
setImmediate(readable.emit.bind(readable), 'error', err)
})
// it would be better if `gitRawCommits` could spit out better formatted data
// so we don't need to transform here
.pipe(through.obj(function (chunk, enc, cb) {
try {
options.transform.call(this, chunk, cb)
} catch (err) {
cb(err)
}
}))
.on('error', function (err) {
err.message = 'Error in options.transform: ' + err.message
setImmediate(readable.emit.bind(readable), 'error', err)
})
.pipe(conventionalChangelogWriter(context, writerOpts))
.on('error', function (err) {
err.message = 'Error in conventional-changelog-writer: ' + err.message
setImmediate(readable.emit.bind(readable), 'error', err)
})
.pipe(through({
objectMode: writerOpts.includeDetails
}, function (chunk, enc, cb) {
try {
readable.push(chunk)
} catch (err) {
setImmediate(function () {
throw err
})
}
cb()
}, function (cb) {
readable.push(null)
cb()
}))
})
.catch(function (err) {
setImmediate(readable.emit.bind(readable), 'error', err)
})
return readable
}
module.exports = conventionalChangelog

View File

@@ -0,0 +1,322 @@
'use strict'
var dateFormat = require('dateformat')
var getPkgRepo = require('get-pkg-repo')
var gitSemverTags = require('git-semver-tags')
var normalizePackageData = require('normalize-package-data')
var Q = require('q')
var gitRemoteOriginUrl
try {
gitRemoteOriginUrl = require('git-remote-origin-url')
} catch (err) {
gitRemoteOriginUrl = function () {
return Q.reject(err)
}
}
var readPkg = require('read-pkg')
var readPkgUp = require('read-pkg-up')
var url = require('url')
var _ = require('lodash')
var rhosts = /github|bitbucket|gitlab/i
var rtag = /tag:\s*[v=]?(.+?)[,)]/gi
function semverTagsPromise (options) {
return Q.Promise(function (resolve, reject) {
gitSemverTags(function (err, result) {
if (err) {
reject(err)
} else {
resolve(result)
}
}, {lernaTags: !!options.lernaPackage, package: options.lernaPackage, tagPrefix: options.tagPrefix})
})
}
function guessNextTag (previousTag, version) {
if (previousTag) {
if (previousTag[0] === 'v' && version[0] !== 'v') {
return 'v' + version
}
if (previousTag[0] !== 'v' && version[0] === 'v') {
return version.replace(/^v/, '')
}
return version
}
if (version[0] !== 'v') {
return 'v' + version
}
return version
}
function mergeConfig (options, context, gitRawCommitsOpts, parserOpts, writerOpts) {
var configPromise
var pkgPromise
var gitRemoteOriginUrlPromise
context = context || {}
gitRawCommitsOpts = gitRawCommitsOpts || {}
options = _.merge({
pkg: {
transform: function (pkg) {
return pkg
}
},
append: false,
releaseCount: 1,
debug: function () {},
transform: function (commit, cb) {
if (_.isString(commit.gitTags)) {
var match = rtag.exec(commit.gitTags)
rtag.lastIndex = 0
if (match) {
commit.version = match[1]
}
}
if (commit.committerDate) {
commit.committerDate = dateFormat(commit.committerDate, 'yyyy-mm-dd', true)
}
cb(null, commit)
},
lernaPackage: null
}, options)
options.warn = options.warn || options.debug
if (options.config) {
if (_.isFunction(options.config)) {
configPromise = Q.nfcall(options.config)
} else {
configPromise = Q(options.config)
}
}
if (options.pkg) {
if (options.pkg.path) {
pkgPromise = Q(readPkg(options.pkg.path))
} else {
pkgPromise = Q(readPkgUp())
}
}
gitRemoteOriginUrlPromise = Q(gitRemoteOriginUrl())
return Q.allSettled([configPromise, pkgPromise, semverTagsPromise(options), gitRemoteOriginUrlPromise])
.spread(function (configObj, pkgObj, tagsObj, gitRemoteOriginUrlObj) {
var config
var pkg
var fromTag
var repo
var hostOpts
var gitSemverTags = []
if (configPromise) {
if (configObj.state === 'fulfilled') {
config = configObj.value
} else {
options.warn('Error in config' + configObj.reason.toString())
config = {}
}
} else {
config = {}
}
context = _.assign(context, config.context)
if (options.pkg) {
if (pkgObj.state === 'fulfilled') {
if (options.pkg.path) {
pkg = pkgObj.value
} else {
pkg = pkgObj.value.pkg || {}
}
pkg = options.pkg.transform(pkg)
} else if (options.pkg.path) {
options.warn(pkgObj.reason.toString())
}
}
if ((!pkg || !pkg.repository || !pkg.repository.url) && gitRemoteOriginUrlObj.state === 'fulfilled') {
pkg = pkg || {}
pkg.repository = pkg.repository || {}
pkg.repository.url = gitRemoteOriginUrlObj.value
normalizePackageData(pkg)
}
if (pkg) {
context.version = context.version || pkg.version
try {
repo = getPkgRepo(pkg)
} catch (err) {
repo = {}
}
if (repo.browse) {
var browse = repo.browse()
var parsedBrowse = url.parse(browse)
context.host = context.host || (repo.domain ? (parsedBrowse.protocol + (parsedBrowse.slashes ? '//' : '') + repo.domain) : null)
context.owner = context.owner || repo.user || ''
context.repository = context.repository || repo.project
context.repoUrl = browse
}
context.packageData = pkg
}
context.version = context.version || ''
if (tagsObj.state === 'fulfilled') {
gitSemverTags = context.gitSemverTags = tagsObj.value
fromTag = gitSemverTags[options.releaseCount - 1]
var lastTag = gitSemverTags[0]
if (lastTag === context.version || lastTag === 'v' + context.version) {
if (options.outputUnreleased) {
context.version = 'Unreleased'
} else {
options.outputUnreleased = false
}
}
}
if (!_.isBoolean(options.outputUnreleased)) {
options.outputUnreleased = true
}
if (context.host && (!context.issue || !context.commit || !parserOpts || !parserOpts.referenceActions)) {
var type
if (context.host) {
var match = context.host.match(rhosts)
if (match) {
type = match[0]
}
} else if (repo && repo.type) {
type = repo.type
}
if (type) {
hostOpts = require('../hosts/' + type)
context = _.assign({
issue: hostOpts.issue,
commit: hostOpts.commit
}, context)
} else {
options.warn('Host: "' + context.host + '" does not exist')
hostOpts = {}
}
} else {
hostOpts = {}
}
gitRawCommitsOpts = _.assign({
format: '%B%n-hash-%n%H%n-gitTags-%n%d%n-committerDate-%n%ci',
from: fromTag,
merges: false,
debug: options.debug
},
config.gitRawCommitsOpts,
gitRawCommitsOpts
)
if (options.append) {
gitRawCommitsOpts.reverse = gitRawCommitsOpts.reverse || true
}
parserOpts = _.assign(
{}, config.parserOpts, {
warn: options.warn
},
parserOpts)
if (hostOpts.referenceActions && parserOpts) {
parserOpts.referenceActions = hostOpts.referenceActions
}
if (_.isEmpty(parserOpts.issuePrefixes) && hostOpts.issuePrefixes) {
parserOpts.issuePrefixes = hostOpts.issuePrefixes
}
writerOpts = _.assign({
finalizeContext: function (context, writerOpts, filteredCommits, keyCommit, originalCommits) {
var firstCommit = originalCommits[0]
var lastCommit = originalCommits[originalCommits.length - 1]
var firstCommitHash = firstCommit ? firstCommit.hash : null
var lastCommitHash = lastCommit ? lastCommit.hash : null
if ((!context.currentTag || !context.previousTag) && keyCommit) {
var match = /tag:\s*(.+?)[,)]/gi.exec(keyCommit.gitTags)
var currentTag = context.currentTag
context.currentTag = currentTag || match ? match[1] : null
var index = gitSemverTags.indexOf(context.currentTag)
// if `keyCommit.gitTags` is not a semver
if (index === -1) {
context.currentTag = currentTag || null
} else {
var previousTag = context.previousTag = gitSemverTags[index + 1]
if (!previousTag) {
if (options.append) {
context.previousTag = context.previousTag || firstCommitHash
} else {
context.previousTag = context.previousTag || lastCommitHash
}
}
}
} else {
context.previousTag = context.previousTag || gitSemverTags[0]
if (context.version === 'Unreleased') {
if (options.append) {
context.currentTag = context.currentTag || lastCommitHash
} else {
context.currentTag = context.currentTag || firstCommitHash
}
} else if (!context.currentTag) {
if (options.lernaPackage) {
context.currentTag = options.lernaPackage + '@' + context.version
} else {
context.currentTag = guessNextTag(gitSemverTags[0], context.version)
}
}
}
if (!_.isBoolean(context.linkCompare) && context.previousTag && context.currentTag) {
context.linkCompare = true
}
return context
},
debug: options.debug
},
config.writerOpts, {
reverse: options.append,
doFlush: options.outputUnreleased
},
writerOpts
)
return {
options: options,
context: context,
gitRawCommitsOpts: gitRawCommitsOpts,
parserOpts: parserOpts,
writerOpts: writerOpts
}
})
}
module.exports = mergeConfig

View File

@@ -0,0 +1 @@
../../../conventional-changelog-writer/cli.js

View File

@@ -0,0 +1 @@
../../../conventional-commits-parser/cli.js

View File

@@ -0,0 +1 @@
../../../get-pkg-repo/cli.js

View File

@@ -0,0 +1 @@
../../../git-raw-commits/cli.js

View File

@@ -0,0 +1 @@
../../../git-semver-tags/cli.js

56
node_modules/conventional-changelog-core/package.json generated vendored Normal file
View File

@@ -0,0 +1,56 @@
{
"name": "conventional-changelog-core",
"version": "2.0.11",
"description": "conventional-changelog core",
"repository": {
"type": "git",
"url": "https://github.com/conventional-changelog/conventional-changelog.git"
},
"keywords": [
"conventional-changelog",
"conventional",
"changelog",
"log"
],
"license": "MIT",
"files": [
"index.js",
"lib",
"hosts"
],
"bugs": {
"url": "https://github.com/conventional-changelog/conventional-changelog/issues"
},
"homepage": "https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-core#readme",
"dependencies": {
"conventional-changelog-writer": "^3.0.9",
"conventional-commits-parser": "^2.1.7",
"dateformat": "^3.0.0",
"get-pkg-repo": "^1.0.0",
"git-raw-commits": "^1.3.6",
"git-remote-origin-url": "^2.0.0",
"git-semver-tags": "^1.3.6",
"lodash": "^4.2.1",
"normalize-package-data": "^2.3.5",
"q": "^1.5.1",
"read-pkg": "^1.1.0",
"read-pkg-up": "^1.0.1",
"through2": "^2.0.0"
},
"devDependencies": {
"better-than-before": "^1.0.0",
"conventional-changelog-angular": "^1.6.6",
"git-dummy-commit": "^1.2.0",
"git-tails": "^1.0.0",
"mkdirp": "^0.5.1",
"pinkie-promise": "^2.0.0",
"semver": "^5.5.0",
"shelljs": "^0.8.0",
"tmp": "0.0.33"
},
"scripts": {
"lint": "eslint --fix .",
"test": "mocha --timeout 30000 && npm run-script lint",
"test-windows": "mocha --timeout 30000"
}
}