1
0
mirror of https://gitlab.nic.cz/turris/reforis/foris-js.git synced 2024-12-27 00:31:35 +01:00
foris-js/Makefile

69 lines
1.7 KiB
Makefile
Raw Normal View History

2019-11-01 10:28:28 +01:00
.PHONY: all install-js watch-js build-js collect-files pack publish-beta publish-latest lint test test-js-update-snapshots create-messages update-messages docs docs-watch clean
DEV_PYTHON=python3.7
VENV_NAME?=venv
VENV_BIN=$(shell pwd)/$(VENV_NAME)/bin
all:
2019-09-10 10:30:42 +02:00
@echo "make install-js"
@echo " Install dependencies"
@echo "make watch-js"
@echo " Compile JS in watch mode."
@echo "make build-js"
@echo " Compile JS."
@echo "make lint-js"
@echo " Run linter"
@echo "make test-js"
@echo " Run tests"
@echo "make create-messages"
@echo " Create locale messages (.pot)."
@echo "make update-messages"
@echo " Update locale messages from .pot file."
2019-09-25 15:43:37 +02:00
@echo "make docs"
@echo " Build project documentation."
@echo "make docs-watch"
@echo " Start styleguidist server."
@echo "make clean"
@echo " Remove python artifacts and virtualenv."
venv: $(VENV_NAME)/bin/activate
$(VENV_NAME)/bin/activate:
test -d $(VENV_NAME) || $(DEV_PYTHON) -m virtualenv -p $(DEV_PYTHON) $(VENV_NAME)
$(VENV_BIN)/$(DEV_PYTHON) -m pip install -r requirements.txt
touch $(VENV_NAME)/bin/activate
2019-09-10 10:30:42 +02:00
install-js: package.json
npm install --save-dev
2019-11-01 10:28:28 +01:00
collect-files:
sh scripts/collect_files.sh
pack: collect-files
cd dist && npm pack
publish-beta: collect-files
sh scripts/publish.sh beta
publish-latest: collect-files
sh scripts/publish.sh latest
2019-09-25 13:56:08 +02:00
lint:
2019-09-10 10:30:42 +02:00
npm run lint
2020-01-09 11:25:29 +01:00
lint-js-fix:
npm run lint:fix
2019-09-10 10:30:42 +02:00
2019-09-25 13:56:08 +02:00
test:
2019-09-10 10:30:42 +02:00
npm test
2019-10-24 10:12:39 +02:00
test-js-update-snapshots:
npm test -- -u
2019-09-10 10:30:42 +02:00
create-messages: venv
$(VENV_BIN)/pybabel extract -F babel.cfg -o ./translations/forisjs.pot .
update-messages: venv
$(VENV_BIN)/pybabel update -i ./translations/forisjs.pot -d ./translations -D forisjs
2019-09-25 15:43:37 +02:00
docs:
npm run-script docs
docs-watch:
npm run-script docs:watch
clean:
rm -rf node_modules dist