@kirchdev/duxt 0.3.4 → 0.3.5-dev-main.43-3310f4b

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 (219) hide show
  1. package/README.md +24 -9
  2. package/app/app.vue +17 -11
  3. package/app/assets/css/duxt.css +47 -6
  4. package/app/components/DuxtAnnouncements.vue +117 -0
  5. package/app/components/DuxtBrunoEntries.vue +62 -0
  6. package/app/components/DuxtCodeBlock.vue +18 -34
  7. package/app/components/DuxtCodeToolbar.vue +14 -0
  8. package/app/components/DuxtCopyButton.vue +33 -0
  9. package/app/components/DuxtCopyPage.vue +32 -30
  10. package/app/components/DuxtFooter.vue +39 -8
  11. package/app/components/DuxtHeader.vue +107 -48
  12. package/app/components/DuxtLandingProse.vue +1 -1
  13. package/app/components/DuxtLinkLabel.vue +36 -0
  14. package/app/components/DuxtLiveWindow.vue +8 -8
  15. package/app/components/DuxtLocale.vue +10 -1
  16. package/app/components/DuxtNavigation.vue +2 -2
  17. package/app/components/DuxtOpenApiClient.vue +285 -90
  18. package/app/components/DuxtOpenApiMedia.vue +30 -18
  19. package/app/components/DuxtOpenApiSchema.vue +10 -7
  20. package/app/components/DuxtPageFeedback.vue +7 -0
  21. package/app/components/DuxtPageInfo.vue +15 -12
  22. package/app/components/DuxtPageNav.vue +41 -27
  23. package/app/components/DuxtPreviewSkeleton.vue +4 -4
  24. package/app/components/DuxtProgress.vue +2 -14
  25. package/app/components/DuxtSearch.vue +230 -90
  26. package/app/components/DuxtSearchInput.vue +70 -0
  27. package/app/components/DuxtSections.vue +11 -1
  28. package/app/components/DuxtSegmented.vue +64 -0
  29. package/app/components/DuxtShortcuts.vue +16 -11
  30. package/app/components/DuxtShortcutsTrigger.vue +49 -0
  31. package/app/components/DuxtSkipLink.vue +1 -1
  32. package/app/components/DuxtToc.vue +16 -10
  33. package/app/components/DuxtTranslationBanner.vue +1 -1
  34. package/app/components/DuxtVersion.vue +53 -12
  35. package/app/components/DuxtVersionBanner.vue +5 -5
  36. package/app/components/content/AccordionItem.vue +2 -2
  37. package/app/components/content/BrunoOverview.vue +260 -0
  38. package/app/components/content/BrunoRequest.vue +141 -0
  39. package/app/components/content/BrunoRequests.vue +104 -0
  40. package/app/components/content/Callout.vue +5 -5
  41. package/app/components/content/ChangelogReleases.vue +161 -40
  42. package/app/components/content/CodeGroup.vue +41 -37
  43. package/app/components/content/Field.vue +1 -1
  44. package/app/components/content/FileTree.vue +1 -1
  45. package/app/components/content/OpenApiOperation.vue +4 -4
  46. package/app/components/content/OpenApiOperations.vue +1 -1
  47. package/app/components/content/OpenApiOverview.vue +1 -1
  48. package/app/components/content/PackageManagers.vue +42 -58
  49. package/app/components/content/PageCards.vue +7 -4
  50. package/app/components/content/Preview.vue +15 -39
  51. package/app/components/content/ProseImg.vue +596 -49
  52. package/app/components/content/Since.vue +1 -1
  53. package/app/components/content/Steps.vue +6 -4
  54. package/app/components/content/TabGroup.vue +13 -12
  55. package/app/components/ui/breadcrumb/BreadcrumbSeparator.vue +1 -1
  56. package/app/components/ui/command/CommandShortcut.vue +1 -1
  57. package/app/components/ui/dialog/DialogContent.vue +2 -2
  58. package/app/components/ui/dialog/DialogHeader.vue +1 -1
  59. package/app/components/ui/dialog/DialogScrollContent.vue +1 -1
  60. package/app/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue +2 -2
  61. package/app/components/ui/dropdown-menu/DropdownMenuItem.vue +1 -1
  62. package/app/components/ui/dropdown-menu/DropdownMenuLabel.vue +1 -1
  63. package/app/components/ui/dropdown-menu/DropdownMenuRadioItem.vue +2 -2
  64. package/app/components/ui/dropdown-menu/DropdownMenuShortcut.vue +1 -1
  65. package/app/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue +2 -2
  66. package/app/components/ui/navigation-menu/NavigationMenuContent.vue +1 -1
  67. package/app/components/ui/navigation-menu/NavigationMenuTrigger.vue +1 -1
  68. package/app/components/ui/navigation-menu/NavigationMenuViewport.vue +1 -1
  69. package/app/components/ui/scroll-area/ScrollBar.vue +1 -1
  70. package/app/components/ui/select/SelectItem.vue +2 -2
  71. package/app/components/ui/sheet/SheetContent.vue +29 -3
  72. package/app/components/ui/sidebar/Sidebar.vue +28 -4
  73. package/app/components/ui/sidebar/SidebarGroupAction.vue +1 -1
  74. package/app/components/ui/sidebar/SidebarInset.vue +1 -1
  75. package/app/components/ui/sidebar/SidebarMenuAction.vue +1 -1
  76. package/app/components/ui/sidebar/SidebarMenuBadge.vue +1 -1
  77. package/app/components/ui/sidebar/SidebarMenuSub.vue +1 -1
  78. package/app/components/ui/sidebar/SidebarMenuSubButton.vue +1 -1
  79. package/app/components/ui/sidebar/SidebarProvider.vue +7 -16
  80. package/app/components/ui/sidebar/index.ts +10 -2
  81. package/app/components/ui/sidebar/utils.ts +0 -1
  82. package/app/components/ui/sonner/Sonner.vue +18 -0
  83. package/app/components/ui/tabs/TabsList.vue +13 -3
  84. package/app/components/ui/tabs/TabsTrigger.vue +24 -3
  85. package/app/components/ui/tooltip/TooltipContent.vue +2 -2
  86. package/app/composables/useActiveHeading.ts +3 -25
  87. package/app/composables/useDuxtAnalytics.ts +50 -0
  88. package/app/composables/useDuxtAnimatedHeight.ts +8 -38
  89. package/app/composables/useDuxtAnnouncements.ts +153 -0
  90. package/app/composables/useDuxtCopy.ts +51 -0
  91. package/app/composables/useDuxtDirection.ts +23 -0
  92. package/app/composables/useDuxtNavigation.ts +28 -8
  93. package/app/composables/useDuxtPath.ts +3 -5
  94. package/app/composables/useDuxtSearch.ts +87 -35
  95. package/app/composables/useDuxtSection.ts +15 -1
  96. package/app/composables/useDuxtSectionRow.ts +6 -5
  97. package/app/composables/useDuxtShortcuts.ts +319 -20
  98. package/app/composables/useDuxtVersion.ts +57 -6
  99. package/app/composables/useDuxtViewportMeasure.ts +37 -0
  100. package/app/composables/useFuzzySearch.ts +9 -4
  101. package/app/composables/useRecentPages.ts +14 -17
  102. package/app/error.vue +112 -74
  103. package/app/layouts/changelog.vue +9 -1
  104. package/app/layouts/default.vue +9 -0
  105. package/app/layouts/docs.vue +9 -1
  106. package/app/layouts/reference.vue +9 -1
  107. package/app/middleware/duxt-section-layout.global.ts +1 -3
  108. package/app/pages/[...slug].vue +146 -35
  109. package/app/pages/index.vue +15 -23
  110. package/app/types/duxt.d.ts +312 -4
  111. package/app/utils/analytics.ts +91 -0
  112. package/app/utils/announcements.ts +205 -0
  113. package/app/utils/changelog.ts +0 -28
  114. package/app/utils/code-highlight.ts +3 -1
  115. package/app/utils/contributor-avatar.ts +27 -0
  116. package/app/utils/direction.ts +43 -0
  117. package/app/utils/duxt-config.ts +43 -0
  118. package/app/utils/duxt-text.ts +10 -0
  119. package/app/utils/format-date.ts +28 -0
  120. package/app/utils/generated-sections.ts +68 -12
  121. package/app/utils/generated-toc.ts +14 -7
  122. package/app/utils/locale-path.ts +43 -0
  123. package/app/utils/navigation-tree.ts +51 -1
  124. package/app/utils/nearest-page.ts +8 -0
  125. package/app/utils/openapi.ts +16 -11
  126. package/app/utils/page-controls.ts +215 -0
  127. package/app/utils/pill.ts +61 -0
  128. package/app/utils/prose-image.ts +128 -0
  129. package/app/utils/search-context.ts +110 -0
  130. package/app/utils/search-display.ts +248 -0
  131. package/app/utils/section-scope.ts +65 -4
  132. package/app/utils/stored-json.ts +31 -0
  133. package/app/utils/version-choices.ts +6 -13
  134. package/app/utils/version-paths.ts +21 -0
  135. package/bin/duxt-cache-key.mjs +61 -0
  136. package/bin/duxt-og-cache.mjs +58 -0
  137. package/bin/{duxt-report.mjs → duxt.mjs} +13 -7
  138. package/bruno-model.ts +169 -0
  139. package/bruno-parse.ts +656 -0
  140. package/bruno-zip.ts +195 -0
  141. package/cli.ts +240 -0
  142. package/duxt-app-config.ts +18 -1
  143. package/frontmatter.ts +49 -0
  144. package/git-contributors.ts +322 -0
  145. package/i18n/locales/de/duxt/announcement.json +7 -0
  146. package/i18n/locales/de/duxt/bruno.json +25 -0
  147. package/i18n/locales/de/duxt/changelog.json +1 -1
  148. package/i18n/locales/de/duxt/code.json +2 -1
  149. package/i18n/locales/de/duxt/page.json +9 -0
  150. package/i18n/locales/de/duxt/shortcuts.json +1 -0
  151. package/i18n/locales/de/duxt/theme.json +2 -1
  152. package/i18n/locales/en/duxt/announcement.json +7 -0
  153. package/i18n/locales/en/duxt/bruno.json +25 -0
  154. package/i18n/locales/en/duxt/changelog.json +1 -1
  155. package/i18n/locales/en/duxt/code.json +2 -1
  156. package/i18n/locales/en/duxt/page.json +9 -0
  157. package/i18n/locales/en/duxt/shortcuts.json +1 -0
  158. package/i18n/locales/en/duxt/theme.json +2 -1
  159. package/i18n/locales/es/duxt/announcement.json +7 -0
  160. package/i18n/locales/es/duxt/bruno.json +25 -0
  161. package/i18n/locales/es/duxt/changelog.json +1 -1
  162. package/i18n/locales/es/duxt/code.json +2 -1
  163. package/i18n/locales/es/duxt/page.json +9 -0
  164. package/i18n/locales/es/duxt/shortcuts.json +1 -0
  165. package/i18n/locales/es/duxt/theme.json +2 -1
  166. package/i18n/locales/fr/duxt/announcement.json +7 -0
  167. package/i18n/locales/fr/duxt/bruno.json +25 -0
  168. package/i18n/locales/fr/duxt/changelog.json +1 -1
  169. package/i18n/locales/fr/duxt/code.json +2 -1
  170. package/i18n/locales/fr/duxt/page.json +9 -0
  171. package/i18n/locales/fr/duxt/shortcuts.json +1 -0
  172. package/i18n/locales/fr/duxt/theme.json +2 -1
  173. package/i18n/locales/pt/duxt/announcement.json +7 -0
  174. package/i18n/locales/pt/duxt/bruno.json +25 -0
  175. package/i18n/locales/pt/duxt/changelog.json +1 -1
  176. package/i18n/locales/pt/duxt/code.json +2 -1
  177. package/i18n/locales/pt/duxt/page.json +9 -0
  178. package/i18n/locales/pt/duxt/shortcuts.json +1 -0
  179. package/i18n/locales/pt/duxt/theme.json +2 -1
  180. package/modules/bruno.ts +118 -0
  181. package/modules/config.ts +26 -0
  182. package/modules/devtools.ts +2 -3
  183. package/modules/git-meta.ts +16 -47
  184. package/modules/search-records.ts +132 -0
  185. package/nuxt.config.ts +81 -7
  186. package/og-image-cache.ts +742 -0
  187. package/package.json +41 -9
  188. package/public/devtools/checks.html +2 -2
  189. package/public/devtools/config.html +59 -4
  190. package/public/devtools/pages.html +8 -1
  191. package/public/devtools/paths.html +1 -1
  192. package/public/devtools/sources.html +2 -2
  193. package/public/devtools/versions.html +3 -0
  194. package/report.ts +28 -19
  195. package/search-records.ts +380 -0
  196. package/section-input.ts +142 -0
  197. package/section-markdown.ts +67 -0
  198. package/section-reports.ts +10 -4
  199. package/sections-bruno.ts +571 -0
  200. package/sections-changelog.ts +76 -43
  201. package/sections-openapi.ts +12 -83
  202. package/sections-resolve.ts +174 -8
  203. package/sections.ts +33 -10
  204. package/server/devtools/shell.ts +1 -1
  205. package/server/mcp/tools/list-pages.ts +77 -36
  206. package/server/mcp/tools/list-versions.ts +84 -0
  207. package/server/mcp/tools/read-page.ts +80 -26
  208. package/server/mcp/tools/search-docs.ts +87 -53
  209. package/server/middleware/raw-markdown.ts +1 -1
  210. package/server/routes/llms-full.txt.get.ts +6 -8
  211. package/server/routes/llms.txt.get.ts +1 -1
  212. package/server/utils/duxt-server-text.ts +0 -13
  213. package/server/utils/llms-pages.ts +24 -9
  214. package/server/utils/mcp-docs.ts +577 -0
  215. package/sources-cache.ts +376 -0
  216. package/sources-git.ts +186 -31
  217. package/sources-resolve.ts +59 -1
  218. package/sources.ts +122 -13
  219. package/tfplugindocs.ts +158 -0
package/nuxt.config.ts CHANGED
@@ -61,6 +61,8 @@ const locales = [
61
61
  language: 'en-GB',
62
62
  name: 'English (UK)',
63
63
  files: [
64
+ 'en/duxt/announcement.json',
65
+ 'en/duxt/bruno.json',
64
66
  'en/duxt/changelog.json',
65
67
  'en/duxt/code.json',
66
68
  'en/duxt/devtools.json',
@@ -83,6 +85,8 @@ const locales = [
83
85
  language: 'en-US',
84
86
  name: 'English (US)',
85
87
  files: [
88
+ 'en/duxt/announcement.json',
89
+ 'en/duxt/bruno.json',
86
90
  'en/duxt/changelog.json',
87
91
  'en/duxt/code.json',
88
92
  'en/duxt/devtools.json',
@@ -105,6 +109,8 @@ const locales = [
105
109
  language: 'de-DE',
106
110
  name: 'Deutsch',
107
111
  files: [
112
+ 'de/duxt/announcement.json',
113
+ 'de/duxt/bruno.json',
108
114
  'de/duxt/changelog.json',
109
115
  'de/duxt/code.json',
110
116
  'de/duxt/devtools.json',
@@ -127,6 +133,8 @@ const locales = [
127
133
  language: 'es-ES',
128
134
  name: 'Español',
129
135
  files: [
136
+ 'es/duxt/announcement.json',
137
+ 'es/duxt/bruno.json',
130
138
  'es/duxt/changelog.json',
131
139
  'es/duxt/code.json',
132
140
  'es/duxt/devtools.json',
@@ -149,6 +157,8 @@ const locales = [
149
157
  language: 'fr-FR',
150
158
  name: 'Français',
151
159
  files: [
160
+ 'fr/duxt/announcement.json',
161
+ 'fr/duxt/bruno.json',
152
162
  'fr/duxt/changelog.json',
153
163
  'fr/duxt/code.json',
154
164
  'fr/duxt/devtools.json',
@@ -171,6 +181,8 @@ const locales = [
171
181
  language: 'pt-PT',
172
182
  name: 'Português',
173
183
  files: [
184
+ 'pt/duxt/announcement.json',
185
+ 'pt/duxt/bruno.json',
174
186
  'pt/duxt/changelog.json',
175
187
  'pt/duxt/code.json',
176
188
  'pt/duxt/devtools.json',
@@ -193,6 +205,8 @@ const locales = [
193
205
  language: 'pt-BR',
194
206
  name: 'Português (Brasil)',
195
207
  files: [
208
+ 'pt/duxt/announcement.json',
209
+ 'pt/duxt/bruno.json',
196
210
  'pt/duxt/changelog.json',
197
211
  'pt/duxt/code.json',
198
212
  'pt/duxt/devtools.json',
@@ -242,6 +256,17 @@ export default defineNuxtConfig({
242
256
  // serves that page at.
243
257
  layer('./modules/redirects.ts'),
244
258
 
259
+ // The downloadable archive of every local Bruno collection, written during
260
+ // the build and served as a static asset. A no-op for a site that declares
261
+ // no `bruno` section.
262
+ layer('./modules/bruno.ts'),
263
+
264
+ // The layer's one build-time extension point: every parsed page of every
265
+ // source, version and language, handed to `duxt:search:records` so an
266
+ // external search provider can be a layer rather than a fork. Builds
267
+ // nothing while no consumer is listening, which is every site until one is.
268
+ layer('./modules/search-records.ts'),
269
+
245
270
  /**
246
271
  * The SEO half, BEFORE Content on purpose.
247
272
  *
@@ -305,11 +330,37 @@ export default defineNuxtConfig({
305
330
  mcp: {
306
331
  description: 'The documentation this site publishes, readable by an agent.',
307
332
  instructions:
308
- 'Call list_pages for the table of contents, search_docs to find a page by ' +
309
- 'term, and read_page for the full text of one page.'
333
+ 'Call list_versions first: it gives the URL prefix that scopes one ' +
334
+ 'documentation version. Pass that prefix to list_pages for its table of ' +
335
+ 'contents or to search_docs to find a page by term, then read_page for ' +
336
+ 'one page as Markdown.'
310
337
  },
311
338
 
312
- nitro: wasm ? { externals: { traceInclude: [wasm] } } : {},
339
+ nitro: {
340
+ /**
341
+ * THE MCP TOOLS CANNOT REACH THE REQUEST WITHOUT THIS.
342
+ *
343
+ * `@nuxtjs/mcp-toolkit` hands a tool handler the MCP SDK's
344
+ * `RequestHandlerExtra` and nothing of H3's, so the only way into the
345
+ * request from inside a tool is `useEvent()` — which throws
346
+ * "Nitro request context is not available" unless Nitro wraps each request
347
+ * in an `AsyncLocalStorage`. The toolkit's own server helpers
348
+ * (`useMcpServer`, `useMcpSession`, `useMcpLogger`) are built on the same
349
+ * call, so this is a prerequisite of mounting an MCP server rather than a
350
+ * preference of duxt's.
351
+ *
352
+ * It is the one Nitro flag this layer imposes on a consumer, and it is
353
+ * imposed knowingly: the alternative is four tools that answer from the
354
+ * global `$fetch` and the default locale instead of from the request, i.e.
355
+ * a second database-reading code path that exists only under `/mcp` and
356
+ * that only a Worker would ever have disagreed with. A consumer who wants
357
+ * it off writes `nitro: { experimental: { asyncContext: false } }` and
358
+ * loses `/mcp`, nothing else.
359
+ */
360
+ experimental: { asyncContext: true },
361
+
362
+ ...(wasm ? { externals: { traceInclude: [wasm] } } : {})
363
+ },
313
364
 
314
365
  css: [layer('./app/assets/css/duxt.css')],
315
366
 
@@ -331,15 +382,38 @@ export default defineNuxtConfig({
331
382
  dark: 'github-dark'
332
383
  },
333
384
  langs: highlightLangs
334
- }
385
+ },
386
+
387
+ /**
388
+ * PARSE the whole outline; decide how much of it to draw later.
389
+ *
390
+ * MDC's `depth` is a COUNT from `h2` over `[h2,h3,h4,h5,h6]`, and its
391
+ * default of `2` stops at `h3` — so a page writing `toc: { maxDepth: 5 }`
392
+ * would have asked for headings Content never put in `body.toc`, and
393
+ * the field would be a promise the build quietly broke. Parsing all
394
+ * five costs a few rows in a table nobody queries by depth.
395
+ *
396
+ * It does NOT change what a reader sees: `duxtTocLinks` cuts the tree
397
+ * back to `duxt.toc.depth` — still `h3` — before `DuxtToc` draws it, so
398
+ * a page that asks for nothing gets exactly the column it always had.
399
+ *
400
+ * `searchDepth` is deliberately left alone. It bounds how deep into the
401
+ * node tree headings are looked for, not which levels count, so raising
402
+ * it would change which pages have an outline at all.
403
+ */
404
+ toc: { depth: 5 }
335
405
  }
336
406
  },
337
407
 
338
408
  // Content's default driver, better-sqlite3, is a native addon compiled
339
- // through node-gyp. Node 24 ships node:sqlite, so no driver package is
340
- // needed — see CLAUDE.md for the fallback if this flag ever goes away.
409
+ // through node-gyp. `native` is Node 24's own node:sqlite, so no driver
410
+ // package is needed — see CLAUDE.md for the fallback if this option ever
411
+ // goes away. It replaced `nativeSqlite: true`, which Content still honours
412
+ // but marks deprecated; a layer is the worst place to carry a deprecation,
413
+ // so tests/sqlite-connector.test.ts holds this block to whatever the
414
+ // installed Content declares current.
341
415
  experimental: {
342
- nativeSqlite: true
416
+ sqliteConnector: 'native'
343
417
  }
344
418
  },
345
419