Files
deepseek-harness/apps/desktop/scripts/desktop-build-paths.d.mts
T
mektpoy 80e4da0e3d fix(desktop): take the development project target as an explicit input
`prepareDevelopmentProject()` resolved the build target from the host
platform and architecture, so a Linux host threw `unsupported target
linux-x64` while writing the runtime descriptor. Pass the target in
instead: the launcher supplies the target it prepared, and isolated tests
supply a fixed supported target.

Extract `desktopTargetPlatform()` into desktop-build-paths.mjs so the
target-to-payload mapping has one home, and use it for the qualification
runner, which previously derived both its target directory and its
descriptor from the host architecture.

Correct the README limitation to name the module that now performs the
architecture check.
2026-09-23 16:03:17 +08:00

75 lines
2.7 KiB
TypeScript

import type { DesktopAutoUpdateTarget } from './desktop-auto-update-environment.mjs'
/** Mutable target directories plus the shared immutable download cache. */
export interface DesktopTargetBuildPaths {
readonly root: string
readonly artifacts: string
readonly unsignedArtifacts: string
readonly runtime: string
readonly packageSet: string
readonly dsh: string
readonly dshPnpm: string
readonly electron: string
readonly packedDsh: string
readonly packedVendor: string
readonly packedLandlock: string
readonly downloads: string
}
/**
* Resolve the fixed build target selected by a packaging environment.
* @param env - Packaging environment.
* @param hostPlatform - Build-host platform used when no target override exists.
* @param hostArch - Build-host architecture used when no target override exists.
* @returns Supported Desktop target name.
*/
export function resolveDesktopBuildTarget(
env?: NodeJS.ProcessEnv,
hostPlatform?: NodeJS.Platform,
hostArch?: string,
): DesktopAutoUpdateTarget
/**
* Return the mutable preparation and artifact directories owned by one release target.
* @param target - Supported Desktop target name.
* @returns Target paths plus the shared immutable download cache.
*/
export function desktopTargetBuildPaths(target: DesktopAutoUpdateTarget): DesktopTargetBuildPaths
/**
* Return the platform and architecture of the payload one release target prepares.
* Windows is prepared as x64 only, so this differs from the build host on an arm64 Windows machine.
* @param target - Supported Desktop target name.
* @returns Platform and architecture of the prepared payload.
*/
export function desktopTargetPlatform(target: DesktopAutoUpdateTarget): {
readonly platform: 'darwin' | 'win32'
readonly arch: 'arm64' | 'x64'
}
/**
* Resolve the paths owned by the target selected in a packaging environment.
* @param env - Packaging environment.
* @param hostPlatform - Build-host platform used when no target override exists.
* @param hostArch - Build-host architecture used when no target override exists.
* @returns Selected target paths.
*/
export function resolveDesktopTargetBuildPaths(
env?: NodeJS.ProcessEnv,
hostPlatform?: NodeJS.Platform,
hostArch?: string,
): DesktopTargetBuildPaths
/**
* Resolve the primary-runtime directory an unpackaged development launch uses.
* @param env - Packaging environment.
* @param hostPlatform - Build-host platform used when no target override exists.
* @param hostArch - Build-host architecture used when no target override exists.
* @returns Primary-runtime directory prepared for the selected target.
*/
export function developmentRuntimeDirectory(
env?: NodeJS.ProcessEnv,
hostPlatform?: NodeJS.Platform,
hostArch?: string,
): string