Skip to content

@tank/desktop-app-dev

1.1.0

Build and ship cross-platform desktop apps from web projects using Electron, Tauri v2, or Wails. Covers framework selection, IPC, native APIs (menus, tray, dialogs), packaging, code signing, auto-update, and migration. Triggers: Electron, Tauri, Wails, desktop app, web to desktop, electron-builder, electron-vite, tauri command, system tray, auto-update, code signing, DMG, MSI, AppImage, IPC, preload script, BrowserWindow, wails build, desktop wrapper, ship desktop app.


name: "@tank/desktop-app-dev" description: | Build, convert, and ship cross-platform desktop applications from web projects using Electron, Tauri v2, or Wails. Covers framework selection and automatic project detection, architecture and IPC patterns, native desktop APIs (menus, tray, notifications, file system, dialogs, shortcuts, clipboard), packaging and distribution (installers, code signing, notarization, auto-update), migration patterns (web-to-desktop conversion, Electron-to-Tauri migration), and CI/CD build pipelines. Synthesizes Electron v40 docs, Tauri v2 docs, Wails v2/v3 docs, and 2025-2026 ecosystem research.

Trigger phrases: "Electron", "Tauri", "Wails", "desktop app", "desktop application", "web to desktop", "convert to desktop app", "cross-platform app", "native app", "electron-builder", "electron-forge", "electron-vite", "tauri command", "system tray", "auto-update", "code signing", "notarize", "DMG", "MSI", "AppImage", "package desktop app", "IPC", "main process", "preload script", "BrowserWindow", "wails build", "desktop wrapper", "ship desktop app", "distribute app", "Electron to Tauri", "migrate from Electron", "wrap web app"

Desktop App Development

Build cross-platform desktop apps from web projects. Three production-ready frameworks: Electron (Node.js), Tauri v2 (Rust), and Wails (Go). Each uses a web frontend with a native backend for OS access.

Core Philosophy

  1. Detect before recommending -- Check the project for existing framework signals before suggesting one. Never assume.
  2. Web skills transfer -- All three frameworks use HTML/CSS/JS frontends. The backend language (Node.js, Rust, Go) is the key differentiator.
  3. Size and performance matter -- Users notice 150 MB downloads and 300 MB memory usage. Choose the lightest framework that meets requirements.
  4. Ship incrementally -- Get a working desktop wrapper first, then add native features (tray, auto-update, deep links) one at a time.
  5. Test on all platforms -- Tauri and Wails use OS WebViews that render differently. Electron bundles Chromium for consistency but at size cost.

Quick-Start

"I want to turn my web app into a desktop app"

StepActionReference
1Detect existing framework (see detection below)This file
2If none detected, choose framework via decision matrixreferences/framework-selection.md
3Set up the chosen framework in the projectFramework-specific guide
4Add native features as needed (menus, tray, dialogs)references/native-apis.md
5Package for distributionreferences/packaging-distribution.md

"I already have an Electron app and want to migrate to Tauri"

StepAction
1Run feasibility assessment (score IPC complexity, Node.js usage, native modules)
2Map Electron IPC handlers to Tauri commands
3Replace Node.js dependencies with Rust equivalents
4Port incrementally: both can coexist during migration
-> See references/migration-patterns.md

"I need to package and distribute my desktop app"

StepAction
1Configure platform-specific installer formats (DMG, MSI, AppImage)
2Set up code signing (macOS: Apple Developer cert, Windows: Authenticode)
3Configure auto-update mechanism
4Set up CI/CD matrix build (Ubuntu, macOS, Windows)
-> See references/packaging-distribution.md

Project Detection

Before recommending a framework, check for existing signals:

SignalFrameworkFiles to Check
electron in package.json depsElectronpackage.json, main.js, preload.js
src-tauri/ directory existsTauritauri.conf.json, src-tauri/Cargo.toml
wails.json existsWailswails.json, go.mod
@tauri-apps/api in depsTauripackage.json
electron-builder.yml existsElectronproject root
electron-forge in depsElectronpackage.json
None of the aboveNo framework-> Use decision matrix

If no framework is detected, ask the user their preference. Recommend based on the decision matrix in references/framework-selection.md.

Decision Trees

Framework Selection (Quick)

SignalRecommendation
Pure web dev team, no Rust/Go experienceElectron
Bundle size and memory are criticalTauri
Team already uses GoWails
Need mobile + desktop from one codebaseTauri v2
Need pixel-perfect cross-platform renderingElectron
Maximum security, minimal attack surfaceTauri
Wrapping existing Next.js / Node.js backendElectron
Greenfield project, performance mattersTauri

Framework Comparison (2026)

AspectElectronTauri v2Wails
Bundle size80-150 MB3-8 MB10-15 MB
Memory (idle)~150 MB~30-60 MB~40-80 MB
BackendNode.jsRustGo
RenderingBundled ChromiumOS WebViewOS WebView
GitHub stars120K103K33K
Mobile supportNoYes (v2)No
Auto-updateBuilt-inPluginManual
Learning curveLow (JS/TS only)Medium (Rust)Medium (Go)

Architecture Pattern

App TypeApproach
Static site / SPALoad index.html directly
SPA with REST APIBundle API server or use local HTTP
Next.js / SSR appElectron + custom server, or export static
Real-time app (WebSocket)Run WS server in backend process
Heavy computationOffload to native backend (Rust/Go)

Anti-Patterns

Don'tDo InsteadWhy
Expose Node.js to renderer (Electron)Use preload + contextBridgeSecurity: renderer is untrusted
Skip code signingSign and notarize for all platformsUsers get scary warnings otherwise
Bundle dev dependenciesProduction build with tree-shakingBloats installer unnecessarily
Use localStorage for sensitive dataUse OS keychain or encrypted storelocalStorage is plaintext
Ignore platform differencesTest on macOS, Windows, LinuxWebView rendering varies
Port everything at once (migration)Migrate incrementallyLower risk, faster feedback

Reference Files

FileContents
references/framework-selection.mdDecision matrices, project detection details, team skill assessment, architecture overviews, ecosystem maturity comparison, frontend framework compatibility
references/electron-guide.mdElectron architecture (main/renderer/preload), project setup (electron-forge, electron-vite), IPC patterns, BrowserWindow configuration, security best practices, TypeScript setup
references/tauri-guide.mdTauri v2 architecture, project setup, commands and events, plugin system, capabilities/permissions, tauri.conf.json, frontend integration, mobile support, Rust state management
references/wails-guide.mdWails architecture, project setup, Go method binding with auto-generated TypeScript, events system, window management, v2 vs v3 comparison
references/native-apis.mdCross-framework native APIs: menus, system tray, notifications, file system, dialogs, keyboard shortcuts, clipboard, deep links, multi-window, with code examples for each framework
references/packaging-distribution.mdPlatform installers (DMG/MSI/AppImage), code signing (macOS/Windows), notarization, auto-update mechanisms, CI/CD build pipelines, distribution channels, bundle size optimization
references/migration-patterns.mdWeb-to-desktop conversion (Electron/Tauri/Wails), Electron-to-Tauri migration (feasibility scoring, IPC mapping, Node.js-to-Rust equivalents), incremental migration strategy, common pitfalls

Command Palette

Search skills, docs, and navigate Tank