# Trunk configuration for syntaxis Leptos CSR dashboard
# Trunk is the build system for web WASM applications built with Leptos
# See: https://trunkrs.io/

[build]
# Target directory for build output
target = "target/site"

# Public URL where the app will be served
# "/" means root path (for production serving at domain root)
public_url = "/"

# Watch patterns for file changes during development
watch_patterns = [
  "crates/client/src/**/*",
  "index.html",
  "uno.config.ts",
]

[watch]
# Additional directories to watch during trunk serve
ignore = ["target", "node_modules"]

[hooks]
# Build hooks: run pnpm css:build before Trunk builds WASM
# This ensures UnoCSS generates styles before WASM build

[[hooks.pre_build]]
# Run UnoCSS to generate CSS before building WASM
command = "pnpm"
command_arguments = ["css:build"]

[serve]
# Development server configuration for `trunk serve`
# Used with `just dev-dashboard` which proxies /api to main API server
port = 8080
address = "127.0.0.1"

# Configure proxy for API development
# Maps /api/* requests to the main API server
# Example: /api/health → http://localhost:3000/api/health
# This can be overridden with --proxy-backend flag at runtime
# proxy_backend = "http://localhost:3000/api"

# Use HTTPS in development (optional)
# https = true

# Open browser automatically on serve
open_browser = true

[release]
# Optimization settings for production builds
# Trunk handles WASM optimization automatically
