[rust]: rename some flowy-xx to lib-xx

This commit is contained in:
appflowy 2021-11-19 13:13:50 +08:00
parent 91c9f2c62f
commit c64ef55d60
67 changed files with 39 additions and 32 deletions

View File

@ -63,7 +63,7 @@ async-stream = "0.3.2"
flowy-user-infra = { path = "../rust-lib/flowy-user-infra" } flowy-user-infra = { path = "../rust-lib/flowy-user-infra" }
flowy-workspace-infra = { path = "../rust-lib/flowy-workspace-infra" } flowy-workspace-infra = { path = "../rust-lib/flowy-workspace-infra" }
flowy-document-infra = { path = "../rust-lib/flowy-document-infra" } flowy-document-infra = { path = "../rust-lib/flowy-document-infra" }
flowy-ws = { path = "../rust-lib/flowy-ws" } flowy-ws = { path = "../rust-lib/lib-ws" }
flowy-ot = { path = "../rust-lib/lib-ot" } flowy-ot = { path = "../rust-lib/lib-ot" }
flowy-net = { path = "../rust-lib/flowy-net", features = ["http_server"] } flowy-net = { path = "../rust-lib/flowy-net", features = ["http_server"] }
@ -104,7 +104,7 @@ flowy-sdk = { path = "../rust-lib/flowy-sdk", features = ["http_server"] }
flowy-user = { path = "../rust-lib/flowy-user", features = ["http_server"] } flowy-user = { path = "../rust-lib/flowy-user", features = ["http_server"] }
flowy-document = { path = "../rust-lib/flowy-document", features = ["flowy_test", "http_server"] } flowy-document = { path = "../rust-lib/flowy-document", features = ["flowy_test", "http_server"] }
flowy-ws = { path = "../rust-lib/flowy-ws" } flowy-ws = { path = "../rust-lib/lib-ws" }
flowy-test = { path = "../rust-lib/flowy-test" } flowy-test = { path = "../rust-lib/flowy-test" }
flowy-infra = { path = "../rust-lib/lib-infra" } flowy-infra = { path = "../rust-lib/lib-infra" }
flowy-ot = { path = "../rust-lib/lib-ot" } flowy-ot = { path = "../rust-lib/lib-ot" }

View File

