You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+26-10Lines changed: 26 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,15 +6,28 @@ We want this community to be friendly and respectful to each other. Please follo
6
6
7
7
## Development workflow
8
8
9
+
This project is a monorepo managed using [Yarn workspaces](https://yarnpkg.com/features/workspaces). It contains the following packages:
10
+
11
+
- The library package in the root directory.
12
+
- An example app in the `example/` directory.
13
+
9
14
To get started with the project, run `yarn` in the root directory to install the required dependencies for each package:
10
15
11
16
```sh
12
17
yarn
13
18
```
14
19
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.
20
+
> Since the project relies on Yarn workspaces, you cannot use [`npm`](https://github.com/npm/cli) for development.
21
+
22
+
The [example app](/example/) demonstrates usage of the library. You need to run it to test any changes you make.
23
+
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.
16
25
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.
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/MytrackerExample.xcworkspace` in XCode and find the source files at `Pods > Development Pods > react-native-mytracker`.
27
+
28
+
To edit the Java or Kotlin files, open `example/android` in Android studio and find the source files at `react-native-mytracker` under `Android`.
29
+
30
+
You can use various commands from the root directory to work with the project.
18
31
19
32
To start the packager:
20
33
@@ -34,10 +47,18 @@ To run the example app on iOS:
34
47
yarn example ios
35
48
```
36
49
50
+
To confirm that the app is running with the new architecture, you can check the Metro logs for a message like this:
51
+
52
+
```sh
53
+
Running "MytrackerExample" with {"fabric":true,"initialProps":{"concurrentRoot":true},"rootTag":1}
54
+
```
55
+
56
+
Note the `"fabric":true` and `"concurrentRoot":true` properties.
57
+
37
58
Make sure your code passes TypeScript and ESLint. Run the following to verify:
38
59
39
60
```sh
40
-
yarn typescript
61
+
yarn typecheck
41
62
yarn lint
42
63
```
43
64
@@ -53,11 +74,6 @@ Remember to add tests for your change if possible. Run the unit tests by:
53
74
yarn test
54
75
```
55
76
56
-
To edit the Objective-C or Swift files, open `example/ios/MytrackerExample.xcworkspace` in XCode and find the source files at `Pods > Development Pods > react-native-mytracker`.
57
-
58
-
To edit the Java or Kotlin files, open `example/android` in Android studio and find the source files at `react-native-mytracker` under `Android`.
59
-
60
-
61
77
### Commit message convention
62
78
63
79
We follow the [conventional commits specification](https://www.conventionalcommits.org/en) for our commit messages:
@@ -93,8 +109,8 @@ yarn release
93
109
94
110
The `package.json` file contains various scripts for common tasks:
95
111
96
-
-`yarn bootstrap`: setup project by installing all dependencies and pods.
97
-
-`yarn typescript`: type-check files with TypeScript.
112
+
-`yarn`: setup project by installing dependencies.
113
+
-`yarn typecheck`: type-check files with TypeScript.
98
114
-`yarn lint`: lint files with ESLint.
99
115
-`yarn test`: run unit tests with Jest.
100
116
-`yarn example start`: start the Metro server for the example app.
0 commit comments