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:
+1
-1
@@ -7,7 +7,7 @@ import { createRouter, createWebHashHistory, Router } from 'vue-router'
|
||||
import zh_cn from './locales/zh-cn.json'
|
||||
import en from './locales/en.json'
|
||||
import { createI18n, I18n } from 'vue-i18n'
|
||||
import { IShrimpResponse, ILabel } from 'shrimp-server/types'
|
||||
import { IShrimpResponse, ILabel } from './IShrimpType'
|
||||
|
||||
import { ShrimpClient, handleShrimpResponse, type IShrimpTipper, type IRouteInfo } from './ShrimpClient'
|
||||
import FieldString from './components/fields/FieldString.vue'
|
||||
|
||||
Reference in New Issue
Block a user