From f269a702fef49e8cb6224aeb447a97316e20bca2 Mon Sep 17 00:00:00 2001 From: Matt Zabriskie Date: Thu, 7 Apr 2016 14:13:03 -0600 Subject: [PATCH] Automating release process --- Gruntfile.js | 27 +++++++++++++++++++-------- package.json | 8 +++++--- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 800aeda..19615ff 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -21,10 +21,8 @@ module.exports = function(grunt) { } }, - update_json: { - bower: { - src: 'package.json', - dest: 'bower.json', + package2bower: { + all: { fields: [ 'name', 'description', @@ -68,8 +66,6 @@ module.exports = function(grunt) { all: ['test/unit/**/*.js'] }, - webpack: require('./webpack.config.js'), - watch: { build: { files: ['lib/**/*.js'], @@ -79,10 +75,25 @@ module.exports = function(grunt) { files: ['lib/**/*.js', 'test/**/*.js', '!test/typescript/axios.js', '!test/typescript/out.js'], tasks: ['test'] } + }, + + webpack: require('./webpack.config.js') + }); + + grunt.registerMultiTask('package2bower', 'Sync package.json to bower.json', function () { + var npm = grunt.file.readJSON('package.json'); + var bower = grunt.file.readJSON('bower.json'); + var fields = this.data.fields || []; + + for (var i=0, l=fields.length; i