- 拷 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。 契约副本 + 版本号对照是低频改动场景的更干净选择。
72 lines
1.8 KiB
TypeScript
72 lines
1.8 KiB
TypeScript
// ============== 主入口 ==============
|
|
//
|
|
// 消费侧用法见 README.md。本文件只做 re-export。
|
|
|
|
// ===== 类型契约(IShrimpType 本地副本,@syncedFrom shrimp-server contract 1.0.0)=====
|
|
export {
|
|
ShrimpCode,
|
|
ShrimpError,
|
|
ShrimpFieldTypes,
|
|
ShrimpConfig,
|
|
isShrimpCondition,
|
|
} from './IShrimpType'
|
|
|
|
export type {
|
|
ILabel,
|
|
IShrimpResponse,
|
|
IModuleInfo,
|
|
ILoginResult,
|
|
IMeResult,
|
|
IMenuItem,
|
|
ITableProto,
|
|
ITableCrudProto,
|
|
IUser,
|
|
IRole,
|
|
IOperationLog,
|
|
WithId,
|
|
IShrimpOperator,
|
|
IShrimpPowerData,
|
|
ShrimpRequestFn,
|
|
IShrimpClient,
|
|
ShrimpFieldType,
|
|
FieldEditable,
|
|
IFieldTypeHandler,
|
|
IFieldConfig,
|
|
IFieldRule,
|
|
IPageQuery,
|
|
IPageResult,
|
|
IShrimpCondition,
|
|
IShrimpPopulate,
|
|
IShrimpQuery,
|
|
IPowerItem,
|
|
IUserProto,
|
|
IRoleProto,
|
|
} from './IShrimpType'
|
|
|
|
export {
|
|
VueAdmin,
|
|
vueAdmin,
|
|
createShrimpAdmin,
|
|
type ShrimpAdminOptions,
|
|
type ShrimpAdminConfig,
|
|
} from './VueAdmin'
|
|
|
|
export {
|
|
ShrimpClient,
|
|
handleShrimpResponse,
|
|
type IShrimpTipper,
|
|
type IRouteInfo,
|
|
} from './ShrimpClient'
|
|
|
|
// 框架组件 — 业务页面想直接复用就 import 这些
|
|
export { default as ShrimpTable } from './components/ShrimpTable.vue'
|
|
export { default as ShrimpEditDrawer } from './components/ShrimpEditDrawer.vue'
|
|
export { default as ShrimpFilterDrawer } from './components/ShrimpFilterDrawer.vue'
|
|
export { default as ShrimpFilterTrigger } from './components/ShrimpFilterTrigger.vue'
|
|
export { default as ShrimpSearchInput } from './components/ShrimpSearchInput.vue'
|
|
export { default as PowerTree } from './components/PowerTree.vue'
|
|
export { default as LangSwitch } from './components/LangSwitch.vue'
|
|
|
|
// 应用入口视图(消费侧 createApp 用)
|
|
export { default as App } from './views/App.vue'
|