Add an API to generate registry index data
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 15.5k
- Forks
- 3k
- Avg merge
- 23h 30m
- Merged PRs (30d)
- 51
Description
See RFC 2141 for more details/context.
Currently, the knowledge of what goes in the registry index in what format lives in crates.io:
- here,
- which serializes an instance of this struct,
- which comes from here,
- most of which comes from cargo anyway, around here,
- which deserializes an instance of this struct
- which has a corresponding struct in cargo
- that gets created here
In order to support minimal registries, we'd like cargo to be able to generate the JSON information that should go into a registry for the current crate.
Cargo does already understand how to read these entries! We need to teach it how to create them as well :)
So as I understand it, this would involve:
- Derive
Serializefor theRegistryPackagestruct - Create a new command, feel free to suggest another name, the first thought in my head is
generate-index-metadata, that should:- Create an instance of
RegistryPackagefor the current crate, reusing code that sends relevant information to crates.io when appropriate - Serialize that struct to stdout
- Create an instance of
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with RFC 2141 and the RegistryPackage struct in src/cargo/sources/registry/mod.rs, then read the registry operation that sends package information to crates.io in src/cargo/ops/registry.rs. Trace how Cargo reads registry entries before deciding how the new command should construct and serialize the current crate's metadata. Done means a command generates the registry JSON and writes it to stdout.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend-api-design, cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100