Mountain/Binary/Build/TauriBuild.rs
1//! # Tauri Build Module
2//!
3//! Configures and creates the Tauri Builder with platform-specific settings.
4
5use tauri::Wry;
6
7/// Creates and configures the Tauri Builder with platform-specific
8/// configurations.
9///
10/// # Returns
11///
12/// A configured `tauri::Builder<Wry>` ready for plugin and window
13/// configuration.
14///
15/// # Platform-Specific Behavior
16///
17/// - Windows/Linux: Enables any_thread configuration
18/// - macOS: Uses default threading (no special configuration)
19pub fn TauriBuild() -> tauri::Builder<Wry> {
20 // Initialize the builder with default configuration
21 let Builder = tauri::Builder::default();
22
23 // Disable Tauri's default macOS main menu so it doesn't pre-install
24 // Edit > Undo/Redo entries that compete with Monaco's undo stack and
25 // cause the WKWebView NSUndoManager to intercept Cmd+Z before the
26 // workbench sees it. The app menu is set explicitly in AppMenu.rs
27 // (SetAppMenu call in AppLifecycle.rs) without Undo/Redo items.
28 #[cfg(target_os = "macos")]
29 let Builder = Builder.enable_macos_default_menu(false);
30
31 // Apply platform-specific configurations
32 #[cfg(any(windows, target_os = "linux"))]
33 {
34 let Builder = Builder.any_thread();
35
36 return Builder;
37 }
38
39 Builder
40}