Skip to content

Commit

Permalink
Fix codegen trying to parse .d.ts files (#34439)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
tido64 authored and facebook-github-bot committed Aug 18, 2022
1 parent ba2dae3 commit 0f0d520
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ function filterJSFile(file: string) {
// NativeSampleTurboModule is for demo purpose. It should be added manually to the
// app for now.
!file.endsWith('NativeSampleTurboModule.js') &&
!file.includes('__tests')
!file.includes('__tests') &&
// Ignore TypeScript type declaration files.
!file.endsWith('.d.ts')
);
}

Expand Down

0 comments on commit 0f0d520

Please sign in to comment.