tessl install tessl/npm-babel--preset-stage-0@7.8.0Deprecated Babel preset for stage 0 plugins that provides migration guidelines to explicit plugin configurations
Agent Success
Agent success rate when using this tile
80%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.21x
Baseline
Agent success rate without this tile
66%
A minimal interface for compiling JavaScript and TypeScript source text and files through the dependency's compiler entry points to deliver transformed code, source maps, and metadata for downstream tooling.
const greet = (name?: string) => name ?? "hi"; and options using @babel/preset-env (targeting Node 14) plus @babel/preset-typescript with sourceMaps: "inline" and filename: "virtual.ts", returns code with type syntax stripped, nullish coalescing rewritten for the target, and an inline source map comment that references virtual.ts. @testsourceMaps is truthy, the returned object contains the generated code, parsed source map data, and compiler metadata. @testfixtures/sample.ts with the same presets/plugins applies the transforms, resolves cwd and filename into the source map paths, and yields code that mirrors the inline behavior. @test.js, .jsx, .ts, .tsx) are rejected with a clear error. @test@generates
export interface CompileOptions {
presets?: Array<string | [string, Record<string, unknown>]>;
plugins?: Array<string | [string, Record<string, unknown>]>;
sourceMaps?: boolean | "inline";
cwd?: string;
filename?: string;
extensions?: string[];
}
export interface CompileOutput {
code: string;
map?: object | null;
metadata?: Record<string, unknown>;
}
export function compileString(source: string, options?: CompileOptions): Promise<CompileOutput>;
export function compileFile(filePath: string, options?: CompileOptions): Promise<CompileOutput>;
export function compileFileSync(filePath: string, options?: CompileOptions): CompileOutput;
export function compileFileWithCallback(
filePath: string,
options: CompileOptions | undefined,
callback: (error: Error | null, result?: CompileOutput) => void
): void;Exposes the compiler entry points used to transform source strings and files, returning code, source maps, and metadata.