Crates.rs — a new, faster crate index website


#42

Makes me wonder if it wouldn’t be nice to have something like:

[package]
name = "unic-ucd"
part-of = "unic"

crates.io could also use that to display a "Part of X" on crates like unic-ucd, and a “Other crates in the X ecosystem” list on crates like unic. You’d probably want to ensure that only the owner of a crate X can publish another crate which has part-of = "X" in its manifest.


#43

Yes, I plan to dedupe them like that. Existing crates tend to use a Cargo workspace in a git monorepo, so deduplicating crates based on that should work.

I’m thinking about:

  1. if multiple crates have the same git repo URL,
  2. scan the repository to find the cargo workspace.
    • if it’s not a real workspace, just search for all Cargo.toml files
  3. If there’s a named crate at the root of the workspace/repo, use that as the project name
    • otherwise use github/gitlab/etc. project name
    • otherwise pick shortest crate name in the workspace
  4. Treat the project as a micro category
    • display only one of the crates in normal category listings
    • display child crate names as “Parent Crate Name > Child Crate Name”
    • link to siblings from crates’ pages
    • etc.

#44

I will be publishing sources here (it’s ~60% there already)

I’ve published stylesheet sources, so you can play with the UI design.


#45

Link to next page in category view leads to crates.io (e.g. https://crates.io/categories/no-std?page=6 @ https://crates.rs/no-std)


#46

I know :slight_smile: There’s a bunch of links for unfinished things that suddenly go to crates.io as a fallback. I haven’t implemented paging.

But I’m also wondering if something better can be done than paging. If you’ve scrolled past 50 or 100 crates and still haven’t found what you were looking for, then it might not be the most effective way. Perhaps smaller subcategories are needed? Filtering/faceted search?


#47

Yeah, but also: Sometimes I’m just browsing, especially as a newbie just exploring the ecosystem


#48

This site is super cool. You say you have 329 bugs and improvements – is it an open source site? Can others contribute? I don’t see a “Fork me” or a link.


#49

Short answer: https://gitlab.com/crates.rs

Longer answer:


#50

Ah ok! Thanks for the info.


#51

pretty cool. is there any way the output could be alphabetized or sorted by popularity?


#52

Depends which output?

  • The categories on the homepage are sorted by (number of crates * popularity of their top crates).
  • The category listings are sorted by popularity (but once I make progress on search, I’ll sort it by rank/relevance for that category)
  • Dependencies are sorted by… a bit of a mess. I’m thinking about sorting them by “weight”, grouped by platform.
  • Authors are sorted by owners first, then mix of original order in Cargo.toml and amount of contributed code.

In general I’m trying very hard to never ever sort anything alphabetically anywhere.