This commit removes babel/es6 from all source and test files, because it was introducing a lot of overhead and only little gain. This commit fixes and enables integration tests on Travis. This commit fixes #153 and #151 along the way. _Originally this commit should have only removed babel, but without working tests that's a bit too hairy._ _I only realized that half way into removing babel/es6, so things are all over the place now._ Closes #153, Closes #151
48 lines
1.1 KiB
JavaScript
48 lines
1.1 KiB
JavaScript
var parseSlug = require('parse-github-repo-url')
|
|
|
|
var SemanticReleaseError = require('@semantic-release/error')
|
|
|
|
module.exports = function (config) {
|
|
var pkg = config.pkg
|
|
var options = config.options
|
|
var env = config.env
|
|
var errors = []
|
|
|
|
if (!pkg.name) {
|
|
errors.push(new SemanticReleaseError(
|
|
'No "name" found in package.json.',
|
|
'ENOPKGNAME'
|
|
))
|
|
}
|
|
|
|
if (!pkg.repository || !pkg.repository.url) {
|
|
errors.push(new SemanticReleaseError(
|
|
'No "repository" found in package.json.',
|
|
'ENOPKGREPO'
|
|
))
|
|
} else if (!parseSlug(pkg.repository.url)) {
|
|
errors.push(new SemanticReleaseError(
|
|
'The "repository" field in the package.json is malformed.',
|
|
'EMALFORMEDPKGREPO'
|
|
))
|
|
}
|
|
|
|
if (options.debug) return errors
|
|
|
|
if (!options.githubToken) {
|
|
errors.push(new SemanticReleaseError(
|
|
'No github token specified.',
|
|
'ENOGHTOKEN'
|
|
))
|
|
}
|
|
|
|
if (!(env.NPM_TOKEN || (env.NPM_OLD_TOKEN && env.NPM_EMAIL))) {
|
|
errors.push(new SemanticReleaseError(
|
|
'No npm token specified.',
|
|
'ENONPMTOKEN'
|
|
))
|
|
}
|
|
|
|
return errors
|
|
}
|