Skip to content

Commit 0f0d520

Browse files
tido64facebook-github-bot
authored andcommitted
Fix codegen trying to parse .d.ts files (#34439)
Summary: With react-native 0.70-rc.3 and new arch, codegen may fail if it encounters `.d.ts` files because specs may appear to be unused. ## Changelog [General] [Fixed] - Codegen should ignore `.d.ts` files Pull Request resolved: #34439 Test Plan: See repro in microsoft/react-native-test-app#1052. The build will fail without manually patching this in. If you prefer to use your own test app, try adding [react-native-safe-area-context](https://github.com/th3rdwave/react-native-safe-area-context) as a dependency. Reviewed By: cipolleschi Differential Revision: D38826388 Pulled By: cortinico fbshipit-source-id: eb7c9be2d49286bae86b2428862fbf20f6f32ca5
1 parent ba2dae3 commit 0f0d520

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/react-native-codegen/src/cli/combine/combine-js-to-schema-cli.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ function filterJSFile(file: string) {
2727
// NativeSampleTurboModule is for demo purpose. It should be added manually to the
2828
// app for now.
2929
!file.endsWith('NativeSampleTurboModule.js') &&
30-
!file.includes('__tests')
30+
!file.includes('__tests') &&
31+
// Ignore TypeScript type declaration files.
32+
!file.endsWith('.d.ts')
3133
);
3234
}
3335

0 commit comments

Comments
 (0)