feat: upgrade to tauri 2.0

Steps taken:
1. install tauri via cargo install tauri-cli
2. see errors when running cargo tauri build
3. run cargo tauri migrate as recommended by docs https://tauri.app/start/migrate/from-tauri-1/
4. manually fix some .ts includes as recommeneded by docs https://tauri.app/start/migrate/from-tauri-1/#migrate-to-core-module
5. successfully build using cargo tauri build
This commit is contained in:
pasta 2024-10-02 14:29:27 -05:00
parent 60728f1699
commit da7fd268b6
No known key found for this signature in database
GPG key ID: E2F3D7916E722D38
8 changed files with 965 additions and 575 deletions

View file

@ -10,10 +10,10 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[build-dependencies]
tauri-build = { version = "1.5", features = [] }
tauri-build = { version = "2", features = [] }
[dependencies]
tauri = { version = "1.6.7", features = ["shell-open"] }
tauri = { version = "2", features = [] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
librqbit = { path = "../../crates/librqbit", features = [
@ -32,6 +32,7 @@ tracing = "0.1"
serde_with = "3.4.0"
parking_lot = "0.12.1"
gethostname = "0.5.0"
tauri-plugin-shell = "2"
[features]
# this feature is used for production builds or when `devPath` points to the filesystem

View file

@ -391,6 +391,7 @@ async fn start() {
let state = State::new(init_logging_result).await;
tauri::Builder::default()
.plugin(tauri_plugin_shell::init())
.manage(state)
.invoke_handler(tauri::generate_handler![
torrents_list,

View file

@ -2,35 +2,25 @@
"build": {
"beforeDevCommand": "npm run dev",
"beforeBuildCommand": "npm run build",
"devPath": "http://localhost:1420",
"distDir": "../dist"
"frontendDist": "../dist",
"devUrl": "http://localhost:1420"
},
"package": {
"productName": "rqbit-desktop"
"bundle": {
"active": true,
"targets": "all",
"icon": [
"icons/32x32.png",
"icons/128x128.png",
"icons/128x128@2x.png",
"icons/icon.icns",
"icons/icon.ico"
]
},
"tauri": {
"allowlist": {
"all": false,
"shell": {
"all": false,
"open": true
}
},
"bundle": {
"active": true,
"targets": "all",
"identifier": "com.rqbit.desktop",
"icon": [
"icons/32x32.png",
"icons/128x128.png",
"icons/128x128@2x.png",
"icons/icon.icns",
"icons/icon.ico"
]
},
"security": {
"csp": null
},
"productName": "rqbit-desktop",
"mainBinaryName": "rqbit-desktop",
"identifier": "com.rqbit.desktop",
"plugins": {},
"app": {
"windows": [
{
"fullscreen": false,
@ -39,6 +29,9 @@
"width": 1024,
"height": 600
}
]
],
"security": {
"csp": null
}
}
}
}