v0.2.0: 解耦 shrimp-server,内置 IShrimpType 契约副本

- 拷 shrimp-server/src/IShrimpType.ts 到 src/IShrimpType.ts,头改 @syncedFrom shrimp-server contract 1.0.0
- 全部内部 import 'shrimp-server/types' → 本地 './IShrimpType'(各文件按相对路径)
- src/index.ts 加上类型契约的 re-export(ShrimpCode/ShrimpError/枚举/全部 interface),消费侧从 'shrimp-admin' 一处拿到
- 删 dependencies.shrimp-server,前端 bundle 不再牵 mongoose/express

为什么不直接 import 'shrimp-server':
  shrimp-server v0.6.0 收单入口后,入口含 mongoose/express,前端会被 vite 牵进 bundle。
  契约副本 + 版本号对照是低频改动场景的更干净选择。
This commit is contained in:
2026-05-23 22:29:42 +08:00
parent 4cb3bb8d75
commit f210ce4582
12 changed files with 427 additions and 13 deletions
+1 -1
View File
@@ -51,7 +51,7 @@
import { ref, onMounted } from 'vue'
import { useI18n } from 'vue-i18n'
import { vueAdmin } from '../VueAdmin'
import { IRole, IRoleProto, WithId, ILabel } from 'shrimp-server/types'
import { IRole, IRoleProto, WithId, ILabel } from '../IShrimpType'
import { ElMessage } from 'element-plus'
import PowerTree from '../components/PowerTree.vue'