Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

docs: update build guideline (#1630)

Himself6505ac48b6939d
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index e5d2171403..f6631d53fb 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -3,8 +3,11 @@ name: Build & Test
on:
pull_request_target:
branches: [master]
-
-# Cancels all previous workflow runs for pull requests that have not completed.
+ paths-ignore:
+ - '.husky'
+ - '.vscode'
+ - 'docs/**'
+ - 'README.md'
# See https://docs.github.com/en/actions/using-jobs/using-concurrency
concurrency:
# The concurrency group contains the workflow name and the branch name for
diff --git a/apps/desktop/package.json b/apps/desktop/package.json
index 1fc6cc8820..7601ef3090 100644
--- a/apps/desktop/package.json
+++ b/apps/desktop/package.json
@@ -7,7 +7,7 @@
"module": "true",
"scripts": {
"dev:app": "NODE_ENV=development tauri dev",
- "dev:web": "pnpm --filter @affine/app dev",
+ "dev:web": "yarn workspace @affine/app dev",
"build:rs-types": "zx scripts/generateTsTypingsFromJsonSchema.mjs",
"build:affine": "zx scripts/buildAffine.mjs",
"build:preload": "esbuild src/preload/index.ts --outdir=public/preload",
diff --git a/docs/BUILDING.md b/docs/BUILDING.md
index 66f2ae5e39..bd557969ac 100644
--- a/docs/BUILDING.md
+++ b/docs/BUILDING.md
@@ -25,29 +25,49 @@ install [Node LTS version](https://nodejs.org/en/download)
install [nvm](https://github.com/nvm-sh/nvm)
```sh
-nvm install --lts
-nvm use --lts
+nvm install 18
+nvm use 18
```
## Setup Environment
```sh
# install dependencies
-pnpm install
+yarn install
```
## Start Development Server
-```sh
-pnpm dev
+### Option 1: Local OctoBase
+
+```shell
+# Run OctoBase container in background
+docker pull ghcr.io/toeverything/cloud:nightly-latest
+docker run --env=SIGN_KEY=test123 --env=RUST_LOG=debug --env=JWST_DEV=1 --env=PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin --workdir=/app -p 3000:3000 --runtime=runc -d ghcr.io/toeverything/cloud:nightly-latest
```
-The playground page should work at [http://localhost:8080/](http://localhost:8080/)
+```shell
+# Run AFFiNE Web in development mode
+yarn dev:local
+```
+
+### Option 2: Remote OctoBase
+
+```shell
+yarn dev
+```
+
+you might need set environment variables in `.env.local` file.
+See our [template](../apps/web/.env.local.template).
+
+Then, the playground page should work at [http://localhost:8080/](http://localhost:8080/)
For more details, see [apps/web/README.md](../apps/web/README.md)
## Testing
+> Local OctoBase is required for testing. Otherwise, the affine part of the tests will fail.
+
Adding test cases is strongly encouraged when you contribute new features and bug fixes.
We use [Playwright](https://playwright.dev/) for E2E test, and [vitest](https://vitest.dev/) for unit test.
@@ -56,5 +76,5 @@ To test locally, please make sure browser binaries are already installed via `np
```sh
# run tests in headless mode in another terminal window
-pnpm test
+yarn test
```
diff --git a/docs/building-desktop-client-app.md b/docs/building-desktop-client-app.md
index f4fc034d38..e62dc6fcd4 100644
--- a/docs/building-desktop-client-app.md
+++ b/docs/building-desktop-client-app.md
@@ -19,9 +19,9 @@ To run AFFiNE Desktop Client Application locally, run the following commands in
```sh
-pnpm install
-pnpm build:preload
-pnpm dev:app
+yarn install
+yarn build:preload
+yarn dev:app
```