<commit_before>export PATH := $(PATH):./node_modules/.bin

.PHONY: test docs

NPM_PUBLISH_TAG := $(shell [[ "$(CIRCLE_TAG)" =~ -[a-z-]+ ]] && echo "pre-release" || echo "latest")
TEST_BROWSER := $(shell [ -z $(TEST_BROWSER) ] && echo "Chrome" || echo ${TEST_BROWSER})

# intended for local dev
test:
	mocha test/server.js

test-browser:
	@if [ -z $(CI) ]; \
		then karma start --browsers=${TEST_BROWSER}; \
		else karma start --single-run --browsers=${TEST_BROWSER}; \
	fi

test-es5:
	node test/es5.js

test-esm:
	FETCH_MOCK_SRC=../esm/server.js ./node_modules/.bin/mocha test/server.mjs

typecheck:
	dtslint --expectOnly types

lint-ci:
	eslint --ext .js,.mjs --ignore-pattern test/fixtures/* src test
	prettier *.md docs/*.md docs/**/*.md

lint:
	eslint --cache --fix --ext .js,.mjs --ignore-pattern test/fixtures/* src test
	prettier --cache --write *.md docs/*.md docs/**/*.md

verify: lint

coverage:
	nyc --reporter=lcovonly --reporter=text mocha test/server.js
	cat ./coverage/lcov.info | coveralls

local-coverage:
	nyc --reporter=html --reporter=text mocha test/server.js

transpile:
	babel src --out-dir es5

build: transpile
	if [ ! -d "cjs" ]; then mkdir cjs; fi
	cp -r src/* cjs
	rollup -c rollup.config.js
	echo '{"type": "module"}' > esm/package.json

docs:
	cd docs; jekyll serve build --watch

publish:
	echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}" > ${HOME}/.npmrc
	npm version --no-git-tag-version $(CIRCLE_TAG)
	npm publish --access public --tag $(NPM_PUBLISH_TAG)<commit_msg>attempt to fix npm releases<commit_after>export PATH := $(PATH):./node_modules/.bin

.PHONY: test docs

SHELL := env "PATH=$(PATH)" /bin/bash
NPM_PUBLISH_TAG := $(shell [[ "$(CIRCLE_TAG)" =~ -[a-z-]+ ]] && echo "pre-release" || echo "latest")
TEST_BROWSER := $(shell [ -z $(TEST_BROWSER) ] && echo "Chrome" || echo ${TEST_BROWSER})

# intended for local dev
test:
	mocha test/server.js

test-browser:
	@if [ -z $(CI) ]; \
		then karma start --browsers=${TEST_BROWSER}; \
		else karma start --single-run --browsers=${TEST_BROWSER}; \
	fi

test-es5:
	node test/es5.js

test-esm:
	FETCH_MOCK_SRC=../esm/server.js ./node_modules/.bin/mocha test/server.mjs

typecheck:
	dtslint --expectOnly types

lint-ci:
	eslint --ext .js,.mjs --ignore-pattern test/fixtures/* src test
	prettier *.md docs/*.md docs/**/*.md

lint:
	eslint --cache --fix --ext .js,.mjs --ignore-pattern test/fixtures/* src test
	prettier --cache --write *.md docs/*.md docs/**/*.md

verify: lint

coverage:
	nyc --reporter=lcovonly --reporter=text mocha test/server.js
	cat ./coverage/lcov.info | coveralls

local-coverage:
	nyc --reporter=html --reporter=text mocha test/server.js

transpile:
	babel src --out-dir es5

build: transpile
	if [ ! -d "cjs" ]; then mkdir cjs; fi
	cp -r src/* cjs
	rollup -c rollup.config.js
	echo '{"type": "module"}' > esm/package.json

docs:
	cd docs; jekyll serve build --watch

la:
	@echo $(NPM_PUBLISH_TAG)

publish:
	echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}" > ${HOME}/.npmrc
	npm version --no-git-tag-version $(CIRCLE_TAG)
	npm publish --access public --tag $(NPM_PUBLISH_TAG)
{'fraction_non_alphanumeric': 0.1796194775878749, 'fraction_numerical': 0.0019348597226701064, 'mean_word_length': 3.489146164978292, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 7, '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': '1382239', 'n_tokens_mistral': 1288, 'n_tokens_neox': 1215, 'n_words': 300}