Skip to content

Commit c95836a

Browse files
committed
release: 2.1.0
2 parents eab58f8 + 65dfdab commit c95836a

24 files changed

+233
-274
lines changed

CREDITS.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
# Project Dependencies
22
Package: fyi
3-
Version: 2.0.2
3+
Version: 2.1.0
44
Target: x86_64-unknown-linux-gnu
5-
Generated: 2025-04-10 05:49:36 UTC
5+
Generated: 2025-05-16 02:14:07 UTC
66

77
| Package | Version | Author(s) | License |
88
| ---- | ---- | ---- | ---- |
99
| [**argyle**](https://github.com/Blobfolio/argyle) | 0.12.3 | [Josh Stoik](mailto:josh@blobfolio.com) | WTFPL |
10-
| [**dactyl**](https://github.com/Blobfolio/dactyl) | 0.10.1 | [Josh Stoik](mailto:josh@blobfolio.com) | WTFPL |
10+
| [**dactyl**](https://github.com/Blobfolio/dactyl) | 0.10.2 | [Josh Stoik](mailto:josh@blobfolio.com) | WTFPL |
1111
| [**fyi_ansi**](https://github.com/Blobfolio/fyi) | 2.0.2 | [Josh Stoik](mailto:josh@blobfolio.com) | WTFPL |
12-
| [**fyi_msg**](https://github.com/Blobfolio/fyi) | 2.0.2 | [Josh Stoik](mailto:josh@blobfolio.com) | WTFPL |
12+
| [**fyi_ansi**](https://github.com/Blobfolio/fyi) | 2.1.0 | [Josh Stoik](mailto:josh@blobfolio.com) | WTFPL |
13+
| [**fyi_msg**](https://github.com/Blobfolio/fyi) | 2.1.0 | [Josh Stoik](mailto:josh@blobfolio.com) | WTFPL |
1314
| [tz-rs](https://github.com/x-hgg-x/tz-rs) | 0.7.0 | x-hgg-x | MIT OR Apache-2.0 |
1415
| [**utc2k**](https://github.com/Blobfolio/utc2k) | 0.12.1 | [Josh Stoik](mailto:josh@blobfolio.com) | WTFPL |
1516

fyi/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "fyi"
3-
version = "2.0.2"
3+
version = "2.1.0"
44
license = "WTFPL"
55
authors = ["Josh Stoik <josh@blobfolio.com>"]
66
edition = "2024"

fyi_ansi/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[package]
22
name = "fyi_ansi"
3-
version = "2.0.2"
3+
version = "2.1.0"
44
authors = ["Josh Stoik <josh@blobfolio.com>"]
55
edition = "2024"
6-
rust-version = "1.85"
6+
rust-version = "1.87"
77
description = "Compile-time ANSI formatting macros for FYI."
88
license = "WTFPL"
99
repository = "https://github.com/Blobfolio/fyi"

fyi_ansi/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -428,9 +428,9 @@ mod macros {
428428
///
429429
/// // Strike, then full reset.
430430
/// assert_eq!(
431-
/// strike!("TODO: Eat."),
432-
/// "\x1b[9mTODO: Eat.\x1b[0m",
433-
/// // ^ reset *all* styles to default
431+
/// strike!("Buy cereal."),
432+
/// "\x1b[9mBuy cereal.\x1b[0m",
433+
/// // ^ reset *all* styles to default
434434
/// );
435435
///
436436
/// // The same results can be obtained via `ansi`.

fyi_msg/Cargo.toml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[package]
22
name = "fyi_msg"
3-
version = "2.0.2"
3+
version = "2.1.0"
44
authors = ["Josh Stoik <josh@blobfolio.com>"]
55
edition = "2024"
6-
rust-version = "1.85"
6+
rust-version = "1.87"
77
description = "Simple ANSI-formatted, prefixed messages for console printing."
88
license = "WTFPL"
99
repository = "https://github.com/Blobfolio/fyi"
@@ -17,9 +17,6 @@ features = [ "fitted", "progress", "signals", "timestamps" ]
1717
default-target = "x86_64-unknown-linux-gnu"
1818
targets = [ "x86_64-unknown-linux-gnu", "x86_64-apple-darwin" ]
1919

20-
[build-dependencies.fyi_ansi]
21-
version = "2.0.*"
22-
2320
[dependencies.dactyl]
2421
version = "0.10.*"
2522
optional = true
@@ -46,7 +43,7 @@ features = [ "local" ]
4643
optional = true
4744

4845
[dev-dependencies]
49-
brunch = "0.9.*"
46+
brunch = "0.10.*"
5047
rayon = "1.10.*"
5148

5249
[[bench]]

fyi_msg/build.rs

Lines changed: 0 additions & 187 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
# FYI: Build
33
*/
44

5-
#![allow(unused_mut, reason = "It is conditionally used.")]
6-
7-
use fyi_ansi::ansi;
85
use std::{
96
fmt,
107
fs::File,
@@ -14,35 +11,6 @@ use std::{
1411

1512

1613

17-
#[cfg(feature = "bin_kinds")]
18-
/// # Total Kinds.
19-
const NUM_KINDS: usize = 17;
20-
21-
#[cfg(not(feature = "bin_kinds"))]
22-
/// # Total Kinds.
23-
const NUM_KINDS: usize = 15;
24-
25-
/// # Message Kinds.
26-
static KINDS: [(&str, &str); NUM_KINDS] = [
27-
("None", ""),
28-
("Aborted", concat!(ansi!((bold, light_red) "Aborted:"), " ")),
29-
("Confirm", concat!(ansi!((bold, dark_orange) "Confirm:"), " ")),
30-
("Crunched", concat!(ansi!((bold, light_green) "Crunched:"), " ")),
31-
("Debug", concat!(ansi!((bold, light_cyan) "Debug:"), " ")),
32-
("Done", concat!(ansi!((bold, light_green) "Done:"), " ")),
33-
("Error", concat!(ansi!((bold, light_red) "Error:"), " ")),
34-
("Found", concat!(ansi!((bold, light_green) "Found:"), " ")),
35-
("Info", concat!(ansi!((bold, light_magenta) "Info:"), " ")),
36-
("Notice", concat!(ansi!((bold, light_magenta) "Notice:"), " ")),
37-
("Review", concat!(ansi!((bold, light_cyan) "Review:"), " ")),
38-
("Skipped", concat!(ansi!((bold, light_yellow) "Skipped:"), " ")),
39-
("Success", concat!(ansi!((bold, light_green) "Success:"), " ")),
40-
("Task", concat!(ansi!((bold, 199) "Task:"), " ")),
41-
("Warning", concat!(ansi!((bold, light_yellow) "Warning:"), " ")),
42-
#[cfg(feature = "bin_kinds")] ("Blank", ""),
43-
#[cfg(feature = "bin_kinds")] ("Custom", ""),
44-
];
45-
4614
// COLORS: [(name, hex)].
4715
include!("skel/ansi256.rs");
4816

@@ -52,7 +20,6 @@ include!("skel/ansi256.rs");
5220
fn main() {
5321
println!("cargo:rerun-if-env-changed=CARGO_PKG_VERSION");
5422
build_ansi_color();
55-
build_msg_kinds();
5623
}
5724

5825
/// # Build ANSI Color Enum.
@@ -190,160 +157,6 @@ impl AnsiColor {\n");
190157
.expect("Unable to save ansi-color.rs");
191158
}
192159

193-
/// # Build/Save `MsgKind`.
194-
///
195-
/// The `MsgKind` enum doesn't feel all that complicated, but there are a lot
196-
/// of little ways inconsistencies can creep in. Building the trickier pieces
197-
/// programmatically helps ensure nothing is missed.
198-
///
199-
/// This generates code for the definition, an `ALL` constant,
200-
/// `MsgKind::as_str_prefix`, and the `Msg::kind` helpers.
201-
fn build_msg_kinds() {
202-
use std::fmt::Write;
203-
204-
/// # Hidden Kinds.
205-
const HIDDEN: [&str; 2] = ["Blank", "Custom"];
206-
207-
let mut out = String::with_capacity(8192);
208-
out.push_str(r#"#[expect(missing_docs, reason = "Redudant.")]
209-
#[derive(Debug, Copy, Clone, Eq, Hash, PartialEq)]
210-
/// # Message Kind.
211-
///
212-
/// This enum contains built-in prefixes for [`Msg`](crate::Msg). These are
213-
/// generally only used to initiate a new message with this prefix, like:
214-
///
215-
/// ## Examples
216-
///
217-
/// ```
218-
/// use fyi_msg::{Msg, MsgKind};
219-
///
220-
/// // Error: Oh no!
221-
/// assert_eq!(
222-
/// Msg::new(MsgKind::Error, "Oh no!"),
223-
/// MsgKind::Error.into_msg("Oh no!"),
224-
/// );
225-
/// ```
226-
///
227-
/// Most kinds have their own dedicated [`Msg`] helper method which, unlike the
228-
/// previous examples, comes with a line break at the end.
229-
///
230-
/// ```
231-
/// use fyi_msg::{Msg, MsgKind};
232-
///
233-
/// // Error: Oh no!\n
234-
/// assert_eq!(
235-
/// Msg::error("Oh no!"),
236-
/// Msg::new(MsgKind::Error, "Oh no!").with_newline(true),
237-
/// );
238-
/// ```
239-
pub enum MsgKind {"#);
240-
for (kind, _) in KINDS {
241-
if kind != "None" { out.push('\n'); }
242-
if HIDDEN.contains(&kind) { out.push_str("\t#[doc(hidden)]\n"); }
243-
writeln!(&mut out, "\t{kind},").unwrap();
244-
}
245-
out.push_str("}\n");
246-
247-
// Add a constant containing all kinds to make iteration easier.
248-
writeln!(
249-
&mut out,
250-
"impl MsgKind {{
251-
/// # All Variants.
252-
///
253-
/// This array can be used to cheaply iterate through all message kinds.
254-
pub const ALL: [Self; {NUM_KINDS}] = ["
255-
).unwrap();
256-
for chunk in KINDS.chunks(8) {
257-
out.push_str("\t\t");
258-
for (kind, _) in chunk { write!(&mut out, "Self::{kind}, ").unwrap(); }
259-
out.push('\n');
260-
}
261-
out.push_str("\t];\n");
262-
263-
// And a crate-wide method to expose the preformatted prefix string.
264-
#[cfg(feature = "bin_kinds")] let wild = "_";
265-
#[cfg(not(feature = "bin_kinds"))] let wild = "Self::None";
266-
267-
out.push_str("\t#[inline]
268-
#[must_use]
269-
/// # As String Slice (Prefix).
270-
///
271-
/// Return the kind as a string slice, formatted and with a trailing `\": \"`,
272-
/// same as [`Msg`] uses for prefixes.
273-
pub(crate) const fn as_str_prefix(self) -> &'static str {
274-
match self {\n");
275-
for (kind, prefix) in KINDS {
276-
// Skip empties.
277-
if prefix.is_empty() {continue; }
278-
279-
// While we're here, check the predictable parts were typed correctly.
280-
assert!(
281-
prefix.starts_with("\x1b[1;") &&
282-
prefix.ends_with(&format!("m{kind}:\x1b[0m ")),
283-
"BUG: {kind}::as_str_prefix is wrong!",
284-
);
285-
286-
writeln!(&mut out, "\t\t\tSelf::{kind} => {prefix:?},").unwrap();
287-
}
288-
writeln!(
289-
&mut out,
290-
"\t\t\t{wild} => \"\",
291-
}}
292-
}}
293-
}}").unwrap();
294-
295-
// Generate helper methods for (most) of the kinds. (Might as well do this
296-
// here.)
297-
out.push_str("/// ## [`MsgKind`] One-Shots.
298-
impl Msg {\n");
299-
for (kind, prefix) in KINDS {
300-
// Skip the empties and "Confirm" (since it has a macro).
301-
if prefix.is_empty() || kind == "Confirm" { continue; }
302-
303-
let prefix_len = prefix.len();
304-
writeln!(
305-
&mut out,
306-
"\t#[must_use]
307-
/// # New {kind}.
308-
///
309-
/// Create a new [`Msg`] with a built-in [`MsgKind::{kind}`] prefix _and_ trailing line break.
310-
///
311-
/// ## Examples.
312-
///
313-
/// ```
314-
/// use fyi_msg::{{Msg, MsgKind}};
315-
///
316-
/// assert_eq!(
317-
/// Msg::{kind_low}(\"Hello World\"),
318-
/// Msg::new(MsgKind::{kind}, \"Hello World\").with_newline(true),
319-
/// );
320-
/// ```
321-
pub fn {kind_low}<S: AsRef<str>>(msg: S) -> Self {{
322-
// Glue it all together.
323-
let msg = msg.as_ref();
324-
let m_end = {prefix_len} + msg.len();
325-
let mut inner = String::with_capacity(m_end + 1);
326-
inner.push_str({prefix:?});
327-
inner.push_str(msg);
328-
inner.push('\\n');
329-
330-
// Done!
331-
Self {{
332-
inner,
333-
toc: super::toc!({prefix_len}, m_end, true),
334-
}}
335-
}}",
336-
kind=kind,
337-
kind_low=kind.to_ascii_lowercase(),
338-
).unwrap();
339-
}
340-
out.push_str("}\n");
341-
342-
File::create(out_path("msg-kinds.rs"))
343-
.and_then(|mut f| f.write_all(out.as_bytes()).and_then(|()| f.flush()))
344-
.expect("Unable to save msg-kinds.rs");
345-
}
346-
347160
/// # Output Path.
348161
///
349162
/// Append the sub-path to OUT_DIR and return it.

0 commit comments

Comments
 (0)