gulp-bump
Advanced tools
Comparing version 0.2.2 to 0.3.0
@@ -41,3 +41,3 @@ 'use strict'; | ||
// increment the key with type | ||
content[opts.key] = semver.inc(content[opts.key], opts.type); | ||
content[opts.key] = semver.inc(content[opts.key], opts.type, opts.preid); | ||
ver = content[opts.key]; | ||
@@ -44,0 +44,0 @@ } |
{ | ||
"name": "gulp-bump", | ||
"description": "Bump npm versions with Gulp (gulpjs.com)", | ||
"version": "0.2.2", | ||
"version": "0.3.0", | ||
"homepage": "http://github.com/stevelacy/gulp-bump", | ||
@@ -11,4 +11,4 @@ "repository": "git://github.com/stevelacy/gulp-bump.git", | ||
"dot-object": "^0.6.0", | ||
"gulp-util": "^3.0.3", | ||
"semver": "^4.3.0", | ||
"gulp-util": "^3.0.4", | ||
"semver": "^4.3.1", | ||
"through2": "^0.5.1" | ||
@@ -15,0 +15,0 @@ }, |
@@ -203,3 +203,15 @@ # gulp-bump | ||
### options.preid | ||
Set the prerelase tag to use | ||
Type: `String` | ||
Default: `null` | ||
Example: | ||
```js | ||
bump({type: 'prerelease', preid : 'alphaWhateverTheYWant'}); | ||
// => '0.0.2-alphaWhateverTheYWant.0' | ||
``` | ||
## Versioning | ||
@@ -206,0 +218,0 @@ #### Versioning Used: [Semantic](http://semver.org/) |
@@ -119,2 +119,38 @@ 'use strict'; | ||
}); | ||
it('should bump to a prerelease version with a preid', function(done) { | ||
var fakeFile = new gutil.File({ | ||
contents: new Buffer('{ "version": "0.0.1"}'), | ||
path: 'test/fixtures/test.json' | ||
}); | ||
var bumpS = bump({type: 'prerelease', preid : 'alphaWhateverTheYWant'}); | ||
bumpS.once('data', function(newFile) { | ||
should.exist(newFile); | ||
should.exist(newFile.contents); | ||
JSON.parse(newFile.contents.toString()).version.should.equal('0.0.2-alphaWhateverTheYWant.0'); | ||
return done(); | ||
}); | ||
bumpS.write(fakeFile); | ||
bumpS.end(); | ||
}); | ||
it('should bump preid version', function(done) { | ||
var fakeFile = new gutil.File({ | ||
contents: new Buffer('{ "version": "0.1.0-zeta.1"}'), | ||
path: 'test/fixtures/test.json' | ||
}); | ||
var bumpS = bump({type: 'prerelease', preid: 'zeta'}); | ||
bumpS.once('data', function(newFile) { | ||
should.exist(newFile); | ||
should.exist(newFile.contents); | ||
JSON.parse(newFile.contents.toString()).version.should.equal('0.1.0-zeta.2'); | ||
return done(); | ||
}); | ||
bumpS.write(fakeFile); | ||
bumpS.end(); | ||
}); | ||
}); |
31980
746
258
Updatedgulp-util@^3.0.4
Updatedsemver@^4.3.1