new Builder(declaration, fileReadHandler, fileWriteHandler, transportArray)
Compiles a Heta platform from a declaration object.
Builder owns the main Container, reads modules through the supplied
file handler, validates the platform declaration, and writes export outputs.
It is also the main class used by the Heta compiler CLI.
Parameters:
| Name | Type | Description |
|---|---|---|
declaration |
object | Platform declaration object. See the platform file format. |
fileReadHandler |
function | Reads module content by filename and returns text. |
fileWriteHandler |
function | Writes exported content by filename. |
transportArray |
Array.<Transport> | Logger transports attached to the builder logger. |
Properties:
| Name | Type | Description |
|---|---|---|
container |
Container | Main platform storage. |
logger |
Logger | Logger shared with |
_distDirname |
string | Directory where export files are written, from |
_metaDirname |
string | Directory where debug meta files are written, from |
exportClasses |
object.<string, function()> | Export constructors bound to this builder. |
exportArray |
Array.<object> | Export instances created from the declaration. |
Methods
exportMany() → {void}
Writes all exports configured in the platform declaration.
Returns:
- Type
- void
run() → {Builder}
Runs the full build pipeline.
The pipeline reads and integrates modules, optionally writes debug meta files, loads the resulting Q-array, binds references, checks circular dependencies, checks units and terms, and writes configured exports.
Returns:
This builder.
- Type
- Builder