babel/Makefile
Benjamin E. Coe db67d7fdce Switch to nyc, babel-plugin-istanbul & codecov-node for code coverage (#4885)
* Switch to nyc, babel-plugin-istanbul & codecov-node for code coverage

This setup (very much like Babylon's) let us trace code coverage back to the `src/` directories of packages.

* Exclude package tests from coverage report

* fix: upgrade to version of nyc that tweaks a couple more things for babel

* fix: remove comment based on @hzoo's review
2016-11-28 14:17:52 -05:00

81 lines
1.7 KiB
Makefile

MAKEFLAGS = -j1
export NODE_ENV = test
.PHONY: build build-dist watch lint fix clean test-clean test-only test test-cov test-ci publish bootstrap
build: clean
./node_modules/.bin/gulp build
build-dist: build
cd packages/babel-polyfill; \
scripts/build-dist.sh
cd packages/babel-runtime; \
node scripts/build-dist.js
node scripts/generate-babel-types-docs.js
watch: clean
./node_modules/.bin/gulp watch
lint:
./node_modules/.bin/eslint packages/ --format=codeframe
flow:
./node_modules/.bin/flow check
fix:
./node_modules/.bin/eslint packages/ --format=codeframe --fix
clean: test-clean
rm -rf packages/*/lib
rm -rf packages/babel-polyfill/browser*
rm -rf packages/babel-polyfill/dist
rm -rf coverage
rm -rf packages/*/npm-debug*
test-clean:
rm -rf packages/*/test/tmp
rm -rf packages/*/test-fixtures.json
clean-all:
rm -rf node_modules
rm -rf packages/*/node_modules
make clean
# without lint
test-only:
./scripts/test.sh
make test-clean
test: lint test-only
test-cov: clean
# rebuild with test
rm -rf packages/*/lib
BABEL_ENV=test ./node_modules/.bin/gulp build
./scripts/test-cov.sh
test-ci:
NODE_ENV=test make bootstrap
make test-cov
./node_modules/.bin/codecov -f coverage/coverage-final.json
publish:
git pull --rebase
rm -rf packages/*/lib
BABEL_ENV=production make build-dist
make test
# not using lerna independent mode atm, so only update packages that have changed since we use ^
./node_modules/.bin/lerna publish --only-explicit-updates
make clean
#./scripts/build-website.sh
bootstrap:
make clean-all
npm install
./node_modules/.bin/lerna bootstrap
make build
cd packages/babel-runtime; \
npm install; \
node scripts/build-dist.js