Skip to content

Commit

Permalink
fixes cloudflarearchive#236 initial commit for grunt file
Browse files Browse the repository at this point in the history
  • Loading branch information
mallim committed Jun 21, 2013
1 parent baaa849 commit 5ce2f71
Show file tree
Hide file tree
Showing 2 changed files with 158 additions and 0 deletions.
124 changes: 124 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
'use strict';

module.exports = function(grunt) {

grunt.initConfig({

pkg: grunt.file.readJSON('package.json'),

//
// This is equivalent to the clean target in the Makefile
//
clean: {
options: {
force: true
},
default: [
'api/**/*',
'lib/**/*',
'src/backgrid.js',
'src/backgrid.min.js',
'src/backgrid.min.css',
'src/extensions/**/*.min.js',
'src/extensions/**/*.min.css'
]
},
concat: {
options: {
banner:'/*! <%= pkg.name %> \n '+
'<%= pkg.repository.url %> \n' +
'Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +' ' +
'Licensed under the MIT @license.\n' +
'*/\n\n' +
'(function (root, $, _, Backbone) {\n\n \"use strict\";\n',
footer:"}(this, jQuery, _, Backbone));"
},
backgrid: {
src: ['src/*.js'],
dest: 'lib/backgrid.js'
},
filter:{
src:['src/extensions/filter/*.js'],
dest:'lib/extensions/backgrid-filter.js'
},
"moment-cell":{
src:['src/extensions/moment-cell/*.js'],
dest:'lib/extensions/backgrid-moment-cell.js'
},
'paginator':{
src:['src/extensions/paginator/*.js'],
dest:'lib/extensions/backgrid-paginator.js'
},
"select2-cell":{
src:['src/extensions/select2-cell/*.js'],
dest:'lib/extensions/backgrid-select2-cell.js'
},
"select-all":{
src:['src/extensions/select-all/*.js'],
dest:'lib/extensions/backgrid-select-all.js'
},
"text-cell":{
src:['src/extensions/text-cell/*.js'],
dest:'lib/extensions/backgrid-text-cell.js'
}
},
recess: {
csslint: {
options: {
compile: true
},
files: {
'lib/backgrid.css': ['src/backgrid.css'],
'lib/extensions/filter/backgrid-filter.css':['src/extensions/filter/*.css'],
'lib/extensions/moment-cell/backgrid-moment-cell.css':['src/extensions/moment-cell/*.css'],
'lib/extensions/paginator/backgrid-paginator.css':['src/extensions/paginator/*.css'],
'lib/extensions/select2-cell/backgrid-select2-cell.css':['src/extensions/select2-cell/*.css'],
'lib/extensions/select-all/backgrid-select-all.css':['src/extensions/select-all/*.css'],
'lib/extensions/text-cell/backgrid-text-cell.css':['src/extensions/text-cell/*.css']
}
},
default: {
options: {
compress:true
},
files: {
'lib/backgrid.min.css': ['src/backgrid.css'],
'lib/extensions/filter/backgrid-filter.min.css':['src/extensions/filter/*.css'],
'lib/extensions/moment-cell/backgrid-moment-cell.min.css':['src/extensions/moment-cell/*.css'],
'lib/extensions/paginator/backgrid-paginator.min.css':['src/extensions/paginator/*.css'],
'lib/extensions/seletct2-cell/backgrid-select2-cell.min.css':['src/extensions/select2-cell/*.css'],
'lib/extensions/select-all/backgrid-select-all.min.css':['src/extensions/select-all/*.css'],
'lib/extensions/text-cell/backgrid-text-cell.min.css':['src/extensions/text-cell/*.css']
}
}
},
uglify:{
options: {
mangle: true,
compress:true
},
default:{
files: {
'lib/backgrid.min.js': ['./lib/backgrid.js'],
'lib/extensions/filter/backgrid-filter.min.js':['src/extensions/filter/*.js'],
'lib/extensions/moment-cell/backgrid-moment-cell.min.js':['src/extensions/moment-cell/*.js'],
'lib/extensions/paginator/backgrid-paginator.min.js':['src/extensions/paginator/*.js'],
'lib/extensions/select2-cell/backgrid-select2-cell.min.js':['src/extensions/select2-cell/*.js'],
'lib/extensions/select-all/backgrid-select-all.js':['src/extensions/select-all/*.js'],
'lib/extensions/text-cell/backgrid-text-cell.js':['src/extensions/text-cell/*.js']
}
}
}
});

// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-recess');

//
// the default task will be equivalent to all in Makefile
//
grunt.registerTask('default', ['clean', 'concat', 'uglify', 'recess' ]);
};
34 changes: 34 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "backgrid",
"version": "0.2.6",
"author": "Jimmy Yuen Ho Wong and contributors<[email protected]>",
"description": "Backgrid.js is a set of components for building semantic and easily stylable data grid widgets with Backbone.",
"keywords": [
"backgrid",
"backbone"
],
"contributors": [
{
"name": "Jimmy Yuen Ho Wong",
"email": "[email protected]"
}
],
"main": "./dist/backgrid.js",
"repository": {
"type": "git",
"url": "http://github.com/wyuenho/backgrid"
},
"dependencies": {},
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-clean": "~0.4.1",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-uglify": "~0.2.2",
"grunt-recess": "~0.3.3"
},
"bundledDependencies": [],
"license": "MIT",
"engines": {
"node": ">=0.6"
}
}

0 comments on commit 5ce2f71

Please sign in to comment.