@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.
@@ -1,3 +1,4 @@
1
1
  [toolchain]
2
2
  channel = "stable"
3
3
  components = ["rustfmt", "clippy"]
4
+ profile = "minimal"
@@ -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 {
@@ -1,5 +1,7 @@
1
1
  /* eslint-disable */
2
2
  /* prettier-ignore */
3
+ /* oxlint-disable */
4
+ /* oxfmt-ignore */
3
5
  // @ts-nocheck
4
6
  // noinspection JSUnusedGlobalSymbols
5
7
  // Generated by unplugin-auto-import
@@ -4296,7 +4296,7 @@ dependencies = [
4296
4296
 
4297
4297
  [[package]]
4298
4298
  name = "tauri-vue-template"
4299
- version = "0.0.1"
4299
+ version = "1.0.3"
4300
4300
  dependencies = [
4301
4301
  "chrono",
4302
4302
  "log",
@@ -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"
@@ -1,3 +1,3 @@
1
1
  fn main() {
2
- tauri_build::build()
2
+ tauri_build::build();
3
3
  }
@@ -0,0 +1,3 @@
1
+ too-many-arguments-threshold = 7
2
+ type-complexity-threshold = 300
3
+ cognitive-complexity-threshold = 30
@@ -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: {}", name);
12
- format!("Hello, {}! You've been greeted from Rust!", name)
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
- specta_builder
12
- .export(Typescript::default(), "../src/generated/bindings.ts")
13
- .unwrap();
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").unwrap().open_devtools();
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
- .expect("error while running tauri application");
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
  }
@@ -2,5 +2,5 @@
2
2
  #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
3
3
 
4
4
  fn main() {
5
- tauri_vue_template_lib::run()
5
+ tauri_vue_template_lib::run();
6
6
  }