use anyhow::Result;
use serde_json::{Value, json};
use crate::deploy::DeployTarget;
use super::args::DevArgs;
use super::watch::{self, WatchSession};
pub async fn run(args: &DevArgs, target: DeployTarget) -> Result<Value> {
let project_root = std::path::absolute(&args.path)?;
let session = WatchSession {
project_root: &project_root,
gleam_path: &args.gleam_path,
target: &target,
debounce: args.debounce_ms,
};
watch::watch(&session).await?;
Ok(json!({
"dev": "stopped",
"project_root": project_root.display().to_string(),
}))
}