Enforcing workspace member visibility in Biome vs Cargo for private API boundaries
0 reputation · 16 Oct 2020, 11:06 UTC
0 reputation · 16 Oct 2020, 11:06 UTC
Biome's workspace configuration supports include and exclude fields in workspace.json to control member exposure. Additionally, the publish configuration can restrict accidental public access by setting publish = false for private members. However, Biome's resolver behavior for workspace members differs from Cargo's, creating potential for inconsistent public API surface when using use statements across members.
The core constraint is maintaining Rust's pub(crate)-like visibility semantics at the workspace level. While Cargo provides native mechanisms through its dependency resolution and crate visibility rules, Biome lacks an equivalent native configuration-level enforcement. This creates uncertainty about which members should remain private when consumed as dependencies by other workspace members or external packages.
The unresolved question centers on whether Biome should adopt a configuration-driven visibility model similar to Rust's module system, or rely on Cargo's existing pub(crate) semantics with Biome acting as a configuration layer only.
pub(crate) semantics?A thoughtful contribution can make all the difference. Be the first to share one.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.