diff --git a/.gitignore b/.gitignore index a57b449..ba4fec8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +<<<<<<< HEAD # DependĂȘncias node_modules/ .pnp @@ -51,6 +52,10 @@ models/ # Logs logs/ +======= +# Logs +logs +>>>>>>> ce33464 (feat: initialize Tauri application with Preact framework) *.log npm-debug.log* yarn-debug.log* @@ -58,6 +63,7 @@ yarn-error.log* pnpm-debug.log* lerna-debug.log* +<<<<<<< HEAD # IDEs e editores .vscode/ .idea/ @@ -97,3 +103,20 @@ src-tauri/WixTools/ *.temp *.bak *.backup +======= +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? +>>>>>>> ce33464 (feat: initialize Tauri application with Preact framework) diff --git a/package.json b/package.json index d392369..06aebcc 100644 --- a/package.json +++ b/package.json @@ -4,16 +4,20 @@ "version": "0.1.0", "type": "module", "scripts": { +<<<<<<< HEAD "dev:ui": "vite", "install:python-deps": "node scripts/install-python-deps.js", "compile:sidecar": "python compile_sidecar.py", "predev": "pnpm install:python-deps && pnpm compile:sidecar", +======= +>>>>>>> ce33464 (feat: initialize Tauri application with Preact framework) "dev": "vite", "build": "tsc && vite build", "preview": "vite preview", "tauri": "tauri" }, "dependencies": { +<<<<<<< HEAD "@emotion/react": "^11.14.0", "@emotion/styled": "^11.14.1", "@fontsource-variable/open-sans": "^5.2.7", @@ -36,5 +40,16 @@ "tailwindcss": "^4.1.18", "typescript": "~5.6.2", "vite": "^6.0.3" +======= + "preact": "^10.25.1", + "@tauri-apps/api": "^2", + "@tauri-apps/plugin-opener": "^2" + }, + "devDependencies": { + "@preact/preset-vite": "^2.9.3", + "typescript": "~5.6.2", + "vite": "^6.0.3", + "@tauri-apps/cli": "^2" +>>>>>>> ce33464 (feat: initialize Tauri application with Preact framework) } } diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index ebf92cb..e81e0b9 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -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" diff --git a/src-tauri/capabilities/default.json b/src-tauri/capabilities/default.json index 1ca2fb1..2cbe6b1 100644 --- a/src-tauri/capabilities/default.json +++ b/src-tauri/capabilities/default.json @@ -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) ] } diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 0b84de9..ab04973 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -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>>, } +======= +>>>>>>> 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::::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"); } diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 4aee070..27a177a 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -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) } } diff --git a/src/App.css b/src/App.css index 395c6bf..4de03f3 100644 --- a/src/App.css +++ b/src/App.css @@ -1,5 +1,8 @@ +<<<<<<< HEAD @import "tailwindcss"; +======= +>>>>>>> ce33464 (feat: initialize Tauri application with Preact framework) .logo.vite:hover { filter: drop-shadow(0 0 2em #747bff); } diff --git a/src/App.tsx b/src/App.tsx index 3c19ef6..63a1150 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,3 +1,4 @@ +<<<<<<< HEAD import "@fontsource/inter"; import React, { useState, useEffect } from "react"; import { @@ -293,4 +294,57 @@ export default function App() { /> ); -} \ No newline at end of file +} +======= +import { useState } from "preact/hooks"; +import preactLogo from "./assets/preact.svg"; +import { invoke } from "@tauri-apps/api/core"; +import "./App.css"; + +function App() { + const [greetMsg, setGreetMsg] = useState(""); + const [name, setName] = useState(""); + + async function greet() { + // Learn more about Tauri commands at https://tauri.app/develop/calling-rust/ + setGreetMsg(await invoke("greet", { name })); + } + + return ( +
+

Welcome to Tauri + Preact

+ + +

Click on the Tauri, Vite, and Preact logos to learn more.

+ +
{ + e.preventDefault(); + greet(); + }} + > + setName(e.currentTarget.value)} + placeholder="Enter a name..." + /> + +
+

{greetMsg}

+
+ ); +} + +export default App; +>>>>>>> ce33464 (feat: initialize Tauri application with Preact framework) diff --git a/src/main.tsx b/src/main.tsx index ace9fae..9d0b7e3 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -1,5 +1,8 @@ import { render } from "preact"; +<<<<<<< HEAD import "./App.css"; +======= +>>>>>>> ce33464 (feat: initialize Tauri application with Preact framework) import App from "./App"; render(, document.getElementById("root")!);