<commit_before>NODE?=node
NPM?=npm
PEGJS?=node_modules/pegjs/bin/pegjs
MOCHA?=node_modules/mocha/bin/mocha
MOCHA_OPTS?=--recursive
JS_COMPILER=node_modules/uglify-js/bin/uglifyjs

all: package.json dagre.js dagre.min.js

.INTERMEDIATE dagre.js: \
	src/pre.js \
	src/version.js \
	src/graph.js \
	src/layout/layout.js \
	src/layout/acyclic.js \
	src/layout/rank.js \
	src/layout/order.js \
	src/layout/position.js \
	src/util.js \
	src/priority-queue.js \
	src/dot.js \
	src/dot-grammar.js \
	src/post.js

dagre.min.js: dagre.js
	@rm -f $@
	$(JS_COMPILER) dagre.js > $@
	@chmod a-w $@

dagre.js: Makefile node_modules
	@rm -f $@
	cat $(filter %.js, $^) > $@
	@chmod a-w $@

src/dot-grammar.js: node_modules
	$(PEGJS) -e dot_parser src/dot-grammar.pegjs $@

node_modules: package.json
	$(NPM) install

package.json: src/version.js package.js
	@rm -f $@
	$(NODE) package.js > $@

.PHONY: test
test: dagre.js
	$(MOCHA) $(MOCHA_OPTS)

clean:
	rm -f dagre.js package.json dagre.min.js<commit_msg>Rebuid dot-grammar.js when the pegjs grammar has changed<commit_after>NODE?=node
NPM?=npm
PEGJS?=node_modules/pegjs/bin/pegjs
MOCHA?=node_modules/mocha/bin/mocha
MOCHA_OPTS?=--recursive
JS_COMPILER=node_modules/uglify-js/bin/uglifyjs

all: package.json dagre.js dagre.min.js

.INTERMEDIATE dagre.js: \
	src/pre.js \
	src/version.js \
	src/graph.js \
	src/layout/layout.js \
	src/layout/acyclic.js \
	src/layout/rank.js \
	src/layout/order.js \
	src/layout/position.js \
	src/util.js \
	src/priority-queue.js \
	src/dot.js \
	src/dot-grammar.js \
	src/post.js

dagre.min.js: dagre.js
	@rm -f $@
	$(JS_COMPILER) dagre.js > $@
	@chmod a-w $@

dagre.js: Makefile node_modules
	@rm -f $@
	cat $(filter %.js, $^) > $@
	@chmod a-w $@

src/dot-grammar.js: src/dot-grammar.pegjs node_modules
	$(PEGJS) -e dot_parser src/dot-grammar.pegjs $@

node_modules: package.json
	$(NPM) install

package.json: src/version.js package.js
	@rm -f $@
	$(NODE) package.js > $@

.PHONY: test
test: dagre.js
	$(MOCHA) $(MOCHA_OPTS)

clean:
	rm -f dagre.js package.json dagre.min.js
{'fraction_non_alphanumeric': 0.1687041564792176, 'fraction_numerical': 0.0, 'mean_word_length': 3.390557939914163, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '839636', 'n_tokens_mistral': 959, 'n_tokens_neox': 922, 'n_words': 151}