Skip to content

Commit 01a9300

Browse files
committed
extract webserver into sub subcrate
1 parent 7bfb09c commit 01a9300

1,577 files changed

Lines changed: 4799 additions & 2335 deletions

File tree

Some content is hidden

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

Cargo.lock

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

Cargo.toml

Lines changed: 6 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ authors = ["Onur Aslan <onuraslan@gmail.com>", "The Rust Project Developers"]
55
readme = "README.md"
66
license = "MIT"
77
repository = "https://github.com/rust-lang/docs.rs"
8-
build = "build.rs"
98
edition = "2024"
109

1110
[workspace]
@@ -27,7 +26,7 @@ askama = "0.15.1"
2726
async-stream = "0.3.5"
2827
axum-extra = { version = "0.12.0", features = ["typed-header", "routing", "middleware"] }
2928
base64 = "0.22"
30-
bon = "3.8.1"
29+
bon = { version = "3.8.1", features = ["experimental-overwritable"] }
3130
chrono = { version = "0.4.11", default-features = false, features = ["clock", "serde"] }
3231
clap = { version = "4.0.22", features = [ "derive" ] }
3332
derive_more = { version = "2.0.0", features = ["display", "deref", "from", "into", "from_str"] }
@@ -66,80 +65,27 @@ walkdir = "2"
6665
docs_rs_build_limits = { path = "crates/lib/docs_rs_build_limits" }
6766
docs_rs_build_queue = { path = "crates/lib/docs_rs_build_queue" }
6867
docs_rs_builder = { path = "crates/bin/docs_rs_builder" }
69-
docs_rs_cargo_metadata = { path = "crates/lib/docs_rs_cargo_metadata" }
7068
docs_rs_context = { path = "crates/lib/docs_rs_context" }
7169
docs_rs_database = { path = "crates/lib/docs_rs_database" }
72-
docs_rs_env_vars = { path = "crates/lib/docs_rs_env_vars" }
7370
docs_rs_fastly = { path = "crates/lib/docs_rs_fastly" }
74-
docs_rs_headers = { path = "crates/lib/docs_rs_headers" }
7571
docs_rs_logging = { path = "crates/lib/docs_rs_logging" }
76-
docs_rs_mimes = { path = "crates/lib/docs_rs_mimes" }
7772
docs_rs_opentelemetry = { path = "crates/lib/docs_rs_opentelemetry" }
7873
docs_rs_registry_api = { path = "crates/lib/docs_rs_registry_api" }
7974
docs_rs_repository_stats = { path = "crates/lib/docs_rs_repository_stats" }
8075
docs_rs_storage = { path = "crates/lib/docs_rs_storage" }
8176
docs_rs_types = { path = "crates/lib/docs_rs_types" }
82-
docs_rs_uri = { path = "crates/lib/docs_rs_uri" }
8377
docs_rs_utils = { path = "crates/lib/docs_rs_utils" }
8478
docs_rs_watcher = { path = "crates/bin/docs_rs_watcher" }
79+
docs_rs_web = { path = "crates/bin/docs_rs_web" }
8580

86-
sentry = { workspace = true }
81+
anyhow = { workspace = true }
8782
tracing = { workspace = true }
88-
regex = { workspace = true }
83+
chrono = { workspace = true }
8984
clap = { workspace = true }
90-
rayon = { workspace = true }
91-
num_cpus = "1.15.0"
92-
reqwest = { workspace = true }
93-
slug = { workspace = true }
94-
sqlx = { workspace = true }
95-
url = { workspace = true }
96-
anyhow = { workspace = true }
97-
thiserror = { workspace = true }
98-
comrak = { version = "0.49.0", default-features = false }
99-
syntect = { version = "5.0.0", default-features = false, features = ["parsing", "html", "dump-load", "regex-onig"] }
100-
toml = { workspace = true }
101-
opentelemetry = { workspace = true }
102-
opentelemetry_sdk = { workspace = true }
103-
base64 = { workspace = true }
104-
lol_html = "2.0.0"
105-
font-awesome-as-a-crate = { path = "crates/lib/font-awesome-as-a-crate" }
106-
getrandom = "0.3.1"
107-
itertools = { workspace = true }
108-
derive_more = { workspace = true }
109-
derive_builder = "0.20.2"
110-
111-
# Async
11285
tokio = { workspace = true }
113-
tokio-util = { version = "0.7.15", default-features = false, features = ["io"] }
114-
tracing-futures= { version = "0.2.5", features = ["std-future", "futures-03"] }
86+
derive_builder = "0.20.2"
11587
futures-util = { workspace = true }
116-
async-stream = { workspace = true }
117-
http = { workspace = true }
118-
119-
# Data serialization and deserialization
120-
serde = { workspace = true }
121-
serde_json = { workspace = true }
122-
postcard = { workspace = true }
123-
124-
# axum dependencies
125-
axum = { version = "0.8.1", features = ["macros"] }
126-
axum-extra = { workspace = true }
127-
tower = "0.5.1"
128-
tower-http = { version = "0.6.0", features = ["fs", "trace", "timeout", "catch-panic"] }
129-
mime = { workspace = true }
130-
131-
fn-error-context = "0.2.0"
132-
133-
# Templating
134-
askama = { workspace = true }
135-
walkdir = { workspace = true }
136-
phf = "0.13.1"
137-
138-
# Date and Time utilities
139-
chrono = { workspace = true }
140-
141-
# Transitive dependencies we don't use directly but need to have specific versions of
142-
constant_time_eq = "0.4.2"
88+
sqlx = { workspace = true }
14389

