UNPKG

trigger.dev

Version:

A Command-Line Interface for Trigger.dev projects

33 lines (32 loc) 1.68 kB
/** * Resolves the `.trigger/tmp` root for a dev session, scoped to the branch so * concurrent sessions on different branches don't share (and clobber) a build * tree. The default branch keeps the original `.trigger/tmp` path; branches get * a sibling root (e.g. `.trigger/tmp-feature-foo`) so a default-branch * `clearTmpDirs` can't reach into a branch's tree, and vice versa. */ export declare function getTmpRoot(projectRoot: string | undefined, branch?: string): string; /** * A short-lived directory. Automatically removed when the process exits, but * can be removed earlier by calling `remove()`. */ export interface EphemeralDirectory { path: string; remove(): void; } /** * Gets a temporary directory in the project's `.trigger` folder with the * specified prefix. We create temporary directories in `.trigger` as opposed * to the OS's temporary directory to avoid issues with different drive letters * on Windows. For example, when `esbuild` outputs a file to a different drive * than the input sources, the generated source maps are incorrect. */ export declare function getTmpDir(projectRoot: string | undefined, prefix: string, keep?: boolean, branch?: string): EphemeralDirectory; export declare function clearTmpDirs(projectRoot: string | undefined, branch?: string): void; /** * Gets the shared store directory for content-addressable build outputs. * This directory persists across rebuilds and is used to deduplicate * identical chunk files between build versions. * Automatically cleaned up when the process exits. */ export declare function getStoreDir(projectRoot: string | undefined, keep?: boolean, branch?: string): string;