feat: Unify books_dir into library tree (#46) #55
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "development_unify_libraries_dir"
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?
Summary
Replace the separate
--books-dir(flat directory of{ns}_{book}.tomlfiles) with a unified library tree at~/hero/var/books/. Book TOMLs, exports, and AI metadata now all live together in{library}/books/{book}/.Changes
Core
library.rs: Addedlibrary_book_toml_path()helperscanner.rs: AddedBooksScanner::scan_libraries()for nested{lib}/books/{book}/book.tomllayoutserver.rs: RenamedServerConfig.books_dir→libraries_dir, removedexport_dirfield. All export/import/discover functions now place TOMLs into the library treemain.rs: New--libraries-dirflag (envHERO_BOOKS_LIBRARIES_DIR, default~/hero/var/books/). Deprecated--books-dirwith auto-seed into library tree for backward compatibilityaxum_server.rs,web/rpc.rs,webservice/server/rpc.rs,zinit_integration.rs: Updated all references frombooks_dirtolibraries_dirScripts & CI
scripts/seed-books.sh— seeds flat{ns}_{book}.tomlfiles into the library treeMakefile— newseed-local/seed-gittargets, updateddemo/serve/run/devscripts/run_server.sh— simplified (no more books_dir arg)scripts/test-all.sh— uses seed + default libraries_dir.forgejo/workflows/test.yaml— seed step before server startDocumentation
docs/manual/server.md— new CLI flags table, updated examplesdocs/manual/book_configuration.md— unified tree layout, seeding instructionsdocs/manual/concepts.md— expanded library tree diagramdocs/manual/README.md— updated quick startdocs/manual/ai_processing.md—--ai-concurrencyflagBackward Compatibility
--books-diris kept as a hidden deprecated alias. When used:.tomlfiles into~/hero/var/books/library treelibraries.txtif presentTesting
cargo check— compilescargo test— 136 tests passcargo clippy -- -D warnings— no warningsCloses #46
Replace the separate --books-dir (flat directory of {ns}_{book}.toml files) with a unified library tree at ~/hero/var/books/. Book TOMLs, exports, and AI metadata now all live together in {library}/books/{book}/. Changes: - Add library_book_toml_path() helper to library.rs - Add BooksScanner::scan_libraries() for nested layout scanning - Rename ServerConfig.books_dir → libraries_dir, remove export_dir - New CLI: --libraries-dir (env HERO_BOOKS_LIBRARIES_DIR), default ~/hero/var/books/ - Deprecated --books-dir with auto-seed into library tree (backward compat) - All export/import/discover functions place TOMLs into library tree - New scripts/seed-books.sh for seeding example books - Updated Makefile with seed-local/seed-git targets - Updated CI workflow, test-all.sh, run_server.sh - Updated docs/manual/ (server.md, book_configuration.md, concepts.md, README.md, ai_processing.md) Closes #46- try_parse_book() now uses parent directory name instead of 'book' file stem when parsing book.toml files in the library tree layout - find_exported_book() handles backward-compat {namespace}_{book} URL format (e.g., /book/coding_python finds coding/books/python/) - Smoke test URLs updated to use new short book names - Added unit test for parent dir name fallbackBook names are now just the book directory name (e.g., 'python') instead of the old namespace-prefixed format ('coding_python'). Updated all 35 references across 6 E2E test files.Closing: all changes from this PR are already present in
developmentbranch (verified viagit merge-base --is-ancestor). Work consolidated into a new PR covering build system alignment and remaining features.mik-tf referenced this pull request2026-02-19 01:20:46 +00:00
mik-tf referenced this pull request2026-02-19 01:20:58 +00:00
Pull request closed