Skip to content
This repository has been archived by the owner on Jun 11, 2019. It is now read-only.

Commit

Permalink
Merge pull request #11 from C2FO/node-5
Browse files Browse the repository at this point in the history
Node 4 and 5 support
  • Loading branch information
dustinsmith1024 committed Jan 5, 2016
2 parents 3e90abd + a2f130c commit be7c74b
Show file tree
Hide file tree
Showing 27 changed files with 7,371 additions and 6,672 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ node_modules
.DS_store
*.iml
lib-cov
.idea
atlassian-ide-plugin.xml
59 changes: 59 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"predef": [
"console",
"setImmediate"
],
"globals": {
"Promise": true,
"Proxy": true,
"setImmediate": false
},
"node": true,
"browser": false,
"devel": true,
"jquery": false,
"bitwise": false,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"forin": false,
"immed": true,
"indent": 4,
"latedef": "nofunc",
"newcap": true,
"noarg": true,
"noempty": true,
"nonew": false,
"plusplus": false,
"quotmark": false,
"regexp": false,
"undef": true,
"unused": false,
"strict": true,
"trailing": true,
"white": false,
"asi": false,
"boss": false,
"debug": false,
"eqnull": true,
"esnext": true,
"evil": false,
"expr": true,
"funcscope": false,
"globalstrict": false,
"iterator": false,
"lastsemic": false,
"laxbreak": false,
"laxcomma": false,
"loopfunc": false,
"multistr": false,
"onecase": false,
"proto": false,
"regexdash": false,
"scripturl": false,
"smarttabs": false,
"shadow": false,
"sub": true,
"supernew": true,
"validthis": false
}
8 changes: 8 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules
.DS_store
*.iml
lib-cov
.idea
atlassian-ide-plugin.xml
docs
test
23 changes: 23 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
env:
- CXX=g++-4.8

addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.8

before_script:
- npm install -g grunt-cli

sudo: false

after_script:
- grunt coveralls

language: node_js
node_js:
- "4"
- "5"
- "stable"
120 changes: 120 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
"use strict";
/*global module:false*/
module.exports = function (grunt) {

// Automatic module definition loading. Significantly speeds up build cycles
require('jit-grunt')(grunt);

// Time how long tasks take. Can help when optimizing build times
require('time-grunt')(grunt);

// Project configuration.
var DEFAULT_COVERAGE_ARGS = ["cover", "-x", "Gruntfile.js", "--report", "none", "--print", "none", "--include-pid", "grunt", "--", "it"],
path = require("path");

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

comb: {
paths: {
root: './',
lib: './lib',
test: './test'
}
},

jshint: {
src: [
"./index.js",
"<%= comb.paths.lib %>/**/*.js",
"<%= comb.paths.test %>/**/*.js",
"Gruntfile.js"
],
options: {
jshintrc: '.jshintrc'
}
},

exec: {
sendToCoveralls: "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
removeCoverage: "rm -rf ./coverage",
removeDocs: "rm -rf docs/*",
createDocs: 'coddoc -f multi-html -d ./lib --dir ./docs'
},

it: {
all: {
src: 'test/**/*.test.js',
options: {
timeout: 3000, // not fully supported yet
reporter: 'tap'
}
}
}
});

grunt.registerTask("benchmarks", "runs benchmarks", function () {
var done = this.async();
require("./benchmark/benchmark")()
.then(function () {
done(true);
})
.catch(function (err) {
console.log(err.stack || err);
done(false);

});
});

grunt.registerTask("spawn-test-coverage", "spawn tests with coverage", function () {
var done = this.async();
var env = process.env;
grunt.util.spawn({
cmd: "./node_modules/istanbul/lib/cli.js",
args: DEFAULT_COVERAGE_ARGS,
opts: {stdio: 'inherit', env: env}
}, function (err) {
if (err) {
console.log(err);
done(false);
} else {
done();
}
});
});


grunt.registerTask("process-coverage", "process coverage obects", function () {
var files = grunt.file.expand("./coverage/coverage*.json"),
istanbul = require('istanbul'),
collector = new istanbul.Collector(),
reporter = new istanbul.Reporter(),
sync = false,
done = this.async();

files.forEach(function (file) {
collector.add(grunt.file.readJSON(file));
});

reporter.add('text');
reporter.addAll(['lcovonly']);
reporter.write(collector, sync, function (err) {
if (err) {
console.error(err.stack);
return done(false);
}
console.log('All reports generated');
done();
});
});

grunt.registerTask('default', ['jshint', "test", "test-coverage", "docs"]);

grunt.registerTask('test', ['it']);

grunt.registerTask('coveralls', ['exec:removeCoverage', 'spawn-test-coverage', 'process-coverage', 'exec:sendToCoveralls', 'exec:removeCoverage']);
grunt.registerTask('test-coverage', ['exec:removeCoverage', 'spawn-test-coverage', 'process-coverage', 'exec:removeCoverage']);


grunt.registerTask("docs", ["exec:removeDocs", "exec:createDocs"]);
};
38 changes: 0 additions & 38 deletions Makefile

This file was deleted.

Loading

0 comments on commit be7c74b

Please sign in to comment.