From bd2cdba5bca3bc62e60bb61ad97889efe07a5a37 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Tue, 29 Oct 2024 14:21:06 -0400 Subject: [PATCH] Move graph to separate crate --- Cargo.lock | 8 +++++++- Cargo.toml | 4 ++-- crates/graph/Cargo.toml | 9 +++++++++ src/graph/mod.rs => crates/graph/src/lib.rs | 0 src/main.rs | 1 - 5 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 crates/graph/Cargo.toml rename src/graph/mod.rs => crates/graph/src/lib.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index 7685194..54a928a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -767,6 +767,13 @@ dependencies = [ "wasi 0.11.0+wasi-snapshot-preview1", ] +[[package]] +name = "graph" +version = "0.1.0" +dependencies = [ + "petgraph", +] + [[package]] name = "h2" version = "0.3.14" @@ -2588,7 +2595,6 @@ dependencies = [ "notify-debouncer-mini", "once_cell", "openssl", - "petgraph", "pulldown-cmark", "regex", "reqwest", diff --git a/Cargo.toml b/Cargo.toml index 4850944..107fca0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,3 +1,4 @@ +workspace = { members = ["crates/graph"] } [package] name = "v6" version = "0.1.0" @@ -66,8 +67,7 @@ tree-sitter-objc = { version = "1.0.0", git = "https://git.shadowfacts.net/shado tree-sitter-rust = "0.20" unicode-normalization = "0.1.19" url = "2.2" -uuid = { version = "1.1", features = ["v4" ] } -petgraph = "0.6.5" +uuid = { version = "1.1", features = ["v4"] } [target.'cfg(target_os = "ios")'.dependencies] openssl = { version = "0.10", features = ["vendored"] } diff --git a/crates/graph/Cargo.toml b/crates/graph/Cargo.toml new file mode 100644 index 0000000..f8194fe --- /dev/null +++ b/crates/graph/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "graph" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +petgraph = "0.6.5" diff --git a/src/graph/mod.rs b/crates/graph/src/lib.rs similarity index 100% rename from src/graph/mod.rs rename to crates/graph/src/lib.rs diff --git a/src/main.rs b/src/main.rs index 5172edd..051845f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,7 +2,6 @@ mod activitypub; mod generator; -mod graph; use crate::generator::{HtmlContent, Post}; use axum::{