feat(plugins): add getLastRelease hook

The code to determine the last-release is now in its own repository: https://github.com/semantic-release/last-release-npm
One can overwrite that behavior by defining a "getLastRelease" plugin. This way
one can decouple semantic-release from npm, e.g. by implementing a git-tag
based version. This is already worked on: https://github.com/semantic-release/last-release-git-tag

Closes #56
This commit is contained in:
Ari Porad
2015-08-18 13:56:24 +02:00
committed by Stephan Bönnemann
parent 77349fcdf1
commit 7ceac76689
6 changed files with 14 additions and 111 deletions
+3 -3
View File
@@ -2,14 +2,14 @@ const _ = require('lodash')
const auto = require('run-auto')
const semver = require('semver')
const getLastRelease = require('./lib/last-release')
const getCommits = require('./lib/commits')
const getType = require('./lib/type')
module.exports = function (config, cb) {
const {plugins} = config
const { plugins } = config
auto({
lastRelease: getLastRelease.bind(null, config),
lastRelease: plugins.getLastRelease.bind(null, config),
commits: ['lastRelease', (cb, results) => {
getCommits(_.assign({
lastRelease: results.lastRelease