diff --git a/BUILDING.md b/BUILDING.md index 27d6d678..1ac4ae9d 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -617,7 +617,8 @@ The Electron build process follows a multi-stage approach: #### **Stage 2: Capacitor Sync** - Copies web assets to Electron app directory -- Syncs Capacitor configuration and plugins +- Uses Electron-specific Capacitor configuration (not copied from main config) +- Syncs Capacitor plugins for Electron platform - Prepares native module bindings #### **Stage 3: TypeScript Compile** diff --git a/electron/capacitor.config.ts b/electron/capacitor.config.ts new file mode 100644 index 00000000..24ef38c6 --- /dev/null +++ b/electron/capacitor.config.ts @@ -0,0 +1,116 @@ +import { CapacitorConfig } from '@capacitor/cli'; + +const config: CapacitorConfig = { + appId: 'app.timesafari', + appName: 'TimeSafari', + webDir: 'dist', + server: { + cleartext: true + }, + plugins: { + App: { + appUrlOpen: { + handlers: [ + { + url: 'timesafari://*', + autoVerify: true + } + ] + } + }, + SplashScreen: { + launchShowDuration: 3000, + launchAutoHide: true, + backgroundColor: '#ffffff', + androidSplashResourceName: 'splash', + androidScaleType: 'CENTER_CROP', + showSpinner: false, + androidSpinnerStyle: 'large', + iosSpinnerStyle: 'small', + spinnerColor: '#999999', + splashFullScreen: true, + splashImmersive: true + }, + CapSQLite: { + iosDatabaseLocation: 'Library/CapacitorDatabase', + iosIsEncryption: false, + iosBiometric: { + biometricAuth: false, + biometricTitle: 'Biometric login for TimeSafari' + }, + androidIsEncryption: false, + androidBiometric: { + biometricAuth: false, + biometricTitle: 'Biometric login for TimeSafari' + }, + electronIsEncryption: false + } + }, + ios: { + contentInset: 'never', + allowsLinkPreview: true, + scrollEnabled: true, + limitsNavigationsToAppBoundDomains: true, + backgroundColor: '#ffffff', + allowNavigation: [ + '*.timesafari.app', + '*.jsdelivr.net', + 'api.endorser.ch' + ] + }, + android: { + allowMixedContent: true, + captureInput: true, + webContentsDebuggingEnabled: false, + allowNavigation: [ + '*.timesafari.app', + '*.jsdelivr.net', + 'api.endorser.ch', + '10.0.2.2:3000' + ] + }, + electron: { + deepLinking: { + schemes: ['timesafari'] + }, + buildOptions: { + appId: 'app.timesafari', + productName: 'TimeSafari', + directories: { + output: 'dist-electron-packages' + }, + files: [ + 'dist/**/*', + 'electron/**/*' + ], + mac: { + category: 'public.app-category.productivity', + target: [ + { + target: 'dmg', + arch: ['x64', 'arm64'] + } + ] + }, + win: { + target: [ + { + target: 'nsis', + arch: ['x64'] + } + ] + }, + linux: { + target: [ + { + target: 'AppImage', + arch: ['x64'] + } + ], + category: 'Utility' + } + } + } +}; + +export default config; diff --git a/electron/package-lock.json b/electron/package-lock.json index 98a7fbdd..9cf915f4 100644 --- a/electron/package-lock.json +++ b/electron/package-lock.json @@ -56,7 +56,6 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/@capacitor-community/sqlite/-/sqlite-6.0.2.tgz", "integrity": "sha512-sj+2SPLu7E/3dM3xxcWwfNomG+aQHuN96/EFGrOtp4Dv30/2y5oIPyi6hZGjQGjPc5GDNoTQwW7vxWNzybjuMg==", - "license": "MIT", "dependencies": { "jeep-sqlite": "^2.7.2" }, diff --git a/electron/tsconfig.json b/electron/tsconfig.json index b590aebb..d6057ede 100644 --- a/electron/tsconfig.json +++ b/electron/tsconfig.json @@ -1,6 +1,6 @@ { "compileOnSave": true, - "include": ["./src/**/*", "./capacitor.config.ts", "./capacitor.config.js"], + "include": ["./src/**/*"], "compilerOptions": { "outDir": "./build", "importHelpers": true, diff --git a/scripts/build-electron.sh b/scripts/build-electron.sh index 7e7756b8..96213afa 100755 --- a/scripts/build-electron.sh +++ b/scripts/build-electron.sh @@ -181,7 +181,7 @@ sync_capacitor() { copy_web_assets() { log_info "Copying web assets to Electron" safe_execute "Copying assets" "cp -r dist/* electron/app/" - safe_execute "Copying config" "cp capacitor.config.json electron/capacitor.config.json" + # Note: Electron has its own capacitor.config.ts file, so we don't copy the main config } # Compile TypeScript