forgex 0.10.2

CLI and runtime for the Forge full-stack framework
Documentation
[package]
name = "forgex"
version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
readme = "README.md"
description = "CLI and runtime for the Forge full-stack framework"
keywords = ["framework", "postgresql", "full-stack", "cli"]
categories = ["web-programming", "command-line-utilities"]
include = [
  "Cargo.toml",
  "build.rs",
  "generated/examples.tar",
  "README.md",
  "src/**",
  ".sqlx/**",
]

[lints]
workspace = true

[lib]
name = "forge"
path = "src/lib.rs"

[[bin]]
name = "forge"
path = "src/main.rs"

[dependencies]
forge-core = { version = "0.10.2", path = "../forge-core" }
forge-runtime = { version = "0.10.2", path = "../forge-runtime", default-features = false }
forge-codegen = { version = "0.10.2", path = "../forge-codegen" }
forge-macros = { version = "0.10.2", path = "../forge-macros" }

tokio = { workspace = true }
tokio-util = { workspace = true }
tracing = { workspace = true }
tracing-subscriber = { workspace = true }
anyhow = { workspace = true }
chrono = { workspace = true }
uuid = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
clap = { version = "4.5", features = ["derive"] }
clap_complete = "4.5"
console = "0.16"
dotenvy = "0.15"
toml = { workspace = true }
sqlx = { workspace = true }
reqwest = { workspace = true }
include_dir = "0.7"
inventory = { workspace = true }
ipnet = { workspace = true }

# `gateway` feature deps (forwarded to forge-runtime)
axum = { workspace = true, optional = true }
tower = { workspace = true, optional = true }
tower-http = { workspace = true, optional = true }

# `otel` feature deps (forwarded to forge-runtime)
tracing-opentelemetry = { workspace = true, optional = true }
opentelemetry = { workspace = true, optional = true }
opentelemetry_sdk = { workspace = true, optional = true }
opentelemetry-otlp = { workspace = true, optional = true }

rust-embed = { workspace = true, optional = true }
mime_guess = { workspace = true, optional = true }

[features]
# Default to `full` so existing apps upgrade transparently. Users who want a
# slim binary opt out via `default-features = false` and pick presets below.
default = ["full"]

# --- Subsystem features (forwarded to forge-runtime) ---

# HTTP gateway bundle: RPC, SSE realtime, OAuth, MCP, webhooks, signals.
gateway = [
    "forge-runtime/gateway",
    "dep:axum",
    "dep:tower",
    "dep:tower-http",
]

# Background job queue and worker.
jobs = ["forge-runtime/jobs"]

# Durable workflow executor. Depends on `jobs` because workflow steps
# resume via job dispatch.
workflows = ["jobs", "forge-runtime/workflows"]

# Cron scheduler. Depends on `jobs` because scheduled runs dispatch as jobs.
cron = ["jobs", "forge-runtime/cron"]

# Long-running daemon runner.
daemons = ["forge-runtime/daemons"]

# OAuth 2.1 + PKCE for MCP authentication.
mcp-oauth = ["gateway", "forge-runtime/mcp-oauth"]

# GeoIP enrichment for signals (heavy build-time download).
geoip = ["gateway", "forge-runtime/geoip"]

# OpenTelemetry exporters (heavy crate deps).
otel = [
    "forge-runtime/otel",
    "dep:tracing-opentelemetry",
    "dep:opentelemetry",
    "dep:opentelemetry_sdk",
    "dep:opentelemetry-otlp",
]

# --- Bundle presets ---

# Everything except geoip. `geoip` requires a build-time network fetch for the
# bundled IP-to-country DB and is excluded from the default preset so that
# `cargo build` succeeds in offline/CI environments. Enable it explicitly with
# `--features forgex/geoip` when needed.
full = [
    "gateway",
    "mcp-oauth",
    "jobs",
    "workflows",
    "cron",
    "daemons",
    "otel",
]

# Worker-only: jobs + workflows + cron + daemons + observability. No HTTP.
# Use for binaries that consume jobs/workflows but don't serve traffic.
worker = ["jobs", "workflows", "cron", "daemons", "otel"]

# API server: HTTP gateway + observability. No background workers.
# Use for read-heavy API nodes.
api = ["gateway", "otel"]

# Bare minimum HTTP server: gateway only, no OTel exporters, no workers.
# Smallest gateway binary; structured logs go to stderr only.
minimal = ["gateway"]

# --- Other features ---

testcontainers = ["forge-core/testcontainers", "forge-runtime/testcontainers"]
embedded-frontend = ["dep:rust-embed", "dep:mime_guess"]

[target.'cfg(unix)'.dependencies]
nix = { version = "0.29", features = ["signal", "hostname"] }

[dev-dependencies]
tempfile = { workspace = true }
trybuild = { workspace = true }

[build-dependencies]
tar = "0.4"