feat(shipper): gate shipper-cli behind default 'cli' feature#149
Conversation
The `shipper` crate is the install façade — `cargo install shipper`
is the recommended install path — but until now its library surface
forced every consumer to pull `shipper-cli` and therefore `clap`,
even though the re-exported modules (`engine`, `plan`, `types`, …)
only touch `shipper-core`.
This commit:
- Marks `shipper-cli` as an optional dependency.
- Adds a `cli` feature that is on by default, so `cargo install shipper`
and the `shipper` binary keep working with zero user action.
- Gates the `[[bin]]` target with `required-features = ["cli"]` so
`--no-default-features` cleanly skips the binary instead of failing
late with a `clap` missing-dep error.
Lean embedders who prefer the product name can now do:
[dependencies]
shipper = { version = "0.3.0-rc.2", default-features = false }
which drops the `clap` graph while keeping the curated re-exports.
`shipper-core` remains the canonical lean embedding surface and is
the recommendation for most library use.
Verified:
- `cargo check -p shipper` — default features (build includes bin)
- `cargo check -p shipper --no-default-features` — lib only
- `cargo build -p shipper --bin shipper --no-default-features` — fails
with a clear `requires the features: cli` message (as intended)
- `cargo test -p shipper` — 39 tests pass
- `cargo clippy --workspace --all-targets --all-features -- -D warnings` clean
- `cargo clippy -p shipper --no-default-features --all-targets -- -D warnings` clean
- `cargo fmt --all -- --check` clean
Docs updated: lib.rs, README.md, CHANGELOG.md [Unreleased] entry.
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 49 minutes and 0 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Summary
Makes
shipper-clian optional dependency of theshippercrate, behind a defaultclifeature.cargo install shipperand theshipperbinary keep working unchanged; lean embedders who want the curatedshipper-corere-export via the product name can now opt out of theclapgraph.Why
The
shippercrate's library surface (engine,plan,types,config,state,store) only touchesshipper-core— but until now, depending onshipperforced consumers to pullshipper-cliand thereforeclap, even when they never intended to invoke the CLI. The #95 three-crate split identifiedshipper-coreas the canonical lean embedding surface and this closes the loop for callers who prefer the product name.Changes
shipper-clidependency is nowoptional = true.[features]block:default = ["cli"],cli = ["dep:shipper-cli"].[[bin]] name = "shipper"getsrequired-features = ["cli"]—--no-default-featurescleanly skips the binary instead of failing late with aclapmissing-dep error.src/lib.rsandcrates/shipper/README.mddocument the embedding opt-out.CHANGELOG.mdgets an[Unreleased]entry.Compatibility
cargo install shipper --locked— unchanged (default features includecli).cargo install shipper-cli --locked— unchanged.shipper = "0.3.0-rc.2"(lib consumers) — unchanged (they already gotshipper-clitransitively; now they still do, by default).shipper = { version = "0.3.0-rc.2", default-features = false }— new opt-in: dropsclap.Test plan
cargo check -p shippercleancargo check -p shipper --no-default-featurescleancargo build -p shipper --bin shipper --no-default-featuresfails with the intendedrequires the features: climessagecargo test -p shipper— 39 passedcargo clippy --workspace --all-targets --all-features -- -D warningscleancargo clippy -p shipper --no-default-features --all-targets -- -D warningscleancargo fmt --all -- --checkclean