diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index fb98c79..950a377 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -7,7 +7,7 @@ runs: - name: Setup Node.js uses: actions/setup-node@v3 with: - node-version-file: .nvmrc + node-version-file: .node-version - name: Cache dependencies id: yarn-cache diff --git a/.node-version b/.node-version new file mode 100644 index 0000000..34bfa5c --- /dev/null +++ b/.node-version @@ -0,0 +1 @@ +18.19.1 \ No newline at end of file diff --git a/.nvmrc b/.nvmrc deleted file mode 100644 index 3f430af..0000000 --- a/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -v18 diff --git a/example/.node-version b/example/.node-version new file mode 100644 index 0000000..34bfa5c --- /dev/null +++ b/example/.node-version @@ -0,0 +1 @@ +18.19.1 \ No newline at end of file diff --git a/example/.ruby-version b/example/.ruby-version new file mode 100644 index 0000000..06eda28 --- /dev/null +++ b/example/.ruby-version @@ -0,0 +1 @@ +3.2.3 \ No newline at end of file diff --git a/example/README.md b/example/README.md index 12470c3..0a98c16 100644 --- a/example/README.md +++ b/example/README.md @@ -2,78 +2,50 @@ This is a new [**React Native**](https://reactnative.dev) project, bootstrapped # Getting Started ->**Note**: Make sure you have completed the [React Native - Environment Setup](https://reactnative.dev/docs/environment-setup) instructions till "Creating a new application" step, before proceeding. +> **Note**: Make sure you have completed the [React Native - Environment Setup](https://reactnative.dev/docs/environment-setup) instructions till "Creating a new application" step, before proceeding. -## Step 1: Start the Metro Server +## NodeJS and Ruby -First, you will need to start **Metro**, the JavaScript _bundler_ that ships _with_ React Native. +To run the project you need to install the correct version of NodeJS and Ruby. +We recommend the use of a virtual environment of your choice. For ease of use, this guide adopts [nodenv](https://github.com/nodenv/nodenv) for NodeJS, [rbenv](https://github.com/rbenv/rbenv) for Ruby. -To start Metro, run the following command from the _root_ of your React Native project: +The node version used in this project is stored in [.node-version](.node-version), +while the version of Ruby is stored in [.ruby-version](.ruby-version). + +## Build the app ```bash -# using npm -npm start +# Install NodeJS with nodenv, the returned version should match the one in the .node-version file +$ nodenv install && nodenv version -# OR using Yarn -yarn start -``` +# Install Ruby with rbenv, the returned version should match the one in the .ruby-version file +$ rbenv install && rbenv version -## Step 2: Start your Application +# Install yarn and rehash to install shims +$ npm install -g yarn && nodenv rehash -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: +# Install bundle +$ gem install bundle -### For Android +# Install the required Gems from the Gemfile +# Run this only during the first setup and when Gems dependencies change +$ bundle install -```bash -# using npm -npm run android +# Install dependencies +# Run this only during the first setup and when JS dependencies change +$ yarn install -# OR using Yarn -yarn android +# Install podfiles when targeting iOS (ignore this step for Android) +# Run this only during the first setup and when Pods dependencies change +$ cd ios && bundle exec pod install && cd .. ``` -### For iOS +## Run the app ```bash -# using npm -npm run ios +# Android +$ yarn android -# OR using Yarn -yarn ios +# iOS +$ 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 R key twice or select **"Reload"** from the **Developer Menu** (Ctrl + M (on Window and Linux) or Cmd ⌘ + M (on macOS)) to see your changes! - - For **iOS**: Hit Cmd ⌘ + R in your iOS Simulator to reload the app and see your changes! - -## Congratulations! :tada: - -You've successfully run and modified your React Native App. :partying_face: - -### Now what? - -- If you want to add this new React Native code to an existing application, check out the [Integration guide](https://reactnative.dev/docs/integration-with-existing-apps). -- If you're curious to learn more about React Native, check out the [Introduction to React Native](https://reactnative.dev/docs/getting-started). - -# Troubleshooting - -If you can't get this to work, see the [Troubleshooting](https://reactnative.dev/docs/troubleshooting) page. - -# Learn More - -To learn more about React Native, take a look at the following resources: - -- [React Native Website](https://reactnative.dev) - learn more about React Native. -- [Getting Started](https://reactnative.dev/docs/environment-setup) - an **overview** of React Native and how setup your environment. -- [Learn the Basics](https://reactnative.dev/docs/getting-started) - a **guided tour** of the React Native **basics**. -- [Blog](https://reactnative.dev/blog) - read the latest official React Native **Blog** posts. -- [`@facebook/react-native`](https://github.com/facebook/react-native) - the Open Source; GitHub **repository** for React Native. diff --git a/example/ios/.gitignore b/example/ios/.gitignore new file mode 100644 index 0000000..4e27d8e --- /dev/null +++ b/example/ios/.gitignore @@ -0,0 +1 @@ +.xcode.env.local \ No newline at end of file