Skip to content

Commit

Permalink
Add Gruntfile.js.
Browse files Browse the repository at this point in the history
Adds JSHint and uglify-js support.
  • Loading branch information
XhmikosR committed Nov 11, 2013
1 parent 9d81c01 commit a480dd6
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 7 deletions.
28 changes: 28 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"asi": true,
"bitwise": true,
"boss": true,
"browser": true,
"curly": false,
"debug": true,
"eqeqeq": false,
"eqnull": true,
"esnext": true,
"evil": true,
"expr": true,
"forin": false,
"immed": true,
"latedef": true,
"laxbreak": true,
"laxcomma": true,
"newcap": false,
"noarg": true,
"node": true,
"noempty": true,
"nonew": true,
"plusplus": false,
"quotmark": "single",
"strict": false,
"sub": true,
"undef": true
}
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
language: node_js
node_js:
- 0.6
- 0.8
- 0.10
- '0.8'
- '0.10'
- '0.11'
before_script:
- npm install -g grunt-cli
32 changes: 32 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
module.exports = function(grunt) {

grunt.initConfig({

uglify: {
options: {
/*compress: true,*/
mangle: true,
preserveComments: false,
report: 'min'
},
compress: {
src: 'fu.js',
dest: 'fu.min.js'
}
},

jshint: {
files: ['Gruntfile.js', 'fu.js', 'test/*.js'],
options: {
jshintrc: '.jshintrc'
}
}

});

// Load the grunt plugins
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');

grunt.registerTask('default', ['jshint', 'uglify']);
};
2 changes: 1 addition & 1 deletion fu.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*jshint curly: false, latedef: false, eqeqeq: false, plusplus: false, newcap: false */
/* global define, toString */
;(function (name, definition) {
'use strict';
if (typeof define == 'function') {
Expand Down
2 changes: 1 addition & 1 deletion fu.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,17 @@
},
"main": "fu.js",
"scripts": {
"test": "testla test"
"test": "grunt && testla test"
},
"files": [
"fu.js",
"fu.min.js",
"README.md"
],
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-jshint": "~0.7.1",
"grunt-contrib-uglify": "~0.2.7",
"testla": "~0.0.8"
}
}
2 changes: 1 addition & 1 deletion test/all-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = function (fu, assert) {
},

unary: function () {
var all = fu.all(function (n) { return n * 0 == 0 })
var all = fu.all(function (n) { return n * 0 === 0 })
assert.isFunction(all)
assert.isTrue(all(a))
}
Expand Down

0 comments on commit a480dd6

Please sign in to comment.