Skip to content

About

Plugins for guinea applications.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

guinea-plugins

Plugins for guinea 0.35 applications.

Crate Purpose
guinea-plugin-store Persistent storage, migrations and optional in-memory fallback
guinea-plugin-l10n Typed localisation and an explicitly remembered language
guinea-plugin-l10n-build Fluent accessors generated in build.rs
guinea-plugin-single-instance One running copy per application identifier and user
guinea-plugin-window-state Window geometry persisted by label
guinea-plugin-devtools Connection to devtools
guinea-devtools-protocol Messages shared by applications and devtools

guinea-widgets contains tables, charts and drag handles. guinea-devtools is the inspector application, HTTP API and MCP server.

Application wiring

use guinea::app::FeatureBuilder;
use guinea_plugin_store::{StoreConfig, StorePlugin};
use guinea_plugin_l10n::{L10nConfig, L10nPlugin};

fn app(app: &mut FeatureBuilder) -> anyhow::Result<guinea::winui::Window> {
    let StorePlugin(store, _) =
        app.plugin::<StorePlugin>(StoreConfig::for_app("my-app", "settings").or_in_memory())?;
    app.plugin::<L10nPlugin<L10n>>(L10nConfig::new("en").remembered_in(store.clone()))?;
    Ok(guinea::winui::Window::of::<Shell>().title("My app"))
}

The application selects the instances and the order. After a successful installation, guinea automatically publishes the values declared in provides. Installers receive them as arguments; another plugin can also take a returned value in its configuration. One provider of each service type is allowed on a scope branch. Independent stores belong to separate application trees, not repeated StorePlugin calls in one application. Reducer exports, such as Language<L10n>, are published by the plugin declaration.

Configuration is separate from the installed value: StoreConfig, L10nConfig, SingleInstanceConfig, WindowStateConfig and DevToolsConfig. Plugin resources belong to the application scope; dropping a returned value does not uninstall them. Dropping the application tears down its resources and runs cleanup.

Writing a plugin

use guinea::prelude::*;

plugin! {
    pub MyPlugin {
        provides { MyService }
    }
}

#[builds]
fn my_plugin(app: &mut PluginBuilder, config: MyConfig) -> anyhow::Result<MyPlugin> {
    let service = MyService::open(config)?;
    let closing = service.clone();
    app.on_cleanup(move || closing.close());
    Ok(MyPlugin(service))
}

Validate configuration before creating resources. A failed installation does not undo external side effects or release resources already registered in the application scope. Propagating the error out of the application's startup drops that scope.

Test installation without a window using guinea's test-utils feature:

let mut app = guinea::app::TestApp::new();
let StorePlugin(store, _) = app.plugin::<StorePlugin>(StoreConfig::in_memory())?;
drop(app);

Compatibility

Dependencies use guinea 0.35.0 or a compatible patch release. The WinUI stack is windows-reactor-pre 0.107.1 and windows-canvas-pre 0.107.0, with windows-window-pre 0.104.0. Consumers must use the same guinea and reactor types; depending on an older plugin tag alongside guinea 0.35 creates incompatible copies.

The store re-exports amethystate 0.29 and has its own package version, 0.29.0. The other workspace packages use version 0.35.2. Plugins are distributed by repository git tags, not through crates.io:

guinea-plugin-store = { git = "https://github.com/guinea-rs/guinea-plugins", tag = "v0.35.2" }

The older v0.31.0 tag targets guinea 0.31 and uses manual service publication; it must not be mixed with guinea 0.35. The devtools JSON protocol remains 3.9.

Checks

Normal local and CI builds use Rust 1.99.1, including the standalone workspace in tools/devtools. The declared MSRV remains 1.95. Ordinary dev, test, release and bench profiles disable debug information; optimisation levels are unchanged. Windows sampler symbol tests use the opt-in profile described in the inspector README.

cargo fmt --check
cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
cargo clippy --workspace --all-targets --locked -- -D warnings
cargo test --workspace --all-features --locked
cargo test --manifest-path tools/devtools/Cargo.toml --workspace --locked

About

Plugins for guinea applications.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages