generated from react-native-community/reproducer-react-native
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 7af55b4
Showing
61 changed files
with
8,889 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
IFS='/' read -ra REPOARR <<< "$GITHUB_REPOSITORY" | ||
echo "Repository: ${REPOARR[0]}" | ||
echo "Repository: ${REPOARR[1]}" | ||
|
||
rm README.md | ||
mv .github/template-cleanup/README.md README.md | ||
rm .github/workflows/cleanup.yml | ||
rm .github/template-cleanup.sh | ||
sed -i -e "s~%REPOSITORY%~$GITHUB_REPOSITORY~g" README.md | ||
sed -i -e "s~%NAME%~${REPOARR[1]}~g" README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# %NAME% | ||
|
||
 | ||
|
||
This is your new React Native Reproducer project. | ||
|
||
# Reproducer TODO list | ||
|
||
- [x] 1. Create a new reproducer project. | ||
- [ ] 2. Git clone your repository locally. | ||
- [ ] 3. Edit the project to reproduce the failure you're seeing. | ||
- [ ] 4. Push your changes, so that Github Actions can run the CI. | ||
- [ ] 5. Make sure the repository is public and share the link with the issue you reported. | ||
|
||
# How to use this Reproducer | ||
|
||
This project has been created with `npx @react-native-community/cli init` and is a vanilla React Native app. | ||
|
||
> [!IMPORTANT] | ||
> Make sure you have completed the [React Native - Environment Setup](https://reactnative.dev/docs/set-up-your-environment) so that you have a working environment locally. | ||
## Step 1: Start the Metro Server | ||
|
||
First, you will need to start **Metro**, the JavaScript _bundler_ that ships _with_ React Native. | ||
|
||
To start Metro, run the following command from the _root_ of your React Native project: | ||
|
||
```bash | ||
# using npm | ||
npm start | ||
|
||
# OR using Yarn | ||
yarn start | ||
``` | ||
|
||
## Step 2: Start your Application | ||
|
||
Let Metro Bundler run in its _own_ terminal. Open a _new_ terminal from the _root_ of your React Native project. Run the following command to start your _Android_ or _iOS_ app: | ||
|
||
### For Android | ||
|
||
```bash | ||
# using npm | ||
npm run android | ||
|
||
# OR using Yarn | ||
yarn android | ||
``` | ||
|
||
### For iOS | ||
|
||
First, make sure you install dependencies with: | ||
|
||
```bash | ||
cd ios && bundle install && bundle exec pod install | ||
``` | ||
|
||
Then you can run the iOS app with: | ||
|
||
```bash | ||
# using npm | ||
npm run ios | ||
|
||
# OR using Yarn | ||
yarn ios | ||
``` | ||
|
||
If everything is set up _correctly_, you should see your new app running in your _Android Emulator_ or _iOS Simulator_ shortly provided you have set up your emulator/simulator correctly. | ||
|
||
This is one way to run your app — you can also run it directly from within Android Studio and Xcode respectively. | ||
|
||
## Step 3: Modifying your App | ||
|
||
Now that you have successfully run the app, let's modify it. | ||
|
||
1. Open `App.tsx` in your text editor of choice and edit some lines. | ||
2. For **Android**: Press the <kbd>R</kbd> key twice or select **"Reload"** from the **Developer Menu** (<kbd>Ctrl</kbd> + <kbd>M</kbd> (on Window and Linux) or <kbd>Cmd ⌘</kbd> + <kbd>M</kbd> (on macOS)) to see your changes! | ||
|
||
For **iOS**: Hit <kbd>Cmd ⌘</kbd> + <kbd>R</kbd> in your iOS Simulator to reload the app and see your changes! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Auto Updater | ||
|
||
on: | ||
schedule: | ||
- cron: "0 0 * * *" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
daily-auto-update: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
if: github.repository == 'react-native-community/reproducer-react-native' | ||
|
||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
|
||
- name: Check React Native Version | ||
id: yarnoutdated | ||
working-directory: ReproducerApp | ||
run: yarn outdated react-native | ||
continue-on-error: true | ||
|
||
- name: Re-create the reproducer | ||
id: recreate | ||
if: steps.yarnoutdated.outcome == 'failure' | ||
run: | | ||
rm -rf ReproducerApp | ||
npx @react-native-community/cli@latest init ReproducerApp --skip-install --skip-git-init | ||
cd ReproducerApp | ||
yarn config set -H enableImmutableInstalls false | ||
yarn | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git add --all | ||
git commit -m "Update reproducer to latest React Native version" | ||
- name: Push changes | ||
uses: ad-m/github-push-action@master | ||
if: steps.yarnoutdated.outcome == 'failure' | ||
with: | ||
branch: main | ||
github_token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# GitHub Actions Workflow responsible for cleaning up the template repository from | ||
# the template-specific files and configurations. This workflow is supposed to be triggered automatically | ||
# when a new template-based repository has been created. | ||
|
||
name: Template Cleanup | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
template-cleanup: | ||
name: Template Cleanup | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
if: github.repository != 'react-native-community/reproducer-react-native' | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v3 | ||
- name: Cleanup | ||
run: ./.github/template-cleanup.sh | ||
- name: Commit files | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git add --all | ||
git commit -m "Template cleanup" | ||
- name: Push changes | ||
uses: ad-m/github-push-action@master | ||
with: | ||
branch: main | ||
github_token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
name: Pre Merge Checks | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- "*" | ||
|
||
jobs: | ||
test-android: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Free Disk Space (Ubuntu) | ||
uses: insightsengineering/disk-space-reclaimer@v1 | ||
with: | ||
tools-cache: false | ||
android: false | ||
dotnet: true | ||
haskell: true | ||
large-packages: false | ||
swap-storage: false | ||
docker-images: true | ||
|
||
- name: Checkout Repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: "zulu" | ||
java-version: "17" | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
|
||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
|
||
- name: Yarn Install | ||
run: yarn install | ||
working-directory: ReproducerApp | ||
|
||
- name: Yarn Build Android Debug | ||
run: yarn react-native build-android | ||
working-directory: ReproducerApp | ||
|
||
- name: Yarn Build Android Release | ||
run: yarn react-native build-android --mode=Release | ||
working-directory: ReproducerApp | ||
|
||
test-ios: | ||
runs-on: macos-latest | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
|
||
- name: Setup XCode | ||
uses: maxim-lobanov/setup-xcode@v1 | ||
with: | ||
xcode-version: 15.3.x | ||
|
||
- name: Yarn Install | ||
run: yarn install | ||
working-directory: ReproducerApp | ||
|
||
- name: pod install | ||
run: pod install | ||
working-directory: ReproducerApp/ios | ||
|
||
- name: Yarn Build iOS | ||
run: yarn react-native build-ios | ||
working-directory: ReproducerApp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Copyright (c) 2023 <Source Code Author> | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# React Native Reproducer | ||
|
||
> [!IMPORTANT] | ||
> Do not just **fork** this repository, but use instead the [](https://github.com/cortinico/reproducer-react-native/generate) button on GitHub. | ||
This is the React Native **reproducer** template. | ||
|
||
You can use this template to create a minimal, complete, and reproducible project that the community can use to understand what's your problem. You can read more about the principles of a good reproducible project [here](https://stackoverflow.com/help/mcve). | ||
|
||
This template is up to date with `react-native@latest` as you can find it on [npm](https://www.npmjs.com/package/react-native/v/latest). | ||
|
||
## How to use this repository | ||
|
||
1. Click on [](https://github.com/cortinico/reproducer-react-native/generate) button to create a new repository starting from this one. | ||
2. Git clone your repository locally. | ||
3. Edit the project to reproduce the failure you're seeing. | ||
4. Push your changes, so that Github Actions can run the CI. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
BUNDLE_PATH: "vendor/bundle" | ||
BUNDLE_FORCE_RUBY_PLATFORM: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module.exports = { | ||
root: true, | ||
extends: '@react-native', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# OSX | ||
# | ||
.DS_Store | ||
|
||
# Xcode | ||
# | ||
build/ | ||
*.pbxuser | ||
!default.pbxuser | ||
*.mode1v3 | ||
!default.mode1v3 | ||
*.mode2v3 | ||
!default.mode2v3 | ||
*.perspectivev3 | ||
!default.perspectivev3 | ||
xcuserdata | ||
*.xccheckout | ||
*.moved-aside | ||
DerivedData | ||
*.hmap | ||
*.ipa | ||
*.xcuserstate | ||
**/.xcode.env.local | ||
|
||
# Android/IntelliJ | ||
# | ||
build/ | ||
.idea | ||
.gradle | ||
local.properties | ||
*.iml | ||
*.hprof | ||
.cxx/ | ||
*.keystore | ||
!debug.keystore | ||
.kotlin/ | ||
|
||
# node.js | ||
# | ||
node_modules/ | ||
npm-debug.log | ||
yarn-error.log | ||
|
||
# fastlane | ||
# | ||
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the | ||
# screenshots whenever they are needed. | ||
# For more information about the recommended setup visit: | ||
# https://docs.fastlane.tools/best-practices/source-control/ | ||
|
||
**/fastlane/report.xml | ||
**/fastlane/Preview.html | ||
**/fastlane/screenshots | ||
**/fastlane/test_output | ||
|
||
# Bundle artifact | ||
*.jsbundle | ||
|
||
# Ruby / CocoaPods | ||
**/Pods/ | ||
/vendor/bundle/ | ||
|
||
# Temporary files created by Metro to check the health of the file watcher | ||
.metro-health-check* | ||
|
||
# testing | ||
/coverage | ||
|
||
# Yarn | ||
.yarn/* | ||
!.yarn/patches | ||
!.yarn/plugins | ||
!.yarn/releases | ||
!.yarn/sdks | ||
!.yarn/versions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
arrowParens: 'avoid', | ||
bracketSameLine: true, | ||
bracketSpacing: false, | ||
singleQuote: true, | ||
trailingComma: 'all', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
Oops, something went wrong.