From 87aa3ce4b33b4b17a0361838ea08f3149a4b3300 Mon Sep 17 00:00:00 2001 From: Tomas Sardyha Date: Thu, 5 Dec 2013 00:16:23 +0100 Subject: [PATCH] Updating Gruntfile --- Gruntfile.js | 36 ++++++++++-------------------------- package.json | 15 +++++++-------- 2 files changed, 17 insertions(+), 34 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index fa400bf..b4b7c21 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,5 +1,5 @@ /*jshint node:true */ -module.exports = function(grunt) { +module.exports = function (grunt) { 'use strict'; // Override environment based line endings enforced by Grunt @@ -7,7 +7,7 @@ module.exports = function(grunt) { // Grunt configuration grunt.initConfig({ - pkg: grunt.file.readJSON('bower.json'), + pkg: grunt.file.readJSON('meta.json'), meta: { banner: '/*!\n' + ' * <%= pkg.title %> <%= pkg.version %> - <%= grunt.template.today("dS mmm yyyy") %>\n' + @@ -23,7 +23,7 @@ module.exports = function(grunt) { // JSHint the code. jshint: { options: { - jshintrc: '.jshintrc' + jshintrc: true }, all: ['src/*.js'] }, @@ -63,30 +63,21 @@ module.exports = function(grunt) { } }, - // Compress files. - compress: { + // Bump up fields in JSON files. + bumpup: { options: { - mode: 'gzip' - }, - vanilla: { - src: 'dist/<%= pkg.name %>.min.js', - dest: 'dist/<%= pkg.name %>.min.js.gz' + updateProps: { + pkg: 'meta.json', + }, }, - jquery: { - src: 'dist/jquery.<%= pkg.name %>.min.js', - dest: 'dist/jquery.<%= pkg.name %>.min.js.gz' - } + files: ['meta.json', '<%= pkg.name %>.jquery.json'], }, - // Bump up fields in JSON files. - bumpup: ['component.json', '<%= pkg.name %>.jquery.json'], - // Commit changes and tag the latest commit with a version from JSON file. - tagrelease: 'component.json' + tagrelease: '<%= pkg.version %>' }); // These plugins provide necessary tasks. - grunt.loadNpmTasks('grunt-contrib-compress'); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-clean'); @@ -94,12 +85,6 @@ module.exports = function(grunt) { grunt.loadNpmTasks('grunt-bumpup'); grunt.loadNpmTasks('grunt-gcc'); - // Task for updating the pkg config property. Needs to be run after - // bumpup so the next tasks in queue can work with updated values. - grunt.registerTask('updatePkg', function () { - grunt.config.set('pkg', grunt.file.readJSON('component.json')); - }); - // Build task. grunt.registerTask('build', function () { grunt.task.run('clean'); @@ -112,7 +97,6 @@ module.exports = function(grunt) { type = type ? type : 'patch'; grunt.task.run('jshint'); grunt.task.run('bumpup:' + type); - grunt.task.run('updatePkg'); grunt.task.run('build'); grunt.task.run('tagrelease'); }); diff --git a/package.json b/package.json index 4e31492..3e1b0c5 100644 --- a/package.json +++ b/package.json @@ -2,13 +2,12 @@ "name": "motio", "version": "0.0.0", "devDependencies": { - "grunt-contrib-compress": "~0.4.1", - "grunt-contrib-jshint": "~0.2.0", - "grunt-contrib-concat": "~0.1.3", - "grunt-contrib-clean": "~0.4.0", - "grunt-tagrelease": "~0.2.0", - "grunt-bumpup": "~0.2.0", - "grunt-gcc": "~0.2.0", - "grunt": "~0.4.0" + "grunt-contrib-jshint": "~0.7.2", + "grunt-contrib-concat": "~0.3.0", + "grunt-contrib-clean": "~0.5.0", + "grunt-tagrelease": "~0.2.1", + "grunt-bumpup": "~0.4.2", + "grunt-gcc": "~0.2.2", + "grunt": "~0.4.2" } } \ No newline at end of file