@duonghieu0712z/create-tauri-vue-template 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +74 -0
- package/assets/vscode-settings.json +16 -0
- package/dist/bin/index.js +83 -0
- package/dist/cli/color.js +25 -0
- package/dist/cli/files.js +18 -0
- package/dist/cli/project.js +48 -0
- package/dist/cli/prompts.js +44 -0
- package/dist/cli/release-workflow.js +13 -0
- package/dist/cli/scaffold.js +30 -0
- package/dist/cli/text.js +24 -0
- package/dist/cli/types.js +1 -0
- package/dist/scripts/prepare-template.js +67 -0
- package/package.json +39 -0
- package/template/.editorconfig +8 -0
- package/template/.gitattributes +5 -0
- package/template/.github/dependabot.yml +38 -0
- package/template/.github/workflows/code-quality.yml +70 -0
- package/template/.github/workflows/release.yml +112 -0
- package/template/.husky/pre-commit +7 -0
- package/template/.oxfmtrc.json +36 -0
- package/template/.oxlintrc.json +24 -0
- package/template/.vscode/extensions.json +11 -0
- package/template/CHANGELOG.md +12 -0
- package/template/LICENSE +21 -0
- package/template/README.md +126 -0
- package/template/components.json +24 -0
- package/template/eslint.config.ts +32 -0
- package/template/index.html +14 -0
- package/template/package.json +74 -0
- package/template/pnpm-lock.yaml +3953 -0
- package/template/pnpm-workspace.yaml +3 -0
- package/template/public/favicon.ico +0 -0
- package/template/rust-toolchain.toml +2 -0
- package/template/scripts/bump-version.js +42 -0
- package/template/scripts/rename-app.js +137 -0
- package/template/scripts/utils.js +59 -0
- package/template/src/App.vue +71 -0
- package/template/src/assets/fonts/Geist/Geist-Italic[wght].woff2 +0 -0
- package/template/src/assets/fonts/Geist/Geist[wght].woff2 +0 -0
- package/template/src/assets/images/tauri.svg +6 -0
- package/template/src/assets/images/vite.svg +1 -0
- package/template/src/assets/images/vue.svg +1 -0
- package/template/src/generated/auto-import.d.ts +139 -0
- package/template/src/generated/bindings.ts +9 -0
- package/template/src/lib/utils.ts +8 -0
- package/template/src/main.ts +9 -0
- package/template/src/styles/fonts.css +15 -0
- package/template/src/styles/globals.css +130 -0
- package/template/src/vite-env.d.ts +7 -0
- package/template/src-tauri/Cargo.lock +6328 -0
- package/template/src-tauri/Cargo.toml +41 -0
- package/template/src-tauri/build.rs +3 -0
- package/template/src-tauri/capabilities/default.json +7 -0
- package/template/src-tauri/icons/128x128.png +0 -0
- package/template/src-tauri/icons/128x128@2x.png +0 -0
- package/template/src-tauri/icons/32x32.png +0 -0
- package/template/src-tauri/icons/Square107x107Logo.png +0 -0
- package/template/src-tauri/icons/Square142x142Logo.png +0 -0
- package/template/src-tauri/icons/Square150x150Logo.png +0 -0
- package/template/src-tauri/icons/Square284x284Logo.png +0 -0
- package/template/src-tauri/icons/Square30x30Logo.png +0 -0
- package/template/src-tauri/icons/Square310x310Logo.png +0 -0
- package/template/src-tauri/icons/Square44x44Logo.png +0 -0
- package/template/src-tauri/icons/Square71x71Logo.png +0 -0
- package/template/src-tauri/icons/Square89x89Logo.png +0 -0
- package/template/src-tauri/icons/StoreLogo.png +0 -0
- package/template/src-tauri/icons/icon.icns +0 -0
- package/template/src-tauri/icons/icon.ico +0 -0
- package/template/src-tauri/icons/icon.png +0 -0
- package/template/src-tauri/src/command/mod.rs +13 -0
- package/template/src-tauri/src/lib.rs +54 -0
- package/template/src-tauri/src/main.rs +6 -0
- package/template/src-tauri/tauri.conf.json +37 -0
- package/template/tsconfig.app.json +11 -0
- package/template/tsconfig.json +11 -0
- package/template/tsconfig.node.json +11 -0
- package/template/vite.config.ts +42 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "tauri-vue-template"
|
|
3
|
+
version = "0.0.1"
|
|
4
|
+
description = "A Tauri Vue application template"
|
|
5
|
+
authors = ["duonghieu0712z"]
|
|
6
|
+
edition = "2024"
|
|
7
|
+
|
|
8
|
+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
9
|
+
|
|
10
|
+
[lib]
|
|
11
|
+
# The `_lib` suffix may seem redundant but it is necessary
|
|
12
|
+
# to make the lib name unique and wouldn't conflict with the bin name.
|
|
13
|
+
# This seems to be only an issue on Windows, see https://github.com/rust-lang/cargo/issues/8519
|
|
14
|
+
name = "tauri_vue_template_lib"
|
|
15
|
+
crate-type = ["staticlib", "cdylib", "rlib"]
|
|
16
|
+
|
|
17
|
+
[dependencies]
|
|
18
|
+
chrono = "0.4.44"
|
|
19
|
+
log = "0.4.29"
|
|
20
|
+
serde = { version = "1.0.228", features = ["derive"] }
|
|
21
|
+
specta = { version = "2.0.0-rc.25", features = ["derive"] }
|
|
22
|
+
specta-typescript = "0.0.12"
|
|
23
|
+
tauri = { version = "2.11.2", features = [] }
|
|
24
|
+
tauri-plugin-devtools = "2.1.0"
|
|
25
|
+
tauri-plugin-log = "2.8.0"
|
|
26
|
+
tauri-plugin-opener = "2.5.4"
|
|
27
|
+
tauri-plugin-prevent-default = "5.0.0"
|
|
28
|
+
tauri-specta = { version = "2.0.0-rc.25", features = ["javascript", "typescript"] }
|
|
29
|
+
|
|
30
|
+
[build-dependencies]
|
|
31
|
+
tauri-build = { version = "2.6.2", features = [] }
|
|
32
|
+
|
|
33
|
+
[profile.dev]
|
|
34
|
+
incremental = true
|
|
35
|
+
|
|
36
|
+
[profile.release]
|
|
37
|
+
codegen-units = 1
|
|
38
|
+
lto = true
|
|
39
|
+
opt-level = "s"
|
|
40
|
+
panic = "abort"
|
|
41
|
+
strip = true
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
use tauri::Runtime;
|
|
2
|
+
use tauri_specta::{Commands, collect_commands};
|
|
3
|
+
|
|
4
|
+
pub fn commands<R: Runtime>() -> Commands<R> {
|
|
5
|
+
collect_commands![greet]
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
#[tauri::command]
|
|
9
|
+
#[specta::specta]
|
|
10
|
+
fn greet(name: &str) -> String {
|
|
11
|
+
log::info!("Backend was called with an argument: {}", name);
|
|
12
|
+
format!("Hello, {}! You've been greeted from Rust!", name)
|
|
13
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
use tauri_specta::Builder;
|
|
2
|
+
|
|
3
|
+
mod command;
|
|
4
|
+
|
|
5
|
+
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
|
6
|
+
pub fn run() {
|
|
7
|
+
let specta_builder = Builder::<tauri::Wry>::new().commands(command::commands());
|
|
8
|
+
|
|
9
|
+
#[cfg(all(debug_assertions, not(mobile)))]
|
|
10
|
+
{
|
|
11
|
+
use specta_typescript::Typescript;
|
|
12
|
+
|
|
13
|
+
specta_builder
|
|
14
|
+
.export(Typescript::default(), "../src/generated/bindings.ts")
|
|
15
|
+
.unwrap();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
let builder = tauri::Builder::default()
|
|
19
|
+
.plugin(tauri_plugin_opener::init())
|
|
20
|
+
.plugin(tauri_plugin_prevent_default::debug());
|
|
21
|
+
|
|
22
|
+
#[cfg(debug_assertions)]
|
|
23
|
+
let builder = builder.plugin(tauri_plugin_devtools::init());
|
|
24
|
+
|
|
25
|
+
#[cfg(not(debug_assertions))]
|
|
26
|
+
let builder = builder.plugin(
|
|
27
|
+
tauri_plugin_log::Builder::new()
|
|
28
|
+
.level(log::LevelFilter::Info)
|
|
29
|
+
.filter(|metadata| metadata.target().starts_with(env!("CARGO_CRATE_NAME")))
|
|
30
|
+
.format(|out, message, record| {
|
|
31
|
+
out.finish(format_args!(
|
|
32
|
+
"[{}]|{:<5}: {}",
|
|
33
|
+
chrono::Local::now().format("%Y-%m-%d %H:%M:%S"),
|
|
34
|
+
record.level(),
|
|
35
|
+
message
|
|
36
|
+
))
|
|
37
|
+
})
|
|
38
|
+
.build(),
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
builder
|
|
42
|
+
.invoke_handler(specta_builder.invoke_handler())
|
|
43
|
+
.setup(|_app| {
|
|
44
|
+
#[cfg(debug_assertions)]
|
|
45
|
+
{
|
|
46
|
+
use tauri::Manager;
|
|
47
|
+
|
|
48
|
+
_app.get_webview_window("main").unwrap().open_devtools();
|
|
49
|
+
}
|
|
50
|
+
Ok(())
|
|
51
|
+
})
|
|
52
|
+
.run(tauri::generate_context!())
|
|
53
|
+
.expect("error while running tauri application");
|
|
54
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://schema.tauri.app/config/2",
|
|
3
|
+
"productName": "Tauri Vue Template",
|
|
4
|
+
"version": "0.0.1",
|
|
5
|
+
"identifier": "dev.duonghieu0712z.tauri-vue-template",
|
|
6
|
+
"build": {
|
|
7
|
+
"beforeDevCommand": "pnpm dev",
|
|
8
|
+
"devUrl": "http://localhost:1420",
|
|
9
|
+
"beforeBuildCommand": "pnpm build",
|
|
10
|
+
"frontendDist": "../dist"
|
|
11
|
+
},
|
|
12
|
+
"app": {
|
|
13
|
+
"windows": [
|
|
14
|
+
{
|
|
15
|
+
"title": "Tauri Vue Template",
|
|
16
|
+
"width": 1200,
|
|
17
|
+
"height": 800,
|
|
18
|
+
"center": true
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"security": {
|
|
22
|
+
"csp": null
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"bundle": {
|
|
26
|
+
"publisher": "duonghieu0712z",
|
|
27
|
+
"active": true,
|
|
28
|
+
"targets": "all",
|
|
29
|
+
"icon": [
|
|
30
|
+
"icons/32x32.png",
|
|
31
|
+
"icons/128x128.png",
|
|
32
|
+
"icons/128x128@2x.png",
|
|
33
|
+
"icons/icon.icns",
|
|
34
|
+
"icons/icon.ico"
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "@vue/tsconfig/tsconfig.dom.json",
|
|
3
|
+
"include": ["src/**/*", "src/**/*.vue"],
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"noUncheckedIndexedAccess": true,
|
|
6
|
+
"paths": {
|
|
7
|
+
"@/*": ["./src/*"]
|
|
8
|
+
},
|
|
9
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "@tsconfig/node24/tsconfig.json",
|
|
3
|
+
"include": ["vite.config.*", "eslint.config.*"],
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"module": "preserve",
|
|
6
|
+
"moduleResolution": "bundler",
|
|
7
|
+
"types": ["node"],
|
|
8
|
+
"allowSyntheticDefaultImports": true,
|
|
9
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { fileURLToPath, URL } from 'node:url';
|
|
2
|
+
|
|
3
|
+
import tailwindcss from '@tailwindcss/vite';
|
|
4
|
+
import vue from '@vitejs/plugin-vue';
|
|
5
|
+
import AutoImport from 'unplugin-auto-import/vite';
|
|
6
|
+
import Components from 'unplugin-vue-components/vite';
|
|
7
|
+
import { defineConfig } from 'vite';
|
|
8
|
+
import vueDevTools from 'vite-plugin-vue-devtools';
|
|
9
|
+
|
|
10
|
+
const host = process.env.TAURI_DEV_HOST;
|
|
11
|
+
|
|
12
|
+
// https://vite.dev/config/
|
|
13
|
+
export default defineConfig(async () => ({
|
|
14
|
+
plugins: [
|
|
15
|
+
vue(),
|
|
16
|
+
tailwindcss(),
|
|
17
|
+
vueDevTools(),
|
|
18
|
+
AutoImport({ imports: ['vue'], dts: 'src/generated/auto-import.d.ts', vueTemplate: true }),
|
|
19
|
+
Components({ dirs: ['src/components'], dts: 'src/generated/components.d.ts' }),
|
|
20
|
+
],
|
|
21
|
+
resolve: {
|
|
22
|
+
alias: {
|
|
23
|
+
'@': fileURLToPath(new URL('src', import.meta.url)),
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
// Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`
|
|
28
|
+
//
|
|
29
|
+
// 1. prevent Vite from obscuring rust errors
|
|
30
|
+
clearScreen: false,
|
|
31
|
+
// 2. tauri expects a fixed port, fail if that port is not available
|
|
32
|
+
server: {
|
|
33
|
+
port: 1420,
|
|
34
|
+
strictPort: true,
|
|
35
|
+
host: host || false,
|
|
36
|
+
hmr: host ? { protocol: 'ws', host, port: 1421 } : undefined,
|
|
37
|
+
watch: {
|
|
38
|
+
// 3. tell Vite to ignore watching `src-tauri`
|
|
39
|
+
ignored: ['**/src-tauri/**'],
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
}));
|