@duonghieu0712z/create-tauri-vue-template 1.0.1 → 1.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/package.json +2 -2
- package/template/.gitattributes +0 -2
- package/template/.github/workflows/code-quality.yml +6 -83
- package/template/.github/workflows/quality-checks.yml +89 -0
- package/template/.github/workflows/release.yml +13 -5
- package/template/package.json +10 -9
- package/template/pnpm-lock.yaml +731 -717
- package/template/rust-toolchain.toml +1 -0
- package/template/{bump-version.js → scripts/bump-version.js} +1 -1
- package/template/src/generated/auto-import.d.ts +2 -0
- package/template/src-tauri/Cargo.lock +1 -1
- package/template/src-tauri/Cargo.toml +39 -0
- package/template/src-tauri/build.rs +1 -1
- package/template/src-tauri/clippy.toml +3 -0
- package/template/src-tauri/rustfmt.toml +14 -0
- package/template/src-tauri/src/command/mod.rs +2 -2
- package/template/src-tauri/src/lib.rs +15 -7
- package/template/src-tauri/src/main.rs +1 -1
|
@@ -5,7 +5,7 @@ import { readFile, writeFile } from 'node:fs/promises';
|
|
|
5
5
|
function parseArgs() {
|
|
6
6
|
const args = process.argv.slice(2).filter((arg) => arg !== '--');
|
|
7
7
|
if (args.length !== 1 || args[0].startsWith('--')) {
|
|
8
|
-
throw new Error('Usage: node bump-version.js VERSION');
|
|
8
|
+
throw new Error('Usage: node scripts/bump-version.js VERSION');
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
return {
|
|
@@ -39,3 +39,42 @@ lto = true
|
|
|
39
39
|
opt-level = "s"
|
|
40
40
|
panic = "abort"
|
|
41
41
|
strip = true
|
|
42
|
+
|
|
43
|
+
[lints.rust]
|
|
44
|
+
unsafe_code = "deny"
|
|
45
|
+
unused_must_use = "deny"
|
|
46
|
+
unused_imports = "warn"
|
|
47
|
+
unused_variables = "warn"
|
|
48
|
+
|
|
49
|
+
[lints.clippy]
|
|
50
|
+
all = { level = "warn", priority = -1 }
|
|
51
|
+
pedantic = { level = "warn", priority = -1 }
|
|
52
|
+
|
|
53
|
+
used_underscore_binding = "allow"
|
|
54
|
+
|
|
55
|
+
module_name_repetitions = "allow"
|
|
56
|
+
must_use_candidate = "allow"
|
|
57
|
+
missing_errors_doc = "allow"
|
|
58
|
+
missing_panics_doc = "allow"
|
|
59
|
+
|
|
60
|
+
dbg_macro = "deny"
|
|
61
|
+
todo = "deny"
|
|
62
|
+
unimplemented = "deny"
|
|
63
|
+
|
|
64
|
+
unwrap_used = "warn"
|
|
65
|
+
expect_used = "warn"
|
|
66
|
+
panic = "deny"
|
|
67
|
+
|
|
68
|
+
await_holding_lock = "deny"
|
|
69
|
+
|
|
70
|
+
large_futures = "warn"
|
|
71
|
+
large_stack_arrays = "warn"
|
|
72
|
+
large_types_passed_by_value = "warn"
|
|
73
|
+
|
|
74
|
+
redundant_clone = "warn"
|
|
75
|
+
clone_on_ref_ptr = "warn"
|
|
76
|
+
needless_collect = "warn"
|
|
77
|
+
inefficient_to_string = "warn"
|
|
78
|
+
|
|
79
|
+
enum_glob_use = "warn"
|
|
80
|
+
wildcard_imports = "warn"
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
edition = "2024"
|
|
2
|
+
style_edition = "2024"
|
|
3
|
+
|
|
4
|
+
max_width = 100
|
|
5
|
+
hard_tabs = false
|
|
6
|
+
tab_spaces = 4
|
|
7
|
+
newline_style = "Unix"
|
|
8
|
+
|
|
9
|
+
use_field_init_shorthand = true
|
|
10
|
+
use_small_heuristics = "Default"
|
|
11
|
+
match_block_trailing_comma = true
|
|
12
|
+
|
|
13
|
+
reorder_imports = true
|
|
14
|
+
reorder_modules = true
|
|
@@ -8,6 +8,6 @@ pub fn commands<R: Runtime>() -> Commands<R> {
|
|
|
8
8
|
#[tauri::command]
|
|
9
9
|
#[specta::specta]
|
|
10
10
|
fn greet(name: &str) -> String {
|
|
11
|
-
log::info!("Backend was called with an argument: {}"
|
|
12
|
-
format!("Hello, {}! You've been greeted from Rust!"
|
|
11
|
+
log::info!("Backend was called with an argument: {name}");
|
|
12
|
+
format!("Hello, {name}! You've been greeted from Rust!")
|
|
13
13
|
}
|
|
@@ -8,9 +8,11 @@ pub fn run() {
|
|
|
8
8
|
{
|
|
9
9
|
use specta_typescript::Typescript;
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
.export(Typescript::default(), "../src/generated/bindings.ts")
|
|
13
|
-
|
|
11
|
+
if let Err(error) =
|
|
12
|
+
specta_builder.export(Typescript::default(), "../src/generated/bindings.ts")
|
|
13
|
+
{
|
|
14
|
+
eprintln!("failed to export TypeScript bindings: {error}");
|
|
15
|
+
}
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
let builder = tauri::Builder::default()
|
|
@@ -36,17 +38,23 @@ pub fn run() {
|
|
|
36
38
|
.build(),
|
|
37
39
|
);
|
|
38
40
|
|
|
39
|
-
builder
|
|
41
|
+
let result = builder
|
|
40
42
|
.invoke_handler(specta_builder.invoke_handler())
|
|
41
43
|
.setup(|_app| {
|
|
42
44
|
#[cfg(debug_assertions)]
|
|
43
45
|
{
|
|
44
46
|
use tauri::Manager;
|
|
45
47
|
|
|
46
|
-
_app.get_webview_window("main")
|
|
48
|
+
if let Some(window) = _app.get_webview_window("main") {
|
|
49
|
+
window.open_devtools();
|
|
50
|
+
}
|
|
47
51
|
}
|
|
48
52
|
Ok(())
|
|
49
53
|
})
|
|
50
|
-
.run(tauri::generate_context!())
|
|
51
|
-
|
|
54
|
+
.run(tauri::generate_context!());
|
|
55
|
+
|
|
56
|
+
if let Err(error) = result {
|
|
57
|
+
eprintln!("error while running Tauri application: {error}");
|
|
58
|
+
std::process::exit(1);
|
|
59
|
+
}
|
|
52
60
|
}
|