From 6c9e3ae876e3a6573062b1803d871fe35da07411 Mon Sep 17 00:00:00 2001 From: "Anders D. Johnson" Date: Fri, 27 Dec 2013 08:19:39 -0600 Subject: [PATCH 1/6] update gruntfile for building to coffeescript --- Gruntfile.coffee | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/Gruntfile.coffee b/Gruntfile.coffee index 03bdeb738..ba76907ac 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -2,6 +2,19 @@ module.exports = (grunt) -> grunt.initConfig pkg: grunt.file.readJSON('package.json') + config: + coffeeFiles: [ + 'src/rivets.coffee' + 'src/util.coffee' + 'src/view.coffee' + 'src/bindings.coffee' + 'src/parsers.coffee' + 'src/keypath_observer.coffee' + 'src/binders.coffee' + 'src/adapters.coffee' + 'src/export.coffee' + ] + meta: banner: '// Rivets.js\n' + @@ -14,17 +27,7 @@ module.exports = (grunt) -> options: join: true files: - 'dist/rivets.js': [ - 'src/rivets.coffee' - 'src/util.coffee' - 'src/view.coffee' - 'src/bindings.coffee' - 'src/parsers.coffee' - 'src/keypath_observer.coffee' - 'src/binders.coffee' - 'src/adapters.coffee' - 'src/export.coffee' - ] + 'dist/rivets.js': '<%= config.coffeeFiles %>' concat: all: @@ -32,6 +35,9 @@ module.exports = (grunt) -> banner: '<%= meta.banner %>' files: 'dist/rivets.js': 'dist/rivets.js' + coffee: + files: + 'dist/rivets.coffee': '<%= config.coffeeFiles %>' uglify: all: @@ -61,4 +67,5 @@ module.exports = (grunt) -> grunt.registerTask 'default', ['watch'] grunt.registerTask 'spec', ['jasmine'] - grunt.registerTask 'build', ['coffee', 'concat', 'uglify'] + grunt.registerTask 'build', ['coffee', 'concat:all', 'uglify'] + grunt.registerTask 'build-coffee', ['concat:coffee'] From 5b4d3ef87f879172556c4fef12fc8a5496dba20b Mon Sep 17 00:00:00 2001 From: "Anders D. Johnson" Date: Fri, 27 Dec 2013 16:38:38 -0600 Subject: [PATCH 2/6] grunt watch all coffee sources --- Gruntfile.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gruntfile.coffee b/Gruntfile.coffee index ba76907ac..12bb3410e 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -56,7 +56,7 @@ module.exports = (grunt) -> watch: all: - files: 'src/rivets.coffee' + files: '<%= config.coffeeFiles %>' tasks: ['build', 'spec'] grunt.loadNpmTasks 'grunt-contrib-coffee' From db6ce8c12426e0f14e6e03c69d77c5b8e3c6017a Mon Sep 17 00:00:00 2001 From: "Anders D. Johnson" Date: Sun, 29 Dec 2013 17:19:53 -0600 Subject: [PATCH 3/6] grunt watch spec files for test --- Gruntfile.coffee | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Gruntfile.coffee b/Gruntfile.coffee index 12bb3410e..86f41ca9e 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -14,6 +14,9 @@ module.exports = (grunt) -> 'src/adapters.coffee' 'src/export.coffee' ] + specFiles: [ + 'spec/**/*.js' + ] meta: banner: @@ -56,7 +59,10 @@ module.exports = (grunt) -> watch: all: - files: '<%= config.coffeeFiles %>' + files: [ + '<%= config.coffeeFiles %>', + '<%= config.specFiles %>' + ] tasks: ['build', 'spec'] grunt.loadNpmTasks 'grunt-contrib-coffee' From e16d7e13ee767cb0c3e2e536e4594827bfc79902 Mon Sep 17 00:00:00 2001 From: "Anders D. Johnson" Date: Mon, 30 Dec 2013 19:54:40 -0600 Subject: [PATCH 4/6] grunt add watch for just build --- Gruntfile.coffee | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Gruntfile.coffee b/Gruntfile.coffee index 86f41ca9e..5dcd240cf 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -64,6 +64,12 @@ module.exports = (grunt) -> '<%= config.specFiles %>' ] tasks: ['build', 'spec'] + build: + files: [ + '<%= config.coffeeFiles %>', + '<%= config.specFiles %>' + ] + tasks: ['build'] grunt.loadNpmTasks 'grunt-contrib-coffee' grunt.loadNpmTasks 'grunt-contrib-concat' @@ -71,7 +77,7 @@ module.exports = (grunt) -> grunt.loadNpmTasks 'grunt-contrib-jasmine' grunt.loadNpmTasks 'grunt-contrib-watch' - grunt.registerTask 'default', ['watch'] + grunt.registerTask 'default', ['watch:all'] grunt.registerTask 'spec', ['jasmine'] grunt.registerTask 'build', ['coffee', 'concat:all', 'uglify'] grunt.registerTask 'build-coffee', ['concat:coffee'] From 87bf428b8e9604acb86ce984c6cf6953bb8d9855 Mon Sep 17 00:00:00 2001 From: "Anders D. Johnson" Date: Mon, 30 Dec 2013 19:55:33 -0600 Subject: [PATCH 5/6] grunt jasmine add keeprunner for browser testing --- Gruntfile.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/Gruntfile.coffee b/Gruntfile.coffee index 5dcd240cf..a8b3d9038 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -56,6 +56,7 @@ module.exports = (grunt) -> options: specs: 'spec/rivets/**/*.js' helpers: 'spec/lib/**/*.js' + keepRunner: true watch: all: From f875dcb156f00fe0e794ead75c877bdd1113eca0 Mon Sep 17 00:00:00 2001 From: "Anders D. Johnson" Date: Mon, 30 Dec 2013 19:56:50 -0600 Subject: [PATCH 6/6] grunt coffee add sourcemap generation --- Gruntfile.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/Gruntfile.coffee b/Gruntfile.coffee index a8b3d9038..dbe8afb08 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -29,6 +29,7 @@ module.exports = (grunt) -> all: options: join: true + sourceMap: true files: 'dist/rivets.js': '<%= config.coffeeFiles %>'