From ae426f620d50743c9914a6f9361aff1eb81795fd Mon Sep 17 00:00:00 2001 From: Mike Grabowski Date: Mon, 13 Jan 2025 17:53:13 +0100 Subject: [PATCH 1/2] docs: update contributing guidelines with correct workspace commands --- CONTRIBUTING.md | 49 +++++++++++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 20 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 91b9fad8..a0fe77cd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -8,8 +8,9 @@ We want this community to be friendly and respectful to each other. Please follo This project is a monorepo managed using [Yarn workspaces](https://yarnpkg.com/features/workspaces). It contains the following packages: -- The library package in the root directory. -- An example app in the `example/` directory. +- The core library package in the `packages` directory +- React Native example app in `apps/example` +- Expo example app in `apps/example-expo` To get started with the project, run `yarn` in the root directory to install the required dependencies for each package: @@ -19,32 +20,39 @@ yarn > Since the project relies on Yarn workspaces, you cannot use [`npm`](https://github.com/npm/cli) for development. -The [example app](/example/) demonstrates usage of the library. You need to run it to test any changes you make. +The example apps in the `apps` directory demonstrate usage of the library. You need to run one of them to test any changes you make. -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. +They are 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 apps. Changes to the library's JavaScript code will be reflected without a rebuild, but native code changes will require a rebuild of the example app. -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/SwiftuiTabviewExample.xcworkspace` in XCode and find the source files at `Pods > Development Pods > react-native-bottom-tabs`. - -To edit the Java or Kotlin files, open `example/android` in Android studio and find the source files at `react-native-bottom-tabs` under `Android`. +If you want to use Android Studio or XCode to edit the native code, you can open the `apps/example/android` or `apps/example/ios` directories respectively in those editors. You can use various commands from the root directory to work with the project. -To start the packager: +To start the packager for the React Native example: + +```sh +yarn workspace react-native-bottom-tabs-example start +``` + +To run the React Native example app on Android: ```sh -yarn example start +yarn workspace react-native-bottom-tabs-example android ``` -To run the example app on Android: +To run the React Native example app on iOS: ```sh -yarn example android +cd apps/example/ios +pod install +cd ../../.. +yarn workspace react-native-bottom-tabs-example ios ``` -To run the example app on iOS: +To run the Expo example: ```sh -yarn example ios +yarn workspace example-expo start ``` By default, the example is configured to build with the old architecture. To run the example with the new architecture, you can do the following: @@ -52,16 +60,17 @@ By default, the example is configured to build with the old architecture. To run 1. For Android, run: ```sh - ORG_GRADLE_PROJECT_newArchEnabled=true yarn example android + cd apps/example + ORG_GRADLE_PROJECT_newArchEnabled=true yarn android ``` 2. For iOS, run: ```sh - cd example/ios + cd apps/example/ios RCT_NEW_ARCH_ENABLED=1 pod install - cd - - yarn example ios + cd ../../.. + yarn workspace react-native-bottom-tabs-example ios ``` If you are building for a different architecture than your previous build, make sure to remove the build folders first. You can run the following command to cleanup all build folders: @@ -136,9 +145,9 @@ The `package.json` file contains various scripts for common tasks: - `yarn typecheck`: type-check files with TypeScript. - `yarn lint`: lint files with ESLint. - `yarn test`: run unit tests with Jest. -- `yarn example start`: start the Metro server for the example app. -- `yarn example android`: run the example app on Android. -- `yarn example ios`: run the example app on iOS. +- `yarn workspace react-native-bottom-tabs-example start`: start the Metro server for the example app. +- `yarn workspace react-native-bottom-tabs-example android`: run the example app on Android. +- `yarn workspace react-native-bottom-tabs-example ios`: run the example app on iOS. ### Sending a pull request From 4f2861c49e0a3b9424332cbfdd96549365240f8e Mon Sep 17 00:00:00 2001 From: Mike Grabowski Date: Mon, 13 Jan 2025 17:57:51 +0100 Subject: [PATCH 2/2] chore: update --- CONTRIBUTING.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a0fe77cd..30a81af9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -45,8 +45,8 @@ To run the React Native example app on iOS: ```sh cd apps/example/ios pod install -cd ../../.. -yarn workspace react-native-bottom-tabs-example ios +cd - +yarn ios ``` To run the Expo example: @@ -69,8 +69,8 @@ By default, the example is configured to build with the old architecture. To run ```sh cd apps/example/ios RCT_NEW_ARCH_ENABLED=1 pod install - cd ../../.. - yarn workspace react-native-bottom-tabs-example ios + cd - + yarn example ios ``` If you are building for a different architecture than your previous build, make sure to remove the build folders first. You can run the following command to cleanup all build folders: