fix: Typecheck and loop dependency problem repair

This commit is contained in:
vince 2024-07-05 11:12:38 +08:00
parent fa781633b5
commit 527023ae51
21 changed files with 462 additions and 750 deletions

View File

@ -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"

View File

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

View File

@ -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",

View File

@ -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",

View File

@ -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>

View File

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

View File

@ -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';

View File

@ -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,

View File

@ -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?.();

View File

@ -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",

View File

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

View File

@ -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: {

View File

@ -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",

View File

@ -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"]

View File

@ -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"
},

View File

@ -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"

View File

@ -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;
};
// }
}

View File

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

View File

@ -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 Load Diff

View File

@ -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}}/**`];