cargo-edit icon indicating copy to clipboard operation
cargo-edit copied to clipboard

read cargo configs with/without .toml extension + make public API clearer

Open chrismooredev opened this issue 5 years ago • 0 comments

The goal for my series of commits is to consolidate repeated functionality and make this crate easier to use for those using it's public Rust API.

commit ff1e158:

  • prevents cargo_edit::registry::cargo_home from unnecessarily getting $HOME, or checking UTF8 compliance.

commit 03f6d74: introduce new structs to drive a new public, programmable API

  • supports reading both bare .cargo/config and .cargo/config.toml files
  • added documentation
  • puts some of the public API into new RegistryReq and RegistryIndex structs, and attaches many of the freestanding functions in cargo_edit::registry into those.
    • RegistryReq notably allows a new user of the public API to more easily figure out the latest dependency of a crate without supplying a project directory.

commit 1c986a6:

  • rolls back changed public signatures, to forward to the new functions, with deprecation warnings
  • moves implementations to their respective RegistryReq and RegistryIndex structs

commit 933ebfe:

  • bakes in the generated binary paths (cargo-add/cargo-rm/cargo-update) for testing purposes
  • also enables testing this crate within a cargo workspace, as the target/ dir is not in the expected crate root or CWD location for those.

I plan to do a major bump once I am done editing the public API, if that is welcomed :)

chrismooredev avatar Dec 03 '20 19:12 chrismooredev