@takazudo/zudo-doc 3.3.0 → 4.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 (423) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/README.md +2 -2
  3. package/bin/tag-cli-config.ts +126 -0
  4. package/bin/tags-audit-runner.ts +60 -76
  5. package/bin/tags-audit.mjs +17 -36
  6. package/bin/tags-suggest-runner.ts +429 -0
  7. package/bin/tags-suggest.mjs +30 -0
  8. package/bin/zudo-doc.mjs +78 -25
  9. package/dist/breadcrumb/breadcrumb.d.ts +4 -4
  10. package/dist/breadcrumb/find-path.d.ts +2 -2
  11. package/dist/breadcrumb/index.d.ts +1 -1
  12. package/dist/breadcrumb/types.d.ts +0 -5
  13. package/dist/chrome/derive.d.ts +16 -10
  14. package/dist/chrome/derive.js +53 -4
  15. package/dist/chrome/index.d.ts +13 -10
  16. package/dist/chrome/index.js +12 -6
  17. package/dist/chrome/primary-slots.d.ts +21 -0
  18. package/dist/chrome/primary-slots.js +59 -0
  19. package/dist/chrome-bindings.d.ts +68 -0
  20. package/dist/code-syntax/code-block-enhancer-script.d.ts +4 -0
  21. package/dist/code-syntax/code-block-enhancer-script.js +7 -4
  22. package/dist/code-syntax/code-block-enhancer.d.ts +2 -2
  23. package/dist/code-syntax/code-block-enhancer.js +1 -3
  24. package/dist/code-syntax/index.d.ts +5 -5
  25. package/dist/code-syntax/index.js +4 -13
  26. package/dist/code-syntax/mermaid-init-script.d.ts +1 -22
  27. package/dist/code-syntax/mermaid-init-script.js +0 -2
  28. package/dist/code-syntax/mermaid-init.d.ts +0 -1
  29. package/dist/code-syntax/mermaid-init.js +3 -4
  30. package/dist/code-syntax/tabs-init.d.ts +0 -1
  31. package/dist/code-syntax/tabs-init.js +1 -3
  32. package/dist/code-syntax/tabs.d.ts +0 -1
  33. package/dist/code-syntax/tabs.js +1 -3
  34. package/dist/color-scheme-utils.d.ts +71 -3
  35. package/dist/color-scheme-utils.js +137 -0
  36. package/dist/color-schemes-defaults/index.js +13 -0
  37. package/dist/config/component-tokens.d.ts +1 -1
  38. package/dist/config/component-tokens.js +104 -5
  39. package/dist/config.d.ts +28 -12
  40. package/dist/config.js +11 -2
  41. package/dist/content/component-map.d.ts +0 -16
  42. package/dist/content/component-map.js +2 -4
  43. package/dist/content/index.d.ts +1 -1
  44. package/dist/content/index.js +2 -3
  45. package/dist/content.css +1 -1
  46. package/dist/design-token-panel-bootstrap.d.ts +45 -40
  47. package/dist/design-token-panel-bootstrap.js +98 -21
  48. package/dist/design-token-panel-config/index.js +1 -4
  49. package/dist/doc-body-end-islands/design-token-panel-island.d.ts +15 -0
  50. package/dist/doc-body-end-islands/design-token-panel-island.js +31 -0
  51. package/dist/doc-body-end-islands/index.d.ts +39 -17
  52. package/dist/doc-body-end-islands/index.js +13 -21
  53. package/dist/doc-body-end-islands/theme-pack-switcher-island.d.ts +37 -0
  54. package/dist/doc-body-end-islands/theme-pack-switcher-island.js +18 -0
  55. package/dist/doc-content-header/index.js +1 -1
  56. package/dist/doc-history-area/index.d.ts +10 -4
  57. package/dist/doc-history-area/index.js +3 -2
  58. package/dist/doc-metainfo-area/index.d.ts +1 -0
  59. package/dist/doc-page-props/index.d.ts +7 -23
  60. package/dist/doc-page-renderer/index.d.ts +1 -0
  61. package/dist/doc-page-renderer/index.js +1 -0
  62. package/dist/doc-page-shell/index.js +19 -12
  63. package/dist/doc-pager/index.js +1 -1
  64. package/dist/doc-route-entries/index.d.ts +2 -2
  65. package/dist/doclayout/doc-layout-with-defaults.js +4 -4
  66. package/dist/doclayout/doc-layout.d.ts +8 -0
  67. package/dist/doclayout/doc-layout.js +10 -1
  68. package/dist/docs-schema/index.js +1 -5
  69. package/dist/eject/index.d.ts +16 -0
  70. package/dist/eject/index.js +122 -28
  71. package/dist/extract-headings/index.d.ts +5 -8
  72. package/dist/extract-headings/index.js +2 -9
  73. package/dist/factory-context/index.d.ts +42 -4
  74. package/dist/features.css +80 -45
  75. package/dist/footer/footer.js +1 -0
  76. package/dist/head-with-defaults/index.d.ts +2 -0
  77. package/dist/head-with-defaults/index.js +16 -0
  78. package/dist/header/header.d.ts +10 -5
  79. package/dist/header/header.js +45 -5
  80. package/dist/header/index.d.ts +1 -1
  81. package/dist/header/types.d.ts +30 -1
  82. package/dist/header-with-defaults/index.js +1 -0
  83. package/dist/home-page/index.d.ts +2 -0
  84. package/dist/home-page/index.js +11 -5
  85. package/dist/home-page/prepare-home-data.js +1 -1
  86. package/dist/locale-merge/index.d.ts +9 -14
  87. package/dist/locale-merge/index.js +6 -4
  88. package/dist/mdx-components/index.js +4 -4
  89. package/dist/plugins/claude-resources.d.ts +1 -0
  90. package/dist/plugins/claude-resources.js +4 -2
  91. package/dist/plugins/doc-history.js +1 -1
  92. package/dist/{integrations → plugins/internal}/claude-resources/index.d.ts +1 -16
  93. package/dist/{integrations → plugins/internal}/claude-resources/index.js +0 -9
  94. package/dist/{integrations → plugins/internal}/doc-history/index.d.ts +0 -17
  95. package/dist/{integrations → plugins/internal}/doc-history/index.js +0 -4
  96. package/dist/{integrations → plugins/internal}/doc-history/pre-build.d.ts +2 -4
  97. package/dist/plugins/internal/llms-txt/index.d.ts +7 -0
  98. package/dist/{integrations → plugins/internal}/llms-txt/load.d.ts +1 -1
  99. package/dist/{integrations → plugins/internal}/llms-txt/load.js +2 -2
  100. package/dist/{integrations → plugins/internal}/llms-txt/strip.d.ts +2 -3
  101. package/dist/{integrations → plugins/internal}/llms-txt/strip.js +1 -1
  102. package/dist/{integrations → plugins/internal}/llms-txt/types.d.ts +13 -22
  103. package/dist/{integrations → plugins/internal}/search-index/collect.js +1 -1
  104. package/dist/plugins/internal/theme-packs/copy.d.ts +32 -0
  105. package/dist/plugins/internal/theme-packs/copy.js +45 -0
  106. package/dist/plugins/internal/theme-packs/dev-middleware.d.ts +22 -0
  107. package/dist/plugins/internal/theme-packs/dev-middleware.js +80 -0
  108. package/dist/plugins/internal/theme-packs/index.d.ts +6 -0
  109. package/dist/plugins/internal/theme-packs/index.js +9 -0
  110. package/dist/plugins/internal/theme-packs/resolve.d.ts +17 -0
  111. package/dist/plugins/internal/theme-packs/resolve.js +17 -0
  112. package/dist/plugins/internal/theme-packs/types.d.ts +22 -0
  113. package/dist/plugins/internal/theme-packs/types.js +0 -0
  114. package/dist/plugins/llms-txt.js +1 -1
  115. package/dist/plugins/routes.js +11 -1
  116. package/dist/plugins/search-index.js +1 -1
  117. package/dist/plugins/theme-packs.d.ts +3 -0
  118. package/dist/plugins/theme-packs.js +40 -0
  119. package/dist/preset.d.ts +19 -14
  120. package/dist/preset.js +24 -9
  121. package/dist/route-context/index.js +4 -6
  122. package/dist/route-enumerators/index.d.ts +6 -18
  123. package/dist/route-enumerators/index.js +8 -6
  124. package/dist/routes/404.js +3 -1
  125. package/dist/routes/_chrome.js +2 -2
  126. package/dist/routes/_context.d.ts +7 -3
  127. package/dist/routes/_context.js +2 -0
  128. package/dist/routes/_docs-helpers.js +9 -21
  129. package/dist/safelist.css +1 -1
  130. package/dist/settings.d.ts +27 -12
  131. package/dist/sidebar-toggle-island/index.js +1 -0
  132. package/dist/sidebar-tree/build-tree.d.ts +3 -4
  133. package/dist/sidebar-tree/build-tree.js +4 -3
  134. package/dist/sidebar-tree/index.d.ts +2 -2
  135. package/dist/sidebar-tree/types.d.ts +6 -17
  136. package/dist/site-tree-nav-island/index.d.ts +3 -1
  137. package/dist/site-tree-nav-island/index.js +17 -5
  138. package/dist/site-tree-nav-island/state.d.ts +4 -0
  139. package/dist/site-tree-nav-island/state.js +10 -0
  140. package/dist/tag-helpers/index.d.ts +6 -13
  141. package/dist/tag-helpers/index.js +5 -23
  142. package/dist/tag-pages/index.d.ts +8 -21
  143. package/dist/tag-pages/index.js +14 -10
  144. package/dist/tags-audit.d.ts +16 -44
  145. package/dist/tags-audit.js +9 -172
  146. package/dist/theme/color-scheme-provider.d.ts +2 -3
  147. package/dist/theme/color-scheme-provider.js +2 -10
  148. package/dist/theme/index.d.ts +1 -4
  149. package/dist/theme/index.js +2 -30
  150. package/dist/theme/theme-pack-provider.d.ts +42 -0
  151. package/dist/theme/theme-pack-provider.js +75 -0
  152. package/dist/theme-cli/apply.d.ts +16 -0
  153. package/dist/theme-cli/apply.js +61 -0
  154. package/dist/theme-cli/config-io.d.ts +15 -0
  155. package/dist/theme-cli/config-io.js +51 -0
  156. package/dist/theme-cli/config-rewriter.d.ts +21 -0
  157. package/dist/theme-cli/config-rewriter.js +141 -0
  158. package/dist/theme-cli/config-scanner.d.ts +63 -0
  159. package/dist/theme-cli/config-scanner.js +288 -0
  160. package/dist/theme-cli/index.d.ts +7 -0
  161. package/dist/theme-cli/index.js +38 -0
  162. package/dist/theme-cli/list.d.ts +27 -0
  163. package/dist/theme-cli/list.js +64 -0
  164. package/dist/theme-cli/provenance.d.ts +17 -0
  165. package/dist/theme-cli/provenance.js +35 -0
  166. package/dist/theme-cli/registry.d.ts +14 -0
  167. package/dist/theme-cli/registry.js +13 -0
  168. package/dist/theme-pack-dialog/dialog-state.d.ts +25 -0
  169. package/dist/theme-pack-dialog/dialog-state.js +40 -0
  170. package/dist/theme-pack-dialog/index.d.ts +5 -0
  171. package/dist/theme-pack-dialog/index.js +152 -0
  172. package/dist/theme-pack-dialog/theme-pack-card.d.ts +25 -0
  173. package/dist/theme-pack-dialog/theme-pack-card.js +72 -0
  174. package/dist/theme-pack-switcher/index.d.ts +49 -0
  175. package/dist/theme-pack-switcher/index.js +205 -0
  176. package/dist/theme-pack-switcher/switcher-state.d.ts +56 -0
  177. package/dist/theme-pack-switcher/switcher-state.js +43 -0
  178. package/dist/theme-pack-switcher/theme-pack-sync.d.ts +85 -0
  179. package/dist/theme-pack-switcher/theme-pack-sync.js +121 -0
  180. package/dist/theme-packs/beacon/fonts/AtkinsonHyperlegible-400-latin.woff2 +0 -0
  181. package/dist/theme-packs/beacon/fonts/AtkinsonHyperlegible-700-latin.woff2 +0 -0
  182. package/dist/theme-packs/beacon/fonts/AtkinsonHyperlegible-italic-400-latin.woff2 +0 -0
  183. package/dist/theme-packs/beacon/fonts/AtkinsonHyperlegible-italic-700-latin.woff2 +0 -0
  184. package/dist/theme-packs/beacon/fonts/AtkinsonHyperlegibleMono-italic-latin.woff2 +0 -0
  185. package/dist/theme-packs/beacon/fonts/AtkinsonHyperlegibleMono-latin.woff2 +0 -0
  186. package/dist/theme-packs/beacon/fonts/OFL.txt +94 -0
  187. package/dist/theme-packs/beacon/meta.json +37 -0
  188. package/dist/theme-packs/beacon/pack.css +442 -0
  189. package/dist/theme-packs/broadsheet/fonts/CourierPrime-400-latin.woff2 +0 -0
  190. package/dist/theme-packs/broadsheet/fonts/CourierPrime-700-latin.woff2 +0 -0
  191. package/dist/theme-packs/broadsheet/fonts/OFL.txt +95 -0
  192. package/dist/theme-packs/broadsheet/fonts/PlayfairDisplay-italic-latin.woff2 +0 -0
  193. package/dist/theme-packs/broadsheet/fonts/PlayfairDisplay-latin.woff2 +0 -0
  194. package/dist/theme-packs/broadsheet/fonts/SourceSerif4-italic-latin.woff2 +0 -0
  195. package/dist/theme-packs/broadsheet/fonts/SourceSerif4-latin.woff2 +0 -0
  196. package/dist/theme-packs/broadsheet/meta.json +38 -0
  197. package/dist/theme-packs/broadsheet/pack.css +448 -0
  198. package/dist/theme-packs/brutalist/fonts/ArchivoBlack-latin.woff2 +0 -0
  199. package/dist/theme-packs/brutalist/fonts/IBMPlexMono-400-latin.woff2 +0 -0
  200. package/dist/theme-packs/brutalist/fonts/IBMPlexMono-500-latin.woff2 +0 -0
  201. package/dist/theme-packs/brutalist/fonts/IBMPlexMono-700-latin.woff2 +0 -0
  202. package/dist/theme-packs/brutalist/fonts/OFL.txt +95 -0
  203. package/dist/theme-packs/brutalist/fonts/SpaceGrotesk-latin.woff2 +0 -0
  204. package/dist/theme-packs/brutalist/meta.json +38 -0
  205. package/dist/theme-packs/brutalist/pack.css +546 -0
  206. package/dist/theme-packs/default/meta.json +37 -0
  207. package/dist/theme-packs/drift/fonts/IBMPlexMono-400-latin-ext.woff2 +0 -0
  208. package/dist/theme-packs/drift/fonts/IBMPlexMono-400-latin.woff2 +0 -0
  209. package/dist/theme-packs/drift/fonts/IBMPlexMono-500-latin-ext.woff2 +0 -0
  210. package/dist/theme-packs/drift/fonts/IBMPlexMono-500-latin.woff2 +0 -0
  211. package/dist/theme-packs/drift/fonts/IBMPlexSans-italic-latin.woff2 +0 -0
  212. package/dist/theme-packs/drift/fonts/IBMPlexSans-latin-ext.woff2 +0 -0
  213. package/dist/theme-packs/drift/fonts/IBMPlexSans-latin.woff2 +0 -0
  214. package/dist/theme-packs/drift/fonts/OFL.txt +93 -0
  215. package/dist/theme-packs/drift/meta.json +37 -0
  216. package/dist/theme-packs/drift/pack.css +478 -0
  217. package/dist/theme-packs/fjord/fonts/Inter-latin-ext.woff2 +0 -0
  218. package/dist/theme-packs/fjord/fonts/Inter-latin.woff2 +0 -0
  219. package/dist/theme-packs/fjord/fonts/JetBrainsMono-latin-ext.woff2 +0 -0
  220. package/dist/theme-packs/fjord/fonts/JetBrainsMono-latin.woff2 +0 -0
  221. package/dist/theme-packs/fjord/fonts/OFL.txt +94 -0
  222. package/dist/theme-packs/fjord/meta.json +37 -0
  223. package/dist/theme-packs/fjord/pack.css +375 -0
  224. package/dist/theme-packs/foundry/fonts/Inter-latin-ext.woff2 +0 -0
  225. package/dist/theme-packs/foundry/fonts/Inter-latin.woff2 +0 -0
  226. package/dist/theme-packs/foundry/fonts/OFL.txt +93 -0
  227. package/dist/theme-packs/foundry/meta.json +37 -0
  228. package/dist/theme-packs/foundry/pack.css +202 -0
  229. package/dist/theme-packs/futura-editorial/fonts/Jost-latin.woff2 +0 -0
  230. package/dist/theme-packs/futura-editorial/fonts/NotoSans-italic-latin.woff2 +0 -0
  231. package/dist/theme-packs/futura-editorial/fonts/NotoSans-latin.woff2 +0 -0
  232. package/dist/theme-packs/futura-editorial/fonts/OFL.txt +95 -0
  233. package/dist/theme-packs/futura-editorial/fonts/SpaceMono-400-latin.woff2 +0 -0
  234. package/dist/theme-packs/futura-editorial/fonts/SpaceMono-700-latin.woff2 +0 -0
  235. package/dist/theme-packs/futura-editorial/meta.json +38 -0
  236. package/dist/theme-packs/futura-editorial/pack.css +313 -0
  237. package/dist/theme-packs/hearth/fonts/Fraunces-italic-latin.woff2 +0 -0
  238. package/dist/theme-packs/hearth/fonts/Fraunces-latin.woff2 +0 -0
  239. package/dist/theme-packs/hearth/fonts/Nunito-latin.woff2 +0 -0
  240. package/dist/theme-packs/hearth/fonts/OFL.txt +95 -0
  241. package/dist/theme-packs/hearth/fonts/SplineSansMono-latin.woff2 +0 -0
  242. package/dist/theme-packs/hearth/meta.json +38 -0
  243. package/dist/theme-packs/hearth/pack.css +385 -0
  244. package/dist/theme-packs/hollow/fonts/OFL.txt +94 -0
  245. package/dist/theme-packs/hollow/fonts/SpaceGrotesk-latin.woff2 +0 -0
  246. package/dist/theme-packs/hollow/fonts/SpaceMono-400-italic-latin.woff2 +0 -0
  247. package/dist/theme-packs/hollow/fonts/SpaceMono-400-latin.woff2 +0 -0
  248. package/dist/theme-packs/hollow/fonts/SpaceMono-700-latin.woff2 +0 -0
  249. package/dist/theme-packs/hollow/meta.json +37 -0
  250. package/dist/theme-packs/hollow/pack.css +428 -0
  251. package/dist/theme-packs/ledger/fonts/CrimsonPro-latin-ext-italic.woff2 +0 -0
  252. package/dist/theme-packs/ledger/fonts/CrimsonPro-latin-ext.woff2 +0 -0
  253. package/dist/theme-packs/ledger/fonts/CrimsonPro-latin-italic.woff2 +0 -0
  254. package/dist/theme-packs/ledger/fonts/CrimsonPro-latin.woff2 +0 -0
  255. package/dist/theme-packs/ledger/fonts/IBMPlexMono-400-latin-ext.woff2 +0 -0
  256. package/dist/theme-packs/ledger/fonts/IBMPlexMono-400-latin.woff2 +0 -0
  257. package/dist/theme-packs/ledger/fonts/IBMPlexMono-500-latin-ext.woff2 +0 -0
  258. package/dist/theme-packs/ledger/fonts/IBMPlexMono-500-latin.woff2 +0 -0
  259. package/dist/theme-packs/ledger/fonts/OFL.txt +94 -0
  260. package/dist/theme-packs/ledger/meta.json +37 -0
  261. package/dist/theme-packs/ledger/pack.css +463 -0
  262. package/dist/theme-packs/manuscript/fonts/CourierPrime-400-latin-ext.woff2 +0 -0
  263. package/dist/theme-packs/manuscript/fonts/CourierPrime-400-latin.woff2 +0 -0
  264. package/dist/theme-packs/manuscript/fonts/CourierPrime-700-latin-ext.woff2 +0 -0
  265. package/dist/theme-packs/manuscript/fonts/CourierPrime-700-latin.woff2 +0 -0
  266. package/dist/theme-packs/manuscript/fonts/EBGaramond-latin-italic.woff2 +0 -0
  267. package/dist/theme-packs/manuscript/fonts/EBGaramond-latin.woff2 +0 -0
  268. package/dist/theme-packs/manuscript/fonts/OFL.txt +94 -0
  269. package/dist/theme-packs/manuscript/meta.json +37 -0
  270. package/dist/theme-packs/manuscript/pack.css +376 -0
  271. package/dist/theme-packs/matcha/fonts/MPLUS1Code-latin.woff2 +0 -0
  272. package/dist/theme-packs/matcha/fonts/OFL.txt +95 -0
  273. package/dist/theme-packs/matcha/fonts/ShipporiMincho-500-latin.woff2 +0 -0
  274. package/dist/theme-packs/matcha/fonts/ShipporiMincho-700-latin.woff2 +0 -0
  275. package/dist/theme-packs/matcha/fonts/ZenKakuGothicNew-400-latin.woff2 +0 -0
  276. package/dist/theme-packs/matcha/fonts/ZenKakuGothicNew-500-latin.woff2 +0 -0
  277. package/dist/theme-packs/matcha/meta.json +38 -0
  278. package/dist/theme-packs/matcha/pack.css +409 -0
  279. package/dist/theme-packs/nocturne/fonts/CormorantGaramond-italic-latin.woff2 +0 -0
  280. package/dist/theme-packs/nocturne/fonts/CormorantGaramond-latin.woff2 +0 -0
  281. package/dist/theme-packs/nocturne/fonts/IBMPlexMono-400-latin.woff2 +0 -0
  282. package/dist/theme-packs/nocturne/fonts/IBMPlexMono-500-latin.woff2 +0 -0
  283. package/dist/theme-packs/nocturne/fonts/IBMPlexMono-italic-latin.woff2 +0 -0
  284. package/dist/theme-packs/nocturne/fonts/Manrope-latin.woff2 +0 -0
  285. package/dist/theme-packs/nocturne/fonts/OFL.txt +95 -0
  286. package/dist/theme-packs/nocturne/meta.json +38 -0
  287. package/dist/theme-packs/nocturne/pack.css +502 -0
  288. package/dist/theme-packs/observatory/fonts/JosefinSans-latin.woff2 +0 -0
  289. package/dist/theme-packs/observatory/fonts/Jost-italic-latin.woff2 +0 -0
  290. package/dist/theme-packs/observatory/fonts/Jost-latin.woff2 +0 -0
  291. package/dist/theme-packs/observatory/fonts/OFL.txt +95 -0
  292. package/dist/theme-packs/observatory/fonts/SpaceMono-400-latin.woff2 +0 -0
  293. package/dist/theme-packs/observatory/fonts/SpaceMono-700-latin.woff2 +0 -0
  294. package/dist/theme-packs/observatory/fonts/SpaceMono-italic-latin.woff2 +0 -0
  295. package/dist/theme-packs/observatory/meta.json +38 -0
  296. package/dist/theme-packs/observatory/pack.css +728 -0
  297. package/dist/theme-packs/onyx/fonts/CormorantGaramond-italic-latin.woff2 +0 -0
  298. package/dist/theme-packs/onyx/fonts/CormorantGaramond-latin.woff2 +0 -0
  299. package/dist/theme-packs/onyx/fonts/IBMPlexMono-400-latin-ext.woff2 +0 -0
  300. package/dist/theme-packs/onyx/fonts/IBMPlexMono-400-latin.woff2 +0 -0
  301. package/dist/theme-packs/onyx/fonts/IBMPlexMono-500-latin-ext.woff2 +0 -0
  302. package/dist/theme-packs/onyx/fonts/IBMPlexMono-500-latin.woff2 +0 -0
  303. package/dist/theme-packs/onyx/fonts/Jost-latin.woff2 +0 -0
  304. package/dist/theme-packs/onyx/fonts/OFL.txt +95 -0
  305. package/dist/theme-packs/onyx/meta.json +38 -0
  306. package/dist/theme-packs/onyx/pack.css +497 -0
  307. package/dist/theme-packs/phosphor/fonts/JetBrainsMono-latin-ext.woff2 +0 -0
  308. package/dist/theme-packs/phosphor/fonts/JetBrainsMono-latin.woff2 +0 -0
  309. package/dist/theme-packs/phosphor/fonts/OFL.txt +94 -0
  310. package/dist/theme-packs/phosphor/fonts/VT323-latin-ext.woff2 +0 -0
  311. package/dist/theme-packs/phosphor/fonts/VT323-latin.woff2 +0 -0
  312. package/dist/theme-packs/phosphor/meta.json +38 -0
  313. package/dist/theme-packs/phosphor/pack.css +493 -0
  314. package/dist/theme-packs/solar/fonts/OFL.txt +94 -0
  315. package/dist/theme-packs/solar/fonts/SourceCodePro-italic-latin.woff2 +0 -0
  316. package/dist/theme-packs/solar/fonts/SourceCodePro-latin.woff2 +0 -0
  317. package/dist/theme-packs/solar/fonts/SourceSans3-italic-latin.woff2 +0 -0
  318. package/dist/theme-packs/solar/fonts/SourceSans3-latin.woff2 +0 -0
  319. package/dist/theme-packs/solar/meta.json +37 -0
  320. package/dist/theme-packs/solar/pack.css +380 -0
  321. package/dist/theme-packs/sumi/fonts/IBMPlexMono-400-latin-ext.woff2 +0 -0
  322. package/dist/theme-packs/sumi/fonts/IBMPlexMono-400-latin.woff2 +0 -0
  323. package/dist/theme-packs/sumi/fonts/IBMPlexMono-500-latin-ext.woff2 +0 -0
  324. package/dist/theme-packs/sumi/fonts/IBMPlexMono-500-latin.woff2 +0 -0
  325. package/dist/theme-packs/sumi/fonts/OFL.txt +95 -0
  326. package/dist/theme-packs/sumi/fonts/ShipporiMinchoB1-600-latin.woff2 +0 -0
  327. package/dist/theme-packs/sumi/fonts/ShipporiMinchoB1-700-latin.woff2 +0 -0
  328. package/dist/theme-packs/sumi/fonts/ShipporiMinchoB1-800-latin.woff2 +0 -0
  329. package/dist/theme-packs/sumi/fonts/ZenKakuGothicNew-400-latin.woff2 +0 -0
  330. package/dist/theme-packs/sumi/fonts/ZenKakuGothicNew-500-latin.woff2 +0 -0
  331. package/dist/theme-packs/sumi/meta.json +38 -0
  332. package/dist/theme-packs/sumi/pack.css +502 -0
  333. package/dist/theme-packs/swissgrid/fonts/IBMPlexMono-400-latin-ext.woff2 +0 -0
  334. package/dist/theme-packs/swissgrid/fonts/IBMPlexMono-400-latin.woff2 +0 -0
  335. package/dist/theme-packs/swissgrid/fonts/IBMPlexMono-600-latin.woff2 +0 -0
  336. package/dist/theme-packs/swissgrid/fonts/Inter-latin-ext.woff2 +0 -0
  337. package/dist/theme-packs/swissgrid/fonts/Inter-latin.woff2 +0 -0
  338. package/dist/theme-packs/swissgrid/fonts/InterTight-latin.woff2 +0 -0
  339. package/dist/theme-packs/swissgrid/fonts/OFL.txt +95 -0
  340. package/dist/theme-packs/swissgrid/meta.json +38 -0
  341. package/dist/theme-packs/swissgrid/pack.css +518 -0
  342. package/dist/theme-packs/washi/fonts/MPlus1Code-400-latin.woff2 +0 -0
  343. package/dist/theme-packs/washi/fonts/MPlus1Code-500-latin.woff2 +0 -0
  344. package/dist/theme-packs/washi/fonts/OFL.txt +95 -0
  345. package/dist/theme-packs/washi/fonts/ShipporiMincho-500-latin.woff2 +0 -0
  346. package/dist/theme-packs/washi/fonts/ShipporiMincho-600-latin.woff2 +0 -0
  347. package/dist/theme-packs/washi/fonts/ShipporiMincho-700-latin.woff2 +0 -0
  348. package/dist/theme-packs/washi/fonts/ZenKakuGothicNew-400-latin.woff2 +0 -0
  349. package/dist/theme-packs/washi/fonts/ZenKakuGothicNew-500-latin.woff2 +0 -0
  350. package/dist/theme-packs/washi/fonts/ZenKakuGothicNew-700-latin.woff2 +0 -0
  351. package/dist/theme-packs/washi/meta.json +38 -0
  352. package/dist/theme-packs/washi/pack.css +479 -0
  353. package/dist/theme-packs-registry/index.d.ts +5 -0
  354. package/dist/theme-packs-registry/index.js +30 -0
  355. package/dist/theme-packs-registry/load-registry.d.ts +23 -0
  356. package/dist/theme-packs-registry/load-registry.js +64 -0
  357. package/dist/theme-packs-registry/meta-schema.d.ts +70 -0
  358. package/dist/theme-packs-registry/meta-schema.js +38 -0
  359. package/dist/theme-packs-registry/resolve-enabled-packs.d.ts +25 -0
  360. package/dist/theme-packs-registry/resolve-enabled-packs.js +43 -0
  361. package/dist/theme-packs-registry/token-manifest.d.ts +19 -0
  362. package/dist/theme-packs-registry/token-manifest.js +57 -0
  363. package/dist/theme-packs-registry/validator.d.ts +35 -0
  364. package/dist/theme-packs-registry/validator.js +284 -0
  365. package/dist/theme-toggle/color-scheme-sync.d.ts +2 -4
  366. package/dist/toc/mobile-toc.js +1 -1
  367. package/dist/versions-page/index.d.ts +2 -2
  368. package/dist/versions-page/index.js +8 -8
  369. package/eject/breadcrumb/breadcrumb.tsx +4 -4
  370. package/eject/breadcrumb/find-path.ts +2 -2
  371. package/eject/breadcrumb/index.ts +1 -1
  372. package/eject/breadcrumb/types.ts +0 -6
  373. package/eject/code-group/index.tsx +2 -2
  374. package/eject/doc-history/index.tsx +1 -1
  375. package/eject/doc-pager/index.tsx +1 -1
  376. package/eject/footer/footer.tsx +1 -0
  377. package/eject/header/header.tsx +86 -21
  378. package/eject/header/index.ts +3 -0
  379. package/eject/header/types.ts +39 -1
  380. package/eject/sidebar-toggle-island/index.tsx +7 -1
  381. package/eject/site-tree-nav-island/index.tsx +15 -3
  382. package/eject/site-tree-nav-island/state.ts +9 -0
  383. package/eject/theme-toggle/color-scheme-sync.ts +2 -4
  384. package/eject/toc/mobile-toc.tsx +9 -1
  385. package/package.json +35 -29
  386. package/routes-src/404.tsx +4 -1
  387. package/routes-src/_chrome.tsx +6 -5
  388. package/routes-src/_context.ts +4 -0
  389. package/routes-src/_docs-helpers.ts +9 -29
  390. package/routes-src/_virtual.d.ts +4 -0
  391. package/virtual-modules.d.ts +4 -0
  392. package/zfb-config-shim.d.ts +40 -18
  393. package/dist/integrations/llms-txt/index.d.ts +0 -33
  394. package/dist/theme/color-tweak-export-modal.d.ts +0 -16
  395. package/dist/theme/color-tweak-export-modal.js +0 -138
  396. package/dist/theme/design-token-serde.d.ts +0 -183
  397. package/dist/theme/design-token-serde.js +0 -346
  398. package/dist/theme/design-token-types.d.ts +0 -13
  399. package/dist/theme/design-token-types.js +0 -6
  400. package/dist/theme/iframe-bridge.d.ts +0 -42
  401. package/dist/theme/iframe-bridge.js +0 -72
  402. /package/dist/{integrations → plugins/internal}/claude-resources/escape-for-mdx.d.ts +0 -0
  403. /package/dist/{integrations → plugins/internal}/claude-resources/escape-for-mdx.js +0 -0
  404. /package/dist/{integrations → plugins/internal}/claude-resources/generate.d.ts +0 -0
  405. /package/dist/{integrations → plugins/internal}/claude-resources/generate.js +0 -0
  406. /package/dist/{integrations → plugins/internal}/doc-history/pre-build.js +0 -0
  407. /package/dist/{integrations → plugins/internal}/llms-txt/dev-middleware.d.ts +0 -0
  408. /package/dist/{integrations → plugins/internal}/llms-txt/dev-middleware.js +0 -0
  409. /package/dist/{integrations → plugins/internal}/llms-txt/emit.d.ts +0 -0
  410. /package/dist/{integrations → plugins/internal}/llms-txt/emit.js +0 -0
  411. /package/dist/{integrations → plugins/internal}/llms-txt/generate.d.ts +0 -0
  412. /package/dist/{integrations → plugins/internal}/llms-txt/generate.js +0 -0
  413. /package/dist/{integrations → plugins/internal}/llms-txt/index.js +0 -0
  414. /package/dist/{integrations → plugins/internal}/llms-txt/types.js +0 -0
  415. /package/dist/{integrations → plugins/internal}/search-index/build-emitter.d.ts +0 -0
  416. /package/dist/{integrations → plugins/internal}/search-index/build-emitter.js +0 -0
  417. /package/dist/{integrations → plugins/internal}/search-index/collect.d.ts +0 -0
  418. /package/dist/{integrations → plugins/internal}/search-index/dev-middleware.d.ts +0 -0
  419. /package/dist/{integrations → plugins/internal}/search-index/dev-middleware.js +0 -0
  420. /package/dist/{integrations → plugins/internal}/search-index/index.d.ts +0 -0
  421. /package/dist/{integrations → plugins/internal}/search-index/index.js +0 -0
  422. /package/dist/{integrations → plugins/internal}/search-index/types.d.ts +0 -0
  423. /package/dist/{integrations → plugins/internal}/search-index/types.js +0 -0
