feat: upgrade to tauri beta

This commit is contained in:
2024-02-05 08:14:58 +07:00
parent 7bd6f6a8db
commit 8a17c36a5b
12 changed files with 843 additions and 400 deletions

761
src-tauri/Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -8,44 +8,37 @@ edition = "2021"
rust-version = "1.70" rust-version = "1.70"
[build-dependencies] [build-dependencies]
tauri-build = { version = "2.0.0-alpha", features = [] } tauri-build = { version = "2.0.0-beta", features = [] }
[dependencies] [dependencies]
nostr-sdk = { version = "0.27", features = ["sqlite"] } nostr-sdk = { version = "0.27", features = ["sqlite"] }
tokio = { version = "1", features = ["full"] } tokio = { version = "1", features = ["full"] }
serde_json = "1.0" serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
tauri = { version = "2.0.0-alpha", features = [ tauri = { version = "2.0.0-beta", features = [
"tray-icon", "tray-icon",
"macos-private-api", "macos-private-api",
"native-tls-vendored", "native-tls-vendored",
"protocol-asset", "protocol-asset",
] } ] }
tauri-plugin-cli = "2.0.0-alpha" tauri-plugin-cli = "2.0.0-beta"
tauri-plugin-clipboard-manager = "2.0.0-alpha" tauri-plugin-clipboard-manager = "2.0.0-beta"
tauri-plugin-dialog = "2.0.0-alpha" tauri-plugin-dialog = "2.0.0-beta"
tauri-plugin-fs = "2.0.0-alpha" tauri-plugin-fs = "2.0.0-beta"
tauri-plugin-http = "2.0.0-alpha" tauri-plugin-http = "2.0.0-beta"
tauri-plugin-notification = "2.0.0-alpha" tauri-plugin-notification = "2.0.0-beta"
tauri-plugin-os = "2.0.0-alpha" tauri-plugin-os = "2.0.0-beta"
tauri-plugin-process = "2.0.0-alpha" tauri-plugin-process = "2.0.0-beta"
tauri-plugin-shell = "2.0.0-alpha" tauri-plugin-shell = "2.0.0-beta"
tauri-plugin-updater = "2.0.0-alpha" tauri-plugin-updater = "2.0.0-beta"
tauri-plugin-autostart = "2.0.0-alpha" tauri-plugin-autostart = "2.0.0-beta"
tauri-plugin-store = "2.0.0-alpha" tauri-plugin-store = "2.0.0-beta"
tauri-plugin-upload = "2.0.0-alpha" tauri-plugin-upload = "2.0.0-beta"
tauri-plugin-window-state = "2.0.0-alpha" tauri-plugin-window-state = "2.0.0-beta"
tauri-plugin-theme = { git = "https://github.com/wyhaya/tauri-plugin-theme" } tauri-plugin-theme = { git = "https://github.com/wyhaya/tauri-plugin-theme" }
webpage = { version = "2.0", features = ["serde"] } webpage = { version = "2.0", features = ["serde"] }
[target.'cfg(not(target_os = "linux"))'.dependencies]
keyring = "2" keyring = "2"
[target.'cfg(target_os = "linux")'.dependencies]
keyring = { version = "2", default_features = false, features = [
"linux-secret-service",
] }
[features] [features]
# by default Tauri runs in production mode # by default Tauri runs in production mode
# when `tauri dev` runs it is executed with `cargo run --no-default-features` if `devPath` is an URL # when `tauri dev` runs it is executed with `cargo run --no-default-features` if `devPath` is an URL

81
src-tauri/gen/main.json Normal file
View File

@@ -0,0 +1,81 @@
{
"$schema": "./schemas/desktop-schema.json",
"identifier": "desktop-capability",
"description": "Capability for the desktop",
"platforms": [
"linux",
"macOS",
"windows"
],
"windows": [
"main",
"settings",
"event-*",
"user-*",
"column-*"
],
"permissions": [
"path:default",
"event:default",
"window:default",
"app:default",
"resources:default",
"menu:default",
"tray:default",
"shell:open",
"theme:allow-set-theme",
"theme:allow-get-theme",
{
"identifier": "http:default",
"allow": [
{
"url": "http://**/"
},
{
"url": "https://**/"
}
]
},
{
"identifier": "fs:scope",
"allow": [
{
"path": "$APPDATA/*"
},
{
"path": "$LOCALDATA/*"
},
{
"path": "$DESKTOP/*"
},
{
"path": "$DOCUMENT/*"
},
{
"path": "$DOWNLOAD/*"
},
{
"path": "$HOME/*"
},
{
"path": "$PICTURE/*"
},
{
"path": "$PUBLIC/*"
},
{
"path": "$VIDEO/*"
},
{
"path": "$RESOURCE"
},
{
"path": "$RESOURCE/*"
},
{
"path": "$RESOURCE/locales/*"
}
]
}
]
}

