Code Generation
The Brownfield CLI generates native types from your TypeScript store definitions.
Usage
Configuration
Swift files are always generated to node_modules/@callstack/brownie/ios/Generated/. This path is auto-resolved and not configurable.
Generated Output
For this TypeScript definition:
Swift Output
Generated to: node_modules/@callstack/brownie/ios/Generated/BrownfieldStore.swift
The generated struct:
- Uses
publicaccess level for framework compatibility - Conforms to
Codablefor JSON serialization - Conforms to
BrownieStoreProtocolwith auto-generatedstoreName - Uses mutable
varproperties
How It Works
- CLI recursively finds all
*.brownie.tsfiles - Parses
declare module '@callstack/brownie'blocks using ts-morph - Extracts store names from
BrownieStoresinterface - Generates native types using quicktype
