mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
Refactor: delete unused crates (#2543)
* refactor: delete user model * refactor: delete user model crate * refactor: rm flowy-server-sync crate * refactor: rm flowy-database and flowy-folder * refactor: rm folder-model * refactor: rm database model * refactor: rm flowy-sync * refactor: rm document-model * refactor: rm flowy-document * refactor: rm flowy-client-sync * refactor: rm ws-model * refactor: rm flowy-revisoin * refactor: rm revision-model * refactor: rm flowy-folder * refactor: rm flowy-client-ws * refactor: move crates * chore: move configuration file * ci: fix tauri build' * ci: fix flutter build * ci: rust test script * ci: tauri pnpm version conflict * ci: tauri build
This commit is contained in:
@ -6,17 +6,13 @@ edition = "2018"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
flowy-derive = { path = "../flowy-derive" }
|
||||
flowy-derive = { path = "../../../shared-lib/flowy-derive" }
|
||||
protobuf = {version = "2.28.0"}
|
||||
bytes = "1.4"
|
||||
anyhow = "1.0"
|
||||
thiserror = "1.0"
|
||||
|
||||
flowy-client-sync = { path = "../flowy-client-sync", optional = true}
|
||||
lib-dispatch = { path = "../lib-dispatch", optional = true }
|
||||
lib-ot = { path = "../../../shared-lib/lib-ot", optional = true}
|
||||
user-model = { path = "../../../shared-lib/user-model", optional = true}
|
||||
flowy-client-ws = { path = "../../../shared-lib/flowy-client-ws", optional = true }
|
||||
serde_json = {version = "1.0", optional = true}
|
||||
serde_repr = { version = "0.1" }
|
||||
serde = "1.0"
|
||||
@ -28,18 +24,14 @@ collab-database = { version = "0.1.0", optional = true }
|
||||
collab-document = { version = "0.1.0", optional = true }
|
||||
|
||||
[features]
|
||||
adaptor_sync = ["flowy-client-sync"]
|
||||
adaptor_ot = ["lib-ot"]
|
||||
adaptor_dispatch = ["lib-dispatch"]
|
||||
adaptor_serde = ["serde_json"]
|
||||
adaptor_reqwest = ["reqwest"]
|
||||
adaptor_database = ["flowy-sqlite", "r2d2"]
|
||||
adaptor_ws= ["flowy-client-ws"]
|
||||
adaptor_user= ["user-model"]
|
||||
adaptor_server_error = ["http-error-code"]
|
||||
dart = ["flowy-codegen/dart"]
|
||||
ts = ["flowy-codegen/ts"]
|
||||
collab = ["collab-database", "collab-document"]
|
||||
|
||||
[build-dependencies]
|
||||
flowy-codegen = { path = "../flowy-codegen", features = ["proto_gen"]}
|
||||
flowy-codegen = { path = "../../../shared-lib/flowy-codegen", features = ["proto_gen"]}
|
||||
|
@ -1,7 +1,8 @@
|
||||
use flowy_derive::ProtoBuf_Enum;
|
||||
use serde_repr::*;
|
||||
use thiserror::Error;
|
||||
|
||||
use flowy_derive::ProtoBuf_Enum;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Error, Serialize_repr, Deserialize_repr, ProtoBuf_Enum)]
|
||||
#[repr(u8)]
|
||||
pub enum ErrorCode {
|
||||
|
@ -1,8 +1,5 @@
|
||||
#[cfg(feature = "adaptor_sync")]
|
||||
pub mod sync;
|
||||
|
||||
#[cfg(feature = "adaptor_ot")]
|
||||
pub mod ot;
|
||||
// #[cfg(feature = "adaptor_ot")]
|
||||
// pub mod ot;
|
||||
|
||||
#[cfg(feature = "adaptor_serde")]
|
||||
pub mod serde;
|
||||
@ -16,12 +13,6 @@ pub mod reqwest;
|
||||
#[cfg(feature = "adaptor_database")]
|
||||
pub mod database;
|
||||
|
||||
#[cfg(feature = "adaptor_ws")]
|
||||
pub mod ws;
|
||||
|
||||
#[cfg(feature = "adaptor_user")]
|
||||
pub mod user;
|
||||
|
||||
#[cfg(feature = "adaptor_server_error")]
|
||||
pub mod http_server;
|
||||
|
||||
|
@ -1,7 +0,0 @@
|
||||
use crate::FlowyError;
|
||||
|
||||
impl std::convert::From<lib_ot::errors::OTError> for FlowyError {
|
||||
fn from(error: lib_ot::errors::OTError) -> Self {
|
||||
FlowyError::internal().context(error.msg)
|
||||
}
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
use crate::FlowyError;
|
||||
|
||||
use flowy_client_sync::errors::ErrorCode;
|
||||
|
||||
impl std::convert::From<flowy_client_sync::errors::SyncError> for FlowyError {
|
||||
fn from(error: flowy_client_sync::errors::SyncError) -> Self {
|
||||
match error.code {
|
||||
ErrorCode::RecordNotFound => FlowyError::record_not_found().context(error.msg),
|
||||
_ => FlowyError::internal().context(error.msg),
|
||||
}
|
||||
}
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
use crate::code::ErrorCode;
|
||||
use user_model::errors::UserErrorCode;
|
||||
|
||||
impl std::convert::From<UserErrorCode> for ErrorCode {
|
||||
fn from(code: UserErrorCode) -> Self {
|
||||
match code {
|
||||
UserErrorCode::Internal => ErrorCode::Internal,
|
||||
UserErrorCode::WorkspaceIdInvalid => ErrorCode::WorkspaceIdInvalid,
|
||||
UserErrorCode::EmailIsEmpty => ErrorCode::EmailIsEmpty,
|
||||
UserErrorCode::EmailFormatInvalid => ErrorCode::EmailFormatInvalid,
|
||||
UserErrorCode::UserIdInvalid => ErrorCode::UserIdInvalid,
|
||||
UserErrorCode::UserNameContainForbiddenCharacters => {
|
||||
ErrorCode::UserNameContainForbiddenCharacters
|
||||
},
|
||||
UserErrorCode::UserNameIsEmpty => ErrorCode::UserNameIsEmpty,
|
||||
UserErrorCode::UserNotExist => ErrorCode::UserNotExist,
|
||||
UserErrorCode::PasswordIsEmpty => ErrorCode::PasswordIsEmpty,
|
||||
UserErrorCode::PasswordTooLong => ErrorCode::PasswordTooLong,
|
||||
UserErrorCode::PasswordContainsForbidCharacters => {
|
||||
ErrorCode::PasswordContainsForbidCharacters
|
||||
},
|
||||
UserErrorCode::PasswordFormatInvalid => ErrorCode::PasswordFormatInvalid,
|
||||
UserErrorCode::PasswordNotMatch => ErrorCode::PasswordNotMatch,
|
||||
UserErrorCode::UserNameTooLong => ErrorCode::UserNameTooLong,
|
||||
}
|
||||
}
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
use crate::FlowyError;
|
||||
use flowy_client_ws::WSErrorCode;
|
||||
|
||||
impl std::convert::From<WSErrorCode> for FlowyError {
|
||||
fn from(code: WSErrorCode) -> Self {
|
||||
match code {
|
||||
WSErrorCode::Internal => FlowyError::internal().context(code),
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user