feat: initialize Tauri application with Preact framework
- Added main application logic in `src-tauri/src/lib.rs` and `src-tauri/src/main.rs`. - Configured Tauri settings in `tauri.conf.json`. - Created basic styling in `src/App.css`. - Implemented main application component in `src/App.tsx` with greeting functionality. - Included Preact logo in `src/assets/preact.svg`. - Set up rendering in `src/main.tsx`. - Defined TypeScript environment in `vite-env.d.ts` and configured TypeScript settings in `tsconfig.json` and `tsconfig.node.json`. - Configured Vite for Tauri development in `vite.config.ts`.
This commit is contained in:
1 parent
08e154894a
commit
a2a512d41d
9 files changed
+146
-1
No files matched your search
@@ -20,7 +20,10 @@ tauri-build = { version = "2", features = [] }
|
||||
[dependencies]
|
||||
tauri = { version = "2", features = [] }
|
||||
tauri-plugin-opener = "2"
|
||||
<<<<<<< HEAD
|
||||
tauri-plugin-shell = "2"
|
||||
=======
|
||||
>>>>>>> ce33464 (feat: initialize Tauri application with Preact framework)
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
{
|
||||
"$schema": "../gen/schemas/desktop-schema.json",
|
||||
<<<<<<< HEAD
|
||||
"identifier": "main-capability",
|
||||
=======
|
||||
"identifier": "default",
|
||||
>>>>>>> ce33464 (feat: initialize Tauri application with Preact framework)
|
||||
"description": "Capability for the main window",
|
||||
"windows": ["main"],
|
||||
"permissions": [
|
||||
"core:default",
|
||||
<<<<<<< HEAD
|
||||
"opener:default",
|
||||
{
|
||||
"identifier": "shell:allow-execute",
|
||||
@@ -15,5 +20,8 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
=======
|
||||
"opener:default"
|
||||
>>>>>>> ce33464 (feat: initialize Tauri application with Preact framework)
|
||||
]
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
// Learn more about Tauri commands at https://tauri.app/develop/calling-rust/
|
||||
<<<<<<< HEAD
|
||||
use tauri_plugin_shell::ShellExt;
|
||||
use tauri_plugin_shell::process::CommandEvent;
|
||||
use std::sync::{Arc, Mutex};
|
||||
@@ -7,6 +8,8 @@ struct AppState {
|
||||
child_process: Arc<Mutex<Option<tauri_plugin_shell::process::CommandChild>>>,
|
||||
}
|
||||
|
||||
=======
|
||||
>>>>>>> ce33464 (feat: initialize Tauri application with Preact framework)
|
||||
#[tauri::command]
|
||||
fn greet(name: &str) -> String {
|
||||
format!("Hello, {}! You've been greeted from Rust!", name)
|
||||
@@ -14,6 +17,7 @@ fn greet(name: &str) -> String {
|
||||
|
||||
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||
pub fn run() {
|
||||
<<<<<<< HEAD
|
||||
let child_process = Arc::new(Mutex::new(Option::<tauri_plugin_shell::process::CommandChild>::None));
|
||||
let child_process_clone = Arc::clone(&child_process);
|
||||
|
||||
@@ -66,6 +70,11 @@ pub fn run() {
|
||||
println!("[System]: Encerrando Backend...");
|
||||
}
|
||||
})
|
||||
=======
|
||||
tauri::Builder::default()
|
||||
.plugin(tauri_plugin_opener::init())
|
||||
.invoke_handler(tauri::generate_handler![greet])
|
||||
>>>>>>> ce33464 (feat: initialize Tauri application with Preact framework)
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running tauri application");
|
||||
}
|
||||
@@ -2,19 +2,43 @@
|
||||
"$schema": "https://schema.tauri.app/config/2",
|
||||
"productName": "localaiapp",
|
||||
"version": "0.1.0",
|
||||
<<<<<<< HEAD
|
||||
"identifier": "com.evandrodevbr.app",
|
||||
"build": {
|
||||
"beforeDevCommand": "pnpm predev && pnpm dev",
|
||||
=======
|
||||
"identifier": "evandrodevbr",
|
||||
"build": {
|
||||
"beforeDevCommand": "pnpm dev",
|
||||
>>>>>>> ce33464 (feat: initialize Tauri application with Preact framework)
|
||||
"devUrl": "http://localhost:1420",
|
||||
"beforeBuildCommand": "pnpm build",
|
||||
"frontendDist": "../dist"
|
||||
},
|
||||
<<<<<<< HEAD
|
||||
"bundle": {
|
||||
"active": true,
|
||||
"targets": "all",
|
||||
"externalBin": [
|
||||
"binaries/engine-backend"
|
||||
],
|
||||
=======
|
||||
"app": {
|
||||
"windows": [
|
||||
{
|
||||
"title": "localaiapp",
|
||||
"width": 800,
|
||||
"height": 600
|
||||
}
|
||||
],
|
||||
"security": {
|
||||
"csp": null
|
||||
}
|
||||
},
|
||||
"bundle": {
|
||||
"active": true,
|
||||
"targets": "all",
|
||||
>>>>>>> ce33464 (feat: initialize Tauri application with Preact framework)
|
||||
"icon": [
|
||||
"icons/32x32.png",
|
||||
"icons/128x128.png",
|
||||
@@ -22,6 +46,7 @@
|
||||
"icons/icon.icns",
|
||||
"icons/icon.ico"
|
||||
]
|
||||
<<<<<<< HEAD
|
||||
},
|
||||
"app": {
|
||||
"windows": [
|
||||
@@ -34,5 +59,7 @@
|
||||
"security": {
|
||||
"csp": null
|
||||
}
|
||||
=======
|
||||
>>>>>>> ce33464 (feat: initialize Tauri application with Preact framework)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user