@@ -1,12 +1,11 @@
1
1
  /**
2
2
  * Minimal structural interface for a docs entry.
3
3
  *
4
- * Structurally compatible with the host's `DocsEntry` from
5
- * `@/types/docs-entry`. Callers pass their concrete entry arrays and
6
- * TypeScript's structural typing ensures compatibility.
4
+ * Structurally compatible with a current zfb collection entry. Callers pass
5
+ * concrete entry arrays and TypeScript preserves the subtype in the result.
7
6
  */
8
7
  export interface MergeDocsEntry {
9
- id: string;
8
+ slug: string;
10
9
  data: {
11
10
  slug?: string;
12
11
  unlisted?: boolean;
@@ -58,13 +57,10 @@ export interface MergeLocaleDocsOptions<T extends MergeDocsEntry = MergeDocsEntr
58
57
  * Only called when `applyDefaultLocaleOnlyFilter` is true. The host stub
59
58
  * passes `isDefaultLocaleOnlyPath` from `@/utils/base`.
60
59
  *
61
- * When omitted (or when `applyDefaultLocaleOnlyFilter` is false), no path
62
- * filtering is applied.
63
- *
64
- * Example: host passes `(path) => isDefaultLocaleOnlyPath(path)` where
65
- * `isDefaultLocaleOnlyPath` is from `src/utils/base.ts`.
60
+ * Required explicitly so the merge never silently omits the current
61
+ * default-locale-only path contract.
66
62
  */
67
- isDefaultLocaleOnlyPath?: (path: string) => boolean;
63
+ isDefaultLocaleOnlyPath: (path: string) => boolean;
68
64
  }
69
65
  /**
70
66
  * Result of mergeLocaleDocs.
@@ -103,10 +99,9 @@ export interface MergeLocaleDocsResult<T extends MergeDocsEntry = MergeDocsEntry
103
99
  * Locale docs take priority; base docs fill in slugs not covered by the locale
104
100
  * collection. Optionally excludes default-locale-only paths and/or unlisted pages.
105
101
  *
106
- * **Slug keying**: slug identity uses `d.data.slug ?? d.id`. Since `loadDocs`
107
- * already strips the `/index` suffix (via `stripIndexSuffix` in `pages/_data.ts`),
108
- * this key is consistent across all call sites regardless of whether they
109
- * loaded docs via `loadDocs` or `bridgeEntries`.
102
+ * **Slug keying**: slug identity uses the explicit frontmatter override or
103
+ * the canonical route form of the current zfb `entry.slug`. This preserves
104
+ * root `index` and nested index-page behavior without mutating the entries.
110
105
  *
111
106
  * **Array identity**: returns a fresh array on each call — see
112
107
  * {@link MergeLocaleDocsResult} for caching guidance.
@@ -1,3 +1,4 @@
1
+ import { toRouteSlug } from "../slug/index.js";
1
2
  function mergeLocaleDocs(options) {
2
3
  const {
3
4
  baseDocs,
@@ -8,13 +9,14 @@ function mergeLocaleDocs(options) {
8
9
  } = options;
9
10
  const filteredLocale = keepUnlisted ? localeDocs : localeDocs.filter((d) => !d.data.unlisted);
10
11
  const filteredBase = keepUnlisted ? baseDocs : baseDocs.filter((d) => !d.data.unlisted);
11
- const localeSlugSet = new Set(filteredLocale.map((d) => d.data.slug ?? d.id));
12
+ const routeSlug = (entry) => entry.data.slug ?? toRouteSlug(entry.slug);
13
+ const localeSlugSet = new Set(filteredLocale.map(routeSlug));
12
14
  let fallbackDocs = filteredBase.filter(
13
- (d) => !localeSlugSet.has(d.data.slug ?? d.id)
15
+ (entry) => !localeSlugSet.has(routeSlug(entry))
14
16
  );
15
- if (applyDefaultLocaleOnlyFilter && isDefaultLocaleOnlyPath) {
17
+ if (applyDefaultLocaleOnlyFilter) {
16
18
  fallbackDocs = fallbackDocs.filter(
17
- (d) => !isDefaultLocaleOnlyPath(`/docs/${d.data.slug ?? d.id}`)
19
+ (entry) => !isDefaultLocaleOnlyPath("/docs/" + routeSlug(entry))
18
20
  );
19
21
  }
20
22
  return {
@@ -1,5 +1,5 @@
1
1
  import { toChildArray } from "preact";
2
- import { htmlOverrides } from "../content/index.js";
2
+ import { defaultComponents } from "../content/index.js";
3
3
  import { makeAdmonition } from "../content-admonition/index.js";
4
4
  import { CodeGroup } from "../code-group/index.js";
5
5
  import { Tabs } from "../code-syntax/index.js";
@@ -105,7 +105,7 @@ function makeEnlargeableParagraph(imageEnlarge, ContentImg) {
105
105
  }
106
106
  }
107
107
  }
108
- return htmlOverrides.p(props);
108
+ return defaultComponents.p(props);
109
109
  };
110
110
  }
111
111
  function createMdxComponents(options) {
@@ -119,11 +119,11 @@ function createMdxComponents(options) {
119
119
  const CategoryTreeNavBound = (props) => navData.CategoryTreeNav({ ...props, lang: locale });
120
120
  const SiteTreeNavBound = (props) => navData.SiteTreeNav({ ...props, lang: locale });
121
121
  return {
122
- ...htmlOverrides,
122
+ ...defaultComponents,
123
123
  // img override: rewrites root-relative src to include settings.base.
124
124
  img: ContentImg,
125
125
  // p override: wraps block-level images in <figure class="zd-enlargeable">.
126
- // Must come AFTER ...htmlOverrides to override ContentParagraph.
126
+ // Must come AFTER ...defaultComponents to override ContentParagraph.
127
127
  p: EnlargeableParagraph,
128
128
  // Admonitions — real typed Preact components emitting the
129
129
  // `.admonition` / `data-admonition` structure the design-system CSS
@@ -1,3 +1,4 @@
1
1
  import type { ZfbPlugin } from "@takazudo/zfb/plugins";
2
+ export { runClaudeResourcesPreStep } from "./internal/claude-resources/index.js";
2
3
  declare const plugin: ZfbPlugin;
3
4
  export default plugin;
@@ -1,4 +1,5 @@
1
- import { runClaudeResourcesPreStep } from "../integrations/claude-resources/index.js";
1
+ import { runClaudeResourcesPreStep } from "./internal/claude-resources/index.js";
2
+ import { runClaudeResourcesPreStep as runClaudeResourcesPreStep2 } from "./internal/claude-resources/index.js";
2
3
  const PLUGIN_NAME = "@takazudo/zudo-doc-claude-resources";
3
4
  const plugin = {
4
5
  name: PLUGIN_NAME,
@@ -25,5 +26,6 @@ const plugin = {
25
26
  };
26
27
  var claude_resources_default = plugin;
27
28
  export {
28
- claude_resources_default as default
29
+ claude_resources_default as default,
30
+ runClaudeResourcesPreStep2 as runClaudeResourcesPreStep
29
31
  };
@@ -2,7 +2,7 @@ import {
2
2
  runDocHistoryMetaStep,
3
3
  runDocHistoryPostBuild,
4
4
  createDocHistoryDevMiddleware
5
- } from "../integrations/doc-history/index.js";
5
+ } from "./internal/doc-history/index.js";
6
6
  import { connectToZfbHandler } from "./connect-adapter.js";
7
7
  import { getBasePrefix } from "./plugin-utils.js";
8
8
  const plugin = {
@@ -1,10 +1,5 @@
1
1
  import { generateClaudeResourcesDocs, type ClaudeResourcesConfig } from "./generate.js";
2
- export interface ZfbPluginConfig {
3
- name: string;
4
- options?: Record<string, unknown>;
5
- }
6
- export declare const CLAUDE_RESOURCES_PLUGIN_NAME = "@takazudo/zudo-doc-claude-resources";
7
- /** Options accepted by both the plugin entry and the imperative runner. */
2
+ /** Options accepted by the plugin's generator runner. */
8
3
  export interface ClaudeResourcesPluginOptions {
9
4
  /**
10
5
  * Path to the project's `.claude/` directory holding `commands/`,
@@ -40,16 +35,6 @@ export interface ClaudeResourcesPluginOptions {
40
35
  */
41
36
  docsDir?: string;
42
37
  }
43
- /**
44
- * Declarative plugin entry for `zfb.config.ts`. Returns the
45
- * `{ name, options }` shape that zfb's plugins array consumes.
46
- *
47
- * v0 note: zfb does not yet invoke plugin lifecycles, so registering the
48
- * plugin alone does not run generation today. Pair it with a call to
49
- * `runClaudeResourcesPreStep` from a `prebuild`-style script until the
50
- * lifecycle hook lands. The plugin entry itself is forward-compatible.
51
- */
52
- export declare function claudeResourcesPlugin(options: ClaudeResourcesPluginOptions): ZfbPluginConfig;
53
38
  /**
54
39
  * Imperative pre-step runner. Resolves relative paths against
55
40
  * `projectRoot` (defaults to `process.cwd()`) and invokes the underlying
@@ -2,13 +2,6 @@ import path from "node:path";
2
2
  import {
3
3
  generateClaudeResourcesDocs
4
4
  } from "./generate.js";
5
- const CLAUDE_RESOURCES_PLUGIN_NAME = "@takazudo/zudo-doc-claude-resources";
6
- function claudeResourcesPlugin(options) {
7
- return {
8
- name: CLAUDE_RESOURCES_PLUGIN_NAME,
9
- options: { ...options }
10
- };
11
- }
12
5
  function runClaudeResourcesPreStep(options) {
13
6
  const projectRoot = path.resolve(options.projectRoot ?? process.cwd());
14
7
  const claudeDir = path.isAbsolute(options.claudeDir) ? options.claudeDir : path.resolve(projectRoot, options.claudeDir);
@@ -18,8 +11,6 @@ function runClaudeResourcesPreStep(options) {
18
11
  return generateClaudeResourcesDocs({ claudeDir, projectRoot: scanRoot, docsDir });
19
12
  }
20
13
  export {
21
- CLAUDE_RESOURCES_PLUGIN_NAME,
22
- claudeResourcesPlugin,
23
14
  generateClaudeResourcesDocs,
24
15
  runClaudeResourcesPreStep
25
16
  };
@@ -24,13 +24,6 @@ export interface DocHistoryOptions {
24
24
  */
25
25
  maxEntries?: number;
26
26
  }
