🔧 修复: 修复文档死链,改为 pnpm 进行文档管理

This commit is contained in:
2025-08-03 17:01:50 +08:00
parent 56bdf5388d
commit cd24bca29e
6 changed files with 2097 additions and 2928 deletions

View File

@@ -8,7 +8,7 @@ on:
- 'docs/**' - 'docs/**'
- 'openapi.json' - 'openapi.json'
- 'package.json' - 'package.json'
- 'yarn.lock' - 'pnpm-lock.yaml'
- '.github/workflows/deploy-docs.yml' - '.github/workflows/deploy-docs.yml'
workflow_dispatch: workflow_dispatch:
@@ -36,20 +36,22 @@ jobs:
- name: 设置Node.js - name: 设置Node.js
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version: 20 node-version: 22
cache: 'yarn' cache: 'pnpm'
- name: 启用Yarn - name: 设置pnpm
run: corepack enable uses: pnpm/action-setup@v2
with:
version: 9
- name: 安装依赖 - name: 安装依赖
run: yarn install --frozen-lockfile run: pnpm install --frozen-lockfile
- name: 验证OpenAPI规范 - name: 验证OpenAPI规范
run: yarn swagger:validate run: pnpm swagger:validate
- name: 检查Markdown文档 - name: 检查Markdown文档
run: yarn lint:docs run: pnpm lint:docs
continue-on-error: true continue-on-error: true
# 构建作业 # 构建作业
@@ -68,13 +70,15 @@ jobs:
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version: 20 node-version: 20
cache: 'yarn' cache: 'pnpm'
- name: 启用Yarn - name: 设置pnpm
run: corepack enable uses: pnpm/action-setup@v2
with:
version: 9
- name: 安装依赖 - name: 安装依赖
run: yarn install --frozen-lockfile run: pnpm install --frozen-lockfile
- name: 复制OpenAPI文件到public目录 - name: 复制OpenAPI文件到public目录
run: | run: |
@@ -82,7 +86,7 @@ jobs:
cp openapi.json docs/public/ cp openapi.json docs/public/
- name: 构建文档 - name: 构建文档
run: yarn docs:build run: pnpm docs:build
env: env:
NODE_ENV: production NODE_ENV: production

14
.gitignore vendored
View File

@@ -277,17 +277,11 @@ vulnerability_report.*
# npm # npm
node_modules/ node_modules/
npm-debug.log* npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log* lerna-debug.log*
.pnpm-debug.log* .pnpm-debug.log*
# Yarn v2+ # pnpm
.yarn/cache .pnpm-store/
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
# Runtime data # Runtime data
pids pids
@@ -341,8 +335,8 @@ jspm_packages/
# Output of 'npm pack' # Output of 'npm pack'
*.tgz *.tgz
# Yarn Integrity file # package-lock files
.yarn-integrity package-lock.json
# parcel-bundler cache # parcel-bundler cache
.cache .cache

View File

@@ -56,34 +56,7 @@ python main.py
### 5. 启动服务 ### 5. 启动服务
```bash ```bash
python main.py --reload python main.py
```
服务启动后,您可以访问:
- **API服务**: http://localhost:8000
- **API文档**: http://localhost:8000/docs
- **Redoc文档**: http://localhost:8000/redoc
## 验证安装
访问健康检查接口验证服务是否正常运行:
```bash
curl http://localhost:8000/health
```
如果一切正常,您应该看到类似以下的响应:
```json
{
"code": 200,
"message": "服务运行正常",
"data": {
"status": "healthy",
"timestamp": "2024-01-01T12:00:00Z"
}
}
``` ```
## 下一步 ## 下一步

View File

@@ -1,5 +1,5 @@
{ {
"packageManager": "yarn@4.6.0", "packageManager": "pnpm@9.0.0",
"name": "loveac-docs", "name": "loveac-docs",
"version": "1.0.0", "version": "1.0.0",
"description": "LoveAC项目文档", "description": "LoveAC项目文档",

2074
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

2876
yarn.lock generated

File diff suppressed because it is too large Load Diff