@wrikka/create-docs 0.1.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.
Files changed (380) hide show
  1. package/README.md +137 -0
  2. package/bin/cli.js +408 -0
  3. package/dist/index.cjs +20 -0
  4. package/dist/index.d.cts +475 -0
  5. package/dist/index.d.ts +475 -0
  6. package/dist/index.js +20 -0
  7. package/docs/_dir.yml +2 -0
  8. package/docs/config.md +75 -0
  9. package/docs/data-sources.md +88 -0
  10. package/docs/deploy.md +38 -0
  11. package/docs/features.md +51 -0
  12. package/docs/getting-started.md +42 -0
  13. package/docs/index.md +34 -0
  14. package/docs/markdown.md +154 -0
  15. package/docs/theming.md +53 -0
  16. package/package.json +142 -0
  17. package/scripts/generate-docs-index.ts +111 -0
  18. package/scripts/github-pull.ts +124 -0
  19. package/src/adapters/config/index.ts +1 -0
  20. package/src/adapters/config/node-config-loader.ts +36 -0
  21. package/src/adapters/fs/fs-docs-loader.ts +31 -0
  22. package/src/adapters/fs/index.ts +12 -0
  23. package/src/adapters/fs/memory-fs.ts +60 -0
  24. package/src/adapters/fs/node-fs.ts +116 -0
  25. package/src/adapters/git/index.ts +164 -0
  26. package/src/adapters/github/github-pull.ts +340 -0
  27. package/src/adapters/index.ts +6 -0
  28. package/src/adapters/velite.ts +112 -0
  29. package/src/adapters/vite/docs-watcher.ts +36 -0
  30. package/src/adapters/vite/index.ts +2 -0
  31. package/src/adapters/vite/polling-watcher.ts +89 -0
  32. package/src/code-block-enhancements/index.ts +3 -0
  33. package/src/config/index.ts +15 -0
  34. package/src/content/index.ts +11 -0
  35. package/src/content-validation/index.ts +5 -0
  36. package/src/index.ts +174 -0
  37. package/src/live-editor/index.ts +7 -0
  38. package/src/modules/analytics/application/plausible-adapter.ts +103 -0
  39. package/src/modules/analytics/application/umami-adapter.ts +109 -0
  40. package/src/modules/analytics/domain/events/index.ts +37 -0
  41. package/src/modules/analytics/domain/models/index.ts +35 -0
  42. package/src/modules/analytics/domain/operations/analytics-operations.ts +67 -0
  43. package/src/modules/analytics/domain/validators/index.ts +50 -0
  44. package/src/modules/analytics/index.ts +9 -0
  45. package/src/modules/analytics/ports/analytics-port.ts +17 -0
  46. package/src/modules/analytics/types/analytics.ts +16 -0
  47. package/src/modules/api-docs/application/type-docs-adapter.ts +34 -0
  48. package/src/modules/api-docs/domain/events/index.ts +42 -0
  49. package/src/modules/api-docs/domain/models/index.ts +40 -0
  50. package/src/modules/api-docs/domain/operations/api-docs-operations.ts +59 -0
  51. package/src/modules/api-docs/domain/validators/index.ts +56 -0
  52. package/src/modules/api-docs/index.ts +8 -0
  53. package/src/modules/api-docs/ports/api-docs-port.ts +21 -0
  54. package/src/modules/api-docs/types/api-docs.ts +15 -0
  55. package/src/modules/api-reference/openapi.ts +166 -0
  56. package/src/modules/api-reference/orpc.ts +94 -0
  57. package/src/modules/code-block-enhancements/application/usecases/index.ts +39 -0
  58. package/src/modules/code-block-enhancements/domain/code-operations.ts +72 -0
  59. package/src/modules/code-block-enhancements/domain/events/index.ts +58 -0
  60. package/src/modules/code-block-enhancements/domain/index.ts +11 -0
  61. package/src/modules/code-block-enhancements/domain/models/index.ts +36 -0
  62. package/src/modules/code-block-enhancements/domain/validators/index.ts +50 -0
  63. package/src/modules/code-block-enhancements/index.ts +10 -0
  64. package/src/modules/code-block-enhancements/ports/index.ts +18 -0
  65. package/src/modules/code-block-enhancements/types/index.ts +37 -0
  66. package/src/modules/code-execution/application/sandbox-adapter.ts +44 -0
  67. package/src/modules/code-execution/domain/events/index.ts +58 -0
  68. package/src/modules/code-execution/domain/models/index.ts +33 -0
  69. package/src/modules/code-execution/domain/operations/execution-operations.ts +60 -0
  70. package/src/modules/code-execution/domain/validators/index.ts +50 -0
  71. package/src/modules/code-execution/index.ts +8 -0
  72. package/src/modules/code-execution/ports/execution-port.ts +15 -0
  73. package/src/modules/code-execution/types/execution.ts +15 -0
  74. package/src/modules/comments/application/giscus-adapter.ts +55 -0
  75. package/src/modules/comments/domain/events/index.ts +55 -0
  76. package/src/modules/comments/domain/models/index.ts +30 -0
  77. package/src/modules/comments/domain/operations/comment-operations.ts +46 -0
  78. package/src/modules/comments/domain/validators/index.ts +50 -0
  79. package/src/modules/comments/index.ts +8 -0
  80. package/src/modules/comments/ports/comment-port.ts +18 -0
  81. package/src/modules/comments/types/comments.ts +19 -0
  82. package/src/modules/config/application/usecases/index.ts +1 -0
  83. package/src/modules/config/application/usecases/loadConfig.ts +38 -0
  84. package/src/modules/config/application/workflows/index.ts +1 -0
  85. package/src/modules/config/application/workflows/validateConfig.ts +14 -0
  86. package/src/modules/config/domain/events/index.ts +50 -0
  87. package/src/modules/config/domain/models/index.ts +9 -0
  88. package/src/modules/config/domain/operations/defaults.ts +74 -0
  89. package/src/modules/config/domain/operations/index.ts +2 -0
  90. package/src/modules/config/domain/operations/resolve.ts +40 -0
  91. package/src/modules/config/domain/validators/index.ts +152 -0
  92. package/src/modules/config/index.ts +23 -0
  93. package/src/modules/config/ports/index.ts +15 -0
  94. package/src/modules/config/types/index.ts +113 -0
  95. package/src/modules/config/types/public.ts +19 -0
  96. package/src/modules/content/application/cache/index.ts +6 -0
  97. package/src/modules/content/application/cache/parse-cache.ts +6 -0
  98. package/src/modules/content/application/cache/parseCache.ts +56 -0
  99. package/src/modules/content/application/usecases/index.ts +2 -0
  100. package/src/modules/content/application/usecases/load-doc-page.ts +1 -0
  101. package/src/modules/content/application/usecases/loadDocPage.ts +111 -0
  102. package/src/modules/content/application/usecases/scanDocsDir.ts +105 -0
  103. package/src/modules/content/application/workflows/index.ts +1 -0
  104. package/src/modules/content/application/workflows/processDocs.ts +51 -0
  105. package/src/modules/content/domain/events/index.ts +61 -0
  106. package/src/modules/content/domain/models/index.ts +13 -0
  107. package/src/modules/content/domain/operations/build-page.ts +146 -0
  108. package/src/modules/content/domain/operations/buildPage.ts +93 -0
  109. package/src/modules/content/domain/operations/index.ts +17 -0
  110. package/src/modules/content/domain/operations/parse.ts +241 -0
  111. package/src/modules/content/domain/validators/frontmatter.ts +82 -0
  112. package/src/modules/content/domain/validators/index.ts +6 -0
  113. package/src/modules/content/index.ts +27 -0
  114. package/src/modules/content/ports/index.ts +45 -0
  115. package/src/modules/content/ports/velite.ts +134 -0
  116. package/src/modules/content/types/index.ts +76 -0
  117. package/src/modules/content/types/public.ts +1 -0
  118. package/src/modules/content-linting/application/builtin-linting-adapter.ts +82 -0
  119. package/src/modules/content-linting/domain/events/index.ts +58 -0
  120. package/src/modules/content-linting/domain/models/index.ts +46 -0
  121. package/src/modules/content-linting/domain/operations/linting-operations.ts +82 -0
  122. package/src/modules/content-linting/domain/validators/index.ts +50 -0
  123. package/src/modules/content-linting/index.ts +8 -0
  124. package/src/modules/content-linting/ports/linting-port.ts +21 -0
  125. package/src/modules/content-linting/types/linting.ts +18 -0
  126. package/src/modules/content-validation/application/usecases/index.ts +18 -0
  127. package/src/modules/content-validation/domain/events/index.ts +7 -0
  128. package/src/modules/content-validation/domain/index.ts +16 -0
  129. package/src/modules/content-validation/domain/models/index.ts +33 -0
  130. package/src/modules/content-validation/domain/operations/index.ts +157 -0
  131. package/src/modules/content-validation/domain/types/index.ts +17 -0
  132. package/src/modules/content-validation/domain/validators/index.ts +8 -0
  133. package/src/modules/content-validation/index.ts +9 -0
  134. package/src/modules/content-validation/ports/index.ts +15 -0
  135. package/src/modules/content-validation/types/index.ts +5 -0
  136. package/src/modules/export/application/puppeteer-export-adapter.ts +63 -0
  137. package/src/modules/export/domain/events/index.ts +55 -0
  138. package/src/modules/export/domain/models/index.ts +38 -0
  139. package/src/modules/export/domain/operations/export-operations.ts +56 -0
  140. package/src/modules/export/domain/validators/index.ts +52 -0
  141. package/src/modules/export/index.ts +8 -0
  142. package/src/modules/export/ports/export-port.ts +15 -0
  143. package/src/modules/export/types/export.ts +15 -0
  144. package/src/modules/external-search/application/algolia-adapter.ts +182 -0
  145. package/src/modules/external-search/application/meilisearch-adapter.ts +161 -0
  146. package/src/modules/external-search/domain/events/index.ts +42 -0
  147. package/src/modules/external-search/domain/models/index.ts +42 -0
  148. package/src/modules/external-search/domain/operations/search-operations.ts +53 -0
  149. package/src/modules/external-search/domain/validators/index.ts +55 -0
  150. package/src/modules/external-search/index.ts +9 -0
  151. package/src/modules/external-search/ports/external-search-port.ts +23 -0
  152. package/src/modules/external-search/types/search.ts +19 -0
  153. package/src/modules/git-history/application/simple-git-adapter.ts +46 -0
  154. package/src/modules/git-history/domain/events/index.ts +34 -0
  155. package/src/modules/git-history/domain/models/index.ts +25 -0
  156. package/src/modules/git-history/domain/operations/git-history-operations.ts +56 -0
  157. package/src/modules/git-history/domain/validators/index.ts +52 -0
  158. package/src/modules/git-history/index.ts +8 -0
  159. package/src/modules/git-history/ports/git-history-port.ts +21 -0
  160. package/src/modules/git-history/types/git-history.ts +15 -0
  161. package/src/modules/i18n/application/fs-locale-loader.ts +39 -0
  162. package/src/modules/i18n/domain/events/index.ts +34 -0
  163. package/src/modules/i18n/domain/models/index.ts +34 -0
  164. package/src/modules/i18n/domain/operations/locale-operations.ts +74 -0
  165. package/src/modules/i18n/domain/validators/index.ts +52 -0
  166. package/src/modules/i18n/index.ts +8 -0
  167. package/src/modules/i18n/ports/locale-loader-port.ts +18 -0
  168. package/src/modules/i18n/types/locale.ts +17 -0
  169. package/src/modules/image-optimization/application/sharp-adapter.ts +58 -0
  170. package/src/modules/image-optimization/domain/events/index.ts +39 -0
  171. package/src/modules/image-optimization/domain/models/index.ts +27 -0
  172. package/src/modules/image-optimization/domain/operations/image-operations.ts +65 -0
  173. package/src/modules/image-optimization/domain/validators/index.ts +52 -0
  174. package/src/modules/image-optimization/index.ts +8 -0
  175. package/src/modules/image-optimization/ports/image-optimizer-port.ts +15 -0
  176. package/src/modules/image-optimization/types/image.ts +17 -0
  177. package/src/modules/live-editor/application/usecases/index.ts +60 -0
  178. package/src/modules/live-editor/domain/events/index.ts +37 -0
  179. package/src/modules/live-editor/domain/gitOperations.ts +110 -0
  180. package/src/modules/live-editor/domain/index.ts +15 -0
  181. package/src/modules/live-editor/domain/models/index.ts +21 -0
  182. package/src/modules/live-editor/domain/validators/index.ts +55 -0
  183. package/src/modules/live-editor/index.ts +14 -0
  184. package/src/modules/live-editor/ports/index.ts +49 -0
  185. package/src/modules/live-editor/types/index.ts +80 -0
  186. package/src/modules/live-preview/application/vite-preview-adapter.ts +20 -0
  187. package/src/modules/live-preview/domain/operations/preview-operations.ts +56 -0
  188. package/src/modules/live-preview/index.ts +8 -0
  189. package/src/modules/live-preview/ports/preview-port.ts +20 -0
  190. package/src/modules/live-preview/types/preview.ts +16 -0
  191. package/src/modules/mdx/application/mdx-js-adapter.ts +38 -0
  192. package/src/modules/mdx/domain/operations/parse-mdx.ts +43 -0
  193. package/src/modules/mdx/index.ts +8 -0
  194. package/src/modules/mdx/ports/mdx-parser-port.ts +15 -0
  195. package/src/modules/mdx/types/mdx.ts +14 -0
  196. package/src/modules/navigation/application/usecases/buildNav.ts +15 -0
  197. package/src/modules/navigation/application/usecases/buildSidebar.ts +45 -0
  198. package/src/modules/navigation/application/usecases/index.ts +2 -0
  199. package/src/modules/navigation/domain/events/index.ts +30 -0
  200. package/src/modules/navigation/domain/models/index.ts +7 -0
  201. package/src/modules/navigation/domain/operations/group.ts +79 -0
  202. package/src/modules/navigation/domain/operations/index.ts +10 -0
  203. package/src/modules/navigation/domain/operations/sort.ts +27 -0
  204. package/src/modules/navigation/domain/shared/utils/array.ts +39 -0
  205. package/src/modules/navigation/domain/validators/index.ts +88 -0
  206. package/src/modules/navigation/index.ts +15 -0
  207. package/src/modules/navigation/ports/index.ts +9 -0
  208. package/src/modules/navigation/types/index.ts +38 -0
  209. package/src/modules/navigation/types/public.ts +9 -0
  210. package/src/modules/openapi/application/swagger-parser-adapter.ts +178 -0
  211. package/src/modules/openapi/domain/operations/parse-openapi.ts +46 -0
  212. package/src/modules/openapi/index.ts +8 -0
  213. package/src/modules/openapi/ports/openapi-parser-port.ts +15 -0
  214. package/src/modules/openapi/types/openapi.ts +37 -0
  215. package/src/modules/plugin/application/usecases/build-virtual-modules.ts +53 -0
  216. package/src/modules/plugin/application/usecases/index.ts +1 -0
  217. package/src/modules/plugin/application/workflows/build-docs.ts +79 -0
  218. package/src/modules/plugin/application/workflows/index.ts +1 -0
  219. package/src/modules/plugin/domain/events/index.ts +62 -0
  220. package/src/modules/plugin/domain/models/index.ts +1 -0
  221. package/src/modules/plugin/domain/operations/build-virtual.ts +76 -0
  222. package/src/modules/plugin/domain/operations/index.ts +11 -0
  223. package/src/modules/plugin/domain/validators/index.ts +30 -0
  224. package/src/modules/plugin/index.ts +14 -0
  225. package/src/modules/plugin/ports/index.ts +21 -0
  226. package/src/modules/plugin/types/index.ts +27 -0
  227. package/src/modules/plugin/types/public.ts +1 -0
  228. package/src/modules/search/application/usecases/index.ts +1 -0
  229. package/src/modules/search/application/usecases/indexPages.ts +15 -0
  230. package/src/modules/search/domain/events/index.ts +32 -0
  231. package/src/modules/search/domain/models/index.ts +1 -0
  232. package/src/modules/search/domain/operations/build-index.ts +6 -0
  233. package/src/modules/search/domain/operations/buildIndex.ts +70 -0
  234. package/src/modules/search/domain/operations/index.ts +7 -0
  235. package/src/modules/search/domain/operations/query.ts +186 -0
  236. package/src/modules/search/domain/validators/index.ts +32 -0
  237. package/src/modules/search/index.ts +9 -0
  238. package/src/modules/search/types/index.ts +22 -0
  239. package/src/modules/search/types/public.ts +1 -0
  240. package/src/modules/search-analytics/application/local-storage-adapter.ts +68 -0
  241. package/src/modules/search-analytics/domain/operations/search-analytics-operations.ts +74 -0
  242. package/src/modules/search-analytics/index.ts +8 -0
  243. package/src/modules/search-analytics/ports/search-analytics-port.ts +20 -0
  244. package/src/modules/search-analytics/types/search-analytics.ts +16 -0
  245. package/src/modules/search-highlighting/application/dom-highlighting-adapter.ts +36 -0
  246. package/src/modules/search-highlighting/domain/operations/highlighting-operations.ts +72 -0
  247. package/src/modules/search-highlighting/index.ts +8 -0
  248. package/src/modules/search-highlighting/ports/highlighting-port.ts +14 -0
  249. package/src/modules/search-highlighting/types/highlighting.ts +15 -0
  250. package/src/modules/seo-optimization/application/usecases/index.ts +18 -0
  251. package/src/modules/seo-optimization/domain/index.ts +12 -0
  252. package/src/modules/seo-optimization/domain/seoOperations.ts +92 -0
  253. package/src/modules/seo-optimization/index.ts +8 -0
  254. package/src/modules/seo-optimization/ports/index.ts +18 -0
  255. package/src/modules/seo-optimization/types/index.ts +41 -0
  256. package/src/modules/theme/application/css-theme-adapter.ts +50 -0
  257. package/src/modules/theme/domain/operations/theme-operations.ts +68 -0
  258. package/src/modules/theme/index.ts +8 -0
  259. package/src/modules/theme/ports/theme-port.ts +8 -0
  260. package/src/modules/theme/types/theme.ts +12 -0
  261. package/src/modules/toc/application/markdown-toc-adapter.ts +106 -0
  262. package/src/modules/toc/domain/operations/toc-operations.ts +92 -0
  263. package/src/modules/toc/index.ts +8 -0
  264. package/src/modules/toc/ports/toc-port.ts +21 -0
  265. package/src/modules/toc/types/toc.ts +17 -0
  266. package/src/modules/toc-generator/application/usecases/index.ts +30 -0
  267. package/src/modules/toc-generator/domain/index.ts +12 -0
  268. package/src/modules/toc-generator/domain/tocOperations.ts +104 -0
  269. package/src/modules/toc-generator/index.ts +9 -0
  270. package/src/modules/toc-generator/ports/index.ts +20 -0
  271. package/src/modules/toc-generator/types/index.ts +50 -0
  272. package/src/modules/version-control/domain/events/index.ts +39 -0
  273. package/src/modules/version-control/domain/models/index.ts +25 -0
  274. package/src/modules/version-control/domain/validators/index.ts +50 -0
  275. package/src/modules/versioning/application/fs-version-loader.ts +44 -0
  276. package/src/modules/versioning/domain/operations/versioning-operations.ts +80 -0
  277. package/src/modules/versioning/index.ts +8 -0
  278. package/src/modules/versioning/ports/version-loader-port.ts +18 -0
  279. package/src/modules/versioning/types/versioning.ts +17 -0
  280. package/src/modules/workflow/domain/events/index.ts +55 -0
  281. package/src/modules/workflow/domain/models/index.ts +40 -0
  282. package/src/modules/workflow/domain/validators/index.ts +50 -0
  283. package/src/modules/yaml-parser/application/js-yaml-adapter.ts +34 -0
  284. package/src/modules/yaml-parser/domain/operations/parse-yaml.ts +58 -0
  285. package/src/modules/yaml-parser/index.ts +7 -0
  286. package/src/modules/yaml-parser/ports/yaml-parser-port.ts +18 -0
  287. package/src/navigation/index.ts +9 -0
  288. package/src/plugin/index.ts +4 -0
  289. package/src/presentation/index.ts +1 -0
  290. package/src/presentation/live-editor/index.ts +22 -0
  291. package/src/presentation/live-editor/live-editor-component.ts +219 -0
  292. package/src/presentation/live-editor/virtual-module.ts +16 -0
  293. package/src/presentation/solid/CodeBlock.tsx +120 -0
  294. package/src/presentation/solid/Toc.tsx +58 -0
  295. package/src/presentation/solid/index.ts +11 -0
  296. package/src/presentation/vite-plugin/docs-plugin.ts +212 -0
  297. package/src/presentation/vite-plugin/index.ts +9 -0
  298. package/src/presentation/vite-plugin/transform-markdown.ts +26 -0
  299. package/src/runtime/analytics.ts +59 -0
  300. package/src/runtime/api-diff.ts +115 -0
  301. package/src/runtime/app.tsx +32 -0
  302. package/src/runtime/components/AccentPicker.tsx +114 -0
  303. package/src/runtime/components/ApiPlayground.tsx +332 -0
  304. package/src/runtime/components/AskAiDialog.tsx +127 -0
  305. package/src/runtime/components/BackToTop.tsx +38 -0
  306. package/src/runtime/components/Banner.tsx +75 -0
  307. package/src/runtime/components/Breadcrumbs.tsx +42 -0
  308. package/src/runtime/components/CollectionDropdown.tsx +85 -0
  309. package/src/runtime/components/CustomizeDrawer.tsx +195 -0
  310. package/src/runtime/components/DocMarkdown.tsx +579 -0
  311. package/src/runtime/components/DocPrevNext.tsx +54 -0
  312. package/src/runtime/components/DocToc.tsx +147 -0
  313. package/src/runtime/components/DocsDropdown.tsx +184 -0
  314. package/src/runtime/components/Footer.tsx +52 -0
  315. package/src/runtime/components/GitHubAuth.tsx +82 -0
  316. package/src/runtime/components/GitHubStats.tsx +73 -0
  317. package/src/runtime/components/Head.tsx +225 -0
  318. package/src/runtime/components/LocaleDropdown.tsx +75 -0
  319. package/src/runtime/components/MobileBottomNav.tsx +111 -0
  320. package/src/runtime/components/NotFound.tsx +139 -0
  321. package/src/runtime/components/PageActions.tsx +144 -0
  322. package/src/runtime/components/RelatedDocs.tsx +50 -0
  323. package/src/runtime/components/ScrollProgress.tsx +32 -0
  324. package/src/runtime/components/SearchPalette.tsx +333 -0
  325. package/src/runtime/components/ShowcaseCard.tsx +87 -0
  326. package/src/runtime/components/SidebarNav.tsx +237 -0
  327. package/src/runtime/components/Skeleton.tsx +39 -0
  328. package/src/runtime/components/ThemeToggle.tsx +26 -0
  329. package/src/runtime/components/TopNav.tsx +270 -0
  330. package/src/runtime/components/VersionDropdown.tsx +189 -0
  331. package/src/runtime/components/markdown/components.ts +280 -0
  332. package/src/runtime/config.ts +225 -0
  333. package/src/runtime/content.ts +451 -0
  334. package/src/runtime/context.tsx +30 -0
  335. package/src/runtime/data.ts +93 -0
  336. package/src/runtime/github.ts +226 -0
  337. package/src/runtime/icons.ts +32 -0
  338. package/src/runtime/index.ts +153 -0
  339. package/src/runtime/layouts/DocsLayout.tsx +144 -0
  340. package/src/runtime/markdown-content.css +996 -0
  341. package/src/runtime/pages/AbTestPage.tsx +88 -0
  342. package/src/runtime/pages/AnalyticsPage.tsx +90 -0
  343. package/src/runtime/pages/ApiDiffPage.tsx +86 -0
  344. package/src/runtime/pages/ApiEndpointPage.tsx +248 -0
  345. package/src/runtime/pages/BuilderPage.tsx +150 -0
  346. package/src/runtime/pages/ChangelogPage.tsx +210 -0
  347. package/src/runtime/pages/CollectionPage.tsx +140 -0
  348. package/src/runtime/pages/CommunityPage.tsx +384 -0
  349. package/src/runtime/pages/CreatePage.tsx +448 -0
  350. package/src/runtime/pages/DocPage.tsx +193 -0
  351. package/src/runtime/pages/EditPage.tsx +201 -0
  352. package/src/runtime/pages/HomePage.tsx +187 -0
  353. package/src/runtime/pages/IssuesPage.tsx +140 -0
  354. package/src/runtime/pages/OAuthCallbackPage.tsx +80 -0
  355. package/src/runtime/pages/PluginsPage.tsx +249 -0
  356. package/src/runtime/pages/ShowcasePage.tsx +202 -0
  357. package/src/runtime/pwa.ts +39 -0
  358. package/src/runtime/router.tsx +192 -0
  359. package/src/runtime/seo.ts +192 -0
  360. package/src/runtime/theme.css +175 -0
  361. package/src/runtime/theme.ts +224 -0
  362. package/src/runtime/types.ts +217 -0
  363. package/src/search/index.ts +6 -0
  364. package/src/seo-optimization/index.ts +4 -0
  365. package/src/shared/constants/index.ts +26 -0
  366. package/src/shared/errors/index.ts +195 -0
  367. package/src/shared/index.ts +27 -0
  368. package/src/shared/types/brand.ts +14 -0
  369. package/src/shared/types/client.d.ts +45 -0
  370. package/src/shared/types/either.ts +38 -0
  371. package/src/shared/types/index.ts +42 -0
  372. package/src/shared/types/option.ts +52 -0
  373. package/src/shared/types/result.ts +81 -0
  374. package/src/shared/utils/array.ts +97 -0
  375. package/src/shared/utils/index.ts +46 -0
  376. package/src/shared/utils/object.ts +47 -0
  377. package/src/shared/utils/string.ts +74 -0
  378. package/src/toc-generator/index.ts +1 -0
  379. package/src/types/js-yaml.d.ts +42 -0
  380. package/src/worker.ts +462 -0
