Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
36 changes: 27 additions & 9 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
{
"root": true,
"extends": [
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"satya164"
],
"settings": {
"react": { "version": "16" },
"react": { "version": "19" },
"import/resolver": {
"babel-module": {}
}
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": [
"./tsconfig.json",
"./example/tsconfig.json",
"./FabricExample/tsconfig.json"
]
"project": ["./tsconfig.json"]
},
"env": { "browser": true, "node": true, "jest/globals": true },
"plugins": ["jest"],
"ignorePatterns": ["lib/**/*"],
"plugins": ["react", "jest"],
"ignorePatterns": [
"packages/react-native-gesture-handler/lib/**/*",
"**/*.config.js",
"scripts/*.js"
],
"rules": {
// removed in new jest-eslint-plugin, referenced in satya config
"jest/no-truthy-falsy": "off",
Expand All @@ -30,19 +31,28 @@
"warn",
{ "assertFunctionNames": ["expect*", "assert*"] }
],
"jest/no-conditional-expect": "warn",

// temporary, remove after we type internals better
"@typescript-eslint/restrict-template-expressions": "warn",
"@typescript-eslint/no-unsafe-member-access": "warn",
"@typescript-eslint/no-unsafe-call": "warn",
"@typescript-eslint/no-unsafe-assignment": "warn",
"@typescript-eslint/no-unsafe-argument": "warn",
"@typescript-eslint/no-unsafe-return": "warn",
"@typescript-eslint/no-non-null-assertion": "warn",
"@typescript-eslint/ban-types": "warn",

// common
"@typescript-eslint/explicit-module-boundary-types": "off",
"import/named": "off",
"react/sort-comp": "off",
"react/no-unused-prop-types": "warn",
"react-hooks/exhaustive-deps": "warn",
"@typescript-eslint/no-floating-promises": "warn",
"@eslint-react/no-missing-component-display-name": "warn",
"@eslint-react/no-nested-components": "warn",
"@eslint-react/no-nested-component-definitions": "warn",
"prefer-const": [
"error",
{
Expand All @@ -53,6 +63,13 @@
"error",
{ "argsIgnorePattern": "^_" }
],
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-redundant-type-constituents": "warn",
"@typescript-eslint/no-empty-function": "error",
"@typescript-eslint/no-misused-promises": "warn",
"@eslint-react/no-array-index-key": "warn",
"@eslint-react/hooks-extra/no-direct-set-state-in-use-effect": "warn",
"@eslint-react/hooks-extra/prefer-use-state-lazy-initialization": "warn",
"no-redeclare": "off",
"@typescript-eslint/no-redeclare": "error",
"no-use-before-define": "off",
Expand All @@ -65,6 +82,7 @@
}
],
"curly": "error",
"spaced-comment": "error"
"spaced-comment": "error",
"no-alert": "warn"
}
}
46 changes: 46 additions & 0 deletions .github/workflows/android-build-paper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Test Android build (Paper)

