Skip to content

API Reference / @gtkx/codegen / runCodegen

Variable: runCodegen

const runCodegen: (options) => Promise<CodegenRunnerResult>

Defined in: codegen/dist/runner.d.ts:57

Writes and links a project's @gtkx/gi and @gtkx/jsx stores from the given GObject-Introspection libraries. The gi store is rewritten only when its GIR inputs changed, and the jsx store only when the gi store or the React element config changed, unless options.isForced is set. Pass the spread of resolveStore(projectRoot) for everything but libraries and girPath.

Every store already on disk is linked at its linkDir before anything is generated, so a link an install pruned out of node_modules is restored without regenerating the store, and the gi store is reachable under its own specifier while the jsx store is type checked.

Parameters

options

CodegenRunnerOptions

What to generate and where to write it.

Returns

Promise<CodegenRunnerResult>

A summary of what was regenerated and how long the run took.

Throws

If girPath is empty, which would otherwise generate nothing and report success.

Released under the MPL-2.0 License.