Vue init (#47)

This commit is contained in:
Geometrically
2023-02-27 09:11:34 -07:00
committed by GitHub
parent e591b7120a
commit c204caa350
58 changed files with 727 additions and 6666 deletions

4
theseus_gui/src-tauri/.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
# Generated by Cargo
# will have compiled files and executables
/target/

View File

@@ -1,24 +1,26 @@
[package]
name = "theseus_gui"
version = "0.1.0"
default-run = "theseus_gui"
version = "0.0.0"
description = "A Tauri App"
authors = ["you"]
license = ""
repository = ""
edition = "2021"
rust-version = "1.57"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[build-dependencies]
tauri-build = { version = "1.0.4", features = [] }
tauri-build = { version = "1.2", features = [] }
[dependencies]
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
tauri = { version = "1.0.4", features = ["api-all"] }
tauri = { version = "1.2", features = ["shell-open"] }
[features]
# 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
default = [ "custom-protocol" ]
default = ["custom-protocol"]
# this feature is used used for production builds where `devPath` points to the filesystem
# DO NOT remove this
custom-protocol = [ "tauri/custom-protocol" ]
custom-protocol = ["tauri/custom-protocol"]

View File

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

View File

@@ -3,88 +3,8 @@
windows_subsystem = "windows"
)]
use tauri::api::shell;
use tauri::{
CustomMenuItem, Manager, Menu, MenuEntry, MenuItem, Submenu, WindowBuilder, WindowUrl,
};
fn main() {
let ctx = tauri::generate_context!(); // Run `pnpm build:web` (builds the web app) to get rid of the error.
tauri::Builder::default()
.invoke_handler(tauri::generate_handler![])
.setup(|app| {
let _win = WindowBuilder::new(app, "main", WindowUrl::default())
.title("Modrinth")
.resizable(true)
.decorations(true)
.always_on_top(false)
.inner_size(800.0, 550.0)
.min_inner_size(400.0, 200.0)
.skip_taskbar(false)
.fullscreen(false)
.build()?;
Ok(())
})
.menu(Menu::with_items([
#[cfg(target_os = "macos")]
MenuEntry::Submenu(Submenu::new(
&ctx.package_info().name,
Menu::with_items([
// MenuItem::About(ctx.package_info().name.clone()).into(),
MenuItem::Separator.into(),
MenuItem::Services.into(),
MenuItem::Separator.into(),
MenuItem::Hide.into(),
MenuItem::HideOthers.into(),
MenuItem::ShowAll.into(),
MenuItem::Separator.into(),
MenuItem::Quit.into(),
]),
)),
MenuEntry::Submenu(Submenu::new(
"File",
Menu::with_items([MenuItem::CloseWindow.into()]),
)),
MenuEntry::Submenu(Submenu::new(
"Edit",
Menu::with_items([
MenuItem::Undo.into(),
MenuItem::Redo.into(),
MenuItem::Separator.into(),
MenuItem::Cut.into(),
MenuItem::Copy.into(),
MenuItem::Paste.into(),
#[cfg(not(target_os = "macos"))]
MenuItem::Separator.into(),
MenuItem::SelectAll.into(),
]),
)),
MenuEntry::Submenu(Submenu::new(
"View",
Menu::with_items([MenuItem::EnterFullScreen.into()]),
)),
MenuEntry::Submenu(Submenu::new(
"Window",
Menu::with_items([MenuItem::Minimize.into(), MenuItem::Zoom.into()]),
)),
// You should always have a Help menu on macOS because it will automatically
// show a menu search field
MenuEntry::Submenu(Submenu::new(
"Help",
Menu::with_items([CustomMenuItem::new("Learn More", "Learn More").into()]),
)),
]))
.on_menu_event(|event| {
let event_name = event.menu_item_id();
match event_name {
"Learn More" => {
let url = "https://github.com/probablykasper/tauri-template".to_string();
shell::open(&event.window().shell_scope(), url, None).unwrap();
}
_ => {}
}
})
.run(ctx)
.run(tauri::generate_context!())
.expect("error while running tauri application");
}

View File

@@ -1,23 +1,31 @@
{
"package": {
"productName": "Modrinth"
},
"build": {
"distDir": "../build",
"devPath": "http://localhost:5173",
"beforeDevCommand": "pnpm dev:web",
"beforeBuildCommand": "pnpm run build:web"
"beforeDevCommand": "yarn dev",
"beforeBuildCommand": "yarn build",
"devPath": "http://localhost:1420",
"distDir": "../dist",
"withGlobalTauri": false
},
"package": {
"productName": "theseus_gui",
"version": "0.0.0"
},
"tauri": {
"allowlist": {
"all": false,
"shell": {
"all": false,
"open": true
}
},
"bundle": {
"active": true,
"targets": [
"dmg",
"deb",
"appimage",
"msi"
],
"identifier": "com.modrinth.theseus",
"category": "DeveloperTool",
"copyright": "",
"deb": {
"depends": []
},
"externalBin": [],
"icon": [
"icons/32x32.png",
"icons/128x128.png",
@@ -25,37 +33,38 @@
"icons/icon.icns",
"icons/icon.ico"
],
"resources": [],
"externalBin": [],
"copyright": "",
"category": "Game",
"shortDescription": "",
"identifier": "com.tauri.dev",
"longDescription": "",
"deb": {
"depends": []
},
"macOS": {
"frameworks": [],
"minimumSystemVersion": "",
"entitlements": null,
"exceptionDomain": "",
"signingIdentity": null,
"frameworks": [],
"providerShortName": null,
"entitlements": null
"signingIdentity": null
},
"resources": [],
"shortDescription": "",
"targets": "all",
"windows": {
"certificateThumbprint": null,
"digestAlgorithm": "sha256",
"timestampUrl": ""
}
},
"security": {
"csp": null
},
"updater": {
"active": false
},
"allowlist": {
"all": true
},
"security": {
"csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'"
}
"windows": [
{
"fullscreen": false,
"height": 600,
"resizable": true,
"title": "theseus_gui",
"width": 800
}
]
}
}