14490
[dev-dependencies]
14591
docs_rs_build_queue = { path = "crates/lib/docs_rs_build_queue", features = ["testing"] }
@@ -153,31 +99,13 @@ docs_rs_storage = { path = "crates/lib/docs_rs_storage", features = ["testing"]
15399
docs_rs_test_fakes = { path = "crates/lib/docs_rs_test_fakes" }
154100
docs_rs_types = { path = "crates/lib/docs_rs_types", features = ["testing"] }
155101

156-
kuchikiki = "0.8"
157-
http-body-util = "0.1.0"
158102
rand = { workspace = true }
159103
mockito = { workspace = true }
160104
test-case = { workspace = true }
161105
tower = { version = "0.5.1", features = ["util"] }
162106
opentelemetry_sdk = { version = "0.31.0", features = ["rt-tokio", "testing"] }
163-
indoc = "2.0.0"
164107
pretty_assertions = { workspace = true }
165108

166-
[build-dependencies]
167-
time = "0.3"
168-
md5 = "0.8.0"
169-
phf_codegen = "0.13"
170-
walkdir = "2"
171-
anyhow = { version = "1.0.42", features = ["backtrace"] }
172-
grass = { version = "0.13.1", default-features = false }
173-
syntect = { version = "5.0.0", default-features = false, features = ["parsing", "dump-create", "yaml-load", "regex-onig"] }
174-
175-
[package.metadata.cargo-machete]
176-
ignored = [
177-
"phf", # used in build script output
178-
"slug", # used in askama templates, can be moved to web binary
179-
]
180-
181109
[[bin]]
182110
name = "cratesfyi"
183111
test = false

assets/syntaxes/Packages/CSS/.python-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

assets/syntaxes/Packages/Diff/.python-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

assets/syntaxes/Packages/HTML/.python-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

assets/syntaxes/Packages/ShellScript/.python-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

crates/bin/docs_rs_builder/src/main.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,17 @@ impl CommandLine {
4242
let config = Arc::new(Config::from_environment()?);
4343
let ctx = runtime.block_on(async {
4444
Context::builder()
45+
.with_runtime()
4546
.await?
47+
.with_meter_provider()?
4648
.with_pool()
4749
.await?
4850
.with_storage()
4951
.await?
50-
.with_cdn()
51-
.await?
52-
.with_build_queue()
53-
.await?
54-
.with_registry_api()
55-
.await?
56-
.with_repository_stats()
57-
.await?
52+
.with_cdn()?
53+
.with_build_queue()?
54+
.with_registry_api()?
55+
.with_repository_stats()?
5856
.build()
5957
})?;
6058

crates/bin/docs_rs_builder/src/testing/test_env.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,12 @@ impl TestEnvironment {
4949
config: Arc::new(config),
5050
context: runtime.block_on(async {
5151
Context::builder()
52+
.with_runtime()
5253
.await?
54+
.with_meter_provider()?
5355
.pool(db_config.into(), db.pool().clone())
5456
.storage(storage_config.clone(), test_storage.storage())
55-
.with_build_queue()
56-
.await?
57+
.with_build_queue()?
5758
.maybe_cdn(
5859
docs_rs_fastly::Config::from_environment()?.into(),
5960
Some(Cdn::mock().into()),

0 commit comments

Comments
 (0)