Upgrade Tauri 1.x to 2.x: fix config format + add plugins
This commit is contained in:
@@ -12,12 +12,15 @@ rust-version = "1.60"
|
||||
[workspace]
|
||||
|
||||
[build-dependencies]
|
||||
tauri-build = { version = "1.5.6", features = [] }
|
||||
tauri-build = { version = "2.0", features = [] }
|
||||
|
||||
[dependencies]
|
||||
serde_json = "1.0"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
tauri = { version = "1.8.3", features = ["fs-all", "path-all", "http-all", "shell-all"] }
|
||||
tauri = { version = "2.0", features = [] }
|
||||
tauri-plugin-fs = "2.0"
|
||||
tauri-plugin-http = "2.0"
|
||||
tauri-plugin-shell = "2.0"
|
||||
tokio = { version = "1.0", features = ["full"] }
|
||||
sysinfo = "0.30"
|
||||
chrono = { version = "0.4", features = ["serde"] }
|
||||
|
||||
@@ -6,6 +6,9 @@ use commands::*;
|
||||
|
||||
fn main() {
|
||||
tauri::Builder::default()
|
||||
.plugin(tauri_plugin_fs::init())
|
||||
.plugin(tauri_plugin_http::init())
|
||||
.plugin(tauri_plugin_shell::init())
|
||||
.invoke_handler(tauri::generate_handler![
|
||||
get_tree,
|
||||
list_files,
|
||||
@@ -59,4 +62,4 @@ fn main() {
|
||||
])
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running tauri application");
|
||||
}
|
||||
}
|
||||
@@ -1,74 +1,38 @@
|
||||
{
|
||||
"$schema": "https://schema.tauri.app/config/2",
|
||||
"productName": "Momentry Display Engine",
|
||||
"version": "0.1.0",
|
||||
"identifier": "com.momentry.markbase",
|
||||
"build": {
|
||||
"beforeBuildCommand": "cd src && npm run build",
|
||||
"beforeDevCommand": "cd src && npm run dev",
|
||||
"devPath": "http://localhost:5173",
|
||||
"distDir": "../src/dist"
|
||||
"devUrl": "http://localhost:5173",
|
||||
"frontendDist": "../src/dist"
|
||||
},
|
||||
"package": {
|
||||
"productName": "Momentry Display Engine",
|
||||
"version": "0.1.0"
|
||||
"bundle": {
|
||||
"active": true,
|
||||
"category": "DeveloperTool",
|
||||
"copyright": "Copyright © 2026 Momentry",
|
||||
"icon": [
|
||||
"icons/32x32.png",
|
||||
"icons/128x128.png",
|
||||
"icons/128x128@2x.png",
|
||||
"icons/icon.icns",
|
||||
"icons/icon.ico"
|
||||
],
|
||||
"longDescription": "Momentry Display Engine - A Tauri-based desktop application for MarkBase management",
|
||||
"macOS": {
|
||||
"entitlements": null,
|
||||
"exceptionDomain": "",
|
||||
"frameworks": [],
|
||||
"providerShortName": null,
|
||||
"signingIdentity": null
|
||||
},
|
||||
"shortDescription": "Momentry Display Engine",
|
||||
"targets": "all"
|
||||
},
|
||||
"tauri": {
|
||||
"allowlist": {
|
||||
"all": false,
|
||||
"fs": {
|
||||
"all": true,
|
||||
"scope": ["$RESOURCE/**", "$APPDATA/**", "$HOME/**"]
|
||||
},
|
||||
"path": {
|
||||
"all": true
|
||||
},
|
||||
"http": {
|
||||
"all": true,
|
||||
"request": true,
|
||||
"scope": ["http://localhost:11438/**", "http://localhost:11439/**"]
|
||||
},
|
||||
"shell": {
|
||||
"all": true,
|
||||
"execute": true,
|
||||
"open": true
|
||||
}
|
||||
},
|
||||
"bundle": {
|
||||
"active": true,
|
||||
"category": "DeveloperTool",
|
||||
"copyright": "Copyright © 2026 Momentry",
|
||||
"deb": {
|
||||
"depends": []
|
||||
},
|
||||
"externalBin": [],
|
||||
"icon": [
|
||||
"icons/32x32.png",
|
||||
"icons/128x128.png",
|
||||
"icons/128x128@2x.png",
|
||||
"icons/icon.icns",
|
||||
"icons/icon.ico"
|
||||
],
|
||||
"identifier": "com.momentry.markbase",
|
||||
"longDescription": "Momentry Display Engine - A Tauri-based desktop application for MarkBase management",
|
||||
"macOS": {
|
||||
"entitlements": null,
|
||||
"exceptionDomain": "",
|
||||
"frameworks": [],
|
||||
"providerShortName": null,
|
||||
"signingIdentity": null
|
||||
},
|
||||
"resources": ["../../data/**"],
|
||||
"shortDescription": "Momentry Display Engine",
|
||||
"targets": "all",
|
||||
"windows": {
|
||||
"certificateThumbprint": null,
|
||||
"digestAlgorithm": "sha256",
|
||||
"timestampUrl": ""
|
||||
}
|
||||
},
|
||||
"security": {
|
||||
"csp": null
|
||||
},
|
||||
"updater": {
|
||||
"active": false
|
||||
},
|
||||
"app": {
|
||||
"withGlobalTauri": false,
|
||||
"windows": [
|
||||
{
|
||||
"fullscreen": false,
|
||||
@@ -80,4 +44,4 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user