From 1b919dc60883a62871f737610903ce9b82cabb70 Mon Sep 17 00:00:00 2001 From: slawek Date: Tue, 3 Dec 2024 12:53:16 +0100 Subject: [PATCH] docs: update contributing docs --- CONTRIBUTING.md | 49 +++++++++++++++++--------- sharedExample/src/contentpassConfig.ts | 7 +++- 2 files changed, 38 insertions(+), 18 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ad175ac..4a70abc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,6 +10,8 @@ This project is a monorepo managed using [Yarn workspaces](https://yarnpkg.com/f - The library package in the root directory. - An example app in the `example/` directory. +- An expo example app in the `expoExample/` directory. +- A shared frontend code for example apps in the `sharedExample/` directory. To get started with the project, run `yarn` in the root directory to install the required dependencies for each package: @@ -19,13 +21,19 @@ yarn > Since the project relies on Yarn workspaces, you cannot use [`npm`](https://github.com/npm/cli) for development. -The [example app](/example/) demonstrates usage of the library. You need to run it to test any changes you make. +The [example app](/example/) and [expo example app](/expoExample/) demonstrates usage of the library. You need to run it to test any changes you make. -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. +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 apps. +Changes to the library's JavaScript code will be reflected in the example apps 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, open `example/ios/ContentpassExample.xcworkspace` in XCode and find the source files at `Pods > Development Pods > react-native-contentpass`. +If you want to use Android Studio or XCode to edit the native code, you can open the +- `example/android` +- `example/ios` +- `expoExample/android` +- `expoExample/ios` +directories respectively in those editors. To edit the Objective-C or Swift files, open `ios/ContentpassExample.xcworkspace` in XCode and find the source files at `Pods > Development Pods > react-native-contentpass`. -To edit the Java or Kotlin files, open `example/android` in Android studio and find the source files at `react-native-contentpass` under `Android`. +To edit the Java or Kotlin files, open `android` in Android studio and find the source files at `react-native-contentpass` under `Android`. You can use various commands from the root directory to work with the project. @@ -35,23 +43,42 @@ To start the packager: yarn example start ``` +OR + +```sh +yarn expo-example start +``` + To run the example app on Android: ```sh yarn example android ``` +OR + +```sh +yarn expo-example android +``` + To run the example app on iOS: ```sh yarn example ios ``` -Make sure your code passes TypeScript and ESLint. Run the following to verify: +OR + +```sh +yarn expo-example ios +``` + +Make sure your code passes TypeScript, ESLint and Prettier. Run the following to verify: ```sh yarn typecheck yarn lint +yarn prettier:check ``` To fix formatting errors, run the following: @@ -97,18 +124,6 @@ To publish new versions, run the following: yarn release ``` -### Scripts - -The `package.json` file contains various scripts for common tasks: - -- `yarn`: setup project by installing dependencies. -- `yarn typecheck`: type-check files with TypeScript. -- `yarn lint`: lint files with ESLint. -- `yarn test`: run unit tests with Jest. -- `yarn example start`: start the Metro server for the example app. -- `yarn example android`: run the example app on Android. -- `yarn example ios`: run the example app on iOS. - ### Sending a pull request > **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). diff --git a/sharedExample/src/contentpassConfig.ts b/sharedExample/src/contentpassConfig.ts index 5bae064..e124598 100644 --- a/sharedExample/src/contentpassConfig.ts +++ b/sharedExample/src/contentpassConfig.ts @@ -1,7 +1,12 @@ import type { ContentpassConfig } from 'react-native-contentpass'; export const contentpassConfig: ContentpassConfig = { + // Testing app propertyId: 'cc3fc4ad-cbe5-4d09-bf85-a49796603b19', - redirectUrl: 'de.contentpass.demo://oauth', issuer: 'https://my.contentpass.dev', + // Staging app + // propertyId: '78da2fd3-8b25-4642-b7b7-4a0193d00f89', + // issuer: 'https://my.contentpass.io', + + redirectUrl: 'de.contentpass.demo://oauth', };