Tooling

Compiler API

Compile source, inspect the source-located AST and diagnostics, or build a project from JavaScript.

source
compile.tsts
import { compileBeast, compileBeastResult } from "beast-tsrx"; const code = compileBeast(source, {  filename: "Card.btsx",  componentName: "Card",  propsParam: "{ title }: { title: string }",}); const result = compileBeastResult(source, {  filename: "Card.btsx",}); console.log(result.ast, result.code, result.map, result.diagnostics);
watch.tsts
import { watchBeastProject } from "beast-tsrx"; const watcher = watchBeastProject({  root: "src",  outDir: ".beast",  onBuild: (result) => console.log(result.generated),  onError: (error) => console.error(error),}); await watcher.ready;// Later: await watcher.close();
build.tsts
import { buildBeastProject } from "beast-tsrx"; const result = await buildBeastProject({  root: "src",  outDir: ".beast",  components: {    "components/Card.btsx": {      componentName: "Card",      propsParam: "{ title }: { title: string }",    },  },}); console.log(result.manifestPath, result.removed);
ExportPurpose
compileBeast()Compile BTSX and return TSRX code
compileBeastResult()Return code, version 3 source map, AST, and diagnostics
parse()Parse BTSX into the public Beast AST
buildBeastProject()Compile and validate a recursive source tree
watchBeastProject()Watch a source tree with recoverable, serialized rebuilds
resolveProjectPath()Resolve project-relative configuration paths
BeastCompileErrorStructured error carrying a stable diagnostic
beastOctane()Complete integration from the Vite, Rspack, or Rsbuild adapter subpath
ToolSupported version
Node.js>=22.22.2
TypeScript^5.9.3
TSRX TypeScript plugin0.3.129
Octane0.2.0
Vite^8.0.16
Octane Rspack/Rsbuild plugins0.1.47
Rspack / Rsbuild^2.0.0