use std::path::PathBuf;
use compmd_host::ManifestError;
#[derive(Debug, thiserror::Error)]
pub enum BuildError {
#[error("no bundle in {}: build the page with @compmd/vite first", .0.display())]
NoBundle(PathBuf),
#[error("the bundle's manifest is format {found}, and tauri-plugin-compmd {} reads format {known}: use the plugin of the same release as @compmd/vite", env!("CARGO_PKG_VERSION"))]
Format {
found: u32,
known: u32,
},
#[error("the bundle's manifest can't be read: {0}")]
Manifest(ManifestError),
#[error("{}", crate::BUILT_WITHOUT_SOURCE)]
NoScheme,
#[error(
"the bundle's source names `{0}`, which isn't a scheme's name: lowercase letters, digits, `+`, `-` and `.`, starting with a letter"
)]
Scheme(String),
#[error("{} can't be read: {why}", .folder.display())]
Unreadable {
folder: PathBuf,
why: String,
},
}