Skip to content

Commit

Permalink
Add bower task
Browse files Browse the repository at this point in the history
  • Loading branch information
dixso committed Dec 29, 2016
1 parent 23ddeb6 commit eb35246
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 1 deletion.
24 changes: 23 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
});
};
42 changes: 42 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -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"
}
}

0 comments on commit eb35246

Please sign in to comment.