<commit_before>all: css js

css:
	node_modules/.bin/node-sass -o dist/css/ --source-map dist/css/style.css.map src/assets/scss/style.scss > dist/css/style.css
	node_modules/.bin/autoprefixer-cli -b "last 2 version" dist/css/style.css dist/css/style.css
	cat src/assets/css/components/*.css dist/css/style.css > dist/css/style.min.css
	node_modules/.bin/csso dist/css/style.min.css dist/css/style.min.css
	echo "\n/*# sourceMappingURL=style.min.css.map */" >> dist/css/style.min.css
	mv dist/css/style.css.map dist/css/style.min.css.map
	rm dist/css/style.css

deps:
	composer install
	npm install
	brew install gettext
	brew link --force gettext

js:
	node_modules/.bin/webpack

lint\:js:
	node_modules/.bin/eslint src/assets/js/*.js src/assets/js/properties/*.js

lint\:php:
	vendor/bin/phpcs -s --extensions=php --standard=phpcs.xml src/

pot:
	xgettext --language=php \
           --add-comments=L10N \
           --keyword=__ \
           --keyword=_e \
           --keyword=_n:1,2 \
           --keyword=_x:1,2c \
           --keyword=_ex:1,2c \
           --keyword=_nx:4c,1,2 \
           --keyword=esc_attr_ \
           --keyword=esc_attr_e \
           --keyword=esc_attr_x:1,2c \
           --keyword=esc_html_ \
           --keyword=esc_html_e \
           --keyword=esc_html_x:1,2c \
           --keyword=_n_noop:1,2 \
           --keyword=_nx_noop:3c,1,2 \
           --keyword=__ngettext_noop:1,2 \
           --package-name=papi \
           --from-code=UTF-8 \
           --output=languages/papi.pot \
           src/**/*.php
	# Add Poedit information to the template file.
	cat languages/papi.pot|perl -pe 's/8bit\\n/8bit\\n\"\n\"X-Poedit-Basepath:\
	..\\n"\n"X-Poedit-SourceCharset: UTF-8\\n"\n\
	"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;_nx_noop:3c,1,2;__ngettext_noop:1,2\\n"\n\
	"X-Poedit-SearchPath-0: .\\n"\n\
	"X-Poedit-SearchPathExcluded-0: *.js\\n"\n"Plural-Forms: nplurals=2; plural=(n != 1);\\n\\n/g'|tail -n +7|tee languages/papi.pot >/dev/null 2>/dev/null

watch:
	node_modules/.bin/parallelshell "make watch:css" "make watch:js"

watch\:css:
	node_modules/.bin/watch 'make css' src/assets/scss

watch\:js:
	node_modules/.bin/watch 'make js' src/assets/js
<commit_msg>Add lint command<commit_after>all: css js

css:
	node_modules/.bin/node-sass -o dist/css/ --source-map dist/css/style.css.map src/assets/scss/style.scss > dist/css/style.css
	node_modules/.bin/autoprefixer-cli -b "last 2 version" dist/css/style.css dist/css/style.css
	cat src/assets/css/components/*.css dist/css/style.css > dist/css/style.min.css
	node_modules/.bin/csso dist/css/style.min.css dist/css/style.min.css
	echo "\n/*# sourceMappingURL=style.min.css.map */" >> dist/css/style.min.css
	mv dist/css/style.css.map dist/css/style.min.css.map
	rm dist/css/style.css

deps:
	composer install
	npm install
	brew install gettext
	brew link --force gettext

js:
	node_modules/.bin/webpack

lint:
	make lint:js
	make lint:php

lint\:js:
	node_modules/.bin/eslint src/assets/js/*.js src/assets/js/properties/*.js

lint\:php:
	vendor/bin/phpcs -s --extensions=php --standard=phpcs.xml src/

pot:
	xgettext --language=php \
           --add-comments=L10N \
           --keyword=__ \
           --keyword=_e \
           --keyword=_n:1,2 \
           --keyword=_x:1,2c \
           --keyword=_ex:1,2c \
           --keyword=_nx:4c,1,2 \
           --keyword=esc_attr_ \
           --keyword=esc_attr_e \
           --keyword=esc_attr_x:1,2c \
           --keyword=esc_html_ \
           --keyword=esc_html_e \
           --keyword=esc_html_x:1,2c \
           --keyword=_n_noop:1,2 \
           --keyword=_nx_noop:3c,1,2 \
           --keyword=__ngettext_noop:1,2 \
           --package-name=papi \
           --from-code=UTF-8 \
           --output=languages/papi.pot \
           src/**/*.php
	# Add Poedit information to the template file.
	cat languages/papi.pot|perl -pe 's/8bit\\n/8bit\\n\"\n\"X-Poedit-Basepath:\
	..\\n"\n"X-Poedit-SourceCharset: UTF-8\\n"\n\
	"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;_nx_noop:3c,1,2;__ngettext_noop:1,2\\n"\n\
	"X-Poedit-SearchPath-0: .\\n"\n\
	"X-Poedit-SearchPathExcluded-0: *.js\\n"\n"Plural-Forms: nplurals=2; plural=(n != 1);\\n\\n/g'|tail -n +7|tee languages/papi.pot >/dev/null 2>/dev/null

watch:
	node_modules/.bin/parallelshell "make watch:css" "make watch:js"

watch\:css:
	node_modules/.bin/watch 'make css' src/assets/scss

watch\:js:
	node_modules/.bin/watch 'make js' src/assets/js

{'fraction_non_alphanumeric': 0.17571336623042266, 'fraction_numerical': 0.02274190087963956, 'mean_word_length': 2.5344958301743747, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '6280058', 'n_tokens_mistral': 1950, 'n_tokens_neox': 1923, 'n_words': 255}