From 08c28c038712f6f0aacb630c3565c7a79e9d6e18 Mon Sep 17 00:00:00 2001 From: Junyan Qin Date: Sat, 26 Jul 2025 19:45:02 +0800 Subject: [PATCH] docs: switch to pnpm --- docs/en/develop/dev-config.md | 20 ++++++-------------- docs/zh/develop/dev-config.md | 19 ++++++------------- 2 files changed, 12 insertions(+), 27 deletions(-) diff --git a/docs/en/develop/dev-config.md b/docs/en/develop/dev-config.md index 05f98f418..4447665ea 100644 --- a/docs/en/develop/dev-config.md +++ b/docs/en/develop/dev-config.md @@ -27,29 +27,21 @@ At this point, the configuration file will be automatically generated in the `da The code is located in the `web` directory and requires Node.js. -Install dependencies +Copy `.env.example` to `.env` and fill in the values. ```bash -npm install +cp .env.example .env ``` -Start debugging - -- Usage in Linux and other environments +Recommended to use [pnpm](https://pnpm.io/installation) to install dependencies. ```bash -npm run dev:local +pnpm install +pnpm dev ``` -- Usage in Windows environments - -```bash -npm run dev:local:win -``` - - :::info -When using `dev:local` to start locally, the environment variable `NEXT_PUBLIC_API_BASE_URL` will be automatically used by the frontend to ensure that the frontend can access the `5300` port of the locally running backend. If you need to modify the backend address or port used, please modify the `scripts` in the `web/package.json` file. +When using `pnpm dev` to start locally, the environment variable `NEXT_PUBLIC_API_BASE_URL` will be automatically used by the frontend to ensure that the frontend can access the `5300` port of the locally running backend. In production environments, the frontend will be precompiled into static files and provided by the backend, and the frontend will automatically access the backend address on the same domain. ::: diff --git a/docs/zh/develop/dev-config.md b/docs/zh/develop/dev-config.md index a6b33aef2..1513214ab 100644 --- a/docs/zh/develop/dev-config.md +++ b/docs/zh/develop/dev-config.md @@ -27,28 +27,21 @@ uv run main.py 代码位于 `web` 目录下,需要安装 Node.js。 -安装依赖 +复制 `.env.example` 到 `.env`。 ```bash -npm install +cp .env.example .env ``` -启动调试 - -- linux等环境使用 +推荐使用 [pnpm](https://pnpm.io/zh/installation) 安装依赖。 ```bash -npm run dev:local -``` - -- windows环境使用 - -```bash -npm run dev:local:win +pnpm install +pnpm dev ``` :::info -本地使用`dev:local`启动时,会携带环境变量`NEXT_PUBLIC_API_BASE_URL`,该变量会自动被前端使用,以确保前端可以访问到本地启动的后端的`5300`端口。如果您需要修改所使用的后端地址或端口,请到`web/package.json`文件中修改`scripts`中的`dev:local`命令。 +本地使用`pnpm dev`启动时,会携带`.env`中的环境变量`NEXT_PUBLIC_API_BASE_URL`,该变量会自动被前端使用,以确保前端可以访问到本地启动的后端的`5300`端口。 生产环境中,前端会被预编译成静态文件,由后端提供服务,前端会自动访问同域的后端地址。 :::