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:
Pierre Vanduynslager
2017-11-24 21:56:15 -05:00
parent d4c7605f68
commit 5bec59b26b
9 changed files with 37 additions and 60 deletions
+6 -19
View File
@@ -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
View File
@@ -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');
};
+2 -2
View File
@@ -1,5 +1,5 @@
module.exports = function(config, options, cb) {
module.exports = () => {
const error = new Error('a');
error.errorProperty = 'errorProperty';
cb(error);
throw error;
};
+1 -3
View File
@@ -1,3 +1 @@
module.exports = (config, options, cb) => {
cb(null);
};
module.exports = () => {};
+1 -3
View File
@@ -1,3 +1 @@
module.exports = function(pluginConfig, options, cb) {
cb(null, {pluginConfig, options});
};
module.exports = (pluginConfig, options) => ({pluginConfig, options});