Skip to main content

Crate weft_client_shim

Crate weft_client_shim 

Source
Expand description

Trait surface separating the OSS Heddle CLI from the closed hosted-client implementation.

OSS builds use NoopWeftExtensions, which returns a friendly “hosted features not enabled” error on every method. Closed builds ship a real implementation in the hosted-client crate and inject it via Cargo features (today) or [patch.crates-io] (post-split).

Why a separate crate (and not just a trait in cli)? When the repos physically split, the OSS heddle-cli crate ships on crates.io. The closed heddle-hosted-client crate published in the private workspace depends on this shim to satisfy cli’s trait bound without cli ever knowing about closed-source code. Same trait surface, two impls, no circular deps.

Trait methods are intentionally minimal — only the truly hosted-only commands (auth, support, presence) flow through here. Hybrid commands like push/pull/fetch/clone stay in cli because their git-overlay-without-hosted code paths must work in OSS-only builds too.

Structs§

NoopWeftExtensions
Noop implementation used in OSS builds. Every method returns the same friendly error pointing the user at the closed-build installation path.

Traits§

CliContext
Small projection of cli::Cli that hosted commands rely on. Defining the surface here rather than passing &Cli lets the closed hosted-client crate compile without depending on cli — breaking what would otherwise be a circular dep (cli optionally pulls in hosted-client, hosted-client would otherwise need cli for the Cli type).
WeftExtensions
Hosted-side command implementations. The CLI dispatches through a &dyn WeftExtensions reference; the active impl is selected at build time by the hosted-client Cargo feature.