@@ -0,0 +1,189 @@
1
+ import {
2
+ createMemo,
3
+ createSignal,
4
+ For,
5
+ onCleanup,
6
+ onMount,
7
+ Show,
8
+ } from "solid-js";
9
+ import { useDocs } from "../context";
10
+ import {
11
+ type BranchInfo,
12
+ type CommitInfo,
13
+ fetchBranches,
14
+ fetchLatestCommit,
15
+ fetchTags,
16
+ type TagInfo,
17
+ } from "../github";
18
+
19
+ interface VersionItem {
20
+ id: string;
21
+ label: string;
22
+ url?: string;
23
+ html_url?: string;
24
+ type: "tag" | "branch" | "commit" | "version";
25
+ }
26
+
27
+ export function VersionDropdown() {
28
+ const [open, setOpen] = createSignal(false);
29
+ const config = useDocs();
30
+ let rootEl: HTMLDivElement | undefined;
31
+
32
+ const [tags, setTags] = createSignal<TagInfo[]>([]);
33
+ const [branches, setBranches] = createSignal<BranchInfo[]>([]);
34
+ const [latest, setLatest] = createSignal<CommitInfo | null>(null);
35
+ const [loading, setLoading] = createSignal(false);
36
+ const [errored, setErrored] = createSignal(false);
37
+
38
+ onMount(async () => {
39
+ if (!config.github || config.versions) return;
40
+ setLoading(true);
41
+ try {
42
+ const [t, b, c] = await Promise.all([
43
+ fetchTags(config.github),
44
+ fetchBranches(config.github),
45
+ fetchLatestCommit(config.github, config.github.branch),
46
+ ]);
47
+ setTags(t);
48
+ setBranches(b);
49
+ setLatest(c);
50
+ } catch {
51
+ setErrored(true);
52
+ } finally {
53
+ setLoading(false);
54
+ }
55
+ });
56
+
57
+ const currentLabel = () =>
58
+ config.versions?.current ??
59
+ config.github?.branch ??
60
+ latest()?.sha ??
61
+ "main";
62
+
63
+ const items = createMemo<VersionItem[]>(() => {
64
+ if (config.versions?.list.length) {
65
+ return config.versions.list.map((v) => ({
66
+ ...v,
67
+ type: "version" as const,
68
+ }));
69
+ }
70
+ const github = config.github;
71
+ if (!github) return [];
72
+
73
+ const list: VersionItem[] = [];
74
+ if (latest()) {
75
+ list.push({
76
+ id: latest()!.sha,
77
+ label: `${latest()!.sha} — ${latest()!.message}`,
78
+ html_url: latest()!.html_url,
79
+ type: "commit",
80
+ });
81
+ }
82
+ for (const b of branches()) {
83
+ list.push({
84
+ id: b.name,
85
+ label: b.name,
86
+ html_url: `https://github.com/${github.owner}/${github.repo}/tree/${b.name}`,
87
+ type: "branch",
88
+ });
89
+ }
90
+ for (const t of tags()) {
91
+ list.push({
92
+ id: t.name,
93
+ label: t.name,
94
+ html_url: `https://github.com/${github.owner}/${github.repo}/releases/tag/${t.name}`,
95
+ type: "tag",
96
+ });
97
+ }
98
+ return list;
99
+ });
100
+
101
+ const hasData = () =>
102
+ (config.versions?.list.length ?? 0) > 1 || items().length > 0 || loading();
103
+
104
+ const onDocClick = (e: MouseEvent) => {
105
+ if (rootEl && !rootEl.contains(e.target as Node)) setOpen(false);
106
+ };
107
+ const onKey = (e: KeyboardEvent) => {
108
+ if (e.key === "Escape") setOpen(false);
109
+ };
110
+
111
+ onMount(() => {
112
+ document.addEventListener("click", onDocClick);
113
+ document.addEventListener("keydown", onKey);
114
+ });
115
+ onCleanup(() => {
116
+ document.removeEventListener("click", onDocClick);
117
+ document.removeEventListener("keydown", onKey);
118
+ });
119
+
120
+ return (
121
+ <Show when={hasData()}>
122
+ <div ref={rootEl} class="relative">
123
+ <button
124
+ type="button"
125
+ onClick={() => setOpen(!open())}
126
+ aria-expanded={open()}
127
+ aria-haspopup="listbox"
128
+ class="inline-flex items-center gap-1.5 px-2.5 h-9 rounded-md border border-border bg-surface text-xs font-medium text-foreground hover:border-focus transition-colors cursor-pointer"
129
+ >
130
+ <span class="i-mdi:tag-outline text-muted" aria-hidden="true" />
131
+ <span class="max-w-32 truncate">{currentLabel()}</span>
132
+ <span
133
+ class={`i-mdi:chevron-down text-muted transition-transform ${open() ? "rotate-180" : ""}`}
134
+ aria-hidden="true"
135
+ />
136
+ </button>
137
+ <Show when={open()}>
138
+ <ul
139
+ role="listbox"
140
+ aria-label="Versions"
141
+ class="absolute right-0 top-full mt-2 min-w-52 max-h-72 overflow-auto rounded-lg border border-border bg-surface shadow-lg py-1 z-50 list-none m-0"
142
+ >
143
+ <Show when={loading()}>
144
+ <li class="px-3 py-2 text-xs text-muted">Loading…</li>
145
+ </Show>
146
+ <Show when={errored() && !loading()}>
147
+ <li class="px-3 py-2 text-xs text-destructive">
148
+ Could not load versions.
149
+ </li>
150
+ </Show>
151
+ <For each={items()}>
152
+ {(v) => (
153
+ <li role="option" aria-selected={v.id === currentLabel()}>
154
+ <a
155
+ href={v.url ?? v.html_url ?? "/"}
156
+ target={v.html_url ? "_blank" : undefined}
157
+ rel={v.html_url ? "noreferrer" : undefined}
158
+ onClick={() => setOpen(false)}
159
+ class={`block px-3 py-2 text-sm no-underline transition-colors hover:bg-background ${
160
+ v.id === currentLabel()
161
+ ? "text-primary font-medium"
162
+ : "text-foreground"
163
+ }`}
164
+ >
165
+ <div class="flex items-center gap-2">
166
+ <span
167
+ class={`${
168
+ v.type === "commit"
169
+ ? "i-mdi:source-commit"
170
+ : v.type === "tag"
171
+ ? "i-mdi:tag"
172
+ : v.type === "branch"
173
+ ? "i-mdi:source-branch"
174
+ : "i-mdi:source-branch"
175
+ } text-muted`}
176
+ aria-hidden="true"
177
+ />
178
+ <span class="truncate">{v.label}</span>
179
+ </div>
180
+ </a>
181
+ </li>
182
+ )}
183
+ </For>
184
+ </ul>
185
+ </Show>
186
+ </div>
187
+ </Show>
188
+ );
189
+ }
@@ -0,0 +1,280 @@
1
+ import type { ElementNode, NodeHandler } from "comark";
2
+
3
+ const rand = () => Math.random().toString(36).slice(2, 8);
4
+
5
+ function getAttr(
6
+ attrs: Record<string, unknown>,
7
+ key: string,
8
+ ): string | undefined {
9
+ return (attrs[key] as string) ?? undefined;
10
+ }
11
+
12
+ export const cardComponent: NodeHandler = async (node, state) => {
13
+ const [, attrs, ...children] = node;
14
+ const title = getAttr(attrs, "title");
15
+ const icon = getAttr(attrs, "icon");
16
+ const to = getAttr(attrs, "to");
17
+ const id = `card-${rand()}`;
18
+ const body = await state.render(children);
19
+
20
+ const inner = `
21
+ <div class="rt-card__header">
22
+ ${icon ? `<span class="${icon} rt-card__icon" aria-hidden="true"></span>` : ""}
23
+ ${title ? `<div class="rt-card__title">${title}</div>` : ""}
24
+ </div>
25
+ <div class="rt-card__body">${body}</div>
26
+ `;
27
+
28
+ if (to) {
29
+ return `<a href="${to}" class="rt-card rt-card--link" id="${id}">${inner}</a>`;
30
+ }
31
+ return `<div class="rt-card" id="${id}">${inner}</div>`;
32
+ };
33
+
34
+ export const cardGridComponent: NodeHandler = async (node, state) => {
35
+ const [, , ...children] = node;
36
+ const rendered = await state.render(children);
37
+ return `<div class="rt-card-grid">${rendered}</div>`;
38
+ };
39
+
40
+ export const tabsComponent: NodeHandler = async (node, state) => {
41
+ const [, , ...children] = node;
42
+ const tabs: { id: string; label: string; body: string }[] = [];
43
+
44
+ for (const child of children) {
45
+ const el = child as ElementNode;
46
+ if (el[0] !== "tab") continue;
47
+ const [, cAttrs, ...cChildren] = el;
48
+ const label = getAttr(cAttrs, "label") ?? "Tab";
49
+ const id = `tab-${rand()}`;
50
+ const body = await state.render(cChildren);
51
+ tabs.push({ id, label, body });
52
+ }
53
+
54
+ if (!tabs.length) return "";
55
+
56
+ const tabList = tabs
57
+ .map(
58
+ (t, i) =>
59
+ `<button type="button" class="rt-tabs__tab${i === 0 ? " rt-tabs__tab--active" : ""}" data-tab="${t.id}" role="tab" aria-selected="${i === 0 ? "true" : "false"}">${t.label}</button>`,
60
+ )
61
+ .join("");
62
+
63
+ const panels = tabs
64
+ .map(
65
+ (t, i) =>
66
+ `<div class="rt-tabs__panel${i === 0 ? " rt-tabs__panel--active" : ""}" id="${t.id}" role="tabpanel">${t.body}</div>`,
67
+ )
68
+ .join("");
69
+
70
+ return `<div class="rt-tabs">
71
+ <div class="rt-tabs__list" role="tablist">${tabList}</div>
72
+ ${panels}
73
+ </div>`;
74
+ };
75
+
76
+ export const fileTreeComponent: NodeHandler = async (node) => {
77
+ const [, , ...children] = node;
78
+
79
+ async function renderTree(items: ElementNode[], depth = 0): Promise<string> {
80
+ const out: string[] = [];
81
+ for (const item of items) {
82
+ const tag = item[0] as string;
83
+ const attrs = item[1] as Record<string, unknown>;
84
+ const cChildren = item.slice(2) as ElementNode[];
85
+ const name = getAttr(attrs, "name") ?? "unknown";
86
+
87
+ if (tag === "folder") {
88
+ const nested = cChildren.length
89
+ ? `<ul class="rt-file-tree__nested">${await renderTree(cChildren, depth + 1)}</ul>`
90
+ : "";
91
+ out.push(`
92
+ <li class="rt-file-tree__item rt-file-tree__item--folder" style="--rt-ft-depth: ${depth}">
93
+ <span class="rt-file-tree__label">
94
+ <span class="i-mdi:folder-outline rt-file-tree__icon" aria-hidden="true"></span>
95
+ ${name}
96
+ </span>
97
+ ${nested}
98
+ </li>
99
+ `);
100
+ } else if (tag === "file") {
101
+ out.push(`
102
+ <li class="rt-file-tree__item rt-file-tree__item--file" style="--rt-ft-depth: ${depth}">
103
+ <span class="rt-file-tree__label">
104
+ <span class="i-mdi:file-document-outline rt-file-tree__icon" aria-hidden="true"></span>
105
+ ${name}
106
+ </span>
107
+ </li>
108
+ `);
109
+ }
110
+ }
111
+ return out.join("");
112
+ }
113
+
114
+ const valid = children.filter(
115
+ (c) =>
116
+ (c as ElementNode)[0] === "folder" || (c as ElementNode)[0] === "file",
117
+ ) as ElementNode[];
118
+ if (!valid.length) return "";
119
+
120
+ return `<ul class="rt-file-tree">${await renderTree(valid)}</ul>`;
121
+ };
122
+
123
+ export const kbdComponent: NodeHandler = async (node, state) => {
124
+ const [, , ...children] = node;
125
+ const text = (await state.render(children)).replace(/<[^>]+>/g, "");
126
+ return `<kbd class="rt-kbd">${text}</kbd>`;
127
+ };
128
+
129
+ export const badgeComponent: NodeHandler = async (node, state) => {
130
+ const [, attrs, ...children] = node;
131
+ const text = getAttr(attrs, "text") ?? (await state.render(children));
132
+ const type = getAttr(attrs, "type") ?? "default";
133
+ return `<span class="rt-badge rt-badge--${type}">${text}</span>`;
134
+ };
135
+
136
+ export const accordionComponent: NodeHandler = async (node, state) => {
137
+ const [, attrs, ...children] = node;
138
+ const title = getAttr(attrs, "title");
139
+ const id = `acc-${rand()}`;
140
+
141
+ // <accordion title="..."> ... content ... </accordion>
142
+ if (title) {
143
+ const body = await state.render(children);
144
+ return `<details class="rt-accordion" id="${id}">
145
+ <summary class="rt-accordion__summary">${title}</summary>
146
+ <div class="rt-accordion__body">${body}</div>
147
+ </details>`;
148
+ }
149
+
150
+ // <accordion> <item title="...">...</item> ... </accordion>
151
+ const items: { title: string; body: string }[] = [];
152
+ for (const child of children) {
153
+ const el = child as ElementNode;
154
+ if (el[0] !== "item") continue;
155
+ const [, cAttrs, ...cChildren] = el;
156
+ const itemTitle = getAttr(cAttrs, "title") ?? "Item";
157
+ const body = await state.render(cChildren);
158
+ items.push({ title: itemTitle, body });
159
+ }
160
+
161
+ if (!items.length) return await state.render(children);
162
+
163
+ return `<div class="rt-accordion-group">
164
+ ${items
165
+ .map(
166
+ (item, i) => `
167
+ <details class="rt-accordion" id="${id}-${i}">
168
+ <summary class="rt-accordion__summary">${item.title}</summary>
169
+ <div class="rt-accordion__body">${item.body}</div>
170
+ </details>
171
+ `,
172
+ )
173
+ .join("")}
174
+ </div>`;
175
+ };
176
+
177
+ const videoHosts = new Set([
178
+ "youtube.com",
179
+ "www.youtube.com",
180
+ "youtu.be",
181
+ "vimeo.com",
182
+ ]);
183
+
184
+ export const youtubeComponent: NodeHandler = async (node) => {
185
+ const [, attrs] = node;
186
+ const id = getAttr(attrs, "id");
187
+ if (!id) return "";
188
+ return `<div class="rt-youtube" data-id="${id}" role="img" aria-label="YouTube video">
189
+ <button type="button" class="rt-youtube__play" aria-label="Play video">
190
+ <span class="i-mdi:play-circle text-5xl" aria-hidden="true"></span>
191
+ </button>
192
+ </div>`;
193
+ };
194
+
195
+ export const videoComponent: NodeHandler = async (node) => {
196
+ const [, attrs] = node;
197
+ const src = getAttr(attrs, "src");
198
+ if (!src) return "";
199
+
200
+ try {
201
+ const url = new URL(src);
202
+ if (!videoHosts.has(url.hostname)) {
203
+ return `<p class="rt-markdown__error">Unsupported video host: ${url.hostname}</p>`;
204
+ }
205
+ } catch {
206
+ return `<p class="rt-markdown__error">Invalid video URL</p>`;
207
+ }
208
+
209
+ return `<div class="rt-video" data-src="${src}">
210
+ <a href="${src}" target="_blank" rel="noreferrer" class="rt-video__link">Watch video</a>
211
+ </div>`;
212
+ };
213
+
214
+ export const timelineComponent: NodeHandler = async (node, state) => {
215
+ const [, , ...children] = node;
216
+ const events: { date?: string; title?: string; body: string }[] = [];
217
+
218
+ for (const child of children) {
219
+ const el = child as ElementNode;
220
+ if (el[0] !== "event") continue;
221
+ const [, cAttrs, ...cChildren] = el;
222
+ const body = await state.render(cChildren);
223
+ events.push({
224
+ date: getAttr(cAttrs, "date"),
225
+ title: getAttr(cAttrs, "title"),
226
+ body,
227
+ });
228
+ }
229
+
230
+ if (!events.length) return await state.render(children);
231
+
232
+ return `<ol class="rt-timeline">
233
+ ${events
234
+ .map(
235
+ (e) => `
236
+ <li class="rt-timeline__item">
237
+ <div class="rt-timeline__dot" aria-hidden="true"></div>
238
+ <div class="rt-timeline__content">
239
+ ${e.date ? `<time class="rt-timeline__date">${e.date}</time>` : ""}
240
+ ${e.title ? `<div class="rt-timeline__title">${e.title}</div>` : ""}
241
+ <div class="rt-timeline__body">${e.body}</div>
242
+ </div>
243
+ </li>
244
+ `,
245
+ )
246
+ .join("")}
247
+ </ol>`;
248
+ };
249
+
250
+ export const tooltipComponent: NodeHandler = async (node, state) => {
251
+ const [, attrs, ...children] = node;
252
+ const text = getAttr(attrs, "text") ?? (await state.render(children));
253
+ const tip = getAttr(attrs, "tip") ?? "";
254
+ const id = `tt-${rand()}`;
255
+ return `<span class="rt-tooltip" id="${id}" data-tip="${tip}" tabindex="0">${text}</span>`;
256
+ };
257
+
258
+ export const copyComponent: NodeHandler = async (node, state) => {
259
+ const [, attrs, ...children] = node;
260
+ const value = getAttr(attrs, "value");
261
+ if (!value) return await state.render(children);
262
+ const id = `cp-${rand()}`;
263
+ return `<button type="button" class="rt-copy" id="${id}" data-copy="${value}" aria-label="Copy to clipboard">${getAttr(attrs, "label") ?? value}</button>`;
264
+ };
265
+
266
+ export const codePreviewComponent: NodeHandler = async (node, state) => {
267
+ const [, , ...children] = node;
268
+ const rendered = await state.render(children);
269
+ const code = rendered
270
+ .replace(/<[^>]+>/g, "")
271
+ .replace(/&lt;/g, "<")
272
+ .replace(/&gt;/g, ">")
273
+ .replace(/&amp;/g, "&")
274
+ .trim();
275
+ const id = `preview-${rand()}`;
276
+ return `<div class="rt-code-preview" id="${id}" data-code="${code.replace(/"/g, "&quot;")}">
277
+ <div class="rt-code-preview__result" aria-live="polite"></div>
278
+ <pre class="rt-code-preview__code"><code>${rendered}</code></pre>
279
+ </div>`;
280
+ };
@@ -0,0 +1,225 @@
1
+ import type { ApiEndpoint, CollectionMeta } from "./types";
2
+
3
+ export interface HomeFeature {
4
+ icon?: string;
5
+ title: string;
6
+ details?: string;
7
+ link?: string;
8
+ }
9
+
10
+ export interface HomeConfig {
11
+ hero?: {
12
+ name?: string;
13
+ text?: string;
14
+ tagline?: string;
15
+ /** Small pill badge above the headline. */
16
+ badge?: string;
17
+ actions?: { text: string; link: string; theme?: "brand" | "alt" }[];
18
+ };
19
+ features?: HomeFeature[];
20
+ /** Items for the horizontal feature slider. Defaults to `features`. */
21
+ slides?: HomeFeature[];
22
+ }
23
+
24
+ /** A static API collection — endpoints parsed up front (OpenAPI/oRPC adapters). */
25
+ export interface ApiCollection extends CollectionMeta {
26
+ type: "api";
27
+ /** API style — shown as a badge on the reference pages. */
28
+ style?: "rest" | "graphql" | "cli" | "rpc";
29
+ endpoints: ApiEndpoint[];
30
+ }
31
+
32
+ export interface DocsAppFeatures {
33
+ search?: boolean;
34
+ askAi?: boolean;
35
+ editLink?: boolean;
36
+ lastUpdated?: boolean;
37
+ toc?: boolean;
38
+ aside?: boolean;
39
+ themeToggle?: boolean;
40
+ breadcrumbs?: boolean;
41
+ reportIssue?: boolean;
42
+ openPR?: boolean;
43
+ rss?: boolean;
44
+ sitemap?: boolean;
45
+ pwa?: boolean;
46
+ /** Local page-view analytics + /analytics dashboard. */
47
+ analytics?: boolean;
48
+ /** Show a toggle to reveal/hide the document frontmatter on doc pages. */
49
+ frontmatterToggle?: boolean;
50
+ /** Show an "MCP available" badge linking to the JSON-RPC endpoint. */
51
+ mcp?: boolean;
52
+ }
53
+
54
+ export interface MarkdownConfig {
55
+ engine?: "comark" | "marked";
56
+ }
57
+
58
+ /** A documentation version entry for the version switcher. */
59
+ export interface DocsVersion {
60
+ /** Unique version id, e.g. "v2". */
61
+ id: string;
62
+ /** Display label, e.g. "v2 (latest)". */
63
+ label: string;
64
+ /** URL where this version is hosted — absolute URL or site path. Omit for the current site. */
65
+ url?: string;
66
+ }
67
+
68
+ export interface VersionsConfig {
69
+ /** Id of the version currently rendered. */
70
+ current: string;
71
+ list: DocsVersion[];
72
+ }
73
+
74
+ /** A locale entry for the language switcher. */
75
+ export interface LocaleInfo {
76
+ /** BCP 47 language tag, e.g. "en", "th". */
77
+ id: string;
78
+ /** Display label, e.g. "English", "ไทย". */
79
+ label: string;
80
+ /** URL of the localized site (absolute or path). Omit for the current site. */
81
+ url?: string;
82
+ }
83
+
84
+ export interface I18nConfig {
85
+ /** BCP 47 tag of the current locale — also applied to `<html lang>`. */
86
+ current: string;
87
+ list: LocaleInfo[];
88
+ }
89
+
90
+ /** A plugin/integration entry shown on the `/plugins` marketplace page. */
91
+ export interface PluginInfo {
92
+ /** Package name, e.g. "@wrikka/create-docs-openapi". */
93
+ name: string;
94
+ /** Short description of what the plugin provides. */
95
+ description: string;
96
+ /** Optional Iconify icon class, e.g. "i-mdi:api". */
97
+ icon?: string;
98
+ /** Optional link to docs or repository. */
99
+ url?: string;
100
+ /** Optional version/tag badge. */
101
+ version?: string;
102
+ /** Install command shown on the card, e.g. "bun add @wrikka/x". Omit for built-in integrations. */
103
+ install?: string;
104
+ }
105
+
106
+ export interface ShowcaseInfo {
107
+ /** Unique id for the showcase item. */
108
+ id: string;
109
+ /** Display label. */
110
+ label: string;
111
+ /** Short description. */
112
+ description: string;
113
+ /** Optional cover image URL. */
114
+ image?: string;
115
+ /** Optional Iconify icon class used as fallback. */
116
+ icon?: string;
117
+ /** Optional link to the project/case. */
118
+ link?: string;
119
+ /** Optional tags. */
120
+ tags?: string[];
121
+ /** Optional badge. */
122
+ badge?: string;
123
+ /** Optional gradient cover color (hex) when no image is provided. */
124
+ coverColor?: string;
125
+ }
126
+
127
+ export interface GitHubOAuthConfig {
128
+ /** Set to false to hide the "Authorize with GitHub" flow. Defaults to true. */
129
+ enabled?: boolean;
130
+ /**
131
+ * Optional public OAuth client id. The real client id/secret are resolved
132
+ * server-side via `GITHUB_CLIENT_ID` / `GITHUB_CLIENT_SECRET` secrets, so
133
+ * this is not required by the client.
134
+ */
135
+ clientId?: string;
136
+ /** OAuth callback URL. Defaults to `${location.origin}/auth/github/callback`. */
137
+ redirectUri?: string;
138
+ /** Requested OAuth scopes. Defaults to "repo". */
139
+ scope?: string;
140
+ }
141
+
142
+ export interface GitHubConfig {
143
+ owner: string;
144
+ repo: string;
145
+ branch?: string;
146
+ stats?: boolean;
147
+ releases?: boolean;
148
+ contributors?: boolean;
149
+ issues?: boolean;
150
+ oauth?: GitHubOAuthConfig;
151
+ }
152
+
153
+ export interface SiteLink {
154
+ label: string;
155
+ to: string;
156
+ icon?: string;
157
+ }
158
+
159
+ export interface FooterConfig {
160
+ copyright?: string;
161
+ links?: SiteLink[];
162
+ }
163
+
164
+ export interface AnnouncementConfig {
165
+ text: string;
166
+ to?: string;
167
+ closable?: boolean;
168
+ }
169
+
170
+ export interface SiteConfig {
171
+ title: string;
172
+ description?: string;
173
+ repoUrl?: string;
174
+ url?: string;
175
+ ogImage?: string;
176
+ /** Optional logo icon class. */
177
+ logo?: string;
178
+ /** Optional social / external links. */
179
+ social?: {
180
+ npm?: string;
181
+ twitter?: string;
182
+ discord?: string;
183
+ youtube?: string;
184
+ mastodon?: string;
185
+ };
186
+ }
187
+
188
+ export interface DocsAppConfig {
189
+ site: SiteConfig;
190
+ /** GitHub integration options. */
191
+ github?: GitHubConfig;
192
+ /** Injected data source for markdown doc collections. */
193
+ dataSource: import("./types").DocsDataSource;
194
+ /** Default collection used for "/" redirect when no home config. */
195
+ defaultCollection?: string;
196
+ /** VitePress-style home page. When set, "/" renders the home layout. */
197
+ home?: HomeConfig;
198
+ /** API reference collections (Scalar-style). */
199
+ apiCollections?: ApiCollection[];
200
+ /**
201
+ * API diff/changelog: a snapshot of previous API collections to compare
202
+ * against `apiCollections`. Enables the `/api-diff` page.
203
+ */
204
+ apiDiff?: { previous: ApiCollection[] };
205
+ features?: DocsAppFeatures;
206
+ /** Markdown rendering engine configuration. */
207
+ markdown?: MarkdownConfig;
208
+ /** Versioned docs: shows a version switcher when more than one entry is listed. */
209
+ versions?: VersionsConfig;
210
+ /** Multi-language docs: shows a language switcher and sets `<html lang>`. */
211
+ i18n?: I18nConfig;
212
+ /** Optional analytics sink: page views are beaconed to this endpoint. */
213
+ analytics?: { endpoint?: string };
214
+ /** Plugin marketplace: entries listed on the `/plugins` page. */
215
+ plugins?: PluginInfo[];
216
+ /** Showcase / featured-work grid used by the `/showcase` page. */
217
+ showcase?: ShowcaseInfo[];
218
+ theme?: { defaultMode?: "dark" | "light" };
219
+ /** Optional fixed announcement banner. */
220
+ announcement?: AnnouncementConfig;
221
+ /** Optional footer configuration. */
222
+ footer?: FooterConfig;
223
+ /** Optional top navigation links. */
224
+ topNav?: SiteLink[];
225
+ }