mirror of
https://gh-proxy.org/https://github.com/klinsmaya/yudao-ui-admin-vben.git
synced 2026-11-10 02:17:14 +08:00
53b1529 为支持运行时动态语言注册,将 SupportedLanguagesType
等四处语言类型从字面量联合放宽为 string,换来扩展便利的同时
完全丢失了编译期类型约束。
本提交以 keyof interface 注册表恢复类型安全:
- typings 新增 SupportedLanguages 接口(默认 en-US / zh-CN),
SupportedLanguagesType = keyof SupportedLanguages 派生联合
- locales / composables / preferences / constants 恢复引用该
联合,LanguageOption 泛型化(默认 string 保留运行时注册
自定义语言的逃生舱),SUPPORT_LANGUAGES 默认列表约束回联合
- 应用扩展语言时无需改动核心包:在应用内 d.ts 通过
declare module '@vben-core/typings' 追加接口键即可让联合
自动扩展(先例:vue-router 的 RouteMeta 增强)
- 运行时语言列表仍由 setSupportLanguages 注册,53b1529 的
动态注册机制与 en-US 回退行为完整保留
- 声明依赖的五个包补齐 @vben-core/typings workspace 依赖
50 lines
1.1 KiB
JSON
50 lines
1.1 KiB
JSON
{
|
|
"name": "@vben-core/composables",
|
|
"version": "5.7.0",
|
|
"homepage": "https://github.com/vbenjs/vue-vben-admin",
|
|
"bugs": "https://github.com/vbenjs/vue-vben-admin/issues",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "git+https://github.com/vbenjs/vue-vben-admin.git",
|
|
"directory": "packages/@core/composables"
|
|
},
|
|
"license": "MIT",
|
|
"type": "module",
|
|
"scripts": {
|
|
"build": "pnpm exec tsdown"
|
|
},
|
|
"files": [
|
|
"dist"
|
|
],
|
|
"sideEffects": false,
|
|
"main": "./dist/index.mjs",
|
|
"module": "./dist/index.mjs",
|
|
"exports": {
|
|
".": {
|
|
"types": "./src/index.ts",
|
|
"development": "./src/index.ts",
|
|
"production": "./src/index.ts",
|
|
"default": "./dist/index.mjs"
|
|
}
|
|
},
|
|
"publishConfig": {
|
|
"exports": {
|
|
".": {
|
|
"types": "./dist/index.d.ts",
|
|
"default": "./dist/index.mjs"
|
|
}
|
|
}
|
|
},
|
|
"dependencies": {
|
|
"@vben-core/shared": "workspace:*",
|
|
"@vben-core/typings": "workspace:*",
|
|
"@vueuse/core": "catalog:",
|
|
"reka-ui": "catalog:",
|
|
"sortablejs": "catalog:",
|
|
"vue": "catalog:"
|
|
},
|
|
"devDependencies": {
|
|
"@types/sortablejs": "catalog:"
|
|
}
|
|
}
|