koatty 4.4.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +77 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +331 -43
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +340 -43
- package/dist/index.mjs.map +1 -1
- package/dist/package.json +21 -14
- package/package.json +20 -13
- package/.rollup.config.js +0 -89
- package/.turbo/turbo-build.log +0 -100
- package/.turbo/turbo-clean.log +0 -4
- package/.turbo/turbo-lint.log +0 -18
- package/.turbo/turbo-test.log +0 -117
- package/TASKS.md +0 -1227
- package/examples/README.md +0 -172
- package/examples/basic-app/README.md +0 -72
- package/examples/basic-app/package.json +0 -23
- package/examples/basic-app/pnpm-workspace.yaml +0 -4
- package/examples/basic-app/resource/data.json +0 -2
- package/examples/basic-app/resource/graphql/User.graphql +0 -22
- package/examples/basic-app/resource/proto/.gitkeep +0 -0
- package/examples/basic-app/resource/proto/hello.proto +0 -19
- package/examples/basic-app/static/.gitkeep +0 -0
- package/examples/basic-app/static/favicon.ico +0 -0
- package/examples/basic-app/test-app.js +0 -28
- package/examples/basic-app/test-logger.js +0 -19
- package/examples/basic-app/test-simple.ts +0 -13
- package/examples/basic-app/view/index.html +0 -25
- package/tsconfig.test.json +0 -16
- package/tsconfig.tsbuildinfo +0 -1
- package/tsup.config.ts +0 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,81 @@
|
|
|
1
|
+
## Unreleased — Phase A–F review (2026-09-30)
|
|
2
|
+
|
|
3
|
+
## 5.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- f0e9278: Phase A–D 审计修复,未发布:
|
|
8
|
+
|
|
9
|
+
- 容器注册表、类标识、实例注入与 AOP 解析均按容器隔离;注入不再写入共享原型。同名构造函数的元数据缓存不再串用。
|
|
10
|
+
- `app.container` 与 Core ALS 贯通;请求结束释放对应容器的请求实例。组件实例和事件处理器使用所属应用。
|
|
11
|
+
- 注册期构造路由 handler;控制器、参数元数据、中间件和 RouterFactory 使用应用容器。关闭一个应用不会清理另一应用的路由。
|
|
12
|
+
- 扫描目录、每个模块与缓存条目均以 realpath 校验根目录边界;越界路径直接拒绝,不再回退扫描整个项目。
|
|
13
|
+
- Bootstrap 自动创建应用独立容器,Loader/Router/注入链路使用 app.container;扫描同时处理默认导出与具名导出。
|
|
14
|
+
- SSE 复用普通路由和 streamSSE;现有 middleware 与 Around/run 承担鉴权、限流和方法包装。
|
|
15
|
+
- HTTPS/HTTP2 证书热更新及失败回退。
|
|
16
|
+
- Serve 使用连接追踪器,HTTP/3 移至独立实验包 koatty_http3;移除核心 QUIC 依赖及模拟监听。
|
|
17
|
+
- 生产构建可用既有 manifest 命令生成 runtime 清单;启动前逐文件校验路径与 SHA256。
|
|
18
|
+
- 修复独立安装缺失运行时/公开类型依赖,以及原生 Node ESM 入口加载错误。
|
|
19
|
+
- Config 复用既有双模式装饰器适配器,支持 TC39 字段初始化与应用隔离。
|
|
20
|
+
|
|
21
|
+
移除 Http3Server 等核心导出和入站池语义属于破坏性变更,因此 koatty 与 koatty_serve 必须按 major 发布,不能沿用原计划的 4.5.0 minor。koatty_http3 是首次发布包,按发布工具的新包流程单独处理;最终版本需与主包依赖同步。
|
|
22
|
+
|
|
23
|
+
迁移:docs/migration/phase-d-router-hotpath.md。D-5 实现及 D-7 清单已补齐;性能门槛、Linux CI 与部署验收仍未关闭。此文件不代表验收通过,不自动应用版本或发布。
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- f0e9278: Close the second Phase A–F review: strict security config validation and environment resolution, explicit metrics trust, default WS Origin checks, hard-link-safe CLI writes and delimited tool arguments, DTO transformation and conservative schema diagnostics, privacy-safe telemetry, HTTP3 peer ownership and draining reference SSE service. MCP/LLM/Guard first-release major entries are in phase-f-audit-hardening. See docs/migration/phase-a-f-review-fixes.md. Do not treat local tests as release/client/provider acceptance.
|
|
28
|
+
- f0e9278: Close Phase C audit findings: await singleton initialization and reverse disposal, make shutdown idempotent and drain responses complete, handle real gRPC deadlines and stream termination, bound lock renewal with cooperative cancellation, await scheduler drain, validate JSON Schema and explicit security profiles, isolate Redis native leases/transactions, and preserve cached types with single flight.
|
|
29
|
+
|
|
30
|
+
Redis transactions now return an explicit isolated handle; native connections must be released. Untyped legacy cache entries are treated as misses. JSON Schema requires optional peer ajv 8. See docs/migration/phase-c-audit-remediation.md before release. Linux/Redis CI and independent package consumption remain release gates.
|
|
31
|
+
|
|
32
|
+
- Updated dependencies [f0e9278]
|
|
33
|
+
- Updated dependencies [f0e9278]
|
|
34
|
+
- Updated dependencies [f0e9278]
|
|
35
|
+
- Updated dependencies [f0e9278]
|
|
36
|
+
- Updated dependencies [a9e91a9]
|
|
37
|
+
- Updated dependencies [f0e9278]
|
|
38
|
+
- Updated dependencies [f0e9278]
|
|
39
|
+
- koatty_core@2.7.0
|
|
40
|
+
- koatty_serve@4.0.0
|
|
41
|
+
- koatty_trace@2.5.0
|
|
42
|
+
- koatty_config@1.5.0
|
|
43
|
+
- koatty_container@4.1.0
|
|
44
|
+
- koatty_lib@1.6.1
|
|
45
|
+
- koatty_loader@2.1.0
|
|
46
|
+
- koatty_logger@3.1.2
|
|
47
|
+
- koatty_router@2.5.0
|
|
48
|
+
- koatty_exception@2.2.3
|
|
49
|
+
|
|
50
|
+
Reference app emits safe SSE errors, drains active responses before shutdown and reports readiness; avoid duplicate guard audits; add socket/backpressure regressions and exclude examples from published files.
|
|
51
|
+
|
|
52
|
+
Migration: `docs/migration/phase-a-f-review-fixes.md` in the monorepo. No release has been applied.
|
|
53
|
+
|
|
1
54
|
# koatty
|
|
2
55
|
|
|
56
|
+
## Unreleased — Phase F audit fixes (2026-09-29)
|
|
57
|
+
|
|
58
|
+
- MCP 参考应用接入真实 SSE、流式工具循环、Guard、live trace;新增真实 HTTP/断线/链路测试及可构建启动入口,纳入 workspace 与 CI。
|
|
59
|
+
- 迁移说明:`docs/migration/phase-f-audit-fixes.md`(主仓库)。
|
|
60
|
+
|
|
61
|
+
## Unreleased — Phase A–D completion
|
|
62
|
+
|
|
63
|
+
- appStart 在所有传输真正监听后触发一次,appReady 仅表示初始化完成;createApplication 不提前发出 appStart。
|
|
64
|
+
- 生产启动消费经过路径与 SHA256 校验的 runtime manifest;内置配置直接打包,修复 tarball 中缺少 config 目录的启动失败。
|
|
65
|
+
- 修复无脚本 argv 的嵌入启动及 ESM 类型导出;生成项目采用编译后清单构建流程。
|
|
66
|
+
|
|
67
|
+
本轮尚未发布;验收边界见根目录 `docs/audits/phase-ad-completion-2026-09-28.md`。
|
|
68
|
+
|
|
69
|
+
## Unreleased (Phase A–D remediation)
|
|
70
|
+
|
|
71
|
+
- Bootstrap 自动创建应用独立容器,Loader/Router/注入链路使用 app.container;扫描同时处理默认导出与具名导出。
|
|
72
|
+
- Loader 尊重 Service scope/args,Controller 在实际请求中构造,避免启动阶段解析 Request 依赖。
|
|
73
|
+
- 应用停止刷新共享默认日志器;最后一个配置日志的应用停止后关闭批量刷新定时器,不销毁其他应用仍使用的进程级日志资源。
|
|
74
|
+
- Jest 中导入 Bootstrap 类只登记定义,显式 createApplication/ExecBootStrap 才启动,避免测试产生无法管理的后台应用;生产自动启动不变。
|
|
75
|
+
- app.paths 为路径入口;旧 env 路径写入保留兼容、已弃用。阶段发布仍受 D-5/D-7 等未关闭验收项约束。
|
|
76
|
+
|
|
77
|
+
迁移说明:`docs/migration/phase-d-router-hotpath.md`。尚未发布。
|
|
78
|
+
|
|
3
79
|
## 4.4.0
|
|
4
80
|
|
|
5
81
|
### Minor Changes
|
|
@@ -45,6 +121,7 @@
|
|
|
45
121
|
- Phase B security hardening (koatty-hardening-and-ai-evolution-plan.md, ADR-101/102/103). Fail-closed defaults with a `security.legacyDefaults: true` rollback switch; see docs/migration/4.3.0.md for the full migration guide.
|
|
46
122
|
|
|
47
123
|
Highlights:
|
|
124
|
+
|
|
48
125
|
- SecurityProfile (strict/standard/development) exposed read-only as `app.security`, with a startup summary and per-item WARN when rolling back
|
|
49
126
|
- body parsing failures return 400/413/415 instead of silently producing `{}`; body size limit follows the security profile (1mb in production)
|
|
50
127
|
- DTO validation whitelist on by default (strict profile rejects unknown fields); `__proto__`/`constructor` keys never reach DTO instances
|