Skip to content

docs: librebar adoption plan - #47

Merged
claylo merged 6 commits into
mainfrom
chore/librebar-migration
Aug 12, 2026
Merged

claylo merged 6 commits into
mainfrom
chore/librebar-migration

Conversation

@claylo

@claylo claylo commented Aug 12, 2026

Copy link
Copy Markdown
Owner

No description provided.

claylo added 6 commits August 11, 2026 20:03
Swap colophon-core's hand-rolled figment ConfigLoader for a thin wrapper
over librebar::config::ConfigLoader. Discovery semantics are unchanged:
walk-up project search, .config/ then dotfile then bare name, XDG user
config, TOML/YAML/JSON, deep merge.

- add librebar 0.6 with the `config` feature only (no process-global state)
- drop figment and directories as direct dependencies
- ConfigSources is now re-exported from librebar, which adds value-origin
  and environment metadata for doctor/info to surface later
- ConfigError::Deserialize carries a boxed std error instead of leaking
  figment::Error through the public API
- XDG helpers delegate to librebar::config::user_*_dir
- observability's log-directory probe uses the same helper so the
  directories dependency can go

Two behavior changes come with librebar:

- COLOPHON_-prefixed environment variables now feed config. They override
  discovered project and user files but not an explicitly selected --config
  file.
- Boundary-marker traversal stops at the marker directory itself. The old
  code skipped that check when the marker sat in the search root, so a
  search starting inside a repo root could previously escape past it.
Delete the hand-rolled observability module (custom JSON log layer,
timestamp formatter, and log target resolution) in favor of
librebar::logging, wired up through the librebar::init builder.

Replace the bespoke Cli struct with librebar::cli::CommonArgs, which
supplies -q, -v, -C, -c, --color, --format, and --version-only as global
flags. librebar::cli::parse_with also augments the command tree with the
schema and completions subcommands, so colophon::command() is no longer
needed to add compact help.

--json survives as a hidden compatibility spelling for --format json.
Output format now resolves through --format, which defaults to auto:
text on a terminal, JSON when stdout is redirected.

Note: xtask still calls colophon::command() and no longer compiles; it
is not a default workspace member and is updated in a follow-up.
--json replaced by --format json, schema subcommand test added,
extract test uses --format text to avoid auto-JSON in piped output.
Both generators now build from `librebar::cli::command::<colophon::Cli>()`
instead of the removed `colophon::command()`, so man pages and completions
describe the same tree `librebar::cli::parse_with` serves at runtime —
including the `schema` and `completions` subcommands librebar injects.

`librebar::cli::generate_manpages` replaces the hand-rolled clap_mangen
loop. It walks the full subcommand tree, names pages by hyphenated command
path, creates the output directory, and skips Clap's generated `help`
subcommand, which the old loop would have emitted as a junk page.

clap_complete stays a direct dependency: librebar does not re-export it,
and the `--shell` flag needs its `Shell` enum.
No longer used directly — XDG resolution delegates through
colophon-core to librebar::config.
@claylo
claylo merged commit 2623a41 into main Aug 12, 2026
5 checks passed
@claylo
claylo deleted the chore/librebar-migration branch August 12, 2026 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant