From bb5fdfa946d149de8b1d60084ac25918d311aeee Mon Sep 17 00:00:00 2001 From: Krystof Woldrich Date: Thu, 12 Sep 2024 22:16:42 +0200 Subject: [PATCH] misc: Update CONTRIBUTING.md for the monorepo changes --- CONTRIBUTING.md | 51 ++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e43b2c4da..05f2b1629 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,18 +1,23 @@ # Contributing -This repository contains a sample project. It can be used to test the SDK as you develop it. +This repository contains mono repository structure with multiple React Native and Expo project for development and testing. -# Requirements +# Overview + +- / -> monorepo root private package +- /samples -> sample application, expo, rn... +- /packages -> RN SDK packages +- /dev-packages -> dev packages, ts-3.8 test runner, e2e tests components and runner +- /performance-tests -> applications used for measuring performance in CI -You need: +# Requirements -- nodejs 14 or higher -- yarn 1 or higher +- nodejs 18 (with corepack enabled) +- yarn version specified in `package.json` (at the moment version 3.6) ## Building -First install dependencies of the SDK (the root of the repository) -This is only needed if dependencies are added/removed. +Install dependencies using: ```sh yarn @@ -23,17 +28,19 @@ Once deps are installed, you can build the project: ```sh yarn build -# Or in watch mode, for development +# Or in watch mode, for development of the SDK core -yarn build:watch +cd packages/core +yarn build:sdk:watch ``` -## testing +## Testing ```sh yarn test # Or the watcher when writing tests: +cd packages/core yarn test:watch ``` @@ -43,9 +50,16 @@ Now we can go into the sample project, install and build it: ```sh cd samples/react-native/ -yarn + +yarn start # Metro development server + +npx pod-install +yarn ios # iOS Development build +yarn android # Android Development build ``` +Recommended is to open the native project in `samples/react-native/android` and `samples/react-native/ios` on Android Studio and Xcode respectively. + ### Run the emulators (legacy-architecture): For android switch `newArchEnabled` to `false` in [android/gradle.properties](https://github.com/getsentry/sentry-react-native/blob/c95aa21497ca93aaaaf0b44d170dc39dc7bcf660/sample-new-architecture/android/gradle.properties#L40). For iOS explicitly disable fabric in `samples/react-native/ios/Podfile` by setting `:fabric_enabled => false` before `pod install`. @@ -77,20 +91,6 @@ yarn run-ios --configuration Release yarn run-android --variant=release ``` -### Optional -You can optionally start the Metro bundler if you want to control where it runs: - -```sh -yarn start --reset-cache -``` - -Run the emulators: - -```sh -yarn react-native run-ios -yarn react-native run-android -``` - ## Develop with sentry-cocoa Here are step on how to test your changes in `sentry-cocoa` with `sentry-react-native`. We assume you have both repositories cloned in siblings folders. @@ -100,7 +100,6 @@ Here are step on how to test your changes in `sentry-cocoa` with `sentry-react-n ```sh cd sentry-cocoa make init -make build-xcframework ``` 2. Link local `sentry-cocoa` build in `sentry-react-native`