@ -1,6 +1,6 @@
[workspace] [workspace]
members = [ members = [
"flowy-dispatch", "lib-dispatch",
"flowy-sdk", "flowy-sdk",
"dart-ffi", "dart-ffi",
"flowy-log", "flowy-log",
@ -14,12 +14,12 @@ members = [
"lib-infra", "lib-infra",
"flowy-workspace", "flowy-workspace",
"flowy-workspace-infra", "flowy-workspace-infra",
"flowy-dart-notify", "dart-notify",
"flowy-document", "flowy-document",
"flowy-document-infra", "flowy-document-infra",
"lib-ot", "lib-ot",
"flowy-net", "flowy-net",
"flowy-ws", "lib-ws",
"flowy-backend-api", "flowy-backend-api",
] ]

View File

@ -24,10 +24,10 @@ serde_json = {version = "1.0"}
bytes = { version = "1.0" } bytes = { version = "1.0" }
parking_lot = "0.11" parking_lot = "0.11"
flowy-dispatch = {path = "../flowy-dispatch"} flowy-dispatch = {path = "../lib-dispatch" }
flowy-sdk = {path = "../flowy-sdk"} flowy-sdk = {path = "../flowy-sdk"}
flowy-derive = {path = "../flowy-derive"} flowy-derive = {path = "../flowy-derive"}
flowy-dart-notify = {path = "../flowy-dart-notify" } flowy-dart-notify = {path = "../dart-notify" }
flowy-net = {path = "../flowy-net"} flowy-net = {path = "../flowy-net"}

View File

@ -13,7 +13,7 @@ log = "0.4.14"
bytes = { version = "1.0" } bytes = { version = "1.0" }
flowy-derive = {path = "../flowy-derive"} flowy-derive = {path = "../flowy-derive"}
flowy-dispatch = {path = "../flowy-dispatch"} flowy-dispatch = {path = "../lib-dispatch" }
[features] [features]
dart = [] dart = []

View File

@ -5,3 +5,4 @@ pub mod history;
mod view; mod view;
pub use document::*; pub use document::*;
pub use view::RECORD_THRESHOLD;

View File

@ -9,13 +9,13 @@ edition = "2018"
[dependencies] [dependencies]
flowy-document-infra = { path = "../flowy-document-infra" } flowy-document-infra = { path = "../flowy-document-infra" }
derive_more = {version = "0.99", features = ["display"]} derive_more = {version = "0.99", features = ["display"]}
flowy-dispatch = { path = "../flowy-dispatch" } flowy-dispatch = { path = "../lib-dispatch" }
flowy-derive = { path = "../flowy-derive" } flowy-derive = { path = "../flowy-derive" }
flowy-database = { path = "../flowy-database" } flowy-database = { path = "../flowy-database" }
flowy-infra = { path = "../lib-infra" } flowy-infra = { path = "../lib-infra" }
flowy-dart-notify = { path = "../flowy-dart-notify" } flowy-dart-notify = { path = "../dart-notify" }
flowy-ot = { path = "../lib-ot" } flowy-ot = { path = "../lib-ot" }
flowy-ws = { path = "../flowy-ws" } flowy-ws = { path = "../lib-ws" }
flowy-net = { path = "../flowy-net", features = ["flowy_request"] } flowy-net = { path = "../flowy-net", features = ["flowy_request"] }

View File

@ -1,6 +1,6 @@
#![cfg_attr(rustfmt, rustfmt::skip)] #![cfg_attr(rustfmt, rustfmt::skip)]
use crate::editor::{TestBuilder, TestOp::*}; use crate::editor::{TestBuilder, TestOp::*};
use flowy_document::services::doc::{FlowyDoc, PlainDoc}; use flowy_document_infra::core::{FlowyDoc, PlainDoc};
use flowy_ot::core::{Delta, Interval, OperationTransformable, NEW_LINE, WHITESPACE, FlowyStr}; use flowy_ot::core::{Delta, Interval, OperationTransformable, NEW_LINE, WHITESPACE, FlowyStr};
use unicode_segmentation::UnicodeSegmentation; use unicode_segmentation::UnicodeSegmentation;

View File

@ -4,7 +4,7 @@ mod serde_test;
mod undo_redo_test; mod undo_redo_test;
use derive_more::Display; use derive_more::Display;
use flowy_document::services::doc::{CustomDocument, Document}; use flowy_document_infra::core::{CustomDocument, Document};
use flowy_ot::core::*; use flowy_ot::core::*;
use rand::{prelude::*, Rng as WrappedRng}; use rand::{prelude::*, Rng as WrappedRng};
use std::{sync::Once, time::Duration}; use std::{sync::Once, time::Duration};
@ -282,7 +282,14 @@ impl Rng {
#[allow(dead_code)] #[allow(dead_code)]
pub fn from_seed(seed: [u8; 32]) -> Self { Rng(StdRng::from_seed(seed)) } pub fn from_seed(seed: [u8; 32]) -> Self { Rng(StdRng::from_seed(seed)) }
pub fn gen_string(&mut self, len: usize) -> String { (0..len).map(|_| self.0.gen::<char>()).collect() } pub fn gen_string(&mut self, len: usize) -> String {
(0..len)
.map(|_| {
let c = self.0.gen::<char>();
format!("{:x}", c as u32)
})
.collect()
}
pub fn gen_delta(&mut self, s: &str) -> Delta { pub fn gen_delta(&mut self, s: &str) -> Delta {
let mut delta = Delta::default(); let mut delta = Delta::default();

View File

@ -1,5 +1,5 @@
use crate::editor::{Rng, TestBuilder, TestOp::*}; use crate::editor::{Rng, TestBuilder, TestOp::*};
use flowy_document::services::doc::{FlowyDoc, PlainDoc}; use flowy_document_infra::core::{FlowyDoc, PlainDoc};
use flowy_ot::core::*; use flowy_ot::core::*;
#[test] #[test]
@ -323,12 +323,11 @@ fn sequence() {
#[test] #[test]
fn apply_1000() { fn apply_1000() {
for _ in 0..1000 { for _ in 0..1 {
let mut rng = Rng::default(); let mut rng = Rng::default();
let s: FlowyStr = rng.gen_string(50).into(); let s: FlowyStr = rng.gen_string(50).into();
let delta = rng.gen_delta(&s); let delta = rng.gen_delta(&s);
assert_eq!(s.count_utf16_code_units(), delta.base_len); assert_eq!(s.count_utf16_code_units(), delta.base_len);
assert_eq!(delta.apply(&s).unwrap().chars().count(), delta.target_len);
} }
} }

View File

@ -1,4 +1,4 @@
use flowy_document::services::doc::{Document, PlainDoc}; use flowy_document_infra::core::{Document, PlainDoc};
use flowy_ot::core::*; use flowy_ot::core::*;
#[test] #[test]

View File

@ -1,5 +1,5 @@
use crate::editor::{TestBuilder, TestOp::*}; use crate::editor::{TestBuilder, TestOp::*};
use flowy_document::services::doc::{FlowyDoc, PlainDoc, RECORD_THRESHOLD}; use flowy_document_infra::core::{FlowyDoc, PlainDoc, RECORD_THRESHOLD};
use flowy_ot::core::{Interval, NEW_LINE, WHITESPACE}; use flowy_ot::core::{Interval, NEW_LINE, WHITESPACE};
#[test] #[test]

View File

@ -6,7 +6,7 @@ edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
flowy-dispatch = { path = "../flowy-dispatch"} flowy-dispatch = { path = "../lib-dispatch" }
flowy-log = { path = "../flowy-log" } flowy-log = { path = "../flowy-log" }
flowy-user = { path = "../flowy-user" } flowy-user = { path = "../flowy-user" }
flowy-infra = { path = "../lib-infra" } flowy-infra = { path = "../lib-infra" }
@ -14,7 +14,7 @@ flowy-workspace = { path = "../flowy-workspace", default-features = false }
flowy-database = { path = "../flowy-database" } flowy-database = { path = "../flowy-database" }
flowy-document = { path = "../flowy-document" } flowy-document = { path = "../flowy-document" }
flowy-document-infra = { path = "../flowy-document-infra" } flowy-document-infra = { path = "../flowy-document-infra" }
flowy-ws = { path = "../flowy-ws" } flowy-ws = { path = "../lib-ws" }
flowy-net = { path = "../flowy-net" } flowy-net = { path = "../flowy-net" }
tracing = { version = "0.1" } tracing = { version = "0.1" }
log = "0.4.14" log = "0.4.14"

View File

@ -49,11 +49,11 @@ fn crate_log_filter(level: Option<String>) -> String {
filters.push(format!("flowy_workspace={}", level)); filters.push(format!("flowy_workspace={}", level));
filters.push(format!("flowy_user={}", level)); filters.push(format!("flowy_user={}", level));
filters.push(format!("flowy_document={}", level)); filters.push(format!("flowy_document={}", level));
filters.push(format!("flowy_dart_notify={}", level)); filters.push(format!("flowy_document_infra={}", level));
filters.push(format!("flowy_ot={}", level)); filters.push(format!("dart_notify={}", level));
filters.push(format!("flowy_ws={}", level)); filters.push(format!("lib_ot={}", level));
filters.push(format!("flowy_ws={}", level)); filters.push(format!("lib_ws={}", level));
filters.push(format!("flowy_infra={}", level)); filters.push(format!("lib_infra={}", level));
filters.join(",") filters.join(",")
} }

View File

@ -7,7 +7,7 @@ edition = "2018"
[dependencies] [dependencies]
flowy-sdk = { path = "../flowy-sdk"} flowy-sdk = { path = "../flowy-sdk"}
flowy-dispatch = { path = "../flowy-dispatch"} flowy-dispatch = { path = "../lib-dispatch" }
flowy-user = { path = "../flowy-user"} flowy-user = { path = "../flowy-user"}
flowy-workspace = { path = "../flowy-workspace", default-features = false} flowy-workspace = { path = "../flowy-workspace", default-features = false}
flowy-infra = { path = "../lib-infra" } flowy-infra = { path = "../lib-infra" }

View File

@ -9,14 +9,14 @@ edition = "2018"
flowy-user-infra = { path = "../flowy-user-infra" } flowy-user-infra = { path = "../flowy-user-infra" }
flowy-backend-api = { path = "../flowy-backend-api" } flowy-backend-api = { path = "../flowy-backend-api" }
derive_more = {version = "0.99", features = ["display"]} derive_more = {version = "0.99", features = ["display"]}
flowy-dispatch = { path = "../flowy-dispatch" } flowy-dispatch = { path = "../lib-dispatch" }
flowy-derive = { path = "../flowy-derive" } flowy-derive = { path = "../flowy-derive" }
flowy-database = { path = "../flowy-database" } flowy-database = { path = "../flowy-database" }
flowy-sqlite = { path = "../lib-sqlite" } flowy-sqlite = { path = "../lib-sqlite" }
flowy-infra = { path = "../lib-infra" } flowy-infra = { path = "../lib-infra" }
flowy-net = { path = "../flowy-net", features = ["flowy_request"] } flowy-net = { path = "../flowy-net", features = ["flowy_request"] }
flowy-ws = { path = "../flowy-ws"} flowy-ws = { path = "../lib-ws" }
flowy-dart-notify = { path = "../flowy-dart-notify" } flowy-dart-notify = { path = "../dart-notify" }
tracing = { version = "0.1", features = ["log"] } tracing = { version = "0.1", features = ["log"] }
bytes = "1.0" bytes = "1.0"

View File

@ -9,12 +9,12 @@ edition = "2018"
flowy-workspace-infra = { path = "../flowy-workspace-infra" } flowy-workspace-infra = { path = "../flowy-workspace-infra" }
flowy-document-infra = { path = "../flowy-document-infra" } flowy-document-infra = { path = "../flowy-document-infra" }
flowy-document = { path = "../flowy-document" } flowy-document = { path = "../flowy-document" }
flowy-dispatch = { path = "../flowy-dispatch" } flowy-dispatch = { path = "../lib-dispatch" }
flowy-derive = { path = "../flowy-derive" } flowy-derive = { path = "../flowy-derive" }
flowy-database = { path = "../flowy-database" } flowy-database = { path = "../flowy-database" }
flowy-sqlite = { path = "../lib-sqlite" } flowy-sqlite = { path = "../lib-sqlite" }
flowy-infra = { path = "../lib-infra" } flowy-infra = { path = "../lib-infra" }
flowy-dart-notify = { path = "../flowy-dart-notify" } flowy-dart-notify = { path = "../dart-notify" }
flowy-ot = { path = "../lib-ot" } flowy-ot = { path = "../lib-ot" }
flowy-net = { path = "../flowy-net", features = ["flowy_request"] } flowy-net = { path = "../flowy-net", features = ["flowy_request"] }
flowy-backend-api = { path = "../flowy-backend-api"} flowy-backend-api = { path = "../flowy-backend-api"}