islands-build 0.1.3

Layout-agnostic build pipeline for islands.rs apps: WASM bundling, the V8 module-namespace patch, per-page CSS, and content-hash manifests. Composed by a thin xtask in any workspace.
Documentation
//! The serialized `manifest.json` schema (writer side).
//!
//! The reader lives in `islands-core` (`Manifest::load`) and is already generic
//! over a string-keyed `pages` map. This is the writer the content-hash pass
//! emits.

use std::collections::BTreeMap;

use serde::Serialize;

/// One page-bundle entry: the content-hashed paths (relative to `static/`) for a
/// bundle's JS, WASM, and (optionally) CSS.
#[derive(Debug, Clone, Serialize, PartialEq, Eq)]
pub struct ManifestBundleEntry {
    pub js: String,
    pub wasm: String,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub css: Option<String>,
}

/// The manifest written to `<out_dir>/manifest.json`.
///
/// Keys: `"islands-core"` (shared runtime), `"css-base"` (hashed base
/// stylesheet path, hyphenated per the plan spec), and `"pages"` (a map keyed by
/// each page's `bundle_key`, e.g. `"counter/page-home"`).
#[derive(Debug, Clone, Serialize, PartialEq, Eq)]
pub struct BuildManifest {
    #[serde(rename = "islands-core")]
    pub islands_core: ManifestBundleEntry,
    #[serde(rename = "css-base")]
    pub css_base: String,
    pub pages: BTreeMap<String, ManifestBundleEntry>,
}