Skip to content

Commit 0db37b3

Browse files
committed
chore: initial commit
0 parents  commit 0db37b3

File tree

118 files changed

+19602
-0
lines changed

Some content is hidden

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

118 files changed

+19602
-0
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

.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: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/package.json') }}
19+
restore-keys: |
20+
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
21+
${{ runner.os }}-yarn-
22+
23+
- name: Install dependencies
24+
if: steps.yarn-cache.outputs.cache-hit != 'true'
25+
run: |
26+
yarn install --cwd example --frozen-lockfile
27+
yarn install --frozen-lockfile
28+
shell: bash

.github/workflows/ci.yml

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
branches:
8+
- main
9+
10+
jobs:
11+
lint:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v3
16+
17+
- name: Setup
18+
uses: ./.github/actions/setup
19+
20+
- name: Lint files
21+
run: yarn lint
22+
23+
- name: Typecheck files
24+
run: yarn typecheck
25+
26+
test:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v3
31+
32+
- name: Setup
33+
uses: ./.github/actions/setup
34+
35+
- name: Run unit tests
36+
run: yarn test --maxWorkers=2 --coverage
37+
38+
build-library:
39+
runs-on: ubuntu-latest
40+
steps:
41+
- name: Checkout
42+
uses: actions/checkout@v3
43+
44+
- name: Setup
45+
uses: ./.github/actions/setup
46+
47+
- name: Build package
48+
run: yarn prepack
49+
50+
build-android:
51+
runs-on: ubuntu-latest
52+
env:
53+
TURBO_CACHE_DIR: .turbo/android
54+
steps:
55+
- name: Checkout
56+
uses: actions/checkout@v3
57+
58+
- name: Setup
59+
uses: ./.github/actions/setup
60+
61+
- name: Cache turborepo for Android
62+
uses: actions/cache@v3
63+
with:
64+
path: ${{ env.TURBO_CACHE_DIR }}
65+
key: ${{ runner.os }}-turborepo-android-${{ hashFiles('**/yarn.lock') }}
66+
restore-keys: |
67+
${{ runner.os }}-turborepo-android-
68+
69+
- name: Check turborepo cache for Android
70+
run: |
71+
TURBO_CACHE_STATUS=$(node -p "($(yarn --silent turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:android').cache.status")
72+
73+
if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
74+
echo "turbo_cache_hit=1" >> $GITHUB_ENV
75+
fi
76+
77+
- name: Install JDK
78+
if: env.turbo_cache_hit != 1
79+
uses: actions/setup-java@v3
80+
with:
81+
distribution: 'zulu'
82+
java-version: '11'
83+
84+
- name: Finalize Android SDK
85+
if: env.turbo_cache_hit != 1
86+
run: |
87+
/bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null"
88+
89+
- name: Cache Gradle
90+
if: env.turbo_cache_hit != 1
91+
uses: actions/cache@v3
92+
with:
93+
path: |
94+
~/.gradle/wrapper
95+
~/.gradle/caches
96+
key: ${{ runner.os }}-gradle-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }}
97+
restore-keys: |
98+
${{ runner.os }}-gradle-
99+
100+
- name: Build example for Android
101+
run: |
102+
yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}"
103+
104+
build-ios:
105+
runs-on: macos-latest
106+
env:
107+
TURBO_CACHE_DIR: .turbo/ios
108+
steps:
109+
- name: Checkout
110+
uses: actions/checkout@v3
111+
112+
- name: Setup
113+
uses: ./.github/actions/setup
114+
115+
- name: Cache turborepo for iOS
116+
uses: actions/cache@v3
117+
with:
118+
path: ${{ env.TURBO_CACHE_DIR }}
119+
key: ${{ runner.os }}-turborepo-ios-${{ hashFiles('**/yarn.lock') }}
120+
restore-keys: |
121+
${{ runner.os }}-turborepo-ios-
122+
123+
- name: Check turborepo cache for iOS
124+
run: |
125+
TURBO_CACHE_STATUS=$(node -p "($(yarn --silent turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:ios').cache.status")
126+
127+
if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
128+
echo "turbo_cache_hit=1" >> $GITHUB_ENV
129+
fi
130+
131+
- name: Cache cocoapods
132+
if: env.turbo_cache_hit != 1
133+
id: cocoapods-cache
134+
uses: actions/cache@v3
135+
with:
136+
path: |
137+
**/ios/Pods
138+
key: ${{ runner.os }}-cocoapods-${{ hashFiles('example/ios/Podfile.lock') }}
139+
restore-keys: |
140+
${{ runner.os }}-cocoapods-
141+
142+
- name: Install cocoapods
143+
if: env.turbo_cache_hit != 1 && steps.cocoapods-cache.outputs.cache-hit != 'true'
144+
run: |
145+
yarn example pods
146+
env:
147+
NO_FLIPPER: 1
148+
149+
- name: Build example for iOS
150+
run: |
151+
yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}"

.gitignore

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# OSX
2+
#
3+
.DS_Store
4+
5+
# XDE
6+
.expo/
7+
8+
# VSCode
9+
.vscode/
10+
jsconfig.json
11+
12+
.yarn
13+
# Xcode
14+
#
15+
build/
16+
*.pbxuser
17+
!default.pbxuser
18+
*.mode1v3
19+
!default.mode1v3
20+
*.mode2v3
21+
!default.mode2v3
22+
*.perspectivev3
23+
!default.perspectivev3
24+
xcuserdata
25+
*.xccheckout
26+
*.moved-aside
27+
DerivedData
28+
*.hmap
29+
*.ipa
30+
*.xcuserstate
31+
project.xcworkspace
32+
33+
# Android/IJ
34+
#
35+
.classpath
36+
.cxx
37+
.gradle
38+
.idea
39+
.project
40+
.settings
41+
local.properties
42+
android.iml
43+
44+
# Cocoapods
45+
#
46+
example/ios/Pods
47+
48+
# Ruby
49+
example/vendor/
50+
51+
# node.js
52+
#
53+
node_modules/
54+
npm-debug.log
55+
yarn-debug.log
56+
yarn-error.log
57+
58+
# BUCK
59+
buck-out/
60+
\.buckd/
61+
android/app/libs
62+
android/keystores/debug.keystore
63+
64+
# Expo
65+
.expo/
66+
67+
# Turborepo
68+
.turbo/
69+
70+
# generated by bob
71+
lib/

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v18

.watchmanconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

.yarnrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Override Yarn command so we can automatically setup the repo on running `yarn`
2+
3+
yarn-path "scripts/bootstrap.js"

0 commit comments

Comments
 (0)