mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
Feat: add appflowy editor in backend (#1320)
* chore: remove update attributes * chore: format code * chore: extension for transaction * refactor: add document editor trait * chore: add appflowy_document editor * chore: add document serde * chore: add new document editor * chore: add tests * chore: add more test * chore: add test Co-authored-by: nathan <nathan@appflowy.io>
This commit is contained in:
@ -22,8 +22,7 @@ pub fn parse_protobuf_context_from(crate_paths: Vec<String>) -> Vec<ProtobufCrat
|
||||
let files = crate_info
|
||||
.proto_input_paths()
|
||||
.iter()
|
||||
.map(|proto_crate_path| parse_files_protobuf(proto_crate_path, &proto_output_path))
|
||||
.flatten()
|
||||
.flat_map(|proto_crate_path| parse_files_protobuf(proto_crate_path, &proto_output_path))
|
||||
.collect::<Vec<ProtoFile>>();
|
||||
|
||||
ProtobufCrateContext::from_crate_info(crate_info, files)
|
||||
|
@ -182,9 +182,9 @@ pub fn check_pb_dart_plugin() {
|
||||
));
|
||||
}
|
||||
|
||||
msg.push_str(&"✅ You can fix that by adding:".to_string());
|
||||
msg.push_str(&"\n\texport PATH=\"$PATH\":\"$HOME/.pub-cache/bin\"\n".to_string());
|
||||
msg.push_str(&"to your shell's config file.(.bashrc, .bash, .profile, .zshrc etc.)".to_string());
|
||||
msg.push_str("✅ You can fix that by adding:");
|
||||
msg.push_str("\n\texport PATH=\"$PATH\":\"$HOME/.pub-cache/bin\"\n");
|
||||
msg.push_str("to your shell's config file.(.bashrc, .bash, .profile, .zshrc etc.)");
|
||||
panic!("{}", msg)
|
||||
}
|
||||
}
|
||||
@ -198,13 +198,9 @@ fn gen_proto_files(crate_name: &str, crate_path: &str) -> Vec<ProtobufCrate> {
|
||||
.map(|info| info.protobuf_crate.clone())
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
crate_context
|
||||
.into_iter()
|
||||
.map(|info| info.files)
|
||||
.flatten()
|
||||
.for_each(|file| {
|
||||
println!("cargo:rerun-if-changed={}", file.file_path);
|
||||
});
|
||||
crate_context.into_iter().flat_map(|info| info.files).for_each(|file| {
|
||||
println!("cargo:rerun-if-changed={}", file.file_path);
|
||||
});
|
||||
|
||||
proto_crates
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ impl ProtoGenerator {
|
||||
fn write_proto_files(crate_contexts: &[ProtobufCrateContext]) {
|
||||
let file_path_content_map = crate_contexts
|
||||
.iter()
|
||||
.map(|ctx| {
|
||||
.flat_map(|ctx| {
|
||||
ctx.files
|
||||
.iter()
|
||||
.map(|file| {
|
||||
@ -66,7 +66,6 @@ fn write_proto_files(crate_contexts: &[ProtobufCrateContext]) {
|
||||
})
|
||||
.collect::<HashMap<String, ProtoFileSymbol>>()
|
||||
})
|
||||
.flatten()
|
||||
.collect::<HashMap<String, ProtoFileSymbol>>();
|
||||
|
||||
for context in crate_contexts {
|
||||
@ -152,12 +151,11 @@ impl ProtoCache {
|
||||
fn from_crate_contexts(crate_contexts: &[ProtobufCrateContext]) -> Self {
|
||||
let proto_files = crate_contexts
|
||||
.iter()
|
||||
.map(|crate_info| &crate_info.files)
|
||||
.flatten()
|
||||
.flat_map(|crate_info| &crate_info.files)
|
||||
.collect::<Vec<&ProtoFile>>();
|
||||
|
||||
let structs: Vec<String> = proto_files.iter().map(|info| info.structs.clone()).flatten().collect();
|
||||
let enums: Vec<String> = proto_files.iter().map(|info| info.enums.clone()).flatten().collect();
|
||||
let structs: Vec<String> = proto_files.iter().flat_map(|info| info.structs.clone()).collect();
|
||||
let enums: Vec<String> = proto_files.iter().flat_map(|info| info.enums.clone()).collect();
|
||||
Self { structs, enums }
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user