Please follow it in all your interactions with the project. Before contributing, please read the code of conduct.
The package.json
file contains various scripts for common tasks:
Installiation, Build
yarn
: setup project by installing dependencies.yarn build
: build packages
Validation
yarn lint
: lint files with ESLint, ClangFormat, SwiftFormat, Ktlint, TypeScript and verify build success and codegen generationyarn t
: alias for lintyarn format
: run formatter with ClangFormat, SwiftFormat for iOS codes and withKtlint for Android codes
Example App Build, Manipluations
yarn android
: run the example app on Androidyarn ios
: run the example app on iOSyarn dev
: run example app metro serveryarn gen:android
: prebuild android expo directoryyarn gen:android:clean
: clean and prebuild android expo directoryyarn gen:ios
: prebuild ios expo directoryyarn gen:ios:clean
: clean and prebuild ios expo directory
Util
yarn studio
: open Android Studio in example/androidyarn xcode
: open Xcode in example/ios
Architecture Convert
new
: convert example project to new architectureold
: convert example project to old architecturenew:pod
: convert example project to new architecture with pod installold:pod
: convert example project to old architecture with pod installold:clean
: convert example project to old architecture with clean project, pod installnew:clean
: convert example project to old architecture with clean project, pod install
Codegen
yarn codegen
: generate codegen spec for all platformyarn codegen:android
: generate android codegen specyarn codegen:ios
: generate ios codegen spec
This project is a monorepo managed using Yarn workspaces. It contains the following packages:
- The library packages in the
packages/
directory. - An example app in the
example/
directory.
To get started with the project, run yarn
in the root directory to install the required
dependencies for each package:
yarn
Since the project relies on Yarn workspaces, you cannot use
npm
for development.
The example app demonstrates usage of the library. You need to run it to test any changes you make.
Important
Our example app uses Expo. You should generate iOS and Android projects for development or building.
Please take a look at the scripts for handling Expo project generation and building. If you are having trouble building or running the Expo example project, you can run it directly from Android Studio or Xcode after the appropriate setup.
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.
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, run yarn xcode
and
find the source files at Pods > Development Pods > RNCKakaoXXX
.
To edit the Java or Kotlin files, run yarn studio
You can use various commands from the root directory to work with the project.
If you are building for a different architecture than your previous build, make sure to remove the build folders first. You can run the following command to cleanup all build folders:
yarn gen:clean
To confirm that the app is running with the new architecture, you can check the Metro logs for a message like this:
Running "ReactNativeKakaoShareExample" with {"fabric":true,"initialProps":{"concurrentRoot":true},"rootTag":1}
Note the "fabric":true
and "concurrentRoot":true
properties.
Make sure your code passes TypeScript and ESLint. Run the following to verify:
yarn lint
We follow the conventional commits specification for our commit messages:
fix
: bug fixes, e.g. fix crash due to deprecated method.feat
: new features, e.g. add new method to the module.refactor
: code refactor, e.g. migrate from class components to hooks.docs
: changes into documentation, e.g. add usage example for the module..test
: adding or updating tests, e.g. add integration tests using detox.chore
: tooling changes, e.g. change CI config.
Our pre-commit hooks verify that your commit message matches this format when committing.
ESLint, Prettier, TypeScript, ClangFormat, SwiftFormat, Ktlint
We use TypeScript for type checking, ESLint with Prettier for linting and formatting the code, and Jest for testing.
In iOS project, we use ClangFormat, SwiftFormat for formatting and linting.
In Android project, we use Ktlint for formatting and linting.
Our pre-commit hooks verify that the linter and tests pass when committing.
Our documentation is built with Docusaurus and is just maintained with Korean(default) and English.
If your API changes require changes to the documentation, you should include those changes in the documentation as well.
When you're sending a pull request:
- Prefer small pull requests focused on one change.
- Verify that linters and tests are passing.
- Review the documentation to make sure it looks good.
- Follow the pull request template when opening a pull request.
- For pull requests that change the API or implementation, discuss with maintainers first by opening an issue.