Reputation: 1687
I am trying to extend the D3 Calendar Viz library built here: https://github.com/kamisama/cal-heatmap
and I've cloned the repo. The code uses Grunt as a build process, so I've installed Grunt-Cli and run npm install
inside the directory, which worked. Running grunt
I get an error:
Warning: Task "default" not found. Use --force to continue.
I have put the grunt.js file into http://esprima.org/demo/validate.html and it has returned with no errors. I can't figure out why grunt is not working here.
Here is the grunt.js file:
module.exports = function(grunt) {
"use strict";
var headerComment = "/*! <%= pkg.name %> v<%= pkg.version %> (<%= grunt.template.today() %>)\n" +
" * ---------------------------------------------\n" +
" * <%= pkg.description %>\n" +
" * <%= pkg.homepage %>\n" +
" * Licensed under the <%= pkg.license %> license\n" +
" * Copyright 2014 <%= pkg.author.name %>\n" +
" */\n";
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),
jshint: {
options: {
jshintrc: ".jshintrc"
},
lib: {
src: ["src/<%= pkg.name %>.js"]
},
test: {
options: {
jshintrc: "test/.jshintrc"
},
src: ["test/test.js", "test/test-amd.js"]
}
},
csslint: {
base: {
src: "<%= pkg.name %>.css",
rules: {
"known-properties": false,
"box-sizing": false
}
}
},
uglify: {
options: {
banner: headerComment
},
base: {
files: {
"<%= pkg.name %>.min.js" : ["<%= pkg.name %>.js"]
}
}
},
qunit: {
options: {
"--web-security": "no",
coverage: {
src: ["src/*.js"],
instrumentedFiles: "temp/",
htmlReport: "report/coverage",
coberturaReport: "report/"
}
},
all: ["test/*.html"]
},
concat: {
options: {
banner: headerComment + "\n"
},
js: {
src: ["src/<%= pkg.name %>.js"],
dest: "<%= pkg.name %>.js"
},
test: {
src: ["test/src/function.js", "test/src/**/*.js"],
dest: "test/test.js"
}
},
coveralls: {
options: {
coverage_dir: "coverage/"
}
},
watch: {
scripts: {
files: "test/src/**/*.js",
tasks: ["concat:test"],
options: {
interrupt: true,
}
},
lint: {
files: "src/*.js",
tasks: ["jshint:lib"],
options: {
interrupt: true,
}
}
}
});
grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-css");
grunt.loadNpmTasks("grunt-contrib-qunit");
grunt.loadNpmTasks("grunt-contrib-concat");
grunt.loadNpmTasks("grunt-karma-coveralls");
grunt.loadNpmTasks("grunt-contrib-watch");
// TO RUN BEFORE COMMIT
// ====================
grunt.registerTask("quick-build", ["csslint", "jshint"]);
// Full build without version bump
grunt.registerTask("build", ["concat", "qunit", "csslint", "jshint", "uglify"]);
// FOR TRAVIS
// ==========
grunt.registerTask("travis", ["jshint", "csslint"]);
};
and here is the package.json file:
{
"name": "cal-heatmap",
"version": "3.5.2",
"description": "Cal-Heatmap is a javascript module to create calendar heatmap to visualize time series data",
"keywords": [
"calendar",
"graph",
"d3js",
"heat map"
],
"main": "cal-heatmap.min.js",
"directories": {
"test": "test"
},
"dependencies": {
"d3": ">= v3.0.6"
},
"devDependencies": {
"grunt": "~0.4.5",
"grunt-contrib-uglify": "~0.7.0",
"grunt-contrib-copy": "~0.7.0",
"grunt-contrib-jshint": "~0.11.0",
"grunt-contrib-concat": "~0.5.0",
"grunt-contrib-watch": "~0.6.1",
"grunt-contrib-qunit": "~0.5.2",
"grunt-css": "~0.5.4",
"grunt-replace": "~0.8.0",
"phantomjs": "~1.9.15",
"karma": "~0.12.31",
"karma-coverage": "~0.2.7",
"karma-qunit": "~0.1.4",
"karma-phantomjs-launcher": "~0.1.4",
"grunt-karma-coveralls": "~2.5.3",
"qunitjs": "~1.17.0",
"jquery": "~1.9.1"
},
"scripts": {
"test": "grunt travis --verbose; ./node_modules/karma/bin/karma start --single-run --browsers PhantomJS"
},
"repository": {
"type": "git",
"url": "https://github.com/kamisama/cal-heatmap.git"
},
"homepage": "https://github.com/kamisama/cal-heatmap",
"author": {
"name": "Wan Qi Chen",
"url": "http://www.kamisama.me"
},
"license": "MIT",
"gitHead": "e7bf798c210e0c25df9f6857bdb268001ef67fd1",
"volo": {
"dependencies": {
"d3": "d3"
}
},
"jam": {
"dependencies": {
"d3": ">=3.0.6"
}
},
"bugs": "https://github.com/kamisama/cal-heatmap/issues",
"github": "https://github.com/kamisama/cal-heatmap",
"categories": [
"Data",
"Visualization"
]
}
Upvotes: 0
Views: 3448
Reputation: 4964
You need to define the default task, for example below.
grunt.registerTask("default", [ "lint", "test", "coverage" ]);
Upvotes: 1