@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,192 @@
1
+ import type { CollectionMeta, DocEntry } from "./types";
2
+
3
+ export interface SeoInput {
4
+ site: { title: string; description?: string; url?: string };
5
+ collections: CollectionMeta[];
6
+ docs: Map<string, DocEntry[]>;
7
+ }
8
+
9
+ function escapeXml(text?: string | null) {
10
+ if (text == null) return "";
11
+ return text
12
+ .replace(/&/g, "&amp;")
13
+ .replace(/</g, "&lt;")
14
+ .replace(/>/g, "&gt;")
15
+ .replace(/"/g, "&quot;")
16
+ .replace(/'/g, "&apos;");
17
+ }
18
+
19
+ export function generateSitemap(input: SeoInput): string {
20
+ const baseUrl = (input.site.url ?? "").replace(/\/$/, "");
21
+ const urls: string[] = [];
22
+ if (baseUrl) {
23
+ urls.push(`${baseUrl}/`);
24
+ for (const collection of input.collections) {
25
+ urls.push(`${baseUrl}/${collection.id}`);
26
+ const docs = input.docs.get(collection.id) ?? [];
27
+ for (const doc of docs) {
28
+ urls.push(`${baseUrl}/${collection.id}/${doc.id}`);
29
+ }
30
+ }
31
+ }
32
+ const entries = urls
33
+ .map(
34
+ (url) => ` <url>
35
+ <loc>${escapeXml(url)}</loc>
36
+ <changefreq>weekly</changefreq>
37
+ <priority>0.7</priority>
38
+ </url>`,
39
+ )
40
+ .join("\n");
41
+ return `<?xml version="1.0" encoding="UTF-8"?>
42
+ <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
43
+ ${entries}
44
+ </urlset>`;
45
+ }
46
+
47
+ export function generateRobots(siteUrl?: string): string {
48
+ const sitemap = siteUrl
49
+ ? `\nSitemap: ${siteUrl.replace(/\/$/, "")}/sitemap.xml`
50
+ : "";
51
+ return `User-agent: *\nAllow: /${sitemap}`;
52
+ }
53
+
54
+ export function generateRss(input: SeoInput): string {
55
+ const baseUrl = (input.site.url ?? "").replace(/\/$/, "");
56
+ const items: string[] = [];
57
+ for (const collection of input.collections) {
58
+ const docs = input.docs.get(collection.id) ?? [];
59
+ for (const doc of docs) {
60
+ if (!baseUrl) continue;
61
+ const link = `${baseUrl}/${collection.id}/${doc.id}`;
62
+ items.push(` <item>
63
+ <title>${escapeXml(doc.label)}</title>
64
+ <link>${escapeXml(link)}</link>
65
+ <description>${escapeXml(doc.description || doc.label)}</description>
66
+ <guid>${escapeXml(link)}</guid>
67
+ </item>`);
68
+ }
69
+ }
70
+ return `<?xml version="1.0" encoding="UTF-8"?>
71
+ <rss version="2.0">
72
+ <channel>
73
+ <title>${escapeXml(input.site.title)}</title>
74
+ <link>${escapeXml(baseUrl || "/")}</link>
75
+ <description>${escapeXml(input.site.description || input.site.title)}</description>
76
+ <language>en</language>
77
+ ${items.join("\n")}
78
+ </channel>
79
+ </rss>`;
80
+ }
81
+
82
+ export function generateAtom(input: SeoInput): string {
83
+ const baseUrl = (input.site.url ?? "").replace(/\/$/, "");
84
+ const updated = new Date().toISOString();
85
+ const items: string[] = [];
86
+ for (const collection of input.collections) {
87
+ const docs = input.docs.get(collection.id) ?? [];
88
+ for (const doc of docs) {
89
+ if (!baseUrl) continue;
90
+ const link = `${baseUrl}/${collection.id}/${doc.id}`;
91
+ const date = doc.lastUpdated ?? updated;
92
+ items.push(` <entry>
93
+ <title>${escapeXml(doc.label)}</title>
94
+ <link href="${escapeXml(link)}" />
95
+ <id>${escapeXml(link)}</id>
96
+ <updated>${escapeXml(date)}</updated>
97
+ <summary>${escapeXml(doc.description || doc.label)}</summary>
98
+ </entry>`);
99
+ }
100
+ }
101
+ return `<?xml version="1.0" encoding="UTF-8"?>
102
+ <feed xmlns="http://www.w3.org/2005/Atom">
103
+ <title>${escapeXml(input.site.title)}</title>
104
+ <link href="${escapeXml(baseUrl || "/")}" />
105
+ <updated>${escapeXml(updated)}</updated>
106
+ <id>${escapeXml(baseUrl || "/")}</id>
107
+ ${items.join("\n")}
108
+ </feed>`;
109
+ }
110
+
111
+ export function generateJsonFeed(input: SeoInput): string {
112
+ const baseUrl = (input.site.url ?? "").replace(/\/$/, "");
113
+ const items = [];
114
+ for (const collection of input.collections) {
115
+ const docs = input.docs.get(collection.id) ?? [];
116
+ for (const doc of docs) {
117
+ if (!baseUrl) continue;
118
+ const link = `${baseUrl}/${collection.id}/${doc.id}`;
119
+ items.push({
120
+ id: link,
121
+ title: doc.label,
122
+ content_text: doc.description || doc.label,
123
+ url: link,
124
+ date_published: doc.publishedAt ?? doc.lastUpdated,
125
+ });
126
+ }
127
+ }
128
+ return JSON.stringify(
129
+ {
130
+ version: "https://jsonfeed.org/version/1.1",
131
+ title: input.site.title,
132
+ home_page_url: baseUrl || "/",
133
+ feed_url: `${baseUrl}/feed.json`,
134
+ items,
135
+ },
136
+ null,
137
+ 2,
138
+ );
139
+ }
140
+
141
+ export interface PluginInfo {
142
+ name: string;
143
+ description?: string;
144
+ install?: string;
145
+ url?: string;
146
+ }
147
+
148
+ export function generatePluginsLlmsTxt(
149
+ plugins: PluginInfo[],
150
+ siteTitle?: string,
151
+ ): string {
152
+ const lines: string[] = [
153
+ `# ${siteTitle ? `${siteTitle} — ` : ""}Plugins`,
154
+ "",
155
+ "Available plugins and integrations.",
156
+ "",
157
+ "## Plugins",
158
+ ];
159
+ for (const p of plugins) {
160
+ lines.push(`- **${p.name}**`);
161
+ if (p.description) lines.push(` - ${p.description}`);
162
+ if (p.url) lines.push(` - URL: ${p.url}`);
163
+ if (p.install) lines.push(` - Install: \`${p.install}\``);
164
+ }
165
+ if (plugins.length === 0) lines.push("- No plugins configured.");
166
+ return lines.join("\n");
167
+ }
168
+
169
+ export function generateLlmsTxt(input: SeoInput): string {
170
+ const baseUrl = (input.site.url ?? "").replace(/\/$/, "");
171
+ const lines: string[] = [
172
+ `# ${input.site.title}`,
173
+ "",
174
+ input.site.description || "",
175
+ "",
176
+ "## Documentation",
177
+ ];
178
+ for (const collection of input.collections) {
179
+ const label = collection.label || collection.id;
180
+ lines.push(`- ${label}`);
181
+ const docs = input.docs.get(collection.id) ?? [];
182
+ for (const doc of docs) {
183
+ const link = baseUrl
184
+ ? `${baseUrl}/${collection.id}/${doc.id}`
185
+ : `/${collection.id}/${doc.id}`;
186
+ lines.push(
187
+ ` - [${doc.label}](${link}): ${doc.description || doc.label}`,
188
+ );
189
+ }
190
+ }
191
+ return lines.join("\n");
192
+ }
@@ -0,0 +1,175 @@
1
+ :root {
2
+ /* Design tokens — light mode (HSL) */
3
+ --color-primary: 142 60% 45%;
4
+ --color-primary-hover: 142 60% 38%;
5
+ --color-primary-active: 142 60% 32%;
6
+ --color-primary-foreground: 0 0% 100%;
7
+ --color-secondary: 217 91% 60%;
8
+ --color-success: 142 76% 36%;
9
+ --color-warning: 38 92% 45%;
10
+ --color-destructive: 0 84% 55%;
11
+ --color-background: 0 0% 100%;
12
+ --color-foreground: 222 20% 12%;
13
+ --color-surface: 220 14% 96%;
14
+ --color-muted: 220 9% 46%;
15
+ --color-accent: 217 91% 55%;
16
+ --color-border: 220 13% 88%;
17
+ --color-focus: 142 60% 45%;
18
+ --color-overlay: 222 20% 12% / 0.4;
19
+ --color-skeleton: 220 13% 91%;
20
+
21
+ /* Legacy content vars — light */
22
+ --rt-bg: #f6f8fa;
23
+ --rt-bg-alt: #eef1f5;
24
+ --rt-panel: #ffffff;
25
+ --rt-border: #d9dee6;
26
+ --rt-border-focus: #2ea043;
27
+ --rt-fg: #1c2330;
28
+ --rt-fg-dim: #5b6577;
29
+ --rt-accent: #2ea043;
30
+ --rt-accent-2: #1f6feb;
31
+ --rt-warn: #9a6700;
32
+ --rt-danger: #cf222e;
33
+ --rt-shadow: 0 4px 24px rgba(28, 35, 48, 0.12);
34
+ --rt-radius: 8px;
35
+ --rt-font-mono:
36
+ "Cascadia Code", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo,
37
+ Consolas, monospace;
38
+ color-scheme: light;
39
+ }
40
+
41
+ .dark {
42
+ /* Design tokens — dark mode (HSL) */
43
+ --color-primary: 140 60% 66%;
44
+ --color-primary-hover: 140 60% 58%;
45
+ --color-primary-active: 140 60% 50%;
46
+ --color-primary-foreground: 222 47% 6%;
47
+ --color-secondary: 207 100% 67%;
48
+ --color-success: 142 76% 45%;
49
+ --color-warning: 43 90% 59%;
50
+ --color-destructive: 0 100% 71%;
51
+ --color-background: 222 33% 5%;
52
+ --color-foreground: 214 22% 92%;
53
+ --color-surface: 220 26% 10%;
54
+ --color-muted: 220 12% 60%;
55
+ --color-accent: 207 100% 67%;
56
+ --color-border: 220 18% 19%;
57
+ --color-focus: 140 60% 66%;
58
+ --color-overlay: 0 0% 0% / 0.55;
59
+ --color-skeleton: 220 15% 18%;
60
+
61
+ /* Legacy content vars — dark */
62
+ --rt-bg: #080a0f;
63
+ --rt-bg-alt: #0d1016;
64
+ --rt-panel: #0f1319;
65
+ --rt-border: #232a36;
66
+ --rt-border-focus: #7ee787;
67
+ --rt-fg: #e3e8ef;
68
+ --rt-fg-dim: #8b95a7;
69
+ --rt-accent: #7ee787;
70
+ --rt-accent-2: #56b6ff;
71
+ --rt-warn: #f2c14e;
72
+ --rt-danger: #ff6b6b;
73
+ --rt-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
74
+ color-scheme: dark;
75
+ }
76
+
77
+ * {
78
+ box-sizing: border-box;
79
+ }
80
+
81
+ html,
82
+ body {
83
+ margin: 0;
84
+ padding: 0;
85
+ background: hsl(var(--color-background));
86
+ color: hsl(var(--color-foreground));
87
+ font-family:
88
+ -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica,
89
+ Arial, sans-serif;
90
+ line-height: 1.6;
91
+ transition:
92
+ background 0.15s ease,
93
+ color 0.15s ease;
94
+ }
95
+
96
+ #root {
97
+ min-height: 100vh;
98
+ display: flex;
99
+ flex-direction: column;
100
+ }
101
+
102
+ @keyframes docs-page-enter {
103
+ from {
104
+ opacity: 0;
105
+ transform: translateY(6px);
106
+ }
107
+ to {
108
+ opacity: 1;
109
+ transform: translateY(0);
110
+ }
111
+ }
112
+
113
+ .docs-page-enter {
114
+ animation: docs-page-enter 0.18s ease-out;
115
+ }
116
+
117
+ a {
118
+ color: hsl(var(--color-accent));
119
+ }
120
+
121
+ button {
122
+ font-family: inherit;
123
+ }
124
+
125
+ :focus-visible {
126
+ outline: 2px solid hsl(var(--color-focus));
127
+ outline-offset: 2px;
128
+ }
129
+
130
+ @media (prefers-reduced-motion: reduce) {
131
+ html {
132
+ scroll-behavior: auto;
133
+ }
134
+
135
+ *,
136
+ *::before,
137
+ *::after {
138
+ animation-duration: 0.01ms !important;
139
+ animation-iteration-count: 1 !important;
140
+ transition-duration: 0.01ms !important;
141
+ scroll-behavior: auto !important;
142
+ }
143
+ }
144
+
145
+ @media print {
146
+ aside,
147
+ footer,
148
+ header,
149
+ nav,
150
+ .rt-toc,
151
+ .rt-code-copy,
152
+ .scroll-progress,
153
+ .back-to-top {
154
+ display: none !important;
155
+ }
156
+
157
+ body {
158
+ background: #fff;
159
+ color: #000;
160
+ }
161
+
162
+ a {
163
+ color: #000;
164
+ text-decoration: underline;
165
+ }
166
+
167
+ pre,
168
+ code,
169
+ blockquote,
170
+ img,
171
+ table,
172
+ figure {
173
+ page-break-inside: avoid;
174
+ }
175
+ }
@@ -0,0 +1,224 @@
1
+ import { createEffect, createSignal } from "solid-js";
2
+
3
+ type Theme = "dark" | "light";
4
+
5
+ const stored = globalThis.localStorage?.getItem("theme");
6
+ const initial: Theme = stored === "light" ? "light" : "dark";
7
+
8
+ const [theme, setThemeSignal] = createSignal<Theme>(initial);
9
+
10
+ /** A daily accent — one per weekday (index 0 = Sunday). */
11
+ export interface DailyAccent {
12
+ name: string;
13
+ day: string;
14
+ /** Primary HSL triples */
15
+ light: string;
16
+ lightHover: string;
17
+ lightActive: string;
18
+ dark: string;
19
+ darkHover: string;
20
+ darkActive: string;
21
+ /** Foreground on the accent */
22
+ lightFg: string;
23
+ darkFg: string;
24
+ /** Legacy content-accent hex values used by markdown content. */
25
+ rtLight: string;
26
+ rtDark: string;
27
+ /** Swatch hex shown in the accent picker. */
28
+ swatch: string;
29
+ }
30
+
31
+ export const DAILY_ACCENTS: DailyAccent[] = [
32
+ {
33
+ name: "Sunday Red",
34
+ day: "Sun",
35
+ light: "0 72% 45%",
36
+ lightHover: "0 72% 38%",
37
+ lightActive: "0 72% 32%",
38
+ dark: "0 90% 68%",
39
+ darkHover: "0 90% 60%",
40
+ darkActive: "0 90% 54%",
41
+ lightFg: "0 0% 100%",
42
+ darkFg: "0 60% 10%",
43
+ rtLight: "#c81e1e",
44
+ rtDark: "#ff7b72",
45
+ swatch: "#e5484d",
46
+ },
47
+ {
48
+ name: "Monday Amber",
49
+ day: "Mon",
50
+ light: "28 95% 42%",
51
+ lightHover: "28 95% 36%",
52
+ lightActive: "28 95% 30%",
53
+ dark: "38 95% 60%",
54
+ darkHover: "38 95% 54%",
55
+ darkActive: "38 95% 48%",
56
+ lightFg: "0 0% 100%",
57
+ darkFg: "30 80% 10%",
58
+ rtLight: "#d97706",
59
+ rtDark: "#fbbf24",
60
+ swatch: "#f59e0b",
61
+ },
62
+ {
63
+ name: "Tuesday Green",
64
+ day: "Tue",
65
+ light: "142 60% 40%",
66
+ lightHover: "142 60% 34%",
67
+ lightActive: "142 60% 28%",
68
+ dark: "140 60% 66%",
69
+ darkHover: "140 60% 58%",
70
+ darkActive: "140 60% 50%",
71
+ lightFg: "0 0% 100%",
72
+ darkFg: "140 60% 10%",
73
+ rtLight: "#2ea043",
74
+ rtDark: "#7ee787",
75
+ swatch: "#3fb950",
76
+ },
77
+ {
78
+ name: "Wednesday Teal",
79
+ day: "Wed",
80
+ light: "188 85% 38%",
81
+ lightHover: "188 85% 32%",
82
+ lightActive: "188 85% 26%",
83
+ dark: "187 80% 62%",
84
+ darkHover: "187 80% 55%",
85
+ darkActive: "187 80% 48%",
86
+ lightFg: "0 0% 100%",
87
+ darkFg: "190 80% 10%",
88
+ rtLight: "#0e8a9c",
89
+ rtDark: "#56d4dd",
90
+ swatch: "#14b8c4",
91
+ },
92
+ {
93
+ name: "Thursday Blue",
94
+ day: "Thu",
95
+ light: "217 91% 52%",
96
+ lightHover: "217 91% 45%",
97
+ lightActive: "217 91% 38%",
98
+ dark: "207 100% 67%",
99
+ darkHover: "207 100% 60%",
100
+ darkActive: "207 100% 53%",
101
+ lightFg: "0 0% 100%",
102
+ darkFg: "217 80% 10%",
103
+ rtLight: "#1f6feb",
104
+ rtDark: "#56b6ff",
105
+ swatch: "#3b82f6",
106
+ },
107
+ {
108
+ name: "Friday Violet",
109
+ day: "Fri",
110
+ light: "262 78% 50%",
111
+ lightHover: "262 78% 43%",
112
+ lightActive: "262 78% 36%",
113
+ dark: "263 85% 72%",
114
+ darkHover: "263 85% 64%",
115
+ darkActive: "263 85% 56%",
116
+ lightFg: "0 0% 100%",
117
+ darkFg: "262 70% 12%",
118
+ rtLight: "#7c3aed",
119
+ rtDark: "#a78bfa",
120
+ swatch: "#8b5cf6",
121
+ },
122
+ {
123
+ name: "Saturday Pink",
124
+ day: "Sat",
125
+ light: "330 78% 46%",
126
+ lightHover: "330 78% 40%",
127
+ lightActive: "330 78% 33%",
128
+ dark: "330 85% 70%",
129
+ darkHover: "330 85% 62%",
130
+ darkActive: "330 85% 55%",
131
+ lightFg: "0 0% 100%",
132
+ darkFg: "330 70% 12%",
133
+ rtLight: "#d61f8c",
134
+ rtDark: "#f471b5",
135
+ swatch: "#ec4899",
136
+ },
137
+ ];
138
+
139
+ export type AccentSetting = "auto" | number;
140
+
141
+ const ACCENT_KEY = "create-docs:accent";
142
+ const storedAccent = globalThis.localStorage?.getItem(ACCENT_KEY);
143
+ const initialAccent: AccentSetting =
144
+ storedAccent == null || storedAccent === "auto"
145
+ ? "auto"
146
+ : Math.min(
147
+ Math.max(Number(storedAccent) || 0, 0),
148
+ DAILY_ACCENTS.length - 1,
149
+ );
150
+
151
+ const [accentSetting, setAccentSignal] =
152
+ createSignal<AccentSetting>(initialAccent);
153
+
154
+ /** Resolved accent index — "auto" maps to today's weekday. */
155
+ export function accentIndex(setting?: AccentSetting): number {
156
+ const s = setting ?? accentSetting();
157
+ if (s === "auto") return new Date().getDay();
158
+ return s;
159
+ }
160
+
161
+ function applyAccent() {
162
+ const root = document.documentElement;
163
+ const isDark = root.classList.contains("dark");
164
+ const a = DAILY_ACCENTS[accentIndex()];
165
+ root.style.setProperty("--color-primary", isDark ? a.dark : a.light);
166
+ root.style.setProperty(
167
+ "--color-primary-hover",
168
+ isDark ? a.darkHover : a.lightHover,
169
+ );
170
+ root.style.setProperty(
171
+ "--color-primary-active",
172
+ isDark ? a.darkActive : a.lightActive,
173
+ );
174
+ root.style.setProperty(
175
+ "--color-primary-foreground",
176
+ isDark ? a.darkFg : a.lightFg,
177
+ );
178
+ root.style.setProperty("--color-focus", isDark ? a.dark : a.light);
179
+ root.style.setProperty("--rt-accent", isDark ? a.rtDark : a.rtLight);
180
+ root.style.setProperty("--rt-border-focus", isDark ? a.rtDark : a.rtLight);
181
+ }
182
+
183
+ export function setAccent(next: AccentSetting) {
184
+ setAccentSignal(next);
185
+ globalThis.localStorage?.setItem(ACCENT_KEY, String(next));
186
+ }
187
+
188
+ /** Apply the stored/default theme + daily accent before render. */
189
+ export function initTheme(defaultMode: Theme = "dark"): void {
190
+ const value = stored === "light" || stored === "dark" ? stored : defaultMode;
191
+ document.documentElement.classList.toggle("dark", value === "dark");
192
+ applyAccent();
193
+ }
194
+
195
+ export function setTheme(next: Theme) {
196
+ setThemeSignal(next);
197
+ }
198
+
199
+ export function useTheme() {
200
+ createEffect(() => {
201
+ const value = theme();
202
+ document.documentElement.classList.toggle("dark", value === "dark");
203
+ globalThis.localStorage?.setItem("theme", value);
204
+ applyAccent();
205
+ });
206
+
207
+ const toggle = () => setThemeSignal((t) => (t === "dark" ? "light" : "dark"));
208
+
209
+ return { theme, toggle };
210
+ }
211
+
212
+ /** Accent picker state — auto follows the weekday, or pin a fixed color. */
213
+ export function useAccent() {
214
+ createEffect(() => {
215
+ accentSetting();
216
+ applyAccent();
217
+ });
218
+ return {
219
+ accent: accentSetting,
220
+ accentIndex: () => accentIndex(),
221
+ accents: DAILY_ACCENTS,
222
+ setAccent,
223
+ };
224
+ }