add tauri

This commit is contained in:
polv committed 2026-06-25 13:18:21 +07:00
1 parent 590ec40548
commit 126a3749f9
28 files changed
+6068 -710

No files matched your search

+25 -2
View File
@@ -1,6 +1,6 @@
import { defineConfig } from 'vitepress' import { defineConfig } from 'vitepress'
const TAURI_HOST = '' const host = process.env.TAURI_DEV_HOST;
// https://vitepress.dev/reference/site-config // https://vitepress.dev/reference/site-config
export default defineConfig({ export default defineConfig({
@@ -23,7 +23,7 @@ export default defineConfig({
], ],
socialLinks: [ socialLinks: [
{ icon: 'github', link: 'https://github.com/vuejs/vitepress' } { icon: 'github', link: 'https://git.polv.cc/polv/yt2press' }
] ]
}, },
markdown: { markdown: {
@@ -34,6 +34,16 @@ export default defineConfig({
vite: { vite: {
clearScreen: false, clearScreen: false,
server: { server: {
// make sure this port matches the devUrl port in tauri.conf.json file
port: 5173,
// Tauri expects a fixed port, fail if that port is not available
strictPort: true,
// if the host Tauri is expecting is set, use it
host: host || false,
watch: {
// tell vite to ignore watching `src-tauri`
ignored: ['**/src-tauri/**'],
},
proxy: { proxy: {
'/socket': { '/socket': {
target: 'ws://localhost:8080', target: 'ws://localhost:8080',
@@ -42,5 +52,18 @@ export default defineConfig({
} }
}, },
}, },
// Env variables starting with the item of `envPrefix` will be exposed in tauri's source code through `import.meta.env`.
envPrefix: ['VITE_', 'TAURI_ENV_*'],
build: {
// Tauri uses Chromium on Windows and WebKit on macOS and Linux
target:
process.env.TAURI_ENV_PLATFORM == 'windows'
? 'chrome105'
: 'safari13',
// don't minify for debug builds
minify: !process.env.TAURI_ENV_DEBUG ? 'esbuild' : false,
// produce sourcemaps for debug builds
sourcemap: !!process.env.TAURI_ENV_DEBUG,
},
} }
}) })
+8 -6
View File
@@ -7,20 +7,22 @@
"dependencies": { "dependencies": {
"gray-matter": "^4.0.3", "gray-matter": "^4.0.3",
"sharp": "^0.34.5", "sharp": "^0.34.5",
"vite": "^7.3.1", "vite": "^8.1.0",
"vitepress": "2.0.0-alpha.15", "vitepress": "2.0.0-alpha.15",
"vue": "^3.5.27", "vue": "^3.5.38",
"ws": "^8.19.0" "ws": "^8.21.0"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "24", "@tauri-apps/cli": "^2.11.3",
"@types/node": "^24.13.2",
"@types/ws": "^8.18.1", "@types/ws": "^8.18.1",
"concurrently": "^9.2.1" "concurrently": "^10.0.3"
}, },
"scripts": { "scripts": {
"dev": "concurrently 'pnpm:dev:*'", "dev": "concurrently 'pnpm:dev:*'",
"dev:server": "node server.js", "dev:server": "node server.js",
"dev:vite": "vitepress dev docs --open", "dev:tauri": "tauri dev",
"vite": "vitepress dev docs",
"build": "vitepress build docs", "build": "vitepress build docs",
"preview": "vitepress preview docs" "preview": "vitepress preview docs"
} }
+1165 -702
View File
File diff suppressed because it is too large. Load diff
+3
View File
@@ -0,0 +1,3 @@
onlyBuiltDependencies:
- esbuild
- sharp
+4
View File
@@ -0,0 +1,4 @@
# Generated by Cargo
# will have compiled files and executables
/target/
/gen/schemas
+4762
View File
File diff suppressed because it is too large. Load diff
+25
View File
@@ -0,0 +1,25 @@
[package]
name = "app"
version = "0.1.0"
description = "A Tauri App"
authors = ["you"]
license = ""
repository = ""
edition = "2021"
rust-version = "1.77.2"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
name = "app_lib"
crate-type = ["staticlib", "cdylib", "rlib"]
[build-dependencies]
tauri-build = { version = "2.6.3", features = [] }
[dependencies]
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
log = "0.4"
tauri = { version = "2.11.3", features = [] }
tauri-plugin-log = "2"
+3
View File
@@ -0,0 +1,3 @@
fn main() {
tauri_build::build()
}
+11
View File
@@ -0,0 +1,11 @@
{
"$schema": "../gen/schemas/desktop-schema.json",
"identifier": "default",
"description": "enables the default permissions",
"windows": [
"main"
],
"permissions": [
"core:default"
]
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

+16
View File
@@ -0,0 +1,16 @@
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
tauri::Builder::default()
.setup(|app| {
if cfg!(debug_assertions) {
app.handle().plugin(
tauri_plugin_log::Builder::default()
.level(log::LevelFilter::Info)
.build(),
)?;
}
Ok(())
})
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
+6
View File
@@ -0,0 +1,6 @@
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
fn main() {
app_lib::run();
}
+40
View File
@@ -0,0 +1,40 @@
{
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
"productName": "yt2press",
"version": "0.1.0",
"identifier": "com.tauri.dev",
"build": {
"frontendDist": "../docs/.vitepress/dist",
"devUrl": "http://localhost:5173",
"beforeDevCommand": "pnpm vite",
"beforeBuildCommand": "pnpm build"
},
"app": {
"windows": [
{
"title": "yt2press",
"width": 800,
"height": 600,
"resizable": true,
"fullscreen": false
}
],
"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"
],
"android": {
"debugApplicationIdSuffix": ".debug"
}
}
}