Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use single crate arch #461

Merged
merged 5 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
985 changes: 560 additions & 425 deletions Cargo.lock

Large diffs are not rendered by default.

10 changes: 0 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
[workspace]
members = [
"crates/file-explorer",
"crates/file-explorer-plugin",
"crates/file-explorer-proto",
"crates/file-explorer-ui",
"crates/http-server",
"crates/http-server-plugin",
]
default-members = ["crates/http-server"]
resolver = "1"
Expand Down Expand Up @@ -50,9 +46,3 @@ tower-layer = "0.3.3"
tracing = "0.1.40"
tracing-subscriber = "0.3.18"
web-sys = "0.3.72"

# Workspace Crates
file-explorer = { path = "crates/file-explorer" }
file-explorer-proto = { path = "crates/file-explorer-proto" }
file-explorer-ui = { path = "crates/file-explorer-ui" }
http-server-plugin = { path = "crates/http-server-plugin" }
11 changes: 1 addition & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,8 @@
default:
@echo No default target.

dev: ui-build plugin-build
cargo b --all && cargo r

release: plugin-build
make -C ./crates/file-explorer-plugin release

plugin-build: ui-release
make -C ./crates/file-explorer-plugin release

ui-build:
make -C ./crates/file-explorer-ui build
make -C ./crates/file-explorer-ui release

ui-dev:
@echo Starting File Explorer UI…
Expand Down
35 changes: 0 additions & 35 deletions crates/file-explorer-plugin/Cargo.toml

This file was deleted.

9 changes: 0 additions & 9 deletions crates/file-explorer-plugin/Makefile

This file was deleted.

10 changes: 0 additions & 10 deletions crates/file-explorer-proto/Cargo.toml

This file was deleted.

4 changes: 1 addition & 3 deletions crates/file-explorer-ui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@ leptos = { workspace = true, features = ["csr"] }
leptos_meta = { workspace = true, features = ["csr"] }
leptos_router = { workspace = true, features = ["csr"] }
reqwest = { workspace = true, features = ["json"] }
rust-embed = { workspace = true }
serde = { workspace = true, features = ["derive"] }
web-sys = { workspace = true, features = ["FileList", "HtmlInputElement"] }

file-explorer-proto = { workspace = true }

[dev-dependencies]
web-sys = { workspace = true }

Expand Down
3 changes: 0 additions & 3 deletions crates/file-explorer-ui/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
default:
@echo No default target.

build:
trunk build --locked --config ./Trunk.toml

dev:
trunk serve --config ./Trunk.toml

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
pub mod proto;

use anyhow::Result;
use gloo::utils::window;
use reqwest::{header::CONTENT_TYPE, Url};
use web_sys::FormData;

use file_explorer_proto::DirectoryIndex;
use self::proto::DirectoryIndex;

pub struct FileDownload {
pub bytes: Vec<u8>,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use leptos::{component, view, For, IntoView, Signal, SignalGet};

use file_explorer_proto::BreadcrumbItem;

use crate::api::proto::BreadcrumbItem;
use crate::components::atoms::icons::House;

#[component]
Expand Down
3 changes: 1 addition & 2 deletions crates/file-explorer-ui/src/components/pages/explorer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ use leptos::{
component, create_memo, create_signal, spawn_local, view, IntoView, SignalGet, SignalSet,
};

use file_explorer_proto::DirectoryIndex;

use crate::api::proto::DirectoryIndex;
use crate::api::Api;
use crate::components::organisms::action_bar::ActionBar;
use crate::components::organisms::navigation_bar::NavigationBar;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use chrono::{DateTime, Local};
use leptos::{component, view, IntoView, View};

use file_explorer_proto::EntryType;
use crate::api::proto::EntryType;

use super::download_button::DownloadButton;
use super::entry_icon::EntryIcon;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use leptos::{component, view, IntoView};

use file_explorer_proto::EntryType;

use crate::api::proto::EntryType;
use crate::components::atoms::icons::{File, Folder, Git, Justfile, Markdown, Rust, Toml};

#[component]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ mod entry_icon;

use leptos::{component, view, For, IntoView, Signal, SignalGet};

use file_explorer_proto::DirectoryEntry;
use crate::api::proto::DirectoryEntry;

use self::entry::Entry;

Expand Down
7 changes: 1 addition & 6 deletions crates/file-explorer-ui/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,8 @@ mod components;

use leptos::{component, view, IntoView};
use leptos_meta::provide_meta_context;
use rust_embed::Embed;

use crate::components::pages::explorer::Explorer;

#[derive(Embed)]
#[folder = "public/dist"]
pub struct Assets;
use self::components::pages::explorer::Explorer;

#[component]
pub fn App() -> impl IntoView {
Expand Down
12 changes: 0 additions & 12 deletions crates/file-explorer/Cargo.toml

This file was deleted.

25 changes: 0 additions & 25 deletions crates/http-server-plugin/Cargo.toml

This file was deleted.

4 changes: 0 additions & 4 deletions crates/http-server-plugin/build.rs

This file was deleted.

18 changes: 0 additions & 18 deletions crates/http-server-plugin/src/config.rs

This file was deleted.

50 changes: 0 additions & 50 deletions crates/http-server-plugin/src/lib.rs

This file was deleted.

18 changes: 8 additions & 10 deletions crates/http-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,13 @@ keywords = ["configurable", "http", "server", "serve", "static"]
license = "MIT OR Apache-2.0"
readme = "README.md"

[[bin]]
name = "http-server"
path = "src/bin/main.rs"

[lib]
name = "http_server_rs"
path = "src/lib.rs"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
anyhow = { workspace = true }
async-trait = { workspace = true }
bytes = { workspace = true }
chrono = { workspace = true, features = ["serde"] }
clap = { workspace = true, features = ["env", "derive", "std"] }
dirs = { workspace = true }
http = { workspace = true }
Expand All @@ -32,11 +25,16 @@ hyper = { workspace = true }
hyper-util = { workspace = true, features = ["full"] }
libloading = { workspace = true }
local-ip-address = { workspace = true }
mime_guess = { workspace = true }
multer = { workspace = true }
rust-embed = { workspace = true }
percent-encoding = { workspace = true }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
tokio = { workspace = true, features = ["fs", "rt-multi-thread", "signal", "macros"] }
tokio-util = { workspace = true }
tower-http = { workspace = true, features = ["cors"] }
tower = { workspace = true, features = ["util"] }
tower-layer = { workspace = true }
tracing = { workspace = true }
tracing-subscriber = { workspace = true, features = ["env-filter"] }

http-server-plugin = { workspace = true }
7 changes: 0 additions & 7 deletions crates/http-server/Makefile

This file was deleted.

Empty file removed crates/http-server/inline/.gitkeep
Empty file.
Loading
Loading