Skip to content

Commit fda1818

Browse files
authored
[Monorepo] Cleanup (#3515)
## Description This PR consists of changes that aim to clean repository after moving into monorepo, namely: - Unify quotations in github workflows - Remove unnecessary config files - Remove unnecessary dependencies - Changes scripts: - Android format script now drops argument instead of only working at one file. I wanted to make it work only on staged files, however it takes a lot of time since `gradle` has to start over and over. Unfortunately, multiple files for `spotlessIdeHook` [are not in the roadmap](diffplug/spotless#791 (comment)). - Added apple format script which formats only staged files (or whole apple codebase if run without argument) - Added script for checking whether staged android files are included in `package.json` 😅 - Make sure that `lint-staged` operates only on staged files (if possible) - Remove `e2e` app - Add `yarn clean` script ## Test plan Check that CIs pass and example apps work as expected
1 parent 780a7bb commit fda1818

61 files changed

Lines changed: 393 additions & 11572 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@
1717
},
1818
"env": { "browser": true, "node": true, "jest/globals": true },
1919
"plugins": ["react", "jest"],
20-
"ignorePatterns": ["packages/react-native-gesture-handler/lib/**/*"],
20+
"ignorePatterns": [
21+
"packages/react-native-gesture-handler/lib/**/*",
22+
"**/*.config.js",
23+
"scripts/*.js"
24+
],
2125
"rules": {
2226
// removed in new jest-eslint-plugin, referenced in satya config
2327
"jest/no-truthy-falsy": "off",
Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,46 @@
11
name: Test Android build (Paper)
2+
23
on:
34
pull_request:
45
paths:
5-
- '.github/workflows/android-build-paper.yml'
6-
- 'packages/react-native-gesture-handler/android/**'
6+
- .github/workflows/android-build-paper.yml
7+
- packages/react-native-gesture-handler/android/**
78
push:
89
branches:
910
- main
1011
workflow_dispatch:
12+
1113
jobs:
1214
build:
1315
if: github.repository == 'software-mansion/react-native-gesture-handler'
16+
1417
runs-on: ubuntu-latest
1518
env:
16-
WORKING_DIRECTORY: 'apps/ExpoExample'
19+
WORKING_DIRECTORY: apps/ExpoExample
20+
concurrency:
21+
group: android-paper-${{ github.ref }}
22+
cancel-in-progress: true
23+
1724
steps:
1825
- name: checkout
1926
uses: actions/checkout@v4
27+
2028
- name: Use Java 17
2129
uses: actions/setup-java@v4
2230
with:
23-
distribution: 'oracle'
24-
java-version: '17'
31+
distribution: oracle
32+
java-version: 17
33+
2534
- name: Use Node.js 18
2635
uses: actions/setup-node@v4
2736
with:
2837
node-version: 18
29-
cache: 'yarn'
38+
cache: yarn
39+
3040
- name: Install node dependencies
3141
working-directory: ${{ env.WORKING_DIRECTORY }}
3242
run: PAPER_ENABLED=1 yarn install --immutable
43+
3344
- name: Build app
3445
working-directory: ${{ env.WORKING_DIRECTORY }}/android
3546
run: ./gradlew assembleDebug --console=plain -PreactNativeArchitectures=arm64-v8a
Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,48 @@
11
name: Test Android build
2+
23
on:
34
pull_request:
45
paths:
5-
- '.github/workflows/android-build.yml'
6-
- 'packages/react-native-gesture-handler/android/**'
7-
- 'apps/BasicExample/android/**'
6+
- .github/workflows/android-build.yml
7+
- packages/react-native-gesture-handler/android/**
8+
- apps/BasicExample/android/**
89
push:
910
branches:
1011
- main
1112
workflow_dispatch:
13+
1214
jobs:
1315
build:
1416
if: github.repository == 'software-mansion/react-native-gesture-handler'
17+
1518
runs-on: ubuntu-latest
1619
strategy:
1720
matrix:
1821
working-directory: [apps/BasicExample, apps/ExpoExample]
1922
concurrency:
2023
group: android-${{ matrix.working-directory }}-${{ github.ref }}
2124
cancel-in-progress: true
25+
2226
steps:
2327
- name: checkout
2428
uses: actions/checkout@v4
29+
2530
- name: Use Java 17
2631
uses: actions/setup-java@v4
2732
with:
28-
distribution: 'oracle'
29-
java-version: '17'
33+
distribution: oracle
34+
java-version: 17
35+
3036
- name: Use Node.js 18
3137
uses: actions/setup-node@v4
3238
with:
3339
node-version: 18
34-
cache: 'yarn'
40+
cache: yarn
41+
3542
- name: Install node dependencies
3643
working-directory: ${{ matrix.working-directory }}
3744
run: yarn install --immutable
45+
3846
- name: Build app
3947
working-directory: ${{ matrix.working-directory }}/android
4048
run: ./gradlew assembleDebug --console=plain -PreactNativeArchitectures=arm64-v8a
Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,40 @@
11
name: Test consistency between Paper & Fabric
2+
23
on:
34
pull_request:
45
branches:
56
- main
67
paths:
8+
- .github/workflows/check-archs-consistency.yml
79
- packages/react-native-gesture-handler/src/specs/**
810
- packages/react-native-gesture-handler/package.json
911
- apps/BasicExample/package.json
10-
- .github/workflows/check-archs-consistency.yml
1112
push:
1213
branches:
1314
- main
1415
workflow_dispatch:
1516

1617
jobs:
18+
if: github.repository == 'software-mansion/react-native-gesture-handler'
19+
1720
check:
1821
runs-on: ubuntu-latest
1922
concurrency:
2023
group: check-archs-consistency-${{ github.ref }}
2124
cancel-in-progress: true
25+
2226
steps:
2327
- name: checkout
2428
uses: actions/checkout@v4
29+
2530
- name: Use Node.js 18
2631
uses: actions/setup-node@v4
2732
with:
2833
node-version: 18
29-
cache: 'yarn'
34+
cache: yarn
35+
3036
- name: Install node dependencies
3137
run: yarn
38+
3239
- name: Check Android Paper & Fabric generated interfaces consistency
3340
run: yarn workspace react-native-gesture-handler architectures-consistency-check

.github/workflows/close-when-stale.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: Check for stale issues
2+
23
on:
34
schedule:
45
- cron: '37 21 * * *' # at 21:37 every day
@@ -12,11 +13,12 @@ jobs:
1213
main:
1314
if: github.repository == 'software-mansion/react-native-gesture-handler'
1415
runs-on: ubuntu-latest
16+
1517
steps:
1618
- name: Checkout Actions
1719
uses: actions/checkout@v4
1820
with:
19-
repository: 'software-mansion-labs/swmansion-bot'
21+
repository: software-mansion-labs/swmansion-bot
2022
ref: stable
2123

2224
- uses: actions/cache@v4
@@ -30,5 +32,5 @@ jobs:
3032
- name: Close when stale
3133
uses: ./close-when-stale
3234
with:
33-
close-when-stale-label: 'Close when stale'
35+
close-when-stale-label: Close when stale
3436
days-to-close: 20

.github/workflows/docs-check.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,34 @@ name: Check documentation
33
on:
44
pull_request:
55
paths:
6-
- 'packages/docs-gesture-handler/**'
6+
- packages/docs-gesture-handler/**
77
workflow_dispatch:
88

99
jobs:
1010
check:
1111
if: github.repository == 'software-mansion/react-native-gesture-handler'
12+
1213
runs-on: ubuntu-latest
14+
env:
15+
WORKING_DIRECTORY: packages/docs-gesture-handler
1316
concurrency:
1417
group: docs-check-${{ github.ref }}
1518
cancel-in-progress: true
16-
env:
17-
WORKING_DIRECTORY: packages/docs-gesture-handler
19+
1820
steps:
1921
- name: checkout
2022
uses: actions/checkout@v4
23+
2124
- name: Use Node.js 18
2225
uses: actions/setup-node@v4
2326
with:
2427
node-version: 18
25-
cache: 'yarn'
28+
cache: yarn
29+
2630
- name: Install node dependencies
2731
working-directory: ${{ env.WORKING_DIRECTORY }}
2832
run: yarn
33+
2934
- name: Generate docs
3035
working-directory: ${{ env.WORKING_DIRECTORY }}
3136
run: yarn build
Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,46 @@
11
name: Test iOS build (paper)
2+
23
on:
34
pull_request:
45
paths:
5-
- '.github/workflows/ios-build-paper.yml'
6-
- 'packages/react-native-gesture-handler/RNGestureHandler.podspec'
7-
- 'packages/react-native-gesture-handler/apple/**'
6+
- .github/workflows/ios-build-paper.yml
7+
- packages/react-native-gesture-handler/RNGestureHandler.podspec
8+
- packages/react-native-gesture-handler/apple/**
89
push:
910
branches:
1011
- main
1112
workflow_dispatch:
13+
1214
jobs:
1315
build:
1416
if: github.repository == 'software-mansion/react-native-gesture-handler'
17+
1518
runs-on: macos-14
1619
env:
17-
WORKING_DIRECTORY: 'apps/ExpoExample'
20+
WORKING_DIRECTORY: apps/ExpoExample
21+
concurrency:
22+
group: ios-paper-${{ matrix.working-directory }}-${{ github.ref }}
23+
cancel-in-progress: true
24+
1825
steps:
1926
- name: checkout
2027
uses: actions/checkout@v4
28+
2129
- name: Use latest stable Xcode
2230
uses: maxim-lobanov/setup-xcode@v1
2331
with:
2432
xcode-version: '16.1'
33+
2534
- name: Use Node.js 18
2635
uses: actions/setup-node@v4
2736
with:
2837
node-version: 18
29-
cache: 'yarn'
38+
cache: yarn
39+
3040
- name: Install node dependencies
3141
working-directory: ${{ env.WORKING_DIRECTORY }}
3242
run: PAPER_ENABLED=1 yarn install --immutable
43+
3344
- name: Build app
3445
working-directory: ${{ env.WORKING_DIRECTORY }}
3546
run: npx react-native run-ios

.github/workflows/ios-build.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,55 @@
11
name: Test iOS build
2+
23
on:
34
pull_request:
45
paths:
5-
- '.github/workflows/ios-build.yml'
6-
- 'packages/react-native-gesture-handler/RNGestureHandler.podspec'
7-
- 'packages/react-native-gesture-handler/apple/**'
8-
- 'apps/BasicExample/ios/**'
6+
- .github/workflows/ios-build.yml
7+
- packages/react-native-gesture-handler/RNGestureHandler.podspec
8+
- packages/react-native-gesture-handler/apple/**
9+
- apps/BasicExample/ios/**
910
push:
1011
branches:
1112
- main
1213
workflow_dispatch:
14+
1315
jobs:
1416
build:
1517
if: github.repository == 'software-mansion/react-native-gesture-handler'
18+
1619
runs-on: macos-14
20+
env:
21+
WORKING_DIRECTORY: apps/BasicExample
1722
strategy:
1823
matrix:
1924
working-directory: [apps/BasicExample, apps/ExpoExample]
2025
concurrency:
2126
group: ios-${{ matrix.working-directory }}-${{ github.ref }}
2227
cancel-in-progress: true
23-
env:
24-
WORKING_DIRECTORY: apps/BasicExample
28+
2529
steps:
2630
- name: checkout
2731
uses: actions/checkout@v4
32+
2833
- name: Use latest stable Xcode
2934
uses: maxim-lobanov/setup-xcode@v1
3035
with:
3136
xcode-version: '16.1'
37+
3238
- name: Use Node.js 18
3339
uses: actions/setup-node@v4
3440
with:
3541
node-version: 18
36-
cache: 'yarn'
42+
cache: yarn
43+
3744
- name: Install node dependencies
3845
working-directory: ${{ matrix.working-directory }}
3946
run: yarn install --immutable
47+
4048
- name: Install pods
4149
if: ${{ matrix.working-directory == 'apps/BasicExample' }}
4250
working-directory: ${{ matrix.working-directory }}/ios
4351
run: bundle install && NO_FLIPPER=1 bundle exec pod install
52+
4453
- name: Build app
4554
working-directory: ${{ matrix.working-directory }}
4655
run: npx react-native run-ios

.github/workflows/kotlin-lint.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,40 @@
11
name: Kotlin Lint
2+
23
on:
34
pull_request:
45
paths:
5-
- 'packages/react-native-gesture-handler/android/**'
6+
- packages/react-native-gesture-handler/android/**
67
push:
78
branches:
89
- main
910
workflow_dispatch:
11+
1012
jobs:
1113
check:
1214
if: github.repository == 'software-mansion/react-native-gesture-handler'
15+
1316
runs-on: ubuntu-latest
17+
env:
18+
WORKING_DIRECTORY: packages/react-native-gesture-handler
1419
concurrency:
1520
group: kotlin-lint-${{ github.ref }}
1621
cancel-in-progress: true
17-
env:
18-
WORKING_DIRECTORY: 'packages/react-native-gesture-handler'
22+
1923
steps:
2024
- name: checkout
2125
uses: actions/checkout@v4
2226

2327
- name: Use Java 17
2428
uses: actions/setup-java@v4
2529
with:
26-
distribution: 'oracle'
27-
java-version: '17'
30+
distribution: oracle
31+
java-version: 17
2832

2933
- name: Use Node.js 18
3034
uses: actions/setup-node@v4
3135
with:
3236
node-version: 18
33-
cache: 'yarn'
37+
cache: yarn
3438

3539
- uses: actions/cache@v4
3640
with:

0 commit comments

Comments
 (0)