Files
miniSCP/electrobun.config.ts
jgamboaandClaude a40433b99e Add built-in auto-updater with tab-bar update pill
Wires electrobun's Updater to the /dl download host. The packaged app checks
https://miniscp.com/dl on launch + every 6h; when a newer build exists, an
accent-colored "update tool" appears next to Connections in the tab bar. It
announces the update, becomes its own inline progress bar while downloading,
then flips to "Restart to apply" (two-step: download, then user-triggered
relaunch).

- electrobun.config.ts: release.baseUrl = https://miniscp.com/dl (baked into
  version.json at build; miniscp.com fronted by an external proxy for TLS).
- rpc.ts: checkForUpdate/downloadUpdate/applyUpdate requests + updateStatus push.
- rpc-handlers.ts + index.ts: call Updater; poll on launch+6h; stream
  onStatusChange progress. checkForUpdate self-guards the dev channel.
- rpc.service.ts + new updater.service.ts: signal-based state
  (available -> downloading -> ready, ready derived from downloadUpdate ok).
- tab-bar.ts: single bg-primary pill; progress fills the pill itself.
- icons.ts: register mynaDownload. i18n: tabBar + menu keys across all locales.
- menu.ts + app.ts: "Check for Updates…" app-menu item -> UpdaterService.check().
- docs: build-and-release + architecture updated.

Unsigned builds still update (applyUpdate strips the macOS quarantine xattr).
Verified: tsc --noEmit (exit 0) + build:ui AOT (exit 0). Live pill + full
download/apply flow require a two-build test on the host.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-14 16:43:40 +02:00

43 lines
1.2 KiB
TypeScript

import type { ElectrobunConfig } from "electrobun";
import { BRANDING } from "./src/shared/branding";
export default {
app: {
name: BRANDING.appName,
identifier: BRANDING.identifier,
version: BRANDING.version,
},
// Auto-updater feed. The flat artifacts land under /dl on the host (see site/);
// miniscp.com is fronted by an external proxy for TLS. baseUrl is baked into
// version.json at build time, so only builds made after this takes effect check
// for updates. generatePatch (default true) needs build-time network to this URL
// to diff against the currently-published version.
release: {
baseUrl: "https://miniscp.com/dl",
},
build: {
bun: {
entrypoint: "src/bun/index.ts",
// ssh2's optional native accelerators must never be bundled; its
// runtime try/catch falls back to pure JS when the require fails.
external: ["cpu-features", "*.node"],
},
copy: {
"ui/dist/ui/browser": "views/app",
"assets/tray": "views/assets/tray",
},
watchIgnore: ["ui/**", "dist/**"],
mac: {
bundleCEF: false,
icons: BRANDING.icon,
},
linux: {
bundleCEF: false,
},
win: {
bundleCEF: false, // system WebView2 keeps the bundle small
icon: "assets/icon.ico",
},
},
} satisfies ElectrobunConfig;