mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-04-05 18:01:56 +02:00
Update to Tauri v2 stable (#1194)
This commit is contained in:
@@ -1,6 +1,3 @@
|
||||
#!/usr/bin/env sh
|
||||
. "$(dirname -- "$0")/_/husky.sh"
|
||||
|
||||
YELLOW="\033[1;33m"
|
||||
GREEN="\033[1;32m"
|
||||
RESET="\033[0m"
|
||||
|
||||
1394
Cargo.lock
generated
1394
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -125,7 +125,7 @@
|
||||
enable = true;
|
||||
toolchain = fenixpkgs.fromToolchainName {
|
||||
name = rust_toolchain.toolchain.channel;
|
||||
sha256 = "sha256-Ngiz76YP4HTY75GGdH2P+APE/DEIx2R/Dn+BwwOyzZU=";
|
||||
sha256 = "sha256-VZZnlyP69+Y3crrLHQyJirqlHrTtGTsyiSnZB8jEvVo=";
|
||||
};
|
||||
components = rust_toolchain.toolchain.components;
|
||||
};
|
||||
|
||||
@@ -5,16 +5,16 @@
|
||||
"dependencies": {
|
||||
"@fluent/bundle": "^0.18.0",
|
||||
"@fluent/react": "^0.15.2",
|
||||
"@fontsource/poppins": "^5.0.14",
|
||||
"@fontsource/poppins": "^5.1.0",
|
||||
"@formatjs/intl-localematcher": "^0.2.32",
|
||||
"@react-three/drei": "^9.107.0",
|
||||
"@react-three/fiber": "^8.16.8",
|
||||
"@tauri-apps/api": "2.0.0-beta.14",
|
||||
"@tauri-apps/plugin-dialog": "2.0.0-beta.6",
|
||||
"@tauri-apps/plugin-fs": "2.0.0-beta.6",
|
||||
"@tauri-apps/plugin-os": "2.0.0-beta.6",
|
||||
"@tauri-apps/plugin-shell": "2.0.0-beta.7",
|
||||
"@tauri-apps/plugin-store": "2.0.0-beta.6",
|
||||
"@react-three/drei": "^9.114.3",
|
||||
"@react-three/fiber": "^8.17.10",
|
||||
"@tauri-apps/api": "^2.0.2",
|
||||
"@tauri-apps/plugin-dialog": "^2.0.0",
|
||||
"@tauri-apps/plugin-fs": "^2.0.0",
|
||||
"@tauri-apps/plugin-os": "^2.0.0",
|
||||
"@tauri-apps/plugin-shell": "^2.0.0",
|
||||
"@tauri-apps/plugin-store": "^2.0.0",
|
||||
"browser-fs-access": "^0.35.0",
|
||||
"classnames": "^2.5.1",
|
||||
"flatbuffers": "22.10.26",
|
||||
@@ -25,15 +25,15 @@
|
||||
"react-dom": "^18.3.1",
|
||||
"react-error-boundary": "^4.0.13",
|
||||
"react-helmet": "^6.1.0",
|
||||
"react-hook-form": "^7.52.0",
|
||||
"react-hook-form": "^7.53.0",
|
||||
"react-modal": "^3.16.1",
|
||||
"react-responsive": "^10.0.0",
|
||||
"react-router-dom": "^6.23.1",
|
||||
"semver": "^7.6.2",
|
||||
"react-router-dom": "^6.26.2",
|
||||
"semver": "^7.6.3",
|
||||
"solarxr-protocol": "file:../solarxr-protocol",
|
||||
"three": "^0.163.0",
|
||||
"ts-pattern": "^5.2.0",
|
||||
"typescript": "^5.4.5",
|
||||
"ts-pattern": "^5.4.0",
|
||||
"typescript": "^5.6.3",
|
||||
"use-double-tap": "^1.3.6"
|
||||
},
|
||||
"scripts": {
|
||||
@@ -50,33 +50,33 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@dword-design/eslint-plugin-import-alias": "^4.0.9",
|
||||
"@tailwindcss/forms": "^0.5.7",
|
||||
"@tauri-apps/cli": "2.0.0-beta.21",
|
||||
"@tailwindcss/forms": "^0.5.9",
|
||||
"@tauri-apps/cli": "^2.0.2",
|
||||
"@types/file-saver": "^2.0.7",
|
||||
"@types/react": "^18.3.3",
|
||||
"@types/react": "^18.3.11",
|
||||
"@types/react-dom": "^18.3.0",
|
||||
"@types/react-helmet": "^6.1.11",
|
||||
"@types/react-modal": "3.16.3",
|
||||
"@types/semver": "^7.5.8",
|
||||
"@types/three": "^0.163.0",
|
||||
"@typescript-eslint/eslint-plugin": "^7.13.0",
|
||||
"@typescript-eslint/parser": "^7.13.0",
|
||||
"@vitejs/plugin-react": "^4.3.1",
|
||||
"autoprefixer": "^10.4.19",
|
||||
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
||||
"@typescript-eslint/parser": "^7.18.0",
|
||||
"@vitejs/plugin-react": "^4.3.2",
|
||||
"autoprefixer": "^10.4.20",
|
||||
"cross-env": "^7.0.3",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint": "^8.57.1",
|
||||
"eslint-config-airbnb": "^19.0.4",
|
||||
"eslint-import-resolver-typescript": "^3.6.1",
|
||||
"eslint-plugin-import": "^2.29.1",
|
||||
"eslint-plugin-jsx-a11y": "^6.8.0",
|
||||
"eslint-plugin-react": "^7.34.2",
|
||||
"eslint-import-resolver-typescript": "^3.6.3",
|
||||
"eslint-plugin-import": "^2.31.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.10.0",
|
||||
"eslint-plugin-react": "^7.37.1",
|
||||
"eslint-plugin-react-hooks": "^4.6.2",
|
||||
"prettier": "^3.3.2",
|
||||
"prettier": "^3.3.3",
|
||||
"rollup-plugin-visualizer": "^5.12.0",
|
||||
"sass": "^1.77.5",
|
||||
"sass": "^1.79.4",
|
||||
"spdx-satisfies": "^5.0.1",
|
||||
"tailwind-gradient-mask-image": "^1.2.0",
|
||||
"tailwindcss": "^3.4.4",
|
||||
"vite": "^5.3.1"
|
||||
"tailwindcss": "^3.4.13",
|
||||
"vite": "^5.4.8"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,21 +21,21 @@ default = ["custom-protocol"]
|
||||
custom-protocol = ["tauri/custom-protocol"]
|
||||
|
||||
[build-dependencies]
|
||||
tauri-build = { version = "=2.0.0-beta.18", features = [] }
|
||||
tauri-build = { version = "2.0", features = [] }
|
||||
cfg_aliases = "0.2"
|
||||
shadow-rs = "0.27"
|
||||
shadow-rs = "0.35"
|
||||
|
||||
[dependencies]
|
||||
serde_json = "1"
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
tauri = { version = "=2.0.0-beta.23", features = ["devtools", "tray-icon", "image-png"] }
|
||||
tauri-runtime = "=2.0.0-beta.19"
|
||||
tauri-plugin-dialog = "=2.0.0-beta.10"
|
||||
tauri-plugin-fs = "=2.0.0-beta.10"
|
||||
tauri-plugin-os = "=2.0.0-beta.7"
|
||||
tauri-plugin-shell = "=2.0.0-beta.8"
|
||||
tauri-plugin-store = "=2.0.0-beta.9"
|
||||
flexi_logger = "0.28"
|
||||
tauri = { version = "2.0", features = ["devtools", "tray-icon", "image-png"] }
|
||||
tauri-runtime = "2.0"
|
||||
tauri-plugin-dialog = "2.0"
|
||||
tauri-plugin-fs = "2.0"
|
||||
tauri-plugin-os = "2.0"
|
||||
tauri-plugin-shell = "2.0"
|
||||
tauri-plugin-store = "2.0"
|
||||
flexi_logger = "0.29"
|
||||
log-panics = { version = "2", features = ["with-backtrace"] }
|
||||
log = "0.4"
|
||||
clap = { version = "4.0.29", features = ["derive"] }
|
||||
@@ -45,11 +45,11 @@ tempfile = "3"
|
||||
which = "6.0"
|
||||
glob = "0.3"
|
||||
open = "5"
|
||||
shadow-rs = { version = "0.27", default-features = false }
|
||||
shadow-rs = { version = "0.35", default-features = false }
|
||||
const_format = "0.2.30"
|
||||
cfg-if = "1"
|
||||
color-eyre = "0.6"
|
||||
rfd = { version = "0.14", features = ["gtk3"], default-features = false }
|
||||
rfd = { version = "0.15", features = ["gtk3"], default-features = false }
|
||||
dirs-next = "2.0.0"
|
||||
discord-sdk = "0.3.6"
|
||||
tokio = { version = "1.37.0", features = ["time"] }
|
||||
|
||||
@@ -6,25 +6,25 @@
|
||||
"main"
|
||||
],
|
||||
"permissions": [
|
||||
"path:default",
|
||||
"event:default",
|
||||
"window:default",
|
||||
"app:default",
|
||||
"resources:default",
|
||||
"menu:default",
|
||||
"tray:default",
|
||||
"core:path:default",
|
||||
"core:event:default",
|
||||
"core:window:default",
|
||||
"core:app:default",
|
||||
"core:resources:default",
|
||||
"core:menu:default",
|
||||
"core:tray:default",
|
||||
"core:webview:default",
|
||||
"core:window:allow-close",
|
||||
"core:window:allow-toggle-maximize",
|
||||
"core:window:allow-minimize",
|
||||
"core:window:allow-start-dragging",
|
||||
"core:window:allow-hide",
|
||||
"core:window:allow-show",
|
||||
"core:window:allow-set-focus",
|
||||
"core:window:allow-set-decorations",
|
||||
"store:default",
|
||||
"os:allow-os-type",
|
||||
"webview:default",
|
||||
"dialog:allow-save",
|
||||
"window:allow-close",
|
||||
"window:allow-toggle-maximize",
|
||||
"window:allow-minimize",
|
||||
"window:allow-start-dragging",
|
||||
"window:allow-hide",
|
||||
"window:allow-show",
|
||||
"window:allow-set-focus",
|
||||
"window:allow-set-decorations",
|
||||
"shell:allow-open",
|
||||
"store:allow-get",
|
||||
"store:allow-set",
|
||||
|
||||
@@ -11,6 +11,7 @@ use std::time::Instant;
|
||||
use clap::Parser;
|
||||
use color_eyre::Result;
|
||||
use state::WindowState;
|
||||
use tauri::Emitter;
|
||||
use tauri::{Manager, RunEvent, WindowEvent};
|
||||
use tauri_plugin_shell::process::CommandChild;
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ use tauri::{
|
||||
image::Image,
|
||||
menu::{Menu, MenuBuilder, MenuItemBuilder, MenuItemKind},
|
||||
tray::{MouseButton, MouseButtonState, TrayIconBuilder, TrayIconEvent},
|
||||
AppHandle, Manager, Runtime, State,
|
||||
AppHandle, Emitter, Manager, Runtime, State,
|
||||
};
|
||||
|
||||
pub struct TrayMenu<R: Runtime>(Menu<R>);
|
||||
|
||||
@@ -62,29 +62,8 @@
|
||||
"licenseFile": "../../LICENSE-MIT"
|
||||
},
|
||||
"plugins": {
|
||||
"fs": {
|
||||
"all": true,
|
||||
"scope": [
|
||||
"$APP/*",
|
||||
"$APP"
|
||||
]
|
||||
},
|
||||
"os": {
|
||||
"all": true
|
||||
},
|
||||
"shell": {
|
||||
"open": "^((https?://\\w+)|(file://)).+"
|
||||
},
|
||||
"window": {
|
||||
"close": true,
|
||||
"maximize": true,
|
||||
"minimize": true,
|
||||
"setResizable": true,
|
||||
"setSize": true,
|
||||
"setTitle": true,
|
||||
"startDragging": true,
|
||||
"unmaximize": true,
|
||||
"unminimize": true
|
||||
}
|
||||
},
|
||||
"productName": "slimevr",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { getCurrent } from '@tauri-apps/api/webviewWindow';
|
||||
import { getCurrentWebviewWindow } from '@tauri-apps/api/webviewWindow';
|
||||
import { ReactNode, useContext, useEffect, useState } from 'react';
|
||||
import { NavLink, useMatch } from 'react-router-dom';
|
||||
import {
|
||||
@@ -71,7 +71,7 @@ export function TopBar({
|
||||
});
|
||||
const closeApp = async () => {
|
||||
await invoke('update_window_state');
|
||||
await getCurrent().close();
|
||||
await getCurrentWebviewWindow().close();
|
||||
};
|
||||
const tryCloseApp = async (dontTray = false) => {
|
||||
if (isTauri && config?.useTray === null) {
|
||||
@@ -80,7 +80,7 @@ export function TopBar({
|
||||
}
|
||||
|
||||
if (config?.useTray && !dontTray) {
|
||||
await getCurrent().hide();
|
||||
await getCurrentWebviewWindow().hide();
|
||||
await invoke('update_tray_text');
|
||||
} else if (
|
||||
config?.connectedTrackersWarning &&
|
||||
@@ -98,7 +98,7 @@ export function TopBar({
|
||||
|
||||
useEffect(() => {
|
||||
const unlisten = listen('try-close', async () => {
|
||||
const window = getCurrent();
|
||||
const window = getCurrentWebviewWindow();
|
||||
await window.show();
|
||||
await window.setFocus();
|
||||
await invoke('update_tray_text');
|
||||
@@ -111,7 +111,7 @@ export function TopBar({
|
||||
|
||||
useEffect(() => {
|
||||
if (config === null || !isTauri) return;
|
||||
getCurrent().setDecorations(config?.decorations).catch(error);
|
||||
getCurrentWebviewWindow().setDecorations(config?.decorations).catch(error);
|
||||
}, [config?.decorations]);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -250,13 +250,13 @@ export function TopBar({
|
||||
<>
|
||||
<div
|
||||
className="flex items-center justify-center hover:bg-background-60 rounded-full w-7 h-7"
|
||||
onClick={() => getCurrent().minimize()}
|
||||
onClick={() => getCurrentWebviewWindow().minimize()}
|
||||
>
|
||||
<MinimiseIcon></MinimiseIcon>
|
||||
</div>
|
||||
<div
|
||||
className="flex items-center justify-center hover:bg-background-60 rounded-full w-7 h-7"
|
||||
onClick={() => getCurrent().toggleMaximize()}
|
||||
onClick={() => getCurrentWebviewWindow().toggleMaximize()}
|
||||
>
|
||||
<MaximiseIcon></MaximiseIcon>
|
||||
</div>
|
||||
@@ -284,7 +284,7 @@ export function TopBar({
|
||||
|
||||
// Doing this in here just in case config doesn't get updated in time
|
||||
if (useTray) {
|
||||
await getCurrent().hide();
|
||||
await getCurrentWebviewWindow().hide();
|
||||
await invoke('update_tray_text');
|
||||
} else if (
|
||||
config?.connectedTrackersWarning &&
|
||||
|
||||
@@ -278,7 +278,7 @@ export function BodyProportions({
|
||||
className={classNames(
|
||||
'h-12 w-32 rounded-lg bg-background-60 flex flex-col justify-center',
|
||||
'items-center fill-background-10',
|
||||
scrollerRef?.current?.scrollTop ?? 0 > 0
|
||||
(scrollerRef?.current?.scrollTop ?? 0 > 0)
|
||||
? 'opacity-100 active:bg-accent-background-30'
|
||||
: 'opacity-50'
|
||||
)}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { createContext, useContext, useMemo, useState } from 'react';
|
||||
import { createContext, useContext, useState } from 'react';
|
||||
import { DeveloperModeWidgetForm } from '@/components/widgets/DeveloperModeWidget';
|
||||
import { error } from '@/utils/logging';
|
||||
import { useDebouncedEffect } from './timeout';
|
||||
import { Store } from '@tauri-apps/plugin-store';
|
||||
import { createStore, Store } from '@tauri-apps/plugin-store';
|
||||
import { useIsTauri } from './breakpoint';
|
||||
import { waitUntil } from '@/utils/a11y';
|
||||
import { isTauri } from '@tauri-apps/api/core';
|
||||
|
||||
export interface WindowConfig {
|
||||
width: number;
|
||||
@@ -73,13 +74,15 @@ interface CrossStorage {
|
||||
get(key: string): Promise<string | null>;
|
||||
}
|
||||
|
||||
const tauriStore: CrossStorage = new Store('gui-settings.dat');
|
||||
|
||||
const localStore: CrossStorage = {
|
||||
get: async (key) => localStorage.getItem(key),
|
||||
set: async (key, value) => localStorage.setItem(key, value),
|
||||
};
|
||||
|
||||
const store: CrossStorage = isTauri()
|
||||
? await createStore('gui-settings.dat')
|
||||
: localStore;
|
||||
|
||||
function fallbackToDefaults(loadedConfig: any): Config {
|
||||
return Object.assign({}, defaultConfig, loadedConfig);
|
||||
}
|
||||
@@ -88,7 +91,6 @@ export function useConfigProvider(): ConfigContext {
|
||||
const [currConfig, set] = useState<Config | null>(null);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const tauri = useIsTauri();
|
||||
const store = useMemo(() => (tauri ? tauriStore : localStore), [tauri]);
|
||||
|
||||
useDebouncedEffect(
|
||||
() => {
|
||||
|
||||
@@ -57,4 +57,11 @@ export default defineConfig({
|
||||
'@': path.resolve(__dirname, 'src'),
|
||||
},
|
||||
},
|
||||
css: {
|
||||
preprocessorOptions: {
|
||||
scss: {
|
||||
api: 'modern',
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "slimevr-ui",
|
||||
"version": "0.5.1",
|
||||
"private": true,
|
||||
"packageManager": "pnpm@9.4.0",
|
||||
"packageManager": "pnpm@9.12.1",
|
||||
"workspaces": [
|
||||
"solarxr-protocol",
|
||||
"gui"
|
||||
@@ -17,7 +17,7 @@
|
||||
"preinstall": "npx only-allow pnpm"
|
||||
},
|
||||
"devDependencies": {
|
||||
"husky": "^9.0.11",
|
||||
"lint-staged": "^15.2.7"
|
||||
"husky": "^9.1.6",
|
||||
"lint-staged": "^15.2.10"
|
||||
}
|
||||
}
|
||||
|
||||
1872
pnpm-lock.yaml
generated
1872
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
||||
[toolchain]
|
||||
channel = "1.79"
|
||||
channel = "1.81"
|
||||
profile = "default"
|
||||
components = ["rustc", "cargo", "clippy", "rustfmt", "rust-analyzer", "rust-src"]
|
||||
|
||||
Reference in New Issue
Block a user