chore: web and tauri project (#4996)

* chore: web and tauri project

fix: clippy

* fix: update version
This commit is contained in:
Kilu.He
2024-04-03 19:25:54 +08:00
committed by GitHub
parent 046e0bac36
commit c97ece5e81
197 changed files with 21085 additions and 16 deletions

View File

@ -22,6 +22,7 @@ pub struct ProtoCache {
pub enum Project {
Tauri,
TauriApp,
Web { relative_path: String },
Native,
}
@ -30,6 +31,9 @@ impl Project {
pub fn dst(&self) -> String {
match self {
Project::Tauri => "appflowy_tauri/src/services/backend".to_string(),
Project::TauriApp => {
"appflowy_web_app/src/application/services/tauri-services/backend".to_string()
},
Project::Web { .. } => "appflowy_web/src/services/backend".to_string(),
Project::Native => panic!("Native project is not supported yet."),
}
@ -37,7 +41,7 @@ impl Project {
pub fn event_root(&self) -> String {
match self {
Project::Tauri => "../../".to_string(),
Project::Tauri | Project::TauriApp => "../../".to_string(),
Project::Web { relative_path } => relative_path.to_string(),
Project::Native => panic!("Native project is not supported yet."),
}
@ -45,7 +49,7 @@ impl Project {
pub fn model_root(&self) -> String {
match self {
Project::Tauri => "../../".to_string(),
Project::Tauri | Project::TauriApp => "../../".to_string(),
Project::Web { relative_path } => relative_path.to_string(),
Project::Native => panic!("Native project is not supported yet."),
}
@ -53,7 +57,7 @@ impl Project {
pub fn event_imports(&self) -> String {
match self {
Project::Tauri => r#"
Project::TauriApp | Project::Tauri => r#"
/// Auto generate. Do not edit
import { Ok, Err, Result } from "ts-results";
import { invoke } from "@tauri-apps/api/tauri";