initial commit

This commit is contained in:
leo
2024-07-19 01:11:13 +02:00
commit 84b0451db4
32 changed files with 5823 additions and 0 deletions

7
src-tauri/.gitignore vendored Normal file
View File

@@ -0,0 +1,7 @@
# Generated by Cargo
# will have compiled files and executables
/target/
# Generated by Tauri
# will have schema files for capabilities auto-completion
/gen/schemas

5302
src-tauri/Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

23
src-tauri/Cargo.toml Normal file
View File

@@ -0,0 +1,23 @@
[package]
name = "tbd-vc"
version = "0.1.0"
description = "Chat Vocal"
authors = ["Leo"]
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[build-dependencies]
tauri-build = { version = "2.0.0-beta", features = [] }
[dependencies]
tauri = { version = "2.0.0-beta", features = ["devtools"] }
tauri-plugin-shell = "2.0.0-beta"
tauri-plugin-single-instance = "2.0.0-beta"
tauri-plugin-deep-link = "2.0.0-beta"
tauri-plugin-window-state = "2.0.0-beta"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
[target."cfg(not(any(target_os = \"android\", target_os = \"ios\")))".dependencies]
tauri-plugin-updater = "2.0.0-beta.10"

3
src-tauri/build.rs Normal file
View File

@@ -0,0 +1,3 @@
fn main() {
tauri_build::build()
}

View File

@@ -0,0 +1,20 @@
{
"$schema": "../gen/schemas/desktop-schema.json",
"identifier": "default",
"description": "Capability for the main window",
"windows": [
"main"
],
"permissions": [
"path:default",
"event:default",
"window:default",
"app:default",
"image:default",
"resources:default",
"menu:default",
"tray:default",
"shell:allow-open",
"updater:default"
]
}

BIN
src-tauri/icons/128x128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

BIN
src-tauri/icons/32x32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 837 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 794 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

196
src-tauri/icons/icon.icns Normal file

File diff suppressed because one or more lines are too long

BIN
src-tauri/icons/icon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 288 KiB

BIN
src-tauri/icons/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

42
src-tauri/src/main.rs Normal file
View File

@@ -0,0 +1,42 @@
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
use tauri::{Emitter, Manager};
#[derive(Clone, serde::Serialize)]
struct Payload {
args: Vec<String>,
}
fn main() {
tauri::Builder::default()
.plugin(tauri_plugin_updater::Builder::new().build())
.plugin(tauri_plugin_shell::init())
.plugin(tauri_plugin_window_state::Builder::default().build())
.plugin(tauri_plugin_deep_link::init())
.plugin(tauri_plugin_single_instance::init(|app, argv, _cwd| {
let window = app.get_webview_window("main").expect("No window open");
if window.is_minimized().unwrap_or(true) {
let _ = window.maximize();
}
let _ = window.set_focus();
let args: Vec<String> = argv.into_iter().skip(1).collect();
if args.len() != 0 {
app.emit("open", Payload { args }).unwrap();
}
}))
.setup(|app| {
let window = app.get_webview_window("main").unwrap();
let argv: Vec<String> = std::env::args().collect();
let args: Vec<String> = argv.into_iter().skip(1).collect();
window.emit("open", Payload { args }).unwrap();
Ok(())
})
.run(tauri::generate_context!())
.expect("error while running tauri application");
}

49
src-tauri/tauri.conf.json Normal file
View File

@@ -0,0 +1,49 @@
{
"productName": "tbd-vc",
"version": "0.1.0",
"identifier": "leo.tbd.vc",
"build": {
"beforeDevCommand": "bun run dev",
"devUrl": "http://localhost:1420",
"beforeBuildCommand": "bun run build",
"frontendDist": "../dist"
},
"app": {
"withGlobalTauri": true,
"windows": [
{
"title": "Chat Vocal",
"width": 800,
"height": 600,
"additionalBrowserArgs": "--autoplay-policy=no-user-gesture-required"
}
],
"security": {
"csp": null
}
},
"bundle": {
"active": true,
"targets": "all",
"icon": [
"icons/32x32.png",
"icons/128x128.png",
"icons/128x128@2x.png",
"icons/icon.icns",
"icons/icon.ico"
],
"createUpdaterArtifacts": true
},
"plugins": {
"deep-link": {
"mobile": [],
"desktop": {
"schemes": ["tbdvc"]
}
},
"updater": {
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEEyRkMxNzc1REUxMzE5NTkKUldSWkdSUGVkUmY4b3R0UCsra1lkanhzZldDVGZoTFFRRnpQTzBkRHplbmpkSXYvYkh6ekRBUy8K",
"endpoints": ["https://git.tarkacore.dev/mc-tbd/vc-app-metadata/raw/branch/main/version.json"]
}
}
}