🔨 chore: bump deps + format

This commit is contained in:
Pauline 2024-08-01 05:41:58 +02:00
parent f5f48e349f
commit 2ec1a04c8b
No known key found for this signature in database
GPG key ID: 722BB181973296AE
18 changed files with 454 additions and 379 deletions

View file

@ -1,6 +1,11 @@
use std::{path::PathBuf, str::FromStr};
use std::path::PathBuf;
use std::str::FromStr;
use onelauncher::{cluster::{self, content::logger}, data::{Loader, PackageData}, store::{Cluster, ClusterPath}, State};
use onelauncher::cluster::content::logger;
use onelauncher::cluster::{self};
use onelauncher::data::{Loader, PackageData};
use onelauncher::store::{Cluster, ClusterPath};
use onelauncher::State;
use serde::{Deserialize, Serialize};
use specta::Type;
use uuid::Uuid;
@ -113,7 +118,9 @@ pub async fn run_cluster(uuid: Uuid) -> Result<(Uuid, u32), String> {
#[specta::specta]
#[tauri::command]
pub async fn get_cluster_logs(uuid: Uuid) -> Result<Vec<String>, String> {
let cluster = onelauncher::cluster::get_by_uuid(uuid, None).await?.ok_or("cluster not found")?;
let cluster = onelauncher::cluster::get_by_uuid(uuid, None)
.await?
.ok_or("cluster not found")?;
let logs = logger::get_logs(&cluster.cluster_path(), None)
.await?
.iter()
@ -125,7 +132,9 @@ pub async fn get_cluster_logs(uuid: Uuid) -> Result<Vec<String>, String> {
#[specta::specta]
#[tauri::command]
pub async fn get_cluster_log(uuid: Uuid, log_name: String) -> Result<String, String> {
let cluster = onelauncher::cluster::get_by_uuid(uuid, None).await?.ok_or("cluster not found")?;
let cluster = onelauncher::cluster::get_by_uuid(uuid, None)
.await?
.ok_or("cluster not found")?;
let log = logger::get_output_by_file(&cluster.cluster_path(), logger::LogType::Info, &log_name)
.await?;
Ok(log.0)
@ -134,10 +143,12 @@ pub async fn get_cluster_log(uuid: Uuid, log_name: String) -> Result<String, Str
#[specta::specta]
#[tauri::command]
pub async fn upload_log(uuid: Uuid, log_name: String) -> Result<String, String> {
let cluster = onelauncher::cluster::get_by_uuid(uuid, None).await?.ok_or("cluster not found")?;
let cluster = onelauncher::cluster::get_by_uuid(uuid, None)
.await?
.ok_or("cluster not found")?;
let log = logger::get_output_by_file(&cluster.cluster_path(), logger::LogType::Info, &log_name)
.await?;
let id = logger::upload_log(&cluster.cluster_path(), log).await?;
Ok(id)
}
}

View file

@ -1,4 +1,5 @@
use onelauncher::{data::ManagedPackage, package::content};
use onelauncher::data::ManagedPackage;
use onelauncher::package::content;
use uuid::Uuid;
#[specta::specta]
@ -34,4 +35,4 @@ pub async fn download_mod(cluster_id: Uuid, version_id: String) -> Result<(), St
.await?;
Ok(())
}
}

View file

@ -1,4 +1,5 @@
use onelauncher::{processor, store::{Cluster, ClusterPath}};
use onelauncher::processor;
use onelauncher::store::{Cluster, ClusterPath};
use uuid::Uuid;
#[specta::specta]
@ -18,4 +19,4 @@ pub async fn get_processes_by_path(path: ClusterPath) -> Result<Vec<Uuid>, Strin
pub async fn kill_process(uuid: Uuid) -> Result<(), String> {
processor::kill_by_uuid(uuid).await?;
Ok(())
}
}

View file

@ -1,4 +1,5 @@
use onelauncher::{data::MinecraftCredentials, minecraft};
use onelauncher::data::MinecraftCredentials;
use onelauncher::minecraft;
use tauri::{AppHandle, Manager};
use uuid::Uuid;
@ -97,4 +98,4 @@ pub async fn auth_login(handle: AppHandle) -> Result<Option<MinecraftCredentials
win.close().map_err(|err| err.to_string())?;
Ok(None)
}
}

View file

@ -0,0 +1 @@

View file

@ -0,0 +1 @@

View file

@ -1,3 +1,3 @@
pub mod updater;
pub mod macos;
pub mod menu;
pub mod updater;

View file

@ -24,14 +24,14 @@
"@rspc/tauri": "^0.2.0",
"@solid-primitives/refs": "^1.0.8",
"@solidjs/router": "^0.14.1",
"@tanstack/solid-query": "^5.51.15",
"@tanstack/solid-query": "^5.51.16",
"@tauri-apps/api": "2.0.0-beta.16",
"@tauri-apps/plugin-clipboard-manager": "github:tauri-apps/tauri-plugin-clipboard-manager#v2",
"@tauri-apps/plugin-dialog": "2.0.0-beta.7",
"@tauri-apps/plugin-dialog": "2.0.0-beta.8",
"@tauri-apps/plugin-shell": "github:tauri-apps/tauri-plugin-shell#v2",
"@thisbeyond/solid-dnd": "^0.7.5",
"@thisbeyond/solid-select": "^0.15.0",
"@unocss/reset": "^0.61.7",
"@unocss/reset": "^0.61.9",
"@untitled-theme/icons-solid": "^0.10.5",
"overlayscrollbars": "^2.10.0",
"overlayscrollbars-solid": "^0.5.5",
@ -46,7 +46,7 @@
"@types/uuid": "^10.0.0",
"jsdom": "^24.1.1",
"sass": "^1.77.8",
"unocss": "^0.61.7",
"unocss": "^0.61.9",
"vite-plugin-solid": "^2.10.2",
"vite-plugin-solid-svg": "^0.8.1",
"vite-tsconfig-paths": "^4.3.2"

View file

@ -36,16 +36,16 @@
},
"devDependencies": {
"@flowr/eslint-config": "^3.10.2",
"@types/node": "^22.0.0",
"@vitest/ui": "^2.0.4",
"@types/node": "^22.0.2",
"@vitest/ui": "^2.0.5",
"bumpp": "^9.4.1",
"eslint": "^9.8.0",
"eslint-plugin-solid": "^0.14.1",
"ts-node": "^10.9.2",
"tsx": "^4.16.2",
"tsx": "^4.16.3",
"typescript": "^5.5.4",
"vite": "^5.3.5",
"vitest": "^2.0.4"
"vitest": "^2.0.5"
},
"pnpm": {
"patchDependencies": {

View file

@ -19,7 +19,7 @@
"@rspc/solid-query": "^0.2.3",
"@rspc/tauri": "^0.2.0",
"@solid-primitives/deep": "^0.2.9",
"@tanstack/solid-query": "^5.51.15",
"@tanstack/solid-query": "^5.51.16",
"fast-equals": "^5.0.1",
"plausible-tracker": "^0.3.9",
"solid-js": "^1.8.19",

View file

@ -342,17 +342,18 @@ pub async fn upload_log(path: &ClusterPath, log: LogOutput) -> crate::Result<Str
#[serde(default)]
pub id: Option<String>,
#[serde(default)]
pub error: Option<String>
pub error: Option<String>,
}
let parsed = serde_json::from_slice::<ResponseBody>(
&http::REQWEST_CLIENT.post(format!("{}/log", crate::constants::MCLOGS_API_URL))
&http::REQWEST_CLIENT
.post(format!("{}/log", crate::constants::MCLOGS_API_URL))
.header("Content-Type", "application/x-www-form-urlencoded")
.form(&form)
.send()
.await?
.bytes()
.await?
.await?,
)?;
if parsed.success {
@ -362,6 +363,10 @@ pub async fn upload_log(path: &ClusterPath, log: LogOutput) -> crate::Result<Str
Err(anyhow::anyhow!("failed to get log id from mclo.gs").into())
}
} else {
Err(anyhow::anyhow!("failed to upload log to mclo.gs: {}", parsed.error.unwrap_or_default()).into())
Err(anyhow::anyhow!(
"failed to upload log to mclo.gs: {}",
parsed.error.unwrap_or_default()
)
.into())
}
}

View file

@ -1,2 +1,2 @@
pub mod logger;
pub mod screenshots;
pub mod logger;

View file

@ -1,6 +1,7 @@
use std::path::PathBuf;
use crate::{utils::io, Result};
use crate::utils::io;
use crate::Result;
use crate::store::ClusterPath;
@ -27,4 +28,4 @@ pub async fn get_screenshots(cluster: &ClusterPath) -> Result<Vec<String>> {
pub async fn get_screenshot_path(cluster: &ClusterPath, file_name: String) -> Result<PathBuf> {
let dir = cluster.full_path().await?.join("screenshots");
Ok(dir.join(file_name))
}
}

View file

@ -6,11 +6,10 @@
use crate::proxy::send::send_cluster;
use crate::proxy::ClusterPayloadType;
use crate::store::ProcessorChild;
use crate::prelude::{ClusterPath, JavaVersion, PackagePath};
use crate::store::MinecraftCredentials;
use crate::proxy::ClusterPayloadType;
pub use crate::store::{Cluster, JavaOptions, State};
use crate::store::{MinecraftCredentials, ProcessorChild};
use crate::utils::io::{self, IOError};
@ -23,9 +22,9 @@ use std::sync::Arc;
use tokio::process::Command;
use tokio::sync::RwLock;
pub mod content;
pub mod create;
pub mod update;
pub mod content;
/// get a cluster by its specified [`ClusterPath`].
#[tracing::instrument]

View file

@ -2,10 +2,11 @@
//!
//! Async wrapper around [`tokio::fs`] and [`std::io::Error`] for our error system.
use std::io::Write;
use async_compression::tokio::bufread::GzipDecoder;
use std::io::Write;
use tempfile::NamedTempFile;
use tokio::{io::AsyncReadExt, task::spawn_blocking};
use tokio::io::AsyncReadExt;
use tokio::task::spawn_blocking;
/// A wrapper around generic and unhelpful [`std::io::Error`] messages.
#[derive(Debug, thiserror::Error)]

View file

@ -41,8 +41,12 @@ pub async fn initialize_watcher() -> crate::Result<Debouncer<RecommendedWatcher>
for cmp in components.by_ref() {
formatted.push(cmp);
if matched { break; }
if cmp.as_os_str() == "clusters" { matched = true; }
if matched {
break;
}
if cmp.as_os_str() == "clusters" {
matched = true;
}
}
let sub = components.next().is_none();

View file

@ -21,7 +21,7 @@
"@iarna/toml": "^2.2.5",
"execa": "^9.3.0",
"semver": "^7.6.3",
"undici": "^6.19.4"
"undici": "^6.19.5"
},
"devDependencies": {
"@types/iarna__toml": "^2.0.5",

731
pnpm-lock.yaml generated

File diff suppressed because it is too large Load diff