on:
pull_request:
paths:
- .github/workflows/android-build-paper.yml
- packages/react-native-gesture-handler/android/**
push:
branches:
- main
workflow_dispatch:

jobs:
build:
if: github.repository == 'software-mansion/react-native-gesture-handler'

runs-on: ubuntu-latest
env:
WORKING_DIRECTORY: apps/expo-example
concurrency:
group: android-paper-${{ github.ref }}
cancel-in-progress: true

steps:
- name: checkout
uses: actions/checkout@v4

- name: Use Java 17
uses: actions/setup-java@v4
with:
distribution: oracle
java-version: 17

- name: Use Node.js 18
uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn

- name: Install node dependencies
working-directory: ${{ env.WORKING_DIRECTORY }}
run: PAPER_ENABLED=1 yarn install --immutable

- name: Build app
working-directory: ${{ env.WORKING_DIRECTORY }}/android
run: ./gradlew assembleDebug --console=plain -PreactNativeArchitectures=arm64-v8a
26 changes: 16 additions & 10 deletions .github/workflows/android-build.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,48 @@
name: Test Android build

on:
pull_request:
paths:
- '.github/workflows/android-build.yml'
- 'android/**'
- 'Common/**'
- 'example/android/**'
- 'FabricExample/android/**'
- .github/workflows/android-build.yml
- packages/react-native-gesture-handler/android/**
- apps/basic-example/android/**
push:
branches:
- main
workflow_dispatch:

jobs:
build:
if: github.repository == 'software-mansion/react-native-gesture-handler'

runs-on: ubuntu-latest
strategy:
matrix:
working-directory: [example, FabricExample]
working-directory: [apps/basic-example, apps/expo-example]
concurrency:
group: android-${{ matrix.working-directory }}-${{ github.ref }}
cancel-in-progress: true

steps:
- name: checkout
uses: actions/checkout@v4

- name: Use Java 17
uses: actions/setup-java@v4
with:
distribution: 'oracle'
java-version: '17'
distribution: oracle
java-version: 17

- name: Use Node.js 18
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'yarn'
cache: yarn

- name: Install node dependencies
working-directory: ${{ matrix.working-directory }}
run: yarn
run: yarn install --immutable

- name: Build app
working-directory: ${{ matrix.working-directory }}/android
run: ./gradlew assembleDebug --console=plain -PreactNativeArchitectures=arm64-v8a
21 changes: 14 additions & 7 deletions .github/workflows/check-archs-consistency.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,40 @@
name: Test consistency between Paper & Fabric
on:

on:
pull_request:
branches:
- main
paths:
- src/specs/**
- package.json
- FabricExample/package.json
paths:
- .github/workflows/check-archs-consistency.yml
- packages/react-native-gesture-handler/src/specs/**
- packages/react-native-gesture-handler/package.json
- apps/basic-example/package.json
push:
branches:
- main
workflow_dispatch:

jobs:
if: github.repository == 'software-mansion/react-native-gesture-handler'

check:
runs-on: ubuntu-latest
concurrency:
group: check-archs-consistency-${{ github.ref }}
cancel-in-progress: true

steps:
- name: checkout
uses: actions/checkout@v4

- name: Use Node.js 18
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'yarn'
cache: yarn

- name: Install node dependencies
run: yarn

- name: Check Android Paper & Fabric generated interfaces consistency
run: yarn architectures-consistency-check
run: yarn workspace react-native-gesture-handler architectures-consistency-check
6 changes: 4 additions & 2 deletions .github/workflows/close-when-stale.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Check for stale issues

on:
schedule:
- cron: '37 21 * * *' # at 21:37 every day
Expand All @@ -12,11 +13,12 @@ jobs:
main:
if: github.repository == 'software-mansion/react-native-gesture-handler'
runs-on: ubuntu-latest

steps:
- name: Checkout Actions
uses: actions/checkout@v4
with:
repository: 'software-mansion-labs/swmansion-bot'
repository: software-mansion-labs/swmansion-bot
ref: stable

- uses: actions/cache@v4
Expand All @@ -30,5 +32,5 @@ jobs:
- name: Close when stale
uses: ./close-when-stale
with:
close-when-stale-label: 'Close when stale'
close-when-stale-label: Close when stale
days-to-close: 20
13 changes: 9 additions & 4 deletions .github/workflows/docs-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,34 @@ name: Check documentation
on:
pull_request:
paths:
- 'docs/**'
- packages/docs-gesture-handler/**
workflow_dispatch:

jobs:
check:
if: github.repository == 'software-mansion/react-native-gesture-handler'

runs-on: ubuntu-latest
env:
WORKING_DIRECTORY: packages/docs-gesture-handler
concurrency:
group: docs-check-${{ github.ref }}
cancel-in-progress: true
env:
WORKING_DIRECTORY: docs

steps:
- name: checkout
uses: actions/checkout@v4

- name: Use Node.js 18
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'yarn'
cache: yarn

- name: Install node dependencies
working-directory: ${{ env.WORKING_DIRECTORY }}
run: yarn

- name: Generate docs
working-directory: ${{ env.WORKING_DIRECTORY }}
run: yarn build
46 changes: 46 additions & 0 deletions .github/workflows/ios-build-paper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Test iOS build (paper)

on:
pull_request:
paths:
- .github/workflows/ios-build-paper.yml
- packages/react-native-gesture-handler/RNGestureHandler.podspec
- packages/react-native-gesture-handler/apple/**
push:
branches:
- main
workflow_dispatch:

jobs:
build:
if: github.repository == 'software-mansion/react-native-gesture-handler'

runs-on: macos-14
env:
WORKING_DIRECTORY: apps/expo-example
concurrency:
group: ios-paper-${{ matrix.working-directory }}-${{ github.ref }}
cancel-in-progress: true

steps:
- name: checkout
uses: actions/checkout@v4

- name: Use latest stable Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '16.1'

- name: Use Node.js 18
uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn

- name: Install node dependencies
working-directory: ${{ env.WORKING_DIRECTORY }}
run: PAPER_ENABLED=1 yarn install --immutable

- name: Build app
working-directory: ${{ env.WORKING_DIRECTORY }}
run: npx react-native run-ios
Loading
Loading