@movk/nuxt-docs 1.10.0 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -29
- package/app/mdc.config.ts +0 -2
- package/app/templates/releases.vue +25 -22
- package/content.config.ts +2 -2
- package/nuxt.config.ts +34 -13
- package/package.json +12 -13
package/README.md
CHANGED
|
@@ -83,37 +83,14 @@ pnpm dev
|
|
|
83
83
|
在现有 Nuxt 项目中使用 Movk Nuxt Docs 作为 layer:
|
|
84
84
|
|
|
85
85
|
```bash [Terminal]
|
|
86
|
-
|
|
87
|
-
pnpm add @movk/nuxt-docs better-sqlite3
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
在 CSS 中导入 Tailwind CSS 和 Nuxt UI
|
|
91
|
-
|
|
92
|
-
```css [app/assets/css/main.css]
|
|
93
|
-
@import 'tailwindcss';
|
|
94
|
-
@import '@nuxt/ui';
|
|
86
|
+
pnpm add @movk/nuxt-docs better-sqlite3 tailwindcss
|
|
95
87
|
```
|
|
96
88
|
|
|
97
89
|
在 `nuxt.config.ts` 中配置:
|
|
98
90
|
|
|
99
91
|
```ts [nuxt.config.ts]
|
|
100
92
|
export default defineNuxtConfig({
|
|
101
|
-
extends: ['@movk/nuxt-docs']
|
|
102
|
-
css: ['~/assets/css/main.css'],
|
|
103
|
-
aiChat: {
|
|
104
|
-
model: 'mistral/devstral-2',
|
|
105
|
-
models: ['mistral/devstral-2', 'openrouter/qwen/qwen3-4b:free']
|
|
106
|
-
},
|
|
107
|
-
mcp: {
|
|
108
|
-
name: 'My Docs',
|
|
109
|
-
browserRedirect: '/docs'
|
|
110
|
-
},
|
|
111
|
-
llms: {
|
|
112
|
-
domain: 'https://your-domain.com',
|
|
113
|
-
title: 'My Docs',
|
|
114
|
-
description: '基于 Movk Nuxt Docs 构建的智能文档站点',
|
|
115
|
-
notes: ['Nuxt 4', '文档主题', 'TypeScript']
|
|
116
|
-
}
|
|
93
|
+
+ extends: ['@movk/nuxt-docs']
|
|
117
94
|
})
|
|
118
95
|
```
|
|
119
96
|
|
|
@@ -126,18 +103,16 @@ export default defineNuxtConfig({
|
|
|
126
103
|
```bash
|
|
127
104
|
my-docs/
|
|
128
105
|
├── app/
|
|
129
|
-
│ ├── assets/css/main.css # 全局样式
|
|
130
106
|
│ └── composables/ # 自定义 Composables
|
|
131
107
|
├── content/ # Markdown 内容
|
|
132
108
|
│ ├── index.md # 首页
|
|
133
109
|
│ └── docs/ # 文档页面
|
|
134
110
|
├── public/ # 静态资源
|
|
135
111
|
├── nuxt.config.ts # Nuxt 配置
|
|
136
|
-
├── app.config.ts # 应用配置
|
|
137
|
-
├── content.config.ts # 内容配置
|
|
138
112
|
├── tsconfig.json # TypeScript 配置
|
|
139
113
|
├── package.json # 依赖与脚本
|
|
140
|
-
|
|
114
|
+
├── .env.example # 环境变量示例
|
|
115
|
+
└── pnpm-workspace.yaml # pnpm 工作区配置
|
|
141
116
|
```
|
|
142
117
|
|
|
143
118
|
### Monorepo 结构
|
package/app/mdc.config.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { defineConfig } from '@nuxtjs/mdc/config'
|
|
2
|
-
import { transformerColorHighlight } from 'shiki-transformer-color-highlight'
|
|
3
2
|
import { transformerIconHighlight } from './utils/shiki-transformer-icon-highlight'
|
|
4
3
|
|
|
5
4
|
export default defineConfig({
|
|
6
5
|
shiki: {
|
|
7
6
|
transformers: [
|
|
8
|
-
transformerColorHighlight(),
|
|
9
7
|
transformerIconHighlight()
|
|
10
8
|
]
|
|
11
9
|
}
|
|
@@ -21,32 +21,32 @@ defineOgImageComponent('Nuxt', {
|
|
|
21
21
|
description
|
|
22
22
|
})
|
|
23
23
|
|
|
24
|
-
const { data: versions } =
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
24
|
+
const { data: versions } = page.value.releases
|
|
25
|
+
? await useFetch(page.value.releases, {
|
|
26
|
+
server: false,
|
|
27
|
+
transform: (data: {
|
|
28
|
+
releases: {
|
|
29
|
+
name?: string
|
|
30
|
+
tag: string
|
|
31
|
+
publishedAt: string
|
|
32
|
+
markdown: string
|
|
33
|
+
}[]
|
|
34
|
+
}) => data.releases.map(release => ({
|
|
35
|
+
tag: release.tag,
|
|
36
|
+
title: release.name || release.tag,
|
|
37
|
+
date: release.publishedAt,
|
|
38
|
+
markdown: release.markdown
|
|
39
|
+
}))
|
|
40
|
+
})
|
|
41
|
+
: { data: ref(null) }
|
|
42
42
|
</script>
|
|
43
43
|
|
|
44
44
|
<template>
|
|
45
45
|
<main v-if="page">
|
|
46
46
|
<UPageHero
|
|
47
|
-
:title="page.hero.title"
|
|
48
|
-
:description="page.hero.description"
|
|
49
|
-
:links="(page.hero
|
|
47
|
+
:title="page.hero?.title || page.title"
|
|
48
|
+
:description="page.hero?.description || page.description"
|
|
49
|
+
:links="(page.hero?.links as ButtonProps[]) || []"
|
|
50
50
|
class="md:border-b border-default"
|
|
51
51
|
:ui="{ container: 'relative py-10 sm:py-16 lg:py-24' }"
|
|
52
52
|
>
|
|
@@ -61,8 +61,11 @@ const { data: versions } = await useFetch(page.value.releases || '', {
|
|
|
61
61
|
|
|
62
62
|
<UPageSection :ui="{ container: 'py-0!' }">
|
|
63
63
|
<div class="py-4 md:py-8 lg:py-16 md:border-x border-default">
|
|
64
|
-
<UContainer class="max-w-5xl">
|
|
64
|
+
<UContainer class="flex flex-col max-w-5xl gap-y-8 sm:gap-y-12 lg:gap-y-16">
|
|
65
|
+
<ContentRenderer v-if="page.body" :value="page" />
|
|
66
|
+
|
|
65
67
|
<UChangelogVersions
|
|
68
|
+
v-if="versions?.length"
|
|
66
69
|
as="main"
|
|
67
70
|
:indicator-motion="false"
|
|
68
71
|
:ui="{
|
package/content.config.ts
CHANGED
package/nuxt.config.ts
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { defineNuxtConfig } from 'nuxt/config'
|
|
2
2
|
import pkg from './package.json'
|
|
3
3
|
|
|
4
|
+
// WASM runtime imports that Rollup should not attempt to resolve
|
|
5
|
+
const WASM_EXTERNALS = ['env', 'wasi_snapshot_preview1']
|
|
6
|
+
|
|
7
|
+
function mergeExternals(existing: unknown, additions: string[]): string[] {
|
|
8
|
+
if (Array.isArray(existing)) return [...existing, ...additions]
|
|
9
|
+
if (typeof existing === 'string') return [existing, ...additions]
|
|
10
|
+
return additions
|
|
11
|
+
}
|
|
12
|
+
|
|
4
13
|
export default defineNuxtConfig({
|
|
5
14
|
modules: [
|
|
6
15
|
'@nuxt/ui',
|
|
@@ -51,11 +60,6 @@ export default defineNuxtConfig({
|
|
|
51
60
|
}
|
|
52
61
|
},
|
|
53
62
|
|
|
54
|
-
routeRules: {
|
|
55
|
-
'/llms.txt': { isr: true },
|
|
56
|
-
'/llms-full.txt': { isr: true }
|
|
57
|
-
},
|
|
58
|
-
|
|
59
63
|
experimental: {
|
|
60
64
|
asyncContext: true,
|
|
61
65
|
defaults: {
|
|
@@ -76,8 +80,8 @@ export default defineNuxtConfig({
|
|
|
76
80
|
},
|
|
77
81
|
|
|
78
82
|
hooks: {
|
|
79
|
-
|
|
80
|
-
|
|
83
|
+
'vite:extendConfig': async (config) => {
|
|
84
|
+
// Rewrite optimizeDeps paths for layer architecture
|
|
81
85
|
const include = config.optimizeDeps?.include
|
|
82
86
|
if (!include) return
|
|
83
87
|
|
|
@@ -86,11 +90,32 @@ export default defineNuxtConfig({
|
|
|
86
90
|
if (layerPkgs.test(id)) include[i] = `@movk/nuxt-docs > ${id}`
|
|
87
91
|
})
|
|
88
92
|
|
|
89
|
-
// Layer dependencies that need pre-bundling
|
|
90
93
|
include.push(
|
|
91
94
|
'@movk/nuxt-docs > @nuxt/content > slugify',
|
|
92
95
|
'@movk/nuxt-docs > @ai-sdk/gateway > @vercel/oidc'
|
|
93
96
|
)
|
|
97
|
+
|
|
98
|
+
// WASM plugin support for Shiki
|
|
99
|
+
const [wasm, topLevelAwait] = await Promise.all([
|
|
100
|
+
import('vite-plugin-wasm'),
|
|
101
|
+
import('vite-plugin-top-level-await')
|
|
102
|
+
])
|
|
103
|
+
config.plugins!.push(wasm.default(), topLevelAwait.default())
|
|
104
|
+
|
|
105
|
+
const build = config.build || ((config as any).build = {})
|
|
106
|
+
build.rollupOptions ??= {}
|
|
107
|
+
build.rollupOptions.external = mergeExternals(
|
|
108
|
+
build.rollupOptions.external,
|
|
109
|
+
WASM_EXTERNALS
|
|
110
|
+
)
|
|
111
|
+
},
|
|
112
|
+
|
|
113
|
+
'nitro:config': (nitroConfig) => {
|
|
114
|
+
nitroConfig.rollupConfig ??= {}
|
|
115
|
+
nitroConfig.rollupConfig.external = mergeExternals(
|
|
116
|
+
nitroConfig.rollupConfig.external,
|
|
117
|
+
WASM_EXTERNALS
|
|
118
|
+
)
|
|
94
119
|
}
|
|
95
120
|
},
|
|
96
121
|
|
|
@@ -137,13 +162,9 @@ export default defineNuxtConfig({
|
|
|
137
162
|
|
|
138
163
|
ogImage: {
|
|
139
164
|
zeroRuntime: true,
|
|
140
|
-
googleFontMirror: 'fonts.loli.net',
|
|
141
165
|
fonts: [
|
|
142
166
|
'Noto+Sans+SC:400',
|
|
143
|
-
'
|
|
144
|
-
'Noto+Sans+SC:700',
|
|
145
|
-
'Inter:400',
|
|
146
|
-
'Inter:700'
|
|
167
|
+
'Inter:400'
|
|
147
168
|
]
|
|
148
169
|
}
|
|
149
170
|
})
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@movk/nuxt-docs",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.11.0",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "Modern Nuxt 4 documentation theme with auto-generated component docs, AI chat assistant, MCP server, and complete developer experience optimization.",
|
|
7
7
|
"author": "YiXuan <mhaibaraai@gmail.com>",
|
|
@@ -30,12 +30,10 @@
|
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@ai-sdk/gateway": "^3.0.29",
|
|
33
|
-
"@ai-sdk/mcp": "^1.0.
|
|
34
|
-
"@ai-sdk/vue": "^3.0.
|
|
33
|
+
"@ai-sdk/mcp": "^1.0.16",
|
|
34
|
+
"@ai-sdk/vue": "^3.0.64",
|
|
35
35
|
"@iconify-json/lucide": "^1.2.87",
|
|
36
|
-
"@iconify-json/ph": "^1.2.2",
|
|
37
36
|
"@iconify-json/simple-icons": "^1.2.68",
|
|
38
|
-
"@iconify-json/tabler": "^1.2.26",
|
|
39
37
|
"@iconify-json/vscode-icons": "^1.2.40",
|
|
40
38
|
"@movk/core": "^1.1.0",
|
|
41
39
|
"@nuxt/a11y": "^1.0.0-alpha.1",
|
|
@@ -49,9 +47,9 @@
|
|
|
49
47
|
"@openrouter/ai-sdk-provider": "^2.1.1",
|
|
50
48
|
"@vercel/analytics": "^1.6.1",
|
|
51
49
|
"@vercel/speed-insights": "^1.3.1",
|
|
52
|
-
"@vueuse/core": "^14.
|
|
53
|
-
"@vueuse/nuxt": "^14.
|
|
54
|
-
"ai": "^6.0.
|
|
50
|
+
"@vueuse/core": "^14.2.0",
|
|
51
|
+
"@vueuse/nuxt": "^14.2.0",
|
|
52
|
+
"ai": "^6.0.64",
|
|
55
53
|
"defu": "^6.1.4",
|
|
56
54
|
"dompurify": "^3.3.1",
|
|
57
55
|
"exsolve": "^1.0.8",
|
|
@@ -68,13 +66,14 @@
|
|
|
68
66
|
"pkg-types": "^2.3.0",
|
|
69
67
|
"prettier": "^3.8.1",
|
|
70
68
|
"scule": "^1.3.0",
|
|
71
|
-
"shiki": "^3.
|
|
69
|
+
"shiki": "^3.22.0",
|
|
72
70
|
"shiki-stream": "^0.1.4",
|
|
73
|
-
"shiki-transformer-color-highlight": "^1.0.0",
|
|
74
|
-
"tailwindcss": "^4.1.18",
|
|
75
71
|
"tailwind-merge": "^3.4.0",
|
|
72
|
+
"tailwindcss": "^4.1.18",
|
|
76
73
|
"ufo": "^1.6.3",
|
|
77
|
-
"
|
|
78
|
-
"
|
|
74
|
+
"vue-component-meta": "^3.2.4",
|
|
75
|
+
"vite-plugin-top-level-await": "^1.6.0",
|
|
76
|
+
"vite-plugin-wasm": "^3.5.0",
|
|
77
|
+
"zod": "^4.3.6"
|
|
79
78
|
}
|
|
80
79
|
}
|