Skip to content

Commit 688217e

Browse files
committed
Add Color struct export to lib
Version bump lib to 0.4.0
1 parent 7ae2c77 commit 688217e

File tree

13 files changed

+36
-23
lines changed

13 files changed

+36
-23
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
### Changed
6+
7+
- Use latest `tinted-builder` crate
8+
39
## [0.6.0] - 2024-06-11
410

511
### Changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tinted-builder-rust/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ strip-ansi-escapes = "0.2.0"
2424

2525
[dependencies.tinted-builder]
2626
path = "../tinted-builder"
27-
version = "0.3.0"
27+
version = "0.4.0"
2828

2929
[[bin]]
3030
name = "tinted-builder-rust"

tinted-builder-rust/src/cli.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ fn build_cli() -> Command {
3838
)
3939
}
4040

41-
pub fn get_matches() -> ArgMatches {
41+
pub(crate) fn get_matches() -> ArgMatches {
4242
let styles = styling::Styles::styled()
4343
.header(styling::AnsiColor::Green.on_default() | styling::Effects::BOLD)
4444
.usage(styling::AnsiColor::Green.on_default() | styling::Effects::BOLD)

tinted-builder-rust/src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
mod cli;
22
mod operations {
3-
pub mod build;
4-
pub mod sync;
3+
pub(crate) mod build;
4+
pub(crate) mod sync;
55
}
66
mod utils;
77

@@ -12,7 +12,7 @@ use crate::cli::get_matches;
1212

1313
const REPO_NAME: &str = env!("CARGO_PKG_NAME");
1414

15-
pub fn replace_tilde_slash_with_home(path_str: &str) -> Result<PathBuf> {
15+
pub(crate) fn replace_tilde_slash_with_home(path_str: &str) -> Result<PathBuf> {
1616
let trimmed_path_str = path_str.trim();
1717
if trimmed_path_str.starts_with("~/") {
1818
match dirs::home_dir() {

tinted-builder-rust/src/operations/sync.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ fn git_diff(target_dir: &Path) -> Result<bool> {
6666
}
6767

6868
/// Sync schemes repo; Install if it does not exist, otherwise update
69-
pub fn sync(schemes_path: &Path) -> Result<()> {
69+
pub(crate) fn sync(schemes_path: &Path) -> Result<()> {
7070
if schemes_path.is_dir() {
7171
let is_diff = git_diff(schemes_path)?;
7272

tinted-builder-rust/src/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::io::Write;
44
use std::path::Path;
55

66
#[allow(dead_code)]
7-
pub fn write_to_file(path: &Path, contents: &str) -> Result<()> {
7+
pub(crate) fn write_to_file(path: &Path, contents: &str) -> Result<()> {
88
if path.exists() {
99
remove_file(path).with_context(|| format!("Unable to remove file: {}", path.display()))?;
1010
}

tinted-builder/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## 0.4.0 - 2024-06-15
4+
5+
## Added
6+
7+
- Add `Color` struct to public exports to allow users to construct a
8+
`Scheme` themselves.
9+
310
## 0.3.0 - 2024-06-11
411

512
## Changed

tinted-builder/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "tinted-builder"
33
description = "A Tinted Theming template builder which uses yaml color schemes to generate theme files."
4-
version = "0.3.0"
4+
version = "0.4.0"
55
edition = "2021"
66
license = "MIT OR Apache-2.0"
77
readme = "README.md"

tinted-builder/src/constants.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
pub const REQUIRED_BASE16_PALETTE_KEYS: [&str; 16] = [
1+
pub(crate) const REQUIRED_BASE16_PALETTE_KEYS: [&str; 16] = [
22
"base00", "base01", "base02", "base03", "base04", "base05", "base06", "base07", "base08",
33
"base09", "base0A", "base0B", "base0C", "base0D", "base0E", "base0F",
44
];
5-
pub const REQUIRED_BASE24_PALETTE_KEYS: [&str; 24] = [
5+
pub(crate) const REQUIRED_BASE24_PALETTE_KEYS: [&str; 24] = [
66
"base00", "base01", "base02", "base03", "base04", "base05", "base06", "base07", "base08",
77
"base09", "base0A", "base0B", "base0C", "base0D", "base0E", "base0F", "base10", "base11",
88
"base12", "base13", "base14", "base15", "base16", "base17",

tinted-builder/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ mod constants;
33
mod scheme;
44
mod template;
55

6-
pub use scheme::Scheme;
6+
pub use scheme::{Color, Scheme};
77
pub use template::Template;

tinted-builder/src/scheme.rs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,18 @@ use serde::{Deserialize, Deserializer};
55
use std::collections::HashMap;
66

77
use crate::constants::{REQUIRED_BASE16_PALETTE_KEYS, REQUIRED_BASE24_PALETTE_KEYS};
8-
use crate::scheme::color::Color;
8+
9+
pub use crate::scheme::color::Color;
910

1011
#[derive(Deserialize)]
1112
pub struct SchemeWrapper {
12-
pub system: String,
13-
pub name: String,
14-
pub slug: Option<String>,
15-
pub author: String,
16-
pub description: Option<String>,
17-
pub variant: Option<String>,
18-
pub palette: HashMap<String, String>,
13+
pub(crate) system: String,
14+
pub(crate) name: String,
15+
pub(crate) slug: Option<String>,
16+
pub(crate) author: String,
17+
pub(crate) description: Option<String>,
18+
pub(crate) variant: Option<String>,
19+
pub(crate) palette: HashMap<String, String>,
1920
}
2021

2122
#[derive(Debug)]
@@ -29,7 +30,7 @@ pub struct Scheme {
2930
pub palette: HashMap<String, Color>,
3031
}
3132

32-
pub fn slugify(input: &str) -> String {
33+
pub(crate) fn slugify(input: &str) -> String {
3334
let char_map: HashMap<char, &str> = [
3435
('á', "a"),
3536
('à', "a"),

tinted-builder/src/template.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ pub struct Template {
1010
content: String,
1111
}
1212

13-
#[allow(dead_code)]
14-
pub fn write_to_file(path: &Path, contents: &str) -> Result<()> {
13+
pub(crate) fn write_to_file(path: &Path, contents: &str) -> Result<()> {
1514
if path.exists() {
1615
remove_file(path).with_context(|| format!("Unable to remove file: {}", path.display()))?;
1716
}

0 commit comments

Comments
 (0)