fix(deps): bump @semantic-release/npm to ^10.0.0-beta.1 (#2670)

This commit is contained in:
Gregor Martynus
2023-01-14 14:14:04 -08:00
committed by GitHub
parent e607e234f3
commit 6a83cb53e5
39 changed files with 1686 additions and 1453 deletions
+17 -17
View File
@@ -1,14 +1,14 @@
import {cloneDeep, isFunction, isPlainObject, noop, omit} from 'lodash-es';
import debugPlugins from 'debug';
import getError from '../get-error.js';
import {extractErrors} from '../utils.js';
import PLUGINS_DEFINITIONS from '../definitions/plugins.js';
import {loadPlugin, parseConfig} from './utils.js';
import { cloneDeep, isFunction, isPlainObject, noop, omit } from "lodash-es";
import debugPlugins from "debug";
import getError from "../get-error.js";
import { extractErrors } from "../utils.js";
import PLUGINS_DEFINITIONS from "../definitions/plugins.js";
import { loadPlugin, parseConfig } from "./utils.js";
const debug = debugPlugins('semantic-release:plugins');
const debug = debugPlugins("semantic-release:plugins");
export default async (context, type, pluginOpt, pluginsPath) => {
const {stdout, stderr, options, logger} = context;
const { stdout, stderr, options, logger } = context;
if (!pluginOpt) {
return noop;
}
@@ -21,26 +21,26 @@ export default async (context, type, pluginOpt, pluginsPath) => {
let func;
if (isFunction(plugin)) {
func = plugin.bind(null, cloneDeep({...options, ...config}));
func = plugin.bind(null, cloneDeep({ ...options, ...config }));
} else if (isPlainObject(plugin) && plugin[type] && isFunction(plugin[type])) {
func = plugin[type].bind(null, cloneDeep({...options, ...config}));
func = plugin[type].bind(null, cloneDeep({ ...options, ...config }));
} else {
throw getError('EPLUGIN', {type, pluginName});
throw getError("EPLUGIN", { type, pluginName });
}
const validator = async (input) => {
const {dryRun, outputValidator} = PLUGINS_DEFINITIONS[type] || {};
const { dryRun, outputValidator } = PLUGINS_DEFINITIONS[type] || {};
try {
if (!input.options.dryRun || dryRun) {
logger.log(`Start step "${type}" of plugin "${pluginName}"`);
const result = await func({
...cloneDeep(omit(input, ['stdout', 'stderr', 'logger'])),
...cloneDeep(omit(input, ["stdout", "stderr", "logger"])),
stdout,
stderr,
logger: logger.scope(logger.scopeName, pluginName),
});
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}"`);
@@ -50,12 +50,12 @@ export default async (context, type, pluginOpt, pluginsPath) => {
logger.warn(`Skip step "${type}" of plugin "${pluginName}" in dry-run mode`);
} catch (error) {
logger.error(`Failed step "${type}" of plugin "${pluginName}"`);
extractErrors(error).forEach((err) => Object.assign(err, {pluginName}));
extractErrors(error).forEach((err) => Object.assign(err, { pluginName }));
throw error;
}
};
Reflect.defineProperty(validator, 'pluginName', {value: pluginName, writable: false, enumerable: true});
Reflect.defineProperty(validator, "pluginName", { value: pluginName, writable: false, enumerable: true });
if (!isFunction(pluginOpt)) {
if (pluginsPath[name]) {
@@ -66,4 +66,4 @@ export default async (context, type, pluginOpt, pluginsPath) => {
}
return validator;
}
};