befly-admin 3.4.27 → 3.4.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "befly-admin",
3
- "version": "3.4.27",
3
+ "version": "3.4.29",
4
4
  "description": "Befly Admin - 基于 Vue3 + OpenTiny Vue 的后台管理系统",
5
5
  "type": "module",
6
6
  "private": false,
@@ -29,16 +29,40 @@
29
29
  "sync:admin": "bunx befly sync:admin"
30
30
  },
31
31
  "dependencies": {
32
- "@opentiny/vue": "^3.27.0",
32
+ "@opentiny/vue-button": "~3.27.0",
33
+ "@opentiny/vue-checkbox": "~3.27.0",
34
+ "@opentiny/vue-checkbox-group": "~3.27.0",
35
+ "@opentiny/vue-dialog-box": "~3.27.0",
36
+ "@opentiny/vue-dropdown": "~3.27.0",
37
+ "@opentiny/vue-dropdown-item": "~3.27.0",
38
+ "@opentiny/vue-dropdown-menu": "~3.27.0",
39
+ "@opentiny/vue-form": "~3.27.0",
40
+ "@opentiny/vue-form-item": "~3.27.0",
41
+ "@opentiny/vue-grid": "~3.27.0",
42
+ "@opentiny/vue-grid-column": "~3.27.0",
43
+ "@opentiny/vue-icon": "~3.27.0",
44
+ "@opentiny/vue-input": "~3.27.0",
45
+ "@opentiny/vue-loading": "~3.27.0",
46
+ "@opentiny/vue-message": "~3.27.0",
47
+ "@opentiny/vue-modal": "~3.27.0",
48
+ "@opentiny/vue-notify": "~3.27.0",
49
+ "@opentiny/vue-numeric": "~3.27.0",
50
+ "@opentiny/vue-pager": "~3.27.0",
51
+ "@opentiny/vue-progress": "~3.27.0",
52
+ "@opentiny/vue-radio": "~3.27.0",
53
+ "@opentiny/vue-radio-group": "~3.27.0",
54
+ "@opentiny/vue-search": "~3.27.0",
55
+ "@opentiny/vue-select": "~3.27.0",
56
+ "@opentiny/vue-tag": "~3.27.0",
57
+ "@opentiny/vue-tree": "~3.27.0",
33
58
  "axios": "^1.13.2",
34
59
  "pinia": "^3.0.4",
35
60
  "vue": "^3.5.22",
36
61
  "vue-router": "^4.6.3"
37
62
  },
38
63
  "devDependencies": {
39
- "@befly-addon/admin": "1.0.29",
64
+ "@befly-addon/admin": "1.0.31",
40
65
  "@iconify-json/lucide": "^1.2.72",
41
- "@opentiny/unplugin-tiny-vue": "^1.0.0",
42
66
  "@unocss/preset-attributify": "^66.5.6",
43
67
  "@unocss/preset-uno": "^66.5.6",
44
68
  "@vitejs/plugin-vue": "^6.0.1",
@@ -49,7 +73,7 @@
49
73
  "unplugin-auto-import": "^20.2.0",
50
74
  "unplugin-icons": "^22.5.0",
51
75
  "unplugin-vue-components": "^30.0.0",
52
- "unplugin-vue-router": "^0.16.2",
76
+ "unplugin-vue-router": "^0.17.0",
53
77
  "vite": "^7.2.2",
54
78
  "vite-plugin-vue-devtools": "^8.0.3",
55
79
  "vue-tsc": "^3.1.3"
@@ -58,5 +82,5 @@
58
82
  "node": ">=24.0.0",
59
83
  "pnpm": ">=10.0.0"
60
84
  },
61
- "gitHead": "ff2020bb13c5f14bf6486e51a12e31aebf2bb712"
85
+ "gitHead": "f279b3e03931a8f13ac1c559e545d18052ce2b87"
62
86
  }
@@ -1,5 +1,5 @@
1
1
  import axios from 'axios';
2
- import { Modal } from '@opentiny/vue';
2
+ import Modal from '@opentiny/vue-modal';
3
3
  import { $Storage } from './storage';
4
4
 
5
5
  /**
@@ -6,17 +6,17 @@
6
6
  // biome-ignore lint: disable
7
7
  export {}
8
8
  declare global {
9
- const $Config: typeof import('../config/index').$Config
10
- const $Http: typeof import('../plugins/http').$Http
11
- const $Storage: typeof import('../plugins/storage').$Storage
9
+ const $Config: typeof import('../config/index.js').$Config
10
+ const $Http: typeof import('../plugins/http.js').$Http
11
+ const $Storage: typeof import('../plugins/storage.js').$Storage
12
12
  const EffectScope: typeof import('vue').EffectScope
13
- const Loading: typeof import('@opentiny/vue').Loading
14
- const Message: typeof import('@opentiny/vue').Message
15
- const MessageBox: typeof import('@opentiny/vue').MessageBox
16
- const Modal: typeof import('@opentiny/vue').Modal
17
- const Notify: typeof import('@opentiny/vue').Notify
13
+ const Loading: typeof import('@opentiny/vue-loading').default
14
+ const Message: typeof import('@opentiny/vue-message').default
15
+ const MessageBox: typeof import('@opentiny/vue-modal').default
16
+ const Modal: typeof import('@opentiny/vue-modal').default
17
+ const Notify: typeof import('@opentiny/vue-notify').default
18
18
  const acceptHMRUpdate: typeof import('pinia').acceptHMRUpdate
19
- const arrayToTree: typeof import('../utils/index').arrayToTree
19
+ const arrayToTree: typeof import('../utils/index.js').arrayToTree
20
20
  const computed: typeof import('vue').computed
21
21
  const createApp: typeof import('vue').createApp
22
22
  const createPinia: typeof import('pinia').createPinia
@@ -80,7 +80,7 @@ declare global {
80
80
  const useAttrs: typeof import('vue').useAttrs
81
81
  const useCssModule: typeof import('vue').useCssModule
82
82
  const useCssVars: typeof import('vue').useCssVars
83
- const useGlobal: typeof import('../plugins/global').useGlobal
83
+ const useGlobal: typeof import('../plugins/global.js').useGlobal
84
84
  const useId: typeof import('vue').useId
85
85
  const useModel: typeof import('vue').useModel
86
86
  const useRoute: typeof import('vue-router').useRoute
@@ -104,17 +104,17 @@ import { UnwrapRef } from 'vue'
104
104
  declare module 'vue' {
105
105
  interface GlobalComponents {}
106
106
  interface ComponentCustomProperties {
107
- readonly $Config: UnwrapRef<typeof import('../config/index')['$Config']>
108
- readonly $Http: UnwrapRef<typeof import('../plugins/http')['$Http']>
109
- readonly $Storage: UnwrapRef<typeof import('../plugins/storage')['$Storage']>
107
+ readonly $Config: UnwrapRef<typeof import('../config/index.js')['$Config']>
108
+ readonly $Http: UnwrapRef<typeof import('../plugins/http.js')['$Http']>
109
+ readonly $Storage: UnwrapRef<typeof import('../plugins/storage.js')['$Storage']>
110
110
  readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
111
- readonly Loading: UnwrapRef<typeof import('@opentiny/vue')['Loading']>
112
- readonly Message: UnwrapRef<typeof import('@opentiny/vue')['Message']>
113
- readonly MessageBox: UnwrapRef<typeof import('@opentiny/vue')['MessageBox']>
114
- readonly Modal: UnwrapRef<typeof import('@opentiny/vue')['Modal']>
115
- readonly Notify: UnwrapRef<typeof import('@opentiny/vue')['Notify']>
111
+ readonly Loading: UnwrapRef<typeof import('@opentiny/vue-loading')['default']>
112
+ readonly Message: UnwrapRef<typeof import('@opentiny/vue-message')['default']>
113
+ readonly MessageBox: UnwrapRef<typeof import('@opentiny/vue-modal')['default']>
114
+ readonly Modal: UnwrapRef<typeof import('@opentiny/vue-modal')['default']>
115
+ readonly Notify: UnwrapRef<typeof import('@opentiny/vue-notify')['default']>
116
116
  readonly acceptHMRUpdate: UnwrapRef<typeof import('pinia')['acceptHMRUpdate']>
117
- readonly arrayToTree: UnwrapRef<typeof import('../utils/index')['arrayToTree']>
117
+ readonly arrayToTree: UnwrapRef<typeof import('../utils/index.js')['arrayToTree']>
118
118
  readonly computed: UnwrapRef<typeof import('vue')['computed']>
119
119
  readonly createApp: UnwrapRef<typeof import('vue')['createApp']>
120
120
  readonly createPinia: UnwrapRef<typeof import('pinia')['createPinia']>
@@ -177,7 +177,7 @@ declare module 'vue' {
177
177
  readonly useAttrs: UnwrapRef<typeof import('vue')['useAttrs']>
178
178
  readonly useCssModule: UnwrapRef<typeof import('vue')['useCssModule']>
179
179
  readonly useCssVars: UnwrapRef<typeof import('vue')['useCssVars']>
180
- readonly useGlobal: UnwrapRef<typeof import('../plugins/global')['useGlobal']>
180
+ readonly useGlobal: UnwrapRef<typeof import('../plugins/global.js')['useGlobal']>
181
181
  readonly useId: UnwrapRef<typeof import('vue')['useId']>
182
182
  readonly useModel: UnwrapRef<typeof import('vue')['useModel']>
183
183
  readonly useRoute: UnwrapRef<typeof import('vue-router')['useRoute']>
@@ -16,11 +16,5 @@ declare module 'vue' {
16
16
  'ILucide:home': typeof import('~icons/lucide/home')['default']
17
17
  RouterLink: typeof import('vue-router')['RouterLink']
18
18
  RouterView: typeof import('vue-router')['RouterView']
19
- TinyButton: typeof import('@opentiny/vue-button')['default']
20
- TinyCol: typeof import('@opentiny/vue-col')['default']
21
- TinyDivider: typeof import('@opentiny/vue-divider')['default']
22
- TinyRow: typeof import('@opentiny/vue-row')['default']
23
- TinyTag: typeof import('@opentiny/vue-tag')['default']
24
- TinyTreeMenu: typeof import('@opentiny/vue-tree-menu')['default']
25
19
  }
26
20
  }
package/vite.config.js CHANGED
@@ -8,14 +8,14 @@ import Components from 'unplugin-vue-components/vite';
8
8
  import Icons from 'unplugin-icons/vite';
9
9
  import IconsResolver from 'unplugin-icons/resolver';
10
10
  import ReactivityTransform from '@vue-macros/reactivity-transform/vite';
11
- import { TinyVueSingleResolver } from '@opentiny/unplugin-tiny-vue';
12
11
  import UnoCSS from 'unocss/vite';
13
12
  import { fileURLToPath, URL } from 'node:url';
14
13
  import { scanBeflyAddonViews } from '@befly-addon/admin/utils/scanBeflyAddonViews';
15
14
 
16
- const routesFolders = scanBeflyAddonViews();
17
-
18
15
  export default defineConfig({
16
+ // 基础路径配置(支持二级目录部署)
17
+ base: './',
18
+
19
19
  // 插件配置
20
20
  plugins: [
21
21
  // UnoCSS
@@ -26,7 +26,7 @@ export default defineConfig({
26
26
 
27
27
  // VueRouter 必须在 Vue 插件之前
28
28
  VueRouter({
29
- routesFolder: routesFolders,
29
+ routesFolder: scanBeflyAddonViews(),
30
30
  dts: './src/types/typed-router.d.ts',
31
31
  extensions: ['.vue'],
32
32
  importMode: 'async',
@@ -52,7 +52,13 @@ export default defineConfig({
52
52
  'pinia',
53
53
  VueRouterAutoImports,
54
54
  {
55
- '@opentiny/vue': ['Modal', 'Notify', 'Message', 'MessageBox', 'Loading']
55
+ '@opentiny/vue-modal': [
56
+ ['default', 'Modal'],
57
+ ['default', 'MessageBox']
58
+ ],
59
+ '@opentiny/vue-notify': [['default', 'Notify']],
60
+ '@opentiny/vue-message': [['default', 'Message']],
61
+ '@opentiny/vue-loading': [['default', 'Loading']]
56
62
  }
57
63
  ],
58
64
  dts: 'src/types/auto-imports.d.ts',
@@ -62,7 +68,7 @@ export default defineConfig({
62
68
 
63
69
  // 组件自动导入
64
70
  Components({
65
- resolvers: [TinyVueSingleResolver, IconsResolver({})],
71
+ resolvers: [IconsResolver({})],
66
72
  dirs: ['src/components'],
67
73
  deep: true,
68
74
  dts: 'src/types/components.d.ts'
@@ -100,12 +106,91 @@ export default defineConfig({
100
106
  assetsDir: 'assets',
101
107
  sourcemap: false,
102
108
  minify: 'esbuild',
109
+ chunkSizeWarningLimit: 1000,
103
110
  rollupOptions: {
104
- external: ['vue', 'vue-router', 'pinia', '@opentiny/vue', 'axios', 'vue-macros/macros'],
105
111
  output: {
106
- chunkFileNames: 'assets/[name]-[hash].js',
107
- entryFileNames: 'assets/[name]-[hash].js',
108
- assetFileNames: 'assets/[name]-[hash].[ext]'
112
+ chunkFileNames: 'assets/js/[name]-[hash].js',
113
+ entryFileNames: 'assets/js/[name]-[hash].js',
114
+ assetFileNames: 'assets/[ext]/[name]-[hash].[ext]',
115
+ manualChunks: (id) => {
116
+ // Vue 核心框架(独立文件)
117
+ if (id.includes('node_modules/vue/') || id.includes('node_modules/@vue/')) {
118
+ return 'framework-vue';
119
+ }
120
+ if (id.includes('node_modules/vue-router/')) {
121
+ return 'framework-vue-router';
122
+ }
123
+ if (id.includes('node_modules/pinia/')) {
124
+ return 'framework-pinia';
125
+ }
126
+
127
+ // TinyVue 细粒度拆分
128
+ if (id.includes('@opentiny/vue-renderless/src/grid')) {
129
+ return 'tiny-grid';
130
+ }
131
+ if (id.includes('@opentiny/vue-renderless/src/table')) {
132
+ return 'tiny-table';
133
+ }
134
+ if (id.includes('@opentiny/vue-renderless/src/tree')) {
135
+ return 'tiny-tree';
136
+ }
137
+ if (id.includes('@opentiny/vue-renderless/src/form')) {
138
+ return 'tiny-form';
139
+ }
140
+ if (id.includes('node_modules/@opentiny/vue-renderless/')) {
141
+ return 'tiny-renderless';
142
+ }
143
+ if (id.includes('node_modules/@opentiny/vue-theme/')) {
144
+ return 'tiny-theme';
145
+ }
146
+ if (id.includes('node_modules/@opentiny/vue-locale/')) {
147
+ return 'tiny-locale';
148
+ }
149
+ if (id.includes('node_modules/@opentiny/vue-common/')) {
150
+ return 'tiny-common';
151
+ }
152
+ if (id.includes('node_modules/@opentiny/vue-icon/')) {
153
+ return 'tiny-icon';
154
+ }
155
+
156
+ // 工具库(独立文件)
157
+ if (id.includes('node_modules/axios/')) {
158
+ return 'lib-axios';
159
+ }
160
+
161
+ // lodash-es 独立拆分(体积较大)
162
+ if (id.includes('node_modules/lodash-es/') || id.includes('node_modules/.bun/lodash-es')) {
163
+ return 'lib-lodash';
164
+ }
165
+
166
+ // echarts 及相关库(TinyVue 图表组件依赖)
167
+ if (id.includes('node_modules/echarts/') || id.includes('node_modules/.bun/echarts')) {
168
+ return 'lib-echarts';
169
+ }
170
+ if (id.includes('node_modules/zrender/') || id.includes('node_modules/.bun/zrender')) {
171
+ return 'lib-zrender';
172
+ }
173
+
174
+ // Lucide 图标
175
+ if (id.includes('node_modules/@iconify/') || id.includes('~icons/')) {
176
+ return 'icons';
177
+ }
178
+
179
+ // Vue Macros
180
+ if (id.includes('node_modules/@vue-macros/') || id.includes('node_modules/vue-macros/')) {
181
+ return 'vue-macros';
182
+ }
183
+
184
+ // befly-addon
185
+ if (id.includes('@befly-addon/')) {
186
+ return 'befly-addon';
187
+ }
188
+
189
+ // 其他 node_modules 依赖
190
+ if (id.includes('node_modules/')) {
191
+ return 'vendor';
192
+ }
193
+ }
109
194
  }
110
195
  }
111
196
  },
@@ -123,6 +208,6 @@ export default defineConfig({
123
208
 
124
209
  // 优化配置
125
210
  optimizeDeps: {
126
- include: ['vue', 'vue-router', 'pinia', 'axios', '@opentiny/vue']
211
+ include: ['vue', 'vue-router', 'pinia', 'axios', 'vue-macros/macros']
127
212
  }
128
213
  });