feat: Expect plugins to return Promises
BREAKING CHANGE: Each plugin is expected to return an async function or a Promise returning function. The callback parameter is not passed to plugins anymore.
This commit is contained in:
Vendored
+6
-19
@@ -1,21 +1,8 @@
|
||||
module.exports = {
|
||||
verifyConditions(config, options, cb) {
|
||||
cb();
|
||||
},
|
||||
|
||||
getLastRelease(config, options, cb) {
|
||||
cb();
|
||||
},
|
||||
analyzeCommits(config, options, cb) {
|
||||
cb();
|
||||
},
|
||||
verifyRelease(config, options, cb) {
|
||||
cb();
|
||||
},
|
||||
generateNotes(config, options, cb) {
|
||||
cb();
|
||||
},
|
||||
publish(config, options, cb) {
|
||||
cb();
|
||||
},
|
||||
verifyConditions: () => {},
|
||||
getLastRelease: () => {},
|
||||
analyzeCommits: () => {},
|
||||
verifyRelease: () => {},
|
||||
generateNotes: () => {},
|
||||
publish: () => {},
|
||||
};
|
||||
|
||||
+2
-2
@@ -9,6 +9,6 @@ class InheritedError extends SemanticReleaseError {
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = function(config, options, cb) {
|
||||
cb(new InheritedError('Inherited error', 'EINHERITED'));
|
||||
module.exports = () => {
|
||||
throw new InheritedError('Inherited error', 'EINHERITED');
|
||||
};
|
||||
|
||||
Vendored
+2
-2
@@ -1,5 +1,5 @@
|
||||
module.exports = function(config, options, cb) {
|
||||
module.exports = () => {
|
||||
const error = new Error('a');
|
||||
error.errorProperty = 'errorProperty';
|
||||
cb(error);
|
||||
throw error;
|
||||
};
|
||||
|
||||
Vendored
+1
-3
@@ -1,3 +1 @@
|
||||
module.exports = (config, options, cb) => {
|
||||
cb(null);
|
||||
};
|
||||
module.exports = () => {};
|
||||
|
||||
+1
-3
@@ -1,3 +1 @@
|
||||
module.exports = function(pluginConfig, options, cb) {
|
||||
cb(null, {pluginConfig, options});
|
||||
};
|
||||
module.exports = (pluginConfig, options) => ({pluginConfig, options});
|
||||
|
||||
Reference in New Issue
Block a user