Flatten Repos (#70)

* move to “crates” style folder

* Update workspace

* clear crate names

* Rename crate folders based on feedback

* Use workspace dependencies instead of paths

* Move updated files from core
This commit is contained in:
Jazz Turner-Baggs 2026-03-24 18:21:00 -07:00 committed by GitHub
parent daeecbd679
commit 9a94f9a6d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
65 changed files with 54 additions and 5 deletions

7
Cargo.lock generated
View File

@ -119,6 +119,13 @@ dependencies = [
"zeroize",
]
[[package]]
name = "client"
version = "0.1.0"
dependencies = [
"libchat",
]
[[package]]
name = "const-oid"
version = "0.9.6"

View File

@ -3,15 +3,17 @@
resolver = "3"
members = [
"conversations",
"crypto",
"double-ratchets",
"storage",
"core/conversations",
"core/crypto",
"core/double-ratchets",
"core/storage",
"crates/client",
]
[workspace.dependencies]
blake2 = "0.10"
storage = { path = "storage" }
libchat = { path = "core/conversations" }
storage = { path = "core/storage" }
# Panicking across FFI boundaries is UB; abort is the correct strategy for a
# C FFI library.

7
core/README.md Normal file
View File

@ -0,0 +1,7 @@
# Core
Crates in this directory will one day be separated into a separate shared repository.
They could be moved now, but it's desirable to have a monorepo setup at this time.
These crates MUST not depend on any code outside of this folder.

View File

@ -12,6 +12,8 @@ mod types;
mod utils;
pub use api::*;
pub use context::{Context, Introduction};
pub use errors::ChatError;
#[cfg(test)]
mod tests {

10
crates/client/Cargo.toml Normal file
View File

@ -0,0 +1,10 @@
[package]
name = "client"
version = "0.1.0"
edition = "2024"
[lib]
crate-type = ["rlib"]
[dependencies]
libchat = { workspace = true }

View File

@ -0,0 +1,18 @@
use libchat::ChatError;
use libchat::Context;
pub struct ChatClient {
ctx: Context,
}
impl ChatClient {
pub fn new(name: impl Into<String>) -> Self {
Self {
ctx: Context::new_with_name(name),
}
}
pub fn create_bundle(&mut self) -> Result<Vec<u8>, ChatError> {
self.ctx.create_intro_bundle()
}
}

3
crates/client/src/lib.rs Normal file
View File

@ -0,0 +1,3 @@
mod client;
pub use client::ChatClient;