-
chore: introduce codex-common crate (#843)
发布于
2025-05-07 00:38:56 +00:00 I started this PR because I wanted to share the
format_duration()
utility function incodex-rs/exec/src/event_processor.rswith the TUI.
The question was: where to put it?coreshould have as few dependencies as possible, so moving it there
would introduce a dependency onchrono, which seemed undesirable.
corealready had thisclifeature to deal with a similar situation
around sharing common utility functions, so I decided to:- make
corefeature-free - introduce
common commoncan have as many "special interest" features as it needs,
each of which can declare their own deps- the first two features of common are
cliandelapsed
In practice, this meant updating a number of
Cargo.tomlfiles,
replacing this line:codex-core = { path = "../core", features = ["cli"] }with these:
codex-core = { path = "../core" } codex-common = { path = "../common", features = ["cli"] }Moving
format_duration()into its own file gave it some "breathing
room" to add a unit test, so I had Codex generate some tests and new
support for durations over 1 minute.下载附件
- make