From 534a21bb8716bdc495bd19afdeb6560fa6791a62 Mon Sep 17 00:00:00 2001 From: Innei Date: Mon, 3 Mar 2025 20:11:08 +0800 Subject: [PATCH] docs: update CONTRIBUTING.md with comprehensive development guides resolves FOL-1686 - Add detailed instructions for developing in web, Electron, SSR, and mobile apps - Include specific steps for each development environment - Add guidance for native iOS module development - Improve overall clarity and usability of contribution documentation Signed-off-by: Innei --- CONTRIBUTING.md | 78 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 75 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e7d471a11..b0667b2a7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,7 +7,7 @@ Thank you for considering contributing to Follow! We welcome contributions from Before you start contributing, please ensure you have enabled [Corepack](https://nodejs.org/api/corepack.html). Corepack ensures you are using the correct version of the package manager specified in the `package.json`. ```sh -corepack enable +corepack enable && corepack prepare ``` ### Installing Dependencies @@ -25,7 +25,7 @@ pnpm install For a more convenient development experience, we recommend developing in the browser: ```sh -pnpm run dev:web +cd apps/desktop && pnpm run dev:web ``` This will open the browser at `https://app.follow.is/__debug_proxy`, allowing you to access the online API environment for development and debugging. @@ -34,6 +34,12 @@ This will open the browser at `https://app.follow.is/__debug_proxy`, allowing yo If you prefer to develop in Electron, follow these steps: +0. Go to the `apps/desktop` directory: + + ```sh + cd apps/desktop + ``` + 1. Copy the example environment variables file: ```sh @@ -45,11 +51,77 @@ If you prefer to develop in Electron, follow these steps: 3. Run the development server: ```sh - pnpm run dev + pnpm run dev:electron ``` > **Tip:** If you encounter login issues, copy the `__Secure-better-auth.session_token` from your browser's cookies into the app. +### Develop in External SSR Web App + +To develop in SSR, follow these steps: + +1. Go to the `apps/ssr` directory: + + ```sh + cd apps/ssr + ``` + +2. Run the development server: + + ```sh + pnpm run dev + ``` + +### Develop in Mobile App + +To develop in the mobile app, follow these steps: + +> [!NOTE] +> You need to have a Mac device to develop in the mobile app. +> +> And already installed Xcode and the necessary dependencies. + +1. Go to the `apps/mobile` directory: + + ```sh + cd apps/mobile + ``` + +2. Build and install Follow(dev) app from source: (This step will take a while and only need to be done once) + + ```sh + pnpm expo prebuild --clean # Optional + pnpm run ios + ``` + +3. Run the development server: + + ```sh + pnpm run dev + ``` + +#### Development Native Modules + +To develop native iOS modules, follow these steps: + +1. Go to the `apps/mobile` directory: + + ```sh + cd apps/mobile/ios + ``` + +2. Open project in Xcode: + + ```sh + open Follow.xcworkspace + ``` + +3. Open `Pods` in left sidebar and select `FollowNative`: + +![](https://github.com/user-attachments/assets/a449c087-6d55-4cbd-bc4b-c61a08406e98) + +4. Build and run the project. + ## Contribution Guidelines - Ensure your code follows the project's coding standards and conventions.