Skip to content

Commit 8425ae3

Browse files
committed
chore: git rid of expo example
1 parent 6cef684 commit 8425ae3

File tree

91 files changed

+14905
-12308
lines changed

Some content is hidden

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

91 files changed

+14905
-12308
lines changed

.github/actions/setup/action.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,13 @@ runs:
55
using: composite
66
steps:
77
- name: Setup Node.js
8-
uses: actions/setup-node@v4
8+
uses: actions/setup-node@v3
99
with:
1010
node-version-file: .nvmrc
1111

12-
- name: Enable Corepack
13-
run: corepack enable
14-
shell: bash
15-
1612
- name: Cache dependencies
1713
id: yarn-cache
18-
uses: actions/cache@v4
14+
uses: actions/cache@v3
1915
with:
2016
path: |
2117
**/node_modules

.github/workflows/ci.yml

Lines changed: 107 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,16 @@ on:
66
pull_request:
77
branches:
88
- main
9+
merge_group:
10+
types:
11+
- checks_requested
912

1013
jobs:
1114
lint:
1215
runs-on: ubuntu-latest
1316
steps:
1417
- name: Checkout
15-
uses: actions/checkout@v4
18+
uses: actions/checkout@v3
1619

1720
- name: Setup
1821
uses: ./.github/actions/setup
@@ -27,34 +30,128 @@ jobs:
2730
runs-on: ubuntu-latest
2831
steps:
2932
- name: Checkout
30-
uses: actions/checkout@v4
33+
uses: actions/checkout@v3
3134

3235
- name: Setup
3336
uses: ./.github/actions/setup
3437

3538
- name: Run unit tests
3639
run: yarn test --maxWorkers=2 --coverage
3740

38-
verify:
41+
build-library:
3942
runs-on: ubuntu-latest
4043
steps:
4144
- name: Checkout
42-
uses: actions/checkout@v4
45+
uses: actions/checkout@v3
4346

4447
- name: Setup
4548
uses: ./.github/actions/setup
4649

47-
- name: Run expo doctor
48-
run: yarn example doctor
50+
- name: Build package
51+
run: yarn prepare
4952

50-
build-library:
53+
build-android:
5154
runs-on: ubuntu-latest
55+
env:
56+
TURBO_CACHE_DIR: .turbo/android
5257
steps:
5358
- name: Checkout
54-
uses: actions/checkout@v4
59+
uses: actions/checkout@v3
5560

5661
- name: Setup
5762
uses: ./.github/actions/setup
5863

59-
- name: Build package
60-
run: yarn prepare
64+
- name: Cache turborepo for Android
65+
uses: actions/cache@v3
66+
with:
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
83+
with:
84+
distribution: 'zulu'
85+
java-version: '17'
86+
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
113+
steps:
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 }}"

.gitignore

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,15 @@ android/keystores/debug.keystore
7272
# Expo
7373
.expo/
7474

75+
# Turborepo
76+
.turbo/
77+
7578
# generated by bob
7679
lib/
7780

78-
# Example
79-
example/ios
80-
example/android
81+
# React Native Codegen
82+
ios/generated
83+
android/generated
84+
85+
# Docs
8186
.vercel

.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Lines changed: 541 additions & 0 deletions
Large diffs are not rendered by default.

.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

Lines changed: 28 additions & 0 deletions
Large diffs are not rendered by default.

.yarn/releases/yarn-3.6.1.cjs

Lines changed: 874 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
nmHoistingLimits: workspaces
2-
31
nodeLinker: node-modules
2+
nmHoistingLimits: workspaces
43

54
plugins:
6-
spec: "@yarnpkg/plugin-workspace-tools"
5+
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
6+
spec: "@yarnpkg/plugin-interactive-tools"
7+
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
8+
spec: "@yarnpkg/plugin-workspace-tools"
9+
10+
yarnPath: .yarn/releases/yarn-3.6.1.cjs

CONTRIBUTING.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,18 @@ The [example app](/example/) demonstrates usage of the library. You need to run
2323

2424
It is configured to use the local version of the library, so any changes you make to the library's source code will be reflected in the example app. Changes to the library's JavaScript code will be reflected in the example app without a rebuild, but native code changes will require a rebuild of the example app.
2525

26-
If you want to use Android Studio or XCode to edit the native code, you can open the `example/android` or `example/ios` directories respectively in those editors. To edit the Objective-C or Swift files, open `example/ios/TrueSheetExample.xcworkspace` in XCode and find the source files at `Pods > Development Pods > TrueSheet`.
26+
If you want to use Android Studio or XCode to edit the native code, you can open the `example/android` or `example/ios` directories respectively in those editors. To edit the Objective-C or Swift files, open `example/ios/TrueSheetExample.xcworkspace` in XCode and find the source files at `Pods > Development Pods > react-native-true-sheet`.
2727

2828
To edit the Java or Kotlin files, open `example/android` in Android studio and find the source files at `react-native-true-sheet` under `Android`.
2929

3030
You can use various commands from the root directory to work with the project.
3131

3232
To start the packager:
3333

34+
```sh
35+
yarn example start
36+
```
37+
3438
To run the example app on Android:
3539

3640
```sh
@@ -43,7 +47,7 @@ To run the example app on iOS:
4347
yarn example ios
4448
```
4549

46-
Make sure your code passes TypeScript and ESLint. Run the following to verify:
50+
Make sure your code passes TypeScript and ESLint. Run the following to verify and fix:
4751

