Skip to content

Commit d423a70

Browse files
docs: Add contributing guidelines to the repository
1 parent fe2f0a7 commit d423a70

1 file changed

Lines changed: 97 additions & 0 deletions

File tree

CONTRIBUTING.md

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# Contributing
2+
3+
Contributions are always welcome, no matter how large or small!
4+
5+
We appreciate feedback and contribution to this repo! Before you get started, please see [Auth0's general contribution guidelines](https://github.com/auth0/open-source-template/blob/master/GENERAL-CONTRIBUTING.md)
6+
7+
## Development workflow
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+
14+
To get started with the project, run `yarn` in the root directory to install the required dependencies for each package:
15+
16+
```sh
17+
yarn
18+
```
19+
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.
25+
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/Auth0Example.xcworkspace` in XCode and find the source files at `Pods > Development Pods > react-native-auth0`.
27+
28+
To edit the Java or Kotlin files, open `example/android` in Android studio and find the source files at `react-native-auth0` under `Android`.
29+
30+
You can use various commands from the root directory to work with the project.
31+
32+
To start the packager:
33+
34+
```sh
35+
yarn example start
36+
```
37+
38+
To run the example app on Android:
39+
40+
```sh
41+
yarn example android
42+
```
43+
44+
To run the example app on iOS:
45+
46+
```sh
47+
yarn example ios
48+
```
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 "Auth0Example" with {"fabric":true,"initialProps":{"concurrentRoot":true},"rootTag":1}
54+
```
55+
56+
Note the `"fabric":true` and `"concurrentRoot":true` properties.
57+
58+
Make sure your code passes TypeScript and ESLint. Run the following to verify:
59+
60+
```sh
61+
yarn typecheck
62+
yarn lint
63+
```
64+
65+
To fix formatting errors, run the following:
66+
67+
```sh
68+
yarn lint --fix
69+
```
70+
71+
Remember to add tests for your change if possible. Run the unit tests by:
72+
73+
```sh
74+
yarn test
75+
```
76+
77+
### Scripts
78+
79+
The `package.json` file contains various scripts for common tasks:
80+
81+
- `yarn`: setup project by installing dependencies.
82+
- `yarn typecheck`: type-check files with TypeScript.
83+
- `yarn lint`: lint files with ESLint.
84+
- `yarn test`: run unit tests with Jest.
85+
- `yarn example start`: start the Metro server for the example app.
86+
- `yarn example android`: run the example app on Android.
87+
- `yarn example ios`: run the example app on iOS.
88+
89+
### Sending a pull request
90+
91+
When you're sending a pull request:
92+
93+
- Prefer small pull requests focused on one change.
94+
- Verify that linters and tests are passing.
95+
- Review the documentation to make sure it looks good.
96+
- Follow the pull request template when opening a pull request.
97+
- For pull requests that change the API or implementation, discuss with maintainers first by opening an issue.

0 commit comments

Comments
 (0)