Commit Graph

5 Commits

Author SHA1 Message Date
imbytecat ed257fe4e6 refactor: 应用 Oracle round-4 复核,硬化 migrator 与默认安全值
- migrate: 校验已应用 migration 的 SHA-256,拒绝 schema drift;
  split 后 trim + skip empty,避免空 statement 触发 SQL 错误
- todo.contract: update 拒绝空 patch
- env: DATABASE_URL 限定 postgres(ql):// scheme,配置错误更早失败
- compile: autoloadDotenv: false,二进制部署不再吞 cwd 的 .env
- Error.tsx: 生产环境隐藏 error.message,避免内部错误泄露
- AGENTS: 同步 generatedFieldKeys / migrator 行为新描述
2026-04-25 14:38:44 +08:00
imbytecat 695e826dcf refactor(types): 消除非必要 as 逃逸,锁紧 strict 政策
按 Oracle 复核处置全仓 5 处类型断言:

- fields.ts: as const → satisfies Record<GeneratedFieldKey, true>
- compile.ts: as readonly string[] → ReadonlySet<string>.has()
- embed-migrations.ts: JSON.parse as Journal → Zod schema 运行时校验,JSON.parse 显式 unknown
- interceptors.ts: 唯一保留的跨包断言(ORPC→Zod)注释扩写为完整背景
- router.tsx: satisfies 非 cast,保留

biome.json 增配 noExplicitAny / noTsIgnore / noNonNullAssertion,防止后续漂移。
2026-04-25 14:23:08 +08:00
imbytecat e28fe9dc7b perf(compile): 启用 bytecode + minify + inline sourcemap
- Bun 官方 bytecode caching:中型应用 startup ~2x(docs.bun.sh/docs/bundler/bytecode)
- minify:减小 bytecode 体积,二进制仅 +2MB sourcemap
- sourcemap inline:嵌入二进制,保证错误堆栈可读,并在 compile.ts 清理 bundler 残留的 *.js.map
2026-04-25 14:05:35 +08:00
imbytecat 19e60d358f feat(cli): 引入 citty CLI,迁移改为显式 ./server migrate
- 顶层新增 bin.ts 作为编译入口,citty 懒加载 src/cli/ 下子命令
- src/cli/serve.ts 通过 _serve-nitro.mjs 桥接启动 Nitro(规避
  .output/server/index.mjs 顶层 serve(...) 的副作用导入)
- src/cli/migrate.ts 显式跑 drizzle migrate;env / drizzle 都在 run()
  里 await import,避免 citty --help 遍历 subCommands 时触发 env 校验
- compile.ts 入口切到 bin.ts;移除 src/server/plugins/migrate.ts
  与 vite.config.ts 中的启动时自动迁移
- compose.yaml 新增一次性 migrate 服务,app depends_on
  service_completed_successfully,保证迁移先行再起服
- tsconfig 排除 .output / out;AGENTS.md 补充 CLI 与部署规约
2026-04-24 20:32:32 +08:00
imbytecat cd7b65fda4 refactor: flatten monorepo into standalone project 2026-04-01 19:43:21 +08:00