Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 40 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,46 @@

All notable changes to this project will be documented in this file.

## [0.4.6] - 2025-11-12
## [0.5.0] - 2025-11-11

### πŸ§ͺ Added

- Introduced a **complete automated test suite** covering both database and CLI layers.
- Implemented `setup_temp_db()` utility for creating **temporary SQLite databases** in the system temp directory:
- Windows β†’ `%TEMP%\librius_test_*.db`
- macOS / Linux β†’ `/tmp/librius_test_*.db`
- Added **unit tests** for database insert and search operations.
- Added **integration tests** for:
- CLI commands (`--help`, `search`, etc.) using `assert_cmd` and `predicates`.
- Database schema and consistency validation.
- ISBN normalization and formatting.
- All tests now use the **real production schema** for reliable, cross-platform testing.

---

### πŸ”§ Changed

- Performed a **modular refactor of the CLI** (`cli.rs` β†’ `cli/` directory):
- Split the monolithic `cli.rs` into three logical units:
- `args.rs` β€” defines the full command tree and global flags.
- `dispatch.rs` β€” routes parsed commands to their handlers.
- `mod.rs` β€” re-exports and integrates the CLI components.
- Improved code readability, testability, and long-term maintainability.
- Prepared CLI for future integration with the `librius_core` crate and the GUI frontend.
- Simplified the internal command dispatch logic and aligned display order for consistent help output.

---

### 🧱 Internal

- Removed obsolete in-source test modules (`#[cfg(test)]`) from production files.
- Eliminated build and Clippy warnings by conditionally compiling test-only code.
- Verified complete cross-platform compatibility (Windows, macOS, Linux).
- Established the foundation for **multi-platform CI testing** planned for `v0.5.1`.

---

## [0.4.6] - 2025-11-11

### πŸ”§ Changed

Expand Down
96 changes: 95 additions & 1 deletion Cargo.lock

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

7 changes: 6 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "librius"
version = "0.4.6"
version = "0.5.0"
edition = "2024"
authors = ["Alessandro Maestri <umpire274@gmail.com>"]
description = "A personal library manager CLI written in Rust."
Expand Down Expand Up @@ -48,3 +48,8 @@ winresource = "0.1.27"

[profile.release]
opt-level = 3

[dev-dependencies]
assert_cmd = "2.1.1"
predicates = "3.1.3"
rusqlite = { version = "0.37.0", features = ["chrono"] }
53 changes: 39 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,45 @@ and import/export support.

---

### ✨ New in v0.4.6

**πŸ”§ CLI help reorganization and localization**

- Reorganized the **command index** in the main help output to provide a clearer, more intuitive structure.
- Commands are now grouped into:
- πŸ“š **Book commands** β€” `list`, `search`, `add`, `edit`, `del`
- βš™οΈ **App commands** β€” `config`, `backup`, `export`, `import`
- ❓ **Other commands** β€” `help`
- Added **full localization** to all help section titles (`help_heading`), ensuring the help text is completely
translated and consistent between English and Italian.
- Improved the **readability and logical flow** of command listings and global options.
- Updated `display_order` values to match the new command grouping.
- Refactored `cli.rs` to simplify future maintenance and localization.
### ✨ New in v0.5.0

**πŸ§ͺ Complete test suite**

- Introduced a robust **automated testing framework** for both CLI and database layers.
- Tests now use the **real production schema**, ensuring consistent validation of all database operations.
- Added a new helper `setup_temp_db()` that automatically creates temporary SQLite databases:
- Windows β†’ `%TEMP%\librius_test_*.db`
- macOS / Linux β†’ `/tmp/librius_test_*.db`
- Unified test structure under `/tests/` for clarity and scalability.

Example structure:

``` text
tests/
β”œβ”€β”€ common.rs # Shared helpers (DB setup, fixtures)
β”œβ”€β”€ db_tests.rs # Database-level tests
β”œβ”€β”€ cli_tests.rs # CLI behavior tests
β”œβ”€β”€ isbn_tests.rs # ISBN module tests
└── librius_core_tests.rs # Core command handler tests
```

**πŸ”§ Modular CLI refactor**

- Reorganized the CLI into a **modular structure** for better readability and future reuse:
- `cli/args.rs` β†’ Command definitions and global options.
- `cli/dispatch.rs` β†’ Command routing and subcommand handling.
- `cli/mod.rs` β†’ Unified CLI interface for main.rs.
- Simplified the main dispatcher logic and improved localization consistency.
- Prepared the CLI subsystem for integration with the upcoming `librius_core` library and GUI frontend.

---

**🧱 Internal improvements**

- Removed legacy `#[cfg(test)]` blocks from source code.
- Cleaned up all build and Clippy warnings.
- Verified stability across all major platforms (Windows, macOS, Linux).
- Established the technical foundation for continuous integration (coming in `v0.5.1`).

---

Expand Down
Loading