Skip to content

Commit 7af55b4

Browse files
authored
Initial commit
0 parents  commit 7af55b4

Some content is hidden

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

61 files changed

+8889
-0
lines changed

.github/template-cleanup.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
IFS='/' read -ra REPOARR <<< "$GITHUB_REPOSITORY"
4+
echo "Repository: ${REPOARR[0]}"
5+
echo "Repository: ${REPOARR[1]}"
6+
7+
rm README.md
8+
mv .github/template-cleanup/README.md README.md
9+
rm .github/workflows/cleanup.yml
10+
rm .github/template-cleanup.sh
11+
sed -i -e "s~%REPOSITORY%~$GITHUB_REPOSITORY~g" README.md
12+
sed -i -e "s~%NAME%~${REPOARR[1]}~g" README.md

.github/template-cleanup/README.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# %NAME%
2+
3+
![Build](https://github.com/%REPOSITORY%/workflows/Pre%20Merge%20Checks/badge.svg)
4+
5+
This is your new React Native Reproducer project.
6+
7+
# Reproducer TODO list
8+
9+
- [x] 1. Create a new reproducer project.
10+
- [ ] 2. Git clone your repository locally.
11+
- [ ] 3. Edit the project to reproduce the failure you're seeing.
12+
- [ ] 4. Push your changes, so that Github Actions can run the CI.
13+
- [ ] 5. Make sure the repository is public and share the link with the issue you reported.
14+
15+
# How to use this Reproducer
16+
17+
This project has been created with `npx @react-native-community/cli init` and is a vanilla React Native app.
18+
19+
> [!IMPORTANT]
20+
> 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.
21+
22+
## Step 1: Start the Metro Server
23+
24+
First, you will need to start **Metro**, the JavaScript _bundler_ that ships _with_ React Native.
25+
26+
To start Metro, run the following command from the _root_ of your React Native project:
27+
28+
```bash
29+
# using npm
30+
npm start
31+
32+
# OR using Yarn
33+
yarn start
34+
```
35+
36+
## Step 2: Start your Application
37+
38+
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:
39+
40+
### For Android
41+
42+
```bash
43+
# using npm
44+
npm run android
45+
46+
# OR using Yarn
47+
yarn android
48+
```
49+
50+
### For iOS
51+
52+
First, make sure you install dependencies with:
53+
54+
```bash
55+
cd ios && bundle install && bundle exec pod install
56+
```
57+
58+
Then you can run the iOS app with:
59+
60+
```bash
61+
# using npm
62+
npm run ios
63+
64+
# OR using Yarn
65+
yarn ios
66+
```
67+
68+
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.
69+
70+
This is one way to run your app — you can also run it directly from within Android Studio and Xcode respectively.
71+
72+
## Step 3: Modifying your App
73+
74+
Now that you have successfully run the app, let's modify it.
75+
76+
1. Open `App.tsx` in your text editor of choice and edit some lines.
77+
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!
78+
79+
For **iOS**: Hit <kbd>Cmd ⌘</kbd> + <kbd>R</kbd> in your iOS Simulator to reload the app and see your changes!

.github/workflows/auto-updater.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Auto Updater
2+
3+
on:
4+
schedule:
5+
- cron: "0 0 * * *"
6+
workflow_dispatch:
7+
8+
jobs:
9+
daily-auto-update:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
if: github.repository == 'react-native-community/reproducer-react-native'
14+
15+
steps:
16+
- name: Checkout Repo
17+
uses: actions/checkout@v3
18+
19+
- name: Setup Node
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: 18
23+
24+
- name: Check React Native Version
25+
id: yarnoutdated
26+
working-directory: ReproducerApp
27+
run: yarn outdated react-native
28+
continue-on-error: true
29+
30+
- name: Re-create the reproducer
31+
id: recreate
32+
if: steps.yarnoutdated.outcome == 'failure'
33+
run: |
34+
rm -rf ReproducerApp
35+
npx @react-native-community/cli@latest init ReproducerApp --skip-install --skip-git-init
36+
cd ReproducerApp
37+
yarn config set -H enableImmutableInstalls false
38+
yarn
39+
git config --local user.email "[email protected]"
40+
git config --local user.name "GitHub Action"
41+
git add --all
42+
git commit -m "Update reproducer to latest React Native version"
43+
44+
- name: Push changes
45+
uses: ad-m/github-push-action@master
46+
if: steps.yarnoutdated.outcome == 'failure'
47+
with:
48+
branch: main
49+
github_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/cleanup.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# GitHub Actions Workflow responsible for cleaning up the template repository from
2+
# the template-specific files and configurations. This workflow is supposed to be triggered automatically
3+
# when a new template-based repository has been created.
4+
5+
name: Template Cleanup
6+
on:
7+
push:
8+
branches:
9+
- main
10+
11+
jobs:
12+
template-cleanup:
13+
name: Template Cleanup
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: write
17+
if: github.repository != 'react-native-community/reproducer-react-native'
18+
steps:
19+
- name: Checkout Repo
20+
uses: actions/checkout@v3
21+
- name: Cleanup
22+
run: ./.github/template-cleanup.sh
23+
- name: Commit files
24+
run: |
25+
git config --local user.email "[email protected]"
26+
git config --local user.name "GitHub Action"
27+
git add --all
28+
git commit -m "Template cleanup"
29+
- name: Push changes
30+
uses: ad-m/github-push-action@master
31+
with:
32+
branch: main
33+
github_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/pre-merge.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Pre Merge Checks
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- "*"
10+
11+
jobs:
12+
test-android:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Free Disk Space (Ubuntu)
16+
uses: insightsengineering/disk-space-reclaimer@v1
17+
with:
18+
tools-cache: false
19+
android: false
20+
dotnet: true
21+
haskell: true
22+
large-packages: false
23+
swap-storage: false
24+
docker-images: true
25+
26+
- name: Checkout Repo
27+
uses: actions/checkout@v3
28+
29+
- name: Setup Java
30+
uses: actions/setup-java@v3
31+
with:
32+
distribution: "zulu"
33+
java-version: "17"
34+
35+
- name: Setup Node
36+
uses: actions/setup-node@v3
37+
with:
38+
node-version: 18
39+
40+
- name: Setup Gradle
41+
uses: gradle/gradle-build-action@v2
42+
43+
- name: Yarn Install
44+
run: yarn install
45+
working-directory: ReproducerApp
46+
47+
- name: Yarn Build Android Debug
48+
run: yarn react-native build-android
49+
working-directory: ReproducerApp
50+
51+
- name: Yarn Build Android Release
52+
run: yarn react-native build-android --mode=Release
53+
working-directory: ReproducerApp
54+
55+
test-ios:
56+
runs-on: macos-latest
57+
steps:
58+
- name: Checkout Repo
59+
uses: actions/checkout@v3
60+
61+
- name: Setup Node
62+
uses: actions/setup-node@v3
63+
with:
64+
node-version: 18
65+
66+
- name: Setup XCode
67+
uses: maxim-lobanov/setup-xcode@v1
68+
with:
69+
xcode-version: 15.3.x
70+
71+
- name: Yarn Install
72+
run: yarn install
73+
working-directory: ReproducerApp
74+
75+
- name: pod install
76+
run: pod install
77+
working-directory: ReproducerApp/ios
78+
79+
- name: Yarn Build iOS
80+
run: yarn react-native build-ios
81+
working-directory: ReproducerApp

LICENSE

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2023 <Source Code Author>
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
SOFTWARE.

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# React Native Reproducer
2+
3+
> [!IMPORTANT]
4+
> Do not just **fork** this repository, but use instead the [![Use this template](https://img.shields.io/badge/-Use%20this%20template-brightgreen)](https://github.com/cortinico/reproducer-react-native/generate) button on GitHub.
5+
6+
This is the React Native **reproducer** template.
7+
8+
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).
9+
10+
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).
11+
12+
## How to use this repository
13+
14+
1. Click on [![Use this template](https://img.shields.io/badge/-Use%20this%20template-brightgreen)](https://github.com/cortinico/reproducer-react-native/generate) button to create a new repository starting from this one.
15+
2. Git clone your repository locally.
16+
3. Edit the project to reproduce the failure you're seeing.
17+
4. Push your changes, so that Github Actions can run the CI.

ReproducerApp/.bundle/config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
BUNDLE_PATH: "vendor/bundle"
2+
BUNDLE_FORCE_RUBY_PLATFORM: 1

ReproducerApp/.eslintrc.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
root: true,
3+
extends: '@react-native',
4+
};

ReproducerApp/.gitignore

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# OSX
2+
#
3+
.DS_Store
4+
5+
# Xcode
6+
#
7+
build/
8+
*.pbxuser
9+
!default.pbxuser
10+
*.mode1v3
11+
!default.mode1v3
12+
*.mode2v3
13+
!default.mode2v3
14+
*.perspectivev3
15+
!default.perspectivev3
16+
xcuserdata
17+
*.xccheckout
18+
*.moved-aside
19+
DerivedData
20+
*.hmap
21+
*.ipa
22+
*.xcuserstate
23+
**/.xcode.env.local
24+
25+
# Android/IntelliJ
26+
#
27+
build/
28+
.idea
29+
.gradle
30+
local.properties
31+
*.iml
32+
*.hprof
33+
.cxx/
34+
*.keystore
35+
!debug.keystore
36+
.kotlin/
37+
38+
# node.js
39+
#
40+
node_modules/
41+
npm-debug.log
42+
yarn-error.log
43+
44+
# fastlane
45+
#
46+
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
47+
# screenshots whenever they are needed.
48+
# For more information about the recommended setup visit:
49+
# https://docs.fastlane.tools/best-practices/source-control/
50+
51+
**/fastlane/report.xml
52+
**/fastlane/Preview.html
53+
**/fastlane/screenshots
54+
**/fastlane/test_output
55+
56+
# Bundle artifact
57+
*.jsbundle
58+
59+
# Ruby / CocoaPods
60+
**/Pods/
61+
/vendor/bundle/
62+
63+
# Temporary files created by Metro to check the health of the file watcher
64+
.metro-health-check*
65+
66+
# testing
67+
/coverage
68+
69+
# Yarn
70+
.yarn/*
71+
!.yarn/patches
72+
!.yarn/plugins
73+
!.yarn/releases
74+
!.yarn/sdks
75+
!.yarn/versions

ReproducerApp/.prettierrc.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
arrowParens: 'avoid',
3+
bracketSameLine: true,
4+
bracketSpacing: false,
5+
singleQuote: true,
6+
trailingComma: 'all',
7+
};

ReproducerApp/.watchmanconfig

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

0 commit comments

Comments
 (0)