2014-10-29 04:30:42 +00:00
|
|
|
BROWSERIFY = ./node_modules/.bin/browserify
|
|
|
|
WATCH = ./node_modules/.bin/watchify
|
|
|
|
SERVER = ./node_modules/.bin/static
|
|
|
|
MOCHA = ./node_modules/.bin/mocha
|
|
|
|
COVERALLS = ./node_modules/.bin/coveralls
|
|
|
|
GRUNT = grunt
|
|
|
|
|
2014-10-27 02:57:44 +00:00
|
|
|
# Install dependencies.
|
2014-08-29 02:55:45 +00:00
|
|
|
install:
|
|
|
|
npm install
|
2014-10-22 03:16:42 +00:00
|
|
|
|
2014-10-27 03:10:41 +00:00
|
|
|
watch:
|
2014-10-29 04:30:42 +00:00
|
|
|
$(MAKE) watch-js & $(MAKE) watch-css
|
|
|
|
|
|
|
|
# Watch the app.
|
|
|
|
watch-js:
|
|
|
|
$(WATCH) -e ./src/app.coffee -o public/js/app.bundle.js -d -v
|
|
|
|
|
|
|
|
# Watch the styles.
|
|
|
|
watch-css:
|
|
|
|
$(GRUNT) watch
|
2014-08-29 02:55:45 +00:00
|
|
|
|
2014-10-27 02:57:44 +00:00
|
|
|
# Serve locally.
|
2014-08-29 02:55:45 +00:00
|
|
|
serve:
|
2014-10-29 04:30:42 +00:00
|
|
|
$(SERVER) public -H '{"Cache-Control": "no-cache, must-revalidate"}'
|
2014-08-29 02:55:45 +00:00
|
|
|
|
2014-10-27 03:10:41 +00:00
|
|
|
# Make a minified package.
|
|
|
|
build:
|
2014-10-29 04:30:42 +00:00
|
|
|
$(GRUNT) init
|
|
|
|
$(BROWSERIFY) -e ./src/app.coffee -o public/js/app.bundle.js
|
|
|
|
$(GRUNT) css
|
|
|
|
$(GRUNT) minify
|
2014-10-27 03:10:41 +00:00
|
|
|
|
2014-10-27 12:57:57 +00:00
|
|
|
# Publish to GitHub Pages.
|
2014-10-27 03:10:41 +00:00
|
|
|
publish:
|
2014-10-29 04:30:42 +00:00
|
|
|
$(GRUNT) gh-pages
|
|
|
|
|
|
|
|
OPTS = --compilers coffee:coffee-script/register --ui exports --timeout 20000 --slow 15000 --bail
|
2014-10-27 03:10:41 +00:00
|
|
|
|
|
|
|
# Run mocha test.
|
|
|
|
test:
|
2014-10-29 04:30:42 +00:00
|
|
|
REPORTER = spec
|
|
|
|
$(MOCHA) $(OPTS) --reporter $(REPORTER)
|
|
|
|
|
|
|
|
# Run code coverage.
|
|
|
|
coverage:
|
|
|
|
$(MOCHA) $(OPTS) --reporter $(REPORTER) --require blanket > docs/COVERAGE.html
|
|
|
|
|
|
|
|
# Run code coverage and publish to coveralls.
|
|
|
|
coveralls:
|
|
|
|
$(MOCHA) $(OPTS) --reporter $(REPORTER) --require blanket | COVERALLS_SERVICE_NAME=MOCHA $(COVERALLS)
|
2014-10-27 03:10:41 +00:00
|
|
|
|
|
|
|
.PHONY: test
|