Skip to content

Commit

Permalink
[INIT]
Browse files Browse the repository at this point in the history
  • Loading branch information
kgryte committed Dec 8, 2014
0 parents commit 255bf75
Show file tree
Hide file tree
Showing 15 changed files with 606 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
root = true

[*]
indent_style = tab
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
62 changes: 62 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@

# Directories #
###############
reports/
build/

# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so

# Packages #
############
# it's better to unpack these files and commit the raw source
# git has its own built in compression methods
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip

# Logs and databases #
######################
*.log
*.sql
*.sqlite

# OS generated files #
######################
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
Icon?
ehthumbs.db
Thumbs.db
Desktop.ini

# Temporary files #
###################
*~

# Node.js #
###########
/node_modules/

# Matlab #
##########

# Windows default autosave extension
*.asv

# Compiled MEX binaries (all platforms)
*.mex*
14 changes: 14 additions & 0 deletions .jshintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

# Directories #
###############
build/
reports/
dist/

# Node.js #
###########
/node_modules/

# Git #
#######
.git*
71 changes: 71 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"bitwise": false,
"camelcase": false,
"curly": true,
"eqeqeq": true,
"es3": false,
"forin": true,
"freeze": true,
"immed": true,
"indent": 4,
"latedef": "nofunc",
"newcap": true,
"noarg": true,
"noempty": false,
"nonbsp": true,
"nonew": true,
"plusplus": false,
"quotmark": "single",
"undef": true,
"unused": true,
"strict": true,
"maxparams": 10,
"maxdepth": 5,
"maxstatements": 100,
"maxcomplexity": false,
"maxlen": 1000,
"asi": false,
"boss": false,
"debug": false,
"eqnull": false,
"esnext": false,
"evil": false,
"expr": false,
"funcscope": false,
"globalstrict": false,
"iterator": false,
"lastsemic": false,
"laxbreak": false,
"laxcomma": false,
"loopfunc": false,
"maxerr": 1000,
"moz": false,
"multistr": false,
"notypeof": false,
"proto": false,
"scripturl": false,
"shadow": false,
"sub": true,
"supernew": false,
"validthis": false,
"noyield": false,
"browser": true,
"browserify": true,
"couch": false,
"devel": true,
"dojo": false,
"jasmine": false,
"jquery": false,
"mocha": true,
"mootools": false,
"node": true,
"nonstandard": false,
"prototypejs": false,
"qunit": false,
"rhino": false,
"shelljs": false,
"worker": false,
"wsh": false,
"yui": false,
"globals": {}
}
52 changes: 52 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@

# Files #
#########
Makefile
README.md
TODO.md

# Directories #
###############
build/
docs/
examples/
reports/
support/
test/
benchmark/

# Node.js #
###########
.npmignore
/node_modules/

# Logs #
########
*.log

# OS generated files #
######################
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
Icon?
ehthumbs.db
Thumbs.db
Desktop.ini

# Temporary files #
###################
*~

# Git #
#######
.git*

# Utilities #
#############
.jshintrc
.jshintignore
.travis.yml
.editorconfig
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: node_js
node_js:
- "0.10"
after_script:
- npm run coveralls
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2014 Athan Reines.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
139 changes: 139 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@

#############
# VARIABLES #

# Set the node.js environment to test:
NODE_ENV ?= test


# NOTES #

NOTES ?= 'TODO|FIXME|WARNING|HACK|NOTE'


# MOCHA #

MOCHA ?= ./node_modules/.bin/mocha
_MOCHA ?= ./node_modules/.bin/_mocha
MOCHA_REPORTER ?= spec


# ISTANBUL #

ISTANBUL ?= ./node_modules/.bin/istanbul
ISTANBUL_OUT ?= ./reports/coverage
ISTANBUL_REPORT ?= lcov
ISTANBUL_LCOV_INFO_PATH ?= $(ISTANBUL_OUT)/lcov.info
ISTANBUL_HTML_REPORT_PATH ?= $(ISTANBUL_OUT)/lcov-report/index.html


# JSHINT #

JSHINT ?= ./node_modules/.bin/jshint
JSHINT_REPORTER ?= ./node_modules/jshint-stylish/stylish.js



# FILES #

# Source files:
SOURCES ?= lib/*.js

# Test files:
TESTS ?= test/*.js




###########
# TARGETS #


# NOTES #

.PHONY: notes

notes:
grep -Ern $(NOTES) $(SOURCES) $(TESTS)



# UNIT TESTS #

.PHONY: test test-mocha

test: test-mocha

test-mocha: node_modules
NODE_ENV=$(NODE_ENV) \
NODE_PATH=$(NODE_PATH_TEST) \
$(MOCHA) \
--reporter $(MOCHA_REPORTER) \
$(TESTS)



# CODE COVERAGE #

.PHONY: test-cov test-istanbul-mocha

test-cov: test-istanbul-mocha

test-istanbul-mocha: node_modules
NODE_ENV=$(NODE_ENV) \
NODE_PATH=$(NODE_PATH_TEST) \
$(ISTANBUL) cover \
--dir $(ISTANBUL_OUT) \
--report $(ISTANBUL_REPORT) \
$(_MOCHA) -- \
--reporter $(MOCHA_REPORTER) \
$(TESTS)



# COVERAGE REPORT #

.PHONY: view-cov view-istanbul-report

view-cov: view-istanbul-report

view-istanbul-report:
open $(ISTANBUL_HTML_REPORT_PATH)



# LINT #

.PHONY: lint lint-jshint

lint: lint-jshint

lint-jshint: node_modules
$(JSHINT) \
--reporter $(JSHINT_REPORTER) \
./



# NODE #

# Installing node_modules:
.PHONY: install

install:
npm install

# Clean node:
.PHONY: clean-node

clean-node:
rm -rf node_modules



# CLEAN #

.PHONY: clean

clean:
rm -rf build

0 comments on commit 255bf75

Please sign in to comment.