CodeVetter · Repo Unpack · System map
tauri-apps/tauri
The repo is a Cargo workspace plus a pnpm workspace. The hub is crates/tauri (the `tauri` crate, v2.11.5), which depends on tauri-runtime (trait layer), tauri-runtime-wry (default WRY/TAO-based runtime), tauri-utils (config/ACL/assets), tauri-codegen + tauri-macros (compile-time codegen) and tauri-build (build-script API). Tooling lives in crates/tauri-cli (the `cargo-tauri` binary), crates/tauri-bundler (installer packaging), crates/tauri-driver (WebDriver proxy), and packages/api + packages/cli (the npm-facing JS). Mobile (Android/iOS) support is split between CLI subcommands and Kotlin/Swift glue under crates/tauri/mobile.
- The root Cargo.toml workspace lists 14 published crates under crates/ plus packages/cli, integration tests (crates/tests/restart, crates/tests/acl), bench apps and examples; workspace release profile uses panic="abort", lto and opt-level "s".
- crates/tauri is the core crate: its lib.rs declares modules app, async_runtime, event, ipc, manager, pattern, plugin, protocol, resources, webview, window, menu, path, process, scope, state, tray and vibrancy, and re-exports Builder/App/AppHandle plus the `command`, `generate_handler` and `generate_context` macros.
- The runtime is abstracted behind the `Runtime`/`RuntimeHandle` traits in crates/tauri-runtime; the default implementation is `tauri::Wry` = `tauri_runtime_wry::Wry<EventLoopMessage>` gated behind the `wry` cargo feature, so a custom runtime can be substituted by disabling the feature.
- App configuration is resolved at compile time: `generate_context!`/`tauri_build_context!` produce a `Context<R>` carrying the parsed Config, embedded assets, window/tray icons, PackageInfo, the security `Pattern` and a `RuntimeAuthority` built from resolved ACLs.
- The `cargo-tauri` binary entrypoint (crates/tauri-cli/src/main.rs) strips a leading `tauri` cargo-subcommand arg, derives bin_name, and calls `tauri_cli::run`; it only supports macOS, Linux and Windows and exits 1 elsewhere.
- tauri_cli::run parses a clap `Cli` with subcommand enum Commands (init, dev, build, bundle, android, ios, migrate, info, add, remove, plugin, icon, signer, completions, permission, capability, inspect) and dispatches each to a module under crates/tauri-cli/src/.
- The npm package @tauri-apps/cli is a thin napi-rs wrapper: packages/cli/src/lib.rs exposes a `run` napi function that spawns a thread, catches panics, and calls `tauri_cli::try_run`, reporting back through a ThreadsafeFunction callback.
- @tauri-apps/api (packages/api) is a TypeScript library with modules core, event, window, webview, webviewWindow, menu, tray, path, app, dpi, image and mocks, all communicating with Rust through `window.__TAURI_INTERNALS__.invoke`.
- tauri-driver is a standalone binary that spawns the platform's native WebDriver server and runs an intermediary WebDriver node (modules cli, server, webdriver) on Linux and Windows only; it exits on other platforms.
- tauri-bundler maps bundle target strings to a PackageType enum covering deb, rpm, appimage, dmg, app, msi, nsis, ios and updater artifacts, and is invoked by the CLI through `tauri_bundler::bundle_project(&settings)`.
- crates/tauri-plugin provides the plugin-authoring SDK with a `build` feature (permission/global-API-script/android/ios path registration via `Builder`) and a `runtime` feature, re-exported as `pub use build::*` / `pub use runtime::*`.
- The JS/TS workspace is driven by pnpm (pnpm-workspace.yaml) with root scripts `build`, `build:api`, `build:cli`, `test`, `test:api-e2e`; Rust builds/tests run via cargo with toolchain 1.90 in CI.
- Mobile support spans crates/tauri-cli/src/mobile (android/ios subcommand trees), Kotlin sources under crates/tauri/mobile, the `mobile_entry_point` macro and the `android_binding!` macro that glues Java PluginManager callbacks (handlePluginResponse, sendChannelData) into Rust.