Implement wiring hardening, runtime API config, smoke tests, and build scripts

This commit is contained in:
Ryan Lancaster
2026-03-17 12:58:43 -04:00
parent a3949c32ee
commit ca46302aff
19 changed files with 2358 additions and 77 deletions

View File

@@ -1,7 +1,8 @@
const { contextBridge, ipcRenderer } = require('electron')
contextBridge.exposeInMainWorld('ENV', {
API_URL: process.env.VITE_API_URL || 'http://localhost:4000/api'
API_URL: process.env.VITE_API_URL || 'http://localhost:4000/api',
API_KEY: process.env.WRITE_API_KEY || process.env.VITE_WRITE_API_KEY || ''
})
contextBridge.exposeInMainWorld('app', {
@@ -10,5 +11,13 @@ contextBridge.exposeInMainWorld('app', {
set: (key, value) => ipcRenderer.invoke('storage-set', key, value),
remove: (key) => ipcRenderer.invoke('storage-remove', key)
},
getAPIUrl: () => ipcRenderer.invoke('get-api-url')
getAPIUrl: () => ipcRenderer.invoke('get-api-url'),
setAPIUrl: (url) => ipcRenderer.invoke('set-api-url', url)
})
// Backward-compatible alias used by the React app persistence wrapper.
contextBridge.exposeInMainWorld('storage', {
get: (key) => ipcRenderer.invoke('storage-get', key),
set: (key, value) => ipcRenderer.invoke('storage-set', key, value),
remove: (key) => ipcRenderer.invoke('storage-remove', key)
})