feat(types): Phase 14.3 共用型別系統 (#97-#100)

建立 Pydantic → TypeScript 自動生成工具鏈:

1. scripts/generate-schemas.py
   - 從 Pydantic 模型生成 JSON Schema
   - 正確處理 Pydantic 2.x 的 $defs 格式
   - 支援 Approval/Incident/Terminal/Playbook/CSRF 模型

2. packages/shared-types/
   - @awoooi/shared-types 套件
   - 44 個型別定義,40 個介面
   - json-schema-to-typescript 自動生成

3. 前端整合
   - apps/web 加入 @awoooi/shared-types 依賴
   - typecheck 通過

使用方式:
  cd packages/shared-types
  pnpm generate  # 重新生成型別

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
OG T
2026-03-31 19:10:33 +08:00
parent a028b44c84
commit 936f1d64de
8 changed files with 3925 additions and 0 deletions

View File

@@ -11,6 +11,7 @@
},
"dependencies": {
"@awoooi/lewooogo-core": "workspace:*",
"@awoooi/shared-types": "workspace:^",
"@sentry/nextjs": "^10.45.0",
"@tanstack/react-query": "^5.17.0",
"class-variance-authority": "^0.7.1",