babel/Makefile
2014-10-19 17:53:08 +11:00

58 lines
1.2 KiB
Makefile

ISTANBUL_CMD = node_modules/istanbul/lib/cli.js cover
JSHINT_CMD = node_modules/jshint/bin/jshint
MOCHA_CMD = node_modules/mocha/bin/_mocha
export NODE_ENV = test
.PHONY: clean test test-cov test-travis test-browser publish bench build
clean:
rm -rf coverage templates.json test/tmp dist
bench:
npm install es6-transpiler traceur esnext es6now jstransform
node node_modules/matcha/bin/_matcha
test:
$(JSHINT_CMD) lib
$(MOCHA_CMD)
test-cov:
rm -rf coverage
node $(ISTANBUL_CMD) $(MOCHA_CMD) --
test-travis:
node $(ISTANBUL_CMD) $(MOCHA_CMD) -- --reporter spec
if test -n "$$CODECLIMATE_REPO_TOKEN"; then codeclimate < coverage/lcov.info; fi
test-browser:
make build
node bin/generate-browser-test >dist/6to5-test.js
test -n "`which open`" && open test/browser.html
build:
mkdir -p dist
node bin/cache-templates
browserify lib/6to5/transform.js -s to5 >dist/6to5.js
uglifyjs dist/6to5.js >dist/6to5.min.js
rm -rf templates.json
publish:
git pull --rebase
make test
node bin/cache-templates
test -f templates.json
read -p "Version: " version; \
npm version $$version --message "v%s"
npm publish
git push --follow-tags
rm -rf templates.json