<commit_before>.PHONY: help build server all subperseus put put-js put-css install clean lint test jest
PORT=9000
WEBAPP=../webapp
IOS=../iOS

API_VERSION_MAJOR:=$(shell node node/echo-major-api-version.js)
PERSEUS_BUILD_JS=build/perseus-$(API_VERSION_MAJOR).js
PERSEUS_BUILD_CSS=build/perseus-$(API_VERSION_MAJOR).css

help:
	@echo "make server PORT=9000  # runs the perseus server"
	@echo "make build             # compiles into $(PERSEUS_BUILD_JS) and $(PERSEUS_BUILD_CSS)"
	@echo "make subperseus        # build perseus into webapp"
	@echo "make clean             # delete all compilation artifacts"
	@echo "make test              # run all tests"

build: install
	mkdir -p build
	./node_modules/.bin/webpack
	echo '/*! Perseus | http://github.com/Khan/perseus */' > $(PERSEUS_BUILD_JS)
	echo "// commit `git rev-parse HEAD`" >> $(PERSEUS_BUILD_JS)
	echo "// branch `git rev-parse --abbrev-ref HEAD`" >> $(PERSEUS_BUILD_JS)
	cat build/perseus.js >> $(PERSEUS_BUILD_JS)
	./node_modules/.bin/lessc stylesheets/exercise-content-package/perseus.less $(PERSEUS_BUILD_CSS)

server: install
	(sleep 1; echo; echo http://localhost:$(PORT)/test.html) &
	./node_modules/.bin/webpack-dev-server --port $(PORT) --output-public-path live-build/ src/perseus.js

demo:
	git checkout gh-pages
	git reset --hard origin/master
	make build
	git add -f $(PERSEUS_BUILD_JS)
	git commit -nm 'demo update'
	git checkout master
	git push -f origin gh-pages:gh-pages

all: subperseus

subperseus-ios: clean install build put-js-ios

subperseus: shorttest clean install build put

put: put-js put-css

put-js-ios: build
	cp $(PERSEUS_BUILD_JS) "$(IOS)/Resources/webview/javascript/perseus-package/perseus.js"

put-js: build
	cp $(PERSEUS_BUILD_JS) "$(WEBAPP)/javascript/perseus-package/"

put-css: build
	cp stylesheets/perseus-admin-package/* "$(WEBAPP)/stylesheets/perseus-admin-package"
	cp $(PERSEUS_BUILD_CSS) "$(WEBAPP)/stylesheets/exercise-content-package/"

install:
	npm install<commit_msg>Add source maps to the Makefile<commit_after>.PHONY: help build server all subperseus put put-js put-css install clean lint test jest
PORT=9000
WEBAPP=../webapp
IOS=../iOS

API_VERSION_MAJOR:=$(shell node node/echo-major-api-version.js)
PERSEUS_BUILD_JS=build/perseus-$(API_VERSION_MAJOR).js
PERSEUS_BUILD_CSS=build/perseus-$(API_VERSION_MAJOR).css

help:
	@echo "make server PORT=9000  # runs the perseus server"
	@echo "make build             # compiles into $(PERSEUS_BUILD_JS) and $(PERSEUS_BUILD_CSS)"
	@echo "make subperseus        # build perseus into webapp"
	@echo "make clean             # delete all compilation artifacts"
	@echo "make test              # run all tests"

build: install
	mkdir -p build
	./node_modules/.bin/webpack
	echo '/*! Perseus | http://github.com/Khan/perseus */' > $(PERSEUS_BUILD_JS)
	echo "// commit `git rev-parse HEAD`" >> $(PERSEUS_BUILD_JS)
	echo "// branch `git rev-parse --abbrev-ref HEAD`" >> $(PERSEUS_BUILD_JS)
	cat build/perseus.js >> $(PERSEUS_BUILD_JS)
	./node_modules/.bin/lessc stylesheets/exercise-content-package/perseus.less $(PERSEUS_BUILD_CSS)

server: install
	(sleep 1; echo; echo http://localhost:$(PORT)/test.html) &
	./node_modules/.bin/webpack-dev-server --port $(PORT) --output-public-path live-build/ --devtool inline-source-map src/perseus.js

demo:
	git checkout gh-pages
	git reset --hard origin/master
	make build
	git add -f $(PERSEUS_BUILD_JS)
	git commit -nm 'demo update'
	git checkout master
	git push -f origin gh-pages:gh-pages

all: subperseus

subperseus-ios: clean install build put-js-ios

subperseus: shorttest clean install build put

put: put-js put-css

put-js-ios: build
	cp $(PERSEUS_BUILD_JS) "$(IOS)/Resources/webview/javascript/perseus-package/perseus.js"

put-js: build
	cp $(PERSEUS_BUILD_JS) "$(WEBAPP)/javascript/perseus-package/"

put-css: build
	cp stylesheets/perseus-admin-package/* "$(WEBAPP)/stylesheets/perseus-admin-package"
	cp $(PERSEUS_BUILD_CSS) "$(WEBAPP)/stylesheets/exercise-content-package/"

install:
	npm install
{'fraction_non_alphanumeric': 0.132, 'fraction_numerical': 0.0045, 'mean_word_length': 4.182642487046632, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5635491', 'n_tokens_mistral': 1497, 'n_tokens_neox': 1412, 'n_words': 336}