Skip to content

Commit 8010b7f

Browse files
authored
feat: use single crate arch (#461)
- Uses single crate architecture - Implements file server as a `handler` and leaves UI in its own crate (non published to crates.io)
1 parent 9ffa604 commit 8010b7f

File tree

41 files changed

+733
-1002
lines changed

Some content is hidden

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

41 files changed

+733
-1002
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
[workspace]
22
members = [
3-
"crates/file-explorer",
4-
"crates/file-explorer-plugin",
5-
"crates/file-explorer-proto",
63
"crates/file-explorer-ui",
74
"crates/http-server",
8-
"crates/http-server-plugin",
95
]
106
default-members = ["crates/http-server"]
117
resolver = "1"
@@ -50,9 +46,3 @@ tower-layer = "0.3.3"
5046
tracing = "0.1.40"
5147
tracing-subscriber = "0.3.18"
5248
web-sys = "0.3.72"
53-
54-
# Workspace Crates
55-
file-explorer = { path = "crates/file-explorer" }
56-
file-explorer-proto = { path = "crates/file-explorer-proto" }
57-
file-explorer-ui = { path = "crates/file-explorer-ui" }
58-
http-server-plugin = { path = "crates/http-server-plugin" }

Makefile

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,8 @@
33
default:
44
@echo No default target.
55

6-
dev: ui-build plugin-build
7-
cargo b --all && cargo r
8-
9-
release: plugin-build
10-
make -C ./crates/file-explorer-plugin release
11-
12-
plugin-build: ui-release
13-
make -C ./crates/file-explorer-plugin release
14-
156
ui-build:
16-
make -C ./crates/file-explorer-ui build
7+
make -C ./crates/file-explorer-ui release
178

189
ui-dev:
1910
@echo Starting File Explorer UI…

crates/file-explorer-plugin/Cargo.toml

Lines changed: 0 additions & 35 deletions
This file was deleted.

crates/file-explorer-plugin/Makefile

Lines changed: 0 additions & 9 deletions
This file was deleted.

crates/file-explorer-proto/Cargo.toml

Lines changed: 0 additions & 10 deletions
This file was deleted.

crates/file-explorer-ui/Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,9 @@ leptos = { workspace = true, features = ["csr"] }
2323
leptos_meta = { workspace = true, features = ["csr"] }
2424
leptos_router = { workspace = true, features = ["csr"] }
2525
reqwest = { workspace = true, features = ["json"] }
26-
rust-embed = { workspace = true }
26+
serde = { workspace = true, features = ["derive"] }
2727
web-sys = { workspace = true, features = ["FileList", "HtmlInputElement"] }
2828

29-
file-explorer-proto = { workspace = true }
30-
3129
[dev-dependencies]
3230
web-sys = { workspace = true }
3331

crates/file-explorer-ui/Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
default:
44
@echo No default target.
55

6-
build:
7-
trunk build --locked --config ./Trunk.toml
8-
96
dev:
107
trunk serve --config ./Trunk.toml
118

crates/file-explorer-ui/src/api.rs renamed to crates/file-explorer-ui/src/api/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
pub mod proto;
2+
13
use anyhow::Result;
24
use gloo::utils::window;
35
use reqwest::{header::CONTENT_TYPE, Url};
46
use web_sys::FormData;
57

6-
use file_explorer_proto::DirectoryIndex;
8+
use self::proto::DirectoryIndex;
79

810
pub struct FileDownload {
911
pub bytes: Vec<u8>,

0 commit comments

Comments
 (0)