ttsc
Version:
General-purpose TypeScript-Go compiler, runtime, plugin host, and LSP host.
27 lines (26 loc) • 1.28 kB
TypeScript
import type { ITtscCompilerContext } from "../../structures/ITtscCompilerContext";
import { ResidentTransformProcess } from "./residentTransformProcess";
/**
* A started resident transform host plus the project root its keys are relative
* to.
*/
export interface StartedResidentTransform {
process: ResidentTransformProcess;
projectRoot: string;
}
/**
* Start a resident `serve` host for the configured project.
*
* Mirrors the plugin spawn of `transformProjectInMemory`, but launches the
* shared host's `serve` subcommand as one long-lived process instead of a
* per-call `transform` subprocess. The host compiles the whole project once at
* startup and then answers per-file requests, so one caller pays the project
* compile once and reuses it across its own per-file requests.
*
* Resident mode runs through the linked-plugin shared host
* (`cmd/utility-host`), which is the only binary that exposes `serve`. It
* therefore requires at least one transform-stage plugin; executable transform
* hosts that own their own process are not served and must use the per-call
* transform path. Check-stage plugins are not run by the resident host.
*/
export declare function startResidentTransform(context: ITtscCompilerContext): StartedResidentTransform;