You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by fi...@apache.org on 2017/01/23 21:46:39 UTC
cordova-coho git commit: validate manually-entered new plugin version
with semver module.
Repository: cordova-coho
Updated Branches:
refs/heads/plugins-releaser dd89b8284 -> d634b15e6
validate manually-entered new plugin version with semver module.
Project: http://git-wip-us.apache.org/repos/asf/cordova-coho/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-coho/commit/d634b15e
Tree: http://git-wip-us.apache.org/repos/asf/cordova-coho/tree/d634b15e
Diff: http://git-wip-us.apache.org/repos/asf/cordova-coho/diff/d634b15e
Branch: refs/heads/plugins-releaser
Commit: d634b15e6d011e023990196ee7c6ababa08954e2
Parents: dd89b82
Author: filmaj <ma...@gmail.com>
Authored: Mon Jan 23 13:46:31 2017 -0800
Committer: filmaj <ma...@gmail.com>
Committed: Mon Jan 23 13:46:31 2017 -0800
----------------------------------------------------------------------
src/plugin-release.js | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/d634b15e/src/plugin-release.js
----------------------------------------------------------------------
diff --git a/src/plugin-release.js b/src/plugin-release.js
index 1693577..ac5530c 100644
--- a/src/plugin-release.js
+++ b/src/plugin-release.js
@@ -36,6 +36,7 @@ var repoclone = require('./repo-clone');
var reporeset = require('./repo-reset');
var jira_client = require('jira-client');
var inquirer = require('inquirer');
+var semver = require('semver');
var print = apputil.print;
/*
@@ -329,20 +330,26 @@ function *interactive_plugins_release() {
message: 'Please tweak and compile ' + plugin + ' release notes',
default: tweak_release_notes.createNotes(plugin, data.current_release, changes)
});
- // TODO: need a validate function to ensure semver adherence
+ /* - what's the average case? just a patch bump? perhaps, for each plugin, show release notes and let RM override version beyond patch bump if RM believes it is necessary? */
release_note_prompts.push({
type: 'input',
name: plugin + '-version',
message: 'Please enter a semver-compatible version number for this release of ' + plugin + ', based on the changes below:\n' + changes,
- default: data.current_release
+ default: data.current_release,
+ validate: function(input) {
+ if (semver.valid(input)) {
+ return true;
+ } else {
+ return 'That\'s not a valid semver version!';
+ }
+ }
});
});
return inquirer.prompt(release_note_prompts);
}).then(function(release_notes) {
console.log('release notes!', release_notes);
});
- /* - what's the average case? just a patch bump? perhaps, for each plugin, show release notes and let RM override version beyond patch bump if RM believes it is necessary?
- * - while reviewing changes for version bump, this is probably the right time to aggregate release notes. once aggregated, write them out to RELEASENOTES.md
+ /*
* - commit changes to versions and release notes together with description '$JIRA Updated version and release notes for release $v'
* - tag each plugin repo with $v*/
}, function(auth_err) {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org