Skip to content

feat(docs): Markdown 展示路由源码位置 (issue #5)#196

Open
yourtion wants to merge 1 commit into
mainfrom
feat/docs-source-location
Open

feat(docs): Markdown 展示路由源码位置 (issue #5)#196
yourtion wants to merge 1 commit into
mainfrom
feat/docs-source-location

Conversation

@yourtion

@yourtion yourtion commented Jul 1, 2026

Copy link
Copy Markdown
Owner

关联 issue

Closes #5

改动内容

sourceFile(含 relative/absolute,由 getCallerSourceLine 在路由注册时解析 Error.stack 采集)此前已在 API 构造时记录,但未纳入 DOC_FIELD,文档生成器拿不到。

  • sourceFile 加入 DOC_FIELD
  • Markdown 在「请求地址」行下方输出 源码位置:<relative>
  • sourceFile 时不输出该行,行为不变

测试

  • 新增 2 个回归测试(有/无 sourceFile)
  • 全量 npm run test:lib:317 → 319 全绿
  • tsc --noEmit 通过

版本

bump 3.2.1 → 3.2.4,已登记 MIGRATION

合并顺序提示

本系列共 4 个 PR,请按版本号顺序合并(3.2.2 → 3.2.3 → 3.2.4 → 3.2.5)。
⚠️ 合并时 MIGRATION.mdpackage.json 可能冲突,需 rebase 解冲突。

@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.56%. Comparing base (ffe0ffa) to head (a311cf3).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #196      +/-   ##
==========================================
+ Coverage   92.54%   92.56%   +0.01%     
==========================================
  Files          28       28              
  Lines        2939     2944       +5     
  Branches      770      772       +2     
==========================================
+ Hits         2720     2725       +5     
  Misses        217      217              
  Partials        2        2              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

sourceFile(relative/absolute)此前已在注册时采集,但未纳入 DOC_FIELD,
文档生成器拿不到。现加入 DOC_FIELD,并在 Markdown「请求地址」下方输出
「源码位置:<relative>」,便于从文档定位定义代码。无 sourceFile 时不输出。

- 新增 2 个回归测试(有/无 sourceFile)
- bump 版本 3.2.1 → 3.2.4,登记 MIGRATION
@yourtion yourtion force-pushed the feat/docs-source-location branch from 8249986 to a311cf3 Compare July 9, 2026 05:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

show source code and function name

1 participant