gulp-bump
Advanced tools
Comparing version 0.1.13 to 0.2.0
@@ -19,3 +19,15 @@ var gulp = require('gulp'); | ||
gulp.task('patch', function(){ | ||
gulp.src('./package.json') | ||
.pipe(bump()) | ||
.pipe(gulp.dest('./build')); | ||
}); | ||
gulp.task('default', ['bump']); | ||
gulp.task('sublevel', function(){ | ||
gulp.src('./sublevel.json') | ||
.pipe(bump({key: 'subversion.version'})) | ||
.pipe(gulp.dest('./build')); | ||
}); | ||
gulp.task('default', ['bump']); |
{ | ||
"name": "gulp-bump", | ||
"description": "Bump npm versions with Gulp (gulpjs.com)", | ||
"version": "0.1.0", | ||
"version": "0.1.9", | ||
"homepage": "http://github.com/stevelacy/gulp-bump", | ||
@@ -6,0 +6,0 @@ "repository": "git://github.com/stevelacy/gulp-bump.git", |
13
index.js
var gutil = require('gulp-util'); | ||
var through = require('through2'); | ||
var semver = require('semver'); | ||
var Dot = require('dot-object'); | ||
@@ -41,3 +42,3 @@ var setDefaultOptions = function(opts) { | ||
var content, json; | ||
var content, json, ver; | ||
@@ -66,2 +67,3 @@ return through.obj(function(file, enc, cb) { | ||
content[key] = version; | ||
ver = content[key]; | ||
} | ||
@@ -71,3 +73,10 @@ else if (semver.valid(content[key])) { | ||
content[key] = semver.inc(content[key], type); | ||
ver = content[key]; | ||
} | ||
else if (key.indexOf('.') > -1) { | ||
var dot = new Dot(); | ||
var value = dot.pick(key, content); | ||
ver = semver.inc(value, type); | ||
dot.str(key, ver, content); | ||
} | ||
else { | ||
@@ -78,5 +87,5 @@ return cb(new gutil.PluginError('gulp-bump', 'Detected invalid semver ' + key, {fileName: file.path, showStack: false})); | ||
gutil.log('Bumped ' + gutil.colors.magenta(key) + ' to: ' + gutil.colors.cyan(content[key])); | ||
gutil.log('Bumped ' + gutil.colors.magenta(key) + ' to: ' + gutil.colors.cyan(ver)); | ||
cb(null, file); | ||
}); | ||
}; |
{ | ||
"name": "gulp-bump", | ||
"description": "Bump npm versions with Gulp (gulpjs.com)", | ||
"version": "0.1.13", | ||
"version": "0.2.0", | ||
"homepage": "http://github.com/stevelacy/gulp-bump", | ||
@@ -10,4 +10,5 @@ "repository": "git://github.com/stevelacy/gulp-bump.git", | ||
"dependencies": { | ||
"gulp-util": "^3.0.1", | ||
"semver": "^2.3.2", | ||
"dot-object": "^0.6.0", | ||
"gulp-util": "^3.0.3", | ||
"semver": "^4.3.0", | ||
"through2": "^0.5.1" | ||
@@ -14,0 +15,0 @@ }, |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
29673
23
707
4
1
+ Addeddot-object@^0.6.0
+ Addedcommander@2.20.3(transitive)
+ Addeddot-object@0.6.0(transitive)
+ Addedsemver@4.3.6(transitive)
- Removedsemver@2.3.2(transitive)
Updatedgulp-util@^3.0.3
Updatedsemver@^4.3.0