this_algorithm/justfile

72 lines
2.0 KiB
Makefile
Raw Normal View History

2023-03-17 23:10:12 -04:00
build: fmt docs-build rust-test rust-build
2023-02-28 09:36:36 -05:00
2023-03-12 01:38:47 -05:00
push:
podman push gitea.austen-wares.com/public/xpin-server
2023-03-01 07:28:33 -05:00
rust-test:
2023-02-28 11:53:39 -05:00
cargo test --all
cargo fmt --all --check
2023-03-15 23:52:58 -04:00
rust-build: docs-build output-clean
2023-02-28 05:58:43 -05:00
cargo build --all
cargo build -p web --release --target x86_64-unknown-linux-musl
earthly +rust-image
2023-02-28 05:58:43 -05:00
2023-03-19 13:03:19 -04:00
wasm-build:
2023-03-02 18:55:40 -05:00
wasm-pack build --target web xpin-wasm
2023-03-13 00:02:33 -04:00
# wasm2js xpin-wasm/pkg/xpin_wasm_bg.wasm -o xpin-wasm/pkg/xpin_wasm_bg.wasm.js
# sed -i 's/xpin_wasm_bg.wasm/xpin_wasm_bg.wasm.js/' xpin-wasm/pkg/wasm2js.js xpin-wasm/pkg/wasm2js_bg.js
2023-02-28 05:58:43 -05:00
wordlist-build:
. wordlist/venv/bin/activate && cd wordlist && for i in *.py; do "./${i}"; done
2023-03-19 21:03:10 -04:00
js-build: output-clean wasm-build docs-build
yarn --cwd ./web-frontend/ build
# rsync -ha ./web-frontend/build/ ./build/
2023-02-28 05:58:43 -05:00
output-clean:
2023-03-17 23:10:12 -04:00
rm -vrf ./web-frontend/build/ ./web-frontend/src/lib/docs/
mkdir -p ./web-frontend/src/lib/docs/
2023-02-28 09:36:36 -05:00
2023-03-12 00:54:16 -05:00
docs-build: output-clean
2023-02-28 09:36:36 -05:00
earthly +docs
2023-03-14 00:23:14 -04:00
rsync --stats -ha ./build/docs/ ./web-frontend/src/lib/docs/
for f in "${PWD}/web-frontend/src/lib/docs/"*.html; do ./web-frontend/node_modules/.bin/inliner "${f}" >"${f}-2" && mv -v -- "${f}-2" "${f}"; done
2023-03-19 15:58:07 -04:00
# cargo doc --all
2023-02-28 09:36:36 -05:00
2023-02-28 05:58:43 -05:00
# TODO: Clippy
2023-03-01 07:28:33 -05:00
rust-watch:
2023-02-28 05:58:43 -05:00
cargo watch -x fmt -x check -x build
2023-04-30 23:27:09 -04:00
js-dev: wasm-build
2023-02-28 05:58:43 -05:00
yarn --cwd ./web-frontend/ dev
fmt:
2023-02-28 09:36:36 -05:00
# just --fmt --unstable
2023-02-28 11:53:39 -05:00
cargo fmt --all
2023-02-28 05:58:43 -05:00
yarn --cwd ./web-frontend/ format
2023-02-28 11:53:39 -05:00
serve:
http-server --verbose ./web-frontend/build/
2023-03-02 01:05:05 -05:00
init:
2023-02-28 05:58:43 -05:00
yarn --cwd ./web-frontend/
cargo fetch
2023-02-28 06:31:42 -05:00
cargo install wasm-pack
2023-04-17 19:41:08 -04:00
earthly +docs-builder
earthly +minify
2023-03-12 00:54:16 -05:00
2023-03-19 15:58:07 -04:00
clean: output-clean
cargo clean
2023-04-29 11:22:31 -04:00
rust-cache: build
2023-04-27 21:31:41 -04:00
cargo check --all
cargo build --all
cargo doc --all
cargo clippy --all
2023-04-27 21:39:30 -04:00
cargo test --all
2023-04-27 21:31:41 -04:00
2023-03-12 00:54:16 -05:00
init-python:
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')'