2023-06-27 18:03:52 +00:00
|
|
|
#!/usr/bin/env just --justfile
|
|
|
|
|
2023-06-28 05:20:04 +00:00
|
|
|
build: build-frontend
|
|
|
|
cargo build --release
|
|
|
|
|
|
|
|
install-frontend:
|
|
|
|
bun install --cwd frontend
|
|
|
|
|
|
|
|
clean-frontend:
|
2023-06-29 04:34:09 +00:00
|
|
|
rm -rf ./static/js/* ./static/css/*
|
2023-06-28 05:20:04 +00:00
|
|
|
|
2023-06-29 04:00:26 +00:00
|
|
|
build-frontend: clean-frontend
|
2023-06-29 04:34:09 +00:00
|
|
|
bun build frontend/js/index.ts \
|
|
|
|
--outdir ./static \
|
|
|
|
--root ./frontend \
|
|
|
|
--entry-naming [dir]/[name]-[hash].[ext] \
|
|
|
|
--asset-naming [dir]/[name]-[hash].[ext] \
|
2023-06-29 04:00:26 +00:00
|
|
|
--minify
|
|
|
|
|
|
|
|
build-dev-frontend: clean-frontend
|
2023-06-29 04:34:09 +00:00
|
|
|
bun build frontend/js/index.ts \
|
|
|
|
--outdir ./static \
|
|
|
|
--root ./frontend \
|
|
|
|
--entry-naming [dir]/[name]-[hash].[ext] \
|
|
|
|
--asset-naming [dir]/[name]-[hash].[ext]
|
2023-06-29 04:00:26 +00:00
|
|
|
touch .frontend-built # triggers watch-backend since static/* is ignored
|
2023-06-28 05:20:04 +00:00
|
|
|
|
|
|
|
watch-frontend: install-frontend
|
|
|
|
cargo watch -w frontend \
|
2023-06-29 04:00:26 +00:00
|
|
|
-s 'just build-dev-frontend'
|
2023-06-28 05:20:04 +00:00
|
|
|
|
|
|
|
watch-backend:
|
|
|
|
mold -run cargo watch \
|
|
|
|
--ignore 'logs/*' \
|
|
|
|
--ignore 'static/*' \
|
|
|
|
--ignore 'frontend/*' \
|
2023-06-29 04:00:26 +00:00
|
|
|
--no-vcs-ignores \
|
2023-06-28 05:20:04 +00:00
|
|
|
-x run
|
|
|
|
|
2023-06-29 04:00:26 +00:00
|
|
|
# runs watch-frontend and watch-backend simultaneously
|
2023-06-28 05:20:04 +00:00
|
|
|
watch:
|
|
|
|
./watch.sh
|
|
|
|
|
|
|
|
migrate:
|
|
|
|
sqlx migrate run
|