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
+47-16Lines changed: 47 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,13 +4,30 @@ We want this community to be friendly and respectful to each other. Please follo
4
4
5
5
## Development workflow
6
6
7
-
To get started with the project, run `yarn` in the root directory to install the required dependencies for each package:
7
+
This project is a monorepo managed using [Yarn workspaces](https://yarnpkg.com/features/workspaces). It contains the following packages:
8
+
9
+
- The library package in the root directory.
10
+
- An example app in the `example/` directory.
11
+
12
+
To get started with the project, make sure you have the correct version of [Node.js](https://nodejs.org/) installed. See the [`.nvmrc`](./.nvmrc) file for the version used in this project.
13
+
14
+
Run `yarn` in the root directory to install the required dependencies for each package:
8
15
9
16
```sh
10
17
yarn
11
18
```
12
19
13
-
While developing, you can run the [example app](/example/) to test your changes.
20
+
> Since the project relies on Yarn workspaces, you cannot use [`npm`](https://github.com/npm/cli) for development without manually migrating.
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/PdfLightExample.xcworkspace` in Xcode and find the source files at `Pods > Development Pods > react-native-pdf-light`.
27
+
28
+
To edit the Java or Kotlin files, open `example/android` in Android studio and find the source files at `react-native-pdf-light` under `Android`.
29
+
30
+
You can use various commands from the root directory to work with the project.
14
31
15
32
To start the packager:
16
33
@@ -30,10 +47,23 @@ To run the example app on iOS:
30
47
yarn example ios
31
48
```
32
49
33
-
Make sure your code passes TypeScript and ESLint. Run the following to verify:
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 "PdfLightExample" 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:
59
+
60
+
```sh
61
+
yarn typecheck
62
+
```
63
+
64
+
To check for linting errors, run the following:
34
65
35
66
```sh
36
-
yarn typescript
37
67
yarn lint
38
68
```
39
69
@@ -49,9 +79,6 @@ Remember to add tests for your change if possible. Run the unit tests by:
49
79
yarn test
50
80
```
51
81
52
-
To edit the Objective-C files, open `example/ios/PdfViewerExample.xcworkspace` in XCode and find the source files at `Pods > Development Pods > react-native-pdf-viewer`.
53
-
54
-
To edit the Kotlin files, open `example/android` in Android studio and find the source files at `reactnativepdfviewer` under `Android`.
55
82
56
83
### Commit message convention
57
84
@@ -66,29 +93,33 @@ We follow the [conventional commits specification](https://www.conventionalcommi
66
93
67
94
Our pre-commit hooks verify that your commit message matches this format when committing.
We use [release-it](https://github.com/release-it/release-it) to make it easier to publish new versions. It handles common tasks like bumping version based on semver, creating tags and releases etc.
100
+
101
+
To publish new versions, run the following:
72
102
73
-
We use [TypeScript](https://www.typescriptlang.org/) for type checking, [ESLint](https://eslint.org/) with [Prettier](https://prettier.io/) for linting and formatting the code, and [Jest](https://jestjs.io/) for testing.
103
+
```sh
104
+
yarn release
105
+
```
74
106
75
-
Our pre-commit hooks verify that the linter and tests pass when committing.
76
107
77
108
### Scripts
78
109
79
110
The `package.json` file contains various scripts for common tasks:
80
111
81
-
-`yarn bootstrap`: setup project by installing all dependencies and pods.
82
-
-`yarn typescript`: type-check files with TypeScript.
83
-
-`yarn lint`: lint files with ESLint.
84
-
-`yarn test`: run unit tests with Jest.
112
+
-`yarn`: setup project by installing dependencies.
113
+
-`yarn typecheck`: type-check files with TypeScript.
114
+
-`yarn lint`: lint files with [ESLint](https://eslint.org/).
115
+
-`yarn test`: run unit tests with [Jest](https://jestjs.io/).
85
116
-`yarn example start`: start the Metro server for the example app.
86
117
-`yarn example android`: run the example app on Android.
87
118
-`yarn example ios`: run the example app on iOS.
88
119
89
120
### Sending a pull request
90
121
91
-
> **Working on your first pull request?** You can learn how from this _free_ series: [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github).
122
+
> **Working on your first pull request?** You can learn how from this _free_ series: [How to Contribute to an Open Source Project on GitHub](https://app.egghead.io/playlists/how-to-contribute-to-an-open-source-project-on-github).
0 commit comments