Browse Source

fix: Typecheck and loop dependency problem repair

vince 8 months ago
parent
commit
527023ae51

+ 0 - 4
.github/release-drafter.yml

@@ -16,13 +16,10 @@ categories:
       - "enhancement"
   - title: "🐞 Bug Fixes"
     labels:
-      - "fix"
-      - "bugfix"
       - "bug"
   - title: 📝 Documentation updates
     labels:
       - "documentation"
-      - "docs"
   - title: 👻 Maintenance
     labels:
       - "chore"
@@ -30,7 +27,6 @@ categories:
     collapse-after: 5
   - title: 🚦 Tests
     labels:
-      - "test"
       - "tests"
   - title: "Breaking"
     label: "breaking"

+ 1 - 1
.tazerc.json

@@ -1,3 +1,3 @@
 {
-  "exclude": ["zx", "eslint"]
+  "exclude": ["zx", "eslint", "eslint-plugin-unused-imports"]
 }

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

@@ -46,7 +46,7 @@
     "eslint-plugin-prettier": "^5.1.3",
     "eslint-plugin-regexp": "^2.6.0",
     "eslint-plugin-unicorn": "^54.0.0",
-    "eslint-plugin-unused-imports": "^4.0.0",
+    "eslint-plugin-unused-imports": "^3.2.0",
     "eslint-plugin-vitest": "^0.5.4",
     "eslint-plugin-vue": "^9.27.0",
     "globals": "^15.8.0",

+ 2 - 2
package.json

