Skip to content
Permalink
Browse files

chore(package): update xo to version 0.24.0

  • Loading branch information...
greenkeeper authored and pvdlg committed Jan 14, 2019
1 parent 1b7d8b2 commit 448a0ff977fda5ad44c96571367f60e6fcdee73a
@@ -3,7 +3,7 @@
// Bad news: We have to write plain ES5 in this file
// Good news: It's the only file of the entire project

/* eslint-disable no-var, promise/prefer-await-to-then, prefer-destructuring */
/* eslint-disable no-var */

var semver = require('semver');
var execa = require('execa');
4 cli.js
@@ -1,4 +1,4 @@
const {argv, env, stderr} = require('process');
const {argv, env, stderr} = require('process'); // eslint-disable-line node/prefer-global/process
const util = require('util');
const hideSensitive = require('./lib/hide-sensitive');

@@ -51,12 +51,14 @@ Usage:
// Debug must be enabled before other requires in order to work
require('debug').enable('semantic-release:*');
}

await require('.')(opts);
return 0;
} catch (error) {
if (error.name !== 'YError') {
stderr.write(hideSensitive(env)(util.inspect(error, {colors: true})));
}

return 1;
}
};
@@ -52,6 +52,7 @@ async function run(context, plugins) {
);
return false;
}

logger[options.dryRun ? 'warn' : 'success'](
`Run automated release from branch ${ciBranch}${options.dryRun ? ' in dry-run mode' : ''}`
);
@@ -70,6 +71,7 @@ async function run(context, plugins) {
);
return false;
}

throw error;
}
} catch (error) {
@@ -92,6 +94,7 @@ async function run(context, plugins) {
logger.log('There are no relevant changes, so no new version is released.');
return false;
}

context.nextRelease = nextRelease;
nextRelease.version = getNextVersion(context);
nextRelease.gitTag = template(options.tagFormat)({version: nextRelease.version});
@@ -1,10 +1,9 @@
const url = require('url');
const {inspect} = require('util');
const {toLower, isString} = require('lodash');
const pkg = require('../../package.json');
const {RELEASE_TYPE} = require('./constants');

const homepage = url.format({...url.parse(pkg.homepage), hash: null});
const [homepage] = pkg.homepage.split('#');
const stringify = obj => (isString(obj) ? obj : inspect(obj, {breakLength: Infinity, depth: 2, maxArrayLength: 5}));
const linkify = file => `${homepage}/blob/master/${file}`;

@@ -59,6 +59,7 @@ module.exports = {
// Regenerate the release notes
context.nextRelease.notes = await generateNotes(context);
}

// Call the next prepare plugin with the updated `nextRelease`
return context;
},
@@ -30,6 +30,7 @@ module.exports = async (context, opts) => {
if (options.ci === false) {
options.noCi = true;
}

const pluginsPath = {};
let extendPaths;
({extends: extendPaths, ...options} = options);
@@ -1,4 +1,4 @@
const {parse, format} = require('url');
const {parse, format} = require('url'); // eslint-disable-line node/no-deprecated-api
const {isNil} = require('lodash');
const hostedGitInfo = require('hosted-git-info');
const {verifyAuth} = require('./git');
@@ -57,10 +57,12 @@ module.exports = (context, pluginsPath) => {
plugin ? [plugin[0], Object.assign(plugin[1], options[type])] : plugin
);
}

if (!validateStep({required}, options[type])) {
errors.push(getError('EPLUGINCONF', {type, required, pluginConf: options[type]}));
return pluginsConf;
}

pluginOpts = options[type];
}

@@ -40,9 +40,11 @@ module.exports = (context, type, pluginOpt, pluginsPath) => {
if (outputValidator && !outputValidator(result)) {
throw getError(`E${type.toUpperCase()}OUTPUT`, {result, pluginName});
}

logger.success(`Completed step "${type}" of plugin "${pluginName}"`);
return result;
}

logger.warn(`Skip step "${type}" of plugin "${pluginName}" in dry-run mode`);
} catch (error) {
logger.error(`Failed step "${type}" of plugin "${pluginName}"`);
@@ -44,6 +44,7 @@ module.exports = (steps, {settleAll = false, getNextInput = identity, transform
throw error;
}
}

// Prepare input for the next step, passing the input of the last iteration (or initial parameter for the first iteration) and the result of the current one
return getNextInput(lastInput, result);
},
@@ -52,5 +53,6 @@ module.exports = (steps, {settleAll = false, getNextInput = identity, transform
if (errors.length > 0) {
throw new AggregateError(errors);
}

return results;
};
@@ -12,6 +12,7 @@ const validateSteps = conf => {
) {
return true;
}

conf = castArray(conf);

if (conf.length !== 1) {
@@ -39,6 +40,7 @@ function validateStep({required}, conf) {
if (required) {
return conf.length >= 1 && validateSteps(conf);
}

return conf.length === 0 || validateSteps(conf);
}

@@ -59,6 +61,7 @@ function parseConfig(plugin) {
} else {
path = plugin;
}

return [path, config || {}];
}

@@ -66,7 +66,7 @@
"sinon": "^7.1.1",
"stream-buffers": "^3.0.2",
"tempy": "^0.2.1",
"xo": "^0.23.0"
"xo": "^0.24.0"
},
"engines": {
"node": ">=8.3"

0 comments on commit 448a0ff

Please sign in to comment.
You can’t perform that action at this time.