2014-10-28 22:30:42 -06:00
|
|
|
BROWSERIFY = ./node_modules/.bin/browserify
|
2014-10-31 19:34:50 -06:00
|
|
|
WATCHIFY = ./node_modules/.bin/watchify
|
|
|
|
LESS = ./node_modules/.bin/lessc
|
|
|
|
WATCH = ./node_modules/.bin/watch
|
2014-10-28 22:30:42 -06:00
|
|
|
SERVER = ./node_modules/.bin/static
|
|
|
|
MOCHA = ./node_modules/.bin/mocha
|
|
|
|
COVERALLS = ./node_modules/.bin/coveralls
|
|
|
|
GRUNT = grunt
|
|
|
|
|
2014-10-26 19:57:44 -07:00
|
|
|
# Install dependencies.
|
2014-08-28 19:55:45 -07:00
|
|
|
install:
|
|
|
|
npm install
|
2014-10-21 20:16:42 -07:00
|
|
|
|
2014-10-26 21:10:41 -06:00
|
|
|
watch:
|
2014-10-31 19:34:50 -06:00
|
|
|
${MAKE} watch-js & ${MAKE} watch-css
|
2014-10-28 22:30:42 -06:00
|
|
|
|
|
|
|
# Watch the app.
|
|
|
|
watch-js:
|
2014-10-31 19:34:50 -06:00
|
|
|
${WATCHIFY} -e ./src/app.coffee -o public/js/app.bundle.js -d -v
|
2014-10-28 22:30:42 -06:00
|
|
|
|
|
|
|
# Watch the styles.
|
|
|
|
watch-css:
|
2014-10-31 19:34:50 -06:00
|
|
|
${MAKE} build-css
|
|
|
|
${WATCH} "${MAKE} build-css" src/styles
|
2014-08-28 19:55:45 -07:00
|
|
|
|
2014-10-26 19:57:44 -07:00
|
|
|
# Serve locally.
|
2014-08-28 19:55:45 -07:00
|
|
|
serve:
|
2014-10-31 19:34:50 -06:00
|
|
|
${SERVER} public -H '{"Cache-Control": "no-cache, must-revalidate"}'
|
2014-08-28 19:55:45 -07:00
|
|
|
|
2014-10-26 21:10:41 -06:00
|
|
|
# Make a minified package.
|
|
|
|
build:
|
2014-10-31 19:34:50 -06:00
|
|
|
${GRUNT} init
|
|
|
|
${MAKE} build-js
|
|
|
|
${MAKE} build-css
|
|
|
|
${GRUNT} minify
|
|
|
|
|
|
|
|
build-js:
|
|
|
|
${BROWSERIFY} -e ./src/app.coffee -o public/js/app.bundle.js
|
|
|
|
|
|
|
|
# Use less on index style.
|
|
|
|
build-css:
|
|
|
|
${LESS} src/styles/burnchart.less > public/css/app.bundle.css
|
2014-10-26 21:10:41 -06:00
|
|
|
|
2014-10-27 06:57:57 -06:00
|
|
|
# Publish to GitHub Pages.
|
2014-10-26 21:10:41 -06:00
|
|
|
publish:
|
2014-10-31 19:34:50 -06:00
|
|
|
${GRUNT} gh-pages
|
2014-10-28 22:30:42 -06:00
|
|
|
|
2014-10-29 20:53:44 -06:00
|
|
|
OPTS = --compilers coffee:coffee-script/register --ui exports
|
2014-10-26 21:10:41 -06:00
|
|
|
|
|
|
|
# Run mocha test.
|
|
|
|
test:
|
2014-10-31 19:34:50 -06:00
|
|
|
${MOCHA} ${OPTS} --reporter spec
|
2014-10-28 22:30:42 -06:00
|
|
|
|
|
|
|
# Run code coverage.
|
|
|
|
coverage:
|
2014-10-31 19:34:50 -06:00
|
|
|
${MOCHA} ${OPTS} --reporter html-cov --require blanket > docs/COVERAGE.html
|
2014-10-28 22:30:42 -06:00
|
|
|
|
|
|
|
# Run code coverage and publish to coveralls.
|
|
|
|
coveralls:
|
2014-10-31 19:34:50 -06:00
|
|
|
${MOCHA} ${OPTS} --reporter mocha-lcov-reporter --require blanket | COVERALLS_REPO_TOKEN=$(TOKEN) COVERALLS_SERVICE_NAME=MOCHA ${COVERALLS}
|
2014-10-26 21:10:41 -06:00
|
|
|
|
|
|
|
.PHONY: test
|