<commit_before>BROWSERIFY_CMD = node_modules/browserify/bin/cmd.js
ISTANBUL_CMD = node_modules/istanbul/lib/cli.js cover
UGLIFY_CMD = node_modules/uglify-js/bin/uglifyjs
#UGLIFY_CMD = node_modules/uglify-js/bin/uglifyjs --mangle sort
JSHINT_CMD = node_modules/jshint/bin/jshint
MOCHA_CMD = node_modules/mocha/bin/_mocha
BABEL_CMD = node_modules/babel/bin/babel

export NODE_ENV = test

.PHONY: clean test test-cov test-clean lint test-travis test-simple test-all test-browser publish build bootstrap publish-core publish-runtime build-core watch-core

build-core:
	node $(BABEL_CMD) src --out-dir lib --copy-files

watch-core:
	node $(BABEL_CMD) src --out-dir lib --watch --copy-files

build:
	mkdir -p dist
	make build-core

	node tools/cache-templates

	node $(BROWSERIFY_CMD) -e lib/babel/polyfill.js >dist/polyfill.js
	node $(UGLIFY_CMD) dist/polyfill.js >dist/polyfill.min.js

	node $(BROWSERIFY_CMD) lib/babel/api/browser.js -s babel >dist/babel.js
	node $(UGLIFY_CMD) dist/babel.js >dist/babel.min.js

	node bin/babel-external-helpers >dist/external-helpers.js
	node $(UGLIFY_CMD) dist/external-helpers.js >dist/external-helpers.min.js

	rm -rf templates.json

clean:
	rm -rf coverage templates.json test/tmp dist

lint:
	$(JSHINT_CMD) --reporter node_modules/jshint-stylish/stylish.js src bin

test-clean:
	rm -rf test/tmp

test: lint
	$(MOCHA_CMD)
	make test-clean

test-simple:
	# excludes test262
	export SIMPLE_BABEL_TESTS=1; \
	make test

test-all:
	export ALL_BABEL_TESTS=1; \
	make test

test-cov:
	rm -rf coverage
	export SIMPLE_BABEL_TESTS=1; \
	node $(ISTANBUL_CMD) $(MOCHA_CMD) --

test-travis: build-core bootstrap
	node $(ISTANBUL_CMD) $(MOCHA_CMD) --
	if test -n "$$CODECLIMATE_REPO_TOKEN"; then codeclimate < coverage/lcov.info; fi

test-browser:
	mkdir -p dist

	node tools/cache-templates
	node tools/cache-tests
	node $(BROWSERIFY_CMD) -e test/_browser.js >dist/babel-test.js
	rm -rf templates.json tests.json
<commit_msg>Test full `make build` on travis<commit_after>BROWSERIFY_CMD = node_modules/browserify/bin/cmd.js
ISTANBUL_CMD = node_modules/istanbul/lib/cli.js cover
UGLIFY_CMD = node_modules/uglify-js/bin/uglifyjs
#UGLIFY_CMD = node_modules/uglify-js/bin/uglifyjs --mangle sort
JSHINT_CMD = node_modules/jshint/bin/jshint
MOCHA_CMD = node_modules/mocha/bin/_mocha
BABEL_CMD = node_modules/babel/bin/babel

export NODE_ENV = test

.PHONY: clean test test-cov test-clean lint test-travis test-simple test-all test-browser publish build bootstrap publish-core publish-runtime build-core watch-core

build-core:
	node $(BABEL_CMD) src --out-dir lib --copy-files

watch-core:
	node $(BABEL_CMD) src --out-dir lib --watch --copy-files

build:
	mkdir -p dist
	make build-core

	node tools/cache-templates

	node $(BROWSERIFY_CMD) -e lib/babel/polyfill.js >dist/polyfill.js
	node $(UGLIFY_CMD) dist/polyfill.js >dist/polyfill.min.js

	node $(BROWSERIFY_CMD) lib/babel/api/browser.js -s babel >dist/babel.js
	node $(UGLIFY_CMD) dist/babel.js >dist/babel.min.js

	node bin/babel-external-helpers >dist/external-helpers.js
	node $(UGLIFY_CMD) dist/external-helpers.js >dist/external-helpers.min.js

	rm -rf templates.json

clean:
	rm -rf coverage templates.json test/tmp dist

lint:
	$(JSHINT_CMD) --reporter node_modules/jshint-stylish/stylish.js src bin

test-clean:
	rm -rf test/tmp

test: lint
	$(MOCHA_CMD)
	make test-clean

test-simple:
	# excludes test262
	export SIMPLE_BABEL_TESTS=1; \
	make test

test-all:
	export ALL_BABEL_TESTS=1; \
	make test

test-cov:
	rm -rf coverage
	export SIMPLE_BABEL_TESTS=1; \
	node $(ISTANBUL_CMD) $(MOCHA_CMD) --

test-travis: bootstrap build
	node $(ISTANBUL_CMD) $(MOCHA_CMD) --
	if test -n "$$CODECLIMATE_REPO_TOKEN"; then codeclimate < coverage/lcov.info; fi

test-browser:
	mkdir -p dist

	node tools/cache-templates
	node tools/cache-tests
	node $(BROWSERIFY_CMD) -e test/_browser.js >dist/babel-test.js
	rm -rf templates.json tests.json

{'fraction_non_alphanumeric': 0.11687979539641943, 'fraction_numerical': 0.003069053708439898, 'mean_word_length': 4.249664429530202, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6995051', 'n_tokens_mistral': 1587, 'n_tokens_neox': 1536, 'n_words': 331}