Polish pkg/ public API with catalog.Paths and a dependency guard - #37
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the Phase 2 public-API polish for the
pkg/library: narrowed storage signatures viacatalog.Paths, a package doc pass with export pruning, and a dependency guard that locks the TUI/CLI decoupling in. Completes thepkg/extraction workstream; the API stays provisional until the tool cuts v2.0.0.What's new
catalog.Paths-LoadShelves,OpenIndex,IndexPath, and theIndexmethodsSync/Rebuild/StaleFilesnow takePaths{ShelfRoot, CatalogFormat, ConfigFile}instead of the full*book.Config, keeping CLI-behavior fields out of the storage contract.catalog.PathsFromConfigbridges at thecmdboundary.catalog.ShelfPath- shelf path computation moves offShelf(AddFileDetaildeleted) into a free function, sopkg/bookcarries no path policy.pkg/book,pkg/catalog, andpkg/web;IntPtrremoved in favor of Go 1.26new(expr);DedupUniqueunexported (onlyMergeTagsused it); newpkg/book/example_test.goruns an open/add/save round trip as an external consumer.make check-depsassertsgo list -deps ./pkg/...stays free ofbubbletea/huh/lipgloss,urfave/*, andinternal/*; wired intomake checkand CI.pkg/layout and import rules.Behavior changes / guardrails
Paths.ConfigFiledisables the defensive config-file exclusion from shelf globs; previously a zero-value exclusion could never fire.pkg/catalogpulls inmodernc.org/sqlitetransitively (pure Go, no cgo); depending onpkg/bookalone avoids the driver.pkg/web- Windows open now usesrundll32 url.dll,FileProtocolHandler, removing thecmd /c start&/%injection vector.Testing
Paths; no assertion changes.go test, proving an external module can load, mutate, and save shelves.index rebuild/sync,mark search,doctor,catalog config.make checkruns fmt, vet, lint, and tests; all green.