From eb352464b6714ef1fefec8eb49a41b524c28206e Mon Sep 17 00:00:00 2001 From: dixso Date: Thu, 29 Dec 2016 12:49:49 +0100 Subject: [PATCH] Add bower task --- Gruntfile.js | 24 +++++++++++++++++++++++- bower.json | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 bower.json diff --git a/Gruntfile.js b/Gruntfile.js index c0d5999..f65d089 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -123,10 +123,32 @@ module.exports = function(grunt) { }, fixpack: { dist: { - src: 'package.json', + src: ['package.json', 'bower.json'], }, }, }); grunt.registerTask('dist', ['clean:start', 'babel:dist', 'uglify:dist', 'autoprefixer:dist', 'cssmin:dist', 'usebanner:dist', 'uglify:polyfill', 'concat:dist', 'clean:end']); + + grunt.registerTask('bump', ['dist', 'update:bower', 'fixpack:dist']); + + grunt.registerTask('update:bower', () => { + const files = ['bower.json']; + const pkg = grunt.file.readJSON('package.json'); + const replace = ['version', 'description', 'name', 'homepage', 'license', 'author', 'repository']; + + for (let e = 0, te = files.length; e < te; e ++) { + let project = grunt.file.readJSON(files[e]); + if ( !grunt.file.exists(files[e]) ) { + grunt.log.error(`file ${files[e]} not found`); + return true; + } + + for (let i = 0, t = replace.length; i < t; i++) { + project[replace[i]] = pkg[replace[i]]; + } + + grunt.file.write(files[e], JSON.stringify(project, null, 2)); + } + }); }; diff --git a/bower.json b/bower.json new file mode 100644 index 0000000..6cab224 --- /dev/null +++ b/bower.json @@ -0,0 +1,42 @@ +{ + "name": "custombox", + "description": "Modal dialog effects with transitions CSS3", + "version": "3.0.2", + "author": { + "name": "Julio de la Calle", + "email": "juliodlcp@gmail.com", + "url": "https://www.linkedin.com/in/juliodelacalle" + }, + "homepage": "https://dixso.github.io/custombox/", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "src", + "LICENSE.txt", + "README.md", + "Gruntfile.js", + "component.json", + "package.json" + ], + "keywords": [ + "animations", + "css3", + "dialog", + "flexbox", + "lightbox", + "modal", + "popup", + "responsive", + "window" + ], + "license": "MIT", + "main": [ + "dist/custombox.min.css", + "dist/custombox.min.js" + ], + "repository": { + "type": "git", + "url": "https://dixso@github.com/dixso/custombox.git" + } +}