Commit d76e1cb2 authored by David Schnur's avatar David Schnur

Merge pull request #1139 from nschonni/0.9-grunt-build

0.9 grunt build
parents aa2d7d10 529a087f
language: node_js language: node_js
node_js: node_js:
- 0.8 - "0.10"
before_script:
- npm install grunt-cli -g
/*jshint node: true */
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
// Metadata.
pkg: grunt.file.readJSON("package.json"),
banner: "/*! <%= pkg.name %> - v<%= pkg.version %> - " +
"* Copyright (c) <%= grunt.template.today('yyyy') %> IOLA and <%= pkg.author.name %>;" +
" Licensed <%= pkg.license %> */\n",
// Task configuration.
uglify: {
options: {
banner: "<%= banner %>"
},
dist: {
expand: true,
flatten: true,
src: ["jquery.*.js", "!jquery.js"],
dest: "dist/",
rename: function(base, path) {
return base + path.replace(/\.js/, ".min.js");
}
}
},
jshint: {
options: grunt.file.readJSON(".jshintrc"),
gruntfile: {
src: "Gruntfile.js"
},
flot: {
src: ["jquery.flot*.js"]
}
},
watch: {
gruntfile: {
files: "Gruntfile.js",
tasks: ["jshint:gruntfile"]
},
flot: {
files: "<%= jshint.flot.src %>",
tasks: ["jshint:flot"]
}
}
});
// These plugins provide necessary tasks.
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.loadNpmTasks("grunt-contrib-watch");
// Default task.
grunt.registerTask("default", ["jshint", "uglify"]);
};
# Flot Makefile
.PHONY: all
# The default behavior is to minify all our JavaScript files
all: $(patsubst %.js,%.min.js,$(filter-out %.min.js,$(wildcard *.js)))
%.min.js: %.js
yui-compressor $< -o $@
# Flot's Travis test suite runs JSHint with the options in .jshintrc
test:
./node_modules/.bin/jshint jquery.flot*.js
...@@ -3,9 +3,49 @@ ...@@ -3,9 +3,49 @@
"version": "0.9.0-alpha", "version": "0.9.0-alpha",
"main": "jquery.flot.js", "main": "jquery.flot.js",
"scripts": { "scripts": {
"test": "make test" "test": "grunt jshint"
},
"description": "Flot is a pure JavaScript plotting library for jQuery, with a focus on simple usage, attractive looks and interactive features.",
"directories": {
"example": "examples"
},
"homepage": "http://www.flotcharts.org",
"repository": {
"type": "git",
"url": "https://github.com/flot/flot.git"
},
"keywords": [
"chart",
"plot",
"graph",
"visualization",
"canvas",
"graphics"
],
"author": {
"name": "Ole Laursen",
"url": "https://github.com/OleLaursen"
},
"licenses": [
{
"type": "MIT",
"url": "http://github.com/flot/flot/blob/master/LICENSE.txt"
}
],
"bugs": {
"url": "https://github.com/flot/flot/issues"
}, },
"devDependencies": { "devDependencies": {
"jshint": "0.9.1" "grunt": "~0.4.1",
"grunt-contrib-jshint": "~0.6.4",
"grunt-contrib-uglify": "~0.2.4",
"grunt-contrib-watch": "~0.5.3"
},
"maintainers": [
{
"name": "David Schnur",
"email": "dnschnur@gmail.com",
"url": "http://github.com/dnschnur"
} }
]
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment