<commit_before>PUBLISH_BRANCH:=gh-pages

setup:
	npm install

prep_branch:
	git branch -D ${PUBLISH_BRANCH} | true
	git checkout -b ${PUBLISH_BRANCH}

build:
	NODE_ENV=production npm run build

cache_bust:
	CACHE_BUST=`git rev-parse HEAD` && sed -i "s/CACHE_BUST/$$CACHE_BUST/g" index.html

publish_branch:
	git config user.email "<EMAIL>"
	git config user.name "CircleCI Script"
	git commit -a -m "Build static assets"
	git push --quiet ${CIRCLE_REPOSITORY_URL} +${PUBLISH_BRANCH};

purge_cloudflare:
	curl -X DELETE "https://api.cloudflare.com/client/v4/zones/${CLOUDFLARE_ZONE}/purge_cache" \
		-H "X-Auth-Email: ${CLOUDFLARE_EMAIL}" \
		-H "X-Auth-Key: ${CLOUDFLARE_SECRET}" \
		-H "Content-Type: application/json" \
		--data '{"purge_everything":true}'

run:
	./node_modules/.bin/gulp watch 
<commit_msg>Need to add dist files<commit_after>PUBLISH_BRANCH:=gh-pages

setup:
	npm install

prep_branch:
	git branch -D ${PUBLISH_BRANCH} | true
	git checkout -b ${PUBLISH_BRANCH}

build:
	NODE_ENV=production npm run build

cache_bust:
	CACHE_BUST=`git rev-parse HEAD` && sed -i "s/CACHE_BUST/$$CACHE_BUST/g" index.html

publish_branch:
	git config user.email "<EMAIL>"
	git config user.name "CircleCI Script"
	git add -f dist/
	git commit -a -m "Build static assets"
	git push --quiet ${CIRCLE_REPOSITORY_URL} +${PUBLISH_BRANCH};

purge_cloudflare:
	curl -X DELETE "https://api.cloudflare.com/client/v4/zones/${CLOUDFLARE_ZONE}/purge_cache" \
		-H "X-Auth-Email: ${CLOUDFLARE_EMAIL}" \
		-H "X-Auth-Key: ${CLOUDFLARE_SECRET}" \
		-H "Content-Type: application/json" \
		--data '{"purge_everything":true}'

run:
	./node_modules/.bin/gulp watch 

{'fraction_non_alphanumeric': 0.14468085106382977, 'fraction_numerical': 0.0012158054711246201, 'mean_word_length': 4.4144736842105265, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '1899272', 'n_tokens_mistral': 709, 'n_tokens_neox': 667, 'n_words': 144}