@vite-hub/docs 0.0.0 → 0.4.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.
Files changed (115) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +456 -0
  3. package/dist/agent-copy-xPaWye_g.js +33 -0
  4. package/dist/assistant-pages-BN7hNsSZ.js +37 -0
  5. package/dist/assistant-shared-CWIKRtBv.d.ts +28 -0
  6. package/dist/assistant-shared-WzButktj.js +113 -0
  7. package/dist/assistant-worker.d.ts +11 -0
  8. package/dist/assistant-worker.js +16 -0
  9. package/dist/assistant.d.ts +14 -0
  10. package/dist/assistant.js +19 -0
  11. package/dist/content-CPZGnn3S.js +141 -0
  12. package/dist/draft-BjWmaiLn.js +45 -0
  13. package/dist/error-diagnostics-B_ZOy7kF.js +93 -0
  14. package/dist/files-UY4h1_36.js +38 -0
  15. package/dist/index.d.ts +28 -0
  16. package/dist/index.js +27 -0
  17. package/dist/link-checker-redirects.d.ts +13 -0
  18. package/dist/link-checker-redirects.js +25 -0
  19. package/dist/manifest-CMoxcwPm.d.ts +80 -0
  20. package/dist/manifest-ZdxLrcvt.js +434 -0
  21. package/dist/markdown-DUWnEMPp.js +378 -0
  22. package/dist/navigation.d.ts +283 -0
  23. package/dist/navigation.js +519 -0
  24. package/dist/nuxt-CAGpKl_-.d.ts +241 -0
  25. package/dist/nuxt.d.ts +3 -0
  26. package/dist/nuxt.js +1868 -0
  27. package/dist/page-Dx2JD3y1.d.ts +74 -0
  28. package/dist/page-GPt09oex.js +82 -0
  29. package/dist/primitive-rail.d.ts +110 -0
  30. package/dist/primitive-rail.js +289 -0
  31. package/dist/raw-BChwipz_.js +857 -0
  32. package/dist/redirects-CmR1yu5A.js +74 -0
  33. package/dist/runtime/app/app.vue +11 -0
  34. package/dist/runtime/app/assistant/DocsAssistant.vue +81 -0
  35. package/dist/runtime/app/assistant/DocsAssistantOff.vue +8 -0
  36. package/dist/runtime/app/assistant/DocsAssistantPanel.vue +322 -0
  37. package/dist/runtime/app/components/AppHeader.vue +368 -0
  38. package/dist/runtime/app/components/AppSearch.vue +68 -0
  39. package/dist/runtime/app/components/DocsAppShell.vue +62 -0
  40. package/dist/runtime/app/components/DocsArticle.vue +184 -0
  41. package/dist/runtime/app/components/DocsAsideFooter.vue +94 -0
  42. package/dist/runtime/app/components/DocsAsideLeftBody.vue +584 -0
  43. package/dist/runtime/app/components/DocsAsideLeftTop.vue +132 -0
  44. package/dist/runtime/app/components/DocsBrandMark.vue +52 -0
  45. package/dist/runtime/app/components/DocsCatalogFooter.vue +129 -0
  46. package/dist/runtime/app/components/DocsCodePanel.vue +388 -0
  47. package/dist/runtime/app/components/DocsCodePre.vue +120 -0
  48. package/dist/runtime/app/components/DocsHeaderActions.vue +4 -0
  49. package/dist/runtime/app/components/DocsLanding.vue +83 -0
  50. package/dist/runtime/app/components/DocsMarkdown.vue +64 -0
  51. package/dist/runtime/app/components/DocsPage.vue +149 -0
  52. package/dist/runtime/app/components/DocsPageCredits.vue +41 -0
  53. package/dist/runtime/app/components/DocsPageHeaderLinks.vue +120 -0
  54. package/dist/runtime/app/components/DocsRail.vue +239 -0
  55. package/dist/runtime/app/components/DocsSidebarStrip.vue +81 -0
  56. package/dist/runtime/app/components/DocsSidebars.vue +63 -0
  57. package/dist/runtime/app/components/OgImage/DocsPage.takumi.vue +33 -0
  58. package/dist/runtime/app/components/content/AgentOnly.vue +9 -0
  59. package/dist/runtime/app/components/content/CodeTree.vue +203 -0
  60. package/dist/runtime/app/components/content/ComarkHtml.vue +31 -0
  61. package/dist/runtime/app/components/content/Correct.vue +17 -0
  62. package/dist/runtime/app/components/content/Example.vue +260 -0
  63. package/dist/runtime/app/components/content/ExamplePreview.vue +6 -0
  64. package/dist/runtime/app/components/content/Examples.vue +71 -0
  65. package/dist/runtime/app/components/content/Incorrect.vue +17 -0
  66. package/dist/runtime/app/components/content/McpClient.vue +170 -0
  67. package/dist/runtime/app/components/content/McpInstall.vue +238 -0
  68. package/dist/runtime/app/components/content/PageList.vue +206 -0
  69. package/dist/runtime/app/components/content/ProductFeatureItem.vue +43 -0
  70. package/dist/runtime/app/components/content/ProductFeatures.vue +17 -0
  71. package/dist/runtime/app/components/content/TutorialStep.vue +39 -0
  72. package/dist/runtime/app/composables/docs-assistant-problem.ts +59 -0
  73. package/dist/runtime/app/composables/docs-theme.ts +15 -0
  74. package/dist/runtime/app/composables/docs.ts +83 -0
  75. package/dist/runtime/app/composables/headerActions.ts +6 -0
  76. package/dist/runtime/app/composables/icons.ts +14 -0
  77. package/dist/runtime/app/composables/seo.ts +64 -0
  78. package/dist/runtime/app/composables/tutorial.ts +40 -0
  79. package/dist/runtime/app/composables/useDocsAssistant.ts +17 -0
  80. package/dist/runtime/app/error.vue +88 -0
  81. package/dist/runtime/app/layouts/default.vue +7 -0
  82. package/dist/runtime/app/layouts/docs.vue +104 -0
  83. package/dist/runtime/app/middleware/docs-layout.ts +23 -0
  84. package/dist/runtime/app/pages/docs-page.vue +3 -0
  85. package/dist/runtime/app/plugins/comark-css.ts +14 -0
  86. package/dist/runtime/app/plugins/icon-stroke.ts +12 -0
  87. package/dist/runtime/app/plugins/theme-color.ts +18 -0
  88. package/dist/runtime/app/utils/docs-theme.ts +43 -0
  89. package/dist/runtime/app/utils/file-tree.ts +40 -0
  90. package/dist/runtime/server/llms.d.ts +6 -0
  91. package/dist/runtime/server/llms.js +7 -0
  92. package/dist/runtime/server/markdown.d.ts +10 -0
  93. package/dist/runtime/server/markdown.js +11 -0
  94. package/dist/runtime/server/mcp.d.ts +6 -0
  95. package/dist/runtime/server/mcp.js +7 -0
  96. package/dist/runtime/server/page.d.ts +7 -0
  97. package/dist/runtime/server/page.js +27 -0
  98. package/dist/runtime/server/raw.d.ts +10 -0
  99. package/dist/runtime/server/raw.js +23 -0
  100. package/dist/runtime/server/search.d.ts +6 -0
  101. package/dist/runtime/server/search.js +32 -0
  102. package/dist/runtime/server/sitemap.d.ts +6 -0
  103. package/dist/runtime/server/sitemap.js +52 -0
  104. package/dist/runtime/server/trailing-slash.d.ts +10 -0
  105. package/dist/runtime/server/trailing-slash.js +28 -0
  106. package/dist/runtime/theme/design.css +464 -0
  107. package/dist/schema-DwpXW0VZ.js +98 -0
  108. package/dist/server.d.ts +15 -0
  109. package/dist/server.js +5 -0
  110. package/dist/theme-BXyu4uFL.d.ts +32 -0
  111. package/dist/theme-DzC8LtMH.js +237 -0
  112. package/dist/theme.d.ts +2 -0
  113. package/dist/theme.js +2 -0
  114. package/dist/types-BhG6vGfG.d.ts +212 -0
  115. package/package.json +144 -1
@@ -0,0 +1,241 @@
1
+ import { d as DocsSectionFile, r as DocsPage } from "./types-BhG6vGfG.js";
2
+ import { i as DocsSourceInput, s as DocsLinkCheckOptions } from "./manifest-CMoxcwPm.js";
3
+ import { DocsGroup, DocsIcons, DocsLink } from "./navigation.js";
4
+ import { ContentLlmsSection } from "@vite-hub/content";
5
+ import { PublicRuntimeConfig } from "nuxt/schema";
6
+ //#region src/comments-nuxt.d.ts
7
+ /** Comments on a docs site: the `comments` option of `vite-hub/nuxt`, which these pass to. */
8
+ interface DocsCommentsOptions {
9
+ /** The Database Definition that keeps the threads. Default: the default or only Database. */
10
+ database?: string;
11
+ /** SQL dialect of that Database. Default `sqlite`: SQLite, libSQL, and D1. */
12
+ dialect?: "postgresql" | "sqlite";
13
+ /** `false` leaves the overlay out of the pages. The Comments API, the operations, and the Console section stay. */
14
+ overlay?: false;
15
+ }
16
+ //#endregion
17
+ //#region src/nuxt.d.ts
18
+ interface DocsSiteOptions {
19
+ /** Name in titles, the rail, and llms.txt. */
20
+ name?: string;
21
+ /** Canonical origin, such as `https://vitehub.dev`. Raw Markdown links, canonical links, and the sitemap use it. */
22
+ url?: string;
23
+ description?: string;
24
+ /**
25
+ * The mark beside the name. A path is a one-color SVG that the theme fills with the text color, so it follows light and
26
+ * dark mode. `{ light, dark? }` shows images as they are, such as a colored logo, with `dark` in dark mode.
27
+ */
28
+ logo?: string | {
29
+ light: string;
30
+ dark?: string;
31
+ };
32
+ /** A short label after the name, such as `beta`, with an optional tooltip on the site brand. */
33
+ badge?: {
34
+ label: string;
35
+ tooltip?: string;
36
+ };
37
+ }
38
+ interface DocsStartOptions {
39
+ /** Id of the section that new readers open first, such as `getting-started`. */
40
+ section: string;
41
+ /**
42
+ * Site pages listed at the top of the start section, such as a tutorials catalog. They open inside the start section,
43
+ * and the header and the error page link to them. A link to the docs base reads "All docs" there.
44
+ */
45
+ links?: DocsLink[];
46
+ }
47
+ interface DocsModuleOptions {
48
+ /** Folder of Markdown pages, relative to the app root. Defaults to `content`. A page's URL is its path in the folder. */
49
+ dir?: string;
50
+ /**
51
+ * Pages from folders and Content Sources, replacing `dir`: a folder relative to the app root, a Source such as
52
+ * `github({ repo, root })` from `vite-hub/source`, or `{ source, mount?, exclude?, frontmatter? }`. The docs assistant
53
+ * reads the same pages.
54
+ */
55
+ sources?: DocsSourceInput[];
56
+ /** Section metadata overrides, keyed by section id. */
57
+ sections?: Record<string, DocsSectionFile>;
58
+ /** Module exporting a default component map for Markdown tags. */
59
+ components?: string;
60
+ /**
61
+ * URL prefix whose folders are sections in the rail. Defaults to `/docs` when the content folder has a `docs/` folder,
62
+ * and to `/` when it has none, so the docs are the whole site. Mapped sources default to `/docs`.
63
+ */
64
+ base?: string;
65
+ site?: DocsSiteOptions;
66
+ /** Order of section categories in the rail and the catalog. Sections of other categories come after them in the rail. */
67
+ categories?: string[];
68
+ /** Categories that the catalog lists but the rail leaves out, such as shared reference topics. */
69
+ railExclude?: string[];
70
+ /**
71
+ * Rail items that hold several sections. The rail shows one item per group, and the sidebar of a member section
72
+ * lists every section of the group. A section joins a group here or with `group` in its `.navigation.yml`.
73
+ */
74
+ groups?: DocsGroup[];
75
+ start?: DocsStartOptions;
76
+ /** Community links in the header on every page, such as a chat server. GitHub comes from `github`. */
77
+ socials?: DocsLink[];
78
+ /** Site pages linked at the end of every docs page, such as About and Privacy, so each one has a link to it. */
79
+ footer?: DocsLink[];
80
+ /** One line above every docs page, such as a release status. */
81
+ banner?: string;
82
+ /** More paths for `/sitemap.xml`, such as app pages outside the content folder. Every docs page is listed already. */
83
+ sitemap?: string[];
84
+ /** The repository of the site. `dir` is the content folder inside the repository. */
85
+ github?: {
86
+ repo: string;
87
+ branch?: string;
88
+ dir?: string;
89
+ } | false;
90
+ /** Icon maps of the rail and the sidebar. */
91
+ icons?: Partial<DocsIcons>;
92
+ /**
93
+ * The docs MCP server at `/mcp`, with the `list-pages` and `get-page` tools of Content. `name` is the server name that
94
+ * page actions suggest, and `guide` is the page that explains how to connect it. `false` turns it off.
95
+ */
96
+ mcp?: {
97
+ name?: string;
98
+ guide?: string;
99
+ } | false;
100
+ /**
101
+ * More text for `/llms.txt`. `details` goes under the site description, such as rules for agents. `sections` adds
102
+ * sections of links, `[{ title, description?, links: [{ title, href, description? }] }]`, before the sections of pages.
103
+ */
104
+ llms?: DocsLlmsOptions;
105
+ /**
106
+ * Checks links on prerendered pages with `nuxt-link-checker` and fails the build on detected errors.
107
+ * Also checks cross-page fragments against the final HTML output.
108
+ * Remote URLs are not fetched. Routes excluded by Nitro's prerender policy may be served at request time. A link to
109
+ * an exact `redirect` route rule passes, and the build checks instead that the rule leads to a docs page and hides
110
+ * none. Exclusion lists accept public paths, globs, or regular expressions. `false` turns the check off.
111
+ */
112
+ linkChecker?: false | Pick<DocsLinkCheckOptions, "excludeLinks" | "excludePages" | "ignoreFragments" | "redirect">;
113
+ /**
114
+ * Checks every prerendered page as a site audit does: a sitemap URL that is not a prerendered page, a missing or
115
+ * duplicate title or description, a title outside 10 to 60 characters or a description outside 70 to 160, not exactly
116
+ * one `h1`, a skipped heading level, fewer than 150 words, or a page that no other page links to. Pages with `noindex`
117
+ * or a canonical link to another page are left out. `"warn"`, the default, reports one hint for each kind of problem,
118
+ * such as `DOCS_SEO_TITLE_INVALID`, in the build output and in `.vitehub/hints.json`. `"error"` or `true` stops the
119
+ * build with `DOCS_SEO_FAILED`. `false` turns the check off.
120
+ */
121
+ seoAudit?: "warn" | "error" | boolean;
122
+ /** The docs assistant: an Agent that answers from these pages. `true` uses the Agent named `docs`. */
123
+ assistant?: boolean | {
124
+ agent?: string;
125
+ };
126
+ /**
127
+ * ViteHub Comments on every page, through `vite-hub/nuxt`. On by default when the app installs `vite-hub/nuxt`: the
128
+ * module sets its `comments` option to `true`, or to these options. Threads belong to the page path, and the Console
129
+ * lists them. `false` turns Comments off.
130
+ */
131
+ comments?: boolean | DocsCommentsOptions;
132
+ /**
133
+ * Rewrites a page's Markdown before it becomes the copy that agents read at `/raw/<page>.md`, for example to expand
134
+ * a component into plain Markdown. The built-in rewrites run after it. Runs at build time, and the server keeps the
135
+ * pages that it changed.
136
+ */
137
+ rawMarkdown?: (markdown: string, page: DocsPage) => string | Promise<string>;
138
+ /**
139
+ * A Markdown copy of every app page that is not a docs page, such as the home page, at its URL plus `.md` and for
140
+ * `Accept: text/markdown`. Content converts the HTML that the app renders for the same request. Docs pages keep their
141
+ * exact copy. `false` turns it off.
142
+ */
143
+ markdownPages?: boolean;
144
+ /**
145
+ * The share image of every page, rendered by `nuxt-og-image` while the build prerenders. By default it shows the
146
+ * site, the page title and description, and the section. `component` names the app's own template in
147
+ * `components/OgImage/`, such as `Docs` for `OgImage/Docs.takumi.vue`; it gets the same props. A page sets
148
+ * `seo.image` to use a file of its own, or `false` for none. `false` here turns the images off.
149
+ */
150
+ ogImage?: false | {
151
+ component?: string;
152
+ };
153
+ /**
154
+ * Path of a module, relative to the app root, whose default export is the parser options: `{ comarkUi, examples,
155
+ * plugins }`. Comark plugins and `examples.play` are functions, so they reach the server through a file and not
156
+ * through this config. The page route, search, and Console drafts parse with it.
157
+ */
158
+ parser?: string;
159
+ /**
160
+ * The folder, relative to the app's source folder, of the Vue files that `::example{name}` shows. Defaults to
161
+ * `examples`, so `::example{name="ButtonExample"}` renders `app/examples/ButtonExample.vue` beside its source.
162
+ */
163
+ examples?: string;
164
+ }
165
+ /** `llms` of the docs module options. */
166
+ interface DocsLlmsOptions {
167
+ details?: string;
168
+ sections?: ContentLlmsSection[];
169
+ }
170
+ /** The site mark: `mask` fills `src` with the text color, else `src` shows as it is, and `dark` in dark mode. */
171
+ interface DocsLogo {
172
+ src: string;
173
+ dark: string | null;
174
+ mask: boolean;
175
+ }
176
+ /** Options as the client and the server read them from `runtimeConfig.public.docs`. */
177
+ interface DocsPublicConfig {
178
+ appBase: string;
179
+ base: string;
180
+ site: {
181
+ name: string;
182
+ url: string;
183
+ description: string;
184
+ logo: DocsLogo | null;
185
+ badge: {
186
+ label: string;
187
+ tooltip: string | null;
188
+ } | null;
189
+ };
190
+ categories: string[];
191
+ railExclude: string[];
192
+ groups: DocsGroup[];
193
+ /** Absent without a `start` option. Nuxt turns a `null` in runtime config into an empty string. */
194
+ start?: {
195
+ section: string;
196
+ links: DocsLink[];
197
+ };
198
+ socials: DocsLink[];
199
+ footer: DocsLink[];
200
+ banner: string | null;
201
+ sitemap: string[];
202
+ /** `stars` is the repository's star count when the build could read it, else `null`. */
203
+ github: {
204
+ repo: string;
205
+ branch: string;
206
+ dir: string;
207
+ url: string;
208
+ stars: number | null;
209
+ } | false;
210
+ icons: DocsIcons;
211
+ mcp: {
212
+ name: string;
213
+ url: string;
214
+ guide: string | null;
215
+ } | false;
216
+ /** Whether app pages that are not docs pages get a converted Markdown copy. */
217
+ markdownPages: boolean;
218
+ assistant: {
219
+ agent: string;
220
+ } | false;
221
+ ogImage: {
222
+ component: string;
223
+ } | false;
224
+ }
225
+ declare module "nuxt/schema" {
226
+ interface PublicRuntimeConfig {
227
+ docs: DocsPublicConfig;
228
+ }
229
+ }
230
+ declare module "nitro/types" {
231
+ interface NitroRuntimeConfig {
232
+ public: PublicRuntimeConfig;
233
+ }
234
+ }
235
+ interface DocsNuxtModule {
236
+ (inlineOptions: DocsModuleOptions, nuxt: never): unknown;
237
+ getMeta?: () => Promise<Record<string, unknown>>;
238
+ }
239
+ declare const docsNuxtModule: DocsNuxtModule;
240
+ //#endregion
241
+ export { DocsPublicConfig as a, docsNuxtModule as c, DocsNuxtModule as i, DocsCommentsOptions as l, DocsLogo as n, DocsSiteOptions as o, DocsModuleOptions as r, DocsStartOptions as s, DocsLlmsOptions as t };
package/dist/nuxt.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import { a as DocsPublicConfig, c as docsNuxtModule, i as DocsNuxtModule, l as DocsCommentsOptions, n as DocsLogo, o as DocsSiteOptions, r as DocsModuleOptions, s as DocsStartOptions, t as DocsLlmsOptions } from "./nuxt-CAGpKl_-.js";
2
+ import { a as DocsThemeScope } from "./theme-BXyu4uFL.js";
3
+ export { type DocsCommentsOptions, DocsLlmsOptions, DocsLogo, DocsModuleOptions, DocsNuxtModule, DocsPublicConfig, DocsSiteOptions, DocsStartOptions, type DocsThemeScope, docsNuxtModule as default };