-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
feature:rulez-uiRuleZ UI desktop applicationRuleZ UI desktop applicationmilestone:M1Project SetupProject Setup
Description
Task: M1-T02
Milestone: M1 - Project Setup (1 day)
Feature: RuleZ UI
Description
Set up the dual-mode architecture that allows the app to run in both Tauri desktop mode and web browser mode (for Playwright testing).
Acceptance Criteria
- Create
src/lib/tauri.tswithisTauri()detection - Implement web fallback pattern for all Tauri commands
- Add mock data module for browser testing
- Verify HMR works in both modes
Implementation
// src/lib/tauri.ts
export const isTauri = (): boolean => {
return typeof window !== 'undefined' && !!window.__TAURI__;
};
export async function invoke<T>(cmd: string, args?: Record<string, unknown>): Promise<T> {
if (isTauri() && window.__TAURI__) {
return window.__TAURI__.invoke<T>(cmd, args);
}
throw new Error(`Tauri not available for command: ${cmd}`);
}Dependencies
- Depends on: M1-T01
Metadata
Metadata
Assignees
Labels
feature:rulez-uiRuleZ UI desktop applicationRuleZ UI desktop applicationmilestone:M1Project SetupProject Setup