Skip to content
Browse files

Update support files.

  • Loading branch information...
1 parent 83324b4 commit b695ee2e2ae51667a9d96dce3630dedcf5c91b2b @jaredhanson committed
Showing with 190 additions and 37 deletions.
  1. +6 −3 .gitignore
  2. +18 −0 .jshintrc
  3. +12 −5 .npmignore
  4. +13 −3 .travis.yml
  5. +2 −2 LICENSE
  6. +35 −12 Makefile
  7. +23 −12 package.json
  8. +7 −0 support/mk/coveralls.mk
  9. +21 −0 support/mk/istanbul.mk
  10. +10 −0 support/mk/jshint.mk
  11. +14 −0 support/mk/mocha.mk
  12. +8 −0 support/mk/node.mk
  13. +7 −0 support/mk/notes.mk
  14. +3 −0 test/bootstrap/node.js
  15. +11 −0 test/package.test.js
View
9 .gitignore
@@ -1,6 +1,9 @@
-# Mac OS X
-.DS_Store
+build/
+reports/
# Node.js
-node_modules/*
+node_modules/
npm-debug.log
+
+# Mac OS X
+.DS_Store
View
18 .jshintrc
@@ -0,0 +1,18 @@
+{
+ "node": true,
+ "bitwise": true,
+ "camelcase": true,
+ "curly": true,
+ "forin": true,
+ "immed": true,
+ "latedef": true,
+ "newcap": true,
+ "noarg": true,
+ "noempty": true,
+ "nonew": true,
+ "quotmark": "single",
+ "undef": true,
+ "unused": true,
+ "trailing": true,
+ "laxcomma": true
+}
View
17 .npmignore
@@ -1,16 +1,23 @@
-README.md
Makefile
-doc/
+README.md
+build/
+docs/
examples/
+reports/
+support/
test/
-# Mac OS X
-.DS_Store
-
# Node.js
.npmignore
node_modules/
npm-debug.log
+# Mac OS X
+.DS_Store
+
# Git
.git*
+
+# Utilities
+.jshintrc
+.travis.yml
View
16 .travis.yml
@@ -1,5 +1,15 @@
language: "node_js"
node_js:
- - 0.4
- - 0.6
- - 0.8
+ - "0.10"
+ - "0.8"
+ - "0.6"
+ - "0.4"
+
+before_install:
+ - "npm install istanbul -g"
+ - "npm install coveralls -g"
+
+script: "make ci-travis"
+
+after_success:
+ - "make submit-cov-to-coveralls"
View
4 LICENSE
@@ -1,6 +1,6 @@
-(The MIT License)
+The MIT License (MIT)
-Copyright (c) 2011-2013 Jared Hanson
+Copyright (c) 2011-2014 Jared Hanson
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
View
47 Makefile
@@ -1,24 +1,47 @@
-SOURCES = lib/**/*.js
+SOURCES ?= lib/*.js
+TESTS ?= test/*.test.js
+
+test: test-mocha
+test-cov: test-istanbul-mocha
+view-cov: view-istanbul-report
+lint: lint-jshint
+lint-tests: lint-tests-jshint
+
# ==============================================================================
-# Node Tests
+# Node.js
# ==============================================================================
+include support/mk/node.mk
+include support/mk/mocha.mk
+include support/mk/istanbul.mk
-VOWS = ./node_modules/.bin/vows
-TESTS ?= test/*-test.js
+# ==============================================================================
+# Analysis
+# ==============================================================================
+include support/mk/notes.mk
+include support/mk/jshint.mk
-test:
- @NODE_ENV=test NODE_PATH=lib $(VOWS) $(TESTS)
+# ==============================================================================
+# Reports
+# ==============================================================================
+include support/mk/coveralls.mk
# ==============================================================================
-# Static Analysis
+# Continuous Integration
# ==============================================================================
+submit-cov-to-coveralls: submit-istanbul-lcov-to-coveralls
+
+# Travis CI
+ci-travis: test test-cov
-JSHINT = jshint
+# ==============================================================================
+# Clean
+# ==============================================================================
+clean:
+ rm -rf build
+ rm -rf reports
-hint: lint
-lint:
- $(JSHINT) $(SOURCES)
+clobber: clean clobber-node
-.PHONY: test hint lint
+.PHONY: test test-cov view-cov lint lint-tests submit-cov-to-coveralls ci-travis clean clobber
View
35 package.json
@@ -2,7 +2,19 @@
"name": "passport-github",
"version": "0.1.7",
"description": "GitHub authentication strategy for Passport.",
- "keywords": ["passport", "github", "auth", "authn", "authentication", "identity"],
+ "keywords": [
+ "passport",
+ "github",
+ "auth",
+ "authn",
+ "authentication",
+ "identity"
+ ],
+ "author": {
+ "name": "Jared Hanson",
+ "email": "jaredhanson@gmail.com",
+ "url": "http://www.jaredhanson.net/"
+ },
"repository": {
"type": "git",
"url": "http://github.com/jaredhanson/passport-github.git"
@@ -10,15 +22,12 @@
"bugs": {
"url": "http://github.com/jaredhanson/passport-github/issues"
},
- "author": {
- "name": "Jared Hanson",
- "email": "jaredhanson@gmail.com",
- "url": "http://www.jaredhanson.net/"
- },
- "licenses": [ {
- "type": "MIT",
- "url": "http://www.opensource.org/licenses/MIT"
- } ],
+ "licenses": [
+ {
+ "type": "MIT",
+ "url": "http://www.opensource.org/licenses/MIT"
+ }
+ ],
"main": "./lib/passport-github",
"dependencies": {
"pkginfo": "0.2.x",
@@ -27,8 +36,10 @@
"devDependencies": {
"vows": "~0.7.x"
},
+ "engines": {
+ "node": ">= 0.4.0"
+ },
"scripts": {
"test": "NODE_PATH=lib node_modules/.bin/vows test/*-test.js"
- },
- "engines": { "node": ">= 0.4.0" }
+ }
}
View
7 support/mk/coveralls.mk
@@ -0,0 +1,7 @@
+COVERALLS ?= coveralls
+
+submit-istanbul-lcov-to-coveralls:
+ cat $(ISTANBUL_LCOV_INFO_PATH) | $(COVERALLS)
+
+
+.PHONY: submit-istanbul-lcov-to-coveralls
View
21 support/mk/istanbul.mk
@@ -0,0 +1,21 @@
+ISTANBUL ?= 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
+
+
+test-istanbul-mocha: node_modules
+ NODE_PATH=$(NODE_PATH_TEST) \
+ $(ISTANBUL) cover \
+ --dir $(ISTANBUL_OUT) --report $(ISTANBUL_REPORT) \
+ $(_MOCHA) -- \
+ --reporter $(MOCHA_REPORTER) \
+ --require $(MOCHA_REQUIRE) \
+ $(TESTS)
+
+view-istanbul-report:
+ open $(ISTANBUL_HTML_REPORT_PATH)
+
+
+.PHONY: test-istanbul-mocha view-istanbul-report
View
10 support/mk/jshint.mk
@@ -0,0 +1,10 @@
+JSHINT ?= jshint
+
+lint-jshint:
+ $(JSHINT) $(SOURCES)
+
+lint-tests-jshint:
+ $(JSHINT) $(TESTS)
+
+
+.PHONY: lint-jshint lint-tests-jshint
View
14 support/mk/mocha.mk
@@ -0,0 +1,14 @@
+MOCHA ?= ./node_modules/.bin/mocha
+_MOCHA ?= ./node_modules/.bin/_mocha
+MOCHA_REPORTER ?= spec
+MOCHA_REQUIRE ?= ./test/bootstrap/node
+
+test-mocha: node_modules
+ NODE_PATH=$(NODE_PATH_TEST) \
+ $(MOCHA) \
+ --reporter $(MOCHA_REPORTER) \
+ --require $(MOCHA_REQUIRE) \
+ $(TESTS)
+
+
+.PHONY: test-mocha
View
8 support/mk/node.mk
@@ -0,0 +1,8 @@
+node_modules:
+ npm install
+
+clobber-node:
+ rm -rf node_modules
+
+
+.PHONY: clobber-node
View
7 support/mk/notes.mk
@@ -0,0 +1,7 @@
+NOTES ?= 'TODO|FIXME'
+
+notes:
+ grep -Ern $(NOTES) $(SOURCES) $(TESTS)
+
+
+.PHONY: notes
View
3 test/bootstrap/node.js
@@ -0,0 +1,3 @@
+var chai = require('chai');
+
+global.expect = chai.expect;
View
11 test/package.test.js
@@ -0,0 +1,11 @@
+/* global describe, it, expect */
+
+var pkg = require('..');
+
+describe('passport-github', function() {
+
+ it('should export object', function() {
+ expect(pkg).to.be.an('object');
+ });
+
+});

0 comments on commit b695ee2

Please sign in to comment.
Something went wrong with that request. Please try again.