Переглянути джерело

refactor(project): re-adjust the overall folder

vince 9 місяців тому
батько
коміт
14538f7ed5
100 змінених файлів з 179 додано та 287 видалено
  1. 2 2
      .vscode/settings.json
  2. 4 5
      apps/web-antd/package.json
  3. 1 1
      apps/web-antd/src/apis/core/auth.ts
  4. 1 1
      apps/web-antd/src/apis/core/menu.ts
  5. 1 1
      apps/web-antd/src/apis/core/user.ts
  6. 1 1
      apps/web-antd/src/apis/demos/status.ts
  7. 3 3
      apps/web-antd/src/apis/request.ts
  8. 1 1
      apps/web-antd/src/app.vue
  9. 1 1
      apps/web-antd/src/bootstrap.ts
  10. 0 11
      apps/web-antd/src/forward/README.md
  11. 0 2
      apps/web-antd/src/forward/index.ts
  12. 4 18
      apps/web-antd/src/layouts/basic.vue
  13. 1 1
      apps/web-antd/src/locales/index.ts
  14. 2 2
      apps/web-antd/src/main.ts
  15. 1 1
      apps/web-antd/src/preferences.ts
  16. 1 1
      apps/web-antd/src/router/access.ts
  17. 3 2
      apps/web-antd/src/router/guard.ts
  18. 1 2
      apps/web-antd/src/router/routes/index.ts
  19. 3 4
      apps/web-antd/src/store/index.ts
  20. 8 7
      apps/web-antd/src/store/modules/access.ts
  21. 6 1
      apps/web-antd/src/views/_core/authentication/code-login.vue
  22. 6 1
      apps/web-antd/src/views/_core/authentication/forget-password.vue
  23. 2 1
      apps/web-antd/src/views/_core/authentication/qrcode-login.vue
  24. 6 1
      apps/web-antd/src/views/_core/authentication/register.vue
  25. 1 1
      apps/web-antd/src/views/dashboard/workspace/index.vue
  26. 2 3
      apps/web-antd/src/views/demos/access/button-control.vue
  27. 4 4
      apps/web-antd/src/views/demos/access/index.vue
  28. 1 1
      apps/web-antd/src/views/demos/features/login-expired/index.vue
  29. 6 6
      internal/lint-configs/eslint-config/package.json
  30. 10 13
      internal/lint-configs/eslint-config/src/configs/perfectionist.ts
  31. 1 2
      internal/tailwind-config/package.json
  32. 3 3
      internal/tailwind-config/src/index.ts
  33. 2 2
      internal/vite-config/src/typing.ts
  34. 6 6
      package.json
  35. 0 7
      packages/@core/forward/README.md
  36. 0 43
      packages/@core/forward/helpers/package.json
  37. 0 29
      packages/@core/forward/stores/src/setup.ts
  38. 3 7
      packages/@core/hooks/package.json
  39. 0 3
      packages/@core/hooks/src/index.ts
  40. 0 0
      packages/@core/preferences/build.config.ts
  41. 2 3
      packages/@core/preferences/package.json
  42. 0 0
      packages/@core/preferences/src/config.ts
  43. 0 0
      packages/@core/preferences/src/constants.ts
  44. 6 7
      packages/@core/preferences/src/index.ts
  45. 1 1
      packages/@core/preferences/src/preferences.test.ts
  46. 5 10
      packages/@core/preferences/src/preferences.ts
  47. 6 0
      packages/@core/preferences/src/types.ts
  48. 0 0
      packages/@core/preferences/src/update-css-variables.ts
  49. 0 0
      packages/@core/preferences/src/use-preferences.ts
  50. 0 0
      packages/@core/preferences/tsconfig.json
  51. 1 2
      packages/@core/shared/constants/package.json
  52. 2 3
      packages/@core/shared/icons/package.json
  53. 1 2
      packages/@core/shared/toolkit/package.json
  54. 1 1
      packages/@core/shared/toolkit/src/cache/storage-manager.ts
  55. 1 1
      packages/@core/shared/toolkit/src/cache/types.ts
  56. 1 1
      packages/@core/shared/toolkit/src/colorful/convert.ts
  57. 1 2
      packages/@core/shared/typings/package.json
  58. 1 1
      packages/@core/shared/typings/src/helper.d.ts
  59. 1 1
      packages/@core/shared/typings/src/vue-router.d.ts
  60. 5 5
      packages/@core/ui-kit/layout-ui/src/vben-layout.ts
  61. 2 2
      packages/@core/ui-kit/layout-ui/src/vben-layout.vue
  62. 4 4
      packages/@core/ui-kit/menu-ui/src/components/menu.vue
  63. 1 1
      packages/@core/ui-kit/menu-ui/src/components/sub-menu.vue
  64. 1 1
      packages/@core/ui-kit/menu-ui/src/interface/index.ts
  65. 1 1
      packages/@core/ui-kit/shadcn-ui/package.json
  66. 1 1
      packages/@core/ui-kit/shadcn-ui/src/components/button/icon-button.vue
  67. 1 1
      packages/@core/ui-kit/shadcn-ui/src/components/hover-card/hover-card.vue
  68. 1 1
      packages/@core/ui-kit/shadcn-ui/src/components/popover/popover.vue
  69. 1 1
      packages/@core/ui-kit/shadcn-ui/src/components/segmented/tabs-indicator.vue
  70. 1 1
      packages/@core/ui-kit/shadcn-ui/src/components/ui/alert-dialog/AlertDialogAction.vue
  71. 1 1
      packages/@core/ui-kit/shadcn-ui/src/components/ui/alert-dialog/AlertDialogCancel.vue
  72. 1 1
      packages/@core/ui-kit/shadcn-ui/src/components/ui/alert-dialog/AlertDialogContent.vue
  73. 1 1
      packages/@core/ui-kit/shadcn-ui/src/components/ui/alert-dialog/AlertDialogDescription.vue
  74. 1 1
      packages/@core/ui-kit/shadcn-ui/src/components/ui/alert-dialog/AlertDialogTitle.vue
  75. 1 1
      packages/@core/ui-kit/shadcn-ui/src/components/ui/avatar/Avatar.vue
  76. 1 1
      packages/@core/ui-kit/shadcn-ui/src/components/ui/avatar/avatar.ts
  77. 1 1
      packages/@core/ui-kit/shadcn-ui/src/components/ui/avatar/index.ts
  78. 1 1
      packages/@core/ui-kit/shadcn-ui/src/components/ui/badge/badge.ts
  79. 2 2
      packages/@core/ui-kit/shadcn-ui/src/components/ui/badge/index.ts
  80. 1 1
      packages/@core/ui-kit/shadcn-ui/src/components/ui/button/button.ts
  81. 2 2
      packages/@core/ui-kit/shadcn-ui/src/components/ui/button/index.ts
  82. 1 1
      packages/@core/ui-kit/shadcn-ui/src/components/ui/checkbox/Checkbox.vue
  83. 1 1
      packages/@core/ui-kit/shadcn-ui/src/components/ui/context-menu/ContextMenuCheckboxItem.vue
  84. 1 1
      packages/@core/ui-kit/shadcn-ui/src/components/ui/context-menu/ContextMenuContent.vue
  85. 1 1
      packages/@core/ui-kit/shadcn-ui/src/components/ui/context-menu/ContextMenuItem.vue
  86. 1 1
      packages/@core/ui-kit/shadcn-ui/src/components/ui/context-menu/ContextMenuLabel.vue
  87. 1 1
      packages/@core/ui-kit/shadcn-ui/src/components/ui/context-menu/ContextMenuRadioItem.vue
  88. 1 1
      packages/@core/ui-kit/shadcn-ui/src/components/ui/context-menu/ContextMenuSeparator.vue
  89. 1 1
      packages/@core/ui-kit/shadcn-ui/src/components/ui/context-menu/ContextMenuSubContent.vue
  90. 1 1
      packages/@core/ui-kit/shadcn-ui/src/components/ui/context-menu/ContextMenuSubTrigger.vue
  91. 1 1
      packages/@core/ui-kit/shadcn-ui/src/components/ui/dialog/DialogContent.vue
  92. 1 1
      packages/@core/ui-kit/shadcn-ui/src/components/ui/dialog/DialogDescription.vue
  93. 1 1
      packages/@core/ui-kit/shadcn-ui/src/components/ui/dialog/DialogScrollContent.vue
  94. 1 1
      packages/@core/ui-kit/shadcn-ui/src/components/ui/dialog/DialogTitle.vue
  95. 1 1
      packages/@core/ui-kit/shadcn-ui/src/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue
  96. 1 1
      packages/@core/ui-kit/shadcn-ui/src/components/ui/dropdown-menu/DropdownMenuContent.vue
  97. 1 1
      packages/@core/ui-kit/shadcn-ui/src/components/ui/dropdown-menu/DropdownMenuItem.vue
  98. 1 1
      packages/@core/ui-kit/shadcn-ui/src/components/ui/dropdown-menu/DropdownMenuLabel.vue
  99. 1 1
      packages/@core/ui-kit/shadcn-ui/src/components/ui/dropdown-menu/DropdownMenuRadioItem.vue
  100. 1 1
      packages/@core/ui-kit/shadcn-ui/src/components/ui/dropdown-menu/DropdownMenuSeparator.vue

