From 70f155eabd8ddaf55a24af4f24b6cf51f79437c8 Mon Sep 17 00:00:00 2001 From: daguanren21 <1363917353@qq.com> Date: Sun, 13 Sep 2026 17:47:15 +0800 Subject: [PATCH] fix(docs): restore overview catalogs --- apps/docs/.vitepress/theme/index.ts | 4 + apps/docs/components/index.md | 2 + apps/docs/e2e/docs-smoke.spec.ts | 10 +- apps/docs/en/components/index.md | 2 + apps/docs/en/primitives/index.md | 4 + apps/docs/primitives/index.md | 4 + apps/docs/src/components/ComponentCatalog.vue | 551 ++++++++++++++++++ apps/docs/src/components/PrimitiveCatalog.vue | 377 ++++++++++++ apps/docs/src/docs-navigation.test.ts | 4 +- 9 files changed, 951 insertions(+), 7 deletions(-) create mode 100644 apps/docs/src/components/ComponentCatalog.vue create mode 100644 apps/docs/src/components/PrimitiveCatalog.vue diff --git a/apps/docs/.vitepress/theme/index.ts b/apps/docs/.vitepress/theme/index.ts index 4958c422..5b1b0494 100644 --- a/apps/docs/.vitepress/theme/index.ts +++ b/apps/docs/.vitepress/theme/index.ts @@ -29,6 +29,7 @@ import { import DefaultTheme from 'vitepress/theme' import AgentComponentDemo from '../../src/components/AgentComponentDemo.vue' import AgentComponentsDemo from '../../src/components/AgentComponentsDemo.vue' +import ComponentCatalog from '../../src/components/ComponentCatalog.vue' import DateFieldDemo from '../../src/components/DateFieldDemo.vue' import FormComponentDemo from '../../src/components/FormComponentDemo.vue' import InteractivePreview from '../../src/components/InteractivePreview.vue' @@ -36,6 +37,7 @@ import ListDemo from '../../src/components/ListDemo.vue' import MapDemo from '../../src/components/MapDemo.vue' import MiniProgramBlocksGallery from '../../src/components/MiniProgramBlocksGallery.vue' import PlatformTabsDemo from '../../src/components/PlatformTabsDemo.vue' +import PrimitiveCatalog from '../../src/components/PrimitiveCatalog.vue' import PrimitiveExample from '../../src/components/PrimitiveExample.vue' import PrimitiveInteractionDemo from '../../src/components/PrimitiveInteractionDemo.vue' import PullRefreshDemo from '../../src/components/PullRefreshDemo.vue' @@ -60,11 +62,13 @@ const theme: Theme = { app.component('FormComponentDemo', FormComponentDemo) app.component('InteractivePreview', InteractivePreview) app.component('ListDemo', ListDemo) + app.component('ComponentCatalog', ComponentCatalog) app.component('MiniProgramBlocksGallery', MiniProgramBlocksGallery) app.component('MapDemo', MapDemo) app.component('RobotChatDemo', RobotChatDemo) app.component('PlatformTabsDemo', PlatformTabsDemo) app.component('PullRefreshDemo', PullRefreshDemo) + app.component('PrimitiveCatalog', PrimitiveCatalog) app.component('PrimitiveExample', PrimitiveExample) app.component('SignatureDemo', SignatureDemo) app.component('WatermarkDemo', WatermarkDemo) diff --git a/apps/docs/components/index.md b/apps/docs/components/index.md index af1df935..093eb907 100644 --- a/apps/docs/components/index.md +++ b/apps/docs/components/index.md @@ -7,3 +7,5 @@ outline: false # 组件 选择组件查看双端演示、用法和 API。 + + diff --git a/apps/docs/e2e/docs-smoke.spec.ts b/apps/docs/e2e/docs-smoke.spec.ts index 3a6fbe61..950938e9 100644 --- a/apps/docs/e2e/docs-smoke.spec.ts +++ b/apps/docs/e2e/docs-smoke.spec.ts @@ -23,7 +23,7 @@ describe('docs smoke baseline', () => { } }) - it('keeps one concise headless install surface and linked detail pages', () => { + it('keeps one headless install surface and restores the overview catalogs', () => { const config = readFileSync(resolve(docsRoot, '.vitepress/config.ts'), 'utf8') const zhOverview = readFileSync(resolve(docsRoot, 'primitives/index.md'), 'utf8') const enOverview = readFileSync(resolve(docsRoot, 'en/primitives/index.md'), 'utf8') @@ -32,10 +32,10 @@ describe('docs smoke baseline', () => { expect(zhOverview).toContain('pnpm add @varo-ui/headless @varo-ui/h5') expect(enOverview).toContain('pnpm add @varo-ui/headless @varo-ui/weapp') - expect(zhOverview).not.toContain('') + expect(enOverview).toContain('') + expect(zhComponents).toContain('') + expect(enComponents).toContain('') expect(config).toContain('/blocks/build-your-own') expect(config).toContain('/en/blocks/build-your-own') expect(existsSync(resolve(docsRoot, 'blocks/build-your-own.md'))).toBe(true) diff --git a/apps/docs/en/components/index.md b/apps/docs/en/components/index.md index f34e5d55..a37c5bdc 100644 --- a/apps/docs/en/components/index.md +++ b/apps/docs/en/components/index.md @@ -7,3 +7,5 @@ outline: false # Components Choose a component to view its demos, usage, and API. + + diff --git a/apps/docs/en/primitives/index.md b/apps/docs/en/primitives/index.md index bf4df878..41a504ac 100644 --- a/apps/docs/en/primitives/index.md +++ b/apps/docs/en/primitives/index.md @@ -23,3 +23,7 @@ See [Wevu Registry](/en/guide/shadcn-mode) for global styles and Tailwind config | `@varo-ui/headless` | Platform-neutral state and events | | `@varo-ui/h5/primitives` | DOM, keyboard, and ARIA | | `@varo-ui/weapp/primitives` | WXML, touch, and native events | + +## Catalog + + diff --git a/apps/docs/primitives/index.md b/apps/docs/primitives/index.md index b74917c8..508d7a67 100644 --- a/apps/docs/primitives/index.md +++ b/apps/docs/primitives/index.md @@ -23,3 +23,7 @@ pnpm add @varo-ui/headless @varo-ui/weapp | `@varo-ui/headless` | 平台中立状态与事件 | | `@varo-ui/h5/primitives` | DOM、键盘与 ARIA | | `@varo-ui/weapp/primitives` | WXML、触摸与原生事件 | + +## 目录 + + diff --git a/apps/docs/src/components/ComponentCatalog.vue b/apps/docs/src/components/ComponentCatalog.vue new file mode 100644 index 00000000..e4fc1e01 --- /dev/null +++ b/apps/docs/src/components/ComponentCatalog.vue @@ -0,0 +1,551 @@ + + + + + diff --git a/apps/docs/src/components/PrimitiveCatalog.vue b/apps/docs/src/components/PrimitiveCatalog.vue new file mode 100644 index 00000000..a6c72c61 --- /dev/null +++ b/apps/docs/src/components/PrimitiveCatalog.vue @@ -0,0 +1,377 @@ + + + + + diff --git a/apps/docs/src/docs-navigation.test.ts b/apps/docs/src/docs-navigation.test.ts index 85435822..788f9519 100644 --- a/apps/docs/src/docs-navigation.test.ts +++ b/apps/docs/src/docs-navigation.test.ts @@ -80,8 +80,8 @@ describe('docs navigation', () => { expect(primitiveZh).toContain('pnpm add @varo-ui/headless @varo-ui/weapp') expect(primitiveEn).toContain('pnpm add @varo-ui/headless @varo-ui/h5') expect(primitiveEn).toContain('pnpm add @varo-ui/headless @varo-ui/weapp') - expect(primitiveZh).not.toContain('') + expect(primitiveEn).toContain('') expect(primitiveZh).not.toContain('