Skip to content

Testing and Packaging

Atsukoro1 edited this page Sep 14, 2026 · 2 revisions

Test and package an extension

Test with Serein's offline demo before publishing. The demo uses a separate bounded temporary profile and does not connect to Discord, read saved credentials, or download catalog content.

Run the creator checks

From a Serein source checkout:

cargo check --locked --manifest-path examples/extensions/Cargo.toml
cargo run --locked -p extensions --example panel_api
cargo run --locked -p ui --example theme_api
cargo run --locked -p serein --example extension_settings

These verify the maintained Rust starter, panel schema, theme application, and extension settings lifecycle. They do not validate your package automatically.

Import your package offline

Start the synthetic client:

cargo run --locked -p serein --features demo -- --demo
  • Import a plugin from Settings → Extensions → Import.
  • Import a theme from Settings → Themes → Import.
  • Importing alone does not execute a plugin or grant it capabilities.
  • Review the displayed manifest and capabilities, then enable it explicitly.

For a plugin, invoke every declared action and test empty, long, and invalid form values. Confirm composer replacements require Apply, stale results disappear after changing conversation/account, and disabling removes the downloaded package and plugin data.

For a theme, inspect light and dark appearances, narrow windows, menus, dialogs, hover/selected states, mentions, warnings, and text contrast. Confirm disabling and Ctrl+Shift+F12 restore built-in appearance.

Shipping limits

Resource Limit
Package JSON 16 MiB
Wasm module 4 MiB
Linear memory 16 MiB
Serialized invocation input/output 256 KiB
Panel elements 64
Panel row nesting 8 levels
Manifest actions 16
Plugin storage 1 MiB, also constrained by invocation I/O
Preview image download 256 KiB

The host also limits execution fuel, interpreter stack, queues, installed plugin count, text values, IDs, labels, select options, and image dimensions. Exceeding a limit returns an error instead of truncating data silently. See API and Security Reference for the maintained source links.

Record size and SHA-256

Do this after the final package is built. Never replace the artifact at the same version after recording these values.

PowerShell:

$package = Get-Item .\packages\hello-serein.serein-extension
$package.Length
(Get-FileHash $package.FullName -Algorithm SHA256).Hash.ToLowerInvariant()

Linux or macOS:

wc -c < packages/hello-serein.serein-extension
sha256sum packages/hello-serein.serein-extension

On macOS, shasum -a 256 may be used when sha256sum is unavailable.

Continue with Publishing to the Community Catalog.