Skip to content

Commit c78a5b7

Browse files
committed
docs: updated outdated contribution guide to reflect correct steps to get started
1 parent 0ede3c1 commit c78a5b7

File tree

1 file changed

+46
-11
lines changed

1 file changed

+46
-11
lines changed

CONTRIBUTING.md

Lines changed: 46 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,50 @@ Contributions are always welcome, no matter how large or small!
44

55
We want this community to be friendly and respectful to each other. Please follow it in all your interactions with the project. Before contributing, please read the [code of conduct](./CODE_OF_CONDUCT.md).
66

7-
## Development workflow
7+
## Development Workflow
88

9-
To get started with the project, run `yarn` in the root directory to install the required dependencies for each package:
9+
This project is a monorepo managed using [Yarn Workspaces](https://yarnpkg.com/features/workspaces) with Yarn 4.9.2. It contains the following packages:
1010

11-
```sh
12-
yarn
13-
```
11+
- The library package in the root directory.
12+
- An example app in the `example/` directory.
13+
14+
To get started with the project, follow these steps:
15+
16+
1. **Ensure Node.js is installed**: Use Node.js 22.12.0 or higher (as specified in `.nvmrc`). Install via [nvm](https://github.com/nvm-sh/nvm) if needed:
17+
18+
```sh
19+
nvm install 22.12.0
20+
nvm use 22.12.0
21+
```
22+
23+
2. **Enable Corepack**: Yarn 4.9.2 is managed via Corepack, included with Node.js. Enable it to ensure the correct Yarn version:
24+
25+
```sh
26+
corepack enable
27+
corepack prepare [email protected] --activate
28+
```
29+
30+
3. Set up Yarn configuration: In the root directory, configure Yarn 4.9.2 and generate the .yarnrc.yml file:
31+
32+
```sh
33+
yarn set version 4.9.2
34+
yarn config set nodeLinker node-modules
35+
yarn config set nmHoistingLimits workspaces
36+
```
37+
38+
4. **Install dependencies**: Install dependencies for all packages:
1439

15-
> While it's possible to use [`npm`](https://github.com/npm/cli), the tooling is built around [`yarn`](https://classic.yarnpkg.com/), so you'll have an easier time if you use `yarn` for development.
40+
```sh
41+
yarn
42+
```
1643

17-
While developing, you can run the [example app](/example/) to test your changes. Any changes you make in your library's JavaScript code will be reflected in the example app without a rebuild. If you change any native code, then you'll need to rebuild the example app.
44+
> Important: This project relies on Yarn Workspaces and Yarn 4.9.2. Do not use npm or other package managers for development, as they are not compatible with the monorepo setup.
45+
46+
The [example app](/example/) demonstrates usage of the library. You need to run it to test any changes you make.
47+
48+
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.
49+
50+
You can use various commands from the root directory to work with the project.
1851

1952
To start the packager:
2053

@@ -34,6 +67,12 @@ To run the example app on iOS:
3467
yarn example ios
3568
```
3669

70+
To run the example app on Web:
71+
72+
```sh
73+
yarn example web
74+
```
75+
3776
Make sure your code passes TypeScript and ESLint. Run the following to verify:
3877

3978
```sh
@@ -53,10 +92,6 @@ Remember to add tests for your change if possible. Run the unit tests by:
5392
yarn test
5493
```
5594

56-
To edit the Objective-C or Swift files, open `example/ios/TreeMultiSelectExample.xcworkspace` in XCode and find the source files at `Pods > Development Pods > react-native-tree-multi-select`.
57-
58-
To edit the Java or Kotlin files, open `example/android` in Android studio and find the source files at `react-native-tree-multi-select` under `Android`.
59-
6095

6196
### Commit message convention
6297

0 commit comments

Comments
 (0)