mirror of
https://github.com/readest/readest.git
synced 2026-07-09 16:00:16 +00:00
docs: move source build instructions to CONTRIBUTING.md (#5017)
This commit is contained in:
parent
93048acda9
commit
5b8ab3db25
2 changed files with 67 additions and 118 deletions
|
|
@ -26,29 +26,27 @@ npm install -g pnpm
|
||||||
rustup update
|
rustup update
|
||||||
```
|
```
|
||||||
|
|
||||||
### Getting Started
|
## Getting Started
|
||||||
|
|
||||||
To get started with Readest, follow these steps to clone and build the project.
|
To get started with Readest, follow these steps to clone and build the project.
|
||||||
|
|
||||||
#### 1. Clone the Repository
|
### 1. Clone the Repository
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/readest/readest.git
|
git clone https://github.com/readest/readest.git
|
||||||
cd readest
|
cd readest
|
||||||
git submodule update --init --recursive
|
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 2. Install Dependencies
|
### 2. Install Dependencies
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# might need to rerun this when code is updated
|
# might need to rerun this when code is updated
|
||||||
|
git submodule update --init --recursive
|
||||||
pnpm install
|
pnpm install
|
||||||
# copy vendors dist libs to public directory
|
# copy vendors dist libs to public directory
|
||||||
pnpm --filter @readest/readest-app setup-vendors
|
pnpm --filter @readest/readest-app setup-vendors
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 3. Verify Dependencies Installation
|
|
||||||
|
|
||||||
To confirm that all dependencies are correctly installed, run the following command:
|
To confirm that all dependencies are correctly installed, run the following command:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|
@ -59,21 +57,78 @@ This command will display information about the installed Tauri dependencies and
|
||||||
|
|
||||||
For Windows targets, “Build Tools for Visual Studio 2022” (or a higher edition of Visual Studio) and the “Desktop development with C++” workflow must be installed. For Windows ARM64 targets, the “VS 2022 C++ ARM64 build tools” and "C++ Clang Compiler for Windows" components must be installed. And make sure `clang` can be found in the path by adding `C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\Llvm\x64\bin` for example in the environment variable `Path`.
|
For Windows targets, “Build Tools for Visual Studio 2022” (or a higher edition of Visual Studio) and the “Desktop development with C++” workflow must be installed. For Windows ARM64 targets, the “VS 2022 C++ ARM64 build tools” and "C++ Clang Compiler for Windows" components must be installed. And make sure `clang` can be found in the path by adding `C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\Llvm\x64\bin` for example in the environment variable `Path`.
|
||||||
|
|
||||||
#### 4. Build for Development
|
#### Using Nix
|
||||||
|
|
||||||
|
If you have Nix installed, you can leverage the included flake to enter a
|
||||||
|
development shell to install and run all the necessary dependencies and commands:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pnpm tauri dev
|
nix develop ./ops # enter a dev shell for the web app
|
||||||
|
nix develop ./ops#ios # enter a dev shell for the ios app
|
||||||
|
nix develop ./ops#android # enter a dev shell for the android app
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 5. Build for Production
|
### 4. Build for Development
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Start development for the Tauri app
|
||||||
|
pnpm tauri dev
|
||||||
|
# or start development for the Web app
|
||||||
|
pnpm dev-web
|
||||||
|
# preview with OpenNext build for the Web app
|
||||||
|
pnpm preview
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Android
|
||||||
|
|
||||||
|
The following must be run once before running the Android app. Note that this is done automatically if using the nix Android devshell:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
rm apps/readest-app/src-tauri/gen/android
|
||||||
|
pnpm tauri android init
|
||||||
|
pnpm tauri icon ../../data/icons/readest-book.png
|
||||||
|
git checkout apps/readest-app/src-tauri/gen/android
|
||||||
|
```
|
||||||
|
|
||||||
|
To run the Android app:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pnpm tauri android dev
|
||||||
|
# or if you want to dev on a real device
|
||||||
|
pnpm tauri android dev --host
|
||||||
|
```
|
||||||
|
|
||||||
|
#### iOS
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Set up the iOS environment (run once)
|
||||||
|
pnpm tauri ios init
|
||||||
|
pnpm tauri icon ../../data/icons/readest-book.png
|
||||||
|
|
||||||
|
pnpm tauri ios dev
|
||||||
|
# or if you want to dev on a real device
|
||||||
|
pnpm tauri ios dev --host
|
||||||
|
``
|
||||||
|
|
||||||
|
### 5. Build for Production
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pnpm tauri build
|
pnpm tauri build
|
||||||
|
pnpm tauri android build
|
||||||
|
pnpm tauri ios build
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Please refer to our release script if you experience any issues:
|
||||||
|
https://github.com/readest/readest/blob/main/.github/workflows/release.yml
|
||||||
|
|
||||||
|
|
||||||
|
### 7. More information
|
||||||
|
|
||||||
|
Please check the [wiki][link-gh-wiki] of this project for more information on development.
|
||||||
|
|
||||||
Now you're all setup and can start implementing your changes.
|
Now you're all setup and can start implementing your changes.
|
||||||
|
|
||||||
### Implement your changes
|
## Implement your changes
|
||||||
|
|
||||||
This project is a monorepo. The code for the `readest-app` is in the `apps/readest-app` directory. Here are some useful scripts for developing the frontend only without compiling Tauri:
|
This project is a monorepo. The code for the `readest-app` is in the `apps/readest-app` directory. Here are some useful scripts for developing the frontend only without compiling Tauri:
|
||||||
|
|
||||||
|
|
|
||||||
110
README.md
110
README.md
|
|
@ -121,115 +121,9 @@ Guides, tutorials, and FAQs for installing and using Readest live in the officia
|
||||||
|
|
||||||
📖 **[https://readest.com/docs][link-docs]**
|
📖 **[https://readest.com/docs][link-docs]**
|
||||||
|
|
||||||
## Requirements
|
## Building from Source
|
||||||
|
|
||||||
- **Node.js** and **pnpm** for Next.js development
|
To build Readest from the latest commit, see [Getting Started](./CONTRIBUTING.md#getting-started).
|
||||||
- **Rust** and **Cargo** for Tauri development
|
|
||||||
|
|
||||||
For the best experience to build Readest for yourself, use a recent version of Node.js and Rust. Refer to the [Tauri documentation](https://v2.tauri.app/start/prerequisites/) for details on setting up the development environment prerequisites on different platforms.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
nvm install v24
|
|
||||||
nvm use v24
|
|
||||||
npm install -g pnpm
|
|
||||||
rustup update
|
|
||||||
```
|
|
||||||
|
|
||||||
## Getting Started
|
|
||||||
|
|
||||||
To get started with Readest, follow these steps to clone and build the project.
|
|
||||||
|
|
||||||
### 1. Clone the Repository
|
|
||||||
|
|
||||||
```bash
|
|
||||||
git clone https://github.com/readest/readest.git
|
|
||||||
cd readest
|
|
||||||
```
|
|
||||||
|
|
||||||
### 2. Install Dependencies
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# might need to rerun this when code is updated
|
|
||||||
git submodule update --init --recursive
|
|
||||||
pnpm install
|
|
||||||
# copy vendors dist libs to public directory
|
|
||||||
pnpm --filter @readest/readest-app setup-vendors
|
|
||||||
```
|
|
||||||
|
|
||||||
### 3. Verify Dependencies Installation
|
|
||||||
|
|
||||||
To confirm that all dependencies are correctly installed, run the following command:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
pnpm tauri info
|
|
||||||
```
|
|
||||||
|
|
||||||
This command will display information about the installed Tauri dependencies and configuration on your platform. Note that the output may vary depending on the operating system and environment setup. Please review the output specific to your platform for any potential issues.
|
|
||||||
|
|
||||||
For Windows targets, “Build Tools for Visual Studio 2022” (or a higher edition of Visual Studio) and the “Desktop development with C++” workflow must be installed. For Windows ARM64 targets, the “VS 2022 C++ ARM64 build tools” and "C++ Clang Compiler for Windows" components must be installed. And make sure `clang` can be found in the path by adding `C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\Llvm\x64\bin` for example in the environment variable `Path`.
|
|
||||||
|
|
||||||
### 4. Build for Development
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Start development for the Tauri app
|
|
||||||
pnpm tauri dev
|
|
||||||
# or start development for the Web app
|
|
||||||
pnpm dev-web
|
|
||||||
# preview with OpenNext build for the Web app
|
|
||||||
pnpm preview
|
|
||||||
```
|
|
||||||
|
|
||||||
For Android:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Initialize the Android environment (run once)
|
|
||||||
rm apps/readest-app/src-tauri/gen/android
|
|
||||||
pnpm tauri android init
|
|
||||||
pnpm tauri icon ../../data/icons/readest-book.png
|
|
||||||
git checkout apps/readest-app/src-tauri/gen/android
|
|
||||||
|
|
||||||
pnpm tauri android dev
|
|
||||||
# or if you want to dev on a real device
|
|
||||||
pnpm tauri android dev --host
|
|
||||||
```
|
|
||||||
|
|
||||||
For iOS:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Set up the iOS environment (run once)
|
|
||||||
pnpm tauri ios init
|
|
||||||
pnpm tauri icon ../../data/icons/readest-book.png
|
|
||||||
|
|
||||||
pnpm tauri ios dev
|
|
||||||
# or if you want to dev on a real device
|
|
||||||
pnpm tauri ios dev --host
|
|
||||||
```
|
|
||||||
|
|
||||||
### 5. Build for Production
|
|
||||||
|
|
||||||
```bash
|
|
||||||
pnpm tauri build
|
|
||||||
pnpm tauri android build
|
|
||||||
pnpm tauri ios build
|
|
||||||
```
|
|
||||||
|
|
||||||
Please refer to our release script if you experience any issues:
|
|
||||||
https://github.com/readest/readest/blob/main/.github/workflows/release.yml
|
|
||||||
|
|
||||||
### 6. Setup dev environment with Nix
|
|
||||||
|
|
||||||
If you have Nix installed, you can leverage flake to enter a development shell
|
|
||||||
with all the necessary dependencies:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
nix develop ./ops # enter a dev shell for the web app
|
|
||||||
nix develop ./ops#ios # enter a dev shell for the ios app
|
|
||||||
nix develop ./ops#android # enter a dev shell for the android app
|
|
||||||
```
|
|
||||||
|
|
||||||
### 7. More information
|
|
||||||
|
|
||||||
Please check the [wiki][link-gh-wiki] of this project for more information on development.
|
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue