diff --git a/apps/web-antd/src/bootstrap.ts b/apps/web-antd/src/bootstrap.ts
index 8141e95f..8c466684 100644
--- a/apps/web-antd/src/bootstrap.ts
+++ b/apps/web-antd/src/bootstrap.ts
@@ -1,5 +1,6 @@
import { createApp } from 'vue';
+import { useAccessDirective } from '@vben/access';
import '@vben/styles';
import '@vben/styles/antd';
@@ -15,9 +16,12 @@ async function bootstrap(namespace: string) {
// 国际化 i18n 配置
await setupI18n(app);
- // 配置 pinia-store
+ // 配置 pinia-tore
await setupStore(app, { namespace });
+ // 安装权限指令
+ useAccessDirective(app);
+
// 配置路由及路由守卫
app.use(router);
diff --git a/apps/web-antd/src/main.ts b/apps/web-antd/src/main.ts
index dedabbcb..5d728a02 100644
--- a/apps/web-antd/src/main.ts
+++ b/apps/web-antd/src/main.ts
@@ -1,5 +1,5 @@
-import { unmountGlobalLoading } from '@vben/hooks';
import { initPreferences } from '@vben/preferences';
+import { unmountGlobalLoading } from '@vben/utils';
import { overridesPreferences } from './preferences';
diff --git a/apps/web-antd/src/views/demos/access/button-control.vue b/apps/web-antd/src/views/demos/access/button-control.vue
index 27332417..f4b751fe 100644
--- a/apps/web-antd/src/views/demos/access/button-control.vue
+++ b/apps/web-antd/src/views/demos/access/button-control.vue
@@ -98,16 +98,16 @@ async function changeAccount(role: string) {
组件形式控制 - 用户角色方式
-
+
-
+
-
+
-
+
@@ -127,5 +127,31 @@ async function changeAccount(role: string) {
Super & Admin 账号可见 ["AC_100100","AC_1000001"]
+
+
+
指令方式 - 权限码
+
+
+
+
+
+
+
+
指令方式 - 角色
+
+
+
+
+
diff --git a/internal/lint-configs/eslint-config/src/configs/vue.ts b/internal/lint-configs/eslint-config/src/configs/vue.ts
index d0e111d6..83818e4a 100644
--- a/internal/lint-configs/eslint-config/src/configs/vue.ts
+++ b/internal/lint-configs/eslint-config/src/configs/vue.ts
@@ -44,7 +44,7 @@ export async function vue(): Promise {
ignore: [],
},
],
- 'vue/attributes-order': 'error',
+ 'vue/attributes-order': 'off',
'vue/block-order': [
'error',
{
diff --git a/internal/lint-configs/eslint-config/src/custom-config.ts b/internal/lint-configs/eslint-config/src/custom-config.ts
index 14e56202..d6d3e91b 100644
--- a/internal/lint-configs/eslint-config/src/custom-config.ts
+++ b/internal/lint-configs/eslint-config/src/custom-config.ts
@@ -69,7 +69,7 @@ const customConfig: Linter.FlatConfig[] = [
},
{
// @core/shared内部组件,不能引入@vben/* 或者 @vben-core/* 里面的包
- files: ['packages/@core/shared/**/**'],
+ files: ['packages/@core/base/**/**'],
ignores: restrictedImportIgnores,
rules: {
'no-restricted-imports': [
diff --git a/packages/@core/base/README.md b/packages/@core/base/README.md
new file mode 100644
index 00000000..cc745b4e
--- /dev/null
+++ b/packages/@core/base/README.md
@@ -0,0 +1,5 @@
+# base
+
+基础共享包,请勿引入 workspace 依赖
+
+-
diff --git a/packages/@core/shared/design/package.json b/packages/@core/base/design/package.json
similarity index 94%
rename from packages/@core/shared/design/package.json
rename to packages/@core/base/design/package.json
index 08d5dde7..78908d79 100644
--- a/packages/@core/shared/design/package.json
+++ b/packages/@core/base/design/package.json
@@ -6,7 +6,7 @@
"repository": {
"type": "git",
"url": "git+https://github.com/vbenjs/vue-vben-admin.git",
- "directory": "packages/@vben-core/shared/design"
+ "directory": "packages/@vben-core/base/design"
},
"license": "MIT",
"type": "module",
diff --git a/packages/@core/shared/design/src/css/global.css b/packages/@core/base/design/src/css/global.css
similarity index 100%
rename from packages/@core/shared/design/src/css/global.css
rename to packages/@core/base/design/src/css/global.css
diff --git a/packages/@core/shared/design/src/css/nprogress.css b/packages/@core/base/design/src/css/nprogress.css
similarity index 100%
rename from packages/@core/shared/design/src/css/nprogress.css
rename to packages/@core/base/design/src/css/nprogress.css
diff --git a/packages/@core/shared/design/src/css/transition.css b/packages/@core/base/design/src/css/transition.css
similarity index 100%
rename from packages/@core/shared/design/src/css/transition.css
rename to packages/@core/base/design/src/css/transition.css
diff --git a/packages/@core/shared/design/src/design-tokens/dark/index.css b/packages/@core/base/design/src/design-tokens/dark/index.css
similarity index 100%
rename from packages/@core/shared/design/src/design-tokens/dark/index.css
rename to packages/@core/base/design/src/design-tokens/dark/index.css
diff --git a/packages/@core/shared/design/src/design-tokens/default/index.css b/packages/@core/base/design/src/design-tokens/default/index.css
similarity index 100%
rename from packages/@core/shared/design/src/design-tokens/default/index.css
rename to packages/@core/base/design/src/design-tokens/default/index.css
diff --git a/packages/@core/shared/design/src/design-tokens/index.ts b/packages/@core/base/design/src/design-tokens/index.ts
similarity index 100%
rename from packages/@core/shared/design/src/design-tokens/index.ts
rename to packages/@core/base/design/src/design-tokens/index.ts
diff --git a/packages/@core/shared/design/src/index.ts b/packages/@core/base/design/src/index.ts
similarity index 100%
rename from packages/@core/shared/design/src/index.ts
rename to packages/@core/base/design/src/index.ts
diff --git a/packages/@core/shared/design/src/scss-bem/bem.scss b/packages/@core/base/design/src/scss-bem/bem.scss
similarity index 100%
rename from packages/@core/shared/design/src/scss-bem/bem.scss
rename to packages/@core/base/design/src/scss-bem/bem.scss
diff --git a/packages/@core/shared/design/src/scss-bem/constants.scss b/packages/@core/base/design/src/scss-bem/constants.scss
similarity index 100%
rename from packages/@core/shared/design/src/scss-bem/constants.scss
rename to packages/@core/base/design/src/scss-bem/constants.scss
diff --git a/packages/@core/shared/design/tsconfig.json b/packages/@core/base/design/tsconfig.json
similarity index 100%
rename from packages/@core/shared/design/tsconfig.json
rename to packages/@core/base/design/tsconfig.json
diff --git a/packages/@core/shared/design/vite.config.mts b/packages/@core/base/design/vite.config.mts
similarity index 100%
rename from packages/@core/shared/design/vite.config.mts
rename to packages/@core/base/design/vite.config.mts
diff --git a/packages/@core/hooks/build.config.ts b/packages/@core/base/icons/build.config.ts
similarity index 100%
rename from packages/@core/hooks/build.config.ts
rename to packages/@core/base/icons/build.config.ts
diff --git a/packages/@core/shared/icons/package.json b/packages/@core/base/icons/package.json
similarity index 94%
rename from packages/@core/shared/icons/package.json
rename to packages/@core/base/icons/package.json
index 6126b00c..036187d8 100644
--- a/packages/@core/shared/icons/package.json
+++ b/packages/@core/base/icons/package.json
@@ -6,7 +6,7 @@
"repository": {
"type": "git",
"url": "git+https://github.com/vbenjs/vue-vben-admin.git",
- "directory": "packages/@vben-core/shared/icons"
+ "directory": "packages/@vben-core/base/icons"
},
"license": "MIT",
"type": "module",
diff --git a/packages/@core/shared/icons/src/create-icon.ts b/packages/@core/base/icons/src/create-icon.ts
similarity index 100%
rename from packages/@core/shared/icons/src/create-icon.ts
rename to packages/@core/base/icons/src/create-icon.ts
diff --git a/packages/@core/shared/icons/src/index.ts b/packages/@core/base/icons/src/index.ts
similarity index 100%
rename from packages/@core/shared/icons/src/index.ts
rename to packages/@core/base/icons/src/index.ts
diff --git a/packages/@core/shared/icons/src/lucide.ts b/packages/@core/base/icons/src/lucide.ts
similarity index 100%
rename from packages/@core/shared/icons/src/lucide.ts
rename to packages/@core/base/icons/src/lucide.ts
diff --git a/packages/@core/shared/icons/src/mdi.ts b/packages/@core/base/icons/src/mdi.ts
similarity index 100%
rename from packages/@core/shared/icons/src/mdi.ts
rename to packages/@core/base/icons/src/mdi.ts
diff --git a/packages/@core/shared/icons/tsconfig.json b/packages/@core/base/icons/tsconfig.json
similarity index 100%
rename from packages/@core/shared/icons/tsconfig.json
rename to packages/@core/base/icons/tsconfig.json
diff --git a/packages/@core/base/shared/build.config.ts b/packages/@core/base/shared/build.config.ts
new file mode 100644
index 00000000..79cc4a2b
--- /dev/null
+++ b/packages/@core/base/shared/build.config.ts
@@ -0,0 +1,13 @@
+import { defineBuildConfig } from 'unbuild';
+
+export default defineBuildConfig({
+ clean: true,
+ declaration: true,
+ entries: [
+ 'src/index',
+ 'src/constants/index',
+ 'src/utils/index',
+ 'src/colorful/index',
+ 'src/cache/index',
+ ],
+});
diff --git a/packages/@core/shared/toolkit/package.json b/packages/@core/base/shared/package.json
similarity index 60%
rename from packages/@core/shared/toolkit/package.json
rename to packages/@core/base/shared/package.json
index 05f72e78..eaa606e9 100644
--- a/packages/@core/shared/toolkit/package.json
+++ b/packages/@core/base/shared/package.json
@@ -1,12 +1,12 @@
{
- "name": "@vben-core/toolkit",
+ "name": "@vben-core/shared",
"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/shared/toolkit"
+ "directory": "packages/@vben-core/base/shared"
},
"license": "MIT",
"type": "module",
@@ -24,6 +24,26 @@
"types": "./src/index.ts",
"development": "./src/index.ts",
"default": "./dist/index.mjs"
+ },
+ "./constants": {
+ "types": "./src/constants/index.ts",
+ "development": "./src/constants/index.ts",
+ "default": "./dist/constants/index.mjs"
+ },
+ "./utils": {
+ "types": "./src/utils/index.ts",
+ "development": "./src/utils/index.ts",
+ "default": "./dist/utils/index.mjs"
+ },
+ "./colorful": {
+ "types": "./src/colorful/index.ts",
+ "development": "./src/colorful/index.ts",
+ "default": "./dist/colorful/index.mjs"
+ },
+ "./cache": {
+ "types": "./src/cache/index.ts",
+ "development": "./src/cache/index.ts",
+ "default": "./dist/cache/index.mjs"
}
},
"publishConfig": {
diff --git a/packages/@core/shared/toolkit/src/cache/index.ts b/packages/@core/base/shared/src/cache/index.ts
similarity index 100%
rename from packages/@core/shared/toolkit/src/cache/index.ts
rename to packages/@core/base/shared/src/cache/index.ts
diff --git a/packages/@core/shared/toolkit/src/cache/storage-manager.test.ts b/packages/@core/base/shared/src/cache/storage-manager.test.ts
similarity index 100%
rename from packages/@core/shared/toolkit/src/cache/storage-manager.test.ts
rename to packages/@core/base/shared/src/cache/storage-manager.test.ts
diff --git a/packages/@core/shared/toolkit/src/cache/storage-manager.ts b/packages/@core/base/shared/src/cache/storage-manager.ts
similarity index 100%
rename from packages/@core/shared/toolkit/src/cache/storage-manager.ts
rename to packages/@core/base/shared/src/cache/storage-manager.ts
diff --git a/packages/@core/shared/toolkit/src/cache/types.ts b/packages/@core/base/shared/src/cache/types.ts
similarity index 100%
rename from packages/@core/shared/toolkit/src/cache/types.ts
rename to packages/@core/base/shared/src/cache/types.ts
diff --git a/packages/@core/shared/toolkit/src/colorful/convert.test.ts b/packages/@core/base/shared/src/colorful/convert.test.ts
similarity index 100%
rename from packages/@core/shared/toolkit/src/colorful/convert.test.ts
rename to packages/@core/base/shared/src/colorful/convert.test.ts
diff --git a/packages/@core/shared/toolkit/src/colorful/convert.ts b/packages/@core/base/shared/src/colorful/convert.ts
similarity index 100%
rename from packages/@core/shared/toolkit/src/colorful/convert.ts
rename to packages/@core/base/shared/src/colorful/convert.ts
diff --git a/packages/@core/shared/toolkit/src/colorful/generator.ts b/packages/@core/base/shared/src/colorful/generator.ts
similarity index 100%
rename from packages/@core/shared/toolkit/src/colorful/generator.ts
rename to packages/@core/base/shared/src/colorful/generator.ts
diff --git a/packages/@core/shared/toolkit/src/colorful/index.ts b/packages/@core/base/shared/src/colorful/index.ts
similarity index 100%
rename from packages/@core/shared/toolkit/src/colorful/index.ts
rename to packages/@core/base/shared/src/colorful/index.ts
diff --git a/packages/@core/shared/constants/src/globals.ts b/packages/@core/base/shared/src/constants/globals.ts
similarity index 100%
rename from packages/@core/shared/constants/src/globals.ts
rename to packages/@core/base/shared/src/constants/globals.ts
diff --git a/packages/@core/shared/constants/src/index.ts b/packages/@core/base/shared/src/constants/index.ts
similarity index 100%
rename from packages/@core/shared/constants/src/index.ts
rename to packages/@core/base/shared/src/constants/index.ts
diff --git a/packages/@core/shared/constants/src/vben.ts b/packages/@core/base/shared/src/constants/vben.ts
similarity index 100%
rename from packages/@core/shared/constants/src/vben.ts
rename to packages/@core/base/shared/src/constants/vben.ts
diff --git a/packages/@core/base/shared/src/index.ts b/packages/@core/base/shared/src/index.ts
new file mode 100644
index 00000000..e4667cc2
--- /dev/null
+++ b/packages/@core/base/shared/src/index.ts
@@ -0,0 +1,4 @@
+export * from './cache';
+export * from './colorful';
+export * from './constants';
+export * from './utils';
diff --git a/packages/@core/shared/toolkit/src/cn.ts b/packages/@core/base/shared/src/utils/cn.ts
similarity index 100%
rename from packages/@core/shared/toolkit/src/cn.ts
rename to packages/@core/base/shared/src/utils/cn.ts
diff --git a/packages/@core/shared/toolkit/src/diff.test.ts b/packages/@core/base/shared/src/utils/diff.test.ts
similarity index 100%
rename from packages/@core/shared/toolkit/src/diff.test.ts
rename to packages/@core/base/shared/src/utils/diff.test.ts
diff --git a/packages/@core/shared/toolkit/src/diff.ts b/packages/@core/base/shared/src/utils/diff.ts
similarity index 100%
rename from packages/@core/shared/toolkit/src/diff.ts
rename to packages/@core/base/shared/src/utils/diff.ts
diff --git a/packages/@core/shared/toolkit/src/dom.test.ts b/packages/@core/base/shared/src/utils/dom.test.ts
similarity index 100%
rename from packages/@core/shared/toolkit/src/dom.test.ts
rename to packages/@core/base/shared/src/utils/dom.test.ts
diff --git a/packages/@core/shared/toolkit/src/dom.ts b/packages/@core/base/shared/src/utils/dom.ts
similarity index 100%
rename from packages/@core/shared/toolkit/src/dom.ts
rename to packages/@core/base/shared/src/utils/dom.ts
diff --git a/packages/@core/shared/toolkit/src/index.ts b/packages/@core/base/shared/src/utils/index.ts
similarity index 86%
rename from packages/@core/shared/toolkit/src/index.ts
rename to packages/@core/base/shared/src/utils/index.ts
index fdf5f2a9..34e6e78e 100644
--- a/packages/@core/shared/toolkit/src/index.ts
+++ b/packages/@core/base/shared/src/utils/index.ts
@@ -1,6 +1,4 @@
-export * from './cache';
export * from './cn';
-export * from './colorful';
export * from './diff';
export * from './dom';
export * from './inference';
diff --git a/packages/@core/shared/toolkit/src/inference.test.ts b/packages/@core/base/shared/src/utils/inference.test.ts
similarity index 100%
rename from packages/@core/shared/toolkit/src/inference.test.ts
rename to packages/@core/base/shared/src/utils/inference.test.ts
diff --git a/packages/@core/shared/toolkit/src/inference.ts b/packages/@core/base/shared/src/utils/inference.ts
similarity index 100%
rename from packages/@core/shared/toolkit/src/inference.ts
rename to packages/@core/base/shared/src/utils/inference.ts
diff --git a/packages/@core/shared/toolkit/src/letter.test.ts b/packages/@core/base/shared/src/utils/letter.test.ts
similarity index 100%
rename from packages/@core/shared/toolkit/src/letter.test.ts
rename to packages/@core/base/shared/src/utils/letter.test.ts
diff --git a/packages/@core/shared/toolkit/src/letter.ts b/packages/@core/base/shared/src/utils/letter.ts
similarity index 100%
rename from packages/@core/shared/toolkit/src/letter.ts
rename to packages/@core/base/shared/src/utils/letter.ts
diff --git a/packages/@core/shared/toolkit/src/merge.ts b/packages/@core/base/shared/src/utils/merge.ts
similarity index 100%
rename from packages/@core/shared/toolkit/src/merge.ts
rename to packages/@core/base/shared/src/utils/merge.ts
diff --git a/packages/@core/shared/toolkit/src/nprogress.ts b/packages/@core/base/shared/src/utils/nprogress.ts
similarity index 100%
rename from packages/@core/shared/toolkit/src/nprogress.ts
rename to packages/@core/base/shared/src/utils/nprogress.ts
diff --git a/packages/@core/shared/toolkit/src/tree.test.ts b/packages/@core/base/shared/src/utils/tree.test.ts
similarity index 100%
rename from packages/@core/shared/toolkit/src/tree.test.ts
rename to packages/@core/base/shared/src/utils/tree.test.ts
diff --git a/packages/@core/shared/toolkit/src/tree.ts b/packages/@core/base/shared/src/utils/tree.ts
similarity index 100%
rename from packages/@core/shared/toolkit/src/tree.ts
rename to packages/@core/base/shared/src/utils/tree.ts
diff --git a/packages/@core/shared/toolkit/src/unique.test.ts b/packages/@core/base/shared/src/utils/unique.test.ts
similarity index 100%
rename from packages/@core/shared/toolkit/src/unique.test.ts
rename to packages/@core/base/shared/src/utils/unique.test.ts
diff --git a/packages/@core/shared/toolkit/src/unique.ts b/packages/@core/base/shared/src/utils/unique.ts
similarity index 100%
rename from packages/@core/shared/toolkit/src/unique.ts
rename to packages/@core/base/shared/src/utils/unique.ts
diff --git a/packages/@core/shared/toolkit/src/update-css-variables.test.ts b/packages/@core/base/shared/src/utils/update-css-variables.test.ts
similarity index 100%
rename from packages/@core/shared/toolkit/src/update-css-variables.test.ts
rename to packages/@core/base/shared/src/utils/update-css-variables.test.ts
diff --git a/packages/@core/shared/toolkit/src/update-css-variables.ts b/packages/@core/base/shared/src/utils/update-css-variables.ts
similarity index 100%
rename from packages/@core/shared/toolkit/src/update-css-variables.ts
rename to packages/@core/base/shared/src/utils/update-css-variables.ts
diff --git a/packages/@core/shared/toolkit/src/window.test.ts b/packages/@core/base/shared/src/utils/window.test.ts
similarity index 100%
rename from packages/@core/shared/toolkit/src/window.test.ts
rename to packages/@core/base/shared/src/utils/window.test.ts
diff --git a/packages/@core/shared/toolkit/src/window.ts b/packages/@core/base/shared/src/utils/window.ts
similarity index 100%
rename from packages/@core/shared/toolkit/src/window.ts
rename to packages/@core/base/shared/src/utils/window.ts
diff --git a/packages/@core/hooks/tsconfig.json b/packages/@core/base/shared/tsconfig.json
similarity index 100%
rename from packages/@core/hooks/tsconfig.json
rename to packages/@core/base/shared/tsconfig.json
diff --git a/packages/@core/shared/constants/build.config.ts b/packages/@core/base/typings/build.config.ts
similarity index 100%
rename from packages/@core/shared/constants/build.config.ts
rename to packages/@core/base/typings/build.config.ts
diff --git a/packages/@core/shared/typings/package.json b/packages/@core/base/typings/package.json
similarity index 94%
rename from packages/@core/shared/typings/package.json
rename to packages/@core/base/typings/package.json
index 28e5e4cc..103c22a1 100644
--- a/packages/@core/shared/typings/package.json
+++ b/packages/@core/base/typings/package.json
@@ -6,7 +6,7 @@
"repository": {
"type": "git",
"url": "git+https://github.com/vbenjs/vue-vben-admin.git",
- "directory": "packages/@vben-core/shared/typings"
+ "directory": "packages/@vben-core/base/typings"
},
"license": "MIT",
"type": "module",
diff --git a/packages/@core/shared/typings/src/app.d.ts b/packages/@core/base/typings/src/app.d.ts
similarity index 100%
rename from packages/@core/shared/typings/src/app.d.ts
rename to packages/@core/base/typings/src/app.d.ts
diff --git a/packages/@core/shared/typings/src/basic.d.ts b/packages/@core/base/typings/src/basic.d.ts
similarity index 100%
rename from packages/@core/shared/typings/src/basic.d.ts
rename to packages/@core/base/typings/src/basic.d.ts
diff --git a/packages/@core/shared/typings/src/helper.d.ts b/packages/@core/base/typings/src/helper.d.ts
similarity index 100%
rename from packages/@core/shared/typings/src/helper.d.ts
rename to packages/@core/base/typings/src/helper.d.ts
diff --git a/packages/@core/shared/typings/src/index.ts b/packages/@core/base/typings/src/index.ts
similarity index 100%
rename from packages/@core/shared/typings/src/index.ts
rename to packages/@core/base/typings/src/index.ts
diff --git a/packages/@core/shared/typings/src/menu-record.ts b/packages/@core/base/typings/src/menu-record.ts
similarity index 100%
rename from packages/@core/shared/typings/src/menu-record.ts
rename to packages/@core/base/typings/src/menu-record.ts
diff --git a/packages/@core/shared/typings/src/tabs.ts b/packages/@core/base/typings/src/tabs.ts
similarity index 100%
rename from packages/@core/shared/typings/src/tabs.ts
rename to packages/@core/base/typings/src/tabs.ts
diff --git a/packages/@core/shared/typings/src/vue-router.d.ts b/packages/@core/base/typings/src/vue-router.d.ts
similarity index 100%
rename from packages/@core/shared/typings/src/vue-router.d.ts
rename to packages/@core/base/typings/src/vue-router.d.ts
diff --git a/packages/@core/shared/constants/tsconfig.json b/packages/@core/base/typings/tsconfig.json
similarity index 100%
rename from packages/@core/shared/constants/tsconfig.json
rename to packages/@core/base/typings/tsconfig.json
diff --git a/packages/@core/shared/typings/vue-router.d.ts b/packages/@core/base/typings/vue-router.d.ts
similarity index 100%
rename from packages/@core/shared/typings/vue-router.d.ts
rename to packages/@core/base/typings/vue-router.d.ts
diff --git a/packages/@core/shared/icons/build.config.ts b/packages/@core/composables/build.config.ts
similarity index 100%
rename from packages/@core/shared/icons/build.config.ts
rename to packages/@core/composables/build.config.ts
diff --git a/packages/@core/hooks/package.json b/packages/@core/composables/package.json
similarity index 85%
rename from packages/@core/hooks/package.json
rename to packages/@core/composables/package.json
index b9ab34dd..7940ff3a 100644
--- a/packages/@core/hooks/package.json
+++ b/packages/@core/composables/package.json
@@ -1,12 +1,12 @@
{
- "name": "@vben-core/hooks",
+ "name": "@vben-core/composables",
"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/@core/hooks"
+ "directory": "packages/@core/composables"
},
"license": "MIT",
"type": "module",
@@ -35,8 +35,7 @@
}
},
"dependencies": {
- "@vben-core/constants": "workspace:*",
- "@vben-core/toolkit": "workspace:*",
+ "@vben-core/shared": "workspace:*",
"@vueuse/core": "^10.11.0",
"radix-vue": "^1.9.2",
"sortablejs": "^1.15.2",
diff --git a/packages/@core/hooks/src/index.ts b/packages/@core/composables/src/index.ts
similarity index 100%
rename from packages/@core/hooks/src/index.ts
rename to packages/@core/composables/src/index.ts
diff --git a/packages/@core/hooks/src/use-content-height.ts b/packages/@core/composables/src/use-content-height.ts
similarity index 88%
rename from packages/@core/hooks/src/use-content-height.ts
rename to packages/@core/composables/src/use-content-height.ts
index 529a9fef..701eba83 100644
--- a/packages/@core/hooks/src/use-content-height.ts
+++ b/packages/@core/composables/src/use-content-height.ts
@@ -1,7 +1,9 @@
import { computed, onMounted, ref, watch } from 'vue';
-import { CSS_VARIABLE_LAYOUT_CONTENT_HEIGHT } from '@vben-core/constants';
-import { getElementVisibleHeight } from '@vben-core/toolkit';
+import {
+ CSS_VARIABLE_LAYOUT_CONTENT_HEIGHT,
+ getElementVisibleHeight,
+} from '@vben-core/shared';
import { useCssVar, useDebounceFn, useWindowSize } from '@vueuse/core';
/**
diff --git a/packages/@core/hooks/src/use-namespace.ts b/packages/@core/composables/src/use-namespace.ts
similarity index 97%
rename from packages/@core/hooks/src/use-namespace.ts
rename to packages/@core/composables/src/use-namespace.ts
index dcef60d0..5aae03ad 100644
--- a/packages/@core/hooks/src/use-namespace.ts
+++ b/packages/@core/composables/src/use-namespace.ts
@@ -1,4 +1,4 @@
-import { DEFAULT_NAMESPACE } from '@vben-core/constants';
+import { DEFAULT_NAMESPACE } from '@vben-core/shared';
/**
* @see copy https://github.com/element-plus/element-plus/blob/dev/packages/hooks/use-namespace/index.ts
diff --git a/packages/@core/hooks/src/use-sortable.test.ts b/packages/@core/composables/src/use-sortable.test.ts
similarity index 100%
rename from packages/@core/hooks/src/use-sortable.test.ts
rename to packages/@core/composables/src/use-sortable.test.ts
diff --git a/packages/@core/hooks/src/use-sortable.ts b/packages/@core/composables/src/use-sortable.ts
similarity index 100%
rename from packages/@core/hooks/src/use-sortable.ts
rename to packages/@core/composables/src/use-sortable.ts
diff --git a/packages/@core/shared/toolkit/tsconfig.json b/packages/@core/composables/tsconfig.json
similarity index 100%
rename from packages/@core/shared/toolkit/tsconfig.json
rename to packages/@core/composables/tsconfig.json
diff --git a/packages/@core/preferences/package.json b/packages/@core/preferences/package.json
index 4d43c277..681386f8 100644
--- a/packages/@core/preferences/package.json
+++ b/packages/@core/preferences/package.json
@@ -29,7 +29,7 @@
}
},
"dependencies": {
- "@vben-core/toolkit": "workspace:*",
+ "@vben-core/shared": "workspace:*",
"@vben-core/typings": "workspace:*",
"@vueuse/core": "^10.11.0",
"vue": "^3.4.34"
diff --git a/packages/@core/preferences/src/preferences.ts b/packages/@core/preferences/src/preferences.ts
index 42cf9df8..18ceaac2 100644
--- a/packages/@core/preferences/src/preferences.ts
+++ b/packages/@core/preferences/src/preferences.ts
@@ -4,7 +4,7 @@ import type { InitialOptions, Preferences } from './types';
import { markRaw, reactive, readonly, watch } from 'vue';
-import { isMacOs, merge, StorageManager } from '@vben-core/toolkit';
+import { isMacOs, merge, StorageManager } from '@vben-core/shared';
import {
breakpointsTailwind,
diff --git a/packages/@core/preferences/src/update-css-variables.ts b/packages/@core/preferences/src/update-css-variables.ts
index 4b3c258d..790264fd 100644
--- a/packages/@core/preferences/src/update-css-variables.ts
+++ b/packages/@core/preferences/src/update-css-variables.ts
@@ -3,7 +3,7 @@ import type { Preferences } from './types';
import {
updateCSSVariables as executeUpdateCSSVariables,
generatorColorVariables,
-} from '@vben-core/toolkit';
+} from '@vben-core/shared';
import { BUILT_IN_THEME_PRESETS, type BuiltinThemePreset } from './constants';
diff --git a/packages/@core/preferences/src/use-preferences.ts b/packages/@core/preferences/src/use-preferences.ts
index e8a80f05..02526d64 100644
--- a/packages/@core/preferences/src/use-preferences.ts
+++ b/packages/@core/preferences/src/use-preferences.ts
@@ -1,6 +1,6 @@
import { computed } from 'vue';
-import { diff } from '@vben-core/toolkit';
+import { diff } from '@vben-core/shared';
import { isDarkTheme, preferencesManager } from './preferences';
diff --git a/packages/@core/shared/README.md b/packages/@core/shared/README.md
deleted file mode 100644
index 8fa45978..00000000
--- a/packages/@core/shared/README.md
+++ /dev/null
@@ -1,6 +0,0 @@
-# shared
-
-全局共享包,请勿引入 workspace 依赖
-
-- typings 共享类型
-- toolkit 共享工具类
diff --git a/packages/@core/shared/constants/package.json b/packages/@core/shared/constants/package.json
deleted file mode 100644
index 4deead68..00000000
--- a/packages/@core/shared/constants/package.json
+++ /dev/null
@@ -1,37 +0,0 @@
-{
- "name": "@vben-core/constants",
- "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/shared/constants"
- },
- "license": "MIT",
- "type": "module",
- "scripts": {
- "build": "pnpm unbuild"
- },
- "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"
- }
- }
- }
-}
diff --git a/packages/@core/shared/toolkit/build.config.ts b/packages/@core/shared/toolkit/build.config.ts
deleted file mode 100644
index 97e572c5..00000000
--- a/packages/@core/shared/toolkit/build.config.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import { defineBuildConfig } from 'unbuild';
-
-export default defineBuildConfig({
- clean: true,
- declaration: true,
- entries: ['src/index'],
-});
diff --git a/packages/@core/shared/typings/build.config.ts b/packages/@core/shared/typings/build.config.ts
deleted file mode 100644
index 97e572c5..00000000
--- a/packages/@core/shared/typings/build.config.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import { defineBuildConfig } from 'unbuild';
-
-export default defineBuildConfig({
- clean: true,
- declaration: true,
- entries: ['src/index'],
-});
diff --git a/packages/@core/shared/typings/tsconfig.json b/packages/@core/shared/typings/tsconfig.json
deleted file mode 100644
index f6860a32..00000000
--- a/packages/@core/shared/typings/tsconfig.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "$schema": "https://json.schemastore.org/tsconfig",
- "extends": "@vben/tsconfig/library.json",
- "include": ["src"],
- "exclude": ["node_modules"]
-}
diff --git a/packages/@core/ui-kit/layout-ui/package.json b/packages/@core/ui-kit/layout-ui/package.json
index 41a80500..74dad7f3 100644
--- a/packages/@core/ui-kit/layout-ui/package.json
+++ b/packages/@core/ui-kit/layout-ui/package.json
@@ -37,7 +37,7 @@
}
},
"dependencies": {
- "@vben-core/hooks": "workspace:*",
+ "@vben-core/composables": "workspace:*",
"@vben-core/icons": "workspace:*",
"@vben-core/shadcn-ui": "workspace:*",
"@vben-core/typings": "workspace:*",
diff --git a/packages/@core/ui-kit/layout-ui/src/components/layout-content.vue b/packages/@core/ui-kit/layout-ui/src/components/layout-content.vue
index 7f00d6de..297d3ca0 100644
--- a/packages/@core/ui-kit/layout-ui/src/components/layout-content.vue
+++ b/packages/@core/ui-kit/layout-ui/src/components/layout-content.vue
@@ -4,7 +4,7 @@ import type { ContentCompactType } from '@vben-core/typings';
import type { CSSProperties } from 'vue';
import { computed } from 'vue';
-import { useContentHeightListener } from '@vben-core/hooks';
+import { useContentHeightListener } from '@vben-core/composables';
interface Props {
/**
diff --git a/packages/@core/ui-kit/menu-ui/package.json b/packages/@core/ui-kit/menu-ui/package.json
index 68e15dde..a428be7e 100644
--- a/packages/@core/ui-kit/menu-ui/package.json
+++ b/packages/@core/ui-kit/menu-ui/package.json
@@ -37,10 +37,10 @@
}
},
"dependencies": {
- "@vben-core/hooks": "workspace:*",
+ "@vben-core/composables": "workspace:*",
"@vben-core/icons": "workspace:*",
"@vben-core/shadcn-ui": "workspace:*",
- "@vben-core/toolkit": "workspace:*",
+ "@vben-core/shared": "workspace:*",
"@vben-core/typings": "workspace:*",
"@vueuse/core": "^10.11.0",
"vue": "^3.4.34"
diff --git a/packages/@core/ui-kit/menu-ui/src/components/menu-item.vue b/packages/@core/ui-kit/menu-ui/src/components/menu-item.vue
index 76805bc3..19a77185 100644
--- a/packages/@core/ui-kit/menu-ui/src/components/menu-item.vue
+++ b/packages/@core/ui-kit/menu-ui/src/components/menu-item.vue
@@ -3,7 +3,7 @@ import type { MenuItemProps, MenuItemRegistered } from '../interface';
import { computed, onBeforeUnmount, onMounted, reactive, useSlots } from 'vue';
-import { useNamespace } from '@vben-core/hooks';
+import { useNamespace } from '@vben-core/composables';
import { VbenIcon, VbenMenuBadge, VbenTooltip } from '@vben-core/shadcn-ui';
import { useMenu, useMenuContext, useSubMenuContext } from '../hooks';
diff --git a/packages/@core/ui-kit/menu-ui/src/components/menu.vue b/packages/@core/ui-kit/menu-ui/src/components/menu.vue
index 32dae1ea..fda8bb6c 100644
--- a/packages/@core/ui-kit/menu-ui/src/components/menu.vue
+++ b/packages/@core/ui-kit/menu-ui/src/components/menu.vue
@@ -18,9 +18,9 @@ import {
watchEffect,
} from 'vue';
-import { useNamespace } from '@vben-core/hooks';
+import { useNamespace } from '@vben-core/composables';
import { Ellipsis } from '@vben-core/icons';
-import { isHttpUrl } from '@vben-core/toolkit';
+import { isHttpUrl } from '@vben-core/shared';
import { useResizeObserver, UseResizeObserverReturn } from '@vueuse/core';
diff --git a/packages/@core/ui-kit/menu-ui/src/components/normal-menu/normal-menu.vue b/packages/@core/ui-kit/menu-ui/src/components/normal-menu/normal-menu.vue
index fbd9986c..7cb29e51 100644
--- a/packages/@core/ui-kit/menu-ui/src/components/normal-menu/normal-menu.vue
+++ b/packages/@core/ui-kit/menu-ui/src/components/normal-menu/normal-menu.vue
@@ -3,7 +3,7 @@ import type { MenuRecordRaw } from '@vben-core/typings';
import type { NormalMenuProps } from './normal-menu';
-import { useNamespace } from '@vben-core/hooks';
+import { useNamespace } from '@vben-core/composables';
import { VbenIcon } from '@vben-core/shadcn-ui';
interface Props extends NormalMenuProps {}
diff --git a/packages/@core/ui-kit/menu-ui/src/components/sub-menu-content.vue b/packages/@core/ui-kit/menu-ui/src/components/sub-menu-content.vue
index e015fd06..a4ec2b7e 100644
--- a/packages/@core/ui-kit/menu-ui/src/components/sub-menu-content.vue
+++ b/packages/@core/ui-kit/menu-ui/src/components/sub-menu-content.vue
@@ -3,7 +3,7 @@ import type { MenuItemProps } from '../interface';
import { computed } from 'vue';
-import { useNamespace } from '@vben-core/hooks';
+import { useNamespace } from '@vben-core/composables';
import { ChevronDown, ChevronRight } from '@vben-core/icons';
import { VbenIcon } from '@vben-core/shadcn-ui';
diff --git a/packages/@core/ui-kit/menu-ui/src/components/sub-menu.vue b/packages/@core/ui-kit/menu-ui/src/components/sub-menu.vue
index 334e9c3f..e4b9795d 100644
--- a/packages/@core/ui-kit/menu-ui/src/components/sub-menu.vue
+++ b/packages/@core/ui-kit/menu-ui/src/components/sub-menu.vue
@@ -9,7 +9,7 @@ import type {
import { computed, onBeforeUnmount, onMounted, reactive, ref } from 'vue';
-import { useNamespace } from '@vben-core/hooks';
+import { useNamespace } from '@vben-core/composables';
import { VbenHoverCard } from '@vben-core/shadcn-ui';
import {
diff --git a/packages/@core/ui-kit/menu-ui/src/menu.vue b/packages/@core/ui-kit/menu-ui/src/menu.vue
index 24b15552..f2ad8dfd 100644
--- a/packages/@core/ui-kit/menu-ui/src/menu.vue
+++ b/packages/@core/ui-kit/menu-ui/src/menu.vue
@@ -1,7 +1,7 @@
diff --git a/packages/@core/ui-kit/shadcn-ui/src/components/ui/dialog/DialogHeader.vue b/packages/@core/ui-kit/shadcn-ui/src/components/ui/dialog/DialogHeader.vue
index 28851d23..5f0f0757 100644
--- a/packages/@core/ui-kit/shadcn-ui/src/components/ui/dialog/DialogHeader.vue
+++ b/packages/@core/ui-kit/shadcn-ui/src/components/ui/dialog/DialogHeader.vue
@@ -1,7 +1,7 @@
diff --git a/packages/@core/ui-kit/shadcn-ui/src/components/ui/pin-input/PinInput.vue b/packages/@core/ui-kit/shadcn-ui/src/components/ui/pin-input/PinInput.vue
index 8ca6dee0..faa7382e 100644
--- a/packages/@core/ui-kit/shadcn-ui/src/components/ui/pin-input/PinInput.vue
+++ b/packages/@core/ui-kit/shadcn-ui/src/components/ui/pin-input/PinInput.vue
@@ -1,7 +1,7 @@
diff --git a/packages/@core/ui-kit/shadcn-ui/src/components/ui/sheet/SheetHeader.vue b/packages/@core/ui-kit/shadcn-ui/src/components/ui/sheet/SheetHeader.vue
index 7d3e8b28..323cace5 100644
--- a/packages/@core/ui-kit/shadcn-ui/src/components/ui/sheet/SheetHeader.vue
+++ b/packages/@core/ui-kit/shadcn-ui/src/components/ui/sheet/SheetHeader.vue
@@ -1,7 +1,7 @@
diff --git a/packages/@core/ui-kit/shadcn-ui/src/components/ui/sheet/SheetTitle.vue b/packages/@core/ui-kit/shadcn-ui/src/components/ui/sheet/SheetTitle.vue
index 2a1d603f..a84cf0b6 100644
--- a/packages/@core/ui-kit/shadcn-ui/src/components/ui/sheet/SheetTitle.vue
+++ b/packages/@core/ui-kit/shadcn-ui/src/components/ui/sheet/SheetTitle.vue
@@ -1,7 +1,7 @@
diff --git a/website/src/guide/other/faq.md b/website/src/guide/other/faq.md
index 65a17959..e3bc4722 100644
--- a/website/src/guide/other/faq.md
+++ b/website/src/guide/other/faq.md
@@ -26,8 +26,6 @@
解决方式是每次更新代码的时候修改 `package.json` 内的 `version` 版本号. 因为 localStorage 的 key 是根据版本号来的。所以更新后版本不同前面的配置会失效。重新登录即可
-`VUE_VBEN_ADMIN__DEVELOPMENT__2.0.3__COMMON__LOCAL__KEY__` key 的组成是 [项目名]+[开发环境]+[版本号]+[key]
-
## 关于修改配置文件的问题
当修改 `.env` 等环境文件以及 `vite.config.ts` 文件时,vite 会自动重启服务。