import type { MetroConfig } from 'metro-config'; import { withUniwindConfig } from 'uniwind/metro'; export interface ForgeMetroConfigOptions { /** Path to the CSS entry file (e.g., `'./global.css'`). */ cssEntryFile: string; /** Path where generated Tailwind class type definitions are written. */ generatedTypesFile?: string; } /** * Wraps a Metro config with Forge UI's styling-layer configuration. * * Today this delegates to Uniwind. If the styling layer is swapped (see * `docs/research/uniwind-to-nativewind-contingency.md`), only the internals * of this function change — consuming Metro configs stay the same. * * Must be the **outermost** Metro config wrapper (after any other wrappers * like `withStorybook`). */ export function withForgeMetroConfig( config: T, options: ForgeMetroConfigOptions, ): T { return withUniwindConfig(config, { cssEntryFile: options.cssEntryFile, dtsFile: options.generatedTypesFile, }) as T; }