Skip to content

Commit

Permalink
Update support files.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredhanson committed Mar 9, 2014
1 parent 83324b4 commit b695ee2
Show file tree
Hide file tree
Showing 15 changed files with 190 additions and 37 deletions.
9 changes: 6 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
18 changes: 18 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -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
}
17 changes: 12 additions & 5 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -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
16 changes: 13 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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"
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand Down
47 changes: 35 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
35 changes: 23 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,32 @@
"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"
},
"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",
Expand All @@ -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" }
}
}
7 changes: 7 additions & 0 deletions support/mk/coveralls.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
COVERALLS ?= coveralls

submit-istanbul-lcov-to-coveralls:
cat $(ISTANBUL_LCOV_INFO_PATH) | $(COVERALLS)


.PHONY: submit-istanbul-lcov-to-coveralls
21 changes: 21 additions & 0 deletions support/mk/istanbul.mk
Original file line number Diff line number Diff line change
@@ -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
10 changes: 10 additions & 0 deletions support/mk/jshint.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
JSHINT ?= jshint

lint-jshint:
$(JSHINT) $(SOURCES)

lint-tests-jshint:
$(JSHINT) $(TESTS)


.PHONY: lint-jshint lint-tests-jshint
14 changes: 14 additions & 0 deletions support/mk/mocha.mk
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions support/mk/node.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules:
npm install

clobber-node:
rm -rf node_modules


.PHONY: clobber-node
7 changes: 7 additions & 0 deletions support/mk/notes.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
NOTES ?= 'TODO|FIXME'

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


.PHONY: notes
3 changes: 3 additions & 0 deletions test/bootstrap/node.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
var chai = require('chai');

global.expect = chai.expect;
11 changes: 11 additions & 0 deletions test/package.test.js
Original file line number Diff line number Diff line change
@@ -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.