4852
```sh
4953
yarn tidy

android/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,5 +95,6 @@ dependencies {
9595
//noinspection GradleDynamicVersion
9696
implementation "com.facebook.react:react-native:+"
9797
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
98+
implementation 'com.google.android.material:material:1.12.0'
9899
}
99100

babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
2-
presets: ['module:@react-native/babel-preset'],
2+
presets: [['module:react-native-builder-bob/babel-preset', { modules: 'commonjs' }]],
33
}

example/.env

Lines changed: 0 additions & 1 deletion
This file was deleted.

example/Gemfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
source 'https://rubygems.org'
2+
3+
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4+
ruby ">= 2.6.10"
5+
6+
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
7+
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
8+
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
9+
gem 'xcodeproj', '< 1.26.0'

example/android/app/build.gradle

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
apply plugin: "com.android.application"
2+
apply plugin: "org.jetbrains.kotlin.android"
3+
apply plugin: "com.facebook.react"
4+
5+
/**
6+
* This is the configuration block to customize your React Native Android app.
7+
* By default you don't need to apply any configuration, just uncomment the lines you need.
8+
*/
9+
react {
10+
/* Folders */
11+
// The root of your project, i.e. where "package.json" lives. Default is '../..'
12+
// root = file("../../")
13+
// The folder where the react-native NPM package is. Default is ../../node_modules/react-native
14+
// reactNativeDir = file("../../node_modules/react-native")
15+
// The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen
16+
// codegenDir = file("../../node_modules/@react-native/codegen")
17+
// The cli.js file which is the React Native CLI entrypoint. Default is ../../node_modules/react-native/cli.js
18+
// cliFile = file("../../node_modules/react-native/cli.js")
19+
20+
/* Variants */
21+
// The list of variants to that are debuggable. For those we're going to
22+
// skip the bundling of the JS bundle and the assets. By default is just 'debug'.
23+
// If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
24+
// debuggableVariants = ["liteDebug", "prodDebug"]
25+
26+
/* Bundling */
27+
// A list containing the node command and its flags. Default is just 'node'.
28+
// nodeExecutableAndArgs = ["node"]
29+
//
30+
// The command to run when bundling. By default is 'bundle'
31+
// bundleCommand = "ram-bundle"
32+
//
33+
// The path to the CLI configuration file. Default is empty.
34+
// bundleConfig = file(../rn-cli.config.js)
35+
//
36+
// The name of the generated asset file containing your JS bundle
37+
// bundleAssetName = "MyApplication.android.bundle"
38+
//
39+
// The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
40+
// entryFile = file("../js/MyApplication.android.js")
41+
//
42+
// A list of extra flags to pass to the 'bundle' commands.
43+
// See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
44+
// extraPackagerArgs = []
45+
46+
/* Hermes Commands */
47+
// The hermes compiler command to run. By default it is 'hermesc'
48+
// hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"
49+
//
50+
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
51+
// hermesFlags = ["-O", "-output-source-map"]
52+
53+
/* Autolinking */
54+
autolinkLibrariesWithApp()
55+
}
56+
57+
/**
58+
* Set this to true to Run Proguard on Release builds to minify the Java bytecode.
59+
*/
60+
def enableProguardInReleaseBuilds = false
61+
62+
/**
63+
* The preferred build flavor of JavaScriptCore (JSC)
64+
*
65+
* For example, to use the international variant, you can use:
66+
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
67+
*
68+
* The international variant includes ICU i18n library and necessary data
69+
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
70+
* give correct results when using with locales other than en-US. Note that
71+
* this variant is about 6MiB larger per architecture than default.
72+
*/
73+
def jscFlavor = 'org.webkit:android-jsc:+'
74+
75+
android {
76+
ndkVersion rootProject.ext.ndkVersion
77+
buildToolsVersion rootProject.ext.buildToolsVersion
78+
compileSdk rootProject.ext.compileSdkVersion
79+
80+
namespace "truesheet.example"
81+
defaultConfig {
82+
applicationId "truesheet.example"
83+
minSdkVersion rootProject.ext.minSdkVersion
84+
targetSdkVersion rootProject.ext.targetSdkVersion
85+
versionCode 1
86+
versionName "1.0"
87+
}
88+
signingConfigs {
89+
debug {
90+
storeFile file('debug.keystore')
91+
storePassword 'android'
92+
keyAlias 'androiddebugkey'
93+
keyPassword 'android'
94+
}
95+
}
96+
buildTypes {
97+
debug {
98+
signingConfig signingConfigs.debug
99+
}
100+
release {
101+
// Caution! In production, you need to generate your own keystore file.
102+
// see https://reactnative.dev/docs/signed-apk-android.
103+
signingConfig signingConfigs.debug
104+
minifyEnabled enableProguardInReleaseBuilds
105+
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
106+
}
107+
}
108+
}
109+
110+
dependencies {
111+
// The version of react-native is set by the React Native Gradle Plugin
112+
implementation("com.facebook.react:react-android")
113+
114+
if (hermesEnabled.toBoolean()) {
115+
implementation("com.facebook.react:hermes-android")
116+
} else {
117+
implementation jscFlavor
118+
}
119+
}

example/android/app/debug.keystore

2.2 KB
Binary file not shown.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Add project specific ProGuard rules here.
2+
# By default, the flags in this file are appended to flags specified
3+
# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
4+
# You can edit the include path and order by changing the proguardFiles
5+
# directive in build.gradle.
6+
#
7+
# For more details, see
8+
# http://developer.android.com/guide/developing/tools/proguard.html
9+
10+
# Add any project specific keep options here:

0 commit comments

Comments
 (0)