feat(desktop): self-contained — bundle the frontend

- build:renderer builds Fabric.Frontend with relative base and copies
  the static bundle into renderer/; dist/pack scripts run it first.
- main.js: production loads renderer/index.html when present (falls
  back to offline.html); packaged app no longer needs a separate
  frontend server (still talks to Center/Guild backends, which the
  login screen points at — file:// origin is CORS-allowed).
- package files += renderer/**; gitignore renderer/.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
h z
2026-05-16 12:11:43 +01:00
parent f641d42a8b
commit 97c4e7ad96
4 changed files with 50 additions and 7 deletions

View File

@@ -4,7 +4,11 @@ const path = require('path')
const isDev = !!process.env.FABRIC_DESKTOP_URL
const DEFAULT_DEV_URL = 'http://localhost:5173'
const DEFAULT_PROD_ENTRY = path.join(__dirname, 'offline.html')
// Self-contained: load the bundled frontend if present, else the placeholder.
const BUNDLED_ENTRY = path.join(__dirname, 'renderer', 'index.html')
const DEFAULT_PROD_ENTRY = fs.existsSync(BUNDLED_ENTRY)
? BUNDLED_ENTRY
: path.join(__dirname, 'offline.html')
let mainWindow = null
let tray = null