|
1 | 1 | # sendbird-uikit-react-native
|
2 | 2 |
|
3 |
| -uikit |
| 3 | +[](https://reactnative.dev/) |
| 4 | +[](https://www.typescriptlang.org/) |
4 | 5 |
|
5 |
| -[](https://github.com/sendbird/sendbird-uikit-react-native/actions/workflows/status-build.yml) |
6 |
| -[](https://github.com/sendbird/sendbird-uikit-react-native/actions/workflows/status-test.yml) |
| 6 | +## Requirements |
7 | 7 |
|
8 |
| ---- |
| 8 | +- Nodejs 14 or newer |
| 9 | +- Watchman |
| 10 | +- JDK 11 or newer |
| 11 | +- XCode |
| 12 | +- Android Studio |
| 13 | + |
| 14 | +More details, please see https://reactnative.dev/docs/environment-setup |
| 15 | + |
| 16 | +<br/> |
| 17 | + |
| 18 | +## Development |
| 19 | + |
| 20 | +We tried development on macOS / Linux systems. You might encounter problems in running sample or scripts like `yarn build` in Windows machines. We are using sample app for development, you can check the sample app [here](/sample) and also check the UI components via storybook in the sample app. |
| 21 | + |
| 22 | +### Run sample app |
| 23 | + |
| 24 | +```shell |
| 25 | +yarn install |
| 26 | +npx pod-install |
| 27 | + |
| 28 | +yarn sample:android |
| 29 | +yarn sample:ios |
| 30 | +``` |
| 31 | + |
| 32 | +### Creating a new key function files |
| 33 | + |
| 34 | +Run the script and enter the key function name as a lower camel case like `groupChannel`, and then you can see the auto generated files in the `/packages/uikit-react-native/src/domain` |
| 35 | + |
| 36 | +```shell |
| 37 | +yarn workspace @sendbird/uikit-react-native run create-domain |
| 38 | +``` |
| 39 | + |
| 40 | +### Managing repository |
| 41 | + |
| 42 | +> **Note** |
| 43 | +> We are using [yarn workspaces](https://classic.yarnpkg.com/en/docs/workspaces) and [lerna](https://github.com/lerna/lerna) to maintain this monorepo |
| 44 | +
|
| 45 | +#### Package dependencies |
| 46 | + |
| 47 | +See [yarn workspace](https://classic.yarnpkg.com/en/docs/cli/workspace) |
| 48 | + |
| 49 | +```shell |
| 50 | +# Add dependency to specific workspace package |
| 51 | +yarn workspace @sendbird/package add package-name |
| 52 | +# Remove dependency from specific workspace package |
| 53 | +yarn workspace @sendbird/package remove package-name |
| 54 | + |
| 55 | +# Add dependency to root |
| 56 | +yarn workspace -W add package-name |
| 57 | +``` |
| 58 | + |
| 59 | +> **Warning** You should better install to root if you're trying to install native view modules. |
| 60 | +> Sometimes native view module in the workspace is not hoisted, and it leads to `Tried to register two views` error on the sample app. |
| 61 | +
|
| 62 | +#### Bump version |
| 63 | + |
| 64 | +See [lerna version](https://github.com/lerna/lerna/tree/main/commands/version) |
| 65 | + |
| 66 | +```shell |
| 67 | +lerna version {major|minor|patch} [--no-git-tag-version] [--no-private] |
| 68 | + |
| 69 | +# or |
| 70 | + |
| 71 | +yarn bump:{major|minor|patch} |
| 72 | +``` |
| 73 | + |
| 74 | +#### Publish |
| 75 | + |
| 76 | +See [lerna publish](https://github.com/lerna/lerna/tree/main/commands/publish) |
| 77 | + |
| 78 | +<br/> |
9 | 79 |
|
10 | 80 | ## Scripts
|
11 | 81 |
|
12 |
| -### Lint & Prettier |
| 82 | +### Build |
13 | 83 |
|
14 |
| -- check: `yarn lint` |
15 |
| -- fix: `yarn fix` |
| 84 | +```shell |
| 85 | +yarn build |
| 86 | +``` |
16 | 87 |
|
17 | 88 | ### Test
|
18 | 89 |
|
19 |
| -- test: `yarn test` |
| 90 | +```shell |
| 91 | +# Unit test |
| 92 | +yarn test |
20 | 93 |
|
21 |
| -### Package dependencies |
| 94 | +# Build test |
| 95 | +yarn test:build |
| 96 | +``` |
22 | 97 |
|
23 |
| -- add: `yarn workspace @sendbird/package add some-package` |
24 |
| -- remove: `yarn workspace @sendbird/package remove some-package` |
| 98 | +### Lint and Prettier |
25 | 99 |
|
26 |
| -### Publish |
27 |
| -> Bump > Build > Deploy |
| 100 | +```shell |
| 101 | +# Check formatting |
| 102 | +yarn lint |
28 | 103 |
|
29 |
| -- bump script: `lerna version {major|minor|patch} [--no-git-tag-version] [--no-private]` or `yarn bump:{major|minor|patch}` |
30 |
| -- build script: `yarn build` |
| 104 | +# Fix formatting |
| 105 | +yarn fix |
| 106 | +``` |
0 commit comments