Skip to main content

Crate whisker_cng

Crate whisker_cng 

Source
Expand description

Whisker CNG (Continuous Native Generation).

Renders the Android / iOS host projects under gen/{android,ios}/ from the user’s whisker.rs (= whisker_config::Config). Drift between the in-tree files and the current config is detected via a content-hashed fingerprint stored alongside each generated tree (gen/<platform>/.whisker-fingerprint).

Modelled on Expo’s CNG: the source of truth is the declarative config, the platforms directory are build artifacts (never committed). Unlike Expo, regeneration is implicit — there’s no separate whisker generate command. Whichever command needs the native tree (today: whisker run) calls sync_android / sync_ios first; the fast path (fingerprint match) is a single file read and returns instantly.

§Public entry points

The crate has no CLI surface and shells out to nothing — whisker-cli is responsible for running xcodegen, gradle, etc. after a sync completes. Keeping side-effects out of the renderer makes it cheap to unit-test against tempdirs.

Re-exports§

pub use android::sync as sync_android;
pub use android::AndroidInputs;
pub use compose::EnabledTargets;
pub use compose::Engine;
pub use compose::SubprocessPlugin;
pub use discovery::discover_plugins;
pub use discovery::DiscoveredPlugin;
pub use ios::sync as sync_ios;
pub use ios::IosInputs;

Modules§

android
Render the Android host project under gen/android/ from an Config.
compose
In-process plugin engine.
discovery
Plugin discovery — walks a user crate’s cargo dep graph and returns every dependency declaring a Whisker CNG plugin in its Cargo.toml’s [package.metadata.whisker.plugins.<name>] table.
ios
Render the iOS host project under gen/ios/ from an Config.
plugins
Built-in Whisker CNG plugins.

Structs§

Config