<commit_before>TAG="\n\n\033[0;32m\#\#\# "
END=" \#\#\# \033[0m\n"

NPM=$(shell npm bin)

BROWSERIFY_OPTS=\
  -e lib/client/main.js \
  -t babelify \
  -v

.PHONY: build start watch stroybook bundle test lint clean

build: clean lint test bundle
	@echo $(TAG)$@$(END)

start:
	@echo $(TAG)$@$(END)
	NODE_ENV="production" node lib/server

watch: node_modules
	@echo $(TAG)$@$(END)
	mkdir -p bundle
	NODE_ENV="development" DEBUG="keik:*,gh:*" $(NPM)/parallelshell \
		'$(NPM)/watchify $(BROWSERIFY_OPTS) -o bundle/bundle.js -d' \
		'$(NPM)/nodemon lib/server -w lib/server -w lib/share' \
		'node bundle-css-modules.js "lib/share/**/*.css" -o bundle/style.css -w -v'

storybook: node_modules
	$(NPM)/start-storybook -p 6006

bundle: node_modules
	@echo $(TAG)$@$(END)
	mkdir -p $@
	NODE_ENV="production" $(NPM)/browserify $(BROWSERIFY_OPTS) | $(NPM)/uglifyjs -mc warnings=false > bundle/bundle.js
	node bundle-css-modules.js 'lib/share/**/*.css' -o bundle/style.css -v

coverage: node_modules
	@echo $(TAG)$@$(END)
	NODE_ENV="test" $(NPM)/nyc -i babel-register --all \
		--include 'lib/**' \
		--exclude 'lib/{server/index.js,client/*.js,share/stories,**/*.test.js}' \
		$(NPM)/ava 'lib/**/*.test.js'

test: node_modules
	@echo $(TAG)$@$(END)
	NODE_ENV="test" $(NPM)/ava 'lib/**/*.test.js'

lint: node_modules
	@echo $(TAG)$@$(END)
	$(NPM)/eslint '{lib/**/*.js,test/**/*.js}'

clean:
	@echo $(TAG)$@$(END)
	rm -rf bundle

node_modules: package.json
	@echo $(TAG)$@$(END)
	npm install
<commit_msg>Remove dependencies to node_modules on each tasks<commit_after>TAG="\n\n\033[0;32m\#\#\# "
END=" \#\#\# \033[0m\n"

NPM=$(shell npm bin)

BROWSERIFY_OPTS=\
  -e lib/client/main.js \
  -t babelify \
  -v

.PHONY: build start watch storybook bundle coverage test lint clean

build: clean lint test bundle
	@echo $(TAG)$@$(END)

start:
	@echo $(TAG)$@$(END)
	NODE_ENV="production" node lib/server

watch:
	@echo $(TAG)$@$(END)
	mkdir -p bundle
	NODE_ENV="development" DEBUG="keik:*,gh:*" $(NPM)/parallelshell \
		'$(NPM)/watchify $(BROWSERIFY_OPTS) -o bundle/bundle.js -d' \
		'$(NPM)/nodemon lib/server -w lib/server -w lib/share' \
		'node bundle-css-modules.js "lib/share/**/*.css" -o bundle/style.css -w -v'

storybook:
	$(NPM)/start-storybook -p 6006

bundle:
	@echo $(TAG)$@$(END)
	mkdir -p $@
	NODE_ENV="production" $(NPM)/browserify $(BROWSERIFY_OPTS) | $(NPM)/uglifyjs -mc warnings=false > bundle/bundle.js
	node bundle-css-modules.js 'lib/share/**/*.css' -o bundle/style.css -v

coverage:
	@echo $(TAG)$@$(END)
	NODE_ENV="test" $(NPM)/nyc -i babel-register --all \
		--include 'lib/**' \
		--exclude 'lib/{server/index.js,client/*.js,share/stories,**/*.test.js}' \
		$(NPM)/ava 'lib/**/*.test.js'

test:
	@echo $(TAG)$@$(END)
	NODE_ENV="test" $(NPM)/ava 'lib/**/*.test.js'

lint:
	@echo $(TAG)$@$(END)
	$(NPM)/eslint '{lib/**/*.js,test/**/*.js}'

clean:
	@echo $(TAG)$@$(END)
	rm -rf bundle

{'fraction_non_alphanumeric': 0.2327109266943292, 'fraction_numerical': 0.009681881051175657, 'mean_word_length': 3.8540268456375837, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1098316', 'n_tokens_mistral': 1270, 'n_tokens_neox': 1206, 'n_words': 247}