Skip to content

Commit 98017a9

Browse files
authored
readme: update contributing guidelines (#238)
* docs: update contributing guidelines with correct workspace commands * chore: update
1 parent 640ed84 commit 98017a9

File tree

1 file changed

+27
-18
lines changed

1 file changed

+27
-18
lines changed

CONTRIBUTING.md

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ We want this community to be friendly and respectful to each other. Please follo
88

99
This project is a monorepo managed using [Yarn workspaces](https://yarnpkg.com/features/workspaces). It contains the following packages:
1010

11-
- The library package in the root directory.
12-
- An example app in the `example/` directory.
11+
- The core library package in the `packages` directory
12+
- React Native example app in `apps/example`
13+
- Expo example app in `apps/example-expo`
1314

1415
To get started with the project, run `yarn` in the root directory to install the required dependencies for each package:
1516

@@ -19,46 +20,54 @@ yarn
1920

2021
> Since the project relies on Yarn workspaces, you cannot use [`npm`](https://github.com/npm/cli) for development.
2122
22-
The [example app](/example/) demonstrates usage of the library. You need to run it to test any changes you make.
23+
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.
2324

24-
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.
25+
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.
2526

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/SwiftuiTabviewExample.xcworkspace` in XCode and find the source files at `Pods > Development Pods > react-native-bottom-tabs`.
27-
28-
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`.
27+
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.
2928

3029
You can use various commands from the root directory to work with the project.
3130

32-
To start the packager:
31+
To start the packager for the React Native example:
32+
33+
```sh
34+
yarn workspace react-native-bottom-tabs-example start
35+
```
36+
37+
To run the React Native example app on Android:
3338

3439
```sh
35-
yarn example start
40+
yarn workspace react-native-bottom-tabs-example android
3641
```
3742

38-
To run the example app on Android:
43+
To run the React Native example app on iOS:
3944

4045
```sh
41-
yarn example android
46+
cd apps/example/ios
47+
pod install
48+
cd -
49+
yarn ios
4250
```
4351

44-
To run the example app on iOS:
52+
To run the Expo example:
4553

4654
```sh
47-
yarn example ios
55+
yarn workspace example-expo start
4856
```
4957

5058
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:
5159

5260
1. For Android, run:
5361

5462
```sh
55-
ORG_GRADLE_PROJECT_newArchEnabled=true yarn example android
63+
cd apps/example
64+
ORG_GRADLE_PROJECT_newArchEnabled=true yarn android
5665
```
5766

5867
2. For iOS, run:
5968

6069
```sh
61-
cd example/ios
70+
cd apps/example/ios
6271
RCT_NEW_ARCH_ENABLED=1 pod install
6372
cd -
6473
yarn example ios
@@ -136,9 +145,9 @@ The `package.json` file contains various scripts for common tasks:
136145
- `yarn typecheck`: type-check files with TypeScript.
137146
- `yarn lint`: lint files with ESLint.
138147
- `yarn test`: run unit tests with Jest.
139-
- `yarn example start`: start the Metro server for the example app.
140-
- `yarn example android`: run the example app on Android.
141-
- `yarn example ios`: run the example app on iOS.
148+
- `yarn workspace react-native-bottom-tabs-example start`: start the Metro server for the example app.
149+
- `yarn workspace react-native-bottom-tabs-example android`: run the example app on Android.
150+
- `yarn workspace react-native-bottom-tabs-example ios`: run the example app on iOS.
142151

143152
### Sending a pull request
144153

0 commit comments

Comments
 (0)