Skip to content

Commit 4644de7

Browse files
authored
[Monorepo] Migrate to monorepo (#3482)
## Description This is base PR that migrates our repository into monorepo structure. It creates following structure: - `/apps` - here we will put our example apps. - `/packages` - main directory for Gesture Handler package, along with documentation. - `/scripts` - scripts that are used by _**GestureHandler**_ (for example formatting scripts) ## Steps <details> <summary>Here is the list of PRs that fix issues caused by changing structure of the repository:</summary> 1. #3487 2. #3490 3. #3494 4. #3495 5. #3496 6. #3497 7. #3503 8. #3506 9. #3507 10. #3510 11. #3515 12. #3518 13. #3519 14. #3524 15. #3525 16. #3526 18. #3528 </details> Note that most of them depends on previous ones, so **_they had to be merged in given order_** (at least up to no. 9). ## Test plan <details> <summary>Following subjects were tested in order to make sure that everything works after migration:</summary> ### Example apps - [x] basic-example - [x] Android - [x] iOS - [x] expo-example (fabric) - [x] Android - [x] iOS - [x] web (in that case architecture doesn't matter) - [x] expo-example (paper) - [x] Android - [x] iOS - [x] macos-example ### Scripts - [x] check-android-dirs - [x] check-rn-versions - [x] format-android - [x] format-apple - [x] codegen-check-consistency - [x] codegen-sync-archs - [x] clangd ### Linters - [x] prettier - [x] eslint - [x] lint-staged ### docs - [x] check documentation ### Build from generated package - [x] New app builds correctly </details>
1 parent 170f5fd commit 4644de7

File tree

975 files changed

+12843
-56255
lines changed

Some content is hidden

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

975 files changed

+12843
-56255
lines changed

.eslintrc.json

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
11
{
2+
"root": true,
23
"extends": [
34
"plugin:@typescript-eslint/recommended",
45
"plugin:@typescript-eslint/recommended-requiring-type-checking",
56
"satya164"
67
],
78
"settings": {
8-
"react": { "version": "16" },
9+
"react": { "version": "19" },
910
"import/resolver": {
1011
"babel-module": {}
1112
}
1213
},
1314
"parser": "@typescript-eslint/parser",
1415
"parserOptions": {
15-
"project": [
16-
"./tsconfig.json",
17-
"./example/tsconfig.json",
18-
"./FabricExample/tsconfig.json"
19-
]
16+
"project": ["./tsconfig.json"]
2017
},
2118
"env": { "browser": true, "node": true, "jest/globals": true },
22-
"plugins": ["jest"],
23-
"ignorePatterns": ["lib/**/*"],
19+
"plugins": ["react", "jest"],
20+
"ignorePatterns": [
21+
"packages/react-native-gesture-handler/lib/**/*",
22+
"**/*.config.js",
23+
"scripts/*.js"
24+
],
2425
"rules": {
2526
// removed in new jest-eslint-plugin, referenced in satya config
2627
"jest/no-truthy-falsy": "off",
@@ -30,19 +31,28 @@
3031
"warn",
3132
{ "assertFunctionNames": ["expect*", "assert*"] }
3233
],
34+
"jest/no-conditional-expect": "warn",
35+
3336
// temporary, remove after we type internals better
3437
"@typescript-eslint/restrict-template-expressions": "warn",
3538
"@typescript-eslint/no-unsafe-member-access": "warn",
3639
"@typescript-eslint/no-unsafe-call": "warn",
3740
"@typescript-eslint/no-unsafe-assignment": "warn",
41+
"@typescript-eslint/no-unsafe-argument": "warn",
3842
"@typescript-eslint/no-unsafe-return": "warn",
43+
"@typescript-eslint/no-non-null-assertion": "warn",
3944
"@typescript-eslint/ban-types": "warn",
4045

4146
// common
4247
"@typescript-eslint/explicit-module-boundary-types": "off",
4348
"import/named": "off",
4449
"react/sort-comp": "off",
4550
"react/no-unused-prop-types": "warn",
51+
"react-hooks/exhaustive-deps": "warn",
52+
"@typescript-eslint/no-floating-promises": "warn",
53+
"@eslint-react/no-missing-component-display-name": "warn",
54+
"@eslint-react/no-nested-components": "warn",
55+
"@eslint-react/no-nested-component-definitions": "warn",
4656
"prefer-const": [
4757
"error",
4858
{
@@ -53,6 +63,13 @@
5363
"error",
5464
{ "argsIgnorePattern": "^_" }
5565
],
66+
"@typescript-eslint/no-explicit-any": "warn",
67+
"@typescript-eslint/no-redundant-type-constituents": "warn",
68+
"@typescript-eslint/no-empty-function": "error",
69+
"@typescript-eslint/no-misused-promises": "warn",
70+
"@eslint-react/no-array-index-key": "warn",
71+
"@eslint-react/hooks-extra/no-direct-set-state-in-use-effect": "warn",
72+
"@eslint-react/hooks-extra/prefer-use-state-lazy-initialization": "warn",
5673
"no-redeclare": "off",
5774
"@typescript-eslint/no-redeclare": "error",
5875
"no-use-before-define": "off",
@@ -65,6 +82,7 @@
6582
}
6683
],
6784
"curly": "error",
68-
"spaced-comment": "error"
85+
"spaced-comment": "error",
86+
"no-alert": "warn"
6987
}
7088
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Test Android build (Paper)
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- .github/workflows/android-build-paper.yml
7+
- packages/react-native-gesture-handler/android/**
8+
push:
9+
branches:
10+
- main
11+
workflow_dispatch:
12+
13+
jobs:
14+
build:
15+
if: github.repository == 'software-mansion/react-native-gesture-handler'
16+
17+
runs-on: ubuntu-latest
18+
env:
19+
WORKING_DIRECTORY: apps/expo-example
20+
concurrency:
21+
group: android-paper-${{ github.ref }}
22+
cancel-in-progress: true
23+
24+
steps:
25+
- name: checkout
26+
uses: actions/checkout@v4
27+
28+
- name: Use Java 17
29+
uses: actions/setup-java@v4
30+
with:
31+
distribution: oracle
32+
java-version: 17
33+
34+
- name: Use Node.js 18
35+
uses: actions/setup-node@v4
36+
with:
37+
node-version: 18
38+
cache: yarn
39+
40+
- name: Install node dependencies
41+
working-directory: ${{ env.WORKING_DIRECTORY }}
42+
run: PAPER_ENABLED=1 yarn install --immutable
43+
44+
- name: Build app
45+
working-directory: ${{ env.WORKING_DIRECTORY }}/android
46+
run: ./gradlew assembleDebug --console=plain -PreactNativeArchitectures=arm64-v8a

.github/workflows/android-build.yml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,48 @@
11
name: Test Android build
2+
23
on:
34
pull_request:
45
paths:
5-
- '.github/workflows/android-build.yml'
6-
- 'android/**'
7-
- 'Common/**'
8-
- 'example/android/**'
9-
- 'FabricExample/android/**'
6+
- .github/workflows/android-build.yml
7+
- packages/react-native-gesture-handler/android/**
8+
- apps/basic-example/android/**
109
push:
1110
branches:
1211
- main
1312
workflow_dispatch:
13+
1414
jobs:
1515
build:
1616
if: github.repository == 'software-mansion/react-native-gesture-handler'
17+
1718
runs-on: ubuntu-latest
1819
strategy:
1920
matrix:
20-
working-directory: [example, FabricExample]
21+
working-directory: [apps/basic-example, apps/expo-example]
2122
concurrency:
2223
group: android-${{ matrix.working-directory }}-${{ github.ref }}
2324
cancel-in-progress: true
25+
2426
steps:
2527
- name: checkout
2628
uses: actions/checkout@v4
29+
2730
- name: Use Java 17
2831
uses: actions/setup-java@v4
2932
with:
30-
distribution: 'oracle'
31-
java-version: '17'
33+
distribution: oracle
34+
java-version: 17
35+
3236
- name: Use Node.js 18
3337
uses: actions/setup-node@v4
3438
with:
3539
node-version: 18
36-
cache: 'yarn'
40+
cache: yarn
41+
3742
- name: Install node dependencies
3843
working-directory: ${{ matrix.working-directory }}
39-
run: yarn
44+
run: yarn install --immutable
45+
4046
- name: Build app
4147
working-directory: ${{ matrix.working-directory }}/android
4248
run: ./gradlew assembleDebug --console=plain -PreactNativeArchitectures=arm64-v8a
Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,40 @@
11
name: Test consistency between Paper & Fabric
2-
on:
2+
3+
on:
34
pull_request:
45
branches:
56
- main
6-
paths:
7-
- src/specs/**
8-
- package.json
9-
- FabricExample/package.json
7+
paths:
108
- .github/workflows/check-archs-consistency.yml
9+
- packages/react-native-gesture-handler/src/specs/**
10+
- packages/react-native-gesture-handler/package.json
11+
- apps/basic-example/package.json
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
33-
run: yarn architectures-consistency-check
40+
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-
- 'docs/**'
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: docs
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

.github/workflows/ios-build-paper.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Test iOS build (paper)
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- .github/workflows/ios-build-paper.yml
7+
- packages/react-native-gesture-handler/RNGestureHandler.podspec
8+
- packages/react-native-gesture-handler/apple/**
9+
push:
10+
branches:
11+
- main
12+
workflow_dispatch:
13+
14+
jobs:
15+
build:
16+
if: github.repository == 'software-mansion/react-native-gesture-handler'
17+
18+
runs-on: macos-14
19+
env:
20+
WORKING_DIRECTORY: apps/expo-example
21+
concurrency:
22+
group: ios-paper-${{ matrix.working-directory }}-${{ github.ref }}
23+
cancel-in-progress: true
24+
25+
steps:
26+
- name: checkout
27+
uses: actions/checkout@v4
28+
29+
- name: Use latest stable Xcode
30+
uses: maxim-lobanov/setup-xcode@v1
31+
with:
32+
xcode-version: '16.1'
33+
34+
- name: Use Node.js 18
35+
uses: actions/setup-node@v4
36+
with:
37+
node-version: 18
38+
cache: yarn
39+
40+
- name: Install node dependencies
41+
working-directory: ${{ env.WORKING_DIRECTORY }}
42+
run: PAPER_ENABLED=1 yarn install --immutable
43+
44+
- name: Build app
45+
working-directory: ${{ env.WORKING_DIRECTORY }}
46+
run: npx react-native run-ios

0 commit comments

Comments
 (0)