A small library that extracts the ReaScript Lua documentation and generates Haxe externs.
The default build reads the bundled Lua definitions and writes the generated
classes to dist:
npm run generateInputs, output, and the Haxe package can be overridden for a downstream bindings project:
npm run generate -- \
--reaper path/to/reaper_defs.lua \
--imgui path/to/imgui_defs.lua \
--output path/to/generated \
--package my.reaperRun node src/main.js --help for the available options.
The generated Reaper.hx, Graphics.hx, ImGui.hx, and Types.hx files are
build artifacts. They may be overwritten on regeneration, so keep handwritten
facades and application code outside the generated output directory.
When installed as a dependency, the CLI is also available as:
npx reascript2hx --output path/to/generated --package my.reaperThe package includes the generator source and bundled Lua definitions. A downstream bindings project should pin the generator version or Git commit and commit its generated Haxe output separately.
The documentation snapshot is tracked in resources/manifest.json. It records
the source revision, commit date, fetch time, SHA-256 hash, and embedded API
version when available. Run npm run updateLuaDocs to fetch a new snapshot and
append the previous one to the manifest history.
Credits: Sexan for the Lua documentation provided by their awesome Reaper Reascript VSCode extension