27
- /** zfb v0 plugin descriptor — mirrors `PluginConfig` in `zfb/config`. */
28
- export interface DocHistoryPluginDescriptor {
29
- /** Stable plugin id used by the future zfb plugin runtime to dispatch hooks. */
30
- name: "doc-history";
31
- /** Options forwarded verbatim into the zfb config; must be JSON-serialisable. */
32
- options: DocHistoryOptions;
33
- }
34
27
  /** Default doc-history-server port — matches `@takazudo/zudo-doc-history-server`. */
35
28
  export declare const DEFAULT_SERVER_PORT = 4322;
36
29
  /** Default git history depth — matches `@takazudo/zudo-doc-history-server`. */
@@ -41,16 +34,6 @@ export declare const DOC_HISTORY_ROUTE_PREFIX = "/doc-history/";
41
34
  export declare const DOC_HISTORY_OUTPUT_DIRNAME = "doc-history";
42
35
  /** CLI bin name exposed by `@takazudo/zudo-doc-history-server` for inline generation. */
43
36
  export declare const DOC_HISTORY_GENERATE_BIN = "doc-history-generate";
44
- /**
45
- * Build the zfb config-side descriptor. Add the return value to the
46
- * `plugins: [...]` array in `zfb.config.ts`.
47
- *
48
- * The shape is intentionally limited to `{ name, options }` because
49
- * that is the only thing today's zfb config loader consumes (see the
50
- * Rust `PluginConfig` struct in zfb's `config.rs`). Runtime wiring is
51
- * done through the sibling helpers in this module.
52
- */
53
- export declare function docHistoryPlugin(options: DocHistoryOptions): DocHistoryPluginDescriptor;
54
37
  /** Connect-style middleware signature — works as a Vite plugin middleware. */
