<commit_before>SHELL := /bin/bash
PATH  := node_modules/.bin:$(PATH)
NAME  := $(shell node -e 'console.log(require("./package.json").name)')
IN    := src
OUT   := dist

VPATH := $(OUT)

.PHONY: clean deliverables test test-watch example bench javascript

build: package.json $(wildcard *.md) docs deliverables javascript

docs:
	@ cp -rp $@ $^

$(OUT)/%.js: $(IN)/%.js
	@ mkdir -p $(@D)
	@ babel $< > $@
	@ echo "Compiled $@"

$(OUT)/%.jsx: $(IN)/%.jsx
	@ mkdir -p $(@D)
	@ babel $< > $@
	@ echo "Compiled $*.js"

deliverables: $(OUT)
	@ cp -rf $(IN) $(OUT)/$(IN)

javascript: $(subst $(IN),$(OUT),$(shell find ./src -name "*.js*"))

$(OUT):
	@ mkdir -p $(OUT)

%.md: $(OUT)
	cp -p $@ $^

package.json: $(OUT)
	@ node -p 'p=require("./package");p.main="Microcosm.js";p.private=undefined;p.scripts=p.devDependencies=undefined;JSON.stringify(p,null,2)' > $(OUT)/package.json

release: clean build
	npm publish $(OUT)

prerelease: clean build
	npm publish $(OUT) --tag beta

example:
	@ npm install
	@ node examples/server

clean:
	@ rm -rf $(OUT)

test:<commit_msg>Remove install command from example<commit_after>SHELL := /bin/bash
PATH  := node_modules/.bin:$(PATH)
NAME  := $(shell node -e 'console.log(require("./package.json").name)')
IN    := src
OUT   := dist

VPATH := $(OUT)

.PHONY: clean deliverables test test-watch example bench javascript

build: package.json $(wildcard *.md) docs deliverables javascript

docs:
	@ cp -rp $@ $^

$(OUT)/%.js: $(IN)/%.js
	@ mkdir -p $(@D)
	@ babel $< > $@
	@ echo "Compiled $@"

$(OUT)/%.jsx: $(IN)/%.jsx
	@ mkdir -p $(@D)
	@ babel $< > $@
	@ echo "Compiled $*.js"

deliverables: $(OUT)
	@ cp -rf $(IN) $(OUT)/$(IN)

javascript: $(subst $(IN),$(OUT),$(shell find ./src -name "*.js*"))

$(OUT):
	@ mkdir -p $(OUT)

%.md: $(OUT)
	cp -p $@ $^

package.json: $(OUT)
	@ node -p 'p=require("./package");p.main="Microcosm.js";p.private=undefined;p.scripts=p.devDependencies=undefined;JSON.stringify(p,null,2)' > $(OUT)/package.json

release: clean build
	npm publish $(OUT)

prerelease: clean build
	npm publish $(OUT) --tag beta

example:
	@ node examples/server

clean:
	@ rm -rf $(OUT)

test:
{'fraction_non_alphanumeric': 0.2273792780121894, 'fraction_numerical': 0.0009376465072667605, 'mean_word_length': 3.8171557562076748, 'pattern_counts': {'":': 0, '<': 7, '<?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': '2778011', 'n_tokens_mistral': 869, 'n_tokens_neox': 823, 'n_words': 203}