|
|
@@ -28,6 +28,13 @@ import {
|
|
|
|
type UpdateCheckResult,
|
|
|
|
type UpdateCheckResult,
|
|
|
|
type UpdateProgress,
|
|
|
|
type UpdateProgress,
|
|
|
|
} from './ipc-types';
|
|
|
|
} from './ipc-types';
|
|
|
|
|
|
|
|
// Static import of the desktop package.json so the bundler inlines the
|
|
|
|
|
|
|
|
// version string at build time. The previous `process.env.npm_package_-
|
|
|
|
|
|
|
|
// version` approach worked in dev (pnpm sets it as a script env var) but
|
|
|
|
|
|
|
|
// fell back to '0.0.0' in packaged builds — every installed user got
|
|
|
|
|
|
|
|
// flagged as "Update verfügbar" against their own actually-current
|
|
|
|
|
|
|
|
// version. resolveJsonModule + esModuleInterop are on in tsconfig.node.
|
|
|
|
|
|
|
|
import pkg from '../package.json';
|
|
|
|
|
|
|
|
|
|
|
|
type Unsubscribe = () => void;
|
|
|
|
type Unsubscribe = () => void;
|
|
|
|
|
|
|
|
|
|
|
@@ -40,7 +47,7 @@ function on<T>(channel: string, cb: (payload: T) => void): Unsubscribe {
|
|
|
|
const api = {
|
|
|
|
const api = {
|
|
|
|
platform: ELECTRON_RUNTIME_MARKER,
|
|
|
|
platform: ELECTRON_RUNTIME_MARKER,
|
|
|
|
osPlatform: process.platform as NodeJS.Platform,
|
|
|
|
osPlatform: process.platform as NodeJS.Platform,
|
|
|
|
appVersion: process.env.npm_package_version ?? '0.0.0',
|
|
|
|
appVersion: pkg.version,
|
|
|
|
|
|
|
|
|
|
|
|
// Screen sources ---------------------------------------------------------
|
|
|
|
// Screen sources ---------------------------------------------------------
|
|
|
|
getScreenSources: (): Promise<ScreenSource[]> => ipcRenderer.invoke(CHANNELS.SCREEN_GET_SOURCES),
|
|
|
|
getScreenSources: (): Promise<ScreenSource[]> => ipcRenderer.invoke(CHANNELS.SCREEN_GET_SOURCES),
|
|
|
|