refactor: pass complete context
to lib/plugins/normalize.js
This commit is contained in:
parent
0626d57116
commit
c57443500f
@ -5,7 +5,8 @@ const PLUGINS_DEFINITIONS = require('../definitions/plugins');
|
||||
const pipeline = require('./pipeline');
|
||||
const normalize = require('./normalize');
|
||||
|
||||
module.exports = ({cwd, options, logger}, pluginsPath) => {
|
||||
module.exports = (context, pluginsPath) => {
|
||||
const {options, logger} = context;
|
||||
const errors = [];
|
||||
const plugins = Object.entries(PLUGINS_DEFINITIONS).reduce(
|
||||
(
|
||||
@ -30,7 +31,7 @@ module.exports = ({cwd, options, logger}, pluginsPath) => {
|
||||
}
|
||||
|
||||
const steps = castArray(pluginOpts).map(pluginOpt =>
|
||||
normalize({cwd, options: omit(options, Object.keys(PLUGINS_DEFINITIONS)), logger}, type, pluginOpt, pluginsPath)
|
||||
normalize({...context, options: omit(options, Object.keys(PLUGINS_DEFINITIONS))}, type, pluginOpt, pluginsPath)
|
||||
);
|
||||
|
||||
plugins[type] = async input =>
|
||||
|
Loading…
x
Reference in New Issue
Block a user