From a107360bdd6cf394d81c0af38e745caa5a3a8f44 Mon Sep 17 00:00:00 2001 From: John Bintz Date: Sun, 2 Nov 2014 10:32:06 -0500 Subject: [PATCH] Start setting up Gulp --- Gulpfile.coffee | 36 ++++++++++++++++++++++++++++++++++++ package.json | 9 ++++++++- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 Gulpfile.coffee diff --git a/Gulpfile.coffee b/Gulpfile.coffee new file mode 100644 index 0000000..5ed9ff4 --- /dev/null +++ b/Gulpfile.coffee @@ -0,0 +1,36 @@ +gulp = require('gulp') + +$ = require('gulp-load-plugins')() + +browserify = require('browserify') +source = require('vinyl-source-stream') +coffeeify = require('coffeeify') +watchify = require('watchify') + +karma = require('karma') + +gulp.task 'browserify', -> + browserify('./src/bismarck.coffee', extensions: ['.coffee']) + .transform({}, coffeeify) + .pipe source('bismarck.js') + .pipe gulp.dest('./dist') + +gulp.task 'watch', -> + gulp.watch './src/**/*.coffee', ['coffee', 'browserify'] + +gulp.task 'coffee', -> + gulp + .src('./src/**/*.coffee') + .pipe $.coffee(bare: true) + .pipe gulp.dest('./lib') + +gulp.task 'scripts', -> + bundlerTarget(createBrowserify().bundle()) + +gulp.task 'karma', -> + karma.server.start { + configFile: __dirname + '/karma.conf.js' + } + +gulp.task 'default', ['scripts', 'watch', 'karma'] + diff --git a/package.json b/package.json index a46e654..1db626d 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "license": "ISC", "devDependencies": { "browserify": "^6.1.0", + "coffee-script": "^1.8.0", "coffeeify": "^0.7.0", "grunt": "^0.4.5", "grunt-browserify": "^3.1.0", @@ -19,6 +20,10 @@ "grunt-contrib-uglify": "^0.6.0", "grunt-contrib-watch": "^0.6.1", "grunt-karma": "^0.9.0", + "gulp": "^3.8.9", + "gulp-coffee": "^2.2.0", + "gulp-load-plugins": "^0.7.1", + "gulp-util": "^3.0.1", "karma": "^0.12.23", "karma-bro": "^0.8.0", "karma-chrome-launcher": "^0.1.4", @@ -26,11 +31,13 @@ "karma-firefox-launcher": "^0.1.3", "karma-jasmine": "~0.2.2", "karma-phantomjs-launcher": "^0.1.4", - "matchdep": "^0.3.0" + "matchdep": "^0.3.0", + "merge": "^1.2.0" }, "dependencies": { "q": "^1.0.1", "underscore": "^1.7.0", + "vinyl-source-stream": "^1.0.0", "xml2js": "^0.4.4" } }