Logo Xantham

GeneratorConfig Module

Functions and values

Function or value Description

derivedRuntimePackage packageName

Full Usage: derivedRuntimePackage packageName

Parameters:
    packageName : string

Returns: string
 The npm package a binding's imports name at runtime, derived from the package the
 declarations were generated from.

 A DefinitelyTyped package ships no JavaScript, so an import that names it resolves to
 nothing at all: `@types/three` carries the types and `three` carries the code. The
 derivation is DefinitelyTyped's own naming convention, which is the only thing on disk
 that says what the runtime is called - a `@types/*` manifest has no field for it:

 - `@types/three` -> `three`;
 - `@types/babel__core` -> `@babel/core`, because DT mangles a scope into the name by
   folding `@scope/name` to `scope__name` (it publishes one flat `@types` scope, so it
   has nowhere else to put the scope);
 - anything not under `@types/` is its own runtime, unchanged.

 The mangling is only ambiguous against an unscoped package whose own name contains
 `__`, which DefinitelyTyped's convention cannot express either; `runtime` in
 `xantham.json` overrides the whole derivation for that and for every other package the
 convention does not describe.
packageName : string
Returns: string

disposition config origin

Full Usage: disposition config origin

Parameters:
Returns: GroupDisposition

A group's effective disposition: the entry always ships, everything else is `widen` unless configured (the default flips to `reference` once the shipped compiler-lib package exists - O7).

config : GeneratorConfig
origin : PackageId
Returns: GroupDisposition

groupKey _arg1

Full Usage: groupKey _arg1

Parameters:
Returns: string option

The key a group is addressed by under `xantham.json`'s `groups`; `None` for the groups that are not configurable (the entry package always ships).

_arg1 : PackageId
Returns: string option

load packageDir

Full Usage: load packageDir

Parameters:
    packageDir : string

Returns: GeneratorConfig

Loads `/xantham.json`.

packageDir : string
Returns: GeneratorConfig

loadFile path

Full Usage: loadFile path

Parameters:
    path : string

Returns: GeneratorConfig

Loads a configuration file, tolerating comments and trailing commas (the file is authored by hand). A missing file is the default configuration, not an error.

path : string
Returns: GeneratorConfig

runtimePackage config packageName

Full Usage: runtimePackage config packageName

Parameters:
Returns: string

The configured runtime package, or the derived one. What every `[]` the run renders names.

config : GeneratorConfig
packageName : string
Returns: string

Type something to start searching.