添加开发文档 - #5438
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds localized development guides and links them from the project READMEs to help developers run and develop new-api locally.
Changes:
- Added a new Development Guide in English, Simplified Chinese, Traditional Chinese, Japanese, and French under
docs/development/. - Documented local dev workflow (Bun build, Go run), Makefile-based dev workflow, and common issues (go:embed, port conflicts).
- Linked each README language variant to its corresponding Development Guide doc.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| docs/development/DEVELOPMENT.md | Adds English development guide content. |
| docs/development/DEVELOPMENT.zh_CN.md | Adds Simplified Chinese development guide content. |
| docs/development/DEVELOPMENT.zh_TW.md | Adds Traditional Chinese development guide content. |
| docs/development/DEVELOPMENT.ja.md | Adds Japanese development guide content. |
| docs/development/DEVELOPMENT.fr.md | Adds French development guide content. |
| README.md | Adds Development Guide link to English README (default). |
| README.en.md | Adds Development Guide link to English README variant. |
| README.zh_CN.md | Adds Development Guide link to Simplified Chinese README. |
| README.zh_TW.md | Adds Development Guide link to Traditional Chinese README. |
| README.ja.md | Adds Development Guide link to Japanese README. |
| README.fr.md | Adds Development Guide link to French README. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <p align="center"> | ||
| <a href="./DEVELOPMENT.zh_CN.md">简体中文</a> | | ||
| <strong>繁體中文</strong> | | ||
| <a href="./DEVELOPMENT.md">English</a> | | ||
| <a href="./DEVELOPMENT.fr.md">Français</a> | | ||
| <a href="./DEVELOPMENT.ja.md">日本語</a> | ||
| </p> |
WalkthroughThis PR adds comprehensive development guide documentation in five languages (English, French, Japanese, Simplified Chinese, Traditional Chinese) and updates all corresponding README files to include Quick Navigation links to the new development resources. Each guide covers local setup, development workflows, troubleshooting, and contribution guidelines. ChangesDevelopment Guide Documentation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
docs/development/DEVELOPMENT.md (1)
142-159: 💤 Low valueOptional: Add language identifier to code block.
The project structure diagram uses a fenced code block without a language specification. Consider adding
textor leaving it unmarked for better Markdown compatibility.As per coding guidelines, the static analysis tool flagged that fenced code blocks should specify a language (MD040).
🎨 Optional formatting improvement
-``` +```text . ├── router/ # HTTP routing🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/development/DEVELOPMENT.md` around lines 142 - 159, The fenced code block containing the project tree diagram (the block that begins with a single dot followed by the tree lines) lacks a language identifier and triggers MD040; update that fenced block by adding a language token such as text (e.g., change ``` to ```text) so the Markdown linter accepts it and the diagram renders as plain text.Source: Linters/SAST tools
docs/development/DEVELOPMENT.fr.md (1)
142-142: ⚡ Quick winAdd language specifier to project structure code block.
All four translation files have a fenced code block at line 142 without a language specifier. For better rendering and accessibility, specify a language identifier such as
textorplaintext.📝 Proposed fix
Replace the opening fence marker at line 142 in all four files:
-``` +```text . ├── router/ # ...🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/development/DEVELOPMENT.fr.md` at line 142, The fenced code block at the project structure opening fence is missing a language specifier; update the opening triple-backtick for the tree snippet (the line that currently reads ``` ) to include a language identifier such as text (i.e. change ``` to ```text) so the code block renders as plain text across all four translation files.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/development/DEVELOPMENT.md`:
- Line 15: Update the DEVELOPMENT.md note to explicitly state that go.mod
specifies "go 1.25.1" while the Dockerfile image uses "golang:1.26.1-alpine",
clarifying that the module/go toolchain requirement is 1.25.1 but the dev
container image intentionally uses 1.26.1 for tooling/compatibility (or change
the image if you prefer exact parity); mention both exact tokens ("go 1.25.1"
and "golang:1.26.1-alpine") so readers are not confused and include a short
guidance line on whether contributors should match their local Go version to
go.mod or rely on the Docker image.
In `@docs/development/DEVELOPMENT.zh_TW.md`:
- Around line 233-234: Update the two Traditional Chinese links in
docs/development/DEVELOPMENT.zh_TW.md (the link texts "[用戶文件]" and "[API 文件]")
to point to the working Chinese locale by replacing their URLs from
https://docs.newapi.pro/en/docs and https://docs.newapi.pro/en/docs/api to
https://docs.newapi.pro/zh/docs and https://docs.newapi.pro/zh/docs/api
respectively (or add a short parenthetical note after the link if you
intentionally want to keep English content).
---
Nitpick comments:
In `@docs/development/DEVELOPMENT.fr.md`:
- Line 142: The fenced code block at the project structure opening fence is
missing a language specifier; update the opening triple-backtick for the tree
snippet (the line that currently reads ``` ) to include a language identifier
such as text (i.e. change ``` to ```text) so the code block renders as plain
text across all four translation files.
In `@docs/development/DEVELOPMENT.md`:
- Around line 142-159: The fenced code block containing the project tree diagram
(the block that begins with a single dot followed by the tree lines) lacks a
language identifier and triggers MD040; update that fenced block by adding a
language token such as text (e.g., change ``` to ```text) so the Markdown linter
accepts it and the diagram renders as plain text.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 0b57119f-4362-4892-8d28-f0e15bb45b1f
📒 Files selected for processing (11)
README.en.mdREADME.fr.mdREADME.ja.mdREADME.mdREADME.zh_CN.mdREADME.zh_TW.mddocs/development/DEVELOPMENT.fr.mddocs/development/DEVELOPMENT.ja.mddocs/development/DEVELOPMENT.mddocs/development/DEVELOPMENT.zh_CN.mddocs/development/DEVELOPMENT.zh_TW.md
|
|
||
| ## Requirements | ||
|
|
||
| - **Go**: 1.22+ (project uses 1.25.1) |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check Go version requirements across the repository
echo "=== Checking go.mod for Go version ==="
if [ -f go.mod ]; then
grep '^go ' go.mod
fi
echo ""
echo "=== Checking Dockerfile for Go version ==="
fd -t f 'Dockerfile|dockerfile' --exec grep -H 'FROM.*golang'
echo ""
echo "=== Checking GitHub Actions for Go version ==="
fd -t f -e yml -e yaml -p '.github/workflows' --exec grep -H 'go-version'
echo ""
echo "=== Checking any version files ==="
fd -t f '.go-version|.tool-versions' --exec cat {}Repository: QuantumNous/new-api
Length of output: 417
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "=== DEVELOPMENT.md around line 15 ==="
nl -ba docs/development/DEVELOPMENT.md | sed -n '1,40p'
echo
echo "=== Search for 1.25.1 / go-version / toolchain / go directives ==="
rg -n --hidden --no-ignore-vcs -S '1\.25\.1|go-version|toolchain\s|^go\s+[0-9]+' . || true
echo
echo "=== Show go.mod (small) ==="
if [ -f go.mod ]; then
nl -ba go.mod | head -n 80
fiRepository: QuantumNous/new-api
Length of output: 162
🌐 Web query:
Go 1.25.1 release notes go.dev
💡 Result:
Go 1.25.1 release notes (go.dev) summarize that go1.25.1 (released 2025-09-03) includes security fixes to the net/http package, as well as bug fixes to the go command, and the net, os, os/exec, and testing/synctest packages; it also points to the Go 1.25.1 milestone on the issue tracker for additional details.[1] The go.dev “Release History” page is the place where the Go 1.25.1 release highlights are listed (it references a milestone for the full set of changes):[1] - go1.25.1 (released 2025-09-03): security fixes to net/http; bug fixes to the go command, and net, os, os/exec, testing/synctest.[1]
Citations:
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "=== DEVELOPMENT.md line 15 context ==="
sed -n '10,20p' docs/development/DEVELOPMENT.md
echo
echo "=== Search for 1.25.1 / go-version / toolchain / go directives ==="
rg -n -S '1\.25\.1|go-version|toolchain\s|^go\s+[0-9]+\.[0-9]+' . || true
echo
echo "=== Search for golang:<version> in Dockerfiles ==="
rg -n -S 'golang:([0-9]+\.)+[0-9]+' Dockerfile* .github/workflows/* 2>/dev/null || true
echo
echo "=== Print relevant go.mod lines ==="
if [ -f go.mod ]; then rg -n -S '^(go\s+[0-9]+\.[0-9]+(\.[0-9]+)?)|toolchain\s+' go.mod || true; fiRepository: QuantumNous/new-api
Length of output: 1216
Go requirement is consistent: go.mod uses 1.25.1 (not a typo)
docs/development/DEVELOPMENT.md matches go.mod (go 1.25.1). Docker-based dev instead uses golang:1.26.1-alpine in Dockerfile*; consider clarifying this difference in the docs to avoid confusion.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/development/DEVELOPMENT.md` at line 15, Update the DEVELOPMENT.md note
to explicitly state that go.mod specifies "go 1.25.1" while the Dockerfile image
uses "golang:1.26.1-alpine", clarifying that the module/go toolchain requirement
is 1.25.1 but the dev container image intentionally uses 1.26.1 for
tooling/compatibility (or change the image if you prefer exact parity); mention
both exact tokens ("go 1.25.1" and "golang:1.26.1-alpine") so readers are not
confused and include a short guidance line on whether contributors should match
their local Go version to go.mod or rely on the Docker image.
| - [用戶文件](https://docs.newapi.pro/en/docs) | ||
| - [API 文件](https://docs.newapi.pro/en/docs/api) |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check if docs.newapi.pro supports zh locale for Traditional Chinese
curl -s -o /dev/null -w "%{http_code}" https://docs.newapi.pro/zh/docs
echo " - Status code for /zh/docs"
# Also check if there's a separate zh-TW or zh_TW locale
curl -s -o /dev/null -w "%{http_code}" https://docs.newapi.pro/zh-TW/docs
echo " - Status code for /zh-TW/docs"
curl -s -o /dev/null -w "%{http_code}" https://docs.newapi.pro/zh_TW/docs
echo " - Status code for /zh_TW/docs"Repository: QuantumNous/new-api
Length of output: 162
🏁 Script executed:
#!/bin/bash
set -euo pipefail
check() {
url="$1"
echo "== $url =="
# Print final effective URL after redirects + status code
curl -s -o /dev/null -L -w "Final status: %{http_code}; Effective URL: %{url_effective}\n" "$url"
# Also print first hop Location header if it is a redirect
echo -n "Redirect Location(s): "
curl -sI -o /dev/null -w "%{http_code}\n" "$url" | tail -n 1 >/dev/null
# safer: just display Location header from HEAD (single hop)
loc="$(curl -sI "$url" | awk 'BEGIN{IGNORECASE=1} /^location:/{print $2; exit}')"
if [ -n "$loc" ]; then
echo "$loc"
else
echo "(none)"
fi
}
check "https://docs.newapi.pro/zh/docs"
check "https://docs.newapi.pro/zh-TW/docs"
check "https://docs.newapi.pro/zh_TW/docs"
check "https://docs.newapi.pro/en/docs"Repository: QuantumNous/new-api
Length of output: 631
🏁 Script executed:
#!/bin/bash
set -euo pipefail
check() {
url="$1"
echo "== $url =="
# Final status code and effective URL after redirects
curl -s -o /dev/null -L -w "Final status: %{http_code}; Effective URL: %{url_effective}\n" "$url"
# Single-hop Location (if any)
loc="$(curl -sI "$url" | awk 'BEGIN{IGNORECASE=1} /^location:/{print $2; exit}')"
if [ -n "$loc" ]; then
echo "Single-hop Location: $loc"
else
echo "Single-hop Location: (none)"
fi
}
check "https://docs.newapi.pro/zh/docs"
check "https://docs.newapi.pro/zh-TW/docs"
check "https://docs.newapi.pro/zh_TW/docs"
check "https://docs.newapi.pro/en/docs"Repository: QuantumNous/new-api
Length of output: 627
🏁 Script executed:
#!/bin/bash
set -euo pipefail
check() {
url="$1"
echo "== $url =="
curl -s -o /dev/null -L -w "Final status: %{http_code}; Effective URL: %{url_effective}\n" "$url"
loc="$(curl -sI "$url" | awk 'BEGIN{IGNORECASE=1} /^location:/{print $2; exit}')"
if [ -n "$loc" ]; then
echo "Single-hop Location: $loc"
else
echo "Single-hop Location: (none)"
fi
}
check "https://docs.newapi.pro/zh/docs"
check "https://docs.newapi.pro/zh-TW/docs"
check "https://docs.newapi.pro/zh_TW/docs"
check "https://docs.newapi.pro/en/docs"Repository: QuantumNous/new-api
Length of output: 627
Fix Traditional Chinese doc links to point to the available Chinese locale
docs/development/DEVELOPMENT.zh_TW.mdcurrently links tohttps://docs.newapi.pro/en/docsfor both the user docs and API docs.https://docs.newapi.pro/zh/docsreturns200, buthttps://docs.newapi.pro/zh-TW/docsandhttps://docs.newapi.pro/zh_TW/docsreturn404.- Update the
zh_TWlinks tohttps://docs.newapi.pro/zh/docs(or add a brief note if English is intentionally used).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs/development/DEVELOPMENT.zh_TW.md` around lines 233 - 234, Update the two
Traditional Chinese links in docs/development/DEVELOPMENT.zh_TW.md (the link
texts "[用戶文件]" and "[API 文件]") to point to the working Chinese locale by
replacing their URLs from https://docs.newapi.pro/en/docs and
https://docs.newapi.pro/en/docs/api to https://docs.newapi.pro/zh/docs and
https://docs.newapi.pro/zh/docs/api respectively (or add a short parenthetical
note after the link if you intentionally want to keep English content).
Important
📝 变更描述 / Description
为项目添加了完整的开发文档(DEVELOPMENT.md),帮助开发者快速搭建本地开发环境。
主要内容:
为什么这样改:
//go:embed机制导致开发时需要特殊处理,未说明会导致新手开发者遇到报错变更细节:
docs/development/DEVELOPMENT.*.md(5 个语言版本)🚀 变更类型 / Type of change
🔗 关联任务 / Related Issue
无
✅ 提交前检查项 / Checklist
📸 运行证明 / Proof of Work
已在本地成功验证以下流程:
文档位置:
docs/development/DEVELOPMENT.md及其他语言版本README 更新: 所有语言版本的文档部分已添加"开发指南"入口