API Reference / @gtkx/codegen / resolveStore
Function: resolveStore()
resolveStore(
projectRoot):ResolvedStore
Defined in: packages/codegen/src/store/resolve-store.ts:192
Resolves generated GI and JSX store options from a project's installed dependencies. Pass the result to runCodegen alongside libraries and girPath, omitting jsx when null.
Parameters
projectRoot
string
Directory containing the project's package.json.
Returns
Store locations and versions, with jsx set to null when React is absent.
Remarks
Both stores share one node_modules directory selected from the project's ancestor chain, using the installed renderer and runtime. Hoisted packages can therefore give several projects one shared store. Store versions follow @gtkx/runtime and @gtkx/react, so upgrades invalidate generated output. Explicit gi or jsx options override this selection.
Throws
If runtime cannot be resolved, or a binding consumer is installed above the selected store and cannot import it.