vcs-core 0.3.0

Unified facade over vcs-git and vcs-jj: repo detection and a backend-agnostic VCS handle.
Documentation
[package]
name = "vcs-core"
version = "0.3.0"
description = "Unified facade over vcs-git and vcs-jj: repo detection and a backend-agnostic VCS handle."
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true
authors.workspace = true
readme = "README.md"

[dependencies]
# Re-exported `Error`/`ProcessRunner`/`JobRunner` and the `ScriptedRunner` test
# seam the underlying clients are generic over. No subprocess work happens here.
processkit.workspace = true
# The typed per-tool clients this crate dispatches between. Path within the
# workspace; `version` is used when published independently.
vcs-git = { path = "../git", version = "0.5" }
vcs-jj = { path = "../jj", version = "0.5" }
# Shared diff DTOs (`ChangeKind`/`DiffStat` re-exported here, so the facade and
# the backends use one type, no remap) and the error classifiers.
vcs-diff = { path = "../diff", version = "0.1" }
vcs-cli-support = { path = "../cli-support", version = "0.1" }
# `async fn` in the object-safe `VcsRepo` trait, so a consumer can hold a
# `Box<dyn VcsRepo>` / `&dyn VcsRepo` instead of threading the runner generic.
async-trait = "0.1"
# Optional: derive `Serialize` on the facade DTOs behind the `serde` feature
# (off by default). Turned on by JSON consumers such as `vcs-mcp`.
serde = { version = "1", features = ["derive"], optional = true }

[features]
# Forward to the underlying clients' `tracing` (a `debug` event per command).
# Features aren't re-exported, so this is how a `vcs-core`-only consumer turns it
# on for both backends at once.
tracing = ["vcs-git/tracing", "vcs-jj/tracing"]
# Add `#[derive(Serialize)]` to the facade DTOs (`RepoSnapshot`, `FileChange`, …);
# also enables it on the re-exported `vcs-diff` types (`ChangeKind`/`DiffStat`).
serde = ["dep:serde", "vcs-diff/serde"]
# Forward to the backends' `cancellation`, so a `vcs-core`-only consumer can build
# a cancellable `Git`/`Jj` (via `default_cancel_on`) and pass it to
# `Repo::from_git`/`from_jj`. Off by default.
cancellation = ["vcs-git/cancellation", "vcs-jj/cancellation"]

[dev-dependencies]
# `#[tokio::test]` for the async dispatch tests.
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
# Exercise the `serde` feature's derives (used only by the feature-gated test).
serde_json = "1"
# Throwaway git/jj repos for the ignored integration tests. Path-only: dev-deps
# are stripped on publish, so this adds no release coupling.
vcs-testkit = { path = "../testkit" }

[package.metadata.docs.rs]
# Build docs.rs with every feature so the optional surfaces (mock / tracing /
# cancellation / serde / stream) are documented (defaults alone hide them), and pass
# `--cfg docsrs` so feature-gated items render an "Available on feature `x`" badge.
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[lints]
workspace = true