Skip to content

Commit 5ed1286

Browse files
mabry1985Claude Agentclaude
authored
feat: spike - replace Electron with Tauri v2 desktop app shell (#44)
Establishes Tauri v2 project structure as a proof-of-concept replacement for Electron. Binary size target: under 20MB vs ~300MB. Server runs independently via Docker/Tailscale; Tauri is a thin webview wrapper only. Phase 1-5 implementation: - Add src-tauri/ with Cargo.toml, main.rs, lib.rs, build.rs, tauri.conf.json - Register plugins: dialog, notification, autostart, deep-link, updater, shell, os - System tray with click-to-focus and health score tooltip support - Remove vite-plugin-electron and all Electron conditional build logic - Add @tauri-apps/api + 8 plugin packages; remove electron/electron-builder - Create isDesktopApp() utility using isTauri() from @tauri-apps/api/core - Create tauri-dialog.ts (native file picker + web fallback) - Create tauri-notification.ts (OS notifications + browser fallback) - Create tray-manager.ts (health score tray tooltip) - Update auth.ts: initServerUrl reads VITE_SERVER_URL env var (no Electron IPC) - Update use-os-detection.ts: uses browser userAgentData only - Delete src/main.ts (1654 lines), preload.ts, auto-updater.ts, prepare-server.mjs To run: install Rust + Tauri CLI, then `npm run dev:tauri` Co-authored-by: Claude Agent <agent@protolabsai.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 2702118 commit 5ed1286

File tree

20 files changed

+865
-5368
lines changed

20 files changed

+865
-5368
lines changed

apps/ui/package.json

Lines changed: 13 additions & 150 deletions
Original file line numberDiff line numberDiff line change
@@ -13,38 +13,32 @@
1313
"engines": {
1414
"node": ">=22.0.0 <23.0.0"
1515
},
16-
"main": "dist-electron/main.js",
1716
"scripts": {
1817
"dev": "vite --clearScreen false",
19-
"dev:web": "cross-env VITE_SKIP_ELECTRON=true vite --clearScreen false",
20-
"dev:electron": "vite --clearScreen false",
21-
"dev:electron:debug": "cross-env OPEN_DEVTOOLS=true vite --clearScreen false",
18+
"dev:web": "vite --clearScreen false",
19+
"dev:tauri": "tauri dev",
2220
"build": "vite build",
23-
"build:electron": "node scripts/prepare-server.mjs && vite build && electron-builder",
24-
"build:electron:legless": "vite build && electron-builder --config electron-builder.legless.json",
25-
"build:electron:legless:dir": "vite build && electron-builder --config electron-builder.legless.json --dir",
26-
"build:electron:dir": "node scripts/prepare-server.mjs && vite build && electron-builder --dir",
27-
"build:electron:win": "node scripts/prepare-server.mjs && vite build && electron-builder --win",
28-
"build:electron:win:dir": "node scripts/prepare-server.mjs && vite build && electron-builder --win --dir",
29-
"build:electron:mac": "node scripts/prepare-server.mjs && vite build && electron-builder --mac",
30-
"build:electron:mac:dir": "node scripts/prepare-server.mjs && vite build && electron-builder --mac --dir",
31-
"build:electron:linux": "node scripts/prepare-server.mjs && vite build && electron-builder --linux",
32-
"build:electron:linux:dir": "node scripts/prepare-server.mjs && vite build && electron-builder --linux --dir",
33-
"postinstall": "electron-builder install-app-deps",
21+
"build:tauri": "tauri build",
22+
"tauri": "tauri",
3423
"preview": "vite preview",
3524
"lint": "npx eslint",
3625
"typecheck": "node scripts/generate-routes.mjs && tsc --noEmit",
3726
"pretest": "node scripts/kill-test-servers.mjs && node scripts/setup-e2e-fixtures.mjs",
3827
"test": "playwright test",
3928
"test:headed": "playwright test --headed",
40-
"test:electron": "playwright test --config playwright.electron.config.ts",
4129
"test:smoke": "playwright test --config playwright.smoke.config.ts",
42-
"dev:electron:wsl": "cross-env vite",
43-
"dev:electron:wsl:gpu": "cross-env MESA_D3D12_DEFAULT_ADAPTER_NAME=NVIDIA vite",
4430
"storybook": "storybook dev -p 6006",
4531
"build-storybook": "storybook build"
4632
},
4733
"dependencies": {
34+
"@tauri-apps/api": "^2",
35+
"@tauri-apps/plugin-autostart": "^2",
36+
"@tauri-apps/plugin-deep-link": "^2",
37+
"@tauri-apps/plugin-dialog": "^2",
38+
"@tauri-apps/plugin-notification": "^2",
39+
"@tauri-apps/plugin-os": "^2",
40+
"@tauri-apps/plugin-shell": "^2",
41+
"@tauri-apps/plugin-updater": "^2",
4842
"@ai-sdk/anthropic": "^3.0.45",
4943
"@ai-sdk/react": "^3.0.92",
5044
"@codemirror/lang-css": "^6.3.1",
@@ -125,7 +119,6 @@
125119
"cmdk": "1.1.1",
126120
"dagre": "0.8.5",
127121
"dotenv": "17.2.3",
128-
"electron-updater": "^6.8.3",
129122
"geist": "1.5.1",
130123
"lucide-react": "0.562.0",
131124
"motion": "^12.34.0",
@@ -159,7 +152,6 @@
159152
},
160153
"devDependencies": {
161154
"@chromatic-com/storybook": "^5.0.1",
162-
"@electron/rebuild": "^4.0.3",
163155
"@eslint/js": "9.0.0",
164156
"@playwright/test": "1.57.0",
165157
"@protolabsai/ui": "^0.60.0",
@@ -177,144 +169,15 @@
177169
"@typescript-eslint/parser": "8.50.0",
178170
"@vitejs/plugin-react": "5.1.2",
179171
"cross-env": "10.1.0",
180-
"electron": "39.2.7",
181-
"electron-builder": "^26.7.0",
182172
"eslint": "9.39.2",
183173
"eslint-plugin-storybook": "^10.2.8",
184174
"sharp": "^0.34.5",
185175
"storybook": "^10.2.8",
186176
"tailwindcss": "4.1.18",
187177
"tw-animate-css": "1.4.0",
188178
"typescript": "5.9.3",
179+
"@tauri-apps/cli": "^2",
189180
"vite": "7.3.0",
190-
"vite-plugin-electron": "0.29.0",
191-
"vite-plugin-electron-renderer": "0.14.6",
192181
"vite-plugin-pwa": "^1.2.0"
193-
},
194-
"build": {
195-
"appId": "studio.protolabs.app",
196-
"productName": "protoLabs.studio",
197-
"artifactName": "${productName}-${version}-${arch}.${ext}",
198-
"npmRebuild": false,
199-
"publish": {
200-
"provider": "github",
201-
"owner": "protoLabsAI",
202-
"repo": "automaker"
203-
},
204-
"afterPack": "./scripts/rebuild-server-natives.cjs",
205-
"directories": {
206-
"output": "release"
207-
},
208-
"files": [
209-
"dist/**/*",
210-
"dist-electron/**/*",
211-
"public/**/*",
212-
"!node_modules/**/*"
213-
],
214-
"extraResources": [
215-
{
216-
"from": "server-bundle/dist",
217-
"to": "server"
218-
},
219-
{
220-
"from": "server-bundle/node_modules",
221-
"to": "server/node_modules"
222-
},
223-
{
224-
"from": "server-bundle/package.json",
225-
"to": "server/package.json"
226-
},
227-
{
228-
"from": "../../.env",
229-
"to": ".env",
230-
"filter": [
231-
"**/*"
232-
]
233-
}
234-
],
235-
"mac": {
236-
"category": "public.app-category.developer-tools",
237-
"entitlements": "entitlements.mac.plist",
238-
"entitlementsInherit": "entitlements.mac.plist",
239-
"extendInfo": {
240-
"NSMicrophoneUsageDescription": "protoLabs Studio needs microphone access for voice activation and wake word detection."
241-
},
242-
"target": [
243-
{
244-
"target": "dmg",
245-
"arch": [
246-
"x64",
247-
"arm64"
248-
]
249-
},
250-
{
251-
"target": "zip",
252-
"arch": [
253-
"x64",
254-
"arm64"
255-
]
256-
}
257-
],
258-
"icon": "public/icon.icns"
259-
},
260-
"win": {
261-
"target": [
262-
{
263-
"target": "nsis",
264-
"arch": [
265-
"x64"
266-
]
267-
}
268-
],
269-
"icon": "public/icon.ico"
270-
},
271-
"linux": {
272-
"target": [
273-
{
274-
"target": "AppImage",
275-
"arch": [
276-
"x64"
277-
]
278-
},
279-
{
280-
"target": "deb",
281-
"arch": [
282-
"x64"
283-
]
284-
},
285-
{
286-
"target": "rpm",
287-
"arch": [
288-
"x64"
289-
]
290-
}
291-
],
292-
"category": "Development",
293-
"icon": "public/logo_larger.png",
294-
"maintainer": "hello@protolabs.studio",
295-
"executableName": "automaker",
296-
"description": "An autonomous AI development studio that helps you build software faster using AI-powered agents",
297-
"synopsis": "AI-powered autonomous development studio"
298-
},
299-
"rpm": {
300-
"depends": [
301-
"gtk3",
302-
"libnotify",
303-
"nss",
304-
"libXScrnSaver",
305-
"libXtst",
306-
"xdg-utils",
307-
"at-spi2-core",
308-
"libuuid"
309-
],
310-
"compression": "xz",
311-
"vendor": "AutoMaker Team"
312-
},
313-
"nsis": {
314-
"oneClick": false,
315-
"allowToChangeInstallationDirectory": true,
316-
"createDesktopShortcut": true,
317-
"createStartMenuShortcut": true
318-
}
319182
}
320183
}

apps/ui/scripts/prepare-server.mjs

Lines changed: 0 additions & 175 deletions
This file was deleted.

0 commit comments

Comments
 (0)