chore(package): update xo to version 0.24.0
This commit is contained in:
		
							parent
							
								
									1b7d8b2d21
								
							
						
					
					
						commit
						448a0ff977
					
				| @ -3,7 +3,7 @@ | |||||||
| // Bad news: We have to write plain ES5 in this file
 | // Bad news: We have to write plain ES5 in this file
 | ||||||
| // Good news: It's the only file of the entire project
 | // 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 semver = require('semver'); | ||||||
| var execa = require('execa'); | var execa = require('execa'); | ||||||
|  | |||||||
							
								
								
									
										4
									
								
								cli.js
									
									
									
									
									
								
							
							
						
						
									
										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 util = require('util'); | ||||||
| const hideSensitive = require('./lib/hide-sensitive'); | const hideSensitive = require('./lib/hide-sensitive'); | ||||||
| 
 | 
 | ||||||
| @ -51,12 +51,14 @@ Usage: | |||||||
|       // Debug must be enabled before other requires in order to work
 |       // Debug must be enabled before other requires in order to work
 | ||||||
|       require('debug').enable('semantic-release:*'); |       require('debug').enable('semantic-release:*'); | ||||||
|     } |     } | ||||||
|  | 
 | ||||||
|     await require('.')(opts); |     await require('.')(opts); | ||||||
|     return 0; |     return 0; | ||||||
|   } catch (error) { |   } catch (error) { | ||||||
|     if (error.name !== 'YError') { |     if (error.name !== 'YError') { | ||||||
|       stderr.write(hideSensitive(env)(util.inspect(error, {colors: true}))); |       stderr.write(hideSensitive(env)(util.inspect(error, {colors: true}))); | ||||||
|     } |     } | ||||||
|  | 
 | ||||||
|     return 1; |     return 1; | ||||||
|   } |   } | ||||||
| }; | }; | ||||||
|  | |||||||
							
								
								
									
										3
									
								
								index.js
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								index.js
									
									
									
									
									
								
							| @ -52,6 +52,7 @@ async function run(context, plugins) { | |||||||
|     ); |     ); | ||||||
|     return false; |     return false; | ||||||
|   } |   } | ||||||
|  | 
 | ||||||
|   logger[options.dryRun ? 'warn' : 'success']( |   logger[options.dryRun ? 'warn' : 'success']( | ||||||
|     `Run automated release from branch ${ciBranch}${options.dryRun ? ' in dry-run mode' : ''}` |     `Run automated release from branch ${ciBranch}${options.dryRun ? ' in dry-run mode' : ''}` | ||||||
|   ); |   ); | ||||||
| @ -70,6 +71,7 @@ async function run(context, plugins) { | |||||||
|         ); |         ); | ||||||
|         return false; |         return false; | ||||||
|       } |       } | ||||||
|  | 
 | ||||||
|       throw error; |       throw error; | ||||||
|     } |     } | ||||||
|   } catch (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.'); |     logger.log('There are no relevant changes, so no new version is released.'); | ||||||
|     return false; |     return false; | ||||||
|   } |   } | ||||||
|  | 
 | ||||||
|   context.nextRelease = nextRelease; |   context.nextRelease = nextRelease; | ||||||
|   nextRelease.version = getNextVersion(context); |   nextRelease.version = getNextVersion(context); | ||||||
|   nextRelease.gitTag = template(options.tagFormat)({version: nextRelease.version}); |   nextRelease.gitTag = template(options.tagFormat)({version: nextRelease.version}); | ||||||
|  | |||||||
| @ -1,10 +1,9 @@ | |||||||
| const url = require('url'); |  | ||||||
| const {inspect} = require('util'); | const {inspect} = require('util'); | ||||||
| const {toLower, isString} = require('lodash'); | const {toLower, isString} = require('lodash'); | ||||||
| const pkg = require('../../package.json'); | const pkg = require('../../package.json'); | ||||||
| const {RELEASE_TYPE} = require('./constants'); | 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 stringify = obj => (isString(obj) ? obj : inspect(obj, {breakLength: Infinity, depth: 2, maxArrayLength: 5})); | ||||||
| const linkify = file => `${homepage}/blob/master/${file}`; | const linkify = file => `${homepage}/blob/master/${file}`; | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -59,6 +59,7 @@ module.exports = { | |||||||
|           // Regenerate the release notes
 |           // Regenerate the release notes
 | ||||||
|           context.nextRelease.notes = await generateNotes(context); |           context.nextRelease.notes = await generateNotes(context); | ||||||
|         } |         } | ||||||
|  | 
 | ||||||
|         // Call the next prepare plugin with the updated `nextRelease`
 |         // Call the next prepare plugin with the updated `nextRelease`
 | ||||||
