Files
open-design/apps/packaged/src/paths.ts
T
Zakaria a46764fb1b
ci / Validate workspace (push) Has been cancelled
landing-page-ci / Validate landing page (push) Has been cancelled
landing-page-deploy / Deploy landing page (push) Has been cancelled
github-metrics / Generate repository metrics SVG (push) Has been cancelled
refresh-contributors-wall / Refresh contributors wall cache bust (push) Waiting to run
first-commit
2026-05-04 14:58:14 -04:00

41 lines
1.3 KiB
TypeScript

import { join } from "node:path";
import { APP_KEYS } from "@open-design/sidecar-proto";
import type { PackagedConfig } from "./config.js";
export type PackagedNamespacePaths = {
cacheRoot: string;
desktopIdentityPath: string;
desktopLogPath: string;
dataRoot: string;
desktopLogsRoot: string;
electronSessionDataRoot: string;
electronUserDataRoot: string;
logsRoot: string;
namespaceRoot: string;
resourceRoot: string;
runtimeRoot: string;
};
export function resolvePackagedNamespacePaths(
config: PackagedConfig,
namespace = config.namespace,
): PackagedNamespacePaths {
const namespaceRoot = join(config.namespaceBaseRoot, namespace);
return {
cacheRoot: join(namespaceRoot, "cache"),
desktopIdentityPath: join(namespaceRoot, "runtime", "desktop-root.json"),
desktopLogPath: join(namespaceRoot, "logs", APP_KEYS.DESKTOP, "latest.log"),
dataRoot: join(namespaceRoot, "data"),
desktopLogsRoot: join(namespaceRoot, "logs", APP_KEYS.DESKTOP),
electronSessionDataRoot: join(namespaceRoot, "user-data", "session"),
electronUserDataRoot: join(namespaceRoot, "user-data"),
logsRoot: join(namespaceRoot, "logs"),
namespaceRoot,
resourceRoot: config.resourceRoot,
runtimeRoot: join(namespaceRoot, "runtime"),
};
}