Logo Xantham

Emission Module

Types

Type Description

EmissionUnit

One compilation unit of the partitioned output.

SplitResult

The result of splitting the rendered tree across the plan.

Functions and values

Function or value Description

dropErasedModules ctx erasedTops root

Full Usage: dropErasedModules ctx erasedTops root

Parameters:

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.

ctx : GeneratorContext
erasedTops : string list
root : RootModule

emitUnits ctx supportLibrary erasedTops plan root outDir

Full Usage: emitUnits ctx supportLibrary erasedTops plan root outDir

Parameters:
Returns: (EmissionUnit * string * int) list

Emit every unit of the plan into outDir//{.fs, .fsproj}. Returns (unit, file, generated-line-count) for the report.

ctx : GeneratorContext
supportLibrary : string option
erasedTops : string list
plan : EmissionUnit list
root : RootModule
outDir : string
Returns: (EmissionUnit * string * int) list

erasedAliasPreamble erasedTops

Full Usage: erasedAliasPreamble erasedTops

Parameters:
    erasedTops : 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.

erasedTops : string list
Returns: string

packageTopModule package

Full Usage: packageTopModule package

Parameters:
    package : 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").

package : string
Returns: string

planUnits recipeDir recipe

Full Usage: planUnits recipeDir recipe

Parameters:
    recipeDir : 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.

recipeDir : string
recipe : Recipe
Returns: EmissionUnit list

renderErasedUnionsFile ()

Full Usage: renderErasedUnionsFile ()

Parameters:
    () : unit

Returns: WidgetBuilder<Oak>

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.

() : unit
Returns: WidgetBuilder<Oak>

renderUnitFile ctx root

Full Usage: renderUnitFile ctx root

Parameters:
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).

ctx : GeneratorContext
root : RootModule
Returns: WidgetBuilder<Oak>

splitRoot plan root

Full Usage: splitRoot plan root

Parameters:
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.

plan : EmissionUnit list
root : RootModule
Returns: SplitResult

unitFsproj supportLibrary unit

Full Usage: unitFsproj supportLibrary unit

Parameters:
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 [] under Fable.Core.JsInterop that activates in later units through the assembly reference when that namespace is open.

supportLibrary : string option
unit : EmissionUnit
Returns: string

Type something to start searching.