Skip to content

Commit b1c8484

Browse files
authored
Merge pull request #231 from p3ol/refactor/full-native
♻️ refactor: rewrite whole library as a wrapper around native libraries
2 parents acad664 + 7d7655b commit b1c8484

File tree

199 files changed

+19373
-27565
lines changed

Some content is hidden

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

199 files changed

+19373
-27565
lines changed

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# EditorConfig helps developers define and maintain consistent
2+
# coding styles between different editors and IDEs
3+
# editorconfig.org
4+
5+
root = true
6+
7+
[*]
8+
9+
indent_style = space
10+
indent_size = 2
11+
12+
end_of_line = lf
13+
charset = utf-8
14+
trim_trailing_whitespace = true
15+
insert_final_newline = true

.eslintignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

.eslintrc.js

Lines changed: 0 additions & 18 deletions
This file was deleted.

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.pbxproj -text
2+
# specific for windows script files
3+
*.bat text eol=crlf

.github/actions/setup/action.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Setup
2+
description: Setup Node.js and install dependencies
3+
4+
runs:
5+
using: composite
6+
steps:
7+
- name: Setup Node.js
8+
uses: actions/setup-node@v3
9+
with:
10+
node-version-file: .nvmrc
11+
12+
- name: Cache dependencies
13+
id: yarn-cache
14+
uses: actions/cache@v3
15+
with:
16+
path: |
17+
**/node_modules
18+
.yarn/install-state.gz
19+
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }}
20+
restore-keys: |
21+
${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
22+
${{ runner.os }}-yarn-
23+
24+
- name: Install dependencies
25+
if: steps.yarn-cache.outputs.cache-hit != 'true'
26+
run: yarn install --immutable
27+
shell: bash

.github/pull_request_template.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{ REMOVE THIS TO WRITE YOUR OWN DESCRIPTION }
2+
3+
## PR title rules
4+
5+
- Should have an emoji so it's clear what it does from the list view
6+
- Should have a type (feat, fix, chore, ...)
7+
- Can have a subject (but it's not mandatory)
8+
9+
## Available emojis
10+
11+
- ✨ → New feature
12+
- 🐛 → Bug fix
13+
- ♻️ → Drastically rewrites a big percentage of the code or architecture
14+
- 🏗 → Add/update unit tests
15+
- 📦 → Dependency maintenance and/or internal script update
16+
- 📖 → Documentation update
17+
18+
## Allowed types
19+
- chore
20+
- docs
21+
- feat
22+
- fix
23+
- refactor
24+
- test
25+
- tests
26+
- deploy
27+
- release
28+
29+
## Don't do
30+
31+
```
32+
Feature: Add new time picker
33+
fix the thing that was not working
34+
```
35+
36+
## Do
37+
38+
```
39+
✨ feat(react): add new time picker component
40+
🐛 fix(core): parse hsla correctly
41+
```

.github/workflows/ci.yml

Lines changed: 139 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,157 @@
11
name: CI
2-
32
on:
43
push:
5-
branches: [master]
4+
branches:
5+
- master
66
pull_request:
7-
branches: [master]
7+
branches:
8+
- master, develop
9+
merge_group:
10+
types:
11+
- checks_requested
812

913
jobs:
1014
lint:
11-
name: Linting
1215
runs-on: ubuntu-latest
1316
steps:
14-
- name: Checkout code
15-
uses: actions/checkout@v2
16-
- name: Setup node
17-
uses: actions/setup-node@v2
18-
- name: Install deps
19-
run: yarn install
20-
- name: Eslint check
17+
- name: Checkout
18+
uses: actions/checkout@v3
19+
20+
- name: Setup
21+
uses: ./.github/actions/setup
22+
23+
- name: Lint files
2124
run: yarn lint
2225

26+
- name: Typecheck files
27+
run: yarn typecheck
28+
2329
test:
24-
name: Unit tests
2530
runs-on: ubuntu-latest
26-
strategy:
27-
matrix:
28-
node: [10, 12, 14]
2931
steps:
30-
- name: Checkout code
31-
uses: actions/checkout@v2
32-
- name: Setup node
33-
uses: actions/setup-node@v2
32+
- name: Checkout
33+
uses: actions/checkout@v3
34+
35+
- name: Setup
36+
uses: ./.github/actions/setup
37+
38+
- name: Run unit tests
39+
run: yarn test --maxWorkers=2 --coverage
40+
41+
build-library:
42+
runs-on: ubuntu-latest
43+
steps:
44+
- name: Checkout
45+
uses: actions/checkout@v3
46+
47+
- name: Setup
48+
uses: ./.github/actions/setup
49+
50+
- name: Build package
51+
run: yarn prepare
52+
53+
build-android:
54+
runs-on: ubuntu-latest
55+
env:
56+
TURBO_CACHE_DIR: .turbo/android
57+
steps:
58+
- name: Checkout
59+
uses: actions/checkout@v3
60+
61+
- name: Setup
62+
uses: ./.github/actions/setup
63+
64+
- name: Cache turborepo for Android
65+
uses: actions/cache@v3
3466
with:
35-
node-version: ${{ matrix.node }}
36-
- name: Install deps
37-
run: yarn install
38-
- name: Test
39-
run: yarn test
40-
- name: Codecov upload
41-
uses: codecov/[email protected]
67+
path: ${{ env.TURBO_CACHE_DIR }}
68+
key: ${{ runner.os }}-turborepo-android-${{ hashFiles('yarn.lock') }}
69+
restore-keys: |
70+
${{ runner.os }}-turborepo-android-
71+
72+
- name: Check turborepo cache for Android
73+
run: |
74+
TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:android').cache.status")
75+
76+
if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
77+
echo "turbo_cache_hit=1" >> $GITHUB_ENV
78+
fi
79+
80+
- name: Install JDK
81+
if: env.turbo_cache_hit != 1
82+
uses: actions/setup-java@v3
4283
with:
43-
token: ${{ secrets.CODECOV_TOKEN }}
84+
distribution: 'zulu'
85+
java-version: '17'
4486

45-
build:
46-
name: Building
47-
runs-on: ubuntu-latest
87+
- name: Finalize Android SDK
88+
if: env.turbo_cache_hit != 1
89+
run: |
90+
/bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null"
91+
92+
- name: Cache Gradle
93+
if: env.turbo_cache_hit != 1
94+
uses: actions/cache@v3
95+
with:
96+
path: |
97+
~/.gradle/wrapper
98+
~/.gradle/caches
99+
key: ${{ runner.os }}-gradle-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }}
100+
restore-keys: |
101+
${{ runner.os }}-gradle-
102+
103+
- name: Build example for Android
104+
env:
105+
JAVA_OPTS: "-XX:MaxHeapSize=6g"
106+
run: |
107+
yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}"
108+
109+
build-ios:
110+
runs-on: macos-14
111+
env:
112+
TURBO_CACHE_DIR: .turbo/ios
48113
steps:
49-
- name: Checkout code
50-
uses: actions/checkout@v2
51-
- name: Setup node
52-
uses: actions/setup-node@v2
53-
- name: Install deps
54-
run: yarn install
55-
- name: Build
56-
run: yarn build
114+
- name: Checkout
115+
uses: actions/checkout@v3
116+
117+
- name: Setup
118+
uses: ./.github/actions/setup
119+
120+
- name: Cache turborepo for iOS
121+
uses: actions/cache@v3
122+
with:
123+
path: ${{ env.TURBO_CACHE_DIR }}
124+
key: ${{ runner.os }}-turborepo-ios-${{ hashFiles('yarn.lock') }}
125+
restore-keys: |
126+
${{ runner.os }}-turborepo-ios-
127+
128+
- name: Check turborepo cache for iOS
129+
run: |
130+
TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:ios').cache.status")
131+
132+
if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
133+
echo "turbo_cache_hit=1" >> $GITHUB_ENV
134+
fi
135+
136+
- name: Cache cocoapods
137+
if: env.turbo_cache_hit != 1
138+
id: cocoapods-cache
139+
uses: actions/cache@v3
140+
with:
141+
path: |
142+
**/ios/Pods
143+
key: ${{ runner.os }}-cocoapods-${{ hashFiles('example/ios/Podfile.lock') }}
144+
restore-keys: |
145+
${{ runner.os }}-cocoapods-
146+
147+
- name: Install cocoapods
148+
if: env.turbo_cache_hit != 1 && steps.cocoapods-cache.outputs.cache-hit != 'true'
149+
run: |
150+
cd example/ios
151+
pod install
152+
env:
153+
NO_FLIPPER: 1
154+
155+
- name: Build example for iOS
156+
run: |
157+
yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}"

0 commit comments

Comments
 (0)