fix: replace @ts-ignore with Metro-specific type definitions (#832)
* fix: replace @ts-ignore with Metro-specific type definitions Replace @types/webpack-env dependency with custom Metro type definitions, following the same approach used by Expo. Metro's require.context API intentionally matches webpack's API by design, but using webpack types caused concerns about API differences. This change: - Adds metro-env.d.ts with Metro-specific types in __MetroModuleApi namespace - Exports types via @storybook/react-native/metro-env - Auto-injects reference directive in generated storybook.requires.ts files - Removes both @ts-ignore comments from generated code References: - Expo's approach: https://github.com/expo/expo/blob/main/packages/expo/types/metro-require.d.ts - Metro require.context PR: https://github.com/facebook/metro/pull/822 - Metro HMR Flow types: https://github.com/facebook/metro/blob/main/packages/metro-runtime/src/polyfills/require.js.flow * fix: module.hot --------- Co-authored-by: Daniel Williams <dannyhyunsoowilliams@gmail.com>
Y
YevheniiKotyrlo committed
d2f2d9994f98c29c07bf1fe0108134c3bec094f9
Parent: e0ae780
Committed by GitHub <noreply@github.com>
on 2/20/2026, 11:01:19 PM