Skip to content

Feat/refactor - #179

Merged
yourtion merged 4 commits into
mainfrom
feat/refactor
Jun 25, 2026
Merged

Feat/refactor#179
yourtion merged 4 commits into
mainfrom
feat/refactor

Conversation

@yourtion

Copy link
Copy Markdown
Owner

No description provided.

yourtion added 3 commits June 25, 2026 09:56
修复测试正确性问题并消除对 dist 构建产物的硬依赖:

- 修复 test-router.ts 中 Koa/@leizm/web 假测试(原用 express.Router 冒充),
  改为真实 koa-router 与 @leizm/web Router 验证路由结构
- 新增 test-integration-koa.ts:真实 Koa + koa-router + koa-bodyparser
  集成测试,覆盖 bind() 的 forceGroup 与非 forceGroup 两种模式
- 新增 test-integration-leizmweb.ts:真实 @leizm/web Application + Router
  集成测试,覆盖 bind() 两种模式与 component.bodyParser 接入
- 修复 test-params.ts/test-lib.ts 对 dist 的硬依赖(6 处 require
  改为 src import),test:lib 现可在干净仓库独立运行
- 适配器覆盖率:koa.ts 40%→95%,leizmweb.ts 45%→100%,error.ts 51%→100%

测试总数 591→609,整体覆盖率 91.49%→94%
- 重写「快速开始」,提供三框架(Express/Koa/@leizm/web)通用的 API 定义
- 新增「框架接入指南」章节,每个框架提供完整可运行示例:
  - Express:含 json/urlencoded 解析、错误处理中间件
  - Koa:含 koa-bodyparser 接入、koa-router、统一错误处理、handler 写法
  - @leizm/web:含 component.bodyParser 接入、ctx.request.$params 用法
  - 三框架均覆盖 forceGroup 与非 forceGroup 两种模式
- 补充测试脚手架、分组中间件、错误处理(ERestError)等高级用法
- 移除过时的 generator-erest 脚手架引用(面向 v1,已 5 年未更新)
- 修复 node 版本徽章(≥18)与拼写问题
- CI workflow 合并重复的测试步骤:移除冗余的 test:lib,
  统一由 test:cov(带覆盖率)执行,测试时间减半
- coverage 上传步骤改用 if 条件控制,仅在 Node 20 矩阵执行
- package.json 简化 test:cov 为直接命令,去掉经由 test:lib 的间接调用
@codecov

codecov Bot commented Jun 25, 2026

Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@yourtion
yourtion merged commit 3c35ec0 into main Jun 25, 2026
6 checks passed
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.

1 participant