Skip to content

Commit 1a385e7

Browse files
committed
chore: upgrade VuePress to 2.0 RC and modernize docs site
- Upgrade VuePress from 2.0.0-beta.36 to 2.0.0-rc.26 - Upgrade dependencies: Prettier 3.x, Husky 9.x, pretty-quick 4.x - Add @vuepress/bundler-vite and @vuepress/theme-default - Migrate config.ts to new VuePress 2 RC format - Add custom dark tech theme with SCSS styles - Update Husky hooks to v9 format - Update type imports (NavbarConfig → NavbarOptions, etc.)
1 parent cc5e584 commit 1a385e7

10 files changed

Lines changed: 2789 additions & 1938 deletions

File tree

.husky/pre-commit

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
41
pnpm format:staged

.vuepress/config.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import type { DefaultThemeOptions } from 'vuepress';
1+
import { viteBundler } from '@vuepress/bundler-vite';
2+
import { defaultTheme } from '@vuepress/theme-default';
23
import { defineUserConfig } from 'vuepress';
34
import { navbar, sidebar } from './configs';
45

5-
export default defineUserConfig<DefaultThemeOptions>({
6+
export default defineUserConfig({
67
// 站点配置
78
lang: 'zh-CN',
89
title: 'Distributed Update System',
@@ -23,9 +24,11 @@ export default defineUserConfig<DefaultThemeOptions>({
2324
},
2425
},
2526

27+
// 打包工具
28+
bundler: viteBundler(),
29+
2630
// 主题配置
27-
theme: '@vuepress/theme-default',
28-
themeConfig: {
31+
theme: defaultTheme({
2932
logo: '/logo.png',
3033
repo: 'DUpdateSystem',
3134
locales: {
@@ -60,7 +63,7 @@ export default defineUserConfig<DefaultThemeOptions>({
6063

6164
// a11y
6265
openInNewWindow: '在新窗口打开',
63-
toggleDarkMode: '切换夜间模式',
66+
toggleColorMode: '切换颜色模式',
6467
toggleSidebar: '切换侧边栏',
6568
},
6669

@@ -79,5 +82,7 @@ export default defineUserConfig<DefaultThemeOptions>({
7982

8083
docsRepo: 'DUpdateSystem/docs',
8184
docsBranch: 'master',
82-
},
85+
colorMode: 'dark',
86+
colorModeSwitch: true,
87+
}),
8388
});

.vuepress/configs/navbar/en.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import type { NavbarConfig } from '@vuepress/theme-default';
1+
import type { NavbarOptions } from '@vuepress/theme-default';
22

3-
export const en: NavbarConfig = [
3+
export const en: NavbarOptions = [
44
{ text: 'User Guide', link: '/en/guide/' },
55
{ text: 'FAQ', link: '/en/faq/' },
66
{ text: 'Developer Documentation', link: '/en/dev/' },

.vuepress/configs/navbar/zh.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import type { NavbarConfig } from '@vuepress/theme-default';
1+
import type { NavbarOptions } from '@vuepress/theme-default';
22

3-
export const zh: NavbarConfig = [
3+
export const zh: NavbarOptions = [
44
{ text: '用户指南', link: '/guide/' },
55
{ text: '常见问题', link: '/faq/' },
66
{ text: '开发者文档', link: '/dev/' },

.vuepress/configs/sidebar/en.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import type { SidebarConfig } from '@vuepress/theme-default';
1+
import type { SidebarOptions } from '@vuepress/theme-default';
22

3-
export const en: SidebarConfig = [
3+
export const en: SidebarOptions = [
44
'/en/guide/README.md',
55
'/en/faq/README.md',
66
{

.vuepress/configs/sidebar/zh.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import type { SidebarConfig } from '@vuepress/theme-default';
1+
import type { SidebarOptions } from '@vuepress/theme-default';
22

3-
export const zh: SidebarConfig = [
3+
export const zh: SidebarOptions = [
44
'/guide/README.md',
55
'/faq/README.md',
66
{

0 commit comments

Comments
 (0)