Summary
一键将 @yunyoujun/docs 集成到 VitePress 文档项目,自动安装依赖并接入 getViteConfig / getVitepressConfig。适用于用户提到“集成 @yunyoujun/docs”、“配置 VitePress 文档基础设施”、“接入 UnoCSS 和组件自动导入”、“迁移现有…
yunyoujun/docs · Archived
一键将 @yunyoujun/docs 集成到 VitePress 文档项目,自动安?
npx skills add yunyoujun/docs --skill setup-yunyoujun-docs
一键将 @yunyoujun/docs 集成到 VitePress 文档项目,自动安装依赖并接入 getViteConfig / getVitepressConfig。适用于用户提到“集成 @yunyoujun/docs”、“配置 VitePress 文档基础设施”、“接入 UnoCSS 和组件自动导入”、“迁移现有…
This repository is archived — consider an actively maintained alternative.
Set up AI Runway on AKS — from bare cluster to running model. Covers cluster verification, cont…
314.8K installsGuides for configuring Prisma with different database providers (PostgreSQL, MySQL, SQLite, Mon…
269.8K installsSet up a new Prisma Postgres database and connect it to a local project using the Management AP…
257.4K installsSafely modifies Xcode projects (.pbxproj) to add Swift Packages and link files. Use this skill …
104.1K installsDeclared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.
main
Parsed from SKILL.md frontmatter.
Files included with this skill beyond the listing page.
SKILL.md
5,413 B
SUMMARY.md
445 B
为 VitePress 文档项目接入 @yunyoujun/docs 预设,并在不破坏现有配置的前提下完成依赖安装与配置合并。
完成后项目应具备:
getViteConfig() 集成(Vite 插件链路)getVitepressConfig() 集成(VitePress 默认站点配置)uno.css 与 virtual:group-icons.cssdocs:dev 或 docs:build- docs/(常见) - 仓库根目录(单项目)
- Vite 配置:vite.config.ts、vite.config.mts、docs/vite.config.ts、docs/vite.config.mts - VitePress 配置:.vitepress/config.ts、.vitepress/config.mts、.vitepress/config/index.ts、.vitepress/config/index.mts(含 docs/ 前缀变体) - 主题入口:.vitepress/theme/index.ts(含 docs/ 前缀变体)
references/integration-templates.md)。优先根据锁文件选择包管理器(pnpm-lock.yaml > package-lock.json > yarn.lock),默认使用 pnpm。
在文档项目目录执行安装(例如 docs/ 子项目则使用 pnpm -C docs):
# 文档项目位于仓库根目录
pnpm add -D @yunyoujun/docs unocss unplugin-vue-components vite-plugin-vue-devtools @shikijs/vitepress-twoslash
# 文档项目位于 docs/ 子目录
pnpm -C docs add -D @yunyoujun/docs unocss unplugin-vue-components vite-plugin-vue-devtools @shikijs/vitepress-twoslash
说明:
@yunyoujun/docs 提供预设 API。unocss、unplugin-vue-components、vite-plugin-vue-devtools、@shikijs/vitepress-twoslash 由预设链路使用,建议一并安装。在目标 Vite 配置中:
getViteConfig。优先使用以下结构(可按现有风格调整):
import { getViteConfig } from '@yunyoujun/docs'
import { defineConfig } from 'vite'
const viteConfig = getViteConfig({})
export default defineConfig({
...viteConfig,
})
在 VitePress 配置中:
getVitepressConfig 与 defineConfig。vpConfig 展开,并保留用户现有 title、description、themeConfig。repo 以自动生成 editLink 与 socialLinks。推荐结构:
import { getVitepressConfig } from '@yunyoujun/docs'
import { defineConfig } from 'vitepress'
const vpConfig = getVitepressConfig({
repo: 'https://github.com/<owner>/<repo>',
})
export default defineConfig({
...vpConfig,
themeConfig: {
...vpConfig.themeConfig,
},
})
在 .vitepress/theme/index.ts 确保包含:
import 'uno.css'
import 'virtual:group-icons.css'
如果文件不存在,按模板创建并继承默认主题(见参考模板)。
按项目脚本执行最小验证:
pnpm lint(若存在)pnpm typecheck(若存在)pnpm docs:build(根脚本)或 pnpm -C docs run build(子项目脚本)若命令不存在,使用最接近的可用脚本,并在结果中明确说明替代命令。
ts/mts、单引号/双引号)。@yunyoujun/docs,但未安装 unocss 等配套依赖,导致运行时报模块缺失。themeConfig 合并时漏掉 ...vpConfig.themeConfig,导致默认搜索/大纲配置丢失。docs/ 子项目与根目录配置混用,导致改动文件未被实际加载。uno.css,样式类不生效。unknown,再断言为当前项目的 UserConfig:import type { UserConfig } from 'vitepress'
const vpConfig = getVitepressConfig({
repo: 'https://github.com/<owner>/<repo>',
}) as unknown as UserConfig
最终回复应包含: