[dep] adapt tauri dep

This commit is contained in:
Purp1e
2025-11-04 23:33:36 +08:00
parent a5f5a2a5ff
commit 67b6c74907
6 changed files with 17 additions and 21 deletions

BIN
bun.lockb

Binary file not shown.

View File

@@ -23,7 +23,7 @@
"@reactuses/core": "6.0.1", "@reactuses/core": "6.0.1",
"@supabase/ssr": "0.6.1", "@supabase/ssr": "0.6.1",
"@tauri-apps/api": "2.4.0", "@tauri-apps/api": "2.4.0",
"@tauri-apps/plugin-autostart": "^2.5.0", "@tauri-apps/plugin-autostart": "^2.5.1",
"@tauri-apps/plugin-cli": "~2.2.1", "@tauri-apps/plugin-cli": "~2.2.1",
"@tauri-apps/plugin-clipboard-manager": "2.2.2", "@tauri-apps/plugin-clipboard-manager": "2.2.2",
"@tauri-apps/plugin-deep-link": "~2.2.1", "@tauri-apps/plugin-deep-link": "~2.2.1",
@@ -35,7 +35,7 @@
"@tauri-apps/plugin-os": "2.2.1", "@tauri-apps/plugin-os": "2.2.1",
"@tauri-apps/plugin-process": "2.2.0", "@tauri-apps/plugin-process": "2.2.0",
"@tauri-apps/plugin-shell": "~2.2.2", "@tauri-apps/plugin-shell": "~2.2.2",
"@tauri-apps/plugin-store": "^2.4.0", "@tauri-apps/plugin-store": "^2.4.1",
"@tauri-store/valtio": "2.1.1", "@tauri-store/valtio": "2.1.1",
"@types/throttle-debounce": "^5.0.2", "@types/throttle-debounce": "^5.0.2",
"ahooks": "^3.9.6", "ahooks": "^3.9.6",
@@ -50,21 +50,21 @@
"tauri-plugin-system-info-api": "^2.0.10" "tauri-plugin-system-info-api": "^2.0.10"
}, },
"devDependencies": { "devDependencies": {
"@tauri-apps/cli": "^2.9.1", "@tauri-apps/cli": "^2.9.2",
"@testing-library/dom": "^10.4.1", "@testing-library/dom": "^10.4.1",
"@testing-library/jest-dom": "^6.9.1", "@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.0", "@testing-library/react": "^16.3.0",
"@testing-library/user-event": "^14.6.1", "@testing-library/user-event": "^14.6.1",
"@types/jest": "^29.5.14", "@types/jest": "^29.5.14",
"@types/node": "^22.18.12", "@types/node": "^22.19.0",
"@types/react": "19.0.10", "@types/react": "19.0.10",
"@types/react-dom": "19.0.4", "@types/react-dom": "19.0.4",
"@typescript-eslint/eslint-plugin": "^8.46.2", "@typescript-eslint/eslint-plugin": "^8.46.3",
"@typescript-eslint/parser": "^8.46.2", "@typescript-eslint/parser": "^8.46.3",
"autoprefixer": "^10.4.21", "autoprefixer": "^10.4.21",
"clsx": "^2.1.1", "clsx": "^2.1.1",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"cssnano": "^7.1.1", "cssnano": "^7.1.2",
"eslint": "9.23.0", "eslint": "9.23.0",
"eslint-config-next": "15.2.3", "eslint-config-next": "15.2.3",
"lint-staged": "^15.5.2", "lint-staged": "^15.5.2",

View File

@@ -6,7 +6,7 @@
use tauri::Manager; use tauri::Manager;
use tauri_plugin_autostart::MacosLauncher; use tauri_plugin_autostart::MacosLauncher;
use tauri_plugin_cli::CliExt; use tauri_plugin_cli::CliExt;
// use tauri_plugin_deep_link::DeepLinkExt; use tauri_plugin_deep_link::DeepLinkExt;
use tauri_plugin_store::StoreExt; use tauri_plugin_store::StoreExt;
// Window Vibrancy // Window Vibrancy

View File

@@ -14,11 +14,9 @@ pub fn get_steam_users() -> Result<String, String> {
} }
mod tests { mod tests {
use super::*;
#[test] #[test]
fn test_get_steam_users() { fn test_get_steam_users() {
let result = get_steam_users(); let result = super::get_steam_users();
assert!(result.is_ok() || result.is_err()); assert!(result.is_ok() || result.is_err());
println!("{}", result.unwrap()); println!("{}", result.unwrap());
} }

View File

@@ -70,7 +70,7 @@ pub fn get_exe_path(name: &str) -> Result<String, std::io::Error> {
pub fn open_path(path: &str) -> Result<(), std::io::Error> { pub fn open_path(path: &str) -> Result<(), std::io::Error> {
// path中所有/ 转换为 \ // path中所有/ 转换为 \
let path = path.replace("/", "\\"); let path = path.replace("/", "\\");
fs::create_dir_all(path)?; fs::create_dir_all(&path)?;
#[cfg(windows)] #[cfg(windows)]
Command::new("cmd.exe") Command::new("cmd.exe")
@@ -82,27 +82,26 @@ pub fn open_path(path: &str) -> Result<(), std::io::Error> {
} }
mod tests { mod tests {
use super::*;
#[test] #[test]
fn test_open_path() { fn test_open_path() {
let path = "D:\\Programs\\Steam"; let path = "D:\\Programs\\Steam";
println!("test open path: {}", path); println!("test open path: {}", path);
open_path(path).unwrap(); super::open_path(path).unwrap();
let path = "D:\\Programs\\Steam\\steamapps\\common\\Counter-Strike Global Offensive\\game\\bin\\win64"; let path = "D:\\Programs\\Steam\\steamapps\\common\\Counter-Strike Global Offensive\\game\\bin\\win64";
println!("test open path: {}", path); println!("test open path: {}", path);
open_path(path).unwrap(); super::open_path(path).unwrap();
let path = "%appdata%/Wmpvp/demo"; let path = "%appdata%/Wmpvp/demo";
println!("test open path: {}", path); println!("test open path: {}", path);
open_path(path).unwrap() super::open_path(path).unwrap()
} }
#[test] #[test]
fn test_get_exe_path() { fn test_get_exe_path() {
let path = get_exe_path("steam").expect("failed"); let path = super::get_exe_path("steam").expect("failed");
println!("test get steam path: {}", path); println!("test get steam path: {}", path);
get_exe_path("not_running").expect("failed"); super::get_exe_path("not_running").expect("failed");
} }
} }

View File

@@ -75,7 +75,6 @@ fn build_vdf(json_value: &serde_json::Value, vdf_data: &mut String, indent_level
} }
mod tests { mod tests {
use super::*;
static VDF_DATA: &str = r#""users" static VDF_DATA: &str = r#""users"
{ {
@@ -132,7 +131,7 @@ mod tests {
#[test] #[test]
fn test_to_json() { fn test_to_json() {
// let expected_json = r#"{"key1": "value1","key2": "value2","subkey": {"key3": "value3"}}"#; // let expected_json = r#"{"key1": "value1","key2": "value2","subkey": {"key3": "value3"}}"#;
let json_data = to_json(VDF_DATA); let json_data = super::to_json(VDF_DATA);
println!("{}", json_data); println!("{}", json_data);
// 解析json // 解析json
@@ -145,7 +144,7 @@ mod tests {
#[test] #[test]
fn test_to_vdf() { fn test_to_vdf() {
// let json_data = r#"{"key1": "value1","key2": "value2","subkey": {"key3": "value3"}}"#; // let json_data = r#"{"key1": "value1","key2": "value2","subkey": {"key3": "value3"}}"#;
let vdf_data = to_vdf(JSON_DATA); let vdf_data = super::to_vdf(JSON_DATA);
println!("{}", vdf_data); println!("{}", vdf_data);
} }