23 lines
888 B
TypeScript
23 lines
888 B
TypeScript
type Params = {
|
|
/**
|
|
* Only include when the exiting process actually crashed with an error.
|
|
* Bun's spawn `onExit` `error` is only set on spawn failures, so callers
|
|
* that DO have the error (crash handlers) should pass `force: true`.
|
|
*/
|
|
force?: boolean;
|
|
error?: unknown;
|
|
exitCode?: number | null;
|
|
};
|
|
/**
|
|
* Writes the `BUNDLER_EXIT.txt` flag that the bundler pipeline watches to
|
|
* detect that the dev/prod child process previously crashed.
|
|
*
|
|
* Guardrails:
|
|
* - Never writes for clean exits (exitCode === 0) or signal deaths where no
|
|
* error is available (Ctrl+C must not leave a stale error file behind).
|
|
* - The supervisor writes only when the file does not already exist, so the
|
|
* crash handler's richer error/stack payload is not clobbered.
|
|
*/
|
|
export default function writeErrorFile({ force, error, exitCode, }: Params): void;
|
|
export {};
|