View File

@@ -0,0 +1 @@
{}

View File

@@ -0,0 +1 @@
{schema_str}

View File

@@ -0,0 +1 @@
{schema_str}

File diff suppressed because one or more lines are too long

View File

@@ -10,7 +10,6 @@ use nostr_sdk::prelude::*;
use std::sync::Arc; use std::sync::Arc;
use tauri::Manager; use tauri::Manager;
use tauri_plugin_autostart::MacosLauncher; use tauri_plugin_autostart::MacosLauncher;
use tauri_plugin_theme::ThemePlugin;
pub struct AppState { pub struct AppState {
pub nostr: Arc<Client>, pub nostr: Arc<Client>,
@@ -54,7 +53,7 @@ fn main() {
Ok(()) Ok(())
}) })
.plugin(ThemePlugin::init(ctx.config_mut())) .plugin(tauri_plugin_theme::init(ctx.config_mut()))
.plugin(tauri_plugin_clipboard_manager::init()) .plugin(tauri_plugin_clipboard_manager::init())
.plugin(tauri_plugin_dialog::init()) .plugin(tauri_plugin_dialog::init())
.plugin(tauri_plugin_fs::init()) .plugin(tauri_plugin_fs::init())

View File

@@ -1,125 +1,116 @@
{ {
"$schema": "../node_modules/@tauri-apps/cli/schema.json", "$schema": "../node_modules/@tauri-apps/cli/schema.json",
"build": { "productName": "Lume",
"beforeBuildCommand": "pnpm run build", "version": "3.0.1",
"beforeDevCommand": "pnpm run dev", "identifier": "nu.lume.Lume",
"devPath": "http://localhost:3000", "build": {
"distDir": "../dist", "beforeBuildCommand": "pnpm run build",
"withGlobalTauri": true "beforeDevCommand": "pnpm run dev",
}, "devUrl": "http://localhost:3000",
"package": { "frontendDist": "../dist"
"productName": "Lume", },
"version": "3.0.1" "app": {
}, "macOSPrivateApi": true,
"plugins": { "withGlobalTauri": true,
"fs": { "security": {
"scope": [ "assetProtocol": {
"$APPDATA/*", "enable": true,
"$DATA/*", "scope": [
"$LOCALDATA/*", "$APPDATA/*",
"$DESKTOP/*", "$DATA/*",
"$DOCUMENT/*", "$LOCALDATA/*",
"$DOWNLOAD/*", "$DESKTOP/*",
"$HOME/*", "$DOCUMENT/*",
"$PICTURE/*", "$DOWNLOAD/*",
"$PUBLIC/*", "$HOME/*",
"$VIDEO/*", "$PICTURE/*",
"$RESOURCE", "$PUBLIC/*",
"$RESOURCE/*", "$VIDEO/*",
"$RESOURCE/**", "$APPCONFIG/*",
"$RESOURCE/locales/*" "$RESOURCE/*"
] ]
}, }
"http": { },
"scope": ["http://**/", "https://**/"] "trayIcon": {
}, "iconPath": "icons/tray.png"
"shell": { }
"open": true, },
"scope": [] "bundle": {
}, "licenseFile": "../LICENSE",
"updater": { "longDescription": "nostr client for desktop",
"endpoints": [ "shortDescription": "nostr client",
"https://lus.reya3772.workers.dev/v1/{{target}}/{{arch}}/{{current_version}}", "targets": "all",
"https://lus.reya3772.workers.dev/{{target}}/{{current_version}}" "active": true,
] "category": "SocialNetworking",
} "resources": [
}, "resources/*",
"tauri": { "./locales/*"
"bundle": { ],
"active": true, "icon": [
"category": "SocialNetworking", "icons/32x32.png",
"deb": { "icons/128x128.png",
"depends": [] "icons/128x128@2x.png",
}, "icons/icon.icns",
"externalBin": [], "icons/icon.ico"
"resources": ["resources/*", "./locales/*"], ],
"icon": [ "linux": {
"icons/32x32.png", "appimage": {
"icons/128x128.png", "bundleMediaFramework": true,
"icons/128x128@2x.png", "files": {}
"icons/icon.icns", },
"icons/icon.ico" "deb": {
], "files": {}
"copyright": "", },
"identifier": "nu.lume.Lume", "rpm": {
"longDescription": "nostr client for desktop", "epoch": 0,
"shortDescription": "nostr client", "files": {},
"targets": "all", "release": "1"
"updater": { }
"active": true, },
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEU3OTdCMkM3RjU5QzE2NzkKUldSNUZwejF4N0tYNTVHYjMrU0JkL090SlEyNUVLYU5TM2hTU3RXSWtEWngrZWJ4a0pydUhXZHEK", "macOS": {
"windows": { "dmg": {
"installMode": "quiet" "appPosition": {
} "x": 180,
}, "y": 170
"appimage": { },
"bundleMediaFramework": true "applicationFolderPosition": {
}, "x": 480,
"rpm": { "y": 170
"epoch": 0, },
"files": {}, "windowSize": {
"release": "1" "height": 400,
}, "width": 660
"macOS": { }
"entitlements": null, },
"exceptionDomain": "", "files": {},
"frameworks": [], "minimumSystemVersion": "10.15"
"license": "../LICENSE", },
"minimumSystemVersion": "10.15.0", "windows": {
"providerShortName": null, "allowDowngrades": true,
"signingIdentity": null "certificateThumbprint": null,
}, "digestAlgorithm": "sha256",
"windows": { "nsis": null,
"certificateThumbprint": null, "timestampUrl": null,
"digestAlgorithm": "sha256", "tsp": false,
"timestampUrl": "" "webviewFixedRuntimePath": null,
} "webviewInstallMode": {
}, "silent": true,
"security": { "type": "downloadBootstrapper"
"assetProtocol": { },
"enable": true, "wix": null
"scope": [ }
"$APPDATA/*", },
"$DATA/*", "plugins": {
"$LOCALDATA/*", "updater": {
"$DESKTOP/*", "active": true,
"$DOCUMENT/*", "pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEU3OTdCMkM3RjU5QzE2NzkKUldSNUZwejF4N0tYNTVHYjMrU0JkL090SlEyNUVLYU5TM2hTU3RXSWtEWngrZWJ4a0pydUhXZHEK",
"$DOWNLOAD/*", "windows": {
"$HOME/*", "installMode": "quiet"
"$PICTURE/*", },
"$PUBLIC/*", "endpoints": [
"$VIDEO/*", "https://lus.reya3772.workers.dev/v1/{{target}}/{{arch}}/{{current_version}}",
"$APPCONFIG/*", "https://lus.reya3772.workers.dev/{{target}}/{{current_version}}"
"$RESOURCE/*" ]
] }
}, }
"dangerousDisableAssetCspModification": false,
"dangerousRemoteDomainIpcAccess": [],
"freezePrototype": false
},
"trayIcon": {
"iconPath": "icons/tray.png"
},
"macOSPrivateApi": true
}
} }

