<commit_before>BABEL = $(call npm-which,BABEL,babel)
BABEL_NODE = $(call npm-which,BABEL_NODE,babel-node)
$(foreach VAR,BABEL BABEL_NODE,$(call make-lazy,$(VAR)))

BABELRC := $(shell $(FIND_Q_NOSYM) . -mindepth 0 -maxdepth 1 -name ".babelrc*" -print)

LIB_JS_FROM_JS_FILES += \
	$(patsubst src/%.js,lib/%.js,$(SRC_JS_FILES)) \

LIB_JS_FROM_TS_FILES += \
	$(patsubst src/%.ts,lib/%.js,$(SRC_TS_FILES)) \

LIB_JS_FILES += \
	$(LIB_JS_FROM_JS_FILES) \
	$(LIB_JS_FROM_TS_FILES) \

LIB_JS_MAP_FILES += \
	$(patsubst src/%.js,lib/%.js.map,$(SRC_JS_FILES)) \
	$(patsubst src/%.ts,lib/%.js.map,$(SRC_TS_FILES)) \

SF_CLEAN_FILES += \
	$(LIB_JS_FILES) \
	$(LIB_JS_MAP_FILES) \

SF_BUILD_TARGETS += \
	build-babel \

BABEL_ARGS += \
	--source-maps

# ------------------------------------------------------------------------------

$(LIB_JS_FROM_JS_FILES): lib/%.js: src/%.js $(SRC_JS_FILES) $(BABELRC)
	$(MKDIR) $(shell dirname $@)
	$(BABEL) $< $(BABEL_ARGS) --out-file $@


$(LIB_JS_FROM_TS_FILES): lib/%.js: src/%.ts $(SRC_JS_FILES) $(BABELRC)
	$(MKDIR) $(shell dirname $@)
	$(BABEL) $< $(BABEL_ARGS) --out-file $@


.PHONY: build-babel
build-babel: $(LIB_JS_FROM_JS_FILES) $(LIB_JS_FROM_TS_FILES)<commit_msg>allow for lib files to be modified before calling build-babel<commit_after>BABEL = $(call npm-which,BABEL,babel)
BABEL_NODE = $(call npm-which,BABEL_NODE,babel-node)
$(foreach VAR,BABEL BABEL_NODE,$(call make-lazy,$(VAR)))

BABELRC := $(shell $(FIND_Q_NOSYM) . -mindepth 0 -maxdepth 1 -name ".babelrc*" -print)

LIB_JS_FROM_JS_FILES += \
	$(patsubst src/%.js,lib/%.js,$(SRC_JS_FILES)) \

LIB_JS_FROM_TS_FILES += \
	$(patsubst src/%.ts,lib/%.js,$(SRC_TS_FILES)) \

LIB_JS_FILES += \
	$(LIB_JS_FROM_JS_FILES) \
	$(LIB_JS_FROM_TS_FILES) \

LIB_JS_MAP_FILES += \
	$(patsubst src/%.js,lib/%.js.map,$(SRC_JS_FILES)) \
	$(patsubst src/%.ts,lib/%.js.map,$(SRC_TS_FILES)) \

SF_CLEAN_FILES += \
	$(LIB_JS_FILES) \
	$(LIB_JS_MAP_FILES) \

SF_BUILD_TARGETS += \
	build-babel \

BABEL_ARGS += \
	--source-maps

# ------------------------------------------------------------------------------

$(LIB_JS_FROM_JS_FILES): lib/%.js: src/%.js $(SRC_JS_FILES) $(BABELRC)
	$(MKDIR) $(shell dirname $@)
	$(BABEL) $< $(BABEL_ARGS) --out-file $@


$(LIB_JS_FROM_TS_FILES): lib/%.js: src/%.ts $(SRC_JS_FILES) $(BABELRC)
	$(MKDIR) $(shell dirname $@)
	$(BABEL) $< $(BABEL_ARGS) --out-file $@


.PHONY: build-babel
build-babel:
	$(MAKE) $(LIB_JS_FROM_JS_FILES) $(LIB_JS_FROM_TS_FILES)
{'fraction_non_alphanumeric': 0.26026840178934524, 'fraction_numerical': 0.0016266775111834079, 'mean_word_length': 3.400715563506261, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, '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': '891364', 'n_tokens_mistral': 1147, 'n_tokens_neox': 1063, 'n_words': 145}