mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
[rust]: rename some flowy-xx to lib-xx
This commit is contained in:
parent
91c9f2c62f
commit
c64ef55d60
@ -63,7 +63,7 @@ async-stream = "0.3.2"
|
||||
flowy-user-infra = { path = "../rust-lib/flowy-user-infra" }
|
||||
flowy-workspace-infra = { path = "../rust-lib/flowy-workspace-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-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-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-infra = { path = "../rust-lib/lib-infra" }
|
||||
flowy-ot = { path = "../rust-lib/lib-ot" }
|
||||
|
@ -1,6 +1,6 @@
|
||||
[workspace]
|
||||
members = [
|
||||
"flowy-dispatch",
|
||||
"lib-dispatch",
|
||||
"flowy-sdk",
|
||||
"dart-ffi",
|
||||
"flowy-log",
|
||||
@ -14,12 +14,12 @@ members = [
|
||||
"lib-infra",
|
||||
"flowy-workspace",
|
||||
"flowy-workspace-infra",
|
||||
"flowy-dart-notify",
|
||||
"dart-notify",
|
||||
"flowy-document",
|
||||
"flowy-document-infra",
|
||||
"lib-ot",
|
||||
"flowy-net",
|
||||
"flowy-ws",
|
||||
"lib-ws",
|
||||
"flowy-backend-api",
|
||||
]
|
||||
|
||||
|
@ -24,10 +24,10 @@ serde_json = {version = "1.0"}
|
||||
bytes = { version = "1.0" }
|
||||
parking_lot = "0.11"
|
||||
|
||||
flowy-dispatch = {path = "../flowy-dispatch"}
|
||||
flowy-dispatch = {path = "../lib-dispatch" }
|
||||
flowy-sdk = {path = "../flowy-sdk"}
|
||||
flowy-derive = {path = "../flowy-derive"}
|
||||
flowy-dart-notify = {path = "../flowy-dart-notify" }
|
||||
flowy-dart-notify = {path = "../dart-notify" }
|
||||
flowy-net = {path = "../flowy-net"}
|
||||
|
||||
|
||||
|
@ -13,7 +13,7 @@ log = "0.4.14"
|
||||
bytes = { version = "1.0" }
|
||||
|
||||
flowy-derive = {path = "../flowy-derive"}
|
||||
flowy-dispatch = {path = "../flowy-dispatch"}
|
||||
flowy-dispatch = {path = "../lib-dispatch" }
|
||||
|
||||
[features]
|
||||
dart = []
|
@ -5,3 +5,4 @@ pub mod history;
|
||||
mod view;
|
||||
|
||||
pub use document::*;
|
||||
pub use view::RECORD_THRESHOLD;
|
||||
|
@ -9,13 +9,13 @@ edition = "2018"
|
||||
[dependencies]
|
||||
flowy-document-infra = { path = "../flowy-document-infra" }
|
||||
derive_more = {version = "0.99", features = ["display"]}
|
||||
flowy-dispatch = { path = "../flowy-dispatch" }
|
||||
flowy-dispatch = { path = "../lib-dispatch" }
|
||||
flowy-derive = { path = "../flowy-derive" }
|
||||
flowy-database = { path = "../flowy-database" }
|
||||
flowy-infra = { path = "../lib-infra" }
|
||||
flowy-dart-notify = { path = "../flowy-dart-notify" }
|
||||
flowy-dart-notify = { path = "../dart-notify" }
|
||||
flowy-ot = { path = "../lib-ot" }
|
||||
flowy-ws = { path = "../flowy-ws" }
|
||||
flowy-ws = { path = "../lib-ws" }
|
||||
flowy-net = { path = "../flowy-net", features = ["flowy_request"] }
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#![cfg_attr(rustfmt, rustfmt::skip)]
|
||||
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 unicode_segmentation::UnicodeSegmentation;
|
||||
|
||||
|
@ -4,7 +4,7 @@ mod serde_test;
|
||||
mod undo_redo_test;
|
||||
|
||||
use derive_more::Display;
|
||||
use flowy_document::services::doc::{CustomDocument, Document};
|
||||
use flowy_document_infra::core::{CustomDocument, Document};
|
||||
use flowy_ot::core::*;
|
||||
use rand::{prelude::*, Rng as WrappedRng};
|
||||
use std::{sync::Once, time::Duration};
|
||||
@ -282,7 +282,14 @@ impl Rng {
|
||||
#[allow(dead_code)]
|
||||
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 {
|
||||
let mut delta = Delta::default();
|
||||
|
@ -1,5 +1,5 @@
|
||||
use crate::editor::{Rng, TestBuilder, TestOp::*};
|
||||
use flowy_document::services::doc::{FlowyDoc, PlainDoc};
|
||||
use flowy_document_infra::core::{FlowyDoc, PlainDoc};
|
||||
use flowy_ot::core::*;
|
||||
|
||||
#[test]
|
||||
@ -323,12 +323,11 @@ fn sequence() {
|
||||
|
||||
#[test]
|
||||
fn apply_1000() {
|
||||
for _ in 0..1000 {
|
||||
for _ in 0..1 {
|
||||
let mut rng = Rng::default();
|
||||
let s: FlowyStr = rng.gen_string(50).into();
|
||||
let delta = rng.gen_delta(&s);
|
||||
assert_eq!(s.count_utf16_code_units(), delta.base_len);
|
||||
assert_eq!(delta.apply(&s).unwrap().chars().count(), delta.target_len);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
use flowy_document::services::doc::{Document, PlainDoc};
|
||||
use flowy_document_infra::core::{Document, PlainDoc};
|
||||
use flowy_ot::core::*;
|
||||
|
||||
#[test]
|
||||
|
@ -1,5 +1,5 @@
|
||||
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};
|
||||
|
||||
#[test]
|
||||
|
@ -6,7 +6,7 @@ edition = "2018"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
flowy-dispatch = { path = "../flowy-dispatch"}
|
||||
flowy-dispatch = { path = "../lib-dispatch" }
|
||||
flowy-log = { path = "../flowy-log" }
|
||||
flowy-user = { path = "../flowy-user" }
|
||||
flowy-infra = { path = "../lib-infra" }
|
||||
@ -14,7 +14,7 @@ flowy-workspace = { path = "../flowy-workspace", default-features = false }
|
||||
flowy-database = { path = "../flowy-database" }
|
||||
flowy-document = { path = "../flowy-document" }
|
||||
flowy-document-infra = { path = "../flowy-document-infra" }
|
||||
flowy-ws = { path = "../flowy-ws" }
|
||||
flowy-ws = { path = "../lib-ws" }
|
||||
flowy-net = { path = "../flowy-net" }
|
||||
tracing = { version = "0.1" }
|
||||
log = "0.4.14"
|
||||
|
@ -49,11 +49,11 @@ fn crate_log_filter(level: Option<String>) -> String {
|
||||
filters.push(format!("flowy_workspace={}", level));
|
||||
filters.push(format!("flowy_user={}", level));
|
||||
filters.push(format!("flowy_document={}", level));
|
||||
filters.push(format!("flowy_dart_notify={}", level));
|
||||
filters.push(format!("flowy_ot={}", level));
|
||||
filters.push(format!("flowy_ws={}", level));
|
||||
filters.push(format!("flowy_ws={}", level));
|
||||
filters.push(format!("flowy_infra={}", level));
|
||||
filters.push(format!("flowy_document_infra={}", level));
|
||||
filters.push(format!("dart_notify={}", level));
|
||||
filters.push(format!("lib_ot={}", level));
|
||||
filters.push(format!("lib_ws={}", level));
|
||||
filters.push(format!("lib_infra={}", level));
|
||||
filters.join(",")
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,7 @@ edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
flowy-sdk = { path = "../flowy-sdk"}
|
||||
flowy-dispatch = { path = "../flowy-dispatch"}
|
||||
flowy-dispatch = { path = "../lib-dispatch" }
|
||||
flowy-user = { path = "../flowy-user"}
|
||||
flowy-workspace = { path = "../flowy-workspace", default-features = false}
|
||||
flowy-infra = { path = "../lib-infra" }
|
||||
|
@ -9,14 +9,14 @@ edition = "2018"
|
||||
flowy-user-infra = { path = "../flowy-user-infra" }
|
||||
flowy-backend-api = { path = "../flowy-backend-api" }
|
||||
derive_more = {version = "0.99", features = ["display"]}
|
||||
flowy-dispatch = { path = "../flowy-dispatch" }
|
||||
flowy-dispatch = { path = "../lib-dispatch" }
|
||||
flowy-derive = { path = "../flowy-derive" }
|
||||
flowy-database = { path = "../flowy-database" }
|
||||
flowy-sqlite = { path = "../lib-sqlite" }
|
||||
flowy-infra = { path = "../lib-infra" }
|
||||
flowy-net = { path = "../flowy-net", features = ["flowy_request"] }
|
||||
flowy-ws = { path = "../flowy-ws"}
|
||||
flowy-dart-notify = { path = "../flowy-dart-notify" }
|
||||
flowy-ws = { path = "../lib-ws" }
|
||||
flowy-dart-notify = { path = "../dart-notify" }
|
||||
|
||||
tracing = { version = "0.1", features = ["log"] }
|
||||
bytes = "1.0"
|
||||
|
@ -9,12 +9,12 @@ edition = "2018"
|
||||
flowy-workspace-infra = { path = "../flowy-workspace-infra" }
|
||||
flowy-document-infra = { path = "../flowy-document-infra" }
|
||||
flowy-document = { path = "../flowy-document" }
|
||||
flowy-dispatch = { path = "../flowy-dispatch" }
|
||||
flowy-dispatch = { path = "../lib-dispatch" }
|
||||
flowy-derive = { path = "../flowy-derive" }
|
||||
flowy-database = { path = "../flowy-database" }
|
||||
flowy-sqlite = { path = "../lib-sqlite" }
|
||||
flowy-infra = { path = "../lib-infra" }
|
||||
flowy-dart-notify = { path = "../flowy-dart-notify" }
|
||||
flowy-dart-notify = { path = "../dart-notify" }
|
||||
flowy-ot = { path = "../lib-ot" }
|
||||
flowy-net = { path = "../flowy-net", features = ["flowy_request"] }
|
||||
flowy-backend-api = { path = "../flowy-backend-api"}
|
||||
|
Loading…
Reference in New Issue
Block a user