move prisma codegen into sd-prisma (#876)

This commit is contained in:
Brendan Allan 2023-05-29 16:37:58 +08:00 committed by GitHub
parent 17cdffc329
commit ac93c22647
6 changed files with 34 additions and 7 deletions

11
Cargo.lock generated
View File

@ -6814,6 +6814,7 @@ dependencies = [
"sd-file-ext",
"sd-heif",
"sd-p2p",
"sd-prisma",
"sd-sync",
"serde",
"serde-hashkey",
@ -6964,6 +6965,16 @@ dependencies = [
"tracing-subscriber",
]
[[package]]
name = "sd-prisma"
version = "0.1.0"
dependencies = [
"prisma-client-rust",
"sd-sync",
"serde",
"serde_json",
]
[[package]]
name = "sd-sync"
version = "0.1.0"

View File

@ -31,6 +31,7 @@ sd-heif = { path = "../crates/heif", optional = true }
sd-file-ext = { path = "../crates/file-ext" }
sd-sync = { path = "../crates/sync" }
sd-p2p = { path = "../crates/p2p", features = ["specta", "serde"] }
sd-prisma = { path = "../crates/prisma" }
rspc = { workspace = true, features = [
"uuid",

View File

@ -4,13 +4,14 @@ datasource db {
}
generator client {
provider = "cargo prisma"
output = "../src/prisma.rs"
provider = "cargo prisma"
output = "../../crates/prisma/src/prisma.rs"
module_path = "crate::prisma"
}
generator sync {
provider = "cargo prisma-sync"
output = "../src/prisma_sync.rs"
output = "../../crates/prisma/src/prisma_sync.rs"
}
//// Sync ////

View File

@ -7,6 +7,8 @@ use crate::{
p2p::P2PManager,
};
pub use sd_prisma::*;
use std::{path::Path, sync::Arc};
use thiserror::Error;
use tokio::{fs, sync::broadcast};
@ -26,10 +28,6 @@ pub(crate) mod sync;
pub(crate) mod util;
pub(crate) mod volume;
#[allow(warnings, unused)]
mod prisma;
pub(crate) mod prisma_sync;
#[derive(Clone)]
pub struct NodeContext {
pub config: Arc<NodeConfigManager>,

12
crates/prisma/Cargo.toml Normal file
View File

@ -0,0 +1,12 @@
[package]
name = "sd-prisma"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
prisma-client-rust = { workspace = true }
serde = "1.0"
serde_json = "1.0"
sd-sync = { path = "../sync" }

4
crates/prisma/src/lib.rs Normal file
View File

@ -0,0 +1,4 @@
#[allow(warnings, unused)]
pub mod prisma;
#[allow(warnings, unused)]
pub mod prisma_sync;