55
38
  export type ConnectMiddleware = (req: IncomingMessage, res: ServerResponse, next: (err?: unknown) => void) => void;
56
39
  /** Minimal logger surface used by the middleware on proxy failure. */
@@ -9,9 +9,6 @@ const DEFAULT_MAX_ENTRIES = 50;
9
9
  const DOC_HISTORY_ROUTE_PREFIX = "/doc-history/";
10
10
  const DOC_HISTORY_OUTPUT_DIRNAME = "doc-history";
11
11
  const DOC_HISTORY_GENERATE_BIN = "doc-history-generate";
12
- function docHistoryPlugin(options) {
13
- return { name: "doc-history", options };
14
- }
15
12
  function createDocHistoryDevMiddleware(options, logger) {
16
13
  const port = options.serverPort ?? DEFAULT_SERVER_PORT;
17
14
  return (req, res, next) => {
@@ -153,7 +150,6 @@ export {
153
150
  DOC_HISTORY_ROUTE_PREFIX,
154
151
  buildGenerateCliArgs,
155
152
  createDocHistoryDevMiddleware,
156
- docHistoryPlugin,
157
153
  resolveDocHistoryGenerateBin,
158
154
  runDocHistoryMetaStep,
159
155
  runDocHistoryPostBuild,
@@ -42,11 +42,9 @@ export interface DocHistoryMetaEntry {
42
42
  /**
43
43
  * Source file extension (".mdx" or ".md") — the content walkers accept
44
44
  * both (`collectContentFiles` matches `\.mdx?$`), so the view-source URL
45
- * builder in the host's `_doc-history-area.tsx` reads this instead of
46
- * hardcoding ".mdx". Optional in older manifests; readers fall back to
47
- * ".mdx" when absent.
45
+ * builder uses the actual source extension.
48
46
  */
49
- ext?: ".mdx" | ".md";
47
+ ext: ".mdx" | ".md";
50
48
  }
51
49
  /** Manifest shape — keyed by composedSlug. */
52
50
  export type DocHistoryMetaManifest = Record<string, DocHistoryMetaEntry>;
@@ -0,0 +1,7 @@
1
+ export { createLlmsTxtDevMiddleware } from "./dev-middleware.js";
2
+ export type { LlmsTxtDevMiddlewareOptions, LlmsTxtMiddleware, LlmsTxtMiddlewareLogger, LlmsTxtNextFn, } from "./dev-middleware.js";
3
+ export { emitLlmsTxt } from "./emit.js";
4
+ export { generateLlmsFullTxt, generateLlmsTxt, } from "./generate.js";
5
+ export { collectMdFiles, isExcluded, loadDocEntries, parseMarkdownFile, slugToUrl, } from "./load.js";
6
+ export { stripImportsAndJsx, stripMarkdown } from "./strip.js";
7
+ export type { LlmsDocEntry, LlmsTxtEmitOptions, LlmsTxtEmitResult, LlmsTxtFrontmatter, LlmsTxtLoadOptions, LlmsTxtLocaleConfig, LlmsTxtLogger, LlmsTxtSiteMeta, } from "./types.js";
@@ -9,7 +9,7 @@
9
9
  * surface is unchanged.
10
10
  */
11
11
  import type { LlmsDocEntry, LlmsTxtLoadOptions } from "./types.js";
12
- export { collectMdFiles, isExcluded, parseMarkdownFile, slugToUrl, } from "../../md-utils/index.js";
12
+ export { collectMdFiles, isExcluded, parseMarkdownFile, slugToUrl, } from "../../../md-utils/index.js";
13
13
  /**
14
14
  * Build the sorted {@link LlmsDocEntry} list for a single content root.
15
15
  * Excluded pages (draft / unlisted / search_exclude) are dropped.
@@ -5,14 +5,14 @@ import {
5
5
  parseMarkdownFile,
6
6
  slugToUrl,
7
7
  stripMarkdown
8
- } from "../../md-utils/index.js";
8
+ } from "../../../md-utils/index.js";
9
9
  import { stripImportsAndJsx } from "./strip.js";
10
10
  import {
11
11
  collectMdFiles as collectMdFiles2,
12
12
  isExcluded as isExcluded2,
13
13
  parseMarkdownFile as parseMarkdownFile2,
14
14
  slugToUrl as slugToUrl2
15
- } from "../../md-utils/index.js";
15
+ } from "../../../md-utils/index.js";
16
16
  function loadDocEntries(options) {
17
17
  const { contentDir, locale, base, siteUrl } = options;
18
18
  const absDir = resolve(contentDir);
@@ -10,10 +10,9 @@
10
10
  * `stripMarkdown` (used to derive a fallback `description` from the body
11
11
  * when frontmatter doesn't carry one) lives in the shared `md-utils`
12
12
  * module — one implementation for search-index and llms-txt
13
- * (zudo-doc#2024) — and is re-exported here to keep the public surface
14
- * unchanged.
13
+ * (zudo-doc#2024) — and is re-exported here for the internal loader barrel.
15
14
  */
16
- export { stripMarkdown } from "../../md-utils/index.js";
15
+ export { stripMarkdown } from "../../../md-utils/index.js";
17
16
  /**
18
17
  * Strip imports, exports, and HTML/JSX tags from MDX/MD content while
19
18
  * keeping the prose layout (headings, lists, blockquotes) intact for
@@ -1,4 +1,4 @@
1
- import { stripMarkdown } from "../../md-utils/index.js";
1
+ import { stripMarkdown } from "../../../md-utils/index.js";
2
2
  function stripImportsAndJsx(content) {
3
3
  return content.replace(/^import\s+.*$/gm, "").replace(/^export\s+.*$/gm, "").replace(/\{\/\*[\s\S]*?\*\/\}/g, "").replace(/<\/?[a-zA-Z][a-zA-Z0-9]*[^>]*>/g, "").replace(/\n{3,}/g, "\n\n").trim();
4
4
  }
@@ -1,16 +1,13 @@
1
1
  /**
2
- * Public types for the framework-agnostic llms-txt build emitter.
2
+ * Internal types for the framework-agnostic llms-txt build emitter.
3
3
  *
4
- * The shapes here are deliberately decoupled from `astro:content` and
5
- * Astro's `AstroIntegration` API so the emitter can run on top of any
6
- * pipeline that exposes a `dist/` output directory and a list of
7
- * markdown content roots — Astro today, zfb tomorrow, plain Node tooling
8
- * in a unit test, etc.
4
+ * The shapes are deliberately framework-neutral so the current zfb plugin
5
+ * and plain Node test tooling can share the same emitter.
9
6
  */
10
- import type { MdDocFrontmatter } from "../../md-utils/index.js";
7
+ import type { MdDocFrontmatter } from "../../../md-utils/index.js";
11
8
  /**
12
9
  * Frontmatter fields the loader reads off of each MDX/MD file. Callers
13
- * are free to extend this; unrecognised fields are ignored. Alias of the
10
+ * are free to extend this; unrecognised fields are ignored. Re-export of the
14
11
  * shared {@link MdDocFrontmatter} shape (`md-utils`, zudo-doc#2024) —
15
12
  * search-index and llms-txt read the same fields.
16
13
  */
@@ -44,8 +41,8 @@ export interface LlmsDocEntry {
44
41
  }
45
42
  /**
46
43
  * Site-level metadata threaded through the generators. Matches the
47
- * `siteName` / `siteDescription` fields on the legacy settings object
48
- * one-for-one so callers can pass `settings` straight through.
44
+ * current `siteName` / `siteDescription` settings one-for-one so callers can
45
+ * pass the current settings object straight through.
49
46
  */
50
47
  export interface LlmsTxtSiteMeta {
51
48
  siteName: string;
@@ -81,16 +78,13 @@ export interface LlmsTxtLoadOptions {
81
78
  /**
82
79
  * Optional absolute site URL. When set, the loader produces fully
83
80
  * qualified URLs by prefixing the base+path with `siteUrl`. When
84
- * empty, URLs are returned path-only (matching the legacy emitter's
85
- * behaviour for projects that omit `siteUrl`).
81
+ * empty, URLs are returned path-only for projects that omit `siteUrl`.
86
82
  */
87
83
  siteUrl?: string;
88
84
  }
89
85
  /**
90
- * Top-level options for {@link emitLlmsTxt}. Mirrors the inputs the
91
- * legacy Astro emitter pulled implicitly off of the project's `settings`
92
- * module so that a one-line registration in `zfb.config.ts` (or a
93
- * `b4-build` hook in Astro) can wire the same behaviour.
86
+ * Top-level options for {@link emitLlmsTxt}. The current zfb plugin supplies
87
+ * these explicitly from its resolved config.
94
88
  */
95
89
  export interface LlmsTxtEmitOptions extends LlmsTxtSiteMeta {
96
90
  /** Absolute output directory — typically `dist/`. */
@@ -110,16 +104,13 @@ export interface LlmsTxtEmitOptions extends LlmsTxtSiteMeta {
110
104
  */
111
105
  locales?: LlmsTxtLocaleConfig[];
112
106
  /**
113
- * Optional logger. Defaults to a no-op so unit tests stay quiet; the
114
- * Astro adapter can wire `astro:build:done`'s `logger` through, and
115
- * a future zfb plugin can pipe its own.
107
+ * Optional logger. Defaults to a no-op so unit tests stay quiet; the zfb
108
+ * plugin can pipe its logger through.
116
109
  */
117
110
  logger?: LlmsTxtLogger;
118
111
  }
119
112
  /**
120
- * Minimal logger interface — a structural subset of both Astro's
121
- * `logger` and `console`. Only `info` is used today; the wider shape is
122
- * provided so the option can hold either object without type acrobatics.
113
+ * Minimal logger interface. Only `info` is used today.
123
114
  */
124
115
  export interface LlmsTxtLogger {
125
116
  info: (msg: string) => void;
@@ -5,7 +5,7 @@ import {
5
5
  parseMarkdownFile,
6
6
  slugToUrl,
7
7
  stripMarkdown
8
- } from "../../md-utils/index.js";
8
+ } from "../../../md-utils/index.js";
9
9
  import {
10
10
  MAX_BODY_LENGTH
11
11
  } from "./types.js";
@@ -0,0 +1,32 @@
1
+ import type { ThemePackRegistry } from "../../../theme-packs-registry/index.js";
2
+ export interface CopyThemePacksParams {
3
+ /** The shipped `theme-packs/` directory — `dist/theme-packs/` once
4
+ * compiled (workspace-built and published shapes alike), `src/theme-packs/`
5
+ * when vitest runs the source directly. Same resolution rule as
6
+ * `routes.ts`'s `themePacksDir`. */
7
+ packsDir: string | URL;
8
+ /** The ENABLED, ORDERED registry (already resolved via `resolveEnabledPacks`). */
9
+ enabled: ThemePackRegistry;
10
+ /** The build's output directory (`ctx.outDir`). */
11
+ outDir: string;
12
+ }
13
+ export interface CopyThemePacksResult {
14
+ /** `false` when the ADR's no-op rule applies (no CSS-bearing pack enabled)
15
+ * — nothing was written. */
16
+ copied: boolean;
17
+ /** Absolute path of `${outDir}/theme-packs/`, when `copied` is `true`. */
18
+ destDir?: string;
19
+ /** Absolute path of the written `index.json`, when `copied` is `true`. */
20
+ indexJsonPath?: string;
21
+ }
22
+ /**
23
+ * Copy every enabled pack's `meta.json` (+ `pack.css` when it ships one, +
24
+ * `fonts/*` when present) into `${outDir}/theme-packs/<slug>/…`, and write
25
+ * the aggregated `${outDir}/theme-packs/index.json` manifest
26
+ * (`{ schemaVersion: 1, packs: ThemePackMeta[] }`) in resolved order.
27
+ *
28
+ * No-ops (writes nothing, returns `{ copied: false }`) when the enabled set
29
+ * has no CSS-bearing pack — i.e. only `"default"` is enabled — per the ADR's
30
+ * dead-weight-avoidance rule.
31
+ */
32
+ export declare function copyEnabledThemePacks({ packsDir, enabled, outDir, }: CopyThemePacksParams): CopyThemePacksResult;
@@ -0,0 +1,45 @@
1
+ import { copyFileSync, existsSync, mkdirSync, readdirSync, writeFileSync } from "node:fs";
2
+ import { join } from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ import { hasCssBearingPack } from "./resolve.js";
5
+ function copyEnabledThemePacks({
6
+ packsDir,
7
+ enabled,
8
+ outDir
9
+ }) {
10
+ if (!hasCssBearingPack(enabled)) {
11
+ return { copied: false };
12
+ }
13
+ const srcRoot = packsDir instanceof URL ? fileURLToPath(packsDir) : packsDir;
14
+ const destRoot = join(outDir, "theme-packs");
15
+ mkdirSync(destRoot, { recursive: true });
16
+ for (const entry of enabled) {
17
+ const srcDir = join(srcRoot, entry.slug);
18
+ const destDir = join(destRoot, entry.slug);
19
+ mkdirSync(destDir, { recursive: true });
20
+ copyFileSync(join(srcDir, "meta.json"), join(destDir, "meta.json"));
21
+ if (entry.hasStylesheet) {
22
+ copyFileSync(join(srcDir, "pack.css"), join(destDir, "pack.css"));
23
+ }
24
+ const fontsSrcDir = join(srcDir, "fonts");
25
+ if (existsSync(fontsSrcDir)) {
26
+ const fontsDestDir = join(destDir, "fonts");
27
+ mkdirSync(fontsDestDir, { recursive: true });
28
+ for (const file of readdirSync(fontsSrcDir, { withFileTypes: true })) {
29
+ if (file.isFile()) {
30
+ copyFileSync(join(fontsSrcDir, file.name), join(fontsDestDir, file.name));
31
+ }
32
+ }
33
+ }
34
+ }
35
+ const manifest = {
36
+ schemaVersion: 1,
37
+ packs: enabled.map((entry) => entry.meta)
38
+ };
39
+ const indexJsonPath = join(destRoot, "index.json");
40
+ writeFileSync(indexJsonPath, JSON.stringify(manifest));
41
+ return { copied: true, destDir: destRoot, indexJsonPath };
42
+ }
43
+ export {
44
+ copyEnabledThemePacks
45
+ };
@@ -0,0 +1,22 @@
1
+ import type { IncomingMessage, ServerResponse } from "node:http";
2
+ import type { ThemePackRegistry } from "../../../theme-packs-registry/index.js";
3
+ export type ThemePacksNextFn = (err?: unknown) => void;
4
+ export type ThemePacksMiddleware = (req: IncomingMessage, res: ServerResponse, next: ThemePacksNextFn) => void;
5
+ export interface CreateThemePacksDevMiddlewareParams {
6
+ /** The shipped `theme-packs/` directory (workspace `src/theme-packs/` under
7
+ * vitest, `dist/theme-packs/` from the published/workspace-built package). */
8
+ packsDir: string | URL;
9
+ /** The ENABLED, ORDERED registry (already resolved via `resolveEnabledPacks`). */
10
+ enabled: ThemePackRegistry;
11
+ /** Base-stripped route prefix this registration matches under, e.g.
12
+ * `/theme-packs` for base `/`, or `/my-docs/theme-packs` for base
13
+ * `/my-docs/` (same `getBasePrefix` convention as the sibling plugins). */
14
+ routePrefix: string;
15
+ }
16
+ /**
17
+ * Build a dev-server middleware serving the enabled packs' files plus a
18
+ * generated `index.json` aggregate. Every request re-reads from disk (no
19
+ * caching) so authoring edits to `pack.css` during `zudo-doc` development
20
+ * surface without a dev-server restart.
21
+ */
22
+ export declare function createThemePacksDevMiddleware({ packsDir, enabled, routePrefix, }: CreateThemePacksDevMiddlewareParams): ThemePacksMiddleware;
@@ -0,0 +1,80 @@
1
+ import { existsSync, readFileSync } from "node:fs";
2
+ import { resolve as resolvePath, sep } from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ const CONTENT_TYPES = {
5
+ ".css": "text/css",
6
+ ".json": "application/json",
7
+ ".woff2": "font/woff2"
8
+ };
9
+ function contentTypeFor(path) {
10
+ const dot = path.lastIndexOf(".");
11
+ if (dot === -1) return void 0;
12
+ return CONTENT_TYPES[path.slice(dot).toLowerCase()];
13
+ }
14
+ function createThemePacksDevMiddleware({
15
+ packsDir,
16
+ enabled,
17
+ routePrefix
18
+ }) {
19
+ const rootDir = resolvePath(packsDir instanceof URL ? fileURLToPath(packsDir) : packsDir);
20
+ const bySlug = new Map(enabled.map((entry) => [entry.slug, entry]));
21
+ const prefix = routePrefix.endsWith("/") ? routePrefix : `${routePrefix}/`;
22
+ const indexPath = `${prefix}index.json`;
23
+ return (req, res, next) => {
24
+ const url = (req.url ?? "").split("?")[0] ?? "";
25
+ if (!url.startsWith(prefix)) {
26
+ next();
27
+ return;
28
+ }
29
+ if (url === indexPath) {
30
+ const manifest = {
31
+ schemaVersion: 1,
32
+ packs: enabled.map((entry2) => entry2.meta)
33
+ };
34
+ res.setHeader("Content-Type", "application/json");
35
+ res.end(JSON.stringify(manifest));
36
+ return;
37
+ }
38
+ const rest = url.slice(prefix.length);
39
+ const segments = rest.split("/");
40
+ const slug = segments[0];
41
+ const tail = segments.slice(1).join("/");
42
+ if (!slug || segments.some((s) => s === "" || s === "." || s === "..")) {
43
+ next();
44
+ return;
45
+ }
46
+ const entry = bySlug.get(slug);
47
+ if (!entry) {
48
+ next();
49
+ return;
50
+ }
51
+ if (tail !== "pack.css" && !tail.startsWith("fonts/")) {
52
+ next();
53
+ return;
54
+ }
55
+ if (tail === "pack.css" && !entry.hasStylesheet) {
56
+ next();
57
+ return;
58
+ }
59
+ const packDir = resolvePath(rootDir, slug);
60
+ const filePath = resolvePath(packDir, tail);
61
+ if (!filePath.startsWith(packDir + sep)) {
62
+ res.statusCode = 400;
63
+ res.end("Bad Request");
64
+ return;
65
+ }
66
+ if (!existsSync(filePath)) {
67
+ next();
68
+ return;
69
+ }
70
+ const contentType = contentTypeFor(filePath);
71
+ const isBinary = contentType === "font/woff2";
72
+ const body = isBinary ? readFileSync(filePath) : readFileSync(filePath, "utf8");
73
+ res.statusCode = 200;
74
+ if (contentType) res.setHeader("Content-Type", contentType);
75
+ res.end(body);
76
+ };
77
+ }
78
+ export {
79
+ createThemePacksDevMiddleware
80
+ };
@@ -0,0 +1,6 @@
1
+ export { resolveThemePacksForOptions, hasCssBearingPack } from "./resolve.js";
2
+ export { copyEnabledThemePacks } from "./copy.js";
3
+ export type { CopyThemePacksParams, CopyThemePacksResult } from "./copy.js";
4
+ export { createThemePacksDevMiddleware } from "./dev-middleware.js";
5
+ export type { ThemePacksMiddleware, ThemePacksNextFn, CreateThemePacksDevMiddlewareParams, } from "./dev-middleware.js";
6
+ export type { ThemePacksPluginOptions, ThemePacksIndexManifest } from "./types.js";
@@ -0,0 +1,9 @@
1
+ import { resolveThemePacksForOptions, hasCssBearingPack } from "./resolve.js";
2
+ import { copyEnabledThemePacks } from "./copy.js";
3
+ import { createThemePacksDevMiddleware } from "./dev-middleware.js";
4
+ export {
5
+ copyEnabledThemePacks,
6
+ createThemePacksDevMiddleware,
7
+ hasCssBearingPack,
8
+ resolveThemePacksForOptions
9
+ };
@@ -0,0 +1,17 @@
1
+ import { type ThemePackRegistry } from "../../../theme-packs-registry/index.js";
2
+ import type { ThemePacksPluginOptions } from "./types.js";
3
+ /**
4
+ * Resolve the ENABLED, ORDERED pack registry for `options` against the
5
+ * shipped `packsDir`. Throws — naming the offending pack/slug — on a broken
6
+ * bundled pack (`loadThemePackRegistry`) or an unknown/duplicate configured
7
+ * slug (`resolveEnabledPacks`); this is the fail-loudly precedent every hook
8
+ * (`setup`, `postBuild`, `devMiddleware`) relies on (never a silent
9
+ * fallback).
10
+ */
11
+ export declare function resolveThemePacksForOptions(packsDir: string | URL, options: ThemePacksPluginOptions): ThemePackRegistry;
12
+ /**
13
+ * Whether the resolved enabled set has anything worth copying/serving — the
14
+ * ADR's dead-weight-avoidance rule: "no-ops when the resolved enabled set has
15
+ * no CSS-bearing pack (i.e. only `default`)".
16
+ */
17
+ export declare function hasCssBearingPack(enabled: ThemePackRegistry): boolean;
@@ -0,0 +1,17 @@
1
+ import {
2
+ loadThemePackRegistry,
3
+ resolveEnabledPacks
4
+ } from "../../../theme-packs-registry/index.js";
5
+ function resolveThemePacksForOptions(packsDir, options) {
6
+ return resolveEnabledPacks(loadThemePackRegistry(packsDir), {
7
+ themePack: options.themePack,
8
+ themePacks: options.themePacks
9
+ });
10
+ }
11
+ function hasCssBearingPack(enabled) {
12
+ return enabled.some((entry) => entry.hasStylesheet);
13
+ }
14
+ export {
15
+ hasCssBearingPack,
16
+ resolveThemePacksForOptions
17
+ };