Emission Module
Types
| Type | Description |
|
One compilation unit of the partitioned output. |
|
|
The result of splitting the rendered tree across the plan. |
Functions and values
| Function or value |
Description
|
Full Usage:
dropErasedModules ctx erasedTops root
Parameters:
GeneratorContext
erasedTops : string list
root : RootModule
|
Drop the modules owned by erased tops from the collected tree — the enforcement point of the erase-with-advisory policy (and the generator- internal chunk-stub module). Every drop is LEDGERED with its node count; references into the dropped content were rewritten to the `Erased.*` advisory aliases by the path substitution.
|
Full Usage:
emitUnits ctx supportLibrary erasedTops plan root outDir
Parameters:
GeneratorContext
supportLibrary : string option
erasedTops : string list
plan : EmissionUnit list
root : RootModule
outDir : string
Returns: (EmissionUnit * string * int) list
|
Emit every unit of the plan into outDir/
|
Full Usage:
erasedAliasPreamble erasedTops
Parameters:
string list
Returns: string
|
The `Erased.*` advisory aliases — the rewrite targets for references into dropped content. Phantom arities absorb surviving generic applications (the ZodType pattern). Appended to the first unit's preamble file.
|
Full Usage:
packageTopModule package
Parameters:
string
Returns: string
|
The npm-name -> top-level-module-name derivation, mirroring the path plane (TypeRefRender.Paths): scoped packages merge to one segment; '-'/'/' are PascalCase word boundaries ("@cloudflare/workers-types" -> "CloudflareWorkersTypes").
|
Full Usage:
planUnits recipeDir recipe
Parameters:
string
recipe : Recipe
Returns: EmissionUnit list
|
The publish-ordered unit plan from the recipe: one unit per lib-declaring entry, in [[entry]] order; each unit references every earlier unit. Policy-holder entries (crawl = false, e.g. zod) ARE units: their content is reached transitively and renders under their top module regardless of seeding. Overlay paths are recipe-relative and resolve against recipeDir.
|
|
Erased-union arities beyond Fable.Core's U2..U9 as their OWN first-unit file. The arity set accumulates GLOBALLY while unit bodies render, so this must be produced AFTER every unit's pass-1 render (the monolith forced all renders before its definitions loop for the same reason); a separate compiled-first file keeps the ordering structural instead of textual.
|
Full Usage:
renderUnitFile ctx root
Parameters:
GeneratorContext
root : RootModule
Returns: WidgetBuilder<Oak>
|
Render one unit file. MIRROR of Render.Collection.renderRoot with a recursive namespace wrapper instead of an anonymous module — if a render arm is added there, add it here (single wrapper difference keeps both readable; unifying behind an inline builder abstraction traded worse than the mirror).
|
Full Usage:
splitRoot plan root
Parameters:
EmissionUnit list
root : RootModule
Returns: SplitResult
|
Split a collected RootModule into per-unit slices at the top-module seam. Total: every module lands in exactly one unit; root types/members and unmatched modules pool into the FIRST unit.
|
Full Usage:
unitFsproj supportLibrary unit
Parameters:
string option
unit : EmissionUnit
Returns: string
|
The generated fsproj for one unit: net10.0 library, Fable.Core for the
interop attributes, project references to every earlier unit. The FIRST unit
(no references) also compiles the Xantham support library — an [
|