Compare commits

..

6 Commits

Author SHA1 Message Date
0f48f3fb44 chore: Run cargo clippy && cargo fmt
Signed-off-by: quexeky <git@quexeky.dev>
2025-10-12 20:13:26 +11:00
974666efe2 refactor: Finish refactor
Signed-off-by: quexeky <git@quexeky.dev>
2025-10-12 19:17:40 +11:00
9e1bf9852f refactor: Builds, but some logic still left to move back
Signed-off-by: quexeky <git@quexeky.dev>
2025-10-12 18:33:43 +11:00
5d22b883d5 refactor: Improvements to src-tauri
Signed-off-by: quexeky <git@quexeky.dev>
2025-10-12 17:04:27 +11:00
62a2561539 fix: Remote tauri dependency from process
Signed-off-by: quexeky <git@quexeky.dev>
2025-10-11 09:51:04 +11:00
59f040bc8b chore: Major refactoring
Still needs a massive go-over because there shouldn't be anything referencing tauri in any of the workspaces except the original one. Process manager has been refactored as an example

Signed-off-by: quexeky <git@quexeky.dev>
2025-10-11 09:28:41 +11:00
83 changed files with 9210 additions and 1412 deletions

8290
Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

14
Cargo.toml Normal file
View File

@ -0,0 +1,14 @@
[workspace]
members = [
"client",
"database",
"src-tauri",
"process",
"remote",
"utils",
"cloud_saves",
"download_manager",
"games",
]
resolver = "3"

View File

@ -27,7 +27,7 @@ impl BackupManager<'_> {
current_platform: Platform::Windows, current_platform: Platform::Windows,
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]
current_platform: Platform::macOS, current_platform: Platform::MacOs,
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
current_platform: Platform::Linux, current_platform: Platform::Linux,
@ -43,7 +43,7 @@ impl BackupManager<'_> {
&LinuxBackupManager {} as &(dyn BackupHandler + Sync + Send), &LinuxBackupManager {} as &(dyn BackupHandler + Sync + Send),
), ),
( (
(Platform::macOS, Platform::macOS), (Platform::MacOs, Platform::MacOs),
&MacBackupManager {} as &(dyn BackupHandler + Sync + Send), &MacBackupManager {} as &(dyn BackupHandler + Sync + Send),
), ),
]), ]),

View File

@ -4,20 +4,20 @@ use serde::{Deserialize, Serialize};
pub enum Platform { pub enum Platform {
Windows, Windows,
Linux, Linux,
macOS, MacOs,
} }
impl Platform { impl Platform {
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]
pub const HOST: Platform = Self::Windows; pub const HOST: Platform = Self::Windows;
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]
pub const HOST: Platform = Self::macOS; pub const HOST: Platform = Self::MacOs;
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
pub const HOST: Platform = Self::Linux; pub const HOST: Platform = Self::Linux;
pub fn is_case_sensitive(&self) -> bool { pub fn is_case_sensitive(&self) -> bool {
match self { match self {
Self::Windows | Self::macOS => false, Self::Windows | Self::MacOs => false,
Self::Linux => true, Self::Linux => true,
} }
} }
@ -28,7 +28,7 @@ impl From<&str> for Platform {
match value.to_lowercase().trim() { match value.to_lowercase().trim() {
"windows" => Self::Windows, "windows" => Self::Windows,
"linux" => Self::Linux, "linux" => Self::Linux,
"mac" | "macos" => Self::macOS, "mac" | "macos" => Self::MacOs,
_ => unimplemented!(), _ => unimplemented!(),
} }
} }
@ -39,7 +39,7 @@ impl From<whoami::Platform> for Platform {
match value { match value {
whoami::Platform::Windows => Platform::Windows, whoami::Platform::Windows => Platform::Windows,
whoami::Platform::Linux => Platform::Linux, whoami::Platform::Linux => Platform::Linux,
whoami::Platform::MacOS => Platform::macOS, whoami::Platform::MacOS => Platform::MacOs,
platform => unimplemented!("Playform {} is not supported", platform), platform => unimplemented!("Playform {} is not supported", platform),
} }
} }

View File

@ -116,7 +116,7 @@ platformInfo.value = currentPlatform;
async function openDataDir() { async function openDataDir() {
if (!dataDir.value) return; if (!dataDir.value) return;
try { try {
await invoke("open_fs", { path: dataDir.value }); await open(dataDir.value);
} catch (error) { } catch (error) {
console.error("Failed to open data dir:", error); console.error("Failed to open data dir:", error);
} }
@ -126,7 +126,7 @@ async function openLogFile() {
if (!dataDir.value) return; if (!dataDir.value) return;
try { try {
const logPath = `${dataDir.value}/drop.log`; const logPath = `${dataDir.value}/drop.log`;
await invoke("open_fs", { path: logPath }); await open(logPath);
} catch (error) { } catch (error) {
console.error("Failed to open log file:", error); console.error("Failed to open log file:", error);
} }

View File

@ -9,8 +9,8 @@
"dependencies": { "dependencies": {
"@tauri-apps/api": "^2.7.0", "@tauri-apps/api": "^2.7.0",
"@tauri-apps/plugin-deep-link": "^2.4.1", "@tauri-apps/plugin-deep-link": "^2.4.1",
"@tauri-apps/plugin-dialog": "^2.4.0", "@tauri-apps/plugin-dialog": "^2.3.2",
"@tauri-apps/plugin-opener": "^2.5.0", "@tauri-apps/plugin-opener": "^2.4.0",
"@tauri-apps/plugin-os": "^2.3.0", "@tauri-apps/plugin-os": "^2.3.0",
"@tauri-apps/plugin-shell": "^2.3.0", "@tauri-apps/plugin-shell": "^2.3.0",
"pino": "^9.7.0", "pino": "^9.7.0",

View File

@ -54,7 +54,7 @@ impl ProcessManager<'_> {
current_platform: Platform::Windows, current_platform: Platform::Windows,
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]
current_platform: Platform::macOS, current_platform: Platform::MacOs,
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
current_platform: Platform::Linux, current_platform: Platform::Linux,
@ -72,7 +72,7 @@ impl ProcessManager<'_> {
&NativeGameLauncher {} as &(dyn ProcessHandler + Sync + Send + 'static), &NativeGameLauncher {} as &(dyn ProcessHandler + Sync + Send + 'static),
), ),
( (
(Platform::macOS, Platform::macOS), (Platform::MacOs, Platform::MacOs),
&NativeGameLauncher {} as &(dyn ProcessHandler + Sync + Send + 'static), &NativeGameLauncher {} as &(dyn ProcessHandler + Sync + Send + 'static),
), ),
( (

2254
src-tauri/Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -80,13 +80,13 @@ bytes = "1.10.1"
# Workspaces # Workspaces
client = { version = "0.1.0", path = "./client" } client = { version = "0.1.0", path = "../client" }
database = { path = "./database" } database = { path = "../database" }
process = { path = "./process" } process = { path = "../process" }
remote = { version = "0.1.0", path = "./remote" } remote = { version = "0.1.0", path = "../remote" }
utils = { path = "./utils" } utils = { path = "../utils" }
games = { version = "0.1.0", path = "./games" } games = { version = "0.1.0", path = "../games" }
download_manager = { version = "0.1.0", path = "./download_manager" } download_manager = { version = "0.1.0", path = "../download_manager" }
[dependencies.dynfmt] [dependencies.dynfmt]
version = "0.1.5" version = "0.1.5"
@ -137,18 +137,3 @@ features = ["derive", "rc"]
lto = true lto = true
codegen-units = 1 codegen-units = 1
panic = 'abort' panic = 'abort'
[workspace]
members = [
"client",
"database",
"process",
"remote",
"utils",
"cloud_saves",
"download_manager",
"games",
]
resolver = "3"

View File

@ -5,7 +5,6 @@ use download_manager::DOWNLOAD_MANAGER;
use log::{debug, error}; use log::{debug, error};
use tauri::AppHandle; use tauri::AppHandle;
use tauri_plugin_autostart::ManagerExt; use tauri_plugin_autostart::ManagerExt;
use tauri_plugin_opener::OpenerExt;
use crate::AppState; use crate::AppState;
@ -73,10 +72,3 @@ pub fn get_autostart_enabled(app: AppHandle) -> Result<bool, tauri_plugin_autost
Ok(db_state) Ok(db_state)
} }
#[tauri::command]
pub fn open_fs(path: String, app_handle: AppHandle) -> Result<(), tauri_plugin_opener::Error> {
app_handle
.opener()
.open_path(path, None::<&str>)
}

View File

@ -229,7 +229,6 @@ pub fn run() {
fetch_state, fetch_state,
quit, quit,
fetch_system_data, fetch_system_data,
open_fs,
// User utils // User utils
update_settings, update_settings,
fetch_settings, fetch_settings,