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
58 changes: 47 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,68 @@

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

## [0.5.1] - 2025-11-12

### Added

- **New `db` command** for database management:
- `librius db --init` β†’ initializes a new database (or resets the existing one).
- `librius db --reset` β†’ alias of `--init`, provided for clarity.
- `librius db --copy -f <FILE>` β†’ copies the current database (as defined in `config.database`) to a new file.
- Automatic use of the database path from the configuration file (`database:` key in `librius.yaml`).
- Added localized messages and colored output for database operations.
- New `--compact` flag for `list --id <ID> --details`:
- Hides empty or null fields in the vertical table view.
- Useful for cleaner, shorter output when many fields are unused.

### Changed

- The `--compact` flag in `list` is now dependent on `--details`.
- Using `--compact` without `--details` will result in an error message.
- This ensures consistent CLI behavior and prevents meaningless flag combinations.

### Fixed

- CLI parsing for `--copy` now correctly behaves as a flag (no value required).
- Improved integration between configuration and database initialization routines.
- Corrected vertical table rendering (`list --id <ID> --details`):
- Proper localized headers (β€œField” / β€œValue”) are now displayed.
- Columns now follow the database schema order instead of alphabetical order.
- Improved compatibility with existing `tabled` crate version.

### Notes

This version introduces a simple and safe way to initialize, reset, or back up your Librius database directly from the
command line.

---

## [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`
- 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.
- 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.
- 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.

---
Expand Down
Loading