+ 2 - 2
.vscode/settings.json

@@ -165,11 +165,11 @@
   },
 
   "cssVariables.lookupFiles": [
-    "packages/@vben-core/shared/design-tokens/src/**/*.css"
+    "packages/@vben-core/shared/design/src/**/*.css"
   ],
 
   "i18n-ally.localesPaths": [
-    "packages/@core/locales/src/langs",
+    "packages/locales/src/langs",
     "apps/*/src/locales/langs"
   ],
   "i18n-ally.enabledParsers": ["json", "ts", "js", "yaml"],

+ 4 - 5
apps/web-antd/package.json

@@ -26,11 +26,6 @@
     "#/*": "./src/*"
   },
   "dependencies": {
-    "@vben-core/helpers": "workspace:*",
-    "@vben-core/locales": "workspace:*",
-    "@vben-core/preferences": "workspace:*",
-    "@vben-core/request": "workspace:*",
-    "@vben-core/stores": "workspace:*",
     "@vben/access": "workspace:*",
     "@vben/chart-ui": "workspace:*",
     "@vben/common-ui": "workspace:*",
@@ -38,6 +33,10 @@
     "@vben/hooks": "workspace:*",
     "@vben/icons": "workspace:*",
     "@vben/layouts": "workspace:*",
+    "@vben/locales": "workspace:*",
+    "@vben/preferences": "workspace:*",
+    "@vben/request": "workspace:*",
+    "@vben/stores": "workspace:*",
     "@vben/styles": "workspace:*",
     "@vben/types": "workspace:*",
     "@vben/utils": "workspace:*",

+ 1 - 1
apps/web-antd/src/apis/core/auth.ts

@@ -1,6 +1,6 @@
 import type { UserApi } from '../types';
 
-import { requestClient } from '#/forward';
+import { requestClient } from '#/apis/request';
 
 /**
  * 登录

+ 1 - 1
apps/web-antd/src/apis/core/menu.ts

@@ -1,6 +1,6 @@
 import type { RouteRecordStringComponent } from '@vben/types';
 
-import { requestClient } from '#/forward';
+import { requestClient } from '#/apis/request';
 
 /**
  * 获取用户所有菜单

+ 1 - 1
apps/web-antd/src/apis/core/user.ts

@@ -1,6 +1,6 @@
 import type { UserInfo } from '@vben/types';
 
-import { requestClient } from '#/forward';
+import { requestClient } from '#/apis/request';
 
 /**
  * 获取用户信息

+ 1 - 1
apps/web-antd/src/apis/demos/status.ts

@@ -1,4 +1,4 @@
-import { requestClient } from '#/forward';
+import { requestClient } from '#/apis/request';
 
 /**
  * 模拟任意状态码

+ 3 - 3
apps/web-antd/src/forward/request.ts → apps/web-antd/src/apis/request.ts

@@ -1,10 +1,10 @@
 /**
  * 该文件可自行根据业务逻辑进行调整
  */
-import type { HttpResponse } from '@vben-core/request';
+import type { HttpResponse } from '@vben/request';
 
-import { preferences } from '@vben-core/preferences';
-import { RequestClient } from '@vben-core/request';
+import { preferences } from '@vben/preferences';
+import { RequestClient } from '@vben/request';
 
 import { message } from 'ant-design-vue';
 

+ 1 - 1
apps/web-antd/src/app.vue

@@ -2,7 +2,7 @@
 import { computed } from 'vue';
 
 import { GlobalProvider } from '@vben/common-ui';
-import { preferences, usePreferences } from '@vben-core/preferences';
+import { preferences, usePreferences } from '@vben/preferences';
 
 import { App, ConfigProvider, theme } from 'ant-design-vue';
 

+ 1 - 1
apps/web-antd/src/bootstrap.ts

@@ -1,8 +1,8 @@
 import { createApp } from 'vue';
 
+import { preferences } from '@vben/preferences';
 import '@vben/styles';
 import '@vben/styles/antd';
-import { preferences } from '@vben-core/preferences';
 
 import { loadMessages, setupI18n } from '#/locales';
 import { setupStore } from '#/store';

+ 0 - 11
apps/web-antd/src/forward/README.md

@@ -1,11 +0,0 @@
-# forward
-
-用于扩展、转发大仓的包以及其他功能,方便在app内自定义不同的逻辑
-
-## request
-
-用于扩展请求的功能,例如添加header、错误响应等
-
-## locale
-
-用于扩展国际化的功能,例如扩展 dayjs、antd组件库的多语言切换

+ 0 - 2
apps/web-antd/src/forward/index.ts

@@ -1,2 +0,0 @@
-export * from './access';
-export * from './request';

+ 4 - 18
apps/web-antd/src/layouts/basic.vue

@@ -12,12 +12,12 @@ import {
   NotificationItem,
   UserDropdown,
 } from '@vben/layouts';
+import { preferences } from '@vben/preferences';
 import { openWindow } from '@vben/utils';
-import { preferences } from '@vben-core/preferences';
 
 import { $t } from '#/locales';
 import { resetRoutes } from '#/router';
-import { storeToRefs, useAccessStore, useAppStore } from '#/store';
+import { resetAllStores, storeToRefs, useAccessStore } from '#/store';
 
 const notifications = ref<NotificationItem[]>([
   {
@@ -84,10 +84,8 @@ const menus = computed(() => [
   },
 ]);
 
-const appStore = useAppStore();
 const accessStore = useAccessStore();
 
-const { isLockScreen, lockScreenPassword } = storeToRefs(appStore);
 const {
   loading: loginLoading,
   openLoginExpiredModal,
@@ -101,8 +99,7 @@ const avatar = computed(() => {
 const router = useRouter();
 
 async function handleLogout() {
-  appStore.resetAppState();
-  appStore.unlockScreen();
+  resetAllStores();
   resetRoutes();
   await router.replace(LOGIN_PATH);
 }
@@ -114,10 +111,6 @@ function handleNoticeClear() {
 function handleMakeAll() {
   notifications.value.forEach((item) => (item.isRead = true));
 }
-
-function handleLockScreen(password: string) {
-  appStore.lockScreen(password);
-}
 </script>
 
 <template>
@@ -129,7 +122,6 @@ function handleLockScreen(password: string) {
         :text="userInfo?.realName"
         description="ann.vben@gmail.com"
         tag-text="Pro"
-        @lock-screen="handleLockScreen"
         @logout="handleLogout"
       />
     </template>
@@ -152,13 +144,7 @@ function handleLockScreen(password: string) {
       />
     </template>
     <template #lock-screen>
-      <LockScreen
-        v-if="isLockScreen"
-        :avatar
-        :cached-password="lockScreenPassword"
-        @to-login="handleLogout"
-        @unlock="appStore.unlockScreen"
-      />
+      <LockScreen :avatar @to-login="handleLogout" />
     </template>
   </BasicLayout>
 </template>

+ 1 - 1
apps/web-antd/src/locales/index.ts

@@ -3,7 +3,7 @@ import type { Locale } from 'ant-design-vue/es/locale';
 
 import { ref } from 'vue';
 
-import { $t, loadLocalesMap, setupI18n } from '@vben-core/locales';
+import { $t, loadLocalesMap, setupI18n } from '@vben/locales';
 
 import antdEnLocale from 'ant-design-vue/es/locale/en_US';
 import antdDefaultLocale from 'ant-design-vue/es/locale/zh_CN';

+ 2 - 2
apps/web-antd/src/main.ts

@@ -1,4 +1,4 @@
-import { preferencesManager } from '@vben-core/preferences';
+import { initPreferences } from '@vben/preferences';
 
 import { overridesPreferences } from './preferences';
 
@@ -12,7 +12,7 @@ async function initApplication() {
   const namespace = `${import.meta.env.VITE_APP_NAMESPACE}-${env}`;
 
   // app偏好设置初始化
-  await preferencesManager.initPreferences({
+  await initPreferences({
     namespace,
     overrides: overridesPreferences,
   });

+ 1 - 1
apps/web-antd/src/preferences.ts

@@ -1,4 +1,4 @@
-import { defineOverridesPreferences } from '@vben-core/preferences';
+import { defineOverridesPreferences } from '@vben/preferences';
 
 /**
  * @description 项目配置文件

+ 1 - 1
apps/web-antd/src/forward/access.ts → apps/web-antd/src/router/access.ts

@@ -4,7 +4,7 @@ import type {
 } from '@vben/types';
 
 import { generateAccessible } from '@vben/access';
-import { preferences } from '@vben-core/preferences';
+import { preferences } from '@vben/preferences';
 
 import { message } from 'ant-design-vue';
 

+ 3 - 2
apps/web-antd/src/router/guard.ts

@@ -1,16 +1,17 @@
 import type { Router } from 'vue-router';
 
 import { LOGIN_PATH } from '@vben/constants';
+import { preferences } from '@vben/preferences';
 import { startProgress, stopProgress } from '@vben/utils';
-import { preferences } from '@vben-core/preferences';
 
 import { useTitle } from '@vueuse/core';
 
-import { generateAccess } from '#/forward';
 import { $t } from '#/locales';
 import { coreRouteNames, dynamicRoutes } from '#/router/routes';
 import { useAccessStore } from '#/store';
 
+import { generateAccess } from './access';
+
 /**
  * 通用守卫配置
  * @param router

+ 1 - 2
apps/web-antd/src/router/routes/index.ts

@@ -1,7 +1,6 @@
 import type { RouteRecordRaw } from 'vue-router';
 
-import { traverseTreeValues } from '@vben/utils';
-import { mergeRouteModules } from '@vben-core/helpers';
+import { mergeRouteModules, traverseTreeValues } from '@vben/utils';
 
 import { coreRoutes, fallbackNotFoundRoute } from './core';
 

+ 3 - 4
apps/web-antd/src/store/index.ts

@@ -1,8 +1,8 @@
-import type { InitStoreOptions } from '@vben-core/stores';
+import type { InitStoreOptions } from '@vben/stores';
 
 import type { App } from 'vue';
 
-import { initStore, storeToRefs } from '@vben-core/stores';
+import { initStore, resetAllStores, storeToRefs } from '@vben/stores';
 
 /**
  * @zh_CN 初始化pinia
@@ -13,7 +13,6 @@ async function setupStore(app: App, options: InitStoreOptions) {
   app.use(pinia);
 }
 
-export { setupStore, storeToRefs };
+export { resetAllStores, setupStore, storeToRefs };
 
 export { useAccessStore } from './modules/access';
-export { useAppStore } from './modules/app';

+ 8 - 7
apps/web-antd/src/store/modules/access.ts

@@ -6,7 +6,7 @@ import { computed, ref } from 'vue';
 import { useRouter } from 'vue-router';
 
 import { DEFAULT_HOME_PATH, LOGIN_PATH } from '@vben/constants';
-import { useCoreAccessStore } from '@vben-core/stores';
+import { resetAllStores, useCoreAccessStore } from '@vben/stores';
 
 import { notification } from 'ant-design-vue';
 import { defineStore } from 'pinia';
@@ -50,7 +50,7 @@ export const useAccessStore = defineStore('access', () => {
     onSuccess?: () => Promise<void> | void,
   ) {
     // 异步处理用户登录操作并获取 accessToken
-    let userInfo: UserInfo | null = null;
+    let userInfo: null | UserInfo = null;
     try {
       loading.value = true;
       const { accessToken, refreshToken } = await login(params);
@@ -102,7 +102,7 @@ export const useAccessStore = defineStore('access', () => {
   }
 
   async function logout() {
-    coreStoreAccess.$reset();
+    resetAllStores();
     openLoginExpiredModal.value = false;
 
     // 回登陆页带上当前路由地址
@@ -115,17 +115,19 @@ export const useAccessStore = defineStore('access', () => {
   }
 
   async function fetchUserInfo() {
-    let userInfo: UserInfo | null = null;
+    let userInfo: null | UserInfo = null;
     userInfo = await getUserInfo();
     coreStoreAccess.setUserInfo(userInfo);
     return userInfo;
   }
 
-  function reset() {
-    coreStoreAccess.$reset();
+  function $reset() {
+    loading.value = false;
+    openLoginExpiredModal.value = false;
   }
 
   return {
+    $reset,
     accessRoutes,
     accessToken,
     authLogin,
@@ -134,7 +136,6 @@ export const useAccessStore = defineStore('access', () => {
     logout,
     openLoginExpiredModal,
     refreshToken,
-    reset,
     setAccessMenus,
     setAccessRoutes,
     setAccessToken,

+ 6 - 1
apps/web-antd/src/views/_core/authentication/code-login.vue

@@ -4,6 +4,7 @@ import type { LoginCodeParams } from '@vben/common-ui';
 import { ref } from 'vue';
 
 import { AuthenticationCodeLogin } from '@vben/common-ui';
+import { LOGIN_PATH } from '@vben/constants';
 
 defineOptions({ name: 'CodeLogin' });
 
@@ -21,5 +22,9 @@ async function handleLogin(values: LoginCodeParams) {
 </script>
 
 <template>
-  <AuthenticationCodeLogin :loading="loading" @submit="handleLogin" />
+  <AuthenticationCodeLogin
+    :loading="loading"
+    :login-path="LOGIN_PATH"
+    @submit="handleLogin"
+  />
 </template>

+ 6 - 1
apps/web-antd/src/views/_core/authentication/forget-password.vue

@@ -2,6 +2,7 @@
 import { ref } from 'vue';
 
 import { AuthenticationForgetPassword } from '@vben/common-ui';
+import { LOGIN_PATH } from '@vben/constants';
 
 defineOptions({ name: 'ForgetPassword' });
 
@@ -14,5 +15,9 @@ function handleSubmit(value: string) {
 </script>
 
 <template>
-  <AuthenticationForgetPassword :loading="loading" @submit="handleSubmit" />
+  <AuthenticationForgetPassword
+    :loading="loading"
+    :login-path="LOGIN_PATH"
+    @submit="handleSubmit"
+  />
 </template>

+ 2 - 1
apps/web-antd/src/views/_core/authentication/qrcode-login.vue

@@ -1,9 +1,10 @@
 <script lang="ts" setup>
 import { AuthenticationQrCodeLogin } from '@vben/common-ui';
+import { LOGIN_PATH } from '@vben/constants';
 
 defineOptions({ name: 'QrCodeLogin' });
 </script>
 
 <template>
-  <AuthenticationQrCodeLogin />
+  <AuthenticationQrCodeLogin :login-path="LOGIN_PATH" />
 </template>

+ 6 - 1
apps/web-antd/src/views/_core/authentication/register.vue

@@ -4,6 +4,7 @@ import type { LoginAndRegisterParams } from '@vben/common-ui';
 import { ref } from 'vue';
 
 import { AuthenticationRegister } from '@vben/common-ui';
+import { LOGIN_PATH } from '@vben/constants';
 
 defineOptions({ name: 'Register' });
 
@@ -16,5 +17,9 @@ function handleSubmit(value: LoginAndRegisterParams) {
 </script>
 
 <template>
-  <AuthenticationRegister :loading="loading" @submit="handleSubmit" />
+  <AuthenticationRegister
+    :loading="loading"
+    :login-path="LOGIN_PATH"
+    @submit="handleSubmit"
+  />
 </template>

+ 1 - 1
apps/web-antd/src/views/dashboard/workspace/index.vue

@@ -16,7 +16,7 @@ import {
   WorkbenchTodo,
   WorkbenchTrends,
 } from '@vben/common-ui';
-import { preferences } from '@vben-core/preferences';
+import { preferences } from '@vben/preferences';
 
 import { useAccessStore } from '#/store';
 

+ 2 - 3
apps/web-antd/src/views/demos/access/button-control.vue

@@ -7,7 +7,7 @@ import { AccessControl, useAccess } from '@vben/access';
 
 import { Button } from 'ant-design-vue';
 
-import { useAccessStore, useAppStore } from '#/store';
+import { resetAllStores, useAccessStore } from '#/store';
 
 defineOptions({ name: 'AccessButtonControl' });
 
@@ -28,7 +28,6 @@ const accounts: Record<string, LoginAndRegisterParams> = {
 
 const { accessMode, hasAccessByCodes } = useAccess();
 const accessStore = useAccessStore();
-const appStore = useAppStore();
 const router = useRouter();
 
 function roleButtonType(role: string) {
@@ -41,7 +40,7 @@ async function changeAccount(role: string) {
   }
 
   const account = accounts[role];
-  appStore.resetAppState();
+  resetAllStores();
   await accessStore.authLogin(account, async () => {
     router.go(0);
   });

+ 4 - 4
apps/web-antd/src/views/demos/access/index.vue

@@ -7,7 +7,7 @@ import { useAccess } from '@vben/access';
 
 import { Button } from 'ant-design-vue';
 
-import { useAccessStore, useAppStore } from '#/store';
+import { resetAllStores, useAccessStore } from '#/store';
 
 defineOptions({ name: 'Access' });
 
@@ -28,7 +28,6 @@ const accounts: Record<string, LoginAndRegisterParams> = {
 
 const { accessMode, toggleAccessMode } = useAccess();
 const accessStore = useAccessStore();
-const appStore = useAppStore();
 const router = useRouter();
 
 function roleButtonType(role: string) {
@@ -41,7 +40,7 @@ async function changeAccount(role: string) {
   }
 
   const account = accounts[role];
-  appStore.resetAppState();
+  resetAllStores();
   await accessStore.authLogin(account, async () => {
     router.go(0);
   });
@@ -49,7 +48,8 @@ async function changeAccount(role: string) {
 
 async function handleToggleAccessMode() {
   await toggleAccessMode();
-  appStore.resetAppState();
+  resetAllStores();
+
   await accessStore.authLogin(accounts.super, async () => {
     router.go(0);
   });

+ 1 - 1
apps/web-antd/src/views/demos/features/login-expired/index.vue

@@ -1,7 +1,7 @@
 <script lang="ts" setup>
 import type { LoginExpiredModeType } from '@vben/types';
 
-import { preferences, updatePreferences } from '@vben-core/preferences';
+import { preferences, updatePreferences } from '@vben/preferences';
 
 import { Button } from 'ant-design-vue';
 

+ 6 - 6
internal/lint-configs/eslint-config/package.json

@@ -32,22 +32,22 @@
   },
   "devDependencies": {
     "@eslint/js": "^9.7.0",
-    "@types/eslint": "^8.56.10",
-    "@typescript-eslint/eslint-plugin": "^7.16.1",
-    "@typescript-eslint/parser": "^7.16.1",
+    "@types/eslint": "^9.6.0",
+    "@typescript-eslint/eslint-plugin": "^7.17.0",
+    "@typescript-eslint/parser": "^7.17.0",
     "eslint": "^8.57.0",
     "eslint-config-prettier": "^9.1.0",
     "eslint-plugin-eslint-comments": "^3.2.0",
     "eslint-plugin-i": "^2.29.1",
-    "eslint-plugin-jsdoc": "^48.8.1",
+    "eslint-plugin-jsdoc": "^48.8.3",
     "eslint-plugin-jsonc": "^2.16.0",
     "eslint-plugin-n": "^17.9.0",
     "eslint-plugin-no-only-tests": "^3.1.0",
-    "eslint-plugin-perfectionist": "^2.11.0",
+    "eslint-plugin-perfectionist": "^3.0.0",
     "eslint-plugin-prettier": "^5.2.1",
     "eslint-plugin-regexp": "^2.6.0",
     "eslint-plugin-unicorn": "^54.0.0",
-    "eslint-plugin-unused-imports": "^4.0.0",
+    "eslint-plugin-unused-imports": "^4.0.1",
     "eslint-plugin-vitest": "^0.5.4",
     "eslint-plugin-vue": "^9.27.0",
     "globals": "^15.8.0",

+ 10 - 13
internal/lint-configs/eslint-config/src/configs/perfectionist.ts

@@ -1,13 +1,10 @@
 import type { Linter } from 'eslint';
 
-export async function perfectionist(): Promise<Linter.FlatConfig[]> {
-  const [perfectionistNatural] = await Promise.all([
-    // @ts-expect-error - no types
-    import('eslint-plugin-perfectionist/configs/recommended-natural'),
-  ] as const);
+import perfectionistPlugin from 'eslint-plugin-perfectionist';
 
+export async function perfectionist(): Promise<Linter.FlatConfig[]> {
   return [
-    perfectionistNatural,
+    perfectionistPlugin.configs['recommended-natural'],
     {
       rules: {
         'perfectionist/sort-exports': [
@@ -20,7 +17,7 @@ export async function perfectionist(): Promise<Linter.FlatConfig[]> {
         'perfectionist/sort-imports': [
           'error',
           {
-            'custom-groups': {
+            customGroups: {
               type: {
                 vben: 'vben',
                 vue: 'vue',
@@ -46,8 +43,8 @@ export async function perfectionist(): Promise<Linter.FlatConfig[]> {
               'object',
               'unknown',
             ],
-            'internal-pattern': ['#*', '#*/**'],
-            'newlines-between': 'always',
+            internalPattern: ['#*', '#*/**'],
+            newlinesBetween: 'always',
             order: 'asc',
             type: 'natural',
           },
@@ -62,15 +59,15 @@ export async function perfectionist(): Promise<Linter.FlatConfig[]> {
         'perfectionist/sort-objects': [
           'error',
           {
-            'custom-groups': {
+            customGroups: {
               items: 'items',
               list: 'list',
               children: 'children',
             },
             groups: ['unknown', 'items', 'list', 'children'],
-            'ignore-pattern': ['children'],
+            ignorePattern: ['children'],
             order: 'asc',
-            'partition-by-comment': 'Part:**',
+            partitionByComment: 'Part:**',
             type: 'natural',
           },
         ],
@@ -78,7 +75,7 @@ export async function perfectionist(): Promise<Linter.FlatConfig[]> {
           'error',
           {
             // Based on: https://vuejs.org/style-guide/rules-recommended.html#element-attribute-order
-            'custom-groups': {
+            customGroups: {
               /* eslint-disable perfectionist/sort-objects */
               DEFINITION: '*(is|:is|v-is)',
               LIST_RENDERING: 'v-for',

+ 1 - 2
internal/tailwind-config/package.json

@@ -12,7 +12,6 @@
   "license": "MIT",
   "type": "module",
   "scripts": {
-    "build": "pnpm unbuild",
     "stub": "pnpm unbuild --stub"
   },
   "files": [
@@ -47,7 +46,7 @@
     "tailwindcss": "^3.4.3"
   },
   "dependencies": {
-    "@iconify/json": "^2.2.229",
+    "@iconify/json": "^2.2.230",
     "@iconify/tailwind": "^1.1.1",
     "@tailwindcss/nesting": "0.0.0-insiders.565cd3e",
     "@tailwindcss/typography": "^0.5.13",

+ 3 - 3
internal/tailwind-config/src/index.ts

@@ -30,8 +30,8 @@ const shadcnUiColors = {
     hover: 'hsl(var(--accent-hover))',
   },
   background: {
-    DEFAULT: 'hsl(var(--background))',
     deep: 'hsl(var(--background-deep))',
+    DEFAULT: 'hsl(var(--background))',
   },
   border: {
     DEFAULT: 'hsl(var(--border))',
@@ -50,8 +50,8 @@ const shadcnUiColors = {
   },
 
   input: {
-    DEFAULT: 'hsl(var(--input))',
     background: 'hsl(var(--input-background))',
+    DEFAULT: 'hsl(var(--input))',
   },
   muted: {
     DEFAULT: 'hsl(var(--muted))',
@@ -95,8 +95,8 @@ const customColors = {
     foreground: 'hsl(var(--destructive-foreground))',
   },
   sidebar: {
-    DEFAULT: 'hsl(var(--sidebar))',
     deep: 'hsl(var(--sidebar-deep))',
+    DEFAULT: 'hsl(var(--sidebar))',
   },
   success: {
     ...createColorsPalette('success'),

+ 2 - 2
internal/vite-config/src/typing.ts

@@ -70,7 +70,7 @@ interface CommonPluginOptions {
   /** 构建模式 */
   mode?: string;
   /** 开启依赖分析 */
-  visualizer?: PluginVisualizerOptions | boolean;
+  visualizer?: boolean | PluginVisualizerOptions;
 }
 
 interface ApplicationPluginOptions extends CommonPluginOptions {
@@ -110,7 +110,7 @@ interface ApplicationPluginOptions extends CommonPluginOptions {
 
 interface LibraryPluginOptions extends CommonPluginOptions {
   /** 开启 dts 输出 */
-  dts?: PluginOptions | boolean;
+  dts?: boolean | PluginOptions;
 
   /** 是否注入lib css */
   injectLibCss?: boolean;

+ 6 - 6
package.json

@@ -66,23 +66,23 @@
     "@vben/vsh": "workspace:*",
     "@vue/test-utils": "^2.4.6",
     "cross-env": "^7.0.3",
-    "cspell": "^8.11.0",
+    "cspell": "^8.12.1",
     "husky": "^9.1.1",
     "is-ci": "^3.0.1",
-    "jsdom": "^24.1.0",
+    "jsdom": "^24.1.1",
     "rimraf": "^6.0.1",
     "turbo": "^2.0.9",
-    "typescript": "^5.5.3",
+    "typescript": "^5.5.4",
     "unbuild": "^2.0.0",
     "vite": "^5.3.4",
-    "vitest": "^2.0.3",
-    "vue-tsc": "^2.0.26"
+    "vitest": "^2.0.4",
+    "vue-tsc": "^2.0.28"
   },
   "engines": {
     "node": ">=20",
     "pnpm": ">=9"
   },
-  "packageManager": "pnpm@9.5.0",
+  "packageManager": "pnpm@9.6.0",
   "pnpm": {
     "overrides": {
       "@ctrl/tinycolor": "^4.1.0",

+ 0 - 7
packages/@core/forward/README.md

@@ -1,7 +0,0 @@
-# @vben-core/forward
-
-该目录内的包,可直接被app所引用,其是项目基础功能的一层抽象。允许轻微的副作用耦合,如`locales`的集成。
-
-## 注意事项
-
-- `forward` 内的包不允许相互引用,有相互引用的情况请考虑是否放到`packages/effects`下

+ 0 - 43
packages/@core/forward/helpers/package.json

@@ -1,43 +0,0 @@
-{
-  "name": "@vben-core/helpers",
-  "version": "5.0.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/@vben-core/forward/helpers"
-  },
-  "license": "MIT",
-  "type": "module",
-  "scripts": {
-    "build": "pnpm unbuild",
-    "stub": "pnpm unbuild --stub"
-  },
-  "files": [
-    "dist"
-  ],
-  "sideEffects": false,
-  "main": "./dist/index.mjs",
-  "module": "./dist/index.mjs",
-  "exports": {
-    ".": {
-      "types": "./src/index.ts",
-      "development": "./src/index.ts",
-      "default": "./dist/index.mjs"
-    }
-  },
-  "publishConfig": {
-    "exports": {
-      ".": {
-        "types": "./dist/index.d.ts",
-        "default": "./dist/index.mjs"
-      }
-    }
-  },
-  "dependencies": {
-    "@vben-core/toolkit": "workspace:*",
-    "@vben-core/typings": "workspace:*",
-    "vue-router": "^4.4.0"
-  }
-}

+ 0 - 29
packages/@core/forward/stores/src/setup.ts

@@ -1,29 +0,0 @@
-import { createPinia } from 'pinia';
-
-interface InitStoreOptions {
-  /**
-   * @zh_CN 应用名,由于 @vben-core/stores 是公用的,后续可能有多个app,为了防止多个app缓存冲突,可在这里配置应用名,应用名将被用于持久化的前缀
-   */
-  namespace: string;
-}
-
-/**
- * @zh_CN 初始化pinia
- */
-async function initStore(options: InitStoreOptions) {
-  const { createPersistedState } = await import('pinia-plugin-persistedstate');
-  const pinia = createPinia();
-  const { namespace } = options;
-  pinia.use(
-    createPersistedState({
-      // key $appName-$store.id
-      key: (storeKey) => `${namespace}-${storeKey}`,
-      storage: localStorage,
-    }),
-  );
-  return pinia;
-}
-
-export { initStore };
-
-export type { InitStoreOptions };

+ 3 - 7
packages/@core/hooks/package.json

@@ -6,13 +6,12 @@
   "repository": {
     "type": "git",
     "url": "git+https://github.com/vbenjs/vue-vben-admin.git",
-    "directory": "packages/@vben-core/shared/hooks"
+    "directory": "packages/@core/hooks"
   },
   "license": "MIT",
   "type": "module",
   "scripts": {
-    "build": "pnpm unbuild",
-    "stub": "pnpm unbuild --stub"
+    "build": "pnpm unbuild"
   },
   "files": [
     "dist"
@@ -37,14 +36,11 @@
   },
   "dependencies": {
     "@vben-core/constants": "workspace:*",
-    "@vben-core/preferences": "workspace:*",
-    "@vben-core/stores": "workspace:*",
     "@vben-core/toolkit": "workspace:*",
     "@vueuse/core": "^10.11.0",
     "radix-vue": "^1.9.2",
     "sortablejs": "^1.15.2",
-    "vue": "^3.4.33",
-    "vue-router": "^4.4.0"
+    "vue": "^3.4.33"
   },
   "devDependencies": {
     "@types/sortablejs": "^1.15.8"

+ 0 - 3
packages/@core/hooks/src/index.ts

@@ -1,9 +1,6 @@
 export * from './use-content-height';
-export * from './use-content-maximize';
 export * from './use-namespace';
-export * from './use-refresh';
 export * from './use-sortable';
-export * from './use-tabs';
 export {
   useEmitAsProps,
   useForwardExpose,

+ 0 - 0
packages/@core/forward/helpers/build.config.ts → packages/@core/preferences/build.config.ts


+ 2 - 3
packages/@core/forward/preferences/package.json → packages/@core/preferences/package.json

@@ -6,13 +6,12 @@
   "repository": {
     "type": "git",
     "url": "git+https://github.com/vbenjs/vue-vben-admin.git",
-    "directory": "packages/@vben-core/forward/preferences"
+    "directory": "packages/@core/preferences"
   },
   "license": "MIT",
   "type": "module",
   "scripts": {
-    "build": "pnpm unbuild",
-    "stub": "pnpm unbuild --stub"
+    "build": "pnpm unbuild"
   },
   "files": [
     "dist",

+ 0 - 0
packages/@core/forward/preferences/src/config.ts → packages/@core/preferences/src/config.ts


+ 0 - 0
packages/@core/forward/preferences/src/constants.ts → packages/@core/preferences/src/constants.ts


+ 6 - 7
packages/@core/forward/preferences/src/index.ts → packages/@core/preferences/src/index.ts

@@ -1,11 +1,10 @@
-import type { DeepPartial } from '@vben-core/typings';
-
 import type { Preferences } from './types';
 
 import { preferencesManager } from './preferences';
 
 // 偏好设置(带有层级关系)
-const preferences: Preferences = preferencesManager.getPreferences();
+const preferences: Preferences =
+  preferencesManager.getPreferences.apply(preferencesManager);
 
 // 更新偏好设置
 const updatePreferences =
@@ -18,13 +17,13 @@ const resetPreferences =
 const clearPreferencesCache =
   preferencesManager.clearCache.bind(preferencesManager);
 
-function defineOverridesPreferences(preferences: DeepPartial<Preferences>) {
-  return preferences;
-}
+// 初始化偏好设置
+const initPreferences =
+  preferencesManager.initPreferences.bind(preferencesManager);
 
 export {
   clearPreferencesCache,
-  defineOverridesPreferences,
+  initPreferences,
   preferences,
   preferencesManager,
   resetPreferences,

+ 1 - 1
packages/@core/forward/preferences/src/preferences.test.ts → packages/@core/preferences/src/preferences.test.ts

@@ -1,7 +1,7 @@
 import { beforeEach, describe, expect, it, vi } from 'vitest';
 
 import { defaultPreferences } from './config';
-import { PreferenceManager, isDarkTheme } from './preferences';
+import { isDarkTheme, PreferenceManager } from './preferences';
 
 describe('preferences', () => {
   let preferenceManager: PreferenceManager;

+ 5 - 10
packages/@core/forward/preferences/src/preferences.ts → packages/@core/preferences/src/preferences.ts

@@ -1,10 +1,10 @@
 import type { DeepPartial } from '@vben-core/typings';
 
-import type { Preferences } from './types';
+import type { InitialOptions, Preferences } from './types';
 
 import { markRaw, reactive, readonly, watch } from 'vue';
 
-import { StorageManager, isMacOs, merge } from '@vben-core/toolkit';
+import { isMacOs, merge, StorageManager } from '@vben-core/toolkit';
 
 import {
   breakpointsTailwind,
@@ -19,11 +19,6 @@ const STORAGE_KEY = 'preferences';
 const STORAGE_KEY_LOCALE = `${STORAGE_KEY}-locale`;
 const STORAGE_KEY_THEME = `${STORAGE_KEY}-theme`;
 
-interface initialOptions {
-  namespace: string;
-  overrides?: DeepPartial<Preferences>;
-}
-
 function isDarkTheme(theme: string) {
   let dark = theme === 'dark';
   if (theme === 'auto') {
@@ -33,7 +28,7 @@ function isDarkTheme(theme: string) {
 }
 
 class PreferenceManager {
-  private cache: StorageManager | null = null;
+  private cache: null | StorageManager = null;
   // private flattenedState: Flatten<Preferences>;
   private initialPreferences: Preferences = defaultPreferences;
   private isInitialized: boolean = false;
@@ -171,7 +166,7 @@ class PreferenceManager {
    * overrides  要覆盖的偏好设置
    * namespace  命名空间
    */
-  public async initPreferences({ namespace, overrides }: initialOptions) {
+  public async initPreferences({ namespace, overrides }: InitialOptions) {
     // 是否初始化过
     if (this.isInitialized) {
       return;
@@ -237,4 +232,4 @@ class PreferenceManager {
 }
 
 const preferencesManager = new PreferenceManager();
-export { PreferenceManager, isDarkTheme, preferencesManager };
+export { isDarkTheme, PreferenceManager, preferencesManager };

+ 6 - 0
packages/@core/forward/preferences/src/types.ts → packages/@core/preferences/src/types.ts

@@ -4,6 +4,7 @@ import type {
   BreadcrumbStyleType,
   BuiltinThemeType,
   ContentCompactType,
+  DeepPartial,
   LayoutHeaderModeType,
   LayoutType,
   LoginExpiredModeType,
@@ -232,11 +233,16 @@ interface Preferences {
 
 type PreferencesKeys = keyof Preferences;
 
+interface InitialOptions {
+  namespace: string;
+  overrides?: DeepPartial<Preferences>;
+}
 export type {
   AppPreferences,
   BreadcrumbPreferences,
   FooterPreferences,
   HeaderPreferences,
+  InitialOptions,
   LogoPreferences,
   NavigationPreferences,
   Preferences,

+ 0 - 0
packages/@core/forward/preferences/src/update-css-variables.ts → packages/@core/preferences/src/update-css-variables.ts


+ 0 - 0
packages/@core/forward/preferences/src/use-preferences.ts → packages/@core/preferences/src/use-preferences.ts


+ 0 - 0
packages/@core/forward/preferences/tsconfig.json → packages/@core/preferences/tsconfig.json


+ 1 - 2
packages/@core/shared/constants/package.json

@@ -11,8 +11,7 @@
   "license": "MIT",
   "type": "module",
   "scripts": {
-    "build": "pnpm unbuild",
-    "stub": "pnpm unbuild --stub"
+    "build": "pnpm unbuild"
   },
   "files": [
     "dist"

+ 2 - 3
packages/@core/shared/icons/package.json

@@ -11,8 +11,7 @@
   "license": "MIT",
   "type": "module",
   "scripts": {
-    "build": "pnpm unbuild",
-    "stub": "pnpm unbuild --stub"
+    "build": "pnpm unbuild"
   },
   "files": [
     "dist"
@@ -36,7 +35,7 @@
   },
   "dependencies": {
     "@iconify/vue": "^4.1.2",
-    "lucide-vue-next": "^0.411.0",
+    "lucide-vue-next": "^0.414.0",
     "vue": "^3.4.33"
   }
 }

+ 1 - 2
packages/@core/shared/toolkit/package.json

@@ -11,8 +11,7 @@
   "license": "MIT",
   "type": "module",
   "scripts": {
-    "build": "pnpm unbuild",
-    "stub": "pnpm unbuild --stub"
+    "build": "pnpm unbuild"
   },
   "files": [
     "dist"

+ 1 - 1
packages/@core/shared/toolkit/src/cache/storage-manager.ts

@@ -67,7 +67,7 @@ class StorageManager {
    * @param defaultValue 当项不存在或已过期时返回的默认值
    * @returns 值,如果项已过期或解析错误则返回默认值
    */
-  getItem<T>(key: string, defaultValue: T | null = null): T | null {
+  getItem<T>(key: string, defaultValue: null | T = null): null | T {
     const fullKey = this.getFullKey(key);
     const itemStr = this.storage.getItem(fullKey);
     if (!itemStr) {

+ 1 - 1
packages/@core/shared/toolkit/src/cache/types.ts

@@ -7,7 +7,7 @@ interface StorageValue<T> {
 
 interface IStorageCache {
   clear(): void;
-  getItem<T>(key: string): T | null;
+  getItem<T>(key: string): null | T;
   key(index: number): null | string;
   length(): number;
   removeItem(key: string): void;

+ 1 - 1
packages/@core/shared/toolkit/src/colorful/convert.ts

@@ -41,4 +41,4 @@ function isValidColor(color?: string) {
   return new TinyColor(color).isValid;
 }
 
-export { TinyColor, convertToHsl, convertToHslCssVar, isValidColor };
+export { convertToHsl, convertToHslCssVar, isValidColor, TinyColor };

+ 1 - 2
packages/@core/shared/typings/package.json

@@ -11,8 +11,7 @@
   "license": "MIT",
   "type": "module",
   "scripts": {
-    "build": "pnpm unbuild",
-    "stub": "pnpm build --stub"
+    "build": "pnpm unbuild"
   },
   "files": [
     "dist"

+ 1 - 1
packages/@core/shared/typings/src/helper.d.ts

@@ -39,7 +39,7 @@ type AnyFunction<T extends any[] = any[], R = void> =
 /**
  *  T | null 包装
  */
-type Nullable<T> = T | null;
+type Nullable<T> = null | T;
 
 /**
  * T | Not null 包装

+ 1 - 1
packages/@core/shared/typings/src/vue-router.d.ts

@@ -1,4 +1,4 @@
-import type { RouteRecordRaw, Router } from 'vue-router';
+import type { Router, RouteRecordRaw } from 'vue-router';
 
 import type { Component } from 'vue';
 

+ 5 - 5
packages/@core/ui-kit/layout-ui/src/vben-layout.ts

@@ -103,11 +103,6 @@ interface VbenLayoutProps {
    * @default sidebar-nav
    */
   layout?: LayoutType;
-  /**
-   *  侧边菜单折叠宽度
-   * @default 48
-   */
-  sideCollapseWidth?: number;
   /**
    * 侧边菜单折叠状态
    * @default false
@@ -153,6 +148,11 @@ interface VbenLayoutProps {
    * @default 210
    */
   sidebarWidth?: number;
+  /**
+   *  侧边菜单折叠宽度
+   * @default 48
+   */
+  sideCollapseWidth?: number;
   /**
    * tab是否可见
    * @default true

+ 2 - 2
packages/@core/ui-kit/layout-ui/src/vben-layout.vue

@@ -38,7 +38,6 @@ const props = withDefaults(defineProps<Props>(), {
   headerVisible: true,
   isMobile: false,
   layout: 'sidebar-nav',
-  sideCollapseWidth: 60,
   sidebarCollapseShowTitle: false,
   sidebarExtraCollapsedWidth: 60,
   sidebarHidden: false,
@@ -46,6 +45,7 @@ const props = withDefaults(defineProps<Props>(), {
   sidebarSemiDark: true,
   sidebarTheme: 'dark',
   sidebarWidth: 180,
+  sideCollapseWidth: 60,
   tabbarEnable: true,
   tabbarHeight: 36,
   zIndex: 200,
@@ -130,7 +130,7 @@ const headerWrapperHeight = computed(() => {
 });
 
 const getSideCollapseWidth = computed(() => {
-  const { sideCollapseWidth, sidebarCollapseShowTitle, sidebarMixedWidth } =
+  const { sidebarCollapseShowTitle, sidebarMixedWidth, sideCollapseWidth } =
     props;
 
   return sidebarCollapseShowTitle || isSidebarMixedNav.value

+ 4 - 4
packages/@core/ui-kit/menu-ui/src/components/menu.vue

@@ -7,13 +7,13 @@ import type {
 } from '../interface';
 
 import {
-  type VNodeArrayChildren,
   computed,
   nextTick,
   reactive,
   ref,
   toRef,
   useSlots,
+  type VNodeArrayChildren,
   watch,
   watchEffect,
 } from 'vue';
@@ -22,7 +22,7 @@ import { useNamespace } from '@vben-core/hooks';
 import { Ellipsis } from '@vben-core/icons';
 import { isHttpUrl } from '@vben-core/toolkit';
 
-import { UseResizeObserverReturn, useResizeObserver } from '@vueuse/core';
+import { useResizeObserver, UseResizeObserverReturn } from '@vueuse/core';
 
 import {
   createMenuContext,
@@ -121,8 +121,8 @@ createMenuContext(
     handleMenuItemClick,
     handleSubMenuClick,
     isMenuPopup,
-    openMenu,
     openedMenus,
+    openMenu,
     props,
     removeMenuItem,
     removeSubMenu,
@@ -176,7 +176,7 @@ function calcSliceIndex() {
 }
 
 function debounce(fn: () => void, wait = 33.34) {
-  let timer: ReturnType<typeof setTimeout> | null;
+  let timer: null | ReturnType<typeof setTimeout>;
   return () => {
     timer && clearTimeout(timer);
     timer = setTimeout(() => {

+ 1 - 1
packages/@core/ui-kit/menu-ui/src/components/sub-menu.vue

@@ -44,7 +44,7 @@ const mouseInChild = ref(false);
 
 const items = ref<MenuProvider['items']>({});
 const subMenus = ref<MenuProvider['subMenus']>({});
-const timer = ref<ReturnType<typeof setTimeout> | null>(null);
+const timer = ref<null | ReturnType<typeof setTimeout>>(null);
 
 createSubMenuContext({
   addSubMenu,

+ 1 - 1
packages/@core/ui-kit/menu-ui/src/interface/index.ts

@@ -105,8 +105,8 @@ interface MenuProvider {
   isMenuPopup: boolean;
   items: Record<string, MenuItemRegistered>;
 
-  openMenu: (path: string, parentLinks: string[]) => void;
   openedMenus: string[];
+  openMenu: (path: string, parentLinks: string[]) => void;
   props: MenuProps;
   removeMenuItem: (item: MenuItemRegistered) => void;
 

+ 1 - 1
packages/@core/ui-kit/shadcn-ui/package.json

@@ -48,7 +48,7 @@
     "@vben-core/typings": "workspace:*",
     "@vueuse/core": "^10.11.0",
     "class-variance-authority": "^0.7.0",
-    "lucide-vue-next": "^0.411.0",
+    "lucide-vue-next": "^0.414.0",
     "radix-vue": "^1.9.2",
     "vue": "^3.4.33"
   }

+ 1 - 1
packages/@core/ui-kit/shadcn-ui/src/components/button/icon-button.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import { type HTMLAttributes, computed, useSlots } from 'vue';
+import { computed, type HTMLAttributes, useSlots } from 'vue';
 
 import { VbenTooltip } from '@vben-core/shadcn-ui/components/tooltip';
 import { ButtonVariants } from '@vben-core/shadcn-ui/components/ui/button';

+ 1 - 1
packages/@core/ui-kit/shadcn-ui/src/components/hover-card/hover-card.vue

@@ -1,7 +1,7 @@
 <script setup lang="ts">
 import type { HoverCardRootEmits, HoverCardRootProps } from 'radix-vue';
 
-import { HTMLAttributes, computed } from 'vue';
+import { computed, HTMLAttributes } from 'vue';
 
 import {
   HoverCard,

+ 1 - 1
packages/@core/ui-kit/shadcn-ui/src/components/popover/popover.vue

@@ -5,7 +5,7 @@ import type {
   PopoverRootProps,
 } from 'radix-vue';
 
-import { HTMLAttributes, computed } from 'vue';
+import { computed, HTMLAttributes } from 'vue';
 
 import {
   PopoverContent,

+ 1 - 1
packages/@core/ui-kit/shadcn-ui/src/components/segmented/tabs-indicator.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import { type HTMLAttributes, computed } from 'vue';
+import { computed, type HTMLAttributes } from 'vue';
 
 import { cn } from '@vben-core/toolkit';
 

+ 1 - 1
packages/@core/ui-kit/shadcn-ui/src/components/ui/alert-dialog/AlertDialogAction.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import { type HTMLAttributes, computed } from 'vue';
+import { computed, type HTMLAttributes } from 'vue';
 
 import { buttonVariants } from '@vben-core/shadcn-ui/components/ui/button';
 import { cn } from '@vben-core/toolkit';

+ 1 - 1
packages/@core/ui-kit/shadcn-ui/src/components/ui/alert-dialog/AlertDialogCancel.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import { type HTMLAttributes, computed } from 'vue';
+import { computed, type HTMLAttributes } from 'vue';
 
 import { buttonVariants } from '@vben-core/shadcn-ui/components/ui/button';
 import { cn } from '@vben-core/toolkit';

+ 1 - 1
packages/@core/ui-kit/shadcn-ui/src/components/ui/alert-dialog/AlertDialogContent.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import { type HTMLAttributes, computed } from 'vue';
+import { computed, type HTMLAttributes } from 'vue';
 
 import { cn } from '@vben-core/toolkit';
 

+ 1 - 1
packages/@core/ui-kit/shadcn-ui/src/components/ui/alert-dialog/AlertDialogDescription.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import { type HTMLAttributes, computed } from 'vue';
+import { computed, type HTMLAttributes } from 'vue';
 
 import { cn } from '@vben-core/toolkit';
 

+ 1 - 1
packages/@core/ui-kit/shadcn-ui/src/components/ui/alert-dialog/AlertDialogTitle.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import { type HTMLAttributes, computed } from 'vue';
+import { computed, type HTMLAttributes } from 'vue';
 
 import { cn } from '@vben-core/toolkit';
 

+ 1 - 1
packages/@core/ui-kit/shadcn-ui/src/components/ui/avatar/Avatar.vue

@@ -5,7 +5,7 @@ import { cn } from '@vben-core/toolkit';
 
 import { AvatarRoot } from 'radix-vue';
 
-import { type AvatarVariants, avatarVariant } from './avatar';
+import { avatarVariant, type AvatarVariants } from './avatar';
 
 const props = withDefaults(
   defineProps<{

+ 1 - 1
packages/@core/ui-kit/shadcn-ui/src/components/ui/avatar/avatar.ts

@@ -1,4 +1,4 @@
-import { type VariantProps, cva } from 'class-variance-authority';
+import { cva, type VariantProps } from 'class-variance-authority';
 
 export const avatarVariant = cva(
   'inline-flex items-center justify-center font-normal text-foreground select-none shrink-0 bg-secondary overflow-hidden',

+ 1 - 1
packages/@core/ui-kit/shadcn-ui/src/components/ui/avatar/index.ts

@@ -1,4 +1,4 @@
+export * from './avatar';
 export { default as Avatar } from './Avatar.vue';
 export { default as AvatarFallback } from './AvatarFallback.vue';
 export { default as AvatarImage } from './AvatarImage.vue';
-export * from './avatar';

+ 1 - 1
packages/@core/ui-kit/shadcn-ui/src/components/ui/badge/badge.ts

@@ -1,4 +1,4 @@
-import { type VariantProps, cva } from 'class-variance-authority';
+import { cva, type VariantProps } from 'class-variance-authority';
 
 export const badgeVariants = cva(
   'inline-flex items-center rounded-md border border-border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',

+ 2 - 2
packages/@core/ui-kit/shadcn-ui/src/components/ui/badge/index.ts

@@ -1,3 +1,3 @@
-export { default as Badge } from './Badge.vue';
-
 export * from './badge';
+
+export { default as Badge } from './Badge.vue';

+ 1 - 1
packages/@core/ui-kit/shadcn-ui/src/components/ui/button/button.ts

@@ -1,4 +1,4 @@
-import { type VariantProps, cva } from 'class-variance-authority';
+import { cva, type VariantProps } from 'class-variance-authority';
 
 export const buttonVariants = cva(
   'inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed  disabled:opacity-50',

+ 2 - 2
packages/@core/ui-kit/shadcn-ui/src/components/ui/button/index.ts

@@ -1,3 +1,3 @@
-export { default as Button } from './Button.vue';
-
 export * from './button';
+
+export { default as Button } from './Button.vue';

+ 1 - 1
packages/@core/ui-kit/shadcn-ui/src/components/ui/checkbox/Checkbox.vue

@@ -1,7 +1,7 @@
 <script setup lang="ts">
 import type { CheckboxRootEmits, CheckboxRootProps } from 'radix-vue';
 
-import { type HTMLAttributes, computed } from 'vue';
+import { computed, type HTMLAttributes } from 'vue';
 
 import { cn } from '@vben-core/toolkit';
 

+ 1 - 1
packages/@core/ui-kit/shadcn-ui/src/components/ui/context-menu/ContextMenuCheckboxItem.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import { type HTMLAttributes, computed } from 'vue';
+import { computed, type HTMLAttributes } from 'vue';
 
 import { cn } from '@vben-core/toolkit';
 

+ 1 - 1
packages/@core/ui-kit/shadcn-ui/src/components/ui/context-menu/ContextMenuContent.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import { type HTMLAttributes, computed } from 'vue';
+import { computed, type HTMLAttributes } from 'vue';
 
 import { cn } from '@vben-core/toolkit';
 

+ 1 - 1
packages/@core/ui-kit/shadcn-ui/src/components/ui/context-menu/ContextMenuItem.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import { type HTMLAttributes, computed } from 'vue';
+import { computed, type HTMLAttributes } from 'vue';
 
 import { cn } from '@vben-core/toolkit';
 

+ 1 - 1
packages/@core/ui-kit/shadcn-ui/src/components/ui/context-menu/ContextMenuLabel.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import { type HTMLAttributes, computed } from 'vue';
+import { computed, type HTMLAttributes } from 'vue';
 
 import { cn } from '@vben-core/toolkit';
 

+ 1 - 1
packages/@core/ui-kit/shadcn-ui/src/components/ui/context-menu/ContextMenuRadioItem.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import { type HTMLAttributes, computed } from 'vue';
+import { computed, type HTMLAttributes } from 'vue';
 
 import { cn } from '@vben-core/toolkit';
 

+ 1 - 1
packages/@core/ui-kit/shadcn-ui/src/components/ui/context-menu/ContextMenuSeparator.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import { type HTMLAttributes, computed } from 'vue';
+import { computed, type HTMLAttributes } from 'vue';
 
 import { cn } from '@vben-core/toolkit';
 

+ 1 - 1
packages/@core/ui-kit/shadcn-ui/src/components/ui/context-menu/ContextMenuSubContent.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import { type HTMLAttributes, computed } from 'vue';
+import { computed, type HTMLAttributes } from 'vue';
 
 import { cn } from '@vben-core/toolkit';
 

+ 1 - 1
packages/@core/ui-kit/shadcn-ui/src/components/ui/context-menu/ContextMenuSubTrigger.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import { type HTMLAttributes, computed } from 'vue';
+import { computed, type HTMLAttributes } from 'vue';
 
 import { cn } from '@vben-core/toolkit';
 

+ 1 - 1
packages/@core/ui-kit/shadcn-ui/src/components/ui/dialog/DialogContent.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import { type HTMLAttributes, computed } from 'vue';
+import { computed, type HTMLAttributes } from 'vue';
 
 import { cn } from '@vben-core/toolkit';
 

+ 1 - 1
packages/@core/ui-kit/shadcn-ui/src/components/ui/dialog/DialogDescription.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import { type HTMLAttributes, computed } from 'vue';
+import { computed, type HTMLAttributes } from 'vue';
 
 import { cn } from '@vben-core/toolkit';
 

+ 1 - 1
packages/@core/ui-kit/shadcn-ui/src/components/ui/dialog/DialogScrollContent.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import { type HTMLAttributes, computed } from 'vue';
+import { computed, type HTMLAttributes } from 'vue';
 
 import { cn } from '@vben-core/toolkit';
 

+ 1 - 1
packages/@core/ui-kit/shadcn-ui/src/components/ui/dialog/DialogTitle.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import { type HTMLAttributes, computed } from 'vue';
+import { computed, type HTMLAttributes } from 'vue';
 
 import { cn } from '@vben-core/toolkit';
 

+ 1 - 1
packages/@core/ui-kit/shadcn-ui/src/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import { type HTMLAttributes, computed } from 'vue';
+import { computed, type HTMLAttributes } from 'vue';
 
 import { cn } from '@vben-core/toolkit';
 

+ 1 - 1
packages/@core/ui-kit/shadcn-ui/src/components/ui/dropdown-menu/DropdownMenuContent.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import { type HTMLAttributes, computed } from 'vue';
+import { computed, type HTMLAttributes } from 'vue';
 
 import { cn } from '@vben-core/toolkit';
 

+ 1 - 1
packages/@core/ui-kit/shadcn-ui/src/components/ui/dropdown-menu/DropdownMenuItem.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import { type HTMLAttributes, computed } from 'vue';
+import { computed, type HTMLAttributes } from 'vue';
 
 import { cn } from '@vben-core/toolkit';
 

+ 1 - 1
packages/@core/ui-kit/shadcn-ui/src/components/ui/dropdown-menu/DropdownMenuLabel.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import { type HTMLAttributes, computed } from 'vue';
+import { computed, type HTMLAttributes } from 'vue';
 
 import { cn } from '@vben-core/toolkit';
 

+ 1 - 1
packages/@core/ui-kit/shadcn-ui/src/components/ui/dropdown-menu/DropdownMenuRadioItem.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import { type HTMLAttributes, computed } from 'vue';
+import { computed, type HTMLAttributes } from 'vue';
 
 import { cn } from '@vben-core/toolkit';
 

+ 1 - 1
packages/@core/ui-kit/shadcn-ui/src/components/ui/dropdown-menu/DropdownMenuSeparator.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import { type HTMLAttributes, computed } from 'vue';
+import { computed, type HTMLAttributes } from 'vue';
 
 import { cn } from '@vben-core/toolkit';
 

Деякі файли не було показано, через те що забагато файлів було змінено