Logo Xantham

Bootstrap Module

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

Function or value Description

entryFile packageDir

Full Usage: entryFile packageDir

Parameters:
    packageDir : string

Returns: string

The package's declaration entry: `types`/`typings` from the manifest, then the first `types` string anywhere under `exports` (conditions nest arbitrarily, so this walks), then `index.d.ts` as npm's own fallback.

packageDir : string
Returns: string

packageName packageDir

Full Usage: packageName packageDir

Parameters:
    packageDir : string

Returns: string

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

packageDir : string
Returns: string

start config packageDir

Full Usage: start config packageDir

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

config : GeneratorConfig
packageDir : string
Returns: Async<TscMailbox * Context>

Type something to start searching.