Skip to content

fix(docs/.vitepress/config): 修复docs/.vitepress/config.ts 文件中 typeScri…#30

Merged
webfanzc merged 1 commit intoZ-TEAM-Z:mainfrom
wshiqyuan:fix/docs-config
Jan 27, 2026
Merged

fix(docs/.vitepress/config): 修复docs/.vitepress/config.ts 文件中 typeScri…#30
webfanzc merged 1 commit intoZ-TEAM-Z:mainfrom
wshiqyuan:fix/docs-config

Conversation

@wshiqyuan
Copy link
Contributor

@wshiqyuan wshiqyuan commented Jan 27, 2026

…pt 类型不兼容错误。

-- 错误原因: docs 依赖2.5.0版本的@shikijs/vitepress-twoslash 但vitepress本身依赖了3.x版本的@shikijs相关包,导致了冲突。
-- 解决办法: 将docs catalog中的@shikijs/vitepress-twoslash更新到兼容的版本
-- 其他修改: index文件的修改是因为可能是新版本的@shikijs/vitepress-twoslash与Vue的类型定义不兼容造成新的TypeScript错误, 使用了类型断言解决了这个问题

Summary by CodeRabbit

发行说明

  • 维护
    • 更新文档构建相关的依赖版本与工作区覆盖配置,确保文档依赖一致性。
    • 改进文档主题插件的类型声明与注册方式(仅类型层面调整,无运行时行为变更)。

✏️ Tip: You can customize this high-level summary in your review settings.

…pt 类型不兼容错误。

    -- 错误原因: docs 依赖2.5.0版本的@shikijs/vitepress-twoslash 但vitepress本身依赖了3.x版本的@shikijs相关包,导致了冲突。
    -- 解决办法: 将docs catalog中的@shikijs/vitepress-twoslash更新到兼容的版本
    -- 其他修改: index文件的修改是因为可能是新版本的@shikijs/vitepress-twoslash与Vue的类型定义不兼容造成新的TypeScript错误, 使用了类型断言解决了这个问题
@coderabbitai
Copy link

coderabbitai bot commented Jan 27, 2026

Walkthrough

此 PR 在 VitePress 主题配置中为插件添加了 Vue Plugin 类型断言,并在 pnpm-workspace.yaml 中将 @shikijs/vitepress-twoslash 升级至 ^3.12.2,同时新增 @shikijs/types: 3.12.2 的 overrides 条目。

Changes

Cohort / File(s) Change summary
VitePress 主题类型
docs/.vitepress/theme/index.ts
新增 import type { Plugin } from 'vue',将 app.use(TwoslashFloatingVue) 改为 app.use(TwoslashFloatingVue as Plugin),仅为编译时类型断言。
工作区依赖声明
pnpm-workspace.yaml
在顶层添加 overrides: { '@shikijs/types': 3.12.2 },并将 catalogs.docs@shikijs/vitepress-twoslash 版本从 ^2.5.0 更新为 ^3.12.2

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 新版来了我跳跃,
类型断言轻声说,
依赖升级风轻抚,
小改动,大安心,
咻—插件跳入花丛里 🌸

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 拉取请求标题涉及修复 TypeScript 类型冲突问题,与实际更改内容(版本更新和类型断言)相关联。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 27, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@zelpis/builder@30
npm i https://pkg.pr.new/@zelpis/core@30
npm i https://pkg.pr.new/@zelpis/render@30
npm i https://pkg.pr.new/@zelpis/shared@30

commit: 8bfd4c4

@cmtlyt
Copy link
Member

cmtlyt commented Jan 27, 2026

@coderabbitai full review

@coderabbitai
Copy link

coderabbitai bot commented Jan 27, 2026

✅ Actions performed

Full review triggered.

@cmtlyt
Copy link
Member

cmtlyt commented Jan 27, 2026

@webfanzc cc

@cmtlyt cmtlyt requested a review from webfanzc January 27, 2026 09:47
@webfanzc
Copy link
Contributor

@webfanzc cc

lgtm

@webfanzc webfanzc merged commit 435c162 into Z-TEAM-Z:main Jan 27, 2026
3 checks passed
@wshiqyuan wshiqyuan deleted the fix/docs-config branch January 28, 2026 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants