blodemd 0.0.15 → 0.2.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 (286) hide show
  1. package/README.md +26 -1
  2. package/dist/cli.mjs +217 -217
  3. package/dist/cli.mjs.map +1 -1
  4. package/package.json +3 -36
  5. package/dev-server/app/[[...slug]]/page.tsx +0 -140
  6. package/dev-server/app/blodemd-dev/invalidate/route.ts +0 -12
  7. package/dev-server/app/blodemd-dev/static/[...path]/route.ts +0 -32
  8. package/dev-server/app/blodemd-dev/version/route.ts +0 -14
  9. package/dev-server/app/blodemd-internal/proxy/route.ts +0 -86
  10. package/dev-server/app/error.tsx +0 -24
  11. package/dev-server/app/favicon.ico +0 -0
  12. package/dev-server/app/globals.css +0 -4
  13. package/dev-server/app/layout.tsx +0 -38
  14. package/dev-server/app/not-found.tsx +0 -18
  15. package/dev-server/app/search/route.ts +0 -17
  16. package/dev-server/components/dev-reload-script.tsx +0 -86
  17. package/dev-server/components/providers.tsx +0 -15
  18. package/dev-server/lib/dev-state.ts +0 -8
  19. package/dev-server/lib/local-content-source.ts +0 -103
  20. package/dev-server/lib/local-runtime.tsx +0 -555
  21. package/dev-server/next-env.d.ts +0 -5
  22. package/dev-server/next.config.js +0 -54
  23. package/dev-server/package.json +0 -61
  24. package/dev-server/postcss.config.mjs +0 -7
  25. package/dev-server/public/glide-variable.woff2 +0 -0
  26. package/dev-server/tsconfig.json +0 -50
  27. package/docs/app/globals.css +0 -471
  28. package/docs/components/animate-ui/primitives/buttons/button.tsx +0 -14
  29. package/docs/components/api/api-playground.tsx +0 -467
  30. package/docs/components/api/api-reference.tsx +0 -157
  31. package/docs/components/content/collection-index.tsx +0 -114
  32. package/docs/components/docs/contextual-menu.tsx +0 -495
  33. package/docs/components/docs/copy-page-menu.tsx +0 -364
  34. package/docs/components/docs/doc-header.tsx +0 -223
  35. package/docs/components/docs/doc-shell.tsx +0 -355
  36. package/docs/components/docs/doc-sidebar.tsx +0 -256
  37. package/docs/components/docs/doc-toc.tsx +0 -46
  38. package/docs/components/docs/mobile-nav.tsx +0 -195
  39. package/docs/components/docs/sidebar-active-highlight.tsx +0 -34
  40. package/docs/components/docs/sidebar-scroll-area.tsx +0 -63
  41. package/docs/components/git/repo-picker.tsx +0 -529
  42. package/docs/components/icons/doc-icon.tsx +0 -96
  43. package/docs/components/mdx/accordion.tsx +0 -83
  44. package/docs/components/mdx/agent-instructions.tsx +0 -17
  45. package/docs/components/mdx/badge.tsx +0 -79
  46. package/docs/components/mdx/callout.tsx +0 -88
  47. package/docs/components/mdx/card.tsx +0 -110
  48. package/docs/components/mdx/code-block.tsx +0 -80
  49. package/docs/components/mdx/code-group.tsx +0 -203
  50. package/docs/components/mdx/color.tsx +0 -87
  51. package/docs/components/mdx/columns.tsx +0 -25
  52. package/docs/components/mdx/expandable.tsx +0 -45
  53. package/docs/components/mdx/field-layout.tsx +0 -77
  54. package/docs/components/mdx/frame.tsx +0 -23
  55. package/docs/components/mdx/get-text-content.ts +0 -18
  56. package/docs/components/mdx/icon.tsx +0 -12
  57. package/docs/components/mdx/iframe.tsx +0 -62
  58. package/docs/components/mdx/index.tsx +0 -121
  59. package/docs/components/mdx/installer.tsx +0 -20
  60. package/docs/components/mdx/panel.tsx +0 -11
  61. package/docs/components/mdx/param-field.tsx +0 -56
  62. package/docs/components/mdx/preview.tsx +0 -36
  63. package/docs/components/mdx/prompt.tsx +0 -63
  64. package/docs/components/mdx/request-example.tsx +0 -27
  65. package/docs/components/mdx/response-field.tsx +0 -42
  66. package/docs/components/mdx/steps.tsx +0 -92
  67. package/docs/components/mdx/tabs.tsx +0 -193
  68. package/docs/components/mdx/tile.tsx +0 -43
  69. package/docs/components/mdx/tooltip.tsx +0 -71
  70. package/docs/components/mdx/tree.tsx +0 -120
  71. package/docs/components/mdx/type-table.tsx +0 -71
  72. package/docs/components/mdx/update.tsx +0 -44
  73. package/docs/components/mdx/video.tsx +0 -45
  74. package/docs/components/mdx/view.tsx +0 -66
  75. package/docs/components/posthog-provider.tsx +0 -42
  76. package/docs/components/providers.tsx +0 -15
  77. package/docs/components/tenant-analytics.tsx +0 -49
  78. package/docs/components/third-parties.tsx +0 -32
  79. package/docs/components/ui/badge.tsx +0 -61
  80. package/docs/components/ui/breadcrumb.tsx +0 -112
  81. package/docs/components/ui/button-group.tsx +0 -83
  82. package/docs/components/ui/button.tsx +0 -65
  83. package/docs/components/ui/card.tsx +0 -92
  84. package/docs/components/ui/command.tsx +0 -167
  85. package/docs/components/ui/copy-button.tsx +0 -129
  86. package/docs/components/ui/dialog.tsx +0 -146
  87. package/docs/components/ui/field.tsx +0 -237
  88. package/docs/components/ui/input.tsx +0 -23
  89. package/docs/components/ui/kbd.tsx +0 -98
  90. package/docs/components/ui/label.tsx +0 -22
  91. package/docs/components/ui/morph-icon.tsx +0 -79
  92. package/docs/components/ui/popover.tsx +0 -267
  93. package/docs/components/ui/search-dialog.tsx +0 -431
  94. package/docs/components/ui/search.tsx +0 -101
  95. package/docs/components/ui/separator.tsx +0 -26
  96. package/docs/components/ui/sheet.tsx +0 -133
  97. package/docs/components/ui/sidebar.tsx +0 -758
  98. package/docs/components/ui/skeleton.tsx +0 -11
  99. package/docs/components/ui/switch.tsx +0 -32
  100. package/docs/components/ui/tabs.tsx +0 -138
  101. package/docs/components/ui/theme-toggle.tsx +0 -62
  102. package/docs/components/ui/tooltip.tsx +0 -53
  103. package/docs/components/web-mcp.tsx +0 -115
  104. package/docs/lib/agent-skills.ts +0 -48
  105. package/docs/lib/api-client.ts +0 -72
  106. package/docs/lib/config.ts +0 -6
  107. package/docs/lib/content-root.ts +0 -33
  108. package/docs/lib/content-source.ts +0 -70
  109. package/docs/lib/contextual-options.ts +0 -222
  110. package/docs/lib/dashboard-session.ts +0 -167
  111. package/docs/lib/db.ts +0 -13
  112. package/docs/lib/docs-collection.ts +0 -7
  113. package/docs/lib/docs-runtime.tsx +0 -745
  114. package/docs/lib/edge-config.ts +0 -95
  115. package/docs/lib/env.ts +0 -23
  116. package/docs/lib/etag.ts +0 -22
  117. package/docs/lib/github-install.ts +0 -33
  118. package/docs/lib/llms-full.ts +0 -82
  119. package/docs/lib/marketing-markdown.ts +0 -79
  120. package/docs/lib/marketing-site.ts +0 -31
  121. package/docs/lib/mdx.ts +0 -98
  122. package/docs/lib/navigation.ts +0 -288
  123. package/docs/lib/openapi-proxy.ts +0 -88
  124. package/docs/lib/openapi.ts +0 -158
  125. package/docs/lib/platform-config.ts +0 -6
  126. package/docs/lib/project-authz.ts +0 -46
  127. package/docs/lib/routes.ts +0 -103
  128. package/docs/lib/server-cache.ts +0 -83
  129. package/docs/lib/shiki.ts +0 -44
  130. package/docs/lib/supabase.ts +0 -37
  131. package/docs/lib/tenancy.ts +0 -364
  132. package/docs/lib/tenant-headers.ts +0 -43
  133. package/docs/lib/tenant-static.ts +0 -705
  134. package/docs/lib/tenant-utility-context.ts +0 -62
  135. package/docs/lib/tenants.ts +0 -72
  136. package/docs/lib/theme.ts +0 -29
  137. package/docs/lib/time-ago.ts +0 -24
  138. package/docs/lib/toc.ts +0 -2
  139. package/docs/lib/use-mobile.ts +0 -19
  140. package/docs/lib/use-tab-observer.ts +0 -71
  141. package/docs/lib/utils.ts +0 -5
  142. package/packages/@repo/common/dist/index.d.ts +0 -16
  143. package/packages/@repo/common/dist/index.d.ts.map +0 -1
  144. package/packages/@repo/common/dist/index.js +0 -84
  145. package/packages/@repo/common/package.json +0 -34
  146. package/packages/@repo/common/src/index.ts +0 -101
  147. package/packages/@repo/contracts/dist/analytics.d.ts +0 -21
  148. package/packages/@repo/contracts/dist/analytics.d.ts.map +0 -1
  149. package/packages/@repo/contracts/dist/analytics.js +0 -18
  150. package/packages/@repo/contracts/dist/dates.d.ts +0 -4
  151. package/packages/@repo/contracts/dist/dates.d.ts.map +0 -1
  152. package/packages/@repo/contracts/dist/dates.js +0 -2
  153. package/packages/@repo/contracts/dist/deployment.d.ts +0 -71
  154. package/packages/@repo/contracts/dist/deployment.d.ts.map +0 -1
  155. package/packages/@repo/contracts/dist/deployment.js +0 -46
  156. package/packages/@repo/contracts/dist/domain.d.ts +0 -94
  157. package/packages/@repo/contracts/dist/domain.d.ts.map +0 -1
  158. package/packages/@repo/contracts/dist/domain.js +0 -36
  159. package/packages/@repo/contracts/dist/git.d.ts +0 -28
  160. package/packages/@repo/contracts/dist/git.d.ts.map +0 -1
  161. package/packages/@repo/contracts/dist/git.js +0 -24
  162. package/packages/@repo/contracts/dist/ids.d.ts +0 -14
  163. package/packages/@repo/contracts/dist/ids.d.ts.map +0 -1
  164. package/packages/@repo/contracts/dist/ids.js +0 -11
  165. package/packages/@repo/contracts/dist/index.d.ts +0 -11
  166. package/packages/@repo/contracts/dist/index.d.ts.map +0 -1
  167. package/packages/@repo/contracts/dist/index.js +0 -12
  168. package/packages/@repo/contracts/dist/pagination.d.ts +0 -23
  169. package/packages/@repo/contracts/dist/pagination.d.ts.map +0 -1
  170. package/packages/@repo/contracts/dist/pagination.js +0 -15
  171. package/packages/@repo/contracts/dist/project.d.ts +0 -42
  172. package/packages/@repo/contracts/dist/project.d.ts.map +0 -1
  173. package/packages/@repo/contracts/dist/project.js +0 -25
  174. package/packages/@repo/contracts/dist/tenant.d.ts +0 -147
  175. package/packages/@repo/contracts/dist/tenant.d.ts.map +0 -1
  176. package/packages/@repo/contracts/dist/tenant.js +0 -58
  177. package/packages/@repo/contracts/dist/user.d.ts +0 -9
  178. package/packages/@repo/contracts/dist/user.d.ts.map +0 -1
  179. package/packages/@repo/contracts/dist/user.js +0 -9
  180. package/packages/@repo/contracts/package.json +0 -37
  181. package/packages/@repo/contracts/src/analytics.ts +0 -33
  182. package/packages/@repo/contracts/src/dates.ts +0 -4
  183. package/packages/@repo/contracts/src/deployment.ts +0 -73
  184. package/packages/@repo/contracts/src/domain.ts +0 -51
  185. package/packages/@repo/contracts/src/git.ts +0 -31
  186. package/packages/@repo/contracts/src/ids.ts +0 -23
  187. package/packages/@repo/contracts/src/index.ts +0 -12
  188. package/packages/@repo/contracts/src/pagination.ts +0 -21
  189. package/packages/@repo/contracts/src/project.ts +0 -32
  190. package/packages/@repo/contracts/src/tenant.ts +0 -94
  191. package/packages/@repo/contracts/src/user.ts +0 -12
  192. package/packages/@repo/models/dist/docs-config.d.ts +0 -961
  193. package/packages/@repo/models/dist/docs-config.d.ts.map +0 -1
  194. package/packages/@repo/models/dist/docs-config.js +0 -531
  195. package/packages/@repo/models/dist/index.d.ts +0 -3
  196. package/packages/@repo/models/dist/index.d.ts.map +0 -1
  197. package/packages/@repo/models/dist/index.js +0 -3
  198. package/packages/@repo/models/dist/tenant.d.ts +0 -37
  199. package/packages/@repo/models/dist/tenant.d.ts.map +0 -1
  200. package/packages/@repo/models/dist/tenant.js +0 -1
  201. package/packages/@repo/models/package.json +0 -37
  202. package/packages/@repo/models/src/docs-config.ts +0 -629
  203. package/packages/@repo/models/src/index.ts +0 -3
  204. package/packages/@repo/models/src/tenant.ts +0 -44
  205. package/packages/@repo/prebuild/dist/index.d.ts +0 -2
  206. package/packages/@repo/prebuild/dist/index.d.ts.map +0 -1
  207. package/packages/@repo/prebuild/dist/index.js +0 -2
  208. package/packages/@repo/prebuild/dist/openapi.d.ts +0 -43
  209. package/packages/@repo/prebuild/dist/openapi.d.ts.map +0 -1
  210. package/packages/@repo/prebuild/dist/openapi.js +0 -86
  211. package/packages/@repo/prebuild/package.json +0 -39
  212. package/packages/@repo/prebuild/src/index.ts +0 -2
  213. package/packages/@repo/prebuild/src/openapi.ts +0 -154
  214. package/packages/@repo/previewing/dist/blob-source.d.ts +0 -16
  215. package/packages/@repo/previewing/dist/blob-source.d.ts.map +0 -1
  216. package/packages/@repo/previewing/dist/blob-source.js +0 -128
  217. package/packages/@repo/previewing/dist/config-loader.d.ts +0 -134
  218. package/packages/@repo/previewing/dist/config-loader.d.ts.map +0 -1
  219. package/packages/@repo/previewing/dist/config-loader.js +0 -231
  220. package/packages/@repo/previewing/dist/constants.d.ts +0 -15
  221. package/packages/@repo/previewing/dist/constants.d.ts.map +0 -1
  222. package/packages/@repo/previewing/dist/constants.js +0 -14
  223. package/packages/@repo/previewing/dist/content-index.d.ts +0 -7
  224. package/packages/@repo/previewing/dist/content-index.d.ts.map +0 -1
  225. package/packages/@repo/previewing/dist/content-index.js +0 -291
  226. package/packages/@repo/previewing/dist/content-source.d.ts +0 -12
  227. package/packages/@repo/previewing/dist/content-source.d.ts.map +0 -1
  228. package/packages/@repo/previewing/dist/content-source.js +0 -1
  229. package/packages/@repo/previewing/dist/fs-source.d.ts +0 -11
  230. package/packages/@repo/previewing/dist/fs-source.d.ts.map +0 -1
  231. package/packages/@repo/previewing/dist/fs-source.js +0 -71
  232. package/packages/@repo/previewing/dist/index.d.ts +0 -16
  233. package/packages/@repo/previewing/dist/index.d.ts.map +0 -1
  234. package/packages/@repo/previewing/dist/index.js +0 -13
  235. package/packages/@repo/previewing/dist/markdown/agent-markdown.d.ts +0 -3
  236. package/packages/@repo/previewing/dist/markdown/agent-markdown.d.ts.map +0 -1
  237. package/packages/@repo/previewing/dist/markdown/agent-markdown.js +0 -176
  238. package/packages/@repo/previewing/dist/markdown/format.d.ts +0 -8
  239. package/packages/@repo/previewing/dist/markdown/format.d.ts.map +0 -1
  240. package/packages/@repo/previewing/dist/markdown/format.js +0 -43
  241. package/packages/@repo/previewing/dist/markdown/links.d.ts +0 -3
  242. package/packages/@repo/previewing/dist/markdown/links.d.ts.map +0 -1
  243. package/packages/@repo/previewing/dist/markdown/links.js +0 -31
  244. package/packages/@repo/previewing/dist/openapi-pages.d.ts +0 -7
  245. package/packages/@repo/previewing/dist/openapi-pages.d.ts.map +0 -1
  246. package/packages/@repo/previewing/dist/openapi-pages.js +0 -200
  247. package/packages/@repo/previewing/dist/search-index.d.ts +0 -4
  248. package/packages/@repo/previewing/dist/search-index.d.ts.map +0 -1
  249. package/packages/@repo/previewing/dist/search-index.js +0 -23
  250. package/packages/@repo/previewing/dist/serialization.d.ts +0 -13
  251. package/packages/@repo/previewing/dist/serialization.d.ts.map +0 -1
  252. package/packages/@repo/previewing/dist/serialization.js +0 -108
  253. package/packages/@repo/previewing/dist/toc-index.d.ts +0 -5
  254. package/packages/@repo/previewing/dist/toc-index.d.ts.map +0 -1
  255. package/packages/@repo/previewing/dist/toc-index.js +0 -53
  256. package/packages/@repo/previewing/dist/types.d.ts +0 -92
  257. package/packages/@repo/previewing/dist/types.d.ts.map +0 -1
  258. package/packages/@repo/previewing/dist/types.js +0 -1
  259. package/packages/@repo/previewing/dist/utility-index.d.ts +0 -7
  260. package/packages/@repo/previewing/dist/utility-index.d.ts.map +0 -1
  261. package/packages/@repo/previewing/dist/utility-index.js +0 -201
  262. package/packages/@repo/previewing/package.json +0 -41
  263. package/packages/@repo/previewing/src/blob-source.ts +0 -185
  264. package/packages/@repo/previewing/src/config-loader.ts +0 -316
  265. package/packages/@repo/previewing/src/constants.ts +0 -16
  266. package/packages/@repo/previewing/src/content-index.ts +0 -384
  267. package/packages/@repo/previewing/src/content-source.ts +0 -12
  268. package/packages/@repo/previewing/src/fs-source.ts +0 -103
  269. package/packages/@repo/previewing/src/index.ts +0 -71
  270. package/packages/@repo/previewing/src/markdown/agent-markdown.ts +0 -254
  271. package/packages/@repo/previewing/src/markdown/format.ts +0 -63
  272. package/packages/@repo/previewing/src/markdown/links.ts +0 -46
  273. package/packages/@repo/previewing/src/openapi-pages.ts +0 -319
  274. package/packages/@repo/previewing/src/search-index.ts +0 -38
  275. package/packages/@repo/previewing/src/serialization.ts +0 -191
  276. package/packages/@repo/previewing/src/toc-index.ts +0 -72
  277. package/packages/@repo/previewing/src/types.ts +0 -105
  278. package/packages/@repo/previewing/src/utility-index.ts +0 -304
  279. package/packages/@repo/validation/dist/index.d.ts +0 -12
  280. package/packages/@repo/validation/dist/index.d.ts.map +0 -1
  281. package/packages/@repo/validation/dist/index.js +0 -30
  282. package/packages/@repo/validation/package.json +0 -38
  283. package/packages/@repo/validation/src/blodemd-docs-schema.json +0 -3575
  284. package/packages/@repo/validation/src/index.ts +0 -59
  285. package/scripts/prepare-package.mjs +0 -53
  286. package/scripts/repo-packages.mjs +0 -8
@@ -1,16 +0,0 @@
1
- export { BlobContentSource, createBlobSource } from "./blob-source.js";
2
- export { getDocsCollection, getDocsCollectionWithNavigation, getDocsNavigation, loadSiteConfig, } from "./config-loader.js";
3
- export { LEGACY_PROJECT_NAME_FALLBACK_WARNING, PREBUILT_INDEX_PATH, PREBUILT_OPENAPI_INDEX_PATH, PREBUILT_SEARCH_INDEX_PATH, PREBUILT_TOC_INDEX_PATH, PREBUILT_UTILITY_INDEX_PATH, PREBUILT_UTILITY_LLMS_FULL_PATH, PREBUILT_UTILITY_LLMS_PATH, PREBUILT_UTILITY_LLMS_SEGMENT_PREFIX, PREBUILT_UTILITY_SITEMAP_PATH, PREBUILT_UTILITY_SKILLS_INDEX_PATH, PREBUILT_UTILITY_SKILLS_MD_PREFIX, UTILITY_DOCS_ROOT_TOKEN, } from "./constants.js";
4
- export { buildContentIndex, buildPageMetadataMap } from "./content-index.js";
5
- export type { CompiledMdxResult, ContentSource } from "./content-source.js";
6
- export { createFsSource, FsContentSource } from "./fs-source.js";
7
- export { prepareLlmsFullContent, toAgentMarkdown, } from "./markdown/agent-markdown.js";
8
- export { formatMarkdownPage, formatMarkdownPageSection, stripFrontmatter, } from "./markdown/format.js";
9
- export { absolutiseInternalLinks, sanitizePlaceholderUrls, } from "./markdown/links.js";
10
- export { formatOpenApiPageContent } from "./openapi-pages.js";
11
- export { buildSearchIndex } from "./search-index.js";
12
- export { loadPrebuiltContentIndex, loadPrebuiltOpenApiIndex, loadPrebuiltSearchIndex, loadPrebuiltTocIndex, loadPrebuiltUtilityIndex, serializeContentIndex, serializeOpenApiIndex, serializeSearchIndex, serializeTocIndex, serializeUtilityIndex, } from "./serialization.js";
13
- export { buildTocIndex, extractToc } from "./toc-index.js";
14
- export type { ContentEntry, ContentIndex, PageMetadata, PrebuiltOpenApiEntry, SearchIndexItem, SiteConfigResult, TocItem, UtilityArtifact, UtilityIndex, UtilityPage, UtilitySegment, } from "./types.js";
15
- export { buildUtilityArtifacts, buildUtilityIndex, getPrebuiltUtilityLlmPagePath, } from "./utility-index.js";
16
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,EACL,iBAAiB,EACjB,+BAA+B,EAC/B,iBAAiB,EACjB,cAAc,GACf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,oCAAoC,EACpC,mBAAmB,EACnB,2BAA2B,EAC3B,0BAA0B,EAC1B,uBAAuB,EACvB,2BAA2B,EAC3B,+BAA+B,EAC/B,0BAA0B,EAC1B,oCAAoC,EACpC,6BAA6B,EAC7B,kCAAkC,EAClC,iCAAiC,EACjC,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC7E,YAAY,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EACL,sBAAsB,EACtB,eAAe,GAChB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,kBAAkB,EAClB,yBAAyB,EACzB,gBAAgB,GACjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EACL,wBAAwB,EACxB,wBAAwB,EACxB,uBAAuB,EACvB,oBAAoB,EACpB,wBAAwB,EACxB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC3D,YAAY,EACV,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,OAAO,EACP,eAAe,EACf,YAAY,EACZ,WAAW,EACX,cAAc,GACf,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,6BAA6B,GAC9B,MAAM,oBAAoB,CAAC"}
@@ -1,13 +0,0 @@
1
- export { BlobContentSource, createBlobSource } from "./blob-source.js";
2
- export { getDocsCollection, getDocsCollectionWithNavigation, getDocsNavigation, loadSiteConfig, } from "./config-loader.js";
3
- export { LEGACY_PROJECT_NAME_FALLBACK_WARNING, PREBUILT_INDEX_PATH, PREBUILT_OPENAPI_INDEX_PATH, PREBUILT_SEARCH_INDEX_PATH, PREBUILT_TOC_INDEX_PATH, PREBUILT_UTILITY_INDEX_PATH, PREBUILT_UTILITY_LLMS_FULL_PATH, PREBUILT_UTILITY_LLMS_PATH, PREBUILT_UTILITY_LLMS_SEGMENT_PREFIX, PREBUILT_UTILITY_SITEMAP_PATH, PREBUILT_UTILITY_SKILLS_INDEX_PATH, PREBUILT_UTILITY_SKILLS_MD_PREFIX, UTILITY_DOCS_ROOT_TOKEN, } from "./constants.js";
4
- export { buildContentIndex, buildPageMetadataMap } from "./content-index.js";
5
- export { createFsSource, FsContentSource } from "./fs-source.js";
6
- export { prepareLlmsFullContent, toAgentMarkdown, } from "./markdown/agent-markdown.js";
7
- export { formatMarkdownPage, formatMarkdownPageSection, stripFrontmatter, } from "./markdown/format.js";
8
- export { absolutiseInternalLinks, sanitizePlaceholderUrls, } from "./markdown/links.js";
9
- export { formatOpenApiPageContent } from "./openapi-pages.js";
10
- export { buildSearchIndex } from "./search-index.js";
11
- export { loadPrebuiltContentIndex, loadPrebuiltOpenApiIndex, loadPrebuiltSearchIndex, loadPrebuiltTocIndex, loadPrebuiltUtilityIndex, serializeContentIndex, serializeOpenApiIndex, serializeSearchIndex, serializeTocIndex, serializeUtilityIndex, } from "./serialization.js";
12
- export { buildTocIndex, extractToc } from "./toc-index.js";
13
- export { buildUtilityArtifacts, buildUtilityIndex, getPrebuiltUtilityLlmPagePath, } from "./utility-index.js";
@@ -1,3 +0,0 @@
1
- export declare const toAgentMarkdown: (source: string) => string;
2
- export declare const prepareLlmsFullContent: (source: string, origin: string, basePath: string) => string;
3
- //# sourceMappingURL=agent-markdown.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"agent-markdown.d.ts","sourceRoot":"","sources":["../../src/markdown/agent-markdown.ts"],"names":[],"mappings":"AA4OA,eAAO,MAAM,eAAe,GAAI,QAAQ,MAAM,KAAG,MAMhD,CAAC;AAEF,eAAO,MAAM,sBAAsB,GACjC,QAAQ,MAAM,EACd,QAAQ,MAAM,EACd,UAAU,MAAM,WAMf,CAAC"}
@@ -1,176 +0,0 @@
1
- import { NEWLINE_REGEX } from "../constants.js";
2
- import { absolutiseInternalLinks, sanitizePlaceholderUrls } from "./links.js";
3
- const FENCED_CODE_BLOCK_REGEX = /(^|\n)(`{3,}|~{3,})[^\n]*\n[\s\S]*?\n\2(?=\n|$)/g;
4
- const TYPE_TABLE_REGEX = /<TypeTable\s+type=\{\{([\s\S]*?)\}\}\s*\/>/g;
5
- const TYPE_TABLE_ROW_HEADER_REGEX = /^\s*(["']?[\w$./<>|{}\-\s]+["']?)\s*:\s*\{\s*$/;
6
- const STRING_FIELD_REGEX = (field) => new RegExp(`${field}:\\s*(?:"([^"]*)"|'([^']*)'|\`([^\`]*)\`)`, "s");
7
- const BOOLEAN_FIELD_REGEX = (field) => new RegExp(`${field}:\\s*(true|false)`, "s");
8
- const getStringProp = (attributes, name) => {
9
- const match = new RegExp(`${name}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|\\{\\s*"([^"]*)"\\s*\\}|\\{\\s*'([^']*)'\\s*\\})`).exec(attributes);
10
- return match?.slice(1).find((value) => typeof value === "string");
11
- };
12
- const protectFencedCodeBlocks = (source) => {
13
- const blocks = [];
14
- const text = source.replace(FENCED_CODE_BLOCK_REGEX, (match) => {
15
- const placeholder = `\n@@BLODEMD_CODE_BLOCK_${blocks.length}@@\n`;
16
- blocks.push(match.trim());
17
- return placeholder;
18
- });
19
- return { blocks, text };
20
- };
21
- const restoreFencedCodeBlocks = (source, blocks) => {
22
- let restored = source;
23
- for (const [index, block] of blocks.entries()) {
24
- // Function replacer: code may contain `$&`, `$1`, `` $` `` etc. which a
25
- // string replacement would interpret as substitution patterns.
26
- restored = restored.replace(`@@BLODEMD_CODE_BLOCK_${index}@@`, () => block);
27
- }
28
- return restored;
29
- };
30
- const INLINE_CODE_REGEX = /(?<![\\`])`([^`\n]+)`(?!`)/g;
31
- const protectInlineCode = (source) => {
32
- const spans = [];
33
- const text = source.replace(INLINE_CODE_REGEX, (match) => {
34
- const placeholder = `@@BLODEMD_INLINE_CODE_${spans.length}@@`;
35
- spans.push(match);
36
- return placeholder;
37
- });
38
- return { spans, text };
39
- };
40
- const restoreInlineCode = (source, spans) => {
41
- let restored = source;
42
- for (const [index, span] of spans.entries()) {
43
- restored = restored.replace(`@@BLODEMD_INLINE_CODE_${index}@@`, () => span);
44
- }
45
- return restored;
46
- };
47
- const compactMarkdown = (source) => source
48
- .replaceAll(/[ \t]+\n/g, "\n")
49
- .replaceAll(/\n{3,}/g, "\n\n")
50
- .trim();
51
- const getFieldStringValue = (block, field) => {
52
- const match = STRING_FIELD_REGEX(field).exec(block);
53
- return match?.slice(1).find((value) => typeof value === "string");
54
- };
55
- const getFieldBooleanValue = (block, field) => {
56
- const match = BOOLEAN_FIELD_REGEX(field).exec(block);
57
- return match?.[1];
58
- };
59
- const renderTypeTable = (_match, body) => {
60
- const rows = [];
61
- const lines = body.split(NEWLINE_REGEX);
62
- for (let index = 0; index < lines.length; index += 1) {
63
- const header = TYPE_TABLE_ROW_HEADER_REGEX.exec(lines[index] ?? "");
64
- if (!header) {
65
- continue;
66
- }
67
- const name = (header[1] ?? "").replaceAll(/^["']|["']$/g, "").trim();
68
- const blockLines = [];
69
- index += 1;
70
- while (index < lines.length) {
71
- const line = lines[index] ?? "";
72
- if (/^\s*\},?\s*$/.test(line)) {
73
- break;
74
- }
75
- blockLines.push(line);
76
- index += 1;
77
- }
78
- const block = blockLines.join("\n");
79
- const type = getFieldStringValue(block, "type") ?? "";
80
- const description = getFieldStringValue(block, "description") ?? "";
81
- const required = getFieldBooleanValue(block, "required") ?? "";
82
- const defaultValue = getFieldStringValue(block, "default") ?? "";
83
- const meta = [
84
- type ? `type: ${type}` : null,
85
- required ? `required: ${required}` : null,
86
- defaultValue ? `default: ${defaultValue}` : null,
87
- ]
88
- .filter(Boolean)
89
- .join(", ");
90
- rows.push(`- \`${name}\`${meta ? ` (${meta})` : ""}: ${description}`);
91
- }
92
- return rows.length ? rows.join("\n") : "";
93
- };
94
- const transformMdxComponents = (source) => {
95
- let output = source;
96
- output = output.replaceAll(TYPE_TABLE_REGEX, renderTypeTable);
97
- output = output.replaceAll(/<Installer\s+([^>]*)\/>/g, (_match, attributes) => {
98
- const command = getStringProp(attributes, "command");
99
- return command ? `\`\`\`bash\n${command}\n\`\`\`` : "";
100
- });
101
- output = output.replaceAll(/<Tree\.Folder\s+([^>]*)>/g, (_match, attributes) => {
102
- const name = getStringProp(attributes, "name") ?? "folder";
103
- return `- ${name}/`;
104
- });
105
- output = output.replaceAll(/<Tree\.File\s+([^>]*)\/>/g, (_match, attributes) => {
106
- const name = getStringProp(attributes, "name") ?? "file";
107
- return `- ${name}`;
108
- });
109
- output = output.replaceAll("</Tree.Folder>", "");
110
- output = output.replaceAll(/<\/?Tree[^>]*>/g, "");
111
- output = output.replaceAll(/<Frame(?=[\s>])\s*([^>]*)>([\s\S]*?)<\/Frame>/g, (_match, attributes, children) => {
112
- const caption = getStringProp(attributes, "caption");
113
- const hint = getStringProp(attributes, "hint");
114
- return compactMarkdown([hint, children.trim(), caption ? `Caption: ${caption}` : null]
115
- .filter(Boolean)
116
- .join("\n\n"));
117
- });
118
- output = output.replaceAll(/<Callout(?=[\s>])\s*([^>]*)>([\s\S]*?)<\/Callout>/g, (_match, attributes, children) => {
119
- const type = (getStringProp(attributes, "type") ?? "note").toUpperCase();
120
- return `> [!${type}]\n${children
121
- .trim()
122
- .split(NEWLINE_REGEX)
123
- .map((line) => `> ${line}`)
124
- .join("\n")}`;
125
- });
126
- for (const [tag, type] of [
127
- ["Note", "NOTE"],
128
- ["Warning", "WARNING"],
129
- ["Info", "INFO"],
130
- ["Tip", "TIP"],
131
- ["Check", "CHECK"],
132
- ["Danger", "DANGER"],
133
- ]) {
134
- output = output.replaceAll(new RegExp(`<${tag}(?=[\\s>])\\s*[^>]*>([\\s\\S]*?)</${tag}>`, "g"), (_match, children) => `> [!${type}]\n${children
135
- .trim()
136
- .split(NEWLINE_REGEX)
137
- .map((line) => `> ${line}`)
138
- .join("\n")}`);
139
- }
140
- output = output.replaceAll(/<Accordion(?=[\s>])\s*([^>]*)>([\s\S]*?)<\/Accordion>/g, (_match, attributes, children) => {
141
- const title = getStringProp(attributes, "title") ?? "Details";
142
- return `### ${title}\n\n${children.trim()}`;
143
- });
144
- output = output.replaceAll(/<Tab\s+([^>]*)>([\s\S]*?)<\/Tab>/g, (_match, attributes, children) => {
145
- const title = getStringProp(attributes, "title") ??
146
- getStringProp(attributes, "label") ??
147
- "Tab";
148
- return `### ${title}\n\n${children.trim()}`;
149
- });
150
- output = output.replaceAll(/<Step\s+([^>]*)>([\s\S]*?)<\/Step>/g, (_match, attributes, children) => {
151
- const title = getStringProp(attributes, "title") ?? "Step";
152
- return `1. **${title}**\n\n${children.trim()}`;
153
- });
154
- output = output.replaceAll(/<Expandable(?=[\s>])\s*([^>]*)>([\s\S]*?)<\/Expandable>/g, (_match, attributes, children) => {
155
- const title = getStringProp(attributes, "title") ?? "Details";
156
- return `### ${title}\n\n${children.trim()}`;
157
- });
158
- output = output.replaceAll(/<Card(?=[\s>])\s*([^>]*)>([\s\S]*?)<\/Card>/g, (_match, attributes, children) => {
159
- const title = getStringProp(attributes, "title");
160
- const href = getStringProp(attributes, "href");
161
- const heading = title
162
- ? `### ${href ? `[${title}](${href})` : title}`
163
- : "";
164
- return compactMarkdown([heading, children.trim()].filter(Boolean).join("\n\n"));
165
- });
166
- output = output.replaceAll(/<\/?(?:Columns|Column|CodeGroup|Tabs|Steps|AccordionGroup|CardGroup)[^>]*>/g, "");
167
- return compactMarkdown(output);
168
- };
169
- export const toAgentMarkdown = (source) => {
170
- const { blocks, text: codeProtected } = protectFencedCodeBlocks(source);
171
- const { spans, text: inlineProtected } = protectInlineCode(codeProtected);
172
- const transformed = transformMdxComponents(inlineProtected);
173
- const inlineRestored = restoreInlineCode(transformed, spans);
174
- return compactMarkdown(restoreFencedCodeBlocks(inlineRestored, blocks));
175
- };
176
- export const prepareLlmsFullContent = (source, origin, basePath) => absolutiseInternalLinks(sanitizePlaceholderUrls(toAgentMarkdown(source)), origin, basePath);
@@ -1,8 +0,0 @@
1
- export declare const parseFrontmatter: (source: string) => {
2
- body: string;
3
- frontmatter: any;
4
- };
5
- export declare const stripFrontmatter: (source: string) => string;
6
- export declare const formatMarkdownPage: (title: string, source: string, description?: string) => string;
7
- export declare const formatMarkdownPageSection: (title: string, url: string, source: string, description?: string) => string;
8
- //# sourceMappingURL=format.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/markdown/format.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,gBAAgB,GAAI,QAAQ,MAAM;;;CAS9C,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,QAAQ,MAAM,WACT,CAAC;AAiBvC,eAAO,MAAM,kBAAkB,GAC7B,OAAO,MAAM,EACb,QAAQ,MAAM,EACd,cAAc,MAAM,WASrB,CAAC;AAEF,eAAO,MAAM,yBAAyB,GACpC,OAAO,MAAM,EACb,KAAK,MAAM,EACX,QAAQ,MAAM,EACd,cAAc,MAAM,WASrB,CAAC"}
@@ -1,43 +0,0 @@
1
- import { slugify } from "@repo/common";
2
- import YAML from "yaml";
3
- const FRONTMATTER_REGEX = /^---\s*\n([\s\S]*?)\n---\s*\n?/;
4
- const LEADING_H1_REGEX = /^#\s+([^\r\n]+)(?:\r?\n(?:\r?\n)?)?/;
5
- export const parseFrontmatter = (source) => {
6
- const match = FRONTMATTER_REGEX.exec(source);
7
- if (!match) {
8
- return { body: source, frontmatter: {} };
9
- }
10
- const raw = match[1] ?? "";
11
- const data = YAML.parse(raw) ?? {};
12
- const body = source.slice(match[0].length);
13
- return { body, frontmatter: data };
14
- };
15
- export const stripFrontmatter = (source) => parseFrontmatter(source).body.trim();
16
- const stripMatchingLeadingH1 = (source, title) => {
17
- const trimmed = source.trimStart();
18
- const match = LEADING_H1_REGEX.exec(trimmed);
19
- if (!match) {
20
- return trimmed.trim();
21
- }
22
- const [headingLine = "", headingTitle = ""] = match;
23
- if (slugify(headingTitle) !== slugify(title)) {
24
- return trimmed.trim();
25
- }
26
- return trimmed.slice(headingLine.length).trim();
27
- };
28
- export const formatMarkdownPage = (title, source, description) => {
29
- const content = stripMatchingLeadingH1(source, title);
30
- const descriptionBlock = description ? `\n\n${description}` : "";
31
- if (!content) {
32
- return `# ${title}${descriptionBlock}`;
33
- }
34
- return `# ${title}${descriptionBlock}\n\n${content}`;
35
- };
36
- export const formatMarkdownPageSection = (title, url, source, description) => {
37
- const content = stripMatchingLeadingH1(source, title);
38
- const descriptionBlock = description ? `\n\n${description}` : "";
39
- if (!content) {
40
- return `# ${title} (${url})${descriptionBlock}`;
41
- }
42
- return `# ${title} (${url})${descriptionBlock}\n\n${content}`;
43
- };
@@ -1,3 +0,0 @@
1
- export declare const sanitizePlaceholderUrls: (text: string) => string;
2
- export declare const absolutiseInternalLinks: (source: string, origin: string, basePath: string) => string;
3
- //# sourceMappingURL=links.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"links.d.ts","sourceRoot":"","sources":["../../src/markdown/links.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,uBAAuB,GAAI,MAAM,MAAM,KAAG,MAGe,CAAC;AAEvE,eAAO,MAAM,uBAAuB,GAClC,QAAQ,MAAM,EACd,QAAQ,MAAM,EACd,UAAU,MAAM,KACf,MAiBF,CAAC"}
@@ -1,31 +0,0 @@
1
- const PLACEHOLDER_URL_PATTERN = [
2
- "https?://(?:[a-z0-9-]+\\.)*example\\.(?:com|org|net)\\b[^\\s)\\]\"'<>]*",
3
- "https?://discord\\.gg/example\\b[^\\s)\\]\"'<>]*",
4
- "https?://(?:[a-z0-9-]+\\.)+(?:test|invalid)(?:[/?#:][^\\s)\\]\"'<>]*)?",
5
- "https?://localhost(?::\\d+)?[^\\s)\\]\"'<>]*",
6
- "https?://(?:[a-z0-9-]+\\.)*your[-_]?domain\\.[a-z]+\\b[^\\s)\\]\"'<>]*",
7
- "https?://acme\\.blode\\.md\\b[^\\s)\\]\"'<>]*",
8
- "https?://github\\.com/example/[^\\s)\\]\"'<>]*",
9
- "https?://(?:us|eu)\\.i\\.posthog\\.com\\b[^\\s)\\]\"'<>]*",
10
- ].join("|");
11
- const PLACEHOLDER_URL_RE = new RegExp(PLACEHOLDER_URL_PATTERN, "gi");
12
- const PLACEHOLDER_MARKDOWN_LINK_RE = new RegExp(`\\[([^\\]]+)\\]\\((?:${PLACEHOLDER_URL_PATTERN})\\)`, "gi");
13
- const INTERNAL_MARKDOWN_LINK_RE = /(!?\[[^\]]+\])\((\/[^)\s]*)\)/g;
14
- const defangUrl = (value) => value.replace(/^https?:\/\//i, "");
15
- export const sanitizePlaceholderUrls = (text) => text
16
- .replace(PLACEHOLDER_MARKDOWN_LINK_RE, "$1")
17
- .replace(PLACEHOLDER_URL_RE, (match) => `\`${defangUrl(match)}\``);
18
- export const absolutiseInternalLinks = (source, origin, basePath) => {
19
- const normalizedBase = basePath
20
- ? `/${basePath}`.replaceAll(/\/+/g, "/").replace(/\/$/, "")
21
- : "";
22
- return source.replaceAll(INTERNAL_MARKDOWN_LINK_RE, (_match, label, linkPath) => {
23
- const alreadyPrefixed = normalizedBase &&
24
- (linkPath === normalizedBase ||
25
- linkPath.startsWith(`${normalizedBase}/`));
26
- const absolutePath = alreadyPrefixed
27
- ? linkPath
28
- : `${normalizedBase}${linkPath}`.replaceAll(/\/+/g, "/");
29
- return `${label}(${origin}${absolutePath})`;
30
- });
31
- };
@@ -1,7 +0,0 @@
1
- import type { CollectionConfig, SiteConfig } from "@repo/models";
2
- import type { OpenApiOperation } from "@repo/prebuild";
3
- import type { ContentSource } from "./content-source.js";
4
- import type { UtilityPage } from "./types.js";
5
- export declare const formatOpenApiPageContent: (operation: OpenApiOperation) => string;
6
- export declare const buildUtilityOpenApiPages: (config: SiteConfig, collection: CollectionConfig | undefined, source: ContentSource) => Promise<UtilityPage[]>;
7
- //# sourceMappingURL=openapi-pages.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"openapi-pages.d.ts","sourceRoot":"","sources":["../src/openapi-pages.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,gBAAgB,EAEhB,UAAU,EACX,MAAM,cAAc,CAAC;AAOtB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAwH9C,eAAO,MAAM,wBAAwB,GACnC,WAAW,gBAAgB,KAC1B,MA0BF,CAAC;AA6EF,eAAO,MAAM,wBAAwB,GACnC,QAAQ,UAAU,EAClB,YAAY,gBAAgB,GAAG,SAAS,EACxC,QAAQ,aAAa,2BA0EtB,CAAC"}
@@ -1,200 +0,0 @@
1
- import { ensureArray, normalizePath } from "@repo/common";
2
- import { extractOpenApiOperations, openApiIdentifier, openApiSlug, parseOpenApiSpec, } from "@repo/prebuild";
3
- import { getDocsNavigation } from "./config-loader.js";
4
- const getOpenApiSourceKey = (source) => `${source.source}::${source.directory ?? ""}::${(source.include ?? []).join("|")}`;
5
- const toOpenApiSourceObject = (value) => {
6
- if (typeof value === "string") {
7
- return { source: value };
8
- }
9
- return value;
10
- };
11
- const collectOpenApiSources = (collection) => {
12
- const sources = [];
13
- for (const item of ensureArray(collection?.openapi)) {
14
- if (!item) {
15
- continue;
16
- }
17
- sources.push(toOpenApiSourceObject(item));
18
- }
19
- const groups = collection?.navigation?.groups ?? [];
20
- for (const group of groups) {
21
- if (!group.openapi) {
22
- continue;
23
- }
24
- sources.push(toOpenApiSourceObject(group.openapi));
25
- }
26
- const seen = new Set();
27
- return sources.filter((source) => {
28
- const key = getOpenApiSourceKey(source);
29
- if (seen.has(key)) {
30
- return false;
31
- }
32
- seen.add(key);
33
- return true;
34
- });
35
- };
36
- const getSchemaTypeLabel = (schema) => {
37
- if (!schema || typeof schema !== "object") {
38
- return "any";
39
- }
40
- const record = schema;
41
- if (typeof record.$ref === "string") {
42
- const last = record.$ref.split("/").pop();
43
- return last ?? "object";
44
- }
45
- if (typeof record.type === "string") {
46
- if (record.type === "array" && record.items) {
47
- return `${getSchemaTypeLabel(record.items)}[]`;
48
- }
49
- return record.type;
50
- }
51
- if (Array.isArray(record.oneOf) || Array.isArray(record.anyOf)) {
52
- const variants = (record.oneOf ?? record.anyOf);
53
- return variants.map(getSchemaTypeLabel).join(" | ");
54
- }
55
- return "object";
56
- };
57
- const formatParameterLine = (parameter) => {
58
- const name = String(parameter.name ?? "");
59
- const location = parameter.in ? ` (${parameter.in})` : "";
60
- const required = parameter.required ? "required" : "optional";
61
- const type = getSchemaTypeLabel(parameter.schema);
62
- const description = typeof parameter.description === "string" && parameter.description
63
- ? ` - ${parameter.description.split("\n")[0]}`
64
- : "";
65
- return `- \`${name}\`${location}: ${type}, ${required}${description}`;
66
- };
67
- const formatRequestBody = (body) => {
68
- const required = body.required ? "required" : "optional";
69
- const content = body.content ?? {};
70
- const mediaTypes = Object.keys(content);
71
- if (mediaTypes.length === 0) {
72
- return `${required} body`;
73
- }
74
- return mediaTypes
75
- .map((mediaType) => {
76
- const mediaEntry = content[mediaType];
77
- const schemaLabel = getSchemaTypeLabel(mediaEntry?.schema);
78
- return `- ${mediaType} (${required}): ${schemaLabel}`;
79
- })
80
- .join("\n");
81
- };
82
- const formatResponses = (responses) => Object.entries(responses)
83
- .map(([status, value]) => {
84
- const response = value ?? {};
85
- const description = typeof response.description === "string" && response.description
86
- ? response.description.split("\n")[0]
87
- : "";
88
- const content = response.content ?? {};
89
- const mediaTypes = Object.keys(content);
90
- const mediaSuffix = mediaTypes.length
91
- ? ` [${mediaTypes.join(", ")}]`
92
- : "";
93
- return `- ${status}${mediaSuffix}${description ? ` - ${description}` : ""}`;
94
- })
95
- .join("\n");
96
- export const formatOpenApiPageContent = (operation) => {
97
- const parts = [`Method: ${operation.method}`, `Path: ${operation.path}`];
98
- if (operation.description) {
99
- parts.push(operation.description);
100
- }
101
- if (operation.tags.length) {
102
- parts.push(`Tags: ${operation.tags.join(", ")}`);
103
- }
104
- if (operation.parameters.length) {
105
- parts.push(`## Parameters\n\n${operation.parameters
106
- .map(formatParameterLine)
107
- .join("\n")}`);
108
- }
109
- if (operation.requestBody) {
110
- parts.push(`## Request body\n\n${formatRequestBody(operation.requestBody)}`);
111
- }
112
- if (operation.responses) {
113
- parts.push(`## Responses\n\n${formatResponses(operation.responses)}`);
114
- }
115
- return parts.join("\n\n");
116
- };
117
- const getGroupedOpenApiSourceKey = (source) => getOpenApiSourceKey(toOpenApiSourceObject(source));
118
- const collectUtilityOpenApiPages = (pagesByIdentifier, pagesBySource, operations, directory, openApiSource, slugPrefix) => {
119
- const sourceKey = getOpenApiSourceKey(openApiSource);
120
- const includeIdentifiers = openApiSource.include?.length
121
- ? new Set(openApiSource.include)
122
- : null;
123
- for (const operation of operations) {
124
- const identifier = openApiIdentifier(operation.method, operation.path);
125
- if (includeIdentifiers && !includeIdentifiers.has(identifier)) {
126
- continue;
127
- }
128
- const baseSlug = normalizePath(openApiSlug(operation.method, operation.path, directory));
129
- const slug = slugPrefix
130
- ? normalizePath(`${slugPrefix}/${baseSlug}`)
131
- : baseSlug;
132
- const page = {
133
- content: formatOpenApiPageContent(operation),
134
- description: operation.description,
135
- identifier,
136
- slug,
137
- sourceKey,
138
- title: operation.summary ?? identifier,
139
- };
140
- pagesByIdentifier.set(identifier, page);
141
- if (!pagesBySource.has(sourceKey)) {
142
- pagesBySource.set(sourceKey, []);
143
- }
144
- pagesBySource.get(sourceKey)?.push(page);
145
- }
146
- };
147
- const addUtilityPagesFromSourceKey = (pages, pagesBySource, sourceKey) => {
148
- for (const page of pagesBySource.get(sourceKey) ?? []) {
149
- pages.set(page.slug, page);
150
- }
151
- };
152
- const addReferencedUtilityPages = (pages, pagesByIdentifier, pageReferences, hiddenPages, groupHidden = false) => {
153
- for (const pageReference of pageReferences ?? []) {
154
- if (groupHidden || hiddenPages.has(pageReference)) {
155
- continue;
156
- }
157
- const page = pagesByIdentifier.get(pageReference);
158
- if (page) {
159
- pages.set(page.slug, page);
160
- }
161
- }
162
- };
163
- export const buildUtilityOpenApiPages = async (config, collection, source) => {
164
- if (!collection || collection.type !== "docs") {
165
- return [];
166
- }
167
- const docsNavigation = getDocsNavigation(config);
168
- const hiddenPages = new Set(docsNavigation?.hidden);
169
- const slugPrefix = normalizePath(collection.slugPrefix ?? "");
170
- const byIdentifier = new Map();
171
- const bySource = new Map();
172
- const pages = new Map();
173
- const sources = collectOpenApiSources(collection);
174
- const resolved = await Promise.all(sources.map(async (item) => {
175
- const rawSpec = await source.readFile(item.source);
176
- const spec = parseOpenApiSpec(rawSpec, item.source);
177
- const directory = item.directory ?? "api";
178
- const { operations } = extractOpenApiOperations(spec, directory);
179
- return { directory, operations, source: item };
180
- }));
181
- for (const { directory, operations, source: openApiSource } of resolved) {
182
- collectUtilityOpenApiPages(byIdentifier, bySource, operations, directory, openApiSource, slugPrefix);
183
- }
184
- for (const openApiSource of ensureArray(collection.openapi)) {
185
- if (!openApiSource) {
186
- continue;
187
- }
188
- addUtilityPagesFromSourceKey(pages, bySource, getGroupedOpenApiSourceKey(openApiSource));
189
- }
190
- for (const group of docsNavigation?.groups ?? []) {
191
- const groupHidden = group.hidden === true;
192
- addReferencedUtilityPages(pages, byIdentifier, group.pages, hiddenPages, groupHidden);
193
- if (groupHidden || !group.openapi) {
194
- continue;
195
- }
196
- addUtilityPagesFromSourceKey(pages, bySource, getGroupedOpenApiSourceKey(group.openapi));
197
- }
198
- addReferencedUtilityPages(pages, byIdentifier, docsNavigation?.pages, hiddenPages);
199
- return [...pages.values()];
200
- };
@@ -1,4 +0,0 @@
1
- import type { SiteConfig } from "@repo/models";
2
- import type { ContentIndex, SearchIndexItem, UtilityIndex } from "./types.js";
3
- export declare const buildSearchIndex: (index: ContentIndex, config: SiteConfig, utilityIndex?: UtilityIndex) => SearchIndexItem[];
4
- //# sourceMappingURL=search-index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"search-index.d.ts","sourceRoot":"","sources":["../src/search-index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAM/C,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE9E,eAAO,MAAM,gBAAgB,GAC3B,OAAO,YAAY,EACnB,QAAQ,UAAU,EAClB,eAAe,YAAY,KAC1B,eAAe,EAyBjB,CAAC"}
@@ -1,23 +0,0 @@
1
- import { buildPageMetadataMap, shouldIncludeSearchEntry, } from "./content-index.js";
2
- export const buildSearchIndex = (index, config, utilityIndex) => {
3
- const pageMetadataMap = buildPageMetadataMap(index);
4
- const items = new Map();
5
- for (const page of utilityIndex?.pages ?? []) {
6
- items.set(page.slug, {
7
- path: page.slug,
8
- title: page.title,
9
- });
10
- }
11
- for (const entry of index.entries) {
12
- if (!shouldIncludeSearchEntry(entry, pageMetadataMap, config)) {
13
- continue;
14
- }
15
- const pageMeta = pageMetadataMap.get(entry.slug);
16
- items.set(entry.slug, {
17
- href: pageMeta?.url,
18
- path: entry.slug,
19
- title: pageMeta?.sidebarTitle ?? entry.title,
20
- });
21
- }
22
- return [...items.values()];
23
- };
@@ -1,13 +0,0 @@
1
- import type { ContentSource } from "./content-source.js";
2
- import type { ContentIndex, PrebuiltOpenApiEntry, SearchIndexItem, TocItem, UtilityIndex } from "./types.js";
3
- export declare const serializeContentIndex: (index: ContentIndex) => string;
4
- export declare const serializeOpenApiIndex: (entries: PrebuiltOpenApiEntry[]) => string;
5
- export declare const loadPrebuiltContentIndex: (source: ContentSource) => Promise<ContentIndex | null>;
6
- export declare const loadPrebuiltOpenApiIndex: (source: ContentSource) => Promise<PrebuiltOpenApiEntry[] | null>;
7
- export declare const serializeSearchIndex: (items: SearchIndexItem[]) => string;
8
- export declare const loadPrebuiltSearchIndex: (source: ContentSource) => Promise<SearchIndexItem[] | null>;
9
- export declare const serializeTocIndex: (itemsBySlug: Map<string, TocItem[]>) => string;
10
- export declare const loadPrebuiltTocIndex: (source: ContentSource) => Promise<Map<string, TocItem[]> | null>;
11
- export declare const serializeUtilityIndex: (index: UtilityIndex) => string;
12
- export declare const loadPrebuiltUtilityIndex: (source: ContentSource) => Promise<UtilityIndex | null>;
13
- //# sourceMappingURL=serialization.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"serialization.d.ts","sourceRoot":"","sources":["../src/serialization.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAEV,YAAY,EACZ,oBAAoB,EACpB,eAAe,EACf,OAAO,EACP,YAAY,EAGb,MAAM,YAAY,CAAC;AAgCpB,eAAO,MAAM,qBAAqB,GAAI,OAAO,YAAY,KAAG,MAKvB,CAAC;AAEtC,eAAO,MAAM,qBAAqB,GAChC,SAAS,oBAAoB,EAAE,KAC9B,MAIkC,CAAC;AAEtC,eAAO,MAAM,wBAAwB,GACnC,QAAQ,aAAa,KACpB,OAAO,CAAC,YAAY,GAAG,IAAI,CA8B7B,CAAC;AAEF,eAAO,MAAM,wBAAwB,GACnC,QAAQ,aAAa,KACpB,OAAO,CAAC,oBAAoB,EAAE,GAAG,IAAI,CAYvC,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,OAAO,eAAe,EAAE,KAAG,MAI5B,CAAC;AAErC,eAAO,MAAM,uBAAuB,GAClC,QAAQ,aAAa,KACpB,OAAO,CAAC,eAAe,EAAE,GAAG,IAAI,CAYlC,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAC5B,aAAa,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,KAClC,MAI8B,CAAC;AAElC,eAAO,MAAM,oBAAoB,GAC/B,QAAQ,aAAa,KACpB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,IAAI,CAYvC,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,OAAO,YAAY,KAAG,MAIvB,CAAC;AAEtC,eAAO,MAAM,wBAAwB,GACnC,QAAQ,aAAa,KACpB,OAAO,CAAC,YAAY,GAAG,IAAI,CAsB7B,CAAC"}