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
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
# Repository: github.com/umpire274/librius-dev-scripts.git
# Access: private (owner/collaborators only)
# ------------------------------------------------
[submodule "tools_private"]
path = tools_private
[submodule "dev_tools"]
path = dev_tools
url = git@github.com:umpire274/rust_dev_scripts.git

# ================================================================
Expand Down
63 changes: 63 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,69 @@

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

## [0.6.0] - 2026-04-27

### 🧱 Refactor β€” Complete modular restructuring

This release introduces a full internal refactor of the codebase. No user-facing
behaviour is changed; all commands, flags and output remain identical.

#### `utils/` β€” monolith broken into focused submodules

- **`utils/verbose.rs`** β€” `VERBOSE` static, `set_verbose()`, `is_verbose()`
- **`utils/print.rs`** β€” `icons` module (`OK`/`ERR`/`WARN`/`INFO`) + `print_ok/err/warn/info()`
- **`utils/log.rs`** β€” `now_str()`, `write_log()` (structured SQLite log entries)
- **`utils/import_helpers.rs`** β€” `open_import_file()`, `handle_import_result()`
- **`utils/mod.rs`** β€” aggregator with explicit `pub use` only (no more glob re-exports)

#### `cli/` β€” CLI concerns separated from utilities

- **`cli/fields.rs`** β€” `EDITABLE_FIELDS` moved from `utils/` (it is a CLI concern, not a generic utility)
- **`cli/mod.rs`** β€” removed dead `Commands` enum (only 3 of 8 commands were represented, never used by dispatch)

#### `models/` β€” data model separated from presentation

- **`models/book.rs`** β€” pure data model: `Book` struct + `from_row()` + Serde only; no `tabled`/`i18n` dependencies
- **`models/display.rs`** *(new)* β€” `BookFull`, `BookShort` with `Tabled` implementations and localised column headers

#### `db/` β€” module consolidation and cleaner naming

- **`db/load_db.rs` β†’ `db/connection.rs`** β€” clearer name for DB connection management
- **`db/migrate_db.rs` β†’ `db/migrations.rs`** β€” clearer name for migration logic
- **`db/search.rs`** β€” absorbed into `db/books.rs`; `search_books()` belongs with book operations

#### `commands/` β€” removal of dead code and duplications

- **`commands/add.rs`** removed β€” 18-line wrapper that only called `handle_add_book()` directly (dead code)
- **`commands/list.rs`** β€” `row_to_book()` simplified to delegate to `Book::from_row()` + ISBN formatting only
- **`commands/db.rs`** β€” local `create_schema()` duplicate removed; delegates to `db::connection::ensure_schema()`
- **`commands/config.rs`** β€” `handle_config()` signature changed from `&Commands` enum to explicit bool parameters
`(init, print, edit, editor)`

#### `lib.rs` β€” explicit public API

- Removed all wildcard re-exports (`pub use commands::*`, `pub use utils::*`, etc.)
- Replaced with an explicit, minimal public API:
```rust
pub use config::{AppConfig, load_or_init};
pub use db::{init_db, start_db};
pub use models::Book;
pub use i18n::{load_language, tr, tr_s, tr_with};
```
- All internal modules now use full `crate::x::y` import paths

#### `main.rs` β€” removed duplicate migration call

- `run_migrations()` was called twice (once in `start_db()`, once explicitly in `main`).
Removed the redundant call in `main.rs`.

### πŸ“„ Documentation

- Added **`STRUCTURE.md`** β€” complete map of every source file with its single responsibility,
design rules table, and the explicit public API surface.

---

## [0.5.1] - 2025-11-12

### Added
Expand Down
Loading
Loading