Release/v0.6.0 #20
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
umpire274/librius!20
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "release/v0.6.0"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
🧱 Full internal refactor — v0.6.0
Summary
Complete restructuring of the source tree into single-responsibility modules.
No user-facing behaviour changes — all commands, flags and output are identical to v0.5.1.
Motivation
The codebase had grown organically with several design issues:
utils/mod.rswas a 155-line monolith mixing verbose flags, print helpers, log and import utilitiesmodels/book.rsmixed pure data withtabled/i18npresentation logiccommands/add.rswas an 18-line dead wrapper overhandle_add_book()create_schema()was duplicated in three separate fileslib.rsused blanketpub use module::*glob re-exports, making the public API opaquerun_migrations()was called twice at startupCommandsenum incli/mod.rscovered only 3 of 8 commands and was never used by dispatchChanges by phase
Phase 1 —
utils/monolith → focused submodulesutils/verbose.rsVERBOSEstatic,set_verbose(),is_verbose()utils/print.rsiconsmodule +print_ok/err/warn/info()utils/log.rsnow_str(),write_log()utils/import_helpers.rsopen_import_file(),handle_import_result()utils/mod.rspub useonlyPhase 2 — CLI concerns separated
cli/fields.rs—EDITABLE_FIELDSmoved fromutils/(it is a CLI concern, not a generic utility)cli/mod.rs— deadCommandsenum removedcommands/config.rs—handle_config(&Commands)→handle_config(init, print, edit, editor)(explicit params, no enum dependency)Phase 3 — Data model separated from presentation
models/book.rs— pureBookstruct +from_row()+ Serde; notabled/i18ndependencymodels/display.rs(new) —BookFull,BookShortwithTabledimplementations and localised column headersPhase 4 —
db/module consolidationdb/load_db.rsdb/connection.rsdb/migrate_db.rsdb/migrations.rsdb/search.rsdb/books.rssearch_books()belongs with book operationsPhase 5 —
commands/dead code removalcommands/add.rsdeleted — dispatch already callshandle_add_book()directly (dead wrapper)commands/list.rs—row_to_book()simplified to delegate toBook::from_row()+ ISBN hyphen formatting onlycommands/db.rs— localcreate_schema()removed; replaced bydb::connection::ensure_schema()(single source of truth)Phase 6 —
lib.rsexplicit public APIRemoved all glob
pub use module::*re-exports. Replaced with a minimal, explicit surface:All internal modules updated to use full
crate::x::yimport paths.main.rs: removed duplicaterun_migrations()call (already run insidestart_db()).Documentation
STRUCTURE.mdadded — full map of every source file with single-responsibility description, design rules table and explicit public API surfaceCHANGELOG.md—[0.6.0]entry addedREADME.md— "New in v0.6.0" section, updated project structure tree, corrected development notes and public API examplesCargo.toml— version bumped0.5.1→0.6.0Testing
All existing integration tests pass unchanged.
Commits
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
81b573a77eℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
added_atvalues in list rowsrow_to_booknow callsBook::from_row, which loadsadded_atasOption<DateTime<Utc>>. In rusqlite, that conversion expects RFC3339 or unix timestamps, but this codebase writesadded_atvia SQLiteCURRENT_TIMESTAMP(YYYY-MM-DD HH:MM:SS), so listing can now fail with a row conversion error instead of rendering results. The previous mapper explicitly parsed SQLite timestamp formats and degraded toNone, so this introduces a regression for databases containing default timestamp strings.Useful? React with 👍 / 👎.