56 lines
1.4 KiB
Makefile
56 lines
1.4 KiB
Makefile
build: fmt js-build
|
|
|
|
# Rust test needs to be built after because it depends on js-build
|
|
all: output-clean fmt build rust-build rust-test
|
|
rsync -ha ./web-frontend/build/ build/
|
|
du -shc build/* | sort -h
|
|
|
|
rust-test:
|
|
cargo test --all
|
|
cargo fmt --all --check
|
|
|
|
rust-build:
|
|
cargo build --all
|
|
cargo build -p web --release --target x86_64-unknown-linux-musl
|
|
earthly +rust-image
|
|
|
|
wasm-build:
|
|
wasm-pack build --target web xpin-wasm
|
|
|
|
wordlist-build:
|
|
. wordlist/venv/bin/activate && cd wordlist && for i in *.py; do "./${i}"; done
|
|
|
|
js-build: wasm-build docs-build
|
|
# mkdir -p ./web-frontend/static/docs/
|
|
# rsync -ha ./build/docs/ ./web-frontend/static/docs/
|
|
yarn --cwd ./web-frontend/ build
|
|
|
|
output-clean:
|
|
rm -vrf build
|
|
|
|
docs-build:
|
|
earthly +docs
|
|
cargo doc --all
|
|
|
|
# TODO: Clippy
|
|
rust-watch:
|
|
cargo watch -x fmt -x check -x build
|
|
|
|
js-dev:
|
|
yarn --cwd ./web-frontend/ dev
|
|
|
|
fmt:
|
|
# just --fmt --unstable
|
|
cargo fmt --all
|
|
yarn --cwd ./web-frontend/ format
|
|
|
|
serve:
|
|
http-server --verbose ./web-frontend/build/
|
|
|
|
init:
|
|
yarn --cwd ./web-frontend/
|
|
cargo fetch
|
|
cargo install wasm-pack
|
|
if [ ! -d "wordlist/venv" ]; then python3 -m virtualenv wordlist/venv -p "$(which python3)"; fi; export OSTYPE=linux-gnu && . wordlist/venv/bin/activate
|
|
export OSTYPE=linux-gnu && . wordlist/venv/bin/activate && pip install -r wordlist/requirements.txt && python -c 'import nltk; nltk.download('wordnet')'
|