forked from boos/BoosAPI
feat: enhance desktop build process with artifact upload and download, and update server working directory resolution
This commit is contained in:
@@ -17,6 +17,12 @@ type ServerExitState = {
|
||||
signal: NodeJS.Signals | null;
|
||||
};
|
||||
|
||||
type DesktopServerWorkingDirInput = {
|
||||
appPath: string;
|
||||
resourcesPath: string;
|
||||
isPackaged: boolean;
|
||||
};
|
||||
|
||||
const DEFAULT_READY_TIMEOUT_MS = 30_000;
|
||||
const DEFAULT_READY_INTERVAL_MS = 250;
|
||||
|
||||
@@ -43,6 +49,10 @@ export function createDesktopHealthUrl(port: number): string {
|
||||
return `${createDesktopServerUrl(port)}/api/desktop/health`;
|
||||
}
|
||||
|
||||
export function resolveDesktopServerWorkingDir(input: DesktopServerWorkingDirInput): string {
|
||||
return input.isPackaged ? input.resourcesPath : input.appPath;
|
||||
}
|
||||
|
||||
export async function waitForServerReady(input: WaitForServerReadyInput): Promise<void> {
|
||||
const fetcher = input.fetcher || ((url: string, init?: RequestInit) => fetch(url, init));
|
||||
const timeoutMs = input.timeoutMs ?? DEFAULT_READY_TIMEOUT_MS;
|
||||
|
||||
Reference in New Issue
Block a user