diff --git a/CHANGELOG.md b/CHANGELOG.md index 7674de0..1de1a31 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## Unreleased + +### Changed + +- Use latest `tinted-builder` crate + ## [0.6.0] - 2024-06-11 ### Changed diff --git a/Cargo.lock b/Cargo.lock index f91375d..79dcf14 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -372,7 +372,7 @@ dependencies = [ [[package]] name = "tinted-builder" -version = "0.3.0" +version = "0.4.0" dependencies = [ "anyhow", "clap", diff --git a/tinted-builder-rust/Cargo.toml b/tinted-builder-rust/Cargo.toml index e0e11f1..11eee09 100644 --- a/tinted-builder-rust/Cargo.toml +++ b/tinted-builder-rust/Cargo.toml @@ -24,7 +24,7 @@ strip-ansi-escapes = "0.2.0" [dependencies.tinted-builder] path = "../tinted-builder" -version = "0.3.0" +version = "0.4.0" [[bin]] name = "tinted-builder-rust" diff --git a/tinted-builder-rust/src/cli.rs b/tinted-builder-rust/src/cli.rs index d43add8..7db9ae9 100644 --- a/tinted-builder-rust/src/cli.rs +++ b/tinted-builder-rust/src/cli.rs @@ -38,7 +38,7 @@ fn build_cli() -> Command { ) } -pub fn get_matches() -> ArgMatches { +pub(crate) fn get_matches() -> ArgMatches { let styles = styling::Styles::styled() .header(styling::AnsiColor::Green.on_default() | styling::Effects::BOLD) .usage(styling::AnsiColor::Green.on_default() | styling::Effects::BOLD) diff --git a/tinted-builder-rust/src/main.rs b/tinted-builder-rust/src/main.rs index 2795b81..3714166 100644 --- a/tinted-builder-rust/src/main.rs +++ b/tinted-builder-rust/src/main.rs @@ -1,7 +1,7 @@ mod cli; mod operations { - pub mod build; - pub mod sync; + pub(crate) mod build; + pub(crate) mod sync; } mod utils; @@ -12,7 +12,7 @@ use crate::cli::get_matches; const REPO_NAME: &str = env!("CARGO_PKG_NAME"); -pub fn replace_tilde_slash_with_home(path_str: &str) -> Result { +pub(crate) fn replace_tilde_slash_with_home(path_str: &str) -> Result { let trimmed_path_str = path_str.trim(); if trimmed_path_str.starts_with("~/") { match dirs::home_dir() { diff --git a/tinted-builder-rust/src/operations/sync.rs b/tinted-builder-rust/src/operations/sync.rs index aeef257..035fdc5 100644 --- a/tinted-builder-rust/src/operations/sync.rs +++ b/tinted-builder-rust/src/operations/sync.rs @@ -66,7 +66,7 @@ fn git_diff(target_dir: &Path) -> Result { } /// Sync schemes repo; Install if it does not exist, otherwise update -pub fn sync(schemes_path: &Path) -> Result<()> { +pub(crate) fn sync(schemes_path: &Path) -> Result<()> { if schemes_path.is_dir() { let is_diff = git_diff(schemes_path)?; diff --git a/tinted-builder-rust/src/utils.rs b/tinted-builder-rust/src/utils.rs index b15bc3d..6821a94 100644 --- a/tinted-builder-rust/src/utils.rs +++ b/tinted-builder-rust/src/utils.rs @@ -4,7 +4,7 @@ use std::io::Write; use std::path::Path; #[allow(dead_code)] -pub fn write_to_file(path: &Path, contents: &str) -> Result<()> { +pub(crate) fn write_to_file(path: &Path, contents: &str) -> Result<()> { if path.exists() { remove_file(path).with_context(|| format!("Unable to remove file: {}", path.display()))?; } diff --git a/tinted-builder/CHANGELOG.md b/tinted-builder/CHANGELOG.md index 11fe341..c81432e 100644 --- a/tinted-builder/CHANGELOG.md +++ b/tinted-builder/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## 0.4.0 - 2024-06-15 + +## Added + +- Add `Color` struct to public exports to allow users to construct a + `Scheme` themselves. + ## 0.3.0 - 2024-06-11 ## Changed diff --git a/tinted-builder/Cargo.toml b/tinted-builder/Cargo.toml index 1165f8d..d42b811 100644 --- a/tinted-builder/Cargo.toml +++ b/tinted-builder/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "tinted-builder" description = "A Tinted Theming template builder which uses yaml color schemes to generate theme files." -version = "0.3.0" +version = "0.4.0" edition = "2021" license = "MIT OR Apache-2.0" readme = "README.md" diff --git a/tinted-builder/src/constants.rs b/tinted-builder/src/constants.rs index b684a5f..6db8b2e 100644 --- a/tinted-builder/src/constants.rs +++ b/tinted-builder/src/constants.rs @@ -1,8 +1,8 @@ -pub const REQUIRED_BASE16_PALETTE_KEYS: [&str; 16] = [ +pub(crate) const REQUIRED_BASE16_PALETTE_KEYS: [&str; 16] = [ "base00", "base01", "base02", "base03", "base04", "base05", "base06", "base07", "base08", "base09", "base0A", "base0B", "base0C", "base0D", "base0E", "base0F", ]; -pub const REQUIRED_BASE24_PALETTE_KEYS: [&str; 24] = [ +pub(crate) const REQUIRED_BASE24_PALETTE_KEYS: [&str; 24] = [ "base00", "base01", "base02", "base03", "base04", "base05", "base06", "base07", "base08", "base09", "base0A", "base0B", "base0C", "base0D", "base0E", "base0F", "base10", "base11", "base12", "base13", "base14", "base15", "base16", "base17", diff --git a/tinted-builder/src/lib.rs b/tinted-builder/src/lib.rs index dfd06e1..8580b06 100644 --- a/tinted-builder/src/lib.rs +++ b/tinted-builder/src/lib.rs @@ -3,5 +3,5 @@ mod constants; mod scheme; mod template; -pub use scheme::Scheme; +pub use scheme::{Color, Scheme}; pub use template::Template; diff --git a/tinted-builder/src/scheme.rs b/tinted-builder/src/scheme.rs index b6f322b..1bb084b 100644 --- a/tinted-builder/src/scheme.rs +++ b/tinted-builder/src/scheme.rs @@ -5,17 +5,18 @@ use serde::{Deserialize, Deserializer}; use std::collections::HashMap; use crate::constants::{REQUIRED_BASE16_PALETTE_KEYS, REQUIRED_BASE24_PALETTE_KEYS}; -use crate::scheme::color::Color; + +pub use crate::scheme::color::Color; #[derive(Deserialize)] pub struct SchemeWrapper { - pub system: String, - pub name: String, - pub slug: Option, - pub author: String, - pub description: Option, - pub variant: Option, - pub palette: HashMap, + pub(crate) system: String, + pub(crate) name: String, + pub(crate) slug: Option, + pub(crate) author: String, + pub(crate) description: Option, + pub(crate) variant: Option, + pub(crate) palette: HashMap, } #[derive(Debug)] @@ -29,7 +30,7 @@ pub struct Scheme { pub palette: HashMap, } -pub fn slugify(input: &str) -> String { +pub(crate) fn slugify(input: &str) -> String { let char_map: HashMap = [ ('á', "a"), ('à', "a"), diff --git a/tinted-builder/src/template.rs b/tinted-builder/src/template.rs index 57b50e3..74aae44 100644 --- a/tinted-builder/src/template.rs +++ b/tinted-builder/src/template.rs @@ -10,8 +10,7 @@ pub struct Template { content: String, } -#[allow(dead_code)] -pub fn write_to_file(path: &Path, contents: &str) -> Result<()> { +pub(crate) fn write_to_file(path: &Path, contents: &str) -> Result<()> { if path.exists() { remove_file(path).with_context(|| format!("Unable to remove file: {}", path.display()))?; }