@vite-hub/docs 0.0.0 → 0.3.1
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/LICENSE +201 -0
- package/README.md +454 -0
- package/dist/agent-copy-BJp_Yf5d.js +33 -0
- package/dist/assistant-shared-CdtXowot.js +97 -0
- package/dist/assistant-shared-Dll_F_yy.d.ts +27 -0
- package/dist/assistant-worker.d.ts +11 -0
- package/dist/assistant-worker.js +16 -0
- package/dist/assistant.d.ts +14 -0
- package/dist/assistant.js +19 -0
- package/dist/content-9CINWiRf.js +171 -0
- package/dist/draft-DUBx--r9.js +45 -0
- package/dist/error-diagnostics-BoOsP6Y4.js +53 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.js +27 -0
- package/dist/link-checker-redirects.d.ts +13 -0
- package/dist/link-checker-redirects.js +25 -0
- package/dist/manifest-D66AEF8F.js +420 -0
- package/dist/manifest-Dzp5-_AJ.d.ts +74 -0
- package/dist/markdown-Cn9-4oVG.js +378 -0
- package/dist/navigation.d.ts +284 -0
- package/dist/navigation.js +520 -0
- package/dist/nuxt-B5LrERKc.d.ts +240 -0
- package/dist/nuxt.d.ts +3 -0
- package/dist/nuxt.js +1485 -0
- package/dist/page-BbmSfZO8.js +81 -0
- package/dist/page-Dx2JD3y1.d.ts +74 -0
- package/dist/primitive-rail.d.ts +110 -0
- package/dist/primitive-rail.js +284 -0
- package/dist/raw-C03EUJKw.js +851 -0
- package/dist/redirects-BrbWFSzW.js +62 -0
- package/dist/runtime/app/app.vue +11 -0
- package/dist/runtime/app/assistant/DocsAssistant.vue +81 -0
- package/dist/runtime/app/assistant/DocsAssistantOff.vue +8 -0
- package/dist/runtime/app/assistant/DocsAssistantPanel.vue +322 -0
- package/dist/runtime/app/components/AppHeader.vue +368 -0
- package/dist/runtime/app/components/AppSearch.vue +68 -0
- package/dist/runtime/app/components/DocsAppShell.vue +62 -0
- package/dist/runtime/app/components/DocsArticle.vue +184 -0
- package/dist/runtime/app/components/DocsAsideFooter.vue +94 -0
- package/dist/runtime/app/components/DocsAsideLeftBody.vue +584 -0
- package/dist/runtime/app/components/DocsAsideLeftTop.vue +132 -0
- package/dist/runtime/app/components/DocsBrandMark.vue +52 -0
- package/dist/runtime/app/components/DocsCatalogFooter.vue +129 -0
- package/dist/runtime/app/components/DocsCodePanel.vue +388 -0
- package/dist/runtime/app/components/DocsCodePre.vue +120 -0
- package/dist/runtime/app/components/DocsHeaderActions.vue +4 -0
- package/dist/runtime/app/components/DocsLanding.vue +83 -0
- package/dist/runtime/app/components/DocsMarkdown.vue +64 -0
- package/dist/runtime/app/components/DocsPage.vue +149 -0
- package/dist/runtime/app/components/DocsPageCredits.vue +41 -0
- package/dist/runtime/app/components/DocsPageHeaderLinks.vue +120 -0
- package/dist/runtime/app/components/DocsRail.vue +239 -0
- package/dist/runtime/app/components/DocsSidebarStrip.vue +81 -0
- package/dist/runtime/app/components/DocsSidebars.vue +63 -0
- package/dist/runtime/app/components/OgImage/DocsPage.takumi.vue +33 -0
- package/dist/runtime/app/components/content/AgentOnly.vue +9 -0
- package/dist/runtime/app/components/content/CodeTree.vue +203 -0
- package/dist/runtime/app/components/content/ComarkHtml.vue +31 -0
- package/dist/runtime/app/components/content/Correct.vue +17 -0
- package/dist/runtime/app/components/content/Example.vue +260 -0
- package/dist/runtime/app/components/content/ExamplePreview.vue +6 -0
- package/dist/runtime/app/components/content/Examples.vue +71 -0
- package/dist/runtime/app/components/content/Incorrect.vue +17 -0
- package/dist/runtime/app/components/content/PageList.vue +206 -0
- package/dist/runtime/app/components/content/ProductFeatureItem.vue +43 -0
- package/dist/runtime/app/components/content/ProductFeatures.vue +17 -0
- package/dist/runtime/app/components/content/TutorialStep.vue +39 -0
- package/dist/runtime/app/composables/docs-assistant-problem.ts +59 -0
- package/dist/runtime/app/composables/docs-theme.ts +15 -0
- package/dist/runtime/app/composables/docs.ts +83 -0
- package/dist/runtime/app/composables/headerActions.ts +6 -0
- package/dist/runtime/app/composables/icons.ts +14 -0
- package/dist/runtime/app/composables/seo.ts +64 -0
- package/dist/runtime/app/composables/tutorial.ts +40 -0
- package/dist/runtime/app/composables/useDocsAssistant.ts +17 -0
- package/dist/runtime/app/error.vue +88 -0
- package/dist/runtime/app/layouts/default.vue +7 -0
- package/dist/runtime/app/layouts/docs.vue +104 -0
- package/dist/runtime/app/middleware/docs-layout.ts +23 -0
- package/dist/runtime/app/pages/docs-page.vue +3 -0
- package/dist/runtime/app/plugins/comark-css.ts +14 -0
- package/dist/runtime/app/plugins/icon-stroke.ts +12 -0
- package/dist/runtime/app/plugins/theme-color.ts +18 -0
- package/dist/runtime/app/utils/docs-theme.ts +43 -0
- package/dist/runtime/app/utils/file-tree.ts +40 -0
- package/dist/runtime/server/llms.d.ts +6 -0
- package/dist/runtime/server/llms.js +7 -0
- package/dist/runtime/server/markdown.d.ts +10 -0
- package/dist/runtime/server/markdown.js +11 -0
- package/dist/runtime/server/mcp.d.ts +6 -0
- package/dist/runtime/server/mcp.js +7 -0
- package/dist/runtime/server/page.d.ts +7 -0
- package/dist/runtime/server/page.js +27 -0
- package/dist/runtime/server/raw.d.ts +10 -0
- package/dist/runtime/server/raw.js +23 -0
- package/dist/runtime/server/search.d.ts +6 -0
- package/dist/runtime/server/search.js +32 -0
- package/dist/runtime/server/sitemap.d.ts +6 -0
- package/dist/runtime/server/sitemap.js +52 -0
- package/dist/runtime/server/trailing-slash.d.ts +10 -0
- package/dist/runtime/server/trailing-slash.js +28 -0
- package/dist/runtime/theme/design.css +464 -0
- package/dist/schema-DwpXW0VZ.js +98 -0
- package/dist/server.d.ts +15 -0
- package/dist/server.js +5 -0
- package/dist/theme-BXyu4uFL.d.ts +32 -0
- package/dist/theme-DzC8LtMH.js +237 -0
- package/dist/theme.d.ts +2 -0
- package/dist/theme.js +2 -0
- package/dist/types-BhG6vGfG.d.ts +212 -0
- package/package.json +144 -1
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import { vitehubTheme } from "@vite-hub/ui/theme";
|
|
2
|
+
import { defu } from "defu";
|
|
3
|
+
//#region runtime/app/utils/docs-theme.ts
|
|
4
|
+
/**
|
|
5
|
+
* The theme as `<UTheme>` props, for the docs pages of an app with its own `app.vue`. The app's `app.config.ts` then
|
|
6
|
+
* stays as written on the app's own pages. `<UTheme>` sets slot classes and default props only, so the docs pages keep
|
|
7
|
+
* the app's colors, icons, and variant classes, such as the color of a callout.
|
|
8
|
+
*/
|
|
9
|
+
function docsThemeScope(theme) {
|
|
10
|
+
const scope = {
|
|
11
|
+
ui: {},
|
|
12
|
+
props: {}
|
|
13
|
+
};
|
|
14
|
+
for (const [name, entry] of Object.entries(theme)) {
|
|
15
|
+
if (name === "colors" || name === "icons" || !isRecord$1(entry)) continue;
|
|
16
|
+
if (name === "prose") {
|
|
17
|
+
const prose = docsThemeScope(entry);
|
|
18
|
+
scope.ui.prose = prose.ui;
|
|
19
|
+
if (Object.keys(prose.props).length) scope.props.prose = prose.props;
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
const slots = isRecord$1(entry.slots) ? entry.slots : typeof entry.base === "string" ? { base: entry.base } : null;
|
|
23
|
+
if (slots) scope.ui[name] = slots;
|
|
24
|
+
if (isRecord$1(entry.defaultVariants)) scope.props[name] = entry.defaultVariants;
|
|
25
|
+
}
|
|
26
|
+
return scope;
|
|
27
|
+
}
|
|
28
|
+
function isRecord$1(value) {
|
|
29
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/theme.ts
|
|
33
|
+
/**
|
|
34
|
+
* The `ui` app config of the site. What the app writes in its Nuxt config wins over the design, and the design wins
|
|
35
|
+
* over the rest, such as the green and slate defaults that Nuxt UI adds when the app lists `@nuxt/ui` before this
|
|
36
|
+
* module. `app.config.ts` still wins over all of it at runtime.
|
|
37
|
+
*/
|
|
38
|
+
function docsAppConfigUi(design, current, configured) {
|
|
39
|
+
return [
|
|
40
|
+
...configured,
|
|
41
|
+
design,
|
|
42
|
+
current
|
|
43
|
+
].reduce((merged, layer) => defu(merged, layer ?? {}), {});
|
|
44
|
+
}
|
|
45
|
+
function callout(icon) {
|
|
46
|
+
return {
|
|
47
|
+
base: "border-default bg-muted text-default dark:text-default [&>ul]:marker:text-muted [&_code]:text-default dark:[&_code]:text-default [&_code]:border-default [&_a]:text-default [&_a]:hover:text-highlighted [&_a]:hover:border-default [&_a]:hover:[&>code]:border-default [&_a]:hover:[&>code]:text-highlighted",
|
|
48
|
+
icon
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
const framedTabs = "my-5 gap-0 rounded-lg border border-default";
|
|
52
|
+
/**
|
|
53
|
+
* The docs design: the ViteHub design system (`vitehubTheme`) plus the slots that only the docs shell has, such as the
|
|
54
|
+
* header with search in the middle, the rail of areas next to a page list, the page grid, the outline, and prose.
|
|
55
|
+
*/
|
|
56
|
+
function docsUi(siteName) {
|
|
57
|
+
return defu({
|
|
58
|
+
container: { base: "w-full max-w-none mx-0 px-0 sm:px-0 lg:px-0" },
|
|
59
|
+
header: {
|
|
60
|
+
defaultVariants: { menu: {
|
|
61
|
+
title: "Navigation",
|
|
62
|
+
description: `${siteName} site navigation`
|
|
63
|
+
} },
|
|
64
|
+
slots: {
|
|
65
|
+
root: "vh-grain-surface border-b border-default h-(--ui-header-height) sticky top-0 z-50",
|
|
66
|
+
container: "flex items-center justify-between gap-4 h-full max-w-none !ps-[1.125rem] !pe-4 lg:grid lg:grid-cols-[minmax(max-content,1fr)_minmax(12rem,24rem)_minmax(max-content,1fr)]",
|
|
67
|
+
left: "flex min-w-0 items-center gap-8",
|
|
68
|
+
center: "hidden lg:flex lg:w-full lg:items-center",
|
|
69
|
+
right: "flex items-center justify-end gap-1",
|
|
70
|
+
title: "shrink-0 font-semibold text-sm text-highlighted flex items-center gap-2 tracking-normal",
|
|
71
|
+
toggle: "lg:hidden"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
pageAside: { slots: {
|
|
75
|
+
root: "hidden h-[calc(100dvh-var(--ui-header-height))] overflow-hidden lg:block lg:sticky lg:top-(--ui-header-height) py-0 lg:ms-0 lg:ps-0 lg:pe-0",
|
|
76
|
+
container: "relative flex h-full min-h-0 flex-col",
|
|
77
|
+
topHeader: "hidden",
|
|
78
|
+
topBody: "relative pointer-events-auto flex h-full min-h-0 flex-col mx-0 px-0",
|
|
79
|
+
topFooter: "hidden"
|
|
80
|
+
} },
|
|
81
|
+
commandPalette: {
|
|
82
|
+
slots: {
|
|
83
|
+
item: "items-center",
|
|
84
|
+
input: "[&_.iconify]:size-4 [&_.iconify]:mx-0.5"
|
|
85
|
+
},
|
|
86
|
+
variants: { size: { md: { itemLeadingIcon: "size-4 mx-0.5" } } }
|
|
87
|
+
},
|
|
88
|
+
dropdownMenu: {
|
|
89
|
+
slots: { item: "items-center" },
|
|
90
|
+
variants: { size: {
|
|
91
|
+
xs: {
|
|
92
|
+
itemLeadingIcon: "size-3.5",
|
|
93
|
+
itemTrailingIcon: "size-3.5"
|
|
94
|
+
},
|
|
95
|
+
sm: {
|
|
96
|
+
itemLeadingIcon: "size-3.5",
|
|
97
|
+
itemTrailingIcon: "size-3.5"
|
|
98
|
+
},
|
|
99
|
+
md: {
|
|
100
|
+
itemLeadingIcon: "size-4",
|
|
101
|
+
itemTrailingIcon: "size-4"
|
|
102
|
+
},
|
|
103
|
+
lg: {
|
|
104
|
+
itemLeadingIcon: "size-4",
|
|
105
|
+
itemTrailingIcon: "size-4"
|
|
106
|
+
},
|
|
107
|
+
xl: {
|
|
108
|
+
itemLeadingIcon: "size-4.5",
|
|
109
|
+
itemTrailingIcon: "size-4.5"
|
|
110
|
+
}
|
|
111
|
+
} }
|
|
112
|
+
},
|
|
113
|
+
contentNavigation: {
|
|
114
|
+
defaultVariants: {
|
|
115
|
+
variant: "link",
|
|
116
|
+
color: "neutral"
|
|
117
|
+
},
|
|
118
|
+
slots: {
|
|
119
|
+
root: "space-y-0",
|
|
120
|
+
link: "text-sm text-muted transition-colors hover:text-highlighted px-4 py-2 data-[active=true]:bg-elevated",
|
|
121
|
+
linkLeadingIcon: "size-4 mr-2 text-muted",
|
|
122
|
+
linkTitle: "truncate",
|
|
123
|
+
linkTrailing: "hidden"
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
pageLinks: { slots: {
|
|
127
|
+
linkLeadingIcon: "size-4",
|
|
128
|
+
linkLabelExternalIcon: "size-2.5"
|
|
129
|
+
} },
|
|
130
|
+
page: { slots: {
|
|
131
|
+
root: "flex flex-col lg:!grid lg:!grid-cols-[var(--vh-sidebar-width)_minmax(0,1fr)] lg:gap-0 px-0",
|
|
132
|
+
left: "lg:!col-span-1 lg:w-[var(--vh-sidebar-width)] lg:shrink-0 lg:border-e lg:border-default",
|
|
133
|
+
center: "lg:!col-span-1 min-w-0",
|
|
134
|
+
right: "order-first lg:order-last lg:!col-span-1 lg:w-[var(--vh-toc-width)] lg:shrink-0"
|
|
135
|
+
} },
|
|
136
|
+
pageHeader: { slots: {
|
|
137
|
+
root: "relative border-b-0 px-4 pt-10 pb-2 sm:px-8",
|
|
138
|
+
container: "flex flex-col",
|
|
139
|
+
headline: "mb-2 text-[0.8125rem] font-normal text-dimmed",
|
|
140
|
+
wrapper: "flex flex-row flex-wrap items-center lg:items-center justify-between gap-x-6 gap-y-3",
|
|
141
|
+
title: "min-w-0 flex-[1_1_18rem] text-[2rem] sm:text-[2rem] leading-[1.15] tracking-[-0.015em] text-balance font-semibold text-highlighted",
|
|
142
|
+
description: "mt-2 max-w-[34rem] text-[1.0625rem] leading-[1.7] text-pretty text-muted",
|
|
143
|
+
links: "flex flex-wrap items-center gap-2"
|
|
144
|
+
} },
|
|
145
|
+
pageBody: { base: "mt-8 px-4 pb-24 sm:px-8" },
|
|
146
|
+
pageGrid: { base: "grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-2" },
|
|
147
|
+
contentSearchButton: {
|
|
148
|
+
defaultVariants: {
|
|
149
|
+
collapsed: false,
|
|
150
|
+
label: "Search",
|
|
151
|
+
variant: "ghost",
|
|
152
|
+
color: "neutral"
|
|
153
|
+
},
|
|
154
|
+
slots: {
|
|
155
|
+
base: "w-full justify-start rounded-md px-3 py-2 text-muted hover:text-highlighted",
|
|
156
|
+
trailing: "ms-auto flex items-center gap-0.5"
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
contentSearch: {
|
|
160
|
+
defaultVariants: {
|
|
161
|
+
placeholder: "Search",
|
|
162
|
+
transition: false
|
|
163
|
+
},
|
|
164
|
+
slots: {
|
|
165
|
+
modal: "vh-docs-search-modal w-[calc(100vw-1rem)] !max-w-[36rem] !h-auto max-h-[calc(100dvh-1rem)] sm:max-h-[70vh]",
|
|
166
|
+
input: "[&>input]:h-14 [&>input]:text-lg"
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
contentToc: {
|
|
170
|
+
defaultVariants: { highlightVariant: "circuit" },
|
|
171
|
+
slots: {
|
|
172
|
+
root: "sticky top-(--ui-header-height) z-10 overflow-y-auto max-h-[calc(100vh-var(--ui-header-height))] lg:mx-0",
|
|
173
|
+
container: "flex flex-col pt-10 pb-8 border-solid",
|
|
174
|
+
title: "text-xs font-medium text-highlighted",
|
|
175
|
+
link: "py-1 text-[0.8125rem] text-dimmed hover:text-highlighted data-[active]:text-highlighted"
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
prose: {
|
|
179
|
+
codeIcon: {
|
|
180
|
+
js: "i-vscode-icons-file-type-js-official",
|
|
181
|
+
mjs: "i-vscode-icons-file-type-js-official",
|
|
182
|
+
txt: "i-vscode-icons-file-type-text"
|
|
183
|
+
},
|
|
184
|
+
a: { base: "font-normal underline underline-offset-[0.2em] decoration-(--ui-border) text-highlighted hover:decoration-current transition-colors" },
|
|
185
|
+
callout: {
|
|
186
|
+
slots: { base: "rounded-lg" },
|
|
187
|
+
variants: { color: {
|
|
188
|
+
info: callout("text-info"),
|
|
189
|
+
warning: callout("text-warning"),
|
|
190
|
+
error: callout("text-error"),
|
|
191
|
+
success: callout("text-success")
|
|
192
|
+
} }
|
|
193
|
+
},
|
|
194
|
+
card: { slots: { base: "rounded-lg" } },
|
|
195
|
+
h2: { slots: {
|
|
196
|
+
base: "relative mt-14 mb-4 border-t border-default pt-5 text-lg/[1.3] tracking-[-0.01em] text-highlighted font-semibold scroll-mt-[calc(1rem+var(--ui-header-height))]",
|
|
197
|
+
leading: "hidden",
|
|
198
|
+
link: "group"
|
|
199
|
+
} },
|
|
200
|
+
h3: { slots: {
|
|
201
|
+
base: "relative mt-9 mb-2 font-mono text-sm/6 text-highlighted font-medium scroll-mt-[calc(1rem+var(--ui-header-height))]",
|
|
202
|
+
leading: "hidden",
|
|
203
|
+
link: "group"
|
|
204
|
+
} },
|
|
205
|
+
tabs: { slots: {
|
|
206
|
+
root: framedTabs,
|
|
207
|
+
list: "mb-0 px-2"
|
|
208
|
+
} },
|
|
209
|
+
tabsItem: { base: "p-0" },
|
|
210
|
+
codeGroup: { slots: {
|
|
211
|
+
root: framedTabs,
|
|
212
|
+
list: "gap-1 border-0 border-b border-default rounded-t-lg bg-transparent px-2 py-0",
|
|
213
|
+
indicator: "inset-y-auto -bottom-px h-px bg-(--ui-text-highlighted) shadow-none",
|
|
214
|
+
trigger: "h-8 px-2.5 py-0 text-muted data-[state=active]:text-highlighted hover:bg-transparent hover:text-highlighted"
|
|
215
|
+
} },
|
|
216
|
+
code: { base: "inline box-decoration-clone wrap-break-word rounded-md border-0 bg-muted px-[0.35em] py-[0.1em] font-mono text-[0.8125rem]/[1.6] text-highlighted ring ring-inset ring-default" },
|
|
217
|
+
pre: { slots: {
|
|
218
|
+
root: "relative my-5 group",
|
|
219
|
+
header: "flex items-center gap-1.5 border border-default bg-muted border-b-0 relative rounded-t-lg ps-4 pe-12 py-2.5 text-[0.8125rem]",
|
|
220
|
+
filename: "min-w-0 wrap-anywhere",
|
|
221
|
+
base: "group font-mono text-[0.8125rem]/6 border border-default bg-muted rounded-lg [[data-slot=header]+&]:rounded-t-none px-[0.9rem] py-[0.8rem] whitespace-pre-wrap wrap-break-word overflow-x-auto",
|
|
222
|
+
copy: "pointer-coarse:opacity-100 pointer-coarse:size-9 pointer-coarse:justify-center pointer-coarse:top-[5px] pointer-coarse:end-[5px]"
|
|
223
|
+
} },
|
|
224
|
+
steps: { base: "vh-docs-steps ms-4 border-s border-default ps-8 [counter-reset:step]" }
|
|
225
|
+
}
|
|
226
|
+
}, vitehubTheme);
|
|
227
|
+
}
|
|
228
|
+
/** The part of the theme that only adds keys, so an app with its own `app.vue` gets it in its app config. */
|
|
229
|
+
function docsThemeAdditions(theme) {
|
|
230
|
+
const prose = isRecord(theme.prose) ? theme.prose : {};
|
|
231
|
+
return isRecord(prose.codeIcon) ? { prose: { codeIcon: prose.codeIcon } } : {};
|
|
232
|
+
}
|
|
233
|
+
function isRecord(value) {
|
|
234
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
235
|
+
}
|
|
236
|
+
//#endregion
|
|
237
|
+
export { docsThemeScope as i, docsThemeAdditions as n, docsUi as r, docsAppConfigUi as t };
|
package/dist/theme.d.ts
ADDED
package/dist/theme.js
ADDED
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/schema.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* How a page renders. `article` is prose with an outline, `tutorial` numbers its steps, `landing` is a wide Overview,
|
|
5
|
+
* and `home` is the page's own blocks at full width under the site header, without the docs sidebar, such as a
|
|
6
|
+
* product home page.
|
|
7
|
+
*/
|
|
8
|
+
declare const docsLayouts: readonly ["article", "tutorial", "landing", "home"];
|
|
9
|
+
type DocsLayout = (typeof docsLayouts)[number];
|
|
10
|
+
/** Navigation fields of a page. `false` keeps the page out of the sidebar. */
|
|
11
|
+
type DocsPageNavigation = false | {
|
|
12
|
+
/** Label in the sidebar. Defaults to the page title. */
|
|
13
|
+
title?: string;
|
|
14
|
+
/** Position among the pages of its section. Lower comes first. */
|
|
15
|
+
order?: number;
|
|
16
|
+
/** Sidebar group label inside the section. */
|
|
17
|
+
group?: string;
|
|
18
|
+
/** Task lane of the page, such as `guide` or `reference`. */
|
|
19
|
+
kind?: string;
|
|
20
|
+
/**
|
|
21
|
+
* On the `index.md` of a folder inside a section: the folder becomes its own panel. The section sidebar shows one link
|
|
22
|
+
* to it, and its pages show a sidebar of their own with a link back to the section.
|
|
23
|
+
*/
|
|
24
|
+
panel?: boolean;
|
|
25
|
+
};
|
|
26
|
+
/** Frontmatter of a docs page, after dotted keys such as `navigation.order` became nested objects. */
|
|
27
|
+
interface DocsPageFrontmatter {
|
|
28
|
+
title: string;
|
|
29
|
+
description?: string;
|
|
30
|
+
/** Text under the heading, when it differs from `description`, which stays the meta description and the llms.txt entry. */
|
|
31
|
+
tagline?: string;
|
|
32
|
+
/** A short label above the title, such as the package that the page documents. */
|
|
33
|
+
eyebrow?: string;
|
|
34
|
+
/** Inline Markdown at the end of the page, such as the projects that a package builds on. */
|
|
35
|
+
credits?: string;
|
|
36
|
+
/** More words that find the page in search: a list, or one string with commas between them. */
|
|
37
|
+
keywords?: string | string[];
|
|
38
|
+
icon?: string;
|
|
39
|
+
layout?: DocsLayout;
|
|
40
|
+
/** Tutorials only. Complete applications sort before shorter quickstarts. */
|
|
41
|
+
tutorial?: "project" | "quickstart";
|
|
42
|
+
/** Tutorials only. Shows the file tree and code of the current step beside the prose. */
|
|
43
|
+
codePanel?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* `false` hides the navigation sidebar on this page. `"collapsed"` shows a narrow strip instead, with a button that opens
|
|
46
|
+
* the sidebar, for a page that needs the width, such as a playground. Code panel tutorials start collapsed.
|
|
47
|
+
*/
|
|
48
|
+
sidebar?: boolean | "collapsed";
|
|
49
|
+
/** `false` hides the "On this page" outline. */
|
|
50
|
+
toc?: boolean;
|
|
51
|
+
navigation?: DocsPageNavigation;
|
|
52
|
+
/**
|
|
53
|
+
* Search and share fields, when they differ from the page's own. `image` is the share image: a path in `public/` or a
|
|
54
|
+
* URL, or `false` for none. Without it the build renders one from the title and description. `index: false` asks
|
|
55
|
+
* search engines not to index the page and leaves it out of the sitemap, llms.txt, the site search, and the prerender.
|
|
56
|
+
* The server renders it on request.
|
|
57
|
+
*/
|
|
58
|
+
seo?: {
|
|
59
|
+
title?: string;
|
|
60
|
+
description?: string;
|
|
61
|
+
image?: string | false;
|
|
62
|
+
index?: boolean;
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Frontmatter of a docs page as the file stores it. Pages may write nested objects or dotted keys, such as
|
|
67
|
+
* `navigation.order: 2`. YAML keeps a dotted key as one key, so each one is a field of its own.
|
|
68
|
+
*/
|
|
69
|
+
interface DocsPageFile extends DocsPageFrontmatter {
|
|
70
|
+
"navigation.title"?: string;
|
|
71
|
+
"navigation.order"?: number;
|
|
72
|
+
"navigation.group"?: string;
|
|
73
|
+
"navigation.kind"?: string;
|
|
74
|
+
"navigation.panel"?: boolean;
|
|
75
|
+
"seo.title"?: string;
|
|
76
|
+
"seo.description"?: string;
|
|
77
|
+
"seo.image"?: string | false;
|
|
78
|
+
"seo.index"?: boolean;
|
|
79
|
+
}
|
|
80
|
+
/** `.navigation.yml` of a section folder. */
|
|
81
|
+
interface DocsSectionFile {
|
|
82
|
+
title?: string;
|
|
83
|
+
icon?: string;
|
|
84
|
+
order?: number;
|
|
85
|
+
/** Catalog group of the section. `categories` in the docs options orders the groups. */
|
|
86
|
+
category?: string;
|
|
87
|
+
/** Rail group of the section: sections of one group share one rail item and one sidebar. */
|
|
88
|
+
group?: string;
|
|
89
|
+
/** Folds each page group of the sidebar until the reader opens it. The group of the current page opens itself. */
|
|
90
|
+
fold?: boolean;
|
|
91
|
+
/** Ids of sections listed under Related in this section's sidebar. */
|
|
92
|
+
related?: string[];
|
|
93
|
+
}
|
|
94
|
+
type Fields<T> = { [K in keyof T]-?: z.ZodType<T[K]>; };
|
|
95
|
+
/**
|
|
96
|
+
* Frontmatter fields of a docs page as files store them, one Standard Schema per field. `docsCollection()` passes them
|
|
97
|
+
* to `documents()`, so the Console editor validates the same values that the build validates, and a save writes
|
|
98
|
+
* dotted keys back as dotted keys.
|
|
99
|
+
*/
|
|
100
|
+
declare const docsPageFields: Fields<DocsPageFile>;
|
|
101
|
+
/** The build validates frontmatter with this schema after `docsFrontmatter()` expanded its dotted keys. */
|
|
102
|
+
declare const docsPageSchema: z.ZodType<DocsPageFrontmatter>;
|
|
103
|
+
declare const docsSectionSchema: z.ZodType<DocsSectionFile>;
|
|
104
|
+
/** YAML keys such as `navigation.order: 2` become nested objects, as Markdown frontmatter writers expect. */
|
|
105
|
+
declare function expandDottedKeys(input: Record<string, unknown>): Record<string, unknown>;
|
|
106
|
+
//#endregion
|
|
107
|
+
//#region src/types.d.ts
|
|
108
|
+
/**
|
|
109
|
+
* The fields of a page that the app reads. `useDocsManifest()` returns pages with only these fields, so every page of
|
|
110
|
+
* the site does not carry the text and SEO options of every other page. The page route returns the whole `DocsPage`.
|
|
111
|
+
*/
|
|
112
|
+
interface DocsAppPage {
|
|
113
|
+
/** Path of the page inside its section, such as `index` or `operations/history`. */
|
|
114
|
+
id: string;
|
|
115
|
+
/** Public URL, such as `/docs/kv/get-started`. */
|
|
116
|
+
path: string;
|
|
117
|
+
/** Label in navigation: `navigation.title`, else `title`. */
|
|
118
|
+
title: string;
|
|
119
|
+
/** The `title` field, for the page heading. */
|
|
120
|
+
sourceTitle: string;
|
|
121
|
+
description: string | null;
|
|
122
|
+
icon: string | null;
|
|
123
|
+
layout: DocsLayout;
|
|
124
|
+
tutorial?: "project" | "quickstart";
|
|
125
|
+
codePanel?: boolean;
|
|
126
|
+
/** Whether the navigation sidebar shows on this page. `"collapsed"` starts it as a narrow strip that the reader opens. */
|
|
127
|
+
sidebar: boolean | "collapsed";
|
|
128
|
+
/** Whether the "On this page" outline shows on this page. */
|
|
129
|
+
toc: boolean;
|
|
130
|
+
kind: string | null;
|
|
131
|
+
group: string | null;
|
|
132
|
+
/** `false` when the page sets `navigation: false`. It still renders but is not listed. */
|
|
133
|
+
navigation: boolean;
|
|
134
|
+
/** `true` on the Overview of a folder with `navigation.panel: true`. Its folder is a panel of its own. */
|
|
135
|
+
panel?: true;
|
|
136
|
+
/**
|
|
137
|
+
* On a panel's Overview in the app manifest: the number of listed pages inside the panel. The app loads those pages
|
|
138
|
+
* when a reader opens the panel, so the section sidebar reads the count from here.
|
|
139
|
+
*/
|
|
140
|
+
panelSize?: number;
|
|
141
|
+
order: number;
|
|
142
|
+
}
|
|
143
|
+
/** One Markdown page, as the navigation and the page route see it. */
|
|
144
|
+
interface DocsPage extends DocsAppPage {
|
|
145
|
+
/** File path relative to the content directory, such as `docs/kv/get-started.md`. */
|
|
146
|
+
file: string;
|
|
147
|
+
/** Server asset namespace of a mapped content source. Omitted for the default content directory. */
|
|
148
|
+
source?: string;
|
|
149
|
+
/** Text under the heading: `tagline`, else `description`. */
|
|
150
|
+
tagline: string | null;
|
|
151
|
+
/** A short label above the title, from the `eyebrow` field. */
|
|
152
|
+
eyebrow: string | null;
|
|
153
|
+
/** Inline Markdown at the end of the page. The page route returns it parsed. */
|
|
154
|
+
credits: string | null;
|
|
155
|
+
/** Search words besides the page's own text. */
|
|
156
|
+
keywords: string[];
|
|
157
|
+
/** Search result title and description, when they differ from the page heading. */
|
|
158
|
+
seo?: {
|
|
159
|
+
title?: string;
|
|
160
|
+
description?: string;
|
|
161
|
+
image?: string | false;
|
|
162
|
+
index?: boolean;
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
/** A folder under the docs base: one rail entry with its own page list. */
|
|
166
|
+
interface DocsSection<Page extends DocsAppPage = DocsPage> {
|
|
167
|
+
id: string;
|
|
168
|
+
path: string;
|
|
169
|
+
title: string;
|
|
170
|
+
description: string | null;
|
|
171
|
+
icon: string | null;
|
|
172
|
+
category: string | null;
|
|
173
|
+
/** Rail group from `.navigation.yml`. The `groups` option can also place the section in a group. */
|
|
174
|
+
group: string | null;
|
|
175
|
+
/** Whether the page groups of the sidebar start folded, from `fold` in `.navigation.yml`. */
|
|
176
|
+
fold: boolean;
|
|
177
|
+
related: string[];
|
|
178
|
+
order: number;
|
|
179
|
+
pages: Page[];
|
|
180
|
+
}
|
|
181
|
+
/** Everything the site navigates, computed from the content directory at build time. */
|
|
182
|
+
interface DocsManifest<Page extends DocsAppPage = DocsPage> {
|
|
183
|
+
/** URL prefix of the sections, such as `/docs`. */
|
|
184
|
+
base: string;
|
|
185
|
+
/** The page at the base URL, such as `content/docs/index.md`. */
|
|
186
|
+
root: Page | null;
|
|
187
|
+
sections: DocsSection<Page>[];
|
|
188
|
+
/** Pages without a section: direct children of the base and pages outside it, such as `/about`. */
|
|
189
|
+
pages: Page[];
|
|
190
|
+
}
|
|
191
|
+
/** One entry of the "On this page" outline. */
|
|
192
|
+
interface DocsTocLink {
|
|
193
|
+
id: string;
|
|
194
|
+
text: string;
|
|
195
|
+
depth: number;
|
|
196
|
+
children?: DocsTocLink[];
|
|
197
|
+
}
|
|
198
|
+
/** One searchable part of a page: the text under one heading. */
|
|
199
|
+
interface DocsSearchSection {
|
|
200
|
+
id: string;
|
|
201
|
+
title: string;
|
|
202
|
+
/** Headings above this part, from the page title down. */
|
|
203
|
+
titles: string[];
|
|
204
|
+
level: number;
|
|
205
|
+
content: string;
|
|
206
|
+
/** Page entries only: the page's `keywords`, which search matches like a title. */
|
|
207
|
+
keywords?: string[];
|
|
208
|
+
/** `false` on the one record of a page that search engines skip, such as a generated error code page. */
|
|
209
|
+
indexed?: false;
|
|
210
|
+
}
|
|
211
|
+
//#endregion
|
|
212
|
+
export { DocsSection as a, DocsPageFile as c, DocsSectionFile as d, docsLayouts as f, expandDottedKeys as g, docsSectionSchema as h, DocsSearchSection as i, DocsPageFrontmatter as l, docsPageSchema as m, DocsManifest as n, DocsTocLink as o, docsPageFields as p, DocsPage as r, DocsLayout as s, DocsAppPage as t, DocsPageNavigation as u };
|
package/package.json
CHANGED
|
@@ -1 +1,144 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"name": "@vite-hub/docs",
|
|
3
|
+
"version": "0.3.1",
|
|
4
|
+
"description": "A documentation site on ViteHub primitives: typed Markdown pages, navigation, tutorials, search, agent resources, Console editing, and a docs assistant.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"content",
|
|
7
|
+
"docs",
|
|
8
|
+
"documentation",
|
|
9
|
+
"markdown",
|
|
10
|
+
"nuxt",
|
|
11
|
+
"vite",
|
|
12
|
+
"vitehub"
|
|
13
|
+
],
|
|
14
|
+
"homepage": "https://vitehub.dev",
|
|
15
|
+
"bugs": "https://github.com/vite-hub/vitehub/issues",
|
|
16
|
+
"license": "Apache-2.0",
|
|
17
|
+
"author": "onmax <maximogarciamtnez@gmail.com>",
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/vite-hub/vitehub.git",
|
|
21
|
+
"directory": "packages/docs"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"dist",
|
|
25
|
+
"package.json"
|
|
26
|
+
],
|
|
27
|
+
"type": "module",
|
|
28
|
+
"sideEffects": false,
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
30
|
+
"exports": {
|
|
31
|
+
".": {
|
|
32
|
+
"types": "./dist/index.d.ts",
|
|
33
|
+
"import": "./dist/index.js",
|
|
34
|
+
"default": "./dist/index.js"
|
|
35
|
+
},
|
|
36
|
+
"./assistant": {
|
|
37
|
+
"types": "./dist/assistant.d.ts",
|
|
38
|
+
"workerd": "./dist/assistant-worker.js",
|
|
39
|
+
"worker": "./dist/assistant-worker.js",
|
|
40
|
+
"import": "./dist/assistant.js",
|
|
41
|
+
"default": "./dist/assistant.js"
|
|
42
|
+
},
|
|
43
|
+
"./navigation": {
|
|
44
|
+
"types": "./dist/navigation.d.ts",
|
|
45
|
+
"import": "./dist/navigation.js",
|
|
46
|
+
"default": "./dist/navigation.js"
|
|
47
|
+
},
|
|
48
|
+
"./nuxt": {
|
|
49
|
+
"types": "./dist/nuxt.d.ts",
|
|
50
|
+
"import": "./dist/nuxt.js",
|
|
51
|
+
"default": "./dist/nuxt.js"
|
|
52
|
+
},
|
|
53
|
+
"./server": {
|
|
54
|
+
"types": "./dist/server.d.ts",
|
|
55
|
+
"import": "./dist/server.js",
|
|
56
|
+
"default": "./dist/server.js"
|
|
57
|
+
},
|
|
58
|
+
"./package.json": "./package.json",
|
|
59
|
+
"./primitive-rail": {
|
|
60
|
+
"types": "./dist/primitive-rail.d.ts",
|
|
61
|
+
"import": "./dist/primitive-rail.js",
|
|
62
|
+
"default": "./dist/primitive-rail.js"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"dependencies": {
|
|
66
|
+
"@nuxt/fonts": "^1.2.0",
|
|
67
|
+
"@nuxt/kit": "4.6.2",
|
|
68
|
+
"@takumi-rs/core": "2.19.0",
|
|
69
|
+
"@vite-hub/content": "0.3.1",
|
|
70
|
+
"@vite-hub/rate-limit": "0.3.1",
|
|
71
|
+
"@vite-hub/source": "0.3.1",
|
|
72
|
+
"@vite-hub/ui": "0.3.1",
|
|
73
|
+
"@vite-hub/workspace": "0.3.1",
|
|
74
|
+
"@vueuse/core": "^14.4.0",
|
|
75
|
+
"comark-content": "0.5.1",
|
|
76
|
+
"comark-zoom": "^0.12.0",
|
|
77
|
+
"defu": "^6.1.7",
|
|
78
|
+
"nostics": "1.4.0",
|
|
79
|
+
"nuxt-agent-discovery": "^0.8.2",
|
|
80
|
+
"nuxt-link-checker": "^6.0.1",
|
|
81
|
+
"nuxt-og-image": "^7.0.7",
|
|
82
|
+
"nuxt-schema-org": "^7.0.1",
|
|
83
|
+
"nuxt-site-config": "^5.0.3",
|
|
84
|
+
"postcss": "^8.5.29",
|
|
85
|
+
"rou3": "^1.0.0",
|
|
86
|
+
"shiki": "^4.5.0",
|
|
87
|
+
"ultrahtml": "^1.7.0",
|
|
88
|
+
"yaml": "^2.9.1",
|
|
89
|
+
"zod": "^4.6.7"
|
|
90
|
+
},
|
|
91
|
+
"devDependencies": {
|
|
92
|
+
"@comark/html": "^0.9.0",
|
|
93
|
+
"@comark/vue": "0.9.0",
|
|
94
|
+
"@nuxt/ui": "^4.12.0",
|
|
95
|
+
"@types/node": "^24.19.1",
|
|
96
|
+
"@vue/test-utils": "2.5.1",
|
|
97
|
+
"@vite-hub/agent": "0.3.1",
|
|
98
|
+
"@vite-hub/gateways": "0.3.1",
|
|
99
|
+
"@vite-hub/icons": "0.1.0",
|
|
100
|
+
"@vite-hub/internal": "0.0.1",
|
|
101
|
+
"comark": "^0.9.0",
|
|
102
|
+
"comark-ui": "^0.12.0",
|
|
103
|
+
"h3": "^2.0.8",
|
|
104
|
+
"happy-dom": "21.0.3",
|
|
105
|
+
"linkedom": "^0.18.13",
|
|
106
|
+
"nitro": "^3.0.261103-rc",
|
|
107
|
+
"nuxt": "npm:nuxt-nightly@5.0.0-2611052317-a04317f",
|
|
108
|
+
"publint": "^0.3.25",
|
|
109
|
+
"tailwindcss": "^4.3.3",
|
|
110
|
+
"typescript": "^6.0.3",
|
|
111
|
+
"vite": "^8.2.2",
|
|
112
|
+
"vite-plus": "^0.3.3",
|
|
113
|
+
"vitest": "^4.1.11",
|
|
114
|
+
"vue": "3.5.44"
|
|
115
|
+
},
|
|
116
|
+
"peerDependencies": {
|
|
117
|
+
"@comark/html": "^0.8.1 || ^0.9.0",
|
|
118
|
+
"@comark/vue": "^0.8.1 || ^0.9.0",
|
|
119
|
+
"@nuxt/ui": "^4.11.0",
|
|
120
|
+
"@vite-hub/agent": "0.3.1",
|
|
121
|
+
"@vite-hub/gateways": "0.3.1",
|
|
122
|
+
"comark": "^0.8.1 || ^0.9.0",
|
|
123
|
+
"comark-ui": "^0.12.0",
|
|
124
|
+
"nuxt": ">=5.0.0-0",
|
|
125
|
+
"vue": "^3.5.0"
|
|
126
|
+
},
|
|
127
|
+
"peerDependenciesMeta": {
|
|
128
|
+
"@vite-hub/agent": {
|
|
129
|
+
"optional": true
|
|
130
|
+
},
|
|
131
|
+
"@vite-hub/gateways": {
|
|
132
|
+
"optional": true
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
"engines": {
|
|
136
|
+
"node": ">=22.22.0"
|
|
137
|
+
},
|
|
138
|
+
"scripts": {
|
|
139
|
+
"build": "vp pack",
|
|
140
|
+
"dev": "vp pack --watch",
|
|
141
|
+
"typecheck": "vp run --cache -t @vite-hub/docs#build && node ../../test/package-typecheck.mjs --noEmit -p ./tsconfig.json",
|
|
142
|
+
"test": "vp run --cache -t @vite-hub/docs#build && vp test"
|
|
143
|
+
}
|
|
144
|
+
}
|