Skip to content

feat(cli): hint users for newer version#166

Merged
goulvenclech merged 1 commit intomainfrom
hint-outdated
Dec 9, 2025
Merged

feat(cli): hint users for newer version#166
goulvenclech merged 1 commit intomainfrom
hint-outdated

Conversation

@goulvenclech
Copy link
Member

Sampo now checks for updates once per day, and displays a hint when a newer version is available on crates.io. The check is non-blocking and fails silently if offline.

What does this change?

  • crates/sampo/src/version_check.rs (new): Queries crates.io for the latest version, caches results for 24h using platform-appropriate directories via dirs, and compares versions using semver.

  • crates/sampo/src/ui.rs: Adds log_hint() function for displaying non-critical suggestions with a 💡 prefix in yellow.

  • crates/sampo/src/main.rs: Calls version check at startup and prints a hint if an update is available.

  • crates/sampo/Cargo.toml: Adds dirs dependency for cross-platform cache directory resolution.

How is it tested?

  • crates/sampo/src/version_check.rs: Unit tests cover cache entry serialization/parsing, semver comparison logic, and edge cases (invalid versions, pre-releases).

How is it documented?

N/A.

@goulvenclech goulvenclech self-assigned this Dec 9, 2025
@sampo-s-bot
Copy link

sampo-s-bot bot commented Dec 9, 2025

🧭 Changeset detected

Merging this PR will release the following updates:

sampo (Cargo) — minor version bump

Minor changes

  • Sampo now checks for updates once per day, and displays a hint when a newer version is available on crates.io. The check is non-blocking and fails silently if offline.

@github-actions github-actions bot added dependencies WIP. crt:sampo Changes in Sampo CLI crate. labels Dec 9, 2025
@goulvenclech goulvenclech merged commit 03098f1 into main Dec 9, 2025
7 checks passed
@goulvenclech goulvenclech deleted the hint-outdated branch December 9, 2025 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

crt:sampo Changes in Sampo CLI crate. dependencies WIP.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants