devforge 0.3.0

Dev environment orchestrator — docker, health checks, mprocs, custom commands via TOML config
Documentation
use devforge::Config;

/// Verify the full TileForge-style config parses correctly.
#[test]
fn tileforge_example_config() {
    let toml = r#"
env_files = [".env", "web/.env.local"]
required_tools = ["docker", "cargo", "node", "npm", "mprocs"]

[docker]
compose_file = "docker-compose.yml"

[[docker.health_checks]]
name = "postgres"
cmd = ["docker", "compose", "exec", "-T", "postgres", "pg_isready", "-U", "tileforge"]
timeout = 30

[[docker.health_checks]]
name = "redis"
cmd = ["docker", "compose", "exec", "-T", "redis", "redis-cli", "ping"]
timeout = 30

[[docker.health_checks]]
name = "minio"
url = "http://localhost:9000/minio/health/live"
timeout = 30

[dev]
mprocs_config = "mprocs.yaml"

[[dev.hooks]]
cmd = "npm install"
cwd = "web"

[dev.hooks.condition]
missing = "web/node_modules"

[[commands]]
name = "migrate"
cmd = ["cargo", "run", "--release", "--package", "tileforge-api", "--", "migrate"]
description = "Run database migrations"
docker = true
"#;

    let config = Config::load(toml).unwrap();
    assert_eq!(config.env_files.len(), 2);
    assert_eq!(config.required_tools.len(), 5);
    assert_eq!(config.docker.health_checks.len(), 3);
    assert_eq!(config.dev.hooks.len(), 1);
    assert_eq!(config.commands.len(), 1);
    assert!(config.commands[0].docker);
}

/// Verify minimal config with all defaults works.
#[test]
fn minimal_config() {
    let config = Config::load("").unwrap();
    assert!(config.env_files.is_empty());
    assert!(config.required_tools.is_empty());
    assert_eq!(config.docker.compose_file, "docker-compose.yml");
    assert_eq!(config.dev.mprocs_config, "mprocs.yaml");
    assert!(config.commands.is_empty());
}