migrate to tauri 2.0

This commit is contained in:
Triston Armstrong 2024-10-02 23:59:14 -04:00
parent ae67b77913
commit ff132f91d7
7 changed files with 1153 additions and 714 deletions

BIN
bun.lockb

Binary file not shown.

View File

@ -10,11 +10,12 @@
"tauri": "tauri" "tauri": "tauri"
}, },
"dependencies": { "dependencies": {
"@tauri-apps/api": "^1.6.0", "@tauri-apps/api": "^2.0.0-rc.0",
"@tauri-apps/plugin-shell": "~2.0.0-rc",
"kaioken": "^0.31.0" "kaioken": "^0.31.0"
}, },
"devDependencies": { "devDependencies": {
"@tauri-apps/cli": "^1.6.2", "@tauri-apps/cli": "^2.0.0-rc.18",
"autoprefixer": "^10.4.20", "autoprefixer": "^10.4.20",
"postcss": "^8.4.47", "postcss": "^8.4.47",
"tailwindcss": "^3.4.13", "tailwindcss": "^3.4.13",

1794
src-tauri/Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -8,12 +8,13 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[build-dependencies] [build-dependencies]
tauri-build = { version = "1", features = [] } tauri-build = { version = "2.0.0-rc", features = [] }
[dependencies] [dependencies]
tauri = { version = "1", features = ["shell-open"] } tauri = { version = "2.0.0-rc", features = [] }
serde = { version = "1", features = ["derive"] } serde = { version = "1", features = ["derive"] }
serde_json = "1" serde_json = "1"
tauri-plugin-shell = "2.0.0-rc"
[features] [features]
# This feature is used for production builds or when a dev server is not specified, DO NOT REMOVE!! # This feature is used for production builds or when a dev server is not specified, DO NOT REMOVE!!

View File

@ -0,0 +1,13 @@
{
"identifier": "migrated",
"description": "permissions that were migrated from v1",
"local": true,
"windows": [
"main"
],
"permissions": [
"core:default",
"shell:allow-open",
"shell:default"
]
}

View File

@ -9,6 +9,7 @@ fn greet(name: &str) -> String {
fn main() { fn main() {
tauri::Builder::default() tauri::Builder::default()
.plugin(tauri_plugin_shell::init())
.invoke_handler(tauri::generate_handler![greet]) .invoke_handler(tauri::generate_handler![greet])
.run(tauri::generate_context!()) .run(tauri::generate_context!())
.expect("error while running tauri application"); .expect("error while running tauri application");

View File

@ -2,43 +2,36 @@
"build": { "build": {
"beforeDevCommand": "bun run dev", "beforeDevCommand": "bun run dev",
"beforeBuildCommand": "bun run build", "beforeBuildCommand": "bun run build",
"devPath": "http://localhost:1420", "frontendDist": "../dist",
"distDir": "../dist", "devUrl": "http://localhost:1420"
"withGlobalTauri": true
}, },
"package": { "bundle": {
"productName": "KlectrTemplate", "active": true,
"version": "0.0.0" "targets": "all",
"icon": [
"icons/32x32.png",
"icons/128x128.png",
"icons/128x128@2x.png",
"icons/icon.icns",
"icons/icon.ico"
]
}, },
"tauri": { "productName": "KlectrTemplate",
"allowlist": { "mainBinaryName": "KlectrTemplate",
"all": false, "version": "0.0.0",
"shell": { "identifier": "com.klectr-template.dev",
"all": false, "plugins": {},
"open": true "app": {
} "withGlobalTauri": true,
},
"windows": [ "windows": [
{ {
"title": "KlectrTemplate", "title": "KlectrTemplate",
"width": 500, "width": 500,
"height": 500 "height": 500
} }
], ],
"security": { "security": {
"csp": null "csp": null
},
"bundle": {
"active": true,
"targets": "all",
"identifier": "com.klectr-template.dev",
"icon": [
"icons/32x32.png",
"icons/128x128.png",
"icons/128x128@2x.png",
"icons/icon.icns",
"icons/icon.ico"
]
} }
} }
} }