chore: Update CONTRIBUTING guidelines

This commit is contained in:
Marc Rousavy 2021-07-14 13:17:14 +02:00
parent 4dac6061c3
commit b222acc331
3 changed files with 20 additions and 39 deletions

View File

@ -1,4 +1,8 @@
<!-- ❤️ Thank you for your contribution! ❤️ -->
<!--
❤️ Thank you for your contribution! ❤️
Make sure you have read the Contributing Guidelines:
https://github.com/mrousavy/react-native-vision-camera/blob/main/CONTRIBUTING.md
-->
## What

View File

@ -13,10 +13,18 @@
yarn bootstrap
```
Read the READMEs in [`android/`](android/README.md), [`ios/`](ios/README.md), and [`cpp/`](cpp/README.md) for a quick overview of the development workflow.
Read the READMEs in [`android/`](android/README.md) and [`ios/`](ios/README.md) for a quick overview of the native development workflow.
> You can also open VisionCamera in [a quick online editor (github1s)](https://github1s.com/mrousavy/react-native-vision-camera)
### JS/TS
1. Open the entire folder in Visual Studio Code
2. Start the metro bundler in the `example/` directory using `yarn start`
3. Run either the iOS or Android project to test changes
> Run `yarn check-js` to validate codestyle
### iOS
1. Open the `example/ios/VisionCameraExample.xcworkspace` file with Xcode
@ -29,17 +37,12 @@ Read the READMEs in [`android/`](android/README.md), [`ios/`](ios/README.md), an
### Android
1. Open the `example/android/` folder with Android Studio
2. Select your device in the devices drop-down
3. Hit run
2. Start the metro bundler in the `example/` directory using `yarn start`
3. Select your device in the devices drop-down
4. Hit run
> Run `yarn check-android` to validate codestyle
### C++
The C++ codebase is shared between Android and iOS. This means you can make changes to those files in either the Android example or the iOS example, but make sure to test changes on both platforms.
> Run `yarn check-cpp` to validate codestyle
## Committing
We love to keep our codebases clean. To achieve that, we use linters and formatters which output errors when something isn't formatted the way we like it to be.
@ -58,34 +61,8 @@ $ yarn check-all
Formatting Swift code..
Linting Swift code..
Linting Kotlin code..
Linting C++ code..
Linting JS/TS code..
All done!
✨ Done in 8.05s.
```
To actually build the library, run the `build` script:
```
yarn build
```
This builds the JS Module, TypeScript definitions, as well as the Hermes and JSC .aar libraries:
```
$ yarn build
yarn run v1.22.10
Building target commonjs
Cleaning up previous build at lib/commonjs
Compiling 18 files in src with babel
✔ Wrote files to lib/commonjs
Building target module
Cleaning up previous build at lib/module
Compiling 18 files in src with babel
✔ Wrote files to lib/module
Building target typescript
Cleaning up previous build at lib/typescript
Generating type definitions with tsc
✔ Wrote definition files to lib/typescript
Building VisionCamera for JS Engine hermes...
...
```

View File

@ -35,9 +35,9 @@
"release": "release-it",
"pods": "cd example && yarn pods",
"bootstrap": "yarn && cd example && yarn && yarn pods",
"check-android": "scripts/ktlint.sh",
"check-android": "scripts/ktlint.sh && scripts/cpplint.sh",
"check-ios": "scripts/swiftformat.sh && scripts/swiftlint.sh",
"check-cpp": "scripts/cpplint.sh",
"check-js": "yarn lint --fix && yarn typescript",
"check-all": "scripts/check-all.sh",
"clean-ios": "scripts/clean-ios.sh",
"clean-android": "scripts/clean-android.sh",