rocketmake-semver
Advanced tools
Comparing version 0.2.0 to 0.3.0
61
index.js
@@ -6,23 +6,35 @@ var Promise = require("bluebird"); | ||
var padZeroes = function pad(num) { | ||
var s = "00000" + num; | ||
return s.substr(s.length-5); | ||
} | ||
module.exports = function(buildType){ | ||
switch(buildType){ | ||
case 'prod': | ||
return getVersionFromLastTag().then(function(num) { | ||
return { | ||
semver: num, | ||
dotnetversion: num + '.0', | ||
mobileversion: num | ||
}; | ||
return getVersionFromLastTag().then(function(version) { | ||
return getCommitsSinceRootTag().then(function(commitsSinceRoot) { | ||
return { | ||
semver: version, | ||
dotnetversion: version + '.0', | ||
mobileversion: version, | ||
commitCountVersion: commitsSinceRoot | ||
}; | ||
}); | ||
}); | ||
case 'test': | ||
return getNextVersionFromBranchName().then(function(num) { | ||
return getCommitsSinceLastTag().then(function(sub) { | ||
return { | ||
semver: num + '-test-' + sub, | ||
dotnetversion: num + '.' + sub, | ||
mobileversion: num | ||
}; | ||
return getNextVersionFromBranchName().then(function(version) { | ||
return getCommitsSinceLastTag().then(function(commitsSinceLastTag) { | ||
return getCommitsSinceRootTag().then(function(commitsSinceRoot) { | ||
return { | ||
semver: version + '-test-' + padZeroes(commitsSinceLastTag), | ||
dotnetversion: version + '.' + commitsSinceLastTag, | ||
mobileversion: version, | ||
commitCountVersion: commitsSinceRoot | ||
}; | ||
}); | ||
}); | ||
@@ -34,7 +46,8 @@ }); | ||
case 'demo': | ||
return getCommitsSinceRootTag().then(function(sub) { | ||
return getCommitsSinceRootTag().then(function(commitsSinceRoot) { | ||
return { | ||
semver: '0.0.0-' + buildType + '-' + sub, | ||
dotnetversion: '0.0.0.' + sub, | ||
mobileversion: '0.0.0' | ||
semver: '0.0.0-' + buildType + '-' + padZeroes(commitsSinceRoot), | ||
dotnetversion: '0.0.0.' + commitsSinceRoot, | ||
mobileversion: '0.0.0', | ||
commitCountVersion: commitsSinceRoot | ||
}; | ||
@@ -46,8 +59,10 @@ }); | ||
_v = incrementPatchNumber(num); | ||
return { | ||
semver: _v + '-local-' + Date.now(), | ||
dotnetversion: _v + '.0', | ||
mobileversion: _v | ||
}; | ||
return getCommitsSinceRootTag().then(function(commitsSinceRoot) { | ||
return { | ||
semver: _v + '-local-' + Date.now(), | ||
dotnetversion: _v + '.0', | ||
mobileversion: _v, | ||
commitCountVersion: commitsSinceRoot | ||
}; | ||
}); | ||
}); | ||
@@ -54,0 +69,0 @@ |
{ | ||
"name": "rocketmake-semver", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"dependencies": { | ||
@@ -5,0 +5,0 @@ "bluebird": "^2.9.25", |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
3094
89
1