Skip to content

Bootstrap

module Bootstrap
AssemblyXantham.Generator

Session bootstrap: locate the compiler, start a mailbox over the package directory, create a program over the package's declaration entry, and bind the session the whole run shares.

Functions and values

entryFile (packageDir: string) : string

The default root declaration: types, typings, a root-export types string, then index.d.ts. A missing or blocked root in an exports map requires an explicit input.

packageName (packageDir: string) : string

The manifest's name, or the directory name when the manifest lacks one.

publicPaths (config: GeneratorConfig) (packageDir: string) : PublicPath list * (string * HarvestGlobals) list

The public paths a run generates. See Context.PublicPaths. With entry configured, the root alone over that file. Otherwise the manifest root (entryFile) plus every ./ key of the exports map, filtered by Subpaths when configured. Skipped keys are returned with their finding. A root-less map yields no root path. publicInputs selects an exact key-to-file map instead, including the root only when listed.

resolveEntryFile (config: GeneratorConfig) (packageDir: string) : string

The existing input file selected for a run. Explicit inputs are relative to the package directory; runtime imports and F# module names are configured independently.

start (config: GeneratorConfig) (packageDir: string) : Async<TscMailbox * Context>

Starts a run's compiler session. The caller owns the returned mailbox and must dispose it - a leaked mailbox leaks a tsc process.