Skip to content

Commit 395126b

Browse files
authored
Rename cargo-registry packages to crates_io (rust-lang#6577)
We are doing this for several reasons: - back when the `cargo-registry` package was created the term "crates.io" was not a thing yet but it's the most commonly used name at this point - at one point the codebase also supported being run as a mirror or for 3rd-party registries, but we haven't supported this anymore for quite a while - `crates_io` is shorter - `crates_io` uses an underscore instead of hyphen, which means it matches the import name - ultimately, `crates_io` is easier to understand for any new contributors Small downside: most of the open pull requests will most likely experience merge conflicts after this gets merged. the number of open pull requests is relatively low though and since it is mostly just moving files it should be comparatively easy to rebase and fix the merge conflicts.
1 parent d748152 commit 395126b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+286
-292
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
id: changed-files-non-rust
4848
with:
4949
files_ignore: |
50-
cargo-registry-*/**
50+
crates_io_*/**
5151
migrations/**
5252
src/**
5353
build.rs

Cargo.lock

Lines changed: 126 additions & 126 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
2-
name = "cargo-registry"
2+
name = "crates_io"
33
authors = ["Alex Crichton <[email protected]>"]
4-
version = "0.2.2"
4+
version = "0.0.0"
55
license = "MIT OR Apache-2.0"
66
repository = "https://github.com/rust-lang/crates.io"
77
description = "Backend of crates.io"
@@ -14,7 +14,7 @@ default-run = "server"
1414
opt-level = 2
1515

1616
[lib]
17-
name = "cargo_registry"
17+
name = "crates_io"
1818
doctest = true
1919

2020
[[test]]
@@ -35,10 +35,10 @@ aws-sigv4 = "=0.55.3"
3535
axum = { version = "=0.6.18", features = ["headers", "macros", "matched-path"] }
3636
axum-extra = { version = "=0.7.4", features = ["cookie-signed"] }
3737
base64 = "=0.13.1"
38-
cargo-registry-index = { path = "cargo-registry-index" }
39-
cargo-registry-markdown = { path = "cargo-registry-markdown" }
40-
cargo-registry-s3 = { path = "cargo-registry-s3" }
41-
cargo-registry-tarball = { path = "cargo-registry-tarball" }
38+
crates_io_index = { path = "crates_io_index" }
39+
crates_io_markdown = { path = "crates_io_markdown" }
40+
crates_io_s3 = { path = "crates_io_s3" }
41+
crates_io_tarball = { path = "crates_io_tarball" }
4242
chrono = { version = "=0.4.26", default-features = false, features = ["serde"] }
4343
clap = { version = "=4.3.2", features = ["derive", "env", "unicode", "wrap_help"] }
4444
cookie = { version = "=0.17.0", features = ["secure"] }
@@ -94,8 +94,8 @@ tracing-subscriber = { version = "=0.3.17", features = ["env-filter"] }
9494
url = "=2.4.0"
9595

9696
[dev-dependencies]
97-
cargo-registry-index = { path = "cargo-registry-index", features = ["testing"] }
98-
cargo-registry-tarball = { path = "cargo-registry-tarball", features = ["builder"] }
97+
crates_io_index = { path = "crates_io_index", features = ["testing"] }
98+
crates_io_tarball = { path = "crates_io_tarball", features = ["builder"] }
9999
claims = "=0.7.1"
100100
hyper-tls = "=0.5.0"
101101
insta = { version = "=1.29.0", features = ["redactions", "yaml"] }

cargo-registry-index/Cargo.toml renamed to crates_io_index/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "cargo-registry-index"
2+
name = "crates_io_index"
33
version = "0.0.0"
44
license = "MIT OR Apache-2.0"
55
repository = "https://github.com/rust-lang/crates.io"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

cargo-registry-markdown/Cargo.toml renamed to crates_io_markdown/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "cargo-registry-markdown"
2+
name = "crates_io_markdown"
33
version = "0.0.0"
44
license = "MIT OR Apache-2.0"
55
repository = "https://github.com/rust-lang/crates.io"

cargo-registry-markdown/lib.rs renamed to crates_io_markdown/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ static MARKDOWN_EXTENSIONS: [&str; 7] =
246246
/// # Examples
247247
///
248248
/// ```
249-
/// use cargo_registry_markdown::text_to_html;
249+
/// use crates_io_markdown::text_to_html;
250250
///
251251
/// let text = "[Rust](https://rust-lang.org/) is an awesome *systems programming* language!";
252252
/// let rendered = text_to_html(text, "README.md", None, None);

cargo-registry-s3/Cargo.toml renamed to crates_io_s3/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
2-
name = "cargo-registry-s3"
3-
version = "0.2.0"
2+
name = "crates_io_s3"
3+
version = "0.0.0"
44
authors = ["Alex Crichton <[email protected]>"]
55
license = "MIT OR Apache-2.0"
66
repository = "https://github.com/rust-lang/crates.io"
File renamed without changes.

cargo-registry-tarball/Cargo.toml renamed to crates_io_tarball/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "cargo-registry-tarball"
2+
name = "crates_io_tarball"
33
version = "0.0.0"
44
license = "MIT OR Apache-2.0"
55
edition = "2021"
File renamed without changes.

docs/BACKEND.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ The server does the following things:
99

1010
1. Initialize logging
1111
2. Check out the index git repository, if it isn't already checked out
12-
3. Reads values from environment variables to configure a new instance of `cargo_registry::App`
13-
4. Adds middleware to the app by calling `cargo_registry::middleware`
12+
3. Reads values from environment variables to configure a new instance of `crates_io::App`
13+
4. Adds middleware to the app by calling `crates_io::middleware`
1414
5. Syncs the categories defined in *src/categories.toml* with the categories in the database
15-
6. Starts a [hyper] server that uses the `cargo_registry::App` instance
15+
6. Starts a [hyper] server that uses the `crates_io::App` instance
1616
7. Tells Nginx on Heroku that the application is ready to receive requests, if running on Heroku
1717
8. Blocks forever (or until the process is killed)
1818

src/admin/backfill/rust_version.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
use crate::db;
22
use crate::schema::{crates, versions};
33
use anyhow::anyhow;
4-
use cargo_registry_index::Repository;
5-
use cargo_registry_tarball::process_tarball;
64
use chrono::{Days, NaiveDate};
5+
use crates_io_index::Repository;
6+
use crates_io_tarball::process_tarball;
77
use crossbeam_channel::unbounded;
88
use diesel::connection::DefaultLoadingMode;
99
use diesel::prelude::*;

0 commit comments

Comments
 (0)