|         return context; |         return context; | ||||||
|       }, |       }, | ||||||
|  | |||||||
| @ -30,6 +30,7 @@ module.exports = async (context, opts) => { | |||||||
|   if (options.ci === false) { |   if (options.ci === false) { | ||||||
|     options.noCi = true; |     options.noCi = true; | ||||||
|   } |   } | ||||||
|  | 
 | ||||||
|   const pluginsPath = {}; |   const pluginsPath = {}; | ||||||
|   let extendPaths; |   let extendPaths; | ||||||
|   ({extends: extendPaths, ...options} = options); |   ({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 {isNil} = require('lodash'); | ||||||
| const hostedGitInfo = require('hosted-git-info'); | const hostedGitInfo = require('hosted-git-info'); | ||||||
| const {verifyAuth} = require('./git'); | const {verifyAuth} = require('./git'); | ||||||
|  | |||||||
| @ -57,10 +57,12 @@ module.exports = (context, pluginsPath) => { | |||||||
|             plugin ? [plugin[0], Object.assign(plugin[1], options[type])] : plugin |             plugin ? [plugin[0], Object.assign(plugin[1], options[type])] : plugin | ||||||
|           ); |           ); | ||||||
|         } |         } | ||||||
|  | 
 | ||||||
|         if (!validateStep({required}, options[type])) { |         if (!validateStep({required}, options[type])) { | ||||||
|           errors.push(getError('EPLUGINCONF', {type, required, pluginConf: options[type]})); |           errors.push(getError('EPLUGINCONF', {type, required, pluginConf: options[type]})); | ||||||
|           return pluginsConf; |           return pluginsConf; | ||||||
|         } |         } | ||||||
|  | 
 | ||||||
|         pluginOpts = options[type]; |         pluginOpts = options[type]; | ||||||
|       } |       } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -40,9 +40,11 @@ module.exports = (context, type, pluginOpt, pluginsPath) => { | |||||||
|         if (outputValidator && !outputValidator(result)) { |         if (outputValidator && !outputValidator(result)) { | ||||||
|           throw getError(`E${type.toUpperCase()}OUTPUT`, {result, pluginName}); |           throw getError(`E${type.toUpperCase()}OUTPUT`, {result, pluginName}); | ||||||
|         } |         } | ||||||
|  | 
 | ||||||
|         logger.success(`Completed step "${type}" of plugin "${pluginName}"`); |         logger.success(`Completed step "${type}" of plugin "${pluginName}"`); | ||||||
|         return result; |         return result; | ||||||
|       } |       } | ||||||
|  | 
 | ||||||
|       logger.warn(`Skip step "${type}" of plugin "${pluginName}" in dry-run mode`); |       logger.warn(`Skip step "${type}" of plugin "${pluginName}" in dry-run mode`); | ||||||
|     } catch (error) { |     } catch (error) { | ||||||
|       logger.error(`Failed step "${type}" of plugin "${pluginName}"`); |       logger.error(`Failed step "${type}" of plugin "${pluginName}"`); | ||||||
|  | |||||||
| @ -44,6 +44,7 @@ module.exports = (steps, {settleAll = false, getNextInput = identity, transform | |||||||
|           throw error; |           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
 |       // 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); |       return getNextInput(lastInput, result); | ||||||
|     }, |     }, | ||||||
| @ -52,5 +53,6 @@ module.exports = (steps, {settleAll = false, getNextInput = identity, transform | |||||||
|   if (errors.length > 0) { |   if (errors.length > 0) { | ||||||
|     throw new AggregateError(errors); |     throw new AggregateError(errors); | ||||||
|   } |   } | ||||||
|  | 
 | ||||||
|   return results; |   return results; | ||||||
| }; | }; | ||||||
|  | |||||||
| @ -12,6 +12,7 @@ const validateSteps = conf => { | |||||||
|     ) { |     ) { | ||||||
|       return true; |       return true; | ||||||
|     } |     } | ||||||
|  | 
 | ||||||
|     conf = castArray(conf); |     conf = castArray(conf); | ||||||
| 
 | 
 | ||||||
|     if (conf.length !== 1) { |     if (conf.length !== 1) { | ||||||
| @ -39,6 +40,7 @@ function validateStep({required}, conf) { | |||||||
|   if (required) { |   if (required) { | ||||||
|     return conf.length >= 1 && validateSteps(conf); |     return conf.length >= 1 && validateSteps(conf); | ||||||
|   } |   } | ||||||
|  | 
 | ||||||
|   return conf.length === 0 || validateSteps(conf); |   return conf.length === 0 || validateSteps(conf); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| @ -59,6 +61,7 @@ function parseConfig(plugin) { | |||||||
|   } else { |   } else { | ||||||
|     path = plugin; |     path = plugin; | ||||||
|   } |   } | ||||||
|  | 
 | ||||||
|   return [path, config || {}]; |   return [path, config || {}]; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -66,7 +66,7 @@ | |||||||
|     "sinon": "^7.1.1", |     "sinon": "^7.1.1", | ||||||
|     "stream-buffers": "^3.0.2", |     "stream-buffers": "^3.0.2", | ||||||
|     "tempy": "^0.2.1", |     "tempy": "^0.2.1", | ||||||
|     "xo": "^0.23.0" |     "xo": "^0.24.0" | ||||||
|   }, |   }, | ||||||
|   "engines": { |   "engines": { | ||||||
|     "node": ">=8.3" |     "node": ">=8.3" | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user