This commit is contained in:
Gregor Martynus
2021-07-30 13:57:35 -07:00
parent d9605a5e45
commit ce263c5f4a
67 changed files with 4180 additions and 323 deletions
+8 -8
View File
@@ -1,12 +1,12 @@
const {identity, isPlainObject, omit, castArray, isNil, isString} = require('lodash');
const AggregateError = require('aggregate-error');
const getError = require('../get-error');
const PLUGINS_DEFINITIONS = require('../definitions/plugins');
const {validatePlugin, validateStep, loadPlugin, parseConfig} = require('./utils');
const pipeline = require('./pipeline');
const normalize = require('./normalize');
import {identity, isPlainObject, omit, castArray, isNil, isString} from 'lodash';
import AggregateError from 'aggregate-error';
import getError from '../get-error.js';
import PLUGINS_DEFINITIONS from '../definitions/plugins.js';
import {validatePlugin, validateStep, loadPlugin, parseConfig} from './utils.js';
import pipeline from './pipeline.js';
import normalize from './normalize.js';
module.exports = (context, pluginsPath) => {
export default (context, pluginsPath) => {
let {options, logger} = context;
const errors = [];
+8 -7
View File
@@ -1,11 +1,12 @@
const {isPlainObject, isFunction, noop, cloneDeep, omit} = require('lodash');
const debug = require('debug')('semantic-release:plugins');
const getError = require('../get-error');
const {extractErrors} = require('../utils');
const PLUGINS_DEFINITIONS = require('../definitions/plugins');
const {loadPlugin, parseConfig} = require('./utils');
import {isPlainObject, isFunction, noop, cloneDeep, omit} from 'lodash';
import debugFactory from 'debug';
const debug = debugFactory('semantic-release:plugins');
import getError from '../get-error.js';
import {extractErrors} from '../utils.js';
import PLUGINS_DEFINITIONS from '../definitions/plugins.js';
import {loadPlugin, parseConfig} from './utils.js';
module.exports = (context, type, pluginOpt, pluginsPath) => {
export default (context, type, pluginOpt, pluginsPath) => {
const {stdout, stderr, options, logger} = context;
if (!pluginOpt) {
return noop;
+5 -5
View File
@@ -1,7 +1,7 @@
const {identity} = require('lodash');
const pReduce = require('p-reduce');
const AggregateError = require('aggregate-error');
const {extractErrors} = require('../utils');
import {identity} from 'lodash';
import pReduce from 'p-reduce';
import AggregateError from 'aggregate-error';
import {extractErrors} from '../utils.js';
/**
* A Function that execute a list of function sequencially. If at least one Function ins the pipeline throws an Error or rejects, the pipeline function rejects as well.
@@ -25,7 +25,7 @@ const {extractErrors} = require('../utils');
*
* @return {Pipeline} A Function that execute the `steps` sequencially
*/
module.exports = (steps, {settleAll = false, getNextInput = identity, transform = identity} = {}) => async (input) => {
export default (steps, {settleAll = false, getNextInput = identity, transform = identity} = {}) => async (input) => {
const results = [];
const errors = [];
await pReduce(
+12 -4
View File
@@ -1,6 +1,6 @@
const {dirname} = require('path');
const {isString, isFunction, castArray, isArray, isPlainObject, isNil} = require('lodash');
const resolveFrom = require('resolve-from');
import {dirname} from 'path';
import {isString, isFunction, castArray, isArray, isPlainObject, isNil} from 'lodash';
import resolveFrom from 'resolve-from';
const validateSteps = (conf) => {
return conf.every((conf) => {
@@ -65,4 +65,12 @@ function parseConfig(plugin) {
return [path, config || {}];
}
module.exports = {validatePlugin, validateStep, loadPlugin, parseConfig};
const exported = {
validatePlugin,
validateStep,
loadPlugin,
parseConfig,
};
export default exported;
export {validatePlugin, validateStep, loadPlugin, parseConfig};