perf(derive): drop proc-macro-crate transitive deps - #1042
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Central YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
04e964c to
391f787
Compare
391f787 to
188e21e
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit db26e1b. Configure here.
Instruction counts
No instruction-count regression above 1%. Only instruction counts gate. Wall clock is shown for context — on identical hardware it moves 4-20% run to run. Measured by tak — instruction-counted CLI benchmarks, stored in this repository's git notes. Shadow comparisonParsing
|
Resolve usage-argv / usage-rs renames by reading the adopter Cargo.toml directly for the dependency forms usage documents. Removes toml_edit and friends from every derive compile while keeping the facade alias and mixed-dependency layouts working. Co-authored-by: jdx <jdx@users.noreply.github.com>
Cargo's TOML 1.1 multi-line inline tables carry a trailing comma on each field and may put fields on the opening or closing brace line. The manifest reader dropped those renames and fell back to ::usage_argv. Read package fields tolerant of the comma and of the brace position. Co-authored-by: jdx <jdx@users.noreply.github.com>
db26e1b to
c543534
Compare
<!-- CURSOR_AGENT_PR_BODY_BEGIN --> ## Summary Rust framework adopters should depend on **one** Cargo package out of the box: `usage-rs` (aliased to `usage`). The facade already existed for that, but it was stuck at the `0.0.0` crates.io placeholder because `tasks/release-plz` never published it, and defaults omitted `diagnostics` so friendly errors were a footgun. ## Changes - Publish `usage-rs` in the release path (after `usage-argv` / `usage-derive`), and include it in cliff / version bump paths - Enable `diagnostics` by default on the facade so clap-shaped parse errors work without an extra feature - Document the one-dependency install; keep `usage-argv` / `usage-derive` as the thin low-level split - Drop the redundant `features = ["diagnostics"]` from `usage-cli` (defaults cover it) - Regression test: facade defaults render clap-shaped unknown-flag errors (plain `Style`, so TTY/`CLICOLOR_FORCE` cannot flake the assertion) - CI: apt per-connection timeouts when installing zsh/fish (same fix as #1036) so stalled azure mirrors do not fail `test`/`coverage` ## Why Applications were documented to depend on `usage-rs`, but without a release they effectively needed both `usage-argv` and `usage-derive`. Shipping the facade closes that gap; turning on diagnostics by default removes the “Debug-formatted errors until you remember the feature” footgun. Low-level adopters that want only the binding runtime still use `usage-argv` directly (no defaults). ## Stack - **This PR** — one-crate facade defaults + release publish + CI apt resilience - #1042 — drop `proc-macro-crate` transitive deps (stacked on this; base = this branch) ## Checks - `cargo test -p usage-rs` - `cargo check -p usage-cli` - `usage --wat` → clap-shaped error, exit 2 - Bugbot ANSI assertion feedback addressed and thread resolved <!-- CURSOR_AGENT_PR_BODY_END --> <div><a href="https://cursor.com/agents/bc-bfc42df3-e089-48ba-8ca9-86373fb54d80?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a> <a href="https://cursor.com/background-agent?bcId=bc-bfc42df3-e089-48ba-8ca9-86373fb54d80&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img alt="Open in Cursor" width="131" height="28" src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a> </div> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Rust applications now enable diagnostics, specification, and help support by default. * Unknown command-line arguments display clearer, clap-style error messages with plain styling. * Shell completions remain optional and can be enabled separately. * **Documentation** * Updated installation and feature guidance to reflect default capabilities and available lower-level alternatives. * Clarified fallback error formatting when diagnostics are disabled. * Documented feature requirements and configuration options for shell completions. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: jdx <jdx@users.noreply.github.com>

Summary
Stacked on #1041. Drops
proc-macro-crate(and itstoml_edit/indexmap/winnowtree) fromusage-deriveso adopters compile a much smaller transitive set.Approach
Keep rename / mixed-dependency resolution by reading the adopter’s
Cargo.tomldirectly for the forms usage documents:usage-argv = …)usage = { package = "usage-rs", … }){ … }tables[dependencies.foo]headersSame priority as before: direct
usage-argvwins, otherwise theusage-rsfacade.Tree
Before (under
usage-rs): ~17 crates includingtoml_edit,winnow,indexmap, …After:
usage-rs→usage-argv+usage-deriveusage-derive→syn/quote/proc-macro2/unicode-identChecks
cargo test -p usage-derive(including newcrate_nameunit tests)cargo test -p usage-rs(facade + cargo-alias + mixed-dependencies fixtures)cargo test -p usage-conformance --test derive --test unit_variantscargo clippy -p usage-derive --all-targets -- -D warningscargo check -p usage-cliStack