@kirchdev/duxt 0.3.4-dev-main.41-23ded41 → 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/bruno-model.ts ADDED
@@ -0,0 +1,169 @@
1
+ /**
2
+ * The shape a Bruno collection is read into — types only, and no imports.
3
+ *
4
+ * Split from `bruno-parse.ts` for the reason `openapi-model.ts` is split from
5
+ * `openapi-parse.ts`: the parser reads a directory and the theme's components
6
+ * need the model without it, and a file with no imports at all can be read from
7
+ * the build, the tests and a `.vue` file in the browser bundle alike.
8
+ *
9
+ * WHAT IS DELIBERATELY NOT HERE, because a Bruno collection carries it and this
10
+ * layer refuses to publish it:
11
+ *
12
+ * - **Environments.** `environments/*.bru` routinely holds hosts, tokens and
13
+ * keys. They are never read, never parsed and never rendered — see
14
+ * `BRUNO_UNPUBLISHED` in `bruno-parse.ts`.
15
+ * - **Scripts and tests.** `script:pre-request`, `script:post-response`,
16
+ * `tests` and `assert` are executable code written against Bruno's own
17
+ * runtime. A documentation site neither runs them nor prints them; a request
18
+ * records only THAT it has them, so a reader downloading the collection knows
19
+ * the page is not the whole of it.
20
+ * - **Credentials in an auth block.** `auth:bearer { token: … }` is a live
21
+ * secret as often as it is a placeholder. The MODE survives — a reader needs
22
+ * to know the endpoint wants a bearer token — and the value never does.
23
+ *
24
+ * A Bruno collection is a CLIENT ARTEFACT, and the model says so rather than
25
+ * pretending otherwise: there are no response schemas here, no reusable
26
+ * components and no statement of what a field means, because a `.bru` file
27
+ * holds none of those. Inventing them is what the issue behind this type
28
+ * rejected `bruno → openapi` conversion for.
29
+ */
30
+
31
+ /** One `key: value` line of a dictionary block. */
32
+ export interface DuxtBrunoEntry {
33
+ name: string;
34
+ value: string;
35
+ /** Written with a leading `~`: kept in the file, not sent. */
36
+ disabled?: boolean;
37
+ /**
38
+ * The value was withheld because the name says it carries a credential.
39
+ *
40
+ * See `redactEntry` in `bruno-parse.ts`. The entry still appears — an
41
+ * endpoint wanting an `Authorization` header is exactly what a reference has
42
+ * to say — and the value is replaced rather than the line dropped.
43
+ */
44
+ redacted?: boolean;
45
+ }
46
+
47
+ /** A query or path parameter. */
48
+ export interface DuxtBrunoParam extends DuxtBrunoEntry {
49
+ in: 'query' | 'path';
50
+ }
51
+
52
+ /** A request body, in whichever of Bruno's spellings the file used. */
53
+ export interface DuxtBrunoBody {
54
+ /** `json`, `text`, `xml`, `sparql`, `graphql`, `form-urlencoded`, … */
55
+ type: string;
56
+ /** A text body, verbatim. */
57
+ text?: string;
58
+ /** A GraphQL body's variables block, verbatim. */
59
+ variables?: string;
60
+ /** A form body, as its fields. */
61
+ entries?: DuxtBrunoEntry[];
62
+ /**
63
+ * The fence language for a text body, as Shiki reads it.
64
+ *
65
+ * Resolved at parse time rather than in the component: the page is Markdown,
66
+ * so the language has to be in the fence the parser writes.
67
+ */
68
+ language?: string;
69
+ }
70
+
71
+ /** What a request authenticates with — the MODE, never the credential. */
72
+ export interface DuxtBrunoAuth {
73
+ /** `bearer`, `basic`, `apikey`, `oauth2`, `inherit`, `none`, … */
74
+ mode: string;
75
+ }
76
+
77
+ /** One request: a `.bru` file that is not `folder.bru` or `collection.bru`. */
78
+ export interface DuxtBrunoRequest {
79
+ /** `meta.name`, falling back to the file name. */
80
+ name: string;
81
+ /** The file this came from, relative to the collection root. */
82
+ file: string;
83
+ /** `meta.seq`, which is how Bruno orders a folder's requests. */
84
+ seq?: number;
85
+ /** Upper-cased, e.g. `GET`. */
86
+ method: string;
87
+ /**
88
+ * The URL as written, `{{variable}}` placeholders intact — minus whatever
89
+ * the redaction rule withholds. See `redactUrl` in `bruno-parse.ts`.
90
+ */
91
+ url: string;
92
+ /**
93
+ * Something was taken out of the URL: userinfo, or a credential's value.
94
+ *
95
+ * Said on the model so the page can say it too. A blank `?api_key=` reads as
96
+ * a parameter the collection forgot to fill in unless the page states that it
97
+ * was withheld, which is the same thing the table's badge does for a header.
98
+ */
99
+ urlRedacted?: boolean;
100
+ /** `meta.type`: `http` or `graphql`. */
101
+ kind: string;
102
+ params: DuxtBrunoParam[];
103
+ headers: DuxtBrunoEntry[];
104
+ auth?: DuxtBrunoAuth;
105
+ body?: DuxtBrunoBody;
106
+ /** The `docs` block, as the CommonMark it is. */
107
+ docs?: string;
108
+ /** It has a `script:*` block — said, never shown, never run. */
109
+ script?: boolean;
110
+ /** It has a `tests` or `assert` block — said, never shown, never run. */
111
+ tests?: boolean;
112
+ /**
113
+ * What the try-it client is given, when the site opted into one.
114
+ *
115
+ * An `DuxtOpenApiOperation` rather than a shape of its own, and that is the
116
+ * whole of this type's answer to "is the client reusable": the existing
117
+ * client takes an operation, servers and security, so a Bruno request is
118
+ * ADAPTED to that at build time and the component is reused unchanged. A
119
+ * second client would be a second place for a credential to be mishandled.
120
+ *
121
+ * Absent when the site declared no `tryIt`, or when the URL still holds a
122
+ * variable the site did not declare a value for — a send button that cannot
123
+ * build a real URL is worse than none.
124
+ */
125
+ tryIt?: DuxtBrunoTryIt;
126
+ }
127
+
128
+ /** The request, resolved against the site's own public configuration. */
129
+ export interface DuxtBrunoTryIt {
130
+ /** The public base URL the request is sent to. */
131
+ server: string;
132
+ /** The path under it, `{{variables}}` already substituted. */
133
+ path: string;
134
+ }
135
+
136
+ /** A folder: a directory, plus whatever `folder.bru` said about it. */
137
+ export interface DuxtBrunoFolder {
138
+ /** `meta.name`, falling back to the directory name. */
139
+ name: string;
140
+ /** The directory, relative to the collection root. */
141
+ dir: string;
142
+ /** `meta.seq`, which is how Bruno orders folders. */
143
+ seq?: number;
144
+ /** The folder's own `docs` block. */
145
+ docs?: string;
146
+ folders: DuxtBrunoFolder[];
147
+ requests: DuxtBrunoRequest[];
148
+ }
149
+
150
+ /** A whole collection, as the pages are built from it. */
151
+ export interface DuxtBrunoCollection {
152
+ /** `bruno.json`'s `name`, falling back to the declared path. */
153
+ name: string;
154
+ /** `bruno.json`'s `version`, where it has one. */
155
+ version?: string;
156
+ /** `collection.bru`'s `docs` block. */
157
+ docs?: string;
158
+ /** Collection-level headers, which every request inherits. */
159
+ headers: DuxtBrunoEntry[];
160
+ /** Collection-level auth mode, which `auth: inherit` resolves to. */
161
+ auth?: DuxtBrunoAuth;
162
+ folders: DuxtBrunoFolder[];
163
+ /** Requests at the collection root, outside any folder. */
164
+ requests: DuxtBrunoRequest[];
165
+ /** How many environment files were found and deliberately not read. */
166
+ environments: number;
167
+ /** What the parser carried on past — see `DuxtSectionContext.warn`. */
168
+ warnings: string[];
169
+ }