From bc4182e34f1048d288f1d8cddda99d5faa750cb8 Mon Sep 17 00:00:00 2001 From: ishaaq Date: Thu, 11 Apr 2024 12:52:05 +0530 Subject: [PATCH] Added Watchexec to JustFile --- justfile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/justfile b/justfile index 2a63707..630cb0b 100644 --- a/justfile +++ b/justfile @@ -1,7 +1,10 @@ +TRUNK_CONFIG_FILE := if os() == "windows" { "Trunk.win.toml" } else { "Trunk.toml" } +TRUNK_RELEASE_CONFIG_FILE := if os() == "windows" { "Trunk-release.win.toml" } else { "Trunk.toml" } + # build in release mode build: # build frontend - trunk --config Trunk-release.toml build + trunk --config {{TRUNK_RELEASE_CONFIG_FILE}} build # build backend cargo build --release --workspace --exclude frontend @@ -17,8 +20,8 @@ clippy: # run clippy fix fix: - cargo clippy -p frontend --fix --target wasm32-unknown-unknown --allow-dirty - cargo clippy --workspace --fix --exclude frontend --allow-dirty + cargo clippy -p frontend --fix --target wasm32-unknown-unknown + cargo clippy --workspace --fix --exclude frontend # build docs. use --open to open in browser doc *ARGS: @@ -26,11 +29,11 @@ doc *ARGS: # run frontend devserver. use --open to open a new browser serve-frontend *ARGS: - trunk serve {{ ARGS }} + trunk --config {{TRUNK_CONFIG_FILE}} serve {{ ARGS }} # run API server serve-api *ARGS: - cargo run -p uchat_server {{ ARGS }} + watchexec -r -i "frontend/**" -i "target/**" --exts rs,sql,toml cargo run -p uchat_server {{ ARGS }} # set up project dependencies init: @@ -53,4 +56,3 @@ db-reset: # create a new database migration db-new-migration NAME: diesel migration generate {{ NAME }} -