imbytecat
|
58b615a327
|
style(ui): 移除过期原生下拉样式
|
2026-05-12 00:45:00 +08:00 |
|
imbytecat
|
8f953cd6a1
|
feat(ui): 替换原生下拉控件
|
2026-05-12 00:39:44 +08:00 |
|
imbytecat
|
84e3f02752
|
chore(deps): 添加 Radix Select 依赖
|
2026-05-12 00:39:44 +08:00 |
|
imbytecat
|
2dabbd1281
|
feat(ui): 添加克制页面动效
|
2026-05-12 00:30:16 +08:00 |
|
imbytecat
|
602f969117
|
chore(deps): 添加 Motion 动效依赖
|
2026-05-12 00:30:16 +08:00 |
|
imbytecat
|
32946b25fa
|
docs: 优化交付文档表达
|
2026-05-12 00:18:00 +08:00 |
|
imbytecat
|
50e8e32bac
|
fix(ui): 修复充电状态筛选重置
|
2026-05-12 00:18:00 +08:00 |
|
imbytecat
|
4571cee2a1
|
feat(ui): 优化电池实时状态筛选体验
|
2026-05-12 00:07:15 +08:00 |
|
imbytecat
|
38943f239f
|
feat(ui): 增强电池看板状态表达
|
2026-05-12 00:07:15 +08:00 |
|
imbytecat
|
5d9aa660d8
|
fix(domain): 移除虚构 SoH 趋势语义
|
2026-05-12 00:07:15 +08:00 |
|
imbytecat
|
e9568bca8c
|
chore(dev): 统一 Compose 环境变量格式
|
2026-05-11 23:42:28 +08:00 |
|
imbytecat
|
ba4aa96baf
|
docs(prediction): 明确 SoH 预测必填依赖
|
2026-05-11 23:38:38 +08:00 |
|
imbytecat
|
8a3d5fd947
|
fix(env): 要求配置 SoH 预测服务
|
2026-05-11 23:38:38 +08:00 |
|
imbytecat
|
a131bb845b
|
fix(dashboard): 正确展示 SoH 预测不可用
|
2026-05-11 23:38:37 +08:00 |
|
imbytecat
|
99d9cd1e1d
|
refactor(api): 复用电池业务常量
|
2026-05-11 23:38:37 +08:00 |
|
imbytecat
|
dc8a595d0a
|
refactor(domain): 集中电池业务常量
|
2026-05-11 23:38:37 +08:00 |
|
imbytecat
|
a8e3cf5f4b
|
docs(api): 更新电池分页接口说明
|
2026-05-11 23:16:59 +08:00 |
|
imbytecat
|
c533113229
|
feat(ui): 重构电池列表分页表格
|
2026-05-11 23:16:59 +08:00 |
|
imbytecat
|
69c4a2e9eb
|
fix(api): 收紧电池列表查询输入
|
2026-05-11 23:16:59 +08:00 |
|
imbytecat
|
dd4a447dcd
|
style: 格式化后端改造代码
|
2026-05-11 23:16:59 +08:00 |
|
imbytecat
|
cf6f91651d
|
feat(api): 支持电池分页和安全预测
|
2026-05-11 22:39:05 +08:00 |
|
imbytecat
|
29e70fea9a
|
refactor(domain): 标注 SoH 来源语义
|
2026-05-11 22:39:05 +08:00 |
|
imbytecat
|
6ff9dbe772
|
chore(deps): 添加表格和缓存依赖
|
2026-05-11 22:39:05 +08:00 |
|
imbytecat
|
c936167fc8
|
docs(prediction): 说明 AI 预测服务配置
|
2026-05-11 22:21:57 +08:00 |
|
imbytecat
|
1a2ff19cf4
|
feat(dashboard): 接入预测结果聚合
|
2026-05-11 22:21:57 +08:00 |
|
imbytecat
|
b11d37e9d8
|
feat(prediction): 新增 AI SoH 预测客户端
|
2026-05-11 22:21:57 +08:00 |
|
imbytecat
|
c8ea9330e1
|
chore(ignore): 忽略本地 MySQL 数据目录
|
2026-05-11 21:58:23 +08:00 |
|
imbytecat
|
8824db8019
|
chore(dev): 改用 Compose named volume
|
2026-05-11 21:58:23 +08:00 |
|
imbytecat
|
158d4007e4
|
feat(ui): 使用 Recharts 并改为客户端 API 请求
|
2026-05-11 21:58:23 +08:00 |
|
imbytecat
|
749697634a
|
chore(env): 更新本地环境示例
|
2026-05-11 20:51:43 +08:00 |
|
imbytecat
|
6f627fe776
|
docs: 更新 MySQL 展示系统说明
|
2026-05-11 20:51:43 +08:00 |
|
imbytecat
|
ddd077eb37
|
chore(dev): 添加本地 MySQL seed 环境
|
2026-05-11 20:51:43 +08:00 |
|
imbytecat
|
3040608959
|
refactor(db): 移除嵌入式迁移链路
|
2026-05-11 20:51:43 +08:00 |
|
imbytecat
|
bec1026a94
|
refactor(db): 移除 PostgreSQL 运行时层
|
2026-05-11 20:51:43 +08:00 |
|
imbytecat
|
e722913468
|
refactor(todo): 移除 Todo API 示例
|
2026-05-11 20:51:34 +08:00 |
|
imbytecat
|
334e387765
|
refactor(todo): 移除 Todo 前端示例
|
2026-05-11 20:51:34 +08:00 |
|
imbytecat
|
b722799ca3
|
feat(ui): 新增电池实时状态页
|
2026-05-11 20:51:34 +08:00 |
|
imbytecat
|
df7b58c2f8
|
feat(ui): 重建 SoH 看板首页
|
2026-05-11 20:51:34 +08:00 |
|
imbytecat
|
4e5ba4b599
|
feat(api): 实现电池 ORPC 路由
|
2026-05-11 20:51:24 +08:00 |
|
imbytecat
|
657c7317f7
|
feat(api): 暴露电池 ORPC 契约
|
2026-05-11 20:51:24 +08:00 |
|
imbytecat
|
ebe0970df1
|
feat(mysql): 接入只读电池数据源
|
2026-05-11 20:51:24 +08:00 |
|
imbytecat
|
8b6339f34b
|
feat(domain): 新增电池领域模型与聚合逻辑
|
2026-05-11 20:51:24 +08:00 |
|
imbytecat
|
393ff406a3
|
docs(readme): 强调 PostgreSQL 18+ 要求并提供 escape hatch
代码 schema 用了 PG 原生 uuidv7() 函数,PG <18 会炸。在技术栈行里把
PostgreSQL 改成 PostgreSQL 18+,快速开始顶部加 callout 说明改回
Bun.randomUUIDv7() 的方式以兼容老版本。
|
2026-04-25 17:34:43 +08:00 |
|
imbytecat
|
9073e38238
|
chore: gitignore瘦身154->21行 + migrate onnotice改logger.debug
gitignore: 删社区模板倒灌的死分支 (bower/jspm/snowpack/parcel/fusebox
/dynamodb/firebase/yarn-v3/sveltekit/vuepress/docusaurus/gatsby/next
/nuxt/grunt/eslintcache 等),只留实际命中的 ~20 行。KISS。
migrate: onnotice 从空函数改成 logger.debug,消除最后一处 silent
black hole。pg NOTICE 现在会出现在 LOG_LEVEL=debug 下。
|
2026-04-25 17:29:18 +08:00 |
|
imbytecat
|
27e5f3c76f
|
chore(vite): remove server block (no need to pin port 3000 strict)
vite default already binds 3000 if available; no real requirement to
strict-port. AGENTS.md / README.md synced.
|
2026-04-25 17:19:27 +08:00 |
|
imbytecat
|
4a78ba2882
|
refactor(db): UUIDv7 \u751f\u6210\u4e0b\u63a8\u5230 PG18 \u539f\u751f uuidv7()\uff0c\u8005\u53ea\u6539 schema
\u53ea\u6539 schema \u5c42\u9762\uff1a
- src/server/db/fields.ts:
$defaultFn(() => Bun.randomUUIDv7()) \u2192 default(sql`uuidv7()`)
- AGENTS.md Stack & runtime: \u52a0 PG18+ \u786c\u7ea6\u675f
- AGENTS.md Drizzle \u8282\u8bf4\u660e DB-side uuidv7\uff08\u5355\u8c03\u3001\u4f7f\u7528 DB \u65f6\u949f\uff09
- AGENTS.md Bun-native \u539f\u5219\u533a\u5206 app-code UUIDv7 \u4e0e DB PK
- AGENTS.md Don'ts \u9996\u6761\u52a0 "AI \u4e0d\u80fd\u8dd1 db:generate"
\u4f9d\u7136\u9700\u8981\u4f60\u624b\u52a8\u8dd1 `bun run db:generate` \u4ee5\uff1a
1) \u751f\u6210\u65b0 migration\uff08\u5e94\u8be5\u662f DROP \u8001\u8868 + CREATE \u65b0\u8868\uff0c
\u6216\u4f60\u624b\u5199 ALTER COLUMN id SET DEFAULT uuidv7()\uff09
2) \u91cd\u751f migrations.gen.ts
\u672c commit \u72b6\u6001\u4e0b\u8fd0\u884c\u65f6\u5c1a\u4e0d\u53ef\u7528\uff08\u8001 migration \u672a\u8bbe DEFAULT\uff0c
\u63d2\u5165\u4f1a\u62a5 NOT NULL \u9519\uff09\uff1bdb:generate \u540e\u91cd\u65b0 build/compile/deploy \u624d\u662f
\u5b8c\u6574\u72b6\u6001\u3002fix / typecheck / test 3/3 \u5747\u8fc7\uff08\u9759\u6001\u68c0\u67e5\u4e0d\u4f9d\u8d56 migration\uff09\u3002
|
2026-04-25 17:12:06 +08:00 |
|
imbytecat
|
fafe02bdbd
|
refactor: 主动审计修复多处可观测性、依赖、代码质量缺口
通过并行 explore + librarian + 自查发现并修复:
代码缺陷
- shutdown.ts: db.$client.end().finally(...) 静默吞错——关闭失败会
谎报 "DB pool closed" 后照常 exit 0。改用 await + try/catch
分别记录成功/失败,setTimeout 也换成 Bun.sleep。
- interceptors.ts: 两条 instanceof ORPCError && instanceof
ValidationError 重复检查,改用 early return + 单 if 分支区分 code。
- types.ts: 移除从未被引用的 RouterInputs 死代码(仅 RouterOutputs
被 TodoItem 用到)。
Bun 原生 API(删/换 Node 兼容层)
- fields.ts: uuid v7 → Bun.randomUUIDv7(),删除 uuid 依赖
- migrate.ts: node:crypto.createHash → Bun.CryptoHasher.hash,
少一个 Promise.all 项 + 一个 import
- shutdown.ts: setTimeout → Bun.sleep(顺带)
Biome 2.4 规则补强
- domains.types: "all"——开启类型感知规则集(noFloatingPromises /
noMisusedPromises / useAwaitThenable / noUnnecessaryConditions
等 Promise/异步陷阱)
- domains.drizzle: "recommended"、domains.react: "recommended"
- 显式开启 suspicious.noImportCycles(2.4 已 promote)
文档
- AGENTS.md 在 Stack & runtime 段加 "Prefer Bun-native APIs"
原则,列出 UUIDv7/SHA-256/sleep/Bun.file 的优先路径
- AGENTS.md 在 Code style (Biome) 段记录本次启用的 lint domain
与 noImportCycles 规则
验证:fix / typecheck / test 3/3 / build 568ms / compile 117M /
docker compose 全套(migrate JSON 日志 ✓、UUIDv7 写入 ✓、SIGTERM
shutdown 正确序列化 ✓)
|
2026-04-25 17:06:22 +08:00 |
|
imbytecat
|
815ee31f95
|
refactor(layout): 根目录脚本归位 src/ 与 scripts/,sql.d.ts 下沉到 db/
- bin.ts → src/bin.ts (生产入口归并到 src/,import 改用 #package + @/cli/*)
- compile.ts → scripts/compile.ts (开发期工具)
- embed-migrations.ts → scripts/embed-migrations.ts (codegen)
- src/sql.d.ts → src/server/db/sql.d.ts (与唯一消费者 migrations.gen.ts 共址)
效果:项目根从 3 个零散 .ts 减为 0 个,src/ 是完整应用源码,scripts/
明确区分开发期工具。所有 package.json scripts、AGENTS.md layout/CLI 章节、
compile.ts ENTRYPOINT 与 .js.map 清理路径同步更新。
验证:fix / typecheck / test 3/3 / build 570ms / compile 117M / docker
compose 全套(migrate 干净的 logger=cli.migrate JSON 日志、app /health
200、POST /api/todo/create 成功)。
|
2026-04-25 16:50:48 +08:00 |
|
imbytecat
|
f8af18cff5
|
fix(docker): 移除 stale COPY patches 行修复 docker build
d9210b3 升级 TanStack Start 至 1.167.48 时删除了 patches/ 目录
(upstream PR #7249 已修),但漏掉同步更新 Dockerfile,导致
docker build 报 "/patches": not found 失败。
验证:docker compose build app 通过。
|
2026-04-25 16:37:43 +08:00 |
|
imbytecat
|
34d2cbb1cd
|
refactor(logging): 二次审计修复 oracle 漏掉的可观测性缺口与占位符冗余
二次深度审计发现:
1. shutdown.ts SIGINT/SIGTERM 路径完全沉默——生产环境 k8s pod 终止时
操作者在日志里看不到任何痕迹。补 getLogger(['shutdown']) 三条日志:
- "Draining for shutdown" {signal, graceMs} (优雅关停起点)
- "Forcing exit on repeated signal" {signal} (二次信号强制退出)
- "DB pool closed, exiting" (干净退出确认)
2. interceptors.ts 与 shutdown.ts 的 {error}/{signal} 占位符在 JSON 模式
下导致 message 字段重复 inspect 转义 properties 里的同一份内容
(Error/对象会被 JSON.stringify 内联进 message,引号被反斜杠转义)。
规则收敛:占位符仅用于"想要内联渲染"的基本类型(id、count、duration),
对象/Error 直接放 properties,message 保持人类可读短句。
3. AGENTS.md Logging 段更新示例与规则,反映实际最佳实践。
端到端验证(compose + Postgres 18-alpine):
- /api/rpc/todo/list 成功 → logger=db level=INFO 输出 SQL ✓
- /api/rpc/todo/create 校验失败 → logger=api level=ERROR
message="Unhandled error in ORPC handler" 干净,properties.error
完整保留 code/status/message/data 字段 ✓
- SIGTERM → 三条 shutdown logger 事件按预期输出 ✓
- typecheck / test 3/3 / build / compile 117M 全绿 ✓
|
2026-04-25 16:24:00 +08:00 |
|