refactor: remove the adapter bucket introduction pattern and improve potential introduction timing (#4635)

* refactor: remove the adapter bucket introduction pattern and improve potential introduction timing

* chore: update deps
This commit is contained in:
Vben 2024-10-14 22:53:23 +08:00 committed by GitHub
parent 45987fc1e3
commit 6c4a742627
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
36 changed files with 344 additions and 273 deletions

View File

@ -1,2 +0,0 @@
export * from './form';
export * from './vxe-table';

View File

@ -1,2 +0,0 @@
export * from './form';
export * from './vxe-table';

View File

@ -1,3 +0,0 @@
export * from './form';
export * from './naive';
export * from './vxe-table';

View File

@ -12,7 +12,7 @@ import {
} from '@vben/request';
import { useAccessStore } from '@vben/stores';
import { message } from '#/adapter';
import { message } from '#/adapter/naive';
import { useAuthStore } from '#/store';
import { refreshTokenApi } from './core';

View File

@ -6,7 +6,7 @@ import type {
import { generateAccessible } from '@vben/access';
import { preferences } from '@vben/preferences';
import { message } from '#/adapter';
import { message } from '#/adapter/naive';
import { getAllMenusApi } from '#/api';
import { BasicLayout, IFrameView } from '#/layouts';
import { $t } from '#/locales';

View File

@ -9,7 +9,7 @@ import { resetAllStores, useAccessStore, useUserStore } from '@vben/stores';
import { defineStore } from 'pinia';
import { notification } from '#/adapter';
import { notification } from '#/adapter/naive';
import { getAccessCodesApi, getUserInfoApi, loginApi, logoutApi } from '#/api';
import { $t } from '#/locales';

View File

@ -258,7 +258,7 @@ _注意_ 需要指定 `dependencies` 的 `triggerFields` 属性,设置由谁
```vue
<script setup lang="ts">
import { useVbenForm } from '#/adapter';
import { useVbenForm } from '#/adapter/form';
// Form 为弹窗组件
// formApi 为弹窗的方法
@ -475,7 +475,7 @@ rules的值可以是一个字符串也可以是一个zod的schema。
rules也支持 zod 的 schema可以进行更复杂的校验zod 的使用请查看 [zod文档](https://zod.dev/)。
```ts
import { z } from '#/adapter';
import { z } from '#/adapter/form';
// 基础类型
{

View File

@ -1,7 +1,7 @@
<script lang="ts" setup>
import { Button, message, Space } from 'ant-design-vue';
import { useVbenForm } from '#/adapter';
import { useVbenForm } from '#/adapter/form';
const [BaseForm, formApi] = useVbenForm({
//

View File

@ -1,7 +1,7 @@
<script lang="ts" setup>
import { message } from 'ant-design-vue';
import { useVbenForm } from '#/adapter';
import { useVbenForm } from '#/adapter/form';
const [BaseForm] = useVbenForm({
//

View File

@ -3,7 +3,7 @@ import { h } from 'vue';
import { Input, message } from 'ant-design-vue';
import { useVbenForm } from '#/adapter';
import { useVbenForm } from '#/adapter/form';
const [Form] = useVbenForm({
//

View File

@ -1,7 +1,7 @@
<script lang="ts" setup>
import { message } from 'ant-design-vue';
import { useVbenForm } from '#/adapter';
import { useVbenForm } from '#/adapter/form';
const [Form] = useVbenForm({
//

View File

@ -1,7 +1,7 @@
<script lang="ts" setup>
import { message } from 'ant-design-vue';
import { useVbenForm } from '#/adapter';
import { useVbenForm } from '#/adapter/form';
const [QueryForm] = useVbenForm({
//

View File

@ -1,7 +1,7 @@
<script lang="ts" setup>
import { message } from 'ant-design-vue';
import { useVbenForm, z } from '#/adapter';
import { useVbenForm, z } from '#/adapter/form';
const [Form] = useVbenForm({
//

View File

@ -101,6 +101,7 @@ const customConfig: Linter.Config[] = [
],
},
},
{
// 不能引入@vben/*里面的包
files: [

View File

@ -3,6 +3,8 @@ import type { ToolbarType } from './types';
import { computed } from 'vue';
import { preferences } from '@vben/preferences';
import {
AuthenticationColorToggle,
AuthenticationLayoutToggle,
@ -41,7 +43,7 @@ const showTheme = computed(() => props.toolbarList.includes('theme'));
<AuthenticationLayoutToggle v-if="showLayout" />
</div>
<!-- Always show Language and Theme toggles -->
<LanguageToggle v-if="showLanguage" />
<ThemeToggle v-if="showTheme" />
<LanguageToggle v-if="showLanguage && preferences.widget.languageToggle" />
<ThemeToggle v-if="showTheme && preferences.widget.themeToggle" />
</div>
</template>

View File

@ -1,2 +0,0 @@
export * from './form';
export * from './vxe-table';

View File

@ -1,7 +1,7 @@
<script lang="ts" setup>
import { useVbenDrawer } from '@vben/common-ui';
import { useVbenForm } from '#/adapter';
import { useVbenForm } from '#/adapter/form';
defineOptions({
name: 'FormDrawerDemo',

View File

@ -3,7 +3,7 @@ import { Page } from '@vben/common-ui';
import { Button, Card, message, Space } from 'ant-design-vue';
import { useVbenForm } from '#/adapter';
import { useVbenForm } from '#/adapter/form';
const [BaseForm, formApi] = useVbenForm({
//

View File

@ -4,7 +4,7 @@ import { Page } from '@vben/common-ui';
import { Button, Card, message } from 'ant-design-vue';
import dayjs from 'dayjs';
import { useVbenForm } from '#/adapter';
import { useVbenForm } from '#/adapter/form';
import DocButton from '../doc-button.vue';

View File

@ -5,7 +5,7 @@ import { Page } from '@vben/common-ui';
import { Card, Input, message } from 'ant-design-vue';
import { useVbenForm } from '#/adapter';
import { useVbenForm } from '#/adapter/form';
const [Form] = useVbenForm({
//

View File

@ -3,7 +3,7 @@ import { Page } from '@vben/common-ui';
import { Button, Card, message } from 'ant-design-vue';
import { useVbenForm } from '#/adapter';
import { useVbenForm } from '#/adapter/form';
const [Form, formApi] = useVbenForm({
//

View File

@ -5,7 +5,7 @@ import { Page } from '@vben/common-ui';
import { Button, Card, message, Step, Steps, Switch } from 'ant-design-vue';
import { useVbenForm } from '#/adapter';
import { useVbenForm } from '#/adapter/form';
const currentTab = ref(0);
function onFirstSubmit(values: Record<string, any>) {

View File

@ -3,7 +3,7 @@ import { Page } from '@vben/common-ui';
import { Card, message } from 'ant-design-vue';
import { useVbenForm } from '#/adapter';
import { useVbenForm } from '#/adapter/form';
const [QueryForm] = useVbenForm({
//

View File

@ -3,7 +3,7 @@ import { Page } from '@vben/common-ui';
import { Button, Card, message } from 'ant-design-vue';
import { useVbenForm, z } from '#/adapter';
import { useVbenForm, z } from '#/adapter/form';
const [Form, formApi] = useVbenForm({
//

View File

@ -3,7 +3,7 @@ import { useVbenModal } from '@vben/common-ui';
import { message } from 'ant-design-vue';
import { useVbenForm } from '#/adapter';
import { useVbenForm } from '#/adapter/form';
defineOptions({
name: 'FormModelDemo',

View File

@ -1,11 +1,11 @@
<script lang="ts" setup>
import type { VxeGridListeners, VxeGridProps } from '#/adapter';
import type { VxeGridListeners, VxeGridProps } from '#/adapter/vxe-table';
import { Page } from '@vben/common-ui';
import { Button, message } from 'ant-design-vue';
import { useVbenVxeGrid } from '#/adapter';
import { useVbenVxeGrid } from '#/adapter/vxe-table';
import DocButton from '../doc-button.vue';
import { MOCK_TABLE_DATA } from './table-data';

View File

@ -1,11 +1,11 @@
<script lang="ts" setup>
import type { VxeGridProps } from '#/adapter';
import type { VxeGridProps } from '#/adapter/vxe-table';
import { Page } from '@vben/common-ui';
import { Button, Image, Switch, Tag } from 'ant-design-vue';
import { useVbenVxeGrid } from '#/adapter';
import { useVbenVxeGrid } from '#/adapter/vxe-table';
import { getExampleTableApi } from '#/api';
interface RowType {

View File

@ -1,9 +1,9 @@
<script lang="ts" setup>
import type { VxeGridProps } from '#/adapter';
import type { VxeGridProps } from '#/adapter/vxe-table';
import { Page } from '@vben/common-ui';
import { useVbenVxeGrid } from '#/adapter';
import { useVbenVxeGrid } from '#/adapter/vxe-table';
import { getExampleTableApi } from '#/api';
interface RowType {

View File

@ -1,11 +1,11 @@
<script lang="ts" setup>
import type { VxeGridProps } from '#/adapter';
import type { VxeGridProps } from '#/adapter/vxe-table';
import { Page } from '@vben/common-ui';
import { Button, message } from 'ant-design-vue';
import { useVbenVxeGrid } from '#/adapter';
import { useVbenVxeGrid } from '#/adapter/vxe-table';
import { getExampleTableApi } from '#/api';
interface RowType {

View File

@ -1,11 +1,11 @@
<script lang="ts" setup>
import type { VxeGridProps } from '#/adapter';
import type { VxeGridProps } from '#/adapter/vxe-table';
import { Page } from '@vben/common-ui';
import { Button } from 'ant-design-vue';
import { useVbenVxeGrid } from '#/adapter';
import { useVbenVxeGrid } from '#/adapter/vxe-table';
import { getExampleTableApi } from '#/api';
interface RowType {

View File

@ -1,11 +1,12 @@
<script lang="ts" setup>
import type { VbenFormProps, VxeGridProps } from '#/adapter';
import type { VbenFormProps } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
import { Page } from '@vben/common-ui';
import { message } from 'ant-design-vue';
import { useVbenVxeGrid } from '#/adapter';
import { useVbenVxeGrid } from '#/adapter/vxe-table';
import { getExampleTableApi } from '#/api';
interface RowType {

View File

@ -1,11 +1,11 @@
<script lang="ts" setup>
import type { VxeGridProps } from '#/adapter';
import type { VxeGridProps } from '#/adapter/vxe-table';
import { Page } from '@vben/common-ui';
import { Button } from 'ant-design-vue';
import { useVbenVxeGrid } from '#/adapter';
import { useVbenVxeGrid } from '#/adapter/vxe-table';
import { getExampleTableApi } from '#/api';
interface RowType {

View File

@ -1,11 +1,11 @@
<script lang="ts" setup>
import type { VxeGridProps } from '#/adapter';
import type { VxeGridProps } from '#/adapter/vxe-table';
import { Page } from '@vben/common-ui';
import { Button } from 'ant-design-vue';
import { useVbenVxeGrid } from '#/adapter';
import { useVbenVxeGrid } from '#/adapter/vxe-table';
import { MOCK_TREE_TABLE_DATA } from './table-data';

View File

@ -1,11 +1,11 @@
<script lang="ts" setup>
import type { VxeGridProps } from '#/adapter';
import type { VxeGridProps } from '#/adapter/vxe-table';
import { onMounted } from 'vue';
import { Page } from '@vben/common-ui';
import { useVbenVxeGrid } from '#/adapter';
import { useVbenVxeGrid } from '#/adapter/vxe-table';
interface RowType {
id: number;

510
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -22,7 +22,7 @@ catalog:
'@ctrl/tinycolor': ^4.1.0
'@eslint/js': ^9.12.0
'@faker-js/faker': ^9.0.3
'@iconify/json': ^2.2.259
'@iconify/json': ^2.2.260
'@iconify/tailwind': ^1.1.3
'@iconify/vue': ^4.1.2
'@intlify/core-base': ^10.0.4
@ -73,7 +73,7 @@ catalog:
commitlint-plugin-function-rules: ^4.0.0
consola: ^3.2.3
cross-env: ^7.0.3
cspell: ^8.15.1
cspell: ^8.15.2
cssnano: ^7.0.6
cz-git: ^1.10.1
czg: ^1.10.1
@ -88,7 +88,7 @@ catalog:
eslint-plugin-command: ^0.2.6
eslint-plugin-eslint-comments: ^3.2.0
eslint-plugin-import-x: ^4.3.1
eslint-plugin-jsdoc: ^50.3.2
eslint-plugin-jsdoc: ^50.4.0
eslint-plugin-jsonc: ^2.16.0
eslint-plugin-n: ^17.11.1
eslint-plugin-no-only-tests: ^3.3.0
@ -149,7 +149,7 @@ catalog:
stylelint-order: ^6.0.4
stylelint-prettier: ^5.0.2
stylelint-scss: ^6.7.0
tailwind-merge: ^2.5.3
tailwind-merge: ^2.5.4
tailwindcss: ^3.4.13
tailwindcss-animate: ^1.0.7
theme-colors: ^0.1.0
@ -158,7 +158,7 @@ catalog:
unbuild: ^2.0.0
unplugin-element-plus: ^0.8.0
vee-validate: ^4.13.2
vite: ^5.4.8
vite: ^5.4.9
vite-plugin-compression: ^0.5.1
vite-plugin-dts: 4.2.1
vite-plugin-html: ^3.2.2
@ -168,13 +168,13 @@ catalog:
vite-plugin-vue-devtools: ^7.4.6
vitepress: ^1.4.1
vitepress-plugin-group-icons: ^1.2.4
vitest: ^2.1.2
vitest: ^2.1.3
vue: ^3.5.12
vue-eslint-parser: ^9.4.3
vue-i18n: ^10.0.4
vue-router: ^4.4.5
vue-tsc: ^2.1.6
vxe-pc-ui: ^4.2.19
vxe-pc-ui: ^4.2.20
vxe-table: ^4.7.86
watermark-js-plus: ^1.5.7
zod: ^3.23.8