Skip to content

Commit

Permalink
Added Watchexec to JustFile
Browse files Browse the repository at this point in the history
  • Loading branch information
ishaaqziyan committed Apr 11, 2024
1 parent d9cd966 commit bc4182e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions justfile
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -17,20 +20,20 @@ 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:
cargo doc -F docbuild {{ 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:
Expand All @@ -53,4 +56,3 @@ db-reset:
# create a new database migration
db-new-migration NAME:
diesel migration generate {{ NAME }}

0 comments on commit bc4182e

Please sign in to comment.