An easy-to-host PDS on the ATProtocol, MacOS. Grandma-approved.

feat(MM-143): add @tauri-apps/api, ipc.ts, update vite config for iOS HMR

authored by malpercio.dev and committed by

Tangled 9644d7f2 25d7dd5e

+22 -3
+4 -1
apps/identity-wallet/package.json
··· 10 10 "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", 11 11 "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch" 12 12 }, 13 + "dependencies": { 14 + "@tauri-apps/api": "^2" 15 + }, 13 16 "devDependencies": { 14 17 "@sveltejs/adapter-static": "^3.0.8", 15 18 "@sveltejs/kit": "^2.20.4", ··· 18 21 "svelte-check": "^4.1.5", 19 22 "tslib": "^2.8.1", 20 23 "typescript": "^5.8.2", 21 - "vite": "^5.4.8" 24 + "vite": "^6.4.1" 22 25 } 23 26 }
+4
apps/identity-wallet/src/lib/ipc.ts
··· 1 + import { invoke } from '@tauri-apps/api/core'; 2 + 3 + export const greet = (name: string): Promise<string> => 4 + invoke('greet', { name });
+14 -2
apps/identity-wallet/vite.config.ts
··· 3 3 4 4 export default defineConfig({ 5 5 plugins: [sveltekit()], 6 + // clearScreen: false surfaces Rust compiler errors in the terminal instead of clearing them 7 + clearScreen: false, 6 8 server: { 7 9 port: 5173, 8 10 strictPort: true, 9 - // host: '0.0.0.0' allows the iOS simulator to reach this dev server over LAN 10 - host: '0.0.0.0', 11 + // TAURI_DEV_HOST is set by `cargo tauri ios dev` to the machine's LAN IP; 12 + // the iOS simulator connects to the dev server over LAN, not localhost 13 + host: process.env.TAURI_DEV_HOST || '0.0.0.0', 14 + hmr: process.env.TAURI_DEV_HOST 15 + ? { 16 + protocol: 'ws', 17 + host: process.env.TAURI_DEV_HOST, 18 + port: 5173, 19 + } 20 + : undefined, 11 21 }, 22 + // Expose VITE_* and TAURI_ENV_* environment variables to the frontend 23 + envPrefix: ['VITE_', 'TAURI_ENV_'], 12 24 });