@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.
Files changed (78) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +74 -0
  3. package/assets/vscode-settings.json +16 -0
  4. package/dist/bin/index.js +83 -0
  5. package/dist/cli/color.js +25 -0
  6. package/dist/cli/files.js +18 -0
  7. package/dist/cli/project.js +48 -0
  8. package/dist/cli/prompts.js +44 -0
  9. package/dist/cli/release-workflow.js +13 -0
  10. package/dist/cli/scaffold.js +30 -0
  11. package/dist/cli/text.js +24 -0
  12. package/dist/cli/types.js +1 -0
  13. package/dist/scripts/prepare-template.js +67 -0
  14. package/package.json +39 -0
  15. package/template/.editorconfig +8 -0
  16. package/template/.gitattributes +5 -0
  17. package/template/.github/dependabot.yml +38 -0
  18. package/template/.github/workflows/code-quality.yml +70 -0
  19. package/template/.github/workflows/release.yml +112 -0
  20. package/template/.husky/pre-commit +7 -0
  21. package/template/.oxfmtrc.json +36 -0
  22. package/template/.oxlintrc.json +24 -0
  23. package/template/.vscode/extensions.json +11 -0
  24. package/template/CHANGELOG.md +12 -0
  25. package/template/LICENSE +21 -0
  26. package/template/README.md +126 -0
  27. package/template/components.json +24 -0
  28. package/template/eslint.config.ts +32 -0
  29. package/template/index.html +14 -0
  30. package/template/package.json +74 -0
  31. package/template/pnpm-lock.yaml +3953 -0
  32. package/template/pnpm-workspace.yaml +3 -0
  33. package/template/public/favicon.ico +0 -0
  34. package/template/rust-toolchain.toml +2 -0
  35. package/template/scripts/bump-version.js +42 -0
  36. package/template/scripts/rename-app.js +137 -0
  37. package/template/scripts/utils.js +59 -0
  38. package/template/src/App.vue +71 -0
  39. package/template/src/assets/fonts/Geist/Geist-Italic[wght].woff2 +0 -0
  40. package/template/src/assets/fonts/Geist/Geist[wght].woff2 +0 -0
  41. package/template/src/assets/images/tauri.svg +6 -0
  42. package/template/src/assets/images/vite.svg +1 -0
  43. package/template/src/assets/images/vue.svg +1 -0
  44. package/template/src/generated/auto-import.d.ts +139 -0
  45. package/template/src/generated/bindings.ts +9 -0
  46. package/template/src/lib/utils.ts +8 -0
  47. package/template/src/main.ts +9 -0
  48. package/template/src/styles/fonts.css +15 -0
  49. package/template/src/styles/globals.css +130 -0
  50. package/template/src/vite-env.d.ts +7 -0
  51. package/template/src-tauri/Cargo.lock +6328 -0
  52. package/template/src-tauri/Cargo.toml +41 -0
  53. package/template/src-tauri/build.rs +3 -0
  54. package/template/src-tauri/capabilities/default.json +7 -0
  55. package/template/src-tauri/icons/128x128.png +0 -0
  56. package/template/src-tauri/icons/128x128@2x.png +0 -0
  57. package/template/src-tauri/icons/32x32.png +0 -0
  58. package/template/src-tauri/icons/Square107x107Logo.png +0 -0
  59. package/template/src-tauri/icons/Square142x142Logo.png +0 -0
  60. package/template/src-tauri/icons/Square150x150Logo.png +0 -0
  61. package/template/src-tauri/icons/Square284x284Logo.png +0 -0
  62. package/template/src-tauri/icons/Square30x30Logo.png +0 -0
  63. package/template/src-tauri/icons/Square310x310Logo.png +0 -0
  64. package/template/src-tauri/icons/Square44x44Logo.png +0 -0
  65. package/template/src-tauri/icons/Square71x71Logo.png +0 -0
  66. package/template/src-tauri/icons/Square89x89Logo.png +0 -0
  67. package/template/src-tauri/icons/StoreLogo.png +0 -0
  68. package/template/src-tauri/icons/icon.icns +0 -0
  69. package/template/src-tauri/icons/icon.ico +0 -0
  70. package/template/src-tauri/icons/icon.png +0 -0
  71. package/template/src-tauri/src/command/mod.rs +13 -0
  72. package/template/src-tauri/src/lib.rs +54 -0
  73. package/template/src-tauri/src/main.rs +6 -0
  74. package/template/src-tauri/tauri.conf.json +37 -0
  75. package/template/tsconfig.app.json +11 -0
  76. package/template/tsconfig.json +11 -0
  77. package/template/tsconfig.node.json +11 -0
  78. 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
@@ -0,0 +1,3 @@
1
+ fn main() {
2
+ tauri_build::build()
3
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "$schema": "../gen/schemas/desktop-schema.json",
3
+ "identifier": "default",
4
+ "description": "Capability for the main window",
5
+ "windows": ["main"],
6
+ "permissions": ["core:default", "log:default", "opener:default"]
7
+ }
@@ -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,6 @@
1
+ // Prevents additional console window on Windows in release, DO NOT REMOVE!!
2
+ #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
3
+
4
+ fn main() {
5
+ tauri_vue_template_lib::run()
6
+ }
@@ -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
+ "files": [],
3
+ "references": [
4
+ {
5
+ "path": "./tsconfig.node.json"
6
+ },
7
+ {
8
+ "path": "./tsconfig.app.json"
9
+ }
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
+ }));