View File

@@ -1,19 +1,19 @@
{ {
"$schema": "../node_modules/@tauri-apps/cli/schema.json", "$schema": "../node_modules/@tauri-apps/cli/schema.json",
"tauri": { "app": {
"windows": [ "windows": [
{ {
"width": 1080, "width": 1080,
"height": 800, "height": 800,
"minWidth": 1080, "minWidth": 1080,
"minHeight": 800, "minHeight": 800,
"resizable": true, "resizable": true,
"title": "Lume", "title": "Lume",
"center": true, "center": true,
"fullscreen": false, "fullscreen": false,
"fileDropEnabled": true, "fileDropEnabled": true,
"decorations": true "decorations": true
} }
] ]
} }
} }

View File

@@ -1,25 +1,27 @@
{ {
"$schema": "../node_modules/@tauri-apps/cli/schema.json", "$schema": "../node_modules/@tauri-apps/cli/schema.json",
"tauri": { "app": {
"windows": [ "windows": [
{ {
"width": 1080, "width": 1080,
"height": 800, "height": 800,
"minWidth": 1080, "minWidth": 1080,
"minHeight": 800, "minHeight": 800,
"resizable": true, "resizable": true,
"title": "Lume", "title": "Lume",
"titleBarStyle": "Overlay", "titleBarStyle": "Overlay",
"center": true, "center": true,
"fullscreen": false, "fullscreen": false,
"hiddenTitle": true, "hiddenTitle": true,
"fileDropEnabled": true, "fileDropEnabled": true,
"decorations": true, "decorations": true,
"transparent": true, "transparent": true,
"windowEffects": { "windowEffects": {
"effects": ["sidebar"] "effects": [
} "sidebar"
} ]
] }
} }
]
}
} }

View File

@@ -1,20 +1,20 @@
{ {
"$schema": "../node_modules/@tauri-apps/cli/schema.json", "$schema": "../node_modules/@tauri-apps/cli/schema.json",
"tauri": { "app": {
"windows": [ "windows": [
{ {
"width": 1080, "width": 1080,
"height": 800, "height": 800,
"minWidth": 1080, "minWidth": 1080,
"minHeight": 800, "minHeight": 800,
"resizable": true, "resizable": true,
"title": "Lume", "title": "Lume",
"center": true, "center": true,
"fullscreen": false, "fullscreen": false,
"hiddenTitle": true, "hiddenTitle": true,
"fileDropEnabled": true, "fileDropEnabled": true,
"decorations": false "decorations": false
} }
] ]
} }
} }