@@ -1,6 +1,6 @@
 {
-  "name": "vben-admin",
-  "version": "5.0.0-alpha.1",
+  "name": "vben-admin-pro",
+  "version": "5.0.0",
   "private": true,
   "keywords": [
     "monorepo",

+ 0 - 46
packages/@core/ui-kit/shadcn-ui/src/components/floating-button-group/floating-button-group.vue

@@ -1,46 +0,0 @@
-<script setup lang="ts">
-import { ref } from 'vue';
-
-const isMenuOpen = ref(false);
-const menuItems = ref(['1', '2', '3', '4']);
-
-const toggleMenu = () => {
-  isMenuOpen.value = !isMenuOpen.value;
-};
-
-const handleMenuItemClick = (_item: any) => {
-  // console.log(111, item);
-};
-</script>
-
-<template>
-  <div class="fixed bottom-5 right-5 flex flex-col-reverse items-center gap-2">
-    <button
-      :class="{ 'rotate-45': isMenuOpen }"
-      class="flex h-12 w-12 items-center justify-center rounded-full bg-blue-500 text-xl text-white transition-transform duration-300"
-      @click="toggleMenu"
-    >
-      ✖
-    </button>
-    <div
-      :class="{
-        'visible translate-y-0 opacity-100': isMenuOpen,
-        'invisible translate-y-2 opacity-0': !isMenuOpen,
-      }"
-      class="absolute bottom-16 right-0 flex flex-col-reverse gap-2 transition-all duration-300"
-    >
-      <button
-        v-for="(item, index) in menuItems"
-        :key="index"
-        class="flex h-12 w-12 items-center justify-center rounded-full bg-blue-500 text-xl text-white"
-        @click="handleMenuItemClick(item)"
-      >
-        {{ item }}
-      </button>
-    </div>
-  </div>
-</template>
-
-<style scoped>
-/* 可以在这里添加任何需要的额外样式 */
-</style>

+ 0 - 1
packages/@core/ui-kit/shadcn-ui/src/components/floating-button-group/index.ts

@@ -1 +0,0 @@
-export { default as VbenFloatingButtonGroup } from './floating-button-group.vue';

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

@@ -8,7 +8,6 @@ export * from './checkbox';
 export * from './context-menu';
 export * from './count-to-animator';
 export * from './dropdown-menu';
-export * from './floating-button-group';
 export * from './full-screen';
 export * from './hover-card';
 export * from './icon';

+ 2 - 1
packages/@core/ui-kit/shadcn-ui/src/components/ui/select/SelectContent.vue

@@ -12,7 +12,8 @@ import {
   useForwardPropsEmits,
 } from 'radix-vue';
 
-import { SelectScrollDownButton, SelectScrollUpButton } from '.';
+import SelectScrollDownButton from './SelectScrollDownButton.vue';
+import SelectScrollUpButton from './SelectScrollUpButton.vue';
 
 defineOptions({
   inheritAttrs: false,

+ 1 - 1
packages/business/access/src/generate-menu-and-routes/generate-routes-backend.ts

@@ -15,7 +15,7 @@ import { mapTree } from '@vben-core/toolkit';
 async function generateRoutesByBackend(
   options: GeneratorMenuAndRoutesOptions,
 ): Promise<RouteRecordRaw[]> {
-  const { fetchMenuListAsync, layoutMap, pageMap } = options;
+  const { fetchMenuListAsync, layoutMap = {}, pageMap = {} } = options;
 
   try {
     const menuRoutes = await fetchMenuListAsync?.();

+ 0 - 1
packages/business/layouts/package.json

@@ -46,7 +46,6 @@
     "@vben-core/stores": "workspace:*",
     "@vben-core/tabs-ui": "workspace:*",
     "@vben-core/toolkit": "workspace:*",
-    "@vben/constants": "workspace:*",
     "@vben/locales": "workspace:*",
     "@vben/widgets": "workspace:*",
     "vue": "^3.4.31",

+ 0 - 1
packages/business/layouts/src/basic/layout.vue

@@ -152,7 +152,6 @@ function toggleSidebar() {
 
     <template #floating-groups>
       <VbenBackTop />
-      <!-- <VbenFloatingButtonGroup /> -->
     </template>
 
     <!-- logo -->

+ 3 - 6
packages/business/layouts/src/basic/tabbar/use-tabs.ts

@@ -2,7 +2,7 @@ import type { IContextMenuItem } from '@vben-core/tabs-ui';
 import type { TabItem } from '@vben-core/typings';
 import type {
   RouteLocationNormalized,
-  RouteRecordNormalized,
+  RouteLocationNormalizedGeneric,
 } from 'vue-router';
 
 import { computed, ref, watch } from 'vue';
@@ -34,8 +34,7 @@ function useTabs() {
   });
 
   const { locale } = useI18n();
-  const currentTabs =
-    ref<(RouteLocationNormalized | RouteRecordNormalized)[]>();
+  const currentTabs = ref<RouteLocationNormalizedGeneric[]>();
   watch([() => tabsStore.getTabs, () => locale.value], ([tabs, _]) => {
     currentTabs.value = tabs.map((item) => wrapperTabLocale(item));
   });
@@ -60,9 +59,7 @@ function useTabs() {
     await tabsStore.closeTabByKey(key, router);
   };
 
-  function wrapperTabLocale(
-    tab: RouteLocationNormalized | RouteRecordNormalized,
-  ) {
+  function wrapperTabLocale(tab: RouteLocationNormalizedGeneric) {
     return {
       ...tab,
       meta: {

+ 0 - 2
packages/business/universal-ui/package.json

@@ -42,9 +42,7 @@
   "dependencies": {
     "@vben-core/design": "workspace:*",
     "@vben-core/iconify": "workspace:*",
-    "@vben-core/preferences": "workspace:*",
     "@vben-core/shadcn-ui": "workspace:*",
-    "@vben/chart-ui": "workspace:*",
     "@vben/locales": "workspace:*",
     "@vben/types": "workspace:*",
     "@vueuse/integrations": "^10.11.0",

+ 1 - 1
packages/business/universal-ui/tsconfig.json

@@ -2,7 +2,7 @@
   "$schema": "https://json.schemastore.org/tsconfig",
   "extends": "@vben/tsconfig/web.json",
   "compilerOptions": {
-    "types": ["@vben/types/window"]
+    "types": ["@vben/types/global"]
   },
   "include": ["src"],
   "exclude": ["node_modules"]

+ 0 - 3
packages/business/widgets/package.json

@@ -46,11 +46,8 @@
     "@vben-core/preferences": "workspace:*",
     "@vben-core/shadcn-ui": "workspace:*",
     "@vben-core/toolkit": "workspace:*",
-    "@vben/chart-ui": "workspace:*",
     "@vben/locales": "workspace:*",
     "@vueuse/core": "^10.11.0",
-    "@vueuse/integrations": "^10.11.0",
-    "qrcode": "^1.5.3",
     "vue": "^3.4.31",
     "vue-router": "^4.4.0"
   },

+ 6 - 3
packages/business/widgets/src/preferences/blocks/layout/breadcrumb.vue

@@ -37,12 +37,15 @@ const disableItem = computed(() => {
   <SwitchItem v-model="breadcrumbHideOnlyOne" :disabled="disableItem">
     {{ $t('preferences.breadcrumb.hide-only-one') }}
   </SwitchItem>
-  <SwitchItem v-model="breadcrumbShowHome" :disabled="disableItem">
-    {{ $t('preferences.breadcrumb.home') }}
-  </SwitchItem>
   <SwitchItem v-model="breadcrumbShowIcon" :disabled="disableItem">
     {{ $t('preferences.breadcrumb.icon') }}
   </SwitchItem>
+  <SwitchItem
+    v-model="breadcrumbShowHome"
+    :disabled="disableItem || !breadcrumbShowIcon"
+  >
+    {{ $t('preferences.breadcrumb.home') }}
+  </SwitchItem>
   <ToggleItem
     v-model="breadcrumbStyleType"
     :disabled="disableItem"

+ 18 - 0
packages/types/global.d.ts

@@ -5,3 +5,21 @@ import 'vue-router';
 declare module 'vue-router' {
   interface RouteMeta extends IRouteMeta {}
 }
+
+declare global {
+  // interface Window {
+  const __VBEN_ADMIN_METADATA__: {
+    authorEmail: string;
+    authorName: string;
+    authorUrl: string;
+    buildTime: string;
+    dependencies: Record<string, string>;
+    description: string;
+    devDependencies: Record<string, string>;
+    homepage: string;
+    license: string;
+    repositoryUrl: string;
+    version: string;
+  };
+  // }
+}

+ 0 - 3
packages/types/package.json

@@ -28,9 +28,6 @@
     },
     "./global": {
       "types": "./global.d.ts"
-    },
-    "./window": {
-      "types": "./window.d.ts"
     }
   },
   "publishConfig": {

+ 0 - 19
packages/types/window.d.ts

@@ -1,19 +0,0 @@
-export {};
-
-declare global {
-  // interface Window {
-  const __VBEN_ADMIN_METADATA__: {
-    authorEmail: string;
-    authorName: string;
-    authorUrl: string;
-    buildTime: string;
-    dependencies: Record<string, string>;
-    description: string;
-    devDependencies: Record<string, string>;
-    homepage: string;
-    license: string;
-    repositoryUrl: string;
-    version: string;
-  };
-  // }
-}

File diff suppressed because it is too large
+ 197 - 309
pnpm-lock.yaml


+ 2 - 2
scripts/vsh/src/check-circular/index.ts

@@ -13,8 +13,8 @@ const IGNORE_DIR = [
   '.cache',
   'scripts',
   'internal',
-  // 'packages/@vben-core/shared/shadcn-ui/',
-  'packages/@vben-core/ui-kit/menu-ui/src/',
+  'packages/@core/forward/request/src/',
+  'packages/@core/ui-kit/menu-ui/src/',
 ].join(',');
 
 const IGNORE = [`**/{${IGNORE_DIR}}/**`];

Some files were not shown because too many files changed in this diff