Skip to content

Commit

Permalink
Replace ansi_term, update openapiv3, openapitor (#668)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamchalmers authored Jun 3, 2024
1 parent 388ce56 commit 827768c
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 33 deletions.
26 changes: 13 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ build = "build.rs"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
ansi_term = "0.12.1"
anyhow = { version = "1", features = ["backtrace"] }
async-trait = "0.1.80"
base64 = "0.22.1"
Expand All @@ -27,6 +26,7 @@ kcl-lib = "0.1.57"
#kcl-lib = {git = "https://github.com/kittycad/modeling-app", branch = "main"}
kittycad = { version = "0.3.3", features = ["clap", "tabled", "requests", "retry"] }
log = "0.4.21"
nu-ansi-term = "0.50.0"
num-traits = "0.2.19"
oauth2 = "4.4.2"
open = "5.1.3"
Expand Down
2 changes: 1 addition & 1 deletion cli-macro-impl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ edition = "2018"
anyhow = "1"
Inflector = "^0.11.4"
openapitor = { git = "https://github.com/KittyCAD/kittycad.rs", branch = "main" }
openapiv3 = "1"
openapiv3 = "2"
proc-macro2 = "1"
quote = "1"
regex = "1.10"
Expand Down
8 changes: 4 additions & 4 deletions cli-macro-impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,7 @@ impl Operation {
writeln!(
ctx.io.out,
"{} Edited {}",
cs.success_icon_with_color(ansi_term::Color::Red),
cs.success_icon_with_color(nu_ansi_term::Color::Red),
#singular_tag_str,
)?;
};
Expand Down Expand Up @@ -1155,7 +1155,7 @@ impl Operation {
writeln!(
ctx.io.out,
"{} Deleted {} {} from {}",
cs.success_icon_with_color(ansi_term::Color::Red),
cs.success_icon_with_color(nu_ansi_term::Color::Red),
#singular_tag_str,
self.#singular_tag_lc,
full_name
Expand All @@ -1167,7 +1167,7 @@ impl Operation {
writeln!(
ctx.io.out,
"{} Deleted {} {}",
cs.success_icon_with_color(ansi_term::Color::Red),
cs.success_icon_with_color(nu_ansi_term::Color::Red),
#singular_tag_str,
full_name
)?;
Expand All @@ -1178,7 +1178,7 @@ impl Operation {
writeln!(
ctx.io.out,
"{} Deleted {} {}",
cs.success_icon_with_color(ansi_term::Color::Red),
cs.success_icon_with_color(nu_ansi_term::Color::Red),
#singular_tag_str,
self.#singular_tag_lc
)?;
Expand Down
4 changes: 2 additions & 2 deletions cli-macro-impl/tests/gen/users.rs.gen
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ impl crate::cmd::Command for CmdUserEdit {
writeln!(
ctx.io.out,
"{} Edited {}",
cs.success_icon_with_color(ansi_term::Color::Red),
cs.success_icon_with_color(nu_ansi_term::Color::Red),
"user",
)?;
Ok(())
Expand Down Expand Up @@ -144,7 +144,7 @@ impl crate::cmd::Command for CmdUserDelete {
writeln!(
ctx.io.out,
"{} Deleted {} {}",
cs.success_icon_with_color(ansi_term::Color::Red),
cs.success_icon_with_color(nu_ansi_term::Color::Red),
"user",
self.user
)?;
Expand Down
2 changes: 1 addition & 1 deletion src/cmd_alias.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ impl crate::cmd::Command for CmdAliasDelete {
writeln!(
ctx.io.out,
"{} Deleted alias {}; was {}",
cs.success_icon_with_color(ansi_term::Color::Red),
cs.success_icon_with_color(nu_ansi_term::Color::Red),
self.alias,
expansion
)?;
Expand Down
20 changes: 10 additions & 10 deletions src/colors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,31 +46,31 @@ impl ColorScheme {
return t.to_string();
}

ansi_term::Style::new().bold().paint(t).to_string()
nu_ansi_term::Style::new().bold().paint(t).to_string()
}

pub fn red(&self, t: &str) -> String {
if !self.enabled {
return t.to_string();
}

ansi_term::Colour::Red.paint(t).to_string()
nu_ansi_term::Color::Red.paint(t).to_string()
}

pub fn yellow(&self, t: &str) -> String {
if !self.enabled {
return t.to_string();
}

ansi_term::Colour::Yellow.paint(t).to_string()
nu_ansi_term::Color::Yellow.paint(t).to_string()
}

pub fn green(&self, t: &str) -> String {
if !self.enabled {
return t.to_string();
}

ansi_term::Colour::Green.paint(t).to_string()
nu_ansi_term::Color::Green.paint(t).to_string()
}

#[allow(dead_code)]
Expand All @@ -80,7 +80,7 @@ impl ColorScheme {
}

if self.is_256_enabled {
ansi_term::Colour::Fixed(242).paint(t).to_string()
nu_ansi_term::Color::Fixed(242).paint(t).to_string()
} else {
t.to_string()
}
Expand All @@ -91,7 +91,7 @@ impl ColorScheme {
return t.to_string();
}

ansi_term::Colour::Purple.paint(t).to_string()
nu_ansi_term::Color::Purple.paint(t).to_string()
}

#[allow(dead_code)]
Expand All @@ -100,22 +100,22 @@ impl ColorScheme {
return t.to_string();
}

ansi_term::Colour::Blue.paint(t).to_string()
nu_ansi_term::Color::Blue.paint(t).to_string()
}

pub fn cyan(&self, t: &str) -> String {
if !self.enabled {
return t.to_string();
}

ansi_term::Colour::Cyan.paint(t).to_string()
nu_ansi_term::Color::Cyan.paint(t).to_string()
}

pub fn success_icon(&self) -> String {
self.green("✔")
}

pub fn success_icon_with_color(&self, color: ansi_term::Colour) -> String {
pub fn success_icon_with_color(&self, color: nu_ansi_term::Color) -> String {
if self.enabled {
return color.paint("✔").to_string();
}
Expand All @@ -133,7 +133,7 @@ impl ColorScheme {
}

#[allow(dead_code)]
pub fn failure_icon_with_color(&self, color: ansi_term::Colour) -> String {
pub fn failure_icon_with_color(&self, color: nu_ansi_term::Color) -> String {
if self.enabled {
return color.paint("✘").to_string();
}
Expand Down
2 changes: 1 addition & 1 deletion src/iostreams.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ impl IoStreams {
// Note for Windows 10 users: On Windows 10, the application must enable ANSI support
// first.
#[cfg(windows)]
let enabled = ansi_term::enable_ansi_support();
let enabled = nu_ansi_term::enable_ansi_support();
#[cfg(windows)]
if enabled.is_ok() {
assume_true_color = true;
Expand Down

0 comments on commit 827768c

Please sign in to comment.