-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 5ca3a9d
Showing
44 changed files
with
4,952 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Logs | ||
logs | ||
*.log | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directory | ||
# Deployed apps should consider commenting this line out: | ||
# see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git | ||
node_modules | ||
|
||
# Ignore test config file | ||
test/config.js | ||
test.html | ||
test.js | ||
|
||
# Dist directory - for now | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
{ | ||
"requireCurlyBraces": [ | ||
"if", | ||
"else", | ||
"for", | ||
"while", | ||
"do", | ||
"try", | ||
"catch", | ||
"case", | ||
"default" | ||
], | ||
"requireSpaceAfterKeywords": [ | ||
"if", | ||
"else", | ||
"for", | ||
"while", | ||
"do", | ||
"switch", | ||
"return", | ||
"try", | ||
"catch" | ||
], | ||
"requireSpaceBeforeBlockStatements": true, | ||
"requireParenthesesAroundIIFE": true, | ||
"requireSpacesInConditionalExpression": { | ||
"afterTest": true, | ||
"beforeConsequent": true, | ||
"afterConsequent": true, | ||
"beforeAlternate": true | ||
}, | ||
"requireSpacesInFunctionExpression": { | ||
"beforeOpeningRoundBrace": true, | ||
"beforeOpeningCurlyBrace": true | ||
}, | ||
"requireSpacesInAnonymousFunctionExpression": { | ||
"beforeOpeningRoundBrace": true, | ||
"beforeOpeningCurlyBrace": true | ||
}, | ||
"requireSpacesInNamedFunctionExpression": { | ||
"beforeOpeningRoundBrace": true, | ||
"beforeOpeningCurlyBrace": true | ||
}, | ||
"requireSpacesInFunctionDeclaration": { | ||
"beforeOpeningRoundBrace": true, | ||
"beforeOpeningCurlyBrace": true | ||
}, | ||
"requireMultipleVarDecl": true, | ||
"requireBlocksOnNewline": true, | ||
"disallowPaddingNewlinesInBlocks": true, | ||
"disallowEmptyBlocks": true, | ||
"requireSpacesInsideObjectBrackets": "all", | ||
"disallowSpacesInsideParentheses": true, | ||
"disallowSpaceAfterObjectKeys": true, | ||
"requireCommaBeforeLineBreak": true, | ||
"disallowLeftStickedOperators": [ | ||
"?", | ||
"=", | ||
"==", | ||
"===", | ||
"!=", | ||
"!==", | ||
">", | ||
">=", | ||
"<", | ||
"<=" | ||
], | ||
"disallowRightStickedOperators": [ | ||
"?", | ||
"=", | ||
":", | ||
"==", | ||
"===", | ||
"!=", | ||
"!==", | ||
">", | ||
">=", | ||
"<", | ||
"<=" | ||
], | ||
"requireSpaceBeforeBinaryOperators": [ | ||
"=", | ||
"==", | ||
"===", | ||
"!=", | ||
"!==", | ||
">", | ||
">=", | ||
"<", | ||
"<=" | ||
], | ||
"requireSpaceAfterBinaryOperators": [ | ||
"=", | ||
"==", | ||
"===", | ||
"!=", | ||
"!==", | ||
">", | ||
">=", | ||
"<", | ||
"<=" | ||
], | ||
"requireCamelCaseOrUpperCaseIdentifiers": true, | ||
"disallowMultipleLineBreaks": true, | ||
"validateQuoteMarks": { | ||
"mark": "'", | ||
"escape": true | ||
}, | ||
"validateIndentation": 2, | ||
"disallowMixedSpacesAndTabs": true, | ||
"disallowTrailingWhitespace": true, | ||
"disallowTrailingComma": true, | ||
"disallowKeywordsOnNewLine": [ | ||
"else" | ||
], | ||
"requireLineFeedAtFileEnd": true, | ||
"maximumLineLength": 120, | ||
"requireCapitalizedConstructors": true, | ||
"disallowYodaConditions": true, | ||
"validateJSDoc": { | ||
"checkParamNames": true, | ||
"checkRedundantParams": true, | ||
"requireParamTypes": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"node": true, | ||
"browser": true, | ||
"esnext": true, | ||
"bitwise": true, | ||
"curly": true, | ||
"eqeqeq": true, | ||
"immed": true, | ||
"indent": 2, | ||
"newcap": true, | ||
"noarg": true, | ||
"regexp": true, | ||
"quotmark": "single", | ||
"unused": "vars", | ||
"undef": true, | ||
"trailing": true, | ||
"smarttabs": true, | ||
"sub": true, | ||
"globals": { | ||
"toString": false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"node": true, | ||
"browser": true, | ||
"esnext": true, | ||
"bitwise": true, | ||
"curly": true, | ||
"eqeqeq": true, | ||
"expr": true, | ||
"immed": true, | ||
"indent": 2, | ||
"newcap": true, | ||
"noarg": true, | ||
"regexp": true, | ||
"quotmark": "single", | ||
"unused": "vars", | ||
"undef": true, | ||
"trailing": true, | ||
"smarttabs": true, | ||
"globals": { | ||
"describe": false, | ||
"it": false, | ||
"before": false, | ||
"beforeEach": false, | ||
"after": false, | ||
"afterEach": false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,175 @@ | ||
'use strict'; | ||
/*global module:false*/ | ||
|
||
// Configure the grunt modules we want to use here | ||
var gruntModules = [ | ||
'grunt-contrib-nodeunit', | ||
'grunt-contrib-jshint', | ||
'grunt-contrib-copy', | ||
'grunt-contrib-clean', | ||
'grunt-mocha-test', | ||
'grunt-blanket', | ||
'grunt-jscs-checker', | ||
'grunt-contrib-compress', | ||
'grunt-browserify', | ||
'grunt-contrib-uglify' | ||
]; | ||
|
||
module.exports = function(grunt) { | ||
|
||
// The `time-grunt` module provides a handy output of the run time of each | ||
// grunt task | ||
require('time-grunt')(grunt); | ||
|
||
// Load these necessary tasks | ||
gruntModules.forEach(function (gruntModule) { | ||
grunt.loadNpmTasks(gruntModule); | ||
}); | ||
|
||
|
||
// Project configuration. | ||
grunt.initConfig({ | ||
// Metadata. | ||
pkg: grunt.file.readJSON('package.json'), | ||
concat: { | ||
options: { | ||
banner: '<%= banner %>', | ||
stripBanners: true | ||
}, | ||
dist: { | ||
src: ['lib/<%= pkg.name %>.js'], | ||
dest: 'dist/<%= pkg.name %>.js' | ||
} | ||
}, | ||
uglify: { | ||
robin: { | ||
options: { | ||
drop_console: true, | ||
report: 'gzip' | ||
}, | ||
files: { | ||
'dist/robin.browser.min.js': ['dist/robin.browser.js'] | ||
} | ||
} | ||
}, | ||
jshint: { | ||
src: { | ||
options: { | ||
jshintrc: '.jshintrc', | ||
reporter: require('jshint-stylish') | ||
}, | ||
src: ['Gruntfile.js', 'robin.js', 'lib/**/*.js'], | ||
}, | ||
test: { | ||
options: { | ||
jshintrc: '.jshintrc-test', | ||
reporter: require('jshint-stylish'), | ||
}, | ||
src: ['test/**/*.js'] | ||
}, | ||
postInstall: { | ||
options: { | ||
jshintrc: '.jshintrc', | ||
reporter: require('jshint-stylish'), | ||
}, | ||
src: ['scripts/postInstall.js'] | ||
} | ||
}, | ||
browserify: { | ||
robin: { | ||
files: { | ||
'dist/robin.browser.js': ['robin.js'] | ||
}, | ||
options: { | ||
browserifyOptions: { | ||
basedir: '.' | ||
}, | ||
bundleOptions: { | ||
standalone: 'Robin', | ||
} | ||
} | ||
}, | ||
tests: { | ||
files: { | ||
'dist/robin.browser.tests.js': ['test/**/test*.js'] | ||
}, | ||
options: { | ||
browserifyOptions: { | ||
basedir: '.' | ||
} | ||
} | ||
}, | ||
}, | ||
compress: { | ||
robin: { | ||
files: { | ||
'dist/robin.browser.min.js.gzip': ['dist/robin.browser.min.js'] | ||
}, | ||
options: { | ||
mode: 'gzip', | ||
level: 9, | ||
pretty: true | ||
} | ||
} | ||
}, | ||
jscs: { | ||
lib: { | ||
src: ['./robin.js', 'lib/**/*.js'], | ||
options: { | ||
config: '.jscs.json', | ||
reporter: 'console' | ||
} | ||
} | ||
}, | ||
clean: { | ||
coverage: { | ||
src: ['coverage/'] | ||
} | ||
}, | ||
copy: { | ||
src: { | ||
src: ['robin.js', 'lib/**/*.js'], | ||
dest: 'coverage/' | ||
}, | ||
test: { | ||
src: ['test/**/test*.js'], | ||
dest: 'coverage/' | ||
} | ||
}, | ||
blanket: { | ||
coverage: { | ||
src: ['coverage/'], | ||
dest: 'coverage/' | ||
} | ||
}, | ||
mochaTest: { | ||
test: { | ||
options: { | ||
reporter: 'spec', | ||
timeout: 1000 | ||
}, | ||
src: ['test/**/test*.js'] | ||
}, | ||
coverage: { | ||
options: { | ||
reporter: 'html-cov', | ||
// use the quiet flag to suppress the mocha console output | ||
quiet: true, | ||
// specify a destination file to capture the mocha | ||
// output (the quiet option does not suppress this) | ||
captureFile: 'coverage/coverage.html' | ||
}, | ||
src: ['coverage/test/**/test*.js'] | ||
} | ||
}, | ||
}); | ||
|
||
// Default task. | ||
grunt.registerTask('lint', ['jshint']); | ||
grunt.registerTask('style', ['jscs:lib']); | ||
grunt.registerTask('coverage', ['copy:src', 'blanket', 'copy:test', 'mochaTest:coverage']); | ||
grunt.registerTask('test', ['mochaTest:test']); | ||
grunt.registerTask('browser', ['browserify', 'uglify:robin']); | ||
grunt.registerTask('build', ['lint', 'test', 'browser']); | ||
|
||
}; |
Oops, something went wrong.