+
diff --git a/docs/.vitepress/config/plugins/demo-preview.ts b/docs/.vitepress/config/plugins/demo-preview.ts
index 03b1698c..ba3863b0 100644
--- a/docs/.vitepress/config/plugins/demo-preview.ts
+++ b/docs/.vitepress/config/plugins/demo-preview.ts
@@ -84,7 +84,7 @@ export const demoPreviewPlugin = (md: MarkdownRenderer) => {
return '';
}
const firstString = 'index.vue';
- childFiles = childFiles.sort((a, b) => {
+ childFiles = childFiles.toSorted((a, b) => {
if (a === firstString) return -1;
if (b === firstString) return 1;
return a.localeCompare(b, 'en', { sensitivity: 'base' });
diff --git a/docs/src/demos/vben-drawer/auto-height/drawer.vue b/docs/src/demos/vben-drawer/auto-height/drawer.vue
index 9ab433cc..1b09723c 100644
--- a/docs/src/demos/vben-drawer/auto-height/drawer.vue
+++ b/docs/src/demos/vben-drawer/auto-height/drawer.vue
@@ -32,7 +32,7 @@ function handleUpdate(len: number) {
{{ item }}
diff --git a/docs/src/demos/vben-modal/auto-height/modal.vue b/docs/src/demos/vben-modal/auto-height/modal.vue
index 8757d5ef..e270df1a 100644
--- a/docs/src/demos/vben-modal/auto-height/modal.vue
+++ b/docs/src/demos/vben-modal/auto-height/modal.vue
@@ -32,7 +32,7 @@ function handleUpdate(len: number) {
{{ item }}
diff --git a/internal/lint-configs/commitlint-config/index.mjs b/internal/lint-configs/commitlint-config/index.mjs
index ede26986..d88166e4 100644
--- a/internal/lint-configs/commitlint-config/index.mjs
+++ b/internal/lint-configs/commitlint-config/index.mjs
@@ -21,7 +21,7 @@ const scopeComplete = execSync('git status --porcelain || true')
.trim()
.split('\n')
.find((r) => ~r.indexOf('M src'))
- ?.replace(/(\/)/g, '%%')
+ ?.replaceAll(/(\/)/g, '%%')
?.match(/src%%((\w|-)*)/)?.[1]
?.replace(/s$/, '');
diff --git a/internal/lint-configs/eslint-config/src/configs/command.ts b/internal/lint-configs/eslint-config/src/configs/command.ts
index 67651b23..d0c902de 100644
--- a/internal/lint-configs/eslint-config/src/configs/command.ts
+++ b/internal/lint-configs/eslint-config/src/configs/command.ts
@@ -3,7 +3,6 @@ import createCommand from 'eslint-plugin-command/config';
export async function command() {
return [
{
- // @ts-expect-error - no types
...createCommand(),
},
];
diff --git a/internal/lint-configs/eslint-config/src/configs/node.ts b/internal/lint-configs/eslint-config/src/configs/node.ts
index fa960d85..f8f26643 100644
--- a/internal/lint-configs/eslint-config/src/configs/node.ts
+++ b/internal/lint-configs/eslint-config/src/configs/node.ts
@@ -35,7 +35,7 @@ export async function node(): Promise
{
'error',
{
ignores: [],
- version: '>=18.0.0',
+ version: '>=20.12.0',
},
],
'n/prefer-global/buffer': ['error', 'never'],
diff --git a/internal/lint-configs/eslint-config/src/configs/perfectionist.ts b/internal/lint-configs/eslint-config/src/configs/perfectionist.ts
index 136bfa33..4a7d12fe 100644
--- a/internal/lint-configs/eslint-config/src/configs/perfectionist.ts
+++ b/internal/lint-configs/eslint-config/src/configs/perfectionist.ts
@@ -4,7 +4,6 @@ import { interopDefault } from '../util';
export async function perfectionist(): Promise {
const perfectionistPlugin = await interopDefault(
- // @ts-expect-error - no types
import('eslint-plugin-perfectionist'),
);
diff --git a/internal/lint-configs/eslint-config/src/configs/turbo.ts b/internal/lint-configs/eslint-config/src/configs/turbo.ts
index 9f6bf75b..bcc27eb6 100644
--- a/internal/lint-configs/eslint-config/src/configs/turbo.ts
+++ b/internal/lint-configs/eslint-config/src/configs/turbo.ts
@@ -4,7 +4,6 @@ import { interopDefault } from '../util';
export async function turbo(): Promise {
const [pluginTurbo] = await Promise.all([
- // @ts-expect-error - no types
interopDefault(import('eslint-config-turbo')),
] as const);
diff --git a/internal/lint-configs/eslint-config/src/configs/typescript.ts b/internal/lint-configs/eslint-config/src/configs/typescript.ts
index cff9aa4b..2f6f9765 100644
--- a/internal/lint-configs/eslint-config/src/configs/typescript.ts
+++ b/internal/lint-configs/eslint-config/src/configs/typescript.ts
@@ -5,7 +5,6 @@ import { interopDefault } from '../util';
export async function typescript(): Promise {
const [pluginTs, parserTs] = await Promise.all([
interopDefault(import('@typescript-eslint/eslint-plugin')),
- // @ts-expect-error missing types
interopDefault(import('@typescript-eslint/parser')),
] as const);
@@ -27,11 +26,11 @@ export async function typescript(): Promise {
},
},
plugins: {
- '@typescript-eslint': pluginTs,
+ '@typescript-eslint': pluginTs as any,
},
rules: {
- ...pluginTs.configs['eslint-recommended'].overrides?.[0].rules,
- ...pluginTs.configs.strict.rules,
+ ...pluginTs.configs['eslint-recommended']?.overrides?.[0]?.rules,
+ ...pluginTs.configs.strict?.rules,
'@typescript-eslint/ban-ts-comment': [
'error',
{
diff --git a/internal/lint-configs/eslint-config/src/configs/vue.ts b/internal/lint-configs/eslint-config/src/configs/vue.ts
index a64c55af..5db72992 100644
--- a/internal/lint-configs/eslint-config/src/configs/vue.ts
+++ b/internal/lint-configs/eslint-config/src/configs/vue.ts
@@ -6,7 +6,6 @@ export async function vue(): Promise {
const [pluginVue, parserVue, parserTs] = await Promise.all([
interopDefault(import('eslint-plugin-vue')),
interopDefault(import('vue-eslint-parser')),
- // @ts-expect-error missing types
interopDefault(import('@typescript-eslint/parser')),
] as const);
diff --git a/internal/lint-configs/eslint-config/tsconfig.json b/internal/lint-configs/eslint-config/tsconfig.json
index b2ec3b61..dbd3bcc8 100644
--- a/internal/lint-configs/eslint-config/tsconfig.json
+++ b/internal/lint-configs/eslint-config/tsconfig.json
@@ -1,6 +1,9 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "@vben/tsconfig/node.json",
+ "compilerOptions": {
+ "moduleResolution": "bundler"
+ },
"include": ["src"],
"exclude": ["node_modules"]
}
diff --git a/internal/tailwind-config/package.json b/internal/tailwind-config/package.json
index 07b26be4..269558cd 100644
--- a/internal/tailwind-config/package.json
+++ b/internal/tailwind-config/package.json
@@ -53,6 +53,7 @@
"@tailwindcss/typography": "catalog:",
"autoprefixer": "catalog:",
"cssnano": "catalog:",
+ "jiti": "catalog:",
"postcss": "catalog:",
"postcss-antd-fixes": "catalog:",
"postcss-import": "catalog:",
diff --git a/internal/vite-config/src/config/application.ts b/internal/vite-config/src/config/application.ts
index f9808cc7..a5d33c60 100644
--- a/internal/vite-config/src/config/application.ts
+++ b/internal/vite-config/src/config/application.ts
@@ -114,7 +114,7 @@ function createCssOptions(injectGlobalScss = true): CSSOptions {
}
return content;
},
- api: 'modern',
+ // api: 'modern',
importers: [new NodePackageImporter()],
},
}
diff --git a/package.json b/package.json
index ace03ad2..b59d1c30 100644
--- a/package.json
+++ b/package.json
@@ -88,14 +88,14 @@
"unbuild": "catalog:",
"vite": "catalog:",
"vitest": "catalog:",
- "vue": "^3.5.24",
+ "vue": "catalog:",
"vue-tsc": "catalog:"
},
"engines": {
- "node": ">=20.10.0",
- "pnpm": ">=9.12.0"
+ "node": ">=20.12.0",
+ "pnpm": ">=10.0.0"
},
- "packageManager": "pnpm@10.14.0",
+ "packageManager": "pnpm@10.22.0",
"pnpm": {
"peerDependencyRules": {
"allowedVersions": {
@@ -107,9 +107,9 @@
"@ctrl/tinycolor": "catalog:",
"clsx": "catalog:",
"esbuild": "0.25.3",
+ "jiti": "catalog:",
"pinia": "catalog:",
- "vue": "catalog:",
- "jiti": "^2.6.1"
+ "vue": "catalog:"
},
"neverBuiltDependencies": [
"canvas",
diff --git a/packages/@core/base/design/src/css/global.css b/packages/@core/base/design/src/css/global.css
index d1999098..dc154fc7 100644
--- a/packages/@core/base/design/src/css/global.css
+++ b/packages/@core/base/design/src/css/global.css
@@ -14,8 +14,9 @@
}
html {
- @apply text-foreground bg-background font-sans text-[100%];
+ @apply text-foreground bg-background font-sans;
+ font-size: var(--font-size-base, 16px);
font-variation-settings: normal;
line-height: 1.15;
text-size-adjust: 100%;
diff --git a/packages/@core/base/design/src/design-tokens/default.css b/packages/@core/base/design/src/design-tokens/default.css
index ab692d07..1b5d36ac 100644
--- a/packages/@core/base/design/src/design-tokens/default.css
+++ b/packages/@core/base/design/src/design-tokens/default.css
@@ -93,6 +93,7 @@
/* 基本文字大小 */
--font-size-base: 16px;
+ --menu-font-size: calc(var(--font-size-base) * 0.875);
/* =============component & UI============= */
diff --git a/packages/@core/base/design/src/design-tokens/index.ts b/packages/@core/base/design/src/design-tokens/index.ts
index 2d031d81..4bf1467d 100644
--- a/packages/@core/base/design/src/design-tokens/index.ts
+++ b/packages/@core/base/design/src/design-tokens/index.ts
@@ -1,4 +1,2 @@
import './default.css';
import './dark.css';
-
-export {};
diff --git a/packages/@core/base/design/src/index.ts b/packages/@core/base/design/src/index.ts
index d7c05340..952caef7 100644
--- a/packages/@core/base/design/src/index.ts
+++ b/packages/@core/base/design/src/index.ts
@@ -4,5 +4,3 @@ import './css/global.css';
import './css/transition.css';
import './css/nprogress.css';
import './css/ui.css';
-
-export {};
diff --git a/packages/@core/preferences/__tests__/__snapshots__/config.test.ts.snap b/packages/@core/preferences/__tests__/__snapshots__/config.test.ts.snap
index c526bb16..488f0069 100644
--- a/packages/@core/preferences/__tests__/__snapshots__/config.test.ts.snap
+++ b/packages/@core/preferences/__tests__/__snapshots__/config.test.ts.snap
@@ -113,6 +113,7 @@ exports[`defaultPreferences immutability test > should not modify the config obj
"colorPrimary": "hsl(215 100% 54%)",
"colorSuccess": "hsl(144 57% 58%)",
"colorWarning": "hsl(42 84% 61%)",
+ "fontSize": 16,
"mode": "dark",
"radius": "0.5",
"semiDarkHeader": false,
diff --git a/packages/@core/preferences/src/config.ts b/packages/@core/preferences/src/config.ts
index f1d26234..0f4ec88b 100644
--- a/packages/@core/preferences/src/config.ts
+++ b/packages/@core/preferences/src/config.ts
@@ -116,6 +116,7 @@ const defaultPreferences: Preferences = {
colorWarning: 'hsl(42 84% 61%)',
mode: 'auto',
radius: '0.5',
+ fontSize: 16,
semiDarkHeader: false,
semiDarkSidebar: false,
},
diff --git a/packages/@core/preferences/src/preferences.ts b/packages/@core/preferences/src/preferences.ts
index 23c5f8be..7fb245e3 100644
--- a/packages/@core/preferences/src/preferences.ts
+++ b/packages/@core/preferences/src/preferences.ts
@@ -141,7 +141,10 @@ class PreferenceManager {
private handleUpdates(updates: DeepPartial) {
const themeUpdates = updates.theme || {};
const appUpdates = updates.app || {};
- if (themeUpdates && Object.keys(themeUpdates).length > 0) {
+ if (
+ (themeUpdates && Object.keys(themeUpdates).length > 0) ||
+ Reflect.has(themeUpdates, 'fontSize')
+ ) {
updateCSSVariables(this.state);
}
@@ -221,12 +224,8 @@ class PreferenceManager {
const dom = document.documentElement;
const COLOR_WEAK = 'invert-mode';
const COLOR_GRAY = 'grayscale-mode';
- colorWeakMode
- ? dom.classList.add(COLOR_WEAK)
- : dom.classList.remove(COLOR_WEAK);
- colorGrayMode
- ? dom.classList.add(COLOR_GRAY)
- : dom.classList.remove(COLOR_GRAY);
+ dom.classList.toggle(COLOR_WEAK, colorWeakMode);
+ dom.classList.toggle(COLOR_GRAY, colorGrayMode);
}
}
}
diff --git a/packages/@core/preferences/src/types.ts b/packages/@core/preferences/src/types.ts
index 9a4d94bd..17224b04 100644
--- a/packages/@core/preferences/src/types.ts
+++ b/packages/@core/preferences/src/types.ts
@@ -239,6 +239,8 @@ interface ThemePreferences {
colorSuccess: string;
/** 警告色 */
colorWarning: string;
+ /** 字体大小(单位:px) */
+ fontSize: number;
/** 当前主题 */
mode: ThemeModeType;
/** 圆角 */
diff --git a/packages/@core/preferences/src/update-css-variables.ts b/packages/@core/preferences/src/update-css-variables.ts
index 0d3466a0..6ee5f748 100644
--- a/packages/@core/preferences/src/update-css-variables.ts
+++ b/packages/@core/preferences/src/update-css-variables.ts
@@ -66,6 +66,19 @@ function updateCSSVariables(preferences: Preferences) {
if (Reflect.has(theme, 'radius')) {
document.documentElement.style.setProperty('--radius', `${radius}rem`);
}
+
+ // 更新字体大小
+ if (Reflect.has(theme, 'fontSize')) {
+ const fontSize = theme.fontSize;
+ document.documentElement.style.setProperty(
+ '--font-size-base',
+ `${fontSize}px`,
+ );
+ document.documentElement.style.setProperty(
+ '--menu-font-size',
+ `calc(${fontSize}px * 0.875)`,
+ );
+ }
}
/**
diff --git a/packages/@core/ui-kit/form-ui/src/form-render/form-field.vue b/packages/@core/ui-kit/form-ui/src/form-render/form-field.vue
index 7e187c50..28a81beb 100644
--- a/packages/@core/ui-kit/form-ui/src/form-render/form-field.vue
+++ b/packages/@core/ui-kit/form-ui/src/form-render/form-field.vue
@@ -339,7 +339,7 @@ onUnmounted(() => {
:is="FieldComponent"
ref="fieldComponentRef"
:class="{
- 'border-destructive focus:border-destructive hover:border-destructive/80 focus:shadow-[0_0_0_2px_rgba(255,38,5,0.06)]':
+ 'border-destructive hover:border-destructive/80 focus:border-destructive focus:shadow-[0_0_0_2px_rgba(255,38,5,0.06)]':
isInValid,
}"
v-bind="createComponentProps(slotProps)"
@@ -367,7 +367,7 @@ onUnmounted(() => {
diff --git a/packages/@core/ui-kit/form-ui/src/form-render/form-label.vue b/packages/@core/ui-kit/form-ui/src/form-render/form-label.vue
index 3c4fdd0a..f1a5249b 100644
--- a/packages/@core/ui-kit/form-ui/src/form-render/form-label.vue
+++ b/packages/@core/ui-kit/form-ui/src/form-render/form-label.vue
@@ -17,7 +17,7 @@ const props = defineProps();
- *
+ *
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 af066f84..1cdca86f 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
@@ -1,10 +1,14 @@
-
+
diff --git a/packages/@core/ui-kit/layout-ui/src/components/layout-footer.vue b/packages/@core/ui-kit/layout-ui/src/components/layout-footer.vue
index 129209da..3793f922 100644
--- a/packages/@core/ui-kit/layout-ui/src/components/layout-footer.vue
+++ b/packages/@core/ui-kit/layout-ui/src/components/layout-footer.vue
@@ -37,7 +37,7 @@ const style = computed((): CSSProperties => {
diff --git a/packages/@core/ui-kit/layout-ui/src/components/layout-header.vue b/packages/@core/ui-kit/layout-ui/src/components/layout-header.vue
index 534e4162..fba07d4e 100644
--- a/packages/@core/ui-kit/layout-ui/src/components/layout-header.vue
+++ b/packages/@core/ui-kit/layout-ui/src/components/layout-header.vue
@@ -64,7 +64,7 @@ const logoStyle = computed((): CSSProperties => {
diff --git a/packages/@core/ui-kit/shadcn-ui/src/components/back-top/back-top.vue b/packages/@core/ui-kit/shadcn-ui/src/components/back-top/back-top.vue
index 1f8b0bc7..8da6cde4 100644
--- a/packages/@core/ui-kit/shadcn-ui/src/components/back-top/back-top.vue
+++ b/packages/@core/ui-kit/shadcn-ui/src/components/back-top/back-top.vue
@@ -32,7 +32,7 @@ const { handleClick, visible } = useBackTop(props);