<commit_before>.PHONY: all test clean webclient

COFFEE = node_modules/.bin/coffee
UGLIFY = node_modules/.bin/uglifyjs -d WEB=true

CLIENT = \
	web-prelude.coffee \
	microevent.coffee \
	doc.coffee \
	connection.coffee \
	index.coffee \
	textarea.coffee

BUNDLED_TYPES = \
	node_modules/ot-types/webclient/text.js \
	src/types/text-api.coffee \
#	node_modules/ot-types/webclient/json0.js

CLIENT_SRCS = $(addprefix src/client/, $(CLIENT))

all: webclient

clean:
	rm -rf lib
	rm -rf webclient

test:
	node_modules/.bin/mocha

webclient/share.uncompressed.js: $(CLIENT_SRCS) $(BUNDLED_TYPES)
	mkdir -p webclient
	echo '(function(){' > $@
	cat $(filter %.js,$^) >> $@
	coffee -bpc $(filter %.coffee,$^) >> $@
	echo '})();' >> $@


# Uglify.
webclient/%.js: webclient/%.uncompressed.js
	$(UGLIFY) $< -cmo $@

# Compile the types for a browser.
webclient: webclient/share.js
	cp node_modules/ot-types/webclient/text.js webclient/
	cp node_modules/ot-types/webclient/json0.js webclient/
	cp node_modules/ot-types/webclient/json0.uncompressed.js webclient/

<commit_msg>Made makefile deterministic wrt. the input source files<commit_after>.PHONY: all test clean webclient

COFFEE = node_modules/.bin/coffee
UGLIFY = node_modules/.bin/uglifyjs -d WEB=true

CLIENT = \
	web-prelude.coffee \
	microevent.coffee \
	doc.coffee \
	connection.coffee \
	index.coffee \
	textarea.coffee

BUNDLED_TYPES = \
	node_modules/ot-types/webclient/text.js \
	src/types/text-api.coffee \
#	node_modules/ot-types/webclient/json0.js

CLIENT_SRCS = $(addprefix src/client/, $(CLIENT))

all: webclient

clean:
	rm -rf lib
	rm -rf webclient

test:
	node_modules/.bin/mocha

t: $(CLIENT_SRCS) $(BUNDLED_TYPES)

webclient/share.uncompressed.js: $(CLIENT_SRCS) $(BUNDLED_TYPES)
	mkdir -p webclient
	echo '(function(){' > $@
	cat $(filter %.js,$^) >> $@
	$(foreach SRC, $(filter %.coffee,$^), coffee -bpc $(SRC) >> $@;)
	echo '})();' >> $@


# Uglify.
webclient/%.js: webclient/%.uncompressed.js
	$(UGLIFY) $< -cmo $@

# Compile the types for a browser.
webclient: webclient/share.js
	cp node_modules/ot-types/webclient/text.js webclient/
	cp node_modules/ot-types/webclient/json0.js webclient/
	cp node_modules/ot-types/webclient/json0.uncompressed.js webclient/


{'fraction_non_alphanumeric': 0.15463917525773196, 'fraction_numerical': 0.002689376961004034, 'mean_word_length': 3.982142857142857, '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': '1472814', 'n_tokens_mistral': 923, 'n_tokens_neox': 892, 'n_words': 163}