diff --git a/TODO.md b/TODO.md new file mode 100644 index 00000000..292b2d8f --- /dev/null +++ b/TODO.md @@ -0,0 +1,7 @@ +# todo list + +- migrate launcher backend storage to `prisma-client-rust` (see `prisma` branch). +- migrate api commands that currently use `tauri-specta` but don't actually rely on `tauri` to `rspc` + - waiting on `rspc` to update to the latest version (hopefully before tauri comes out of beta) +- bump `tauri` to stable v2 when it releases. +- test all major version/loader combos launching and mod loading. diff --git a/apps/desktop/src/api/commands/cluster.rs b/apps/desktop/src/api/commands/cluster.rs index 6e47ec6e..23cf33e9 100644 --- a/apps/desktop/src/api/commands/cluster.rs +++ b/apps/desktop/src/api/commands/cluster.rs @@ -1,4 +1,6 @@ -use std::{collections::HashMap, path::PathBuf, str::FromStr}; +use std::collections::HashMap; +use std::path::PathBuf; +use std::str::FromStr; use onelauncher::cluster::content::logger; use onelauncher::cluster::{self}; diff --git a/apps/desktop/src/api/statics.rs b/apps/desktop/src/api/statics.rs index b6c178b6..6c0c524c 100644 --- a/apps/desktop/src/api/statics.rs +++ b/apps/desktop/src/api/statics.rs @@ -1,13 +1,6 @@ use onelauncher::constants::*; use serde::Serialize; use specta::Type; -// use tauri_specta::StaticCollection; - -// pub fn get_static_collection() -> StaticCollection { -// StaticCollection::default() -// .register("PROGRAM_INFO", get_program_info()) -// .to_owned() -// } #[derive(Serialize, Type)] pub struct ProgramInfo { diff --git a/apps/desktop/src/lib.rs b/apps/desktop/src/lib.rs index a2c98864..1ed4d763 100644 --- a/apps/desktop/src/lib.rs +++ b/apps/desktop/src/lib.rs @@ -1,7 +1,7 @@ #![recursion_limit = "1024"] -// use api::statics::get_static_collection; -use tauri::{Manager, Emitter}; +use api::statics::get_program_info; +use tauri::{Emitter, Manager}; pub mod api; pub mod error; @@ -40,16 +40,16 @@ pub async fn run() { pub async fn run_app(setup: F) { let prebuild = tauri_specta::Builder::::new() - // .header("/* eslint-disable -- auto-generated file */") - // .statics(get_static_collection()) .commands(collect_commands!()) - .events(collect_events!()); + .events(collect_events!()) + .constant("PROGRAM_INFO", get_program_info()); #[cfg(debug_assertions)] prebuild .export( - specta_typescript::Typescript::default(), - "../frontend/src/bindings.ts" + specta_typescript::Typescript::default() + .bigint(specta_typescript::BigIntExportBehavior::BigInt), + "../frontend/src/bindings.ts", ) .expect("failed to export debug bindings!"); diff --git a/apps/frontend/src/ui/pages/Home.tsx b/apps/frontend/src/ui/pages/Home.tsx index 384c6123..2596bc06 100644 --- a/apps/frontend/src/ui/pages/Home.tsx +++ b/apps/frontend/src/ui/pages/Home.tsx @@ -1,5 +1,4 @@ import { - CheckIcon, ChevronRightIcon, DotsVerticalIcon, EyeIcon, @@ -8,22 +7,13 @@ import { SearchMdIcon, } from '@untitled-theme/icons-solid'; import type { Accessor, Setter } from 'solid-js'; -import { For, Show, createEffect, createMemo, createSignal } from 'solid-js'; +import { For, Show, createEffect, createSignal } from 'solid-js'; import { useNavigate } from '@solidjs/router'; -import { - DragDropProvider, - DragDropSensors, - type DragEventHandler, - DragOverlay, - SortableProvider, - createDroppable, - createSortable, -} from '@thisbeyond/solid-dnd'; + import { mergeRefs } from '@solid-primitives/refs'; import image from '../../assets/images/header.png'; import ContextMenu from '../components/overlay/ContextMenu'; import Button from '../components/base/Button'; -import Tag from '../components/base/Tag'; import TextField from '../components/base/TextField'; import ClusterRoot from './cluster/ClusterRoot'; import ClusterCover from '~ui/components/game/ClusterCover'; @@ -166,7 +156,7 @@ export default HomePage; // TODO: Replace this into it's own component // possibly with the core ui lirbary with autogenerated and optimized svgs pls -function OneConfigLogo() { +function _OneConfigLogo() { return ( diff --git a/apps/frontend/src/ui/pages/cluster/ClusterGame.tsx b/apps/frontend/src/ui/pages/cluster/ClusterGame.tsx index fe54ad11..fbfeac53 100644 --- a/apps/frontend/src/ui/pages/cluster/ClusterGame.tsx +++ b/apps/frontend/src/ui/pages/cluster/ClusterGame.tsx @@ -3,7 +3,7 @@ import Sidebar from '~ui/components/Sidebar'; import useClusterContext from '~ui/hooks/useCluster'; function ClusterGame() { - const cluster = useClusterContext(); + const _cluster = useClusterContext(); // TODO: Save cluster settings diff --git a/packages/core/src/api/cluster/mod.rs b/packages/core/src/api/cluster/mod.rs index 9c4af75f..b150a599 100644 --- a/packages/core/src/api/cluster/mod.rs +++ b/packages/core/src/api/cluster/mod.rs @@ -68,7 +68,11 @@ pub async fn list_grouped(clear: Option) -> crate::Result>::new(); for cluster in list { - let group = cluster.meta.group.clone().unwrap_or(String::from("Ungrouped")); + let group = cluster + .meta + .group + .clone() + .unwrap_or(String::from("Ungrouped")); if let Some(items) = map.get_mut(&group) { items.push(cluster); } else { diff --git a/packages/core/src/store/processor.rs b/packages/core/src/store/processor.rs index 4ac05702..2aaaa43e 100644 --- a/packages/core/src/store/processor.rs +++ b/packages/core/src/store/processor.rs @@ -206,7 +206,10 @@ impl ChildType { ChildType::ChildProcess(child) => Ok(child.kill().await.map_err(IOError::from)?), ChildType::RescuedChild(pid) => { let mut system = sysinfo::System::new(); - if system.refresh_processes(sysinfo::ProcessesToUpdate::Some(&[sysinfo::Pid::from_u32(*pid)])) != 0 { + if system.refresh_processes(sysinfo::ProcessesToUpdate::Some(&[ + sysinfo::Pid::from_u32(*pid), + ])) != 0 + { let process = system.process(sysinfo::Pid::from_u32(*pid)); if let Some(process) = process { process.kill(); @@ -226,7 +229,10 @@ impl ChildType { .map(|x| x.code().unwrap_or(0))), ChildType::RescuedChild(pid) => { let mut system = sysinfo::System::new(); - if !(system.refresh_processes(sysinfo::ProcessesToUpdate::Some(&[sysinfo::Pid::from_u32(*pid)])) != 0) { + if system.refresh_processes(sysinfo::ProcessesToUpdate::Some(&[ + sysinfo::Pid::from_u32(*pid), + ])) == 0 + { return Ok(Some(0)); } @@ -475,7 +481,7 @@ impl Processor { ) .into()); } - if cache.name != process.name().to_string_lossy().to_string() { + if cache.name != process.name().to_string_lossy() { return Err(anyhow::anyhow!( "restored process {} has a mismatched name {}", cache.pid,