Skip to content

Commit

Permalink
add gulp commands to help package versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
jpoon committed Mar 21, 2016
1 parent 6bf6cfc commit 9d62576
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
21 changes: 19 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,33 @@ var gulp = require('gulp'),
shell = require('gulp-shell'),
mocha = require('gulp-mocha'),
soften = require('gulp-soften'),
git = require('gulp-git'),
bump = require('gulp-bump'),
filter = require('gulp-filter'),
tag_version = require('gulp-tag-version'),
trimlines = require('gulp-trimlines');

var paths = {
scripts_ts: "src/**/*.ts",
tests_ts: "test/**/*.ts"
};

function versionBump(importance) {
return gulp.src(['./package.json'])
.pipe(bump({type: importance}))
.pipe(gulp.dest('./'))
.pipe(git.commit('bump package version'))
.pipe(filter('package.json'))
.pipe(tag_version());
}

gulp.task('patch', function() { return versionBump('patch'); })
gulp.task('feature', function() { return versionBump('minor'); })
gulp.task('release', function() { return versionBump('major'); })

gulp.task('typings', function () {
// reinstall typescript definitions
return gulp.src('./typings.json')
.pipe(typings());
.pipe(typings());
});

gulp.task('fix-whitespace', function() {
Expand Down Expand Up @@ -42,3 +58,4 @@ gulp.task('compile', shell.task([

gulp.task('init', ['typings']);
gulp.task('default', ['tslint', 'compile']);
gulp.task('release', ['default', 'patch']);
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,13 @@
},
"devDependencies": {
"gulp": "^3.9.1",
"gulp-bump": "^2.0.1",
"gulp-filter": "^4.0.0",
"gulp-git": "^1.7.0",
"gulp-mocha": "^2.2.0",
"gulp-shell": "^0.5.2",
"gulp-soften": "^0.0.1",
"gulp-tag-version": "^1.3.0",
"gulp-trimlines": "^1.0.0",
"gulp-tslint": "^4.3.2",
"gulp-typescript": "^2.12.0",
Expand Down

0 comments on commit 9d62576

Please sign in to comment.