Skip to content

Protryon/lib-rs-mirror

Repository files navigation

Lib.rs (Crates.rs)

Lib.rs is a fast, lightweight index of Rust libraries and applications.

Crates published to crates.io will automatically show up on lib.rs. Lib.rs is not a registry on its own, and it's not affiliated with crates.io or the Rust project.

Building

  1. Install Rust, Node.js (Node is used for Sass styles), and Docutils (for .rst readmes).

    • Rust 1.48 or later
  2. Clone this repository recursively, so that all subprojects are included:

    git clone --recursive https://gitlab.com/crates.rs/crates.rs
    cd crates.rs
  3. Run make. It will download, compile and run everything. In case it doesn't work, try the step-by-step instructions below.

Contributing

The site is open source. It aims to be friendly and will enforce Code of Conduct to Rust's high standards. Rust beginners are welcome. Contributions beyond just code, such as UX and design, are appreciated.

If you'd like to help improve it:

Where to find the code?

Building step-by-step

  1. Get the initial data files for the site (about 200MB).

  2. Extract the data files in .xz format using 7zip, The Unarchiver (Mac) or unxz data/*.xz.

    • Put them all (crate_data.db, cratesio.rmpz, etc.) in the data/ subdirectory of crates.rs checkout.
  3. Generate front-end styles:

    cd style
    npm install
    npm run build
  4. Start a local server (open it in a new terminal or run in the background):

    cd ../server
    cargo run
    
  5. Serve the HTML and the styles together:

    cd ../style
    npm start

    This will launch a local web server on localhost:3000 that serves HTML from front_end/public/ and live reload styles from style/src/*.scss, so you can browse the site and edit the styles locally.

    Note that opening of the homepage for the first time takes a long time, because it may need to fetch and cache thousands of crates.

Troubleshooting

  • If you get "patch for … in … did not resolve to any crates." error when building, delete Cargo.lock files from the project.
  • If you get "deadline elapsed" error pages, just refresh. Cache takes time.
  • Search won't work until you run reindex_crates --all from the reindex subproject.

About

A mirror of lib.rs/main

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages