software-mansion / react-native-gesture-handler

Declarative API exposing platform native touch and gesture system to React Native.
https://docs.swmansion.com/react-native-gesture-handler/
MIT License
6.13k stars 982 forks source link

chore: Refactore gradle task to JS scripts #3001

Closed maciekstosio closed 4 months ago

maciekstosio commented 4 months ago

Changes moved from: https://github.com/software-mansion/react-native-screens/pull/2224

Description

When changing native props on Fabric, codegen generates corresponding interfaces and delegates. To make sure both implementations are consistent, we implement those interfaces on Paper too. Currently, after generating interfaces using codegen, developer needs to copy corresponding files for paper manually. This task adds Gradle task, that automates this.

Changes

Current assumption: Two scripts: check-archs-consistency and sync-archs. The first one generates codegen interfaces and compares them with what we have for paper, the second generates and copies for paper to sync the archs.

Test code and steps to reproduce

Open src/specs/RNGestureHandlerButtonNativeComponent.ts and remove any proper form interface. Now:

You can also run those commands yourself using yarn check-archs-consistency and yarn sync-archs