mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
feat: folder web (#4580)
* chore: folder wasm * chore: folder wasm * chore: resolve deps * chore: fix trait * chore: try localset * chore: fix * chore: fix * chore: fix * chore: async init sdk * chore: fix test * chore: fix test
This commit is contained in:
@ -76,7 +76,7 @@ pub fn dart_gen(crate_name: &str) {
|
||||
}
|
||||
|
||||
#[allow(unused_variables)]
|
||||
pub fn ts_gen(crate_name: &str, project: Project) {
|
||||
pub fn ts_gen(crate_name: &str, dest_folder_name: &str, project: Project) {
|
||||
// 1. generate the proto files to proto_file_dir
|
||||
#[cfg(feature = "proto_gen")]
|
||||
let proto_crates = gen_proto_files(crate_name);
|
||||
@ -116,7 +116,7 @@ pub fn ts_gen(crate_name: &str, project: Project) {
|
||||
// 2. generate the protobuf files(Dart)
|
||||
#[cfg(feature = "ts")]
|
||||
generate_ts_protobuf_files(
|
||||
crate_name,
|
||||
dest_folder_name,
|
||||
&proto_file_output_path,
|
||||
&proto_file_paths,
|
||||
&file_names,
|
||||
|
@ -13,7 +13,7 @@ use std::path::PathBuf;
|
||||
use syn::Item;
|
||||
use walkdir::WalkDir;
|
||||
|
||||
pub fn gen(crate_name: &str, project: Project) {
|
||||
pub fn gen(dest_folder_name: &str, project: Project) {
|
||||
let root = project.event_root();
|
||||
let backend_service_path = project.dst();
|
||||
|
||||
@ -40,7 +40,7 @@ pub fn gen(crate_name: &str, project: Project) {
|
||||
}
|
||||
render_result.push_str(TS_FOOTER);
|
||||
|
||||
let ts_event_folder: PathBuf = [&root, &backend_service_path, "events", crate_name]
|
||||
let ts_event_folder: PathBuf = [&root, &backend_service_path, "events", dest_folder_name]
|
||||
.iter()
|
||||
.collect();
|
||||
if !ts_event_folder.as_path().exists() {
|
||||
@ -82,7 +82,10 @@ pub fn gen(crate_name: &str, project: Project) {
|
||||
Ok(ref mut file) => {
|
||||
let mut export = String::new();
|
||||
export.push_str("// Auto-generated, do not edit \n");
|
||||
export.push_str(&format!("export * from '../../models/{}';\n", crate_name));
|
||||
export.push_str(&format!(
|
||||
"export * from '../../models/{}';\n",
|
||||
dest_folder_name
|
||||
));
|
||||
export.push_str(&format!("export * from './{}';\n", event_file));
|
||||
file.write_all(export.as_bytes()).unwrap();
|
||||
File::flush(file).unwrap();
|
||||
|
Reference in New Issue
Block a user