@takazudo/zudo-doc 3.3.0 → 4.0.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 (417) hide show
  1. package/CHANGELOG.md +32 -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.d.ts +28 -12
  38. package/dist/config.js +11 -2
  39. package/dist/content/component-map.d.ts +0 -16
  40. package/dist/content/component-map.js +2 -4
  41. package/dist/content/index.d.ts +1 -1
  42. package/dist/content/index.js +2 -3
  43. package/dist/content.css +1 -1
  44. package/dist/design-token-panel-bootstrap.d.ts +45 -40
  45. package/dist/design-token-panel-bootstrap.js +98 -21
  46. package/dist/design-token-panel-config/index.js +1 -4
  47. package/dist/doc-body-end-islands/design-token-panel-island.d.ts +15 -0
  48. package/dist/doc-body-end-islands/design-token-panel-island.js +31 -0
  49. package/dist/doc-body-end-islands/index.d.ts +39 -17
  50. package/dist/doc-body-end-islands/index.js +13 -21
  51. package/dist/doc-body-end-islands/theme-pack-switcher-island.d.ts +37 -0
  52. package/dist/doc-body-end-islands/theme-pack-switcher-island.js +18 -0
  53. package/dist/doc-content-header/index.js +1 -1
  54. package/dist/doc-history-area/index.d.ts +10 -4
  55. package/dist/doc-history-area/index.js +3 -2
  56. package/dist/doc-metainfo-area/index.d.ts +1 -0
  57. package/dist/doc-page-props/index.d.ts +7 -23
  58. package/dist/doc-page-renderer/index.d.ts +1 -0
  59. package/dist/doc-page-renderer/index.js +1 -0
  60. package/dist/doc-page-shell/index.js +19 -12
  61. package/dist/doc-pager/index.js +1 -1
  62. package/dist/doc-route-entries/index.d.ts +2 -2
  63. package/dist/doclayout/doc-layout-with-defaults.js +4 -4
  64. package/dist/doclayout/doc-layout.d.ts +8 -0
  65. package/dist/doclayout/doc-layout.js +10 -1
  66. package/dist/docs-schema/index.js +1 -5
  67. package/dist/eject/index.d.ts +16 -0
  68. package/dist/eject/index.js +122 -28
  69. package/dist/extract-headings/index.d.ts +5 -8
  70. package/dist/extract-headings/index.js +2 -9
  71. package/dist/factory-context/index.d.ts +42 -4
  72. package/dist/features.css +55 -43
  73. package/dist/footer/footer.js +1 -0
  74. package/dist/head-with-defaults/index.d.ts +2 -0
  75. package/dist/head-with-defaults/index.js +16 -0
  76. package/dist/header/header.d.ts +10 -5
  77. package/dist/header/header.js +45 -5
  78. package/dist/header/index.d.ts +1 -1
  79. package/dist/header/types.d.ts +30 -1
  80. package/dist/header-with-defaults/index.js +1 -0
  81. package/dist/home-page/index.d.ts +2 -0
  82. package/dist/home-page/index.js +11 -5
  83. package/dist/home-page/prepare-home-data.js +1 -1
  84. package/dist/locale-merge/index.d.ts +9 -14
  85. package/dist/locale-merge/index.js +6 -4
  86. package/dist/mdx-components/index.js +4 -4
  87. package/dist/plugins/claude-resources.d.ts +1 -0
  88. package/dist/plugins/claude-resources.js +4 -2
  89. package/dist/plugins/doc-history.js +1 -1
  90. package/dist/{integrations → plugins/internal}/claude-resources/index.d.ts +1 -16
  91. package/dist/{integrations → plugins/internal}/claude-resources/index.js +0 -9
  92. package/dist/{integrations → plugins/internal}/doc-history/index.d.ts +0 -17
  93. package/dist/{integrations → plugins/internal}/doc-history/index.js +0 -4
  94. package/dist/{integrations → plugins/internal}/doc-history/pre-build.d.ts +2 -4
  95. package/dist/plugins/internal/llms-txt/index.d.ts +7 -0
  96. package/dist/{integrations → plugins/internal}/llms-txt/load.d.ts +1 -1
  97. package/dist/{integrations → plugins/internal}/llms-txt/load.js +2 -2
  98. package/dist/{integrations → plugins/internal}/llms-txt/strip.d.ts +2 -3
  99. package/dist/{integrations → plugins/internal}/llms-txt/strip.js +1 -1
  100. package/dist/{integrations → plugins/internal}/llms-txt/types.d.ts +13 -22
  101. package/dist/{integrations → plugins/internal}/search-index/collect.js +1 -1
  102. package/dist/plugins/internal/theme-packs/copy.d.ts +32 -0
  103. package/dist/plugins/internal/theme-packs/copy.js +45 -0
  104. package/dist/plugins/internal/theme-packs/dev-middleware.d.ts +22 -0
  105. package/dist/plugins/internal/theme-packs/dev-middleware.js +80 -0
  106. package/dist/plugins/internal/theme-packs/index.d.ts +6 -0
  107. package/dist/plugins/internal/theme-packs/index.js +9 -0
  108. package/dist/plugins/internal/theme-packs/resolve.d.ts +17 -0
  109. package/dist/plugins/internal/theme-packs/resolve.js +17 -0
  110. package/dist/plugins/internal/theme-packs/types.d.ts +22 -0
  111. package/dist/plugins/internal/theme-packs/types.js +0 -0
  112. package/dist/plugins/llms-txt.js +1 -1
  113. package/dist/plugins/routes.js +11 -1
  114. package/dist/plugins/search-index.js +1 -1
  115. package/dist/plugins/theme-packs.d.ts +3 -0
  116. package/dist/plugins/theme-packs.js +40 -0
  117. package/dist/preset.d.ts +19 -14
  118. package/dist/preset.js +24 -9
  119. package/dist/route-context/index.js +4 -6
  120. package/dist/route-enumerators/index.d.ts +6 -18
  121. package/dist/route-enumerators/index.js +8 -6
  122. package/dist/routes/404.js +3 -1
  123. package/dist/routes/_chrome.js +2 -2
  124. package/dist/routes/_context.d.ts +7 -3
  125. package/dist/routes/_context.js +2 -0
  126. package/dist/routes/_docs-helpers.js +9 -21
  127. package/dist/safelist.css +1 -1
  128. package/dist/settings.d.ts +27 -12
  129. package/dist/sidebar-tree/build-tree.d.ts +3 -4
  130. package/dist/sidebar-tree/build-tree.js +4 -3
  131. package/dist/sidebar-tree/index.d.ts +2 -2
  132. package/dist/sidebar-tree/types.d.ts +6 -17
  133. package/dist/site-tree-nav-island/index.d.ts +3 -1
  134. package/dist/site-tree-nav-island/index.js +17 -5
  135. package/dist/site-tree-nav-island/state.d.ts +4 -0
  136. package/dist/site-tree-nav-island/state.js +10 -0
  137. package/dist/tag-helpers/index.d.ts +6 -13
  138. package/dist/tag-helpers/index.js +5 -23
  139. package/dist/tag-pages/index.d.ts +8 -21
  140. package/dist/tag-pages/index.js +14 -10
  141. package/dist/tags-audit.d.ts +16 -44
  142. package/dist/tags-audit.js +9 -172
  143. package/dist/theme/color-scheme-provider.d.ts +2 -3
  144. package/dist/theme/color-scheme-provider.js +2 -10
  145. package/dist/theme/index.d.ts +1 -4
  146. package/dist/theme/index.js +2 -30
  147. package/dist/theme/theme-pack-provider.d.ts +42 -0
  148. package/dist/theme/theme-pack-provider.js +75 -0
  149. package/dist/theme-cli/apply.d.ts +16 -0
  150. package/dist/theme-cli/apply.js +61 -0
  151. package/dist/theme-cli/config-io.d.ts +15 -0
  152. package/dist/theme-cli/config-io.js +51 -0
  153. package/dist/theme-cli/config-rewriter.d.ts +21 -0
  154. package/dist/theme-cli/config-rewriter.js +141 -0
  155. package/dist/theme-cli/config-scanner.d.ts +63 -0
  156. package/dist/theme-cli/config-scanner.js +288 -0
  157. package/dist/theme-cli/index.d.ts +7 -0
  158. package/dist/theme-cli/index.js +38 -0
  159. package/dist/theme-cli/list.d.ts +27 -0
  160. package/dist/theme-cli/list.js +64 -0
  161. package/dist/theme-cli/provenance.d.ts +17 -0
  162. package/dist/theme-cli/provenance.js +35 -0
  163. package/dist/theme-cli/registry.d.ts +14 -0
  164. package/dist/theme-cli/registry.js +13 -0
  165. package/dist/theme-pack-dialog/dialog-state.d.ts +25 -0
  166. package/dist/theme-pack-dialog/dialog-state.js +40 -0
  167. package/dist/theme-pack-dialog/index.d.ts +5 -0
  168. package/dist/theme-pack-dialog/index.js +152 -0
  169. package/dist/theme-pack-dialog/theme-pack-card.d.ts +25 -0
  170. package/dist/theme-pack-dialog/theme-pack-card.js +72 -0
  171. package/dist/theme-pack-switcher/index.d.ts +49 -0
  172. package/dist/theme-pack-switcher/index.js +205 -0
  173. package/dist/theme-pack-switcher/switcher-state.d.ts +56 -0
  174. package/dist/theme-pack-switcher/switcher-state.js +43 -0
  175. package/dist/theme-pack-switcher/theme-pack-sync.d.ts +85 -0
  176. package/dist/theme-pack-switcher/theme-pack-sync.js +121 -0
  177. package/dist/theme-packs/beacon/fonts/AtkinsonHyperlegible-400-latin.woff2 +0 -0
  178. package/dist/theme-packs/beacon/fonts/AtkinsonHyperlegible-700-latin.woff2 +0 -0
  179. package/dist/theme-packs/beacon/fonts/AtkinsonHyperlegible-italic-400-latin.woff2 +0 -0
  180. package/dist/theme-packs/beacon/fonts/AtkinsonHyperlegible-italic-700-latin.woff2 +0 -0
  181. package/dist/theme-packs/beacon/fonts/AtkinsonHyperlegibleMono-italic-latin.woff2 +0 -0
  182. package/dist/theme-packs/beacon/fonts/AtkinsonHyperlegibleMono-latin.woff2 +0 -0
  183. package/dist/theme-packs/beacon/fonts/OFL.txt +94 -0
  184. package/dist/theme-packs/beacon/meta.json +37 -0
  185. package/dist/theme-packs/beacon/pack.css +442 -0
  186. package/dist/theme-packs/broadsheet/fonts/CourierPrime-400-latin.woff2 +0 -0
  187. package/dist/theme-packs/broadsheet/fonts/CourierPrime-700-latin.woff2 +0 -0
  188. package/dist/theme-packs/broadsheet/fonts/OFL.txt +95 -0
  189. package/dist/theme-packs/broadsheet/fonts/PlayfairDisplay-italic-latin.woff2 +0 -0
  190. package/dist/theme-packs/broadsheet/fonts/PlayfairDisplay-latin.woff2 +0 -0
  191. package/dist/theme-packs/broadsheet/fonts/SourceSerif4-italic-latin.woff2 +0 -0
  192. package/dist/theme-packs/broadsheet/fonts/SourceSerif4-latin.woff2 +0 -0
  193. package/dist/theme-packs/broadsheet/meta.json +38 -0
  194. package/dist/theme-packs/broadsheet/pack.css +448 -0
  195. package/dist/theme-packs/brutalist/fonts/ArchivoBlack-latin.woff2 +0 -0
  196. package/dist/theme-packs/brutalist/fonts/IBMPlexMono-400-latin.woff2 +0 -0
  197. package/dist/theme-packs/brutalist/fonts/IBMPlexMono-500-latin.woff2 +0 -0
  198. package/dist/theme-packs/brutalist/fonts/IBMPlexMono-700-latin.woff2 +0 -0
  199. package/dist/theme-packs/brutalist/fonts/OFL.txt +95 -0
  200. package/dist/theme-packs/brutalist/fonts/SpaceGrotesk-latin.woff2 +0 -0
  201. package/dist/theme-packs/brutalist/meta.json +38 -0
  202. package/dist/theme-packs/brutalist/pack.css +546 -0
  203. package/dist/theme-packs/default/meta.json +37 -0
  204. package/dist/theme-packs/drift/fonts/IBMPlexMono-400-latin-ext.woff2 +0 -0
  205. package/dist/theme-packs/drift/fonts/IBMPlexMono-400-latin.woff2 +0 -0
  206. package/dist/theme-packs/drift/fonts/IBMPlexMono-500-latin-ext.woff2 +0 -0
  207. package/dist/theme-packs/drift/fonts/IBMPlexMono-500-latin.woff2 +0 -0
  208. package/dist/theme-packs/drift/fonts/IBMPlexSans-italic-latin.woff2 +0 -0
  209. package/dist/theme-packs/drift/fonts/IBMPlexSans-latin-ext.woff2 +0 -0
  210. package/dist/theme-packs/drift/fonts/IBMPlexSans-latin.woff2 +0 -0
  211. package/dist/theme-packs/drift/fonts/OFL.txt +93 -0
  212. package/dist/theme-packs/drift/meta.json +37 -0
  213. package/dist/theme-packs/drift/pack.css +478 -0
  214. package/dist/theme-packs/fjord/fonts/Inter-latin-ext.woff2 +0 -0
  215. package/dist/theme-packs/fjord/fonts/Inter-latin.woff2 +0 -0
  216. package/dist/theme-packs/fjord/fonts/JetBrainsMono-latin-ext.woff2 +0 -0
  217. package/dist/theme-packs/fjord/fonts/JetBrainsMono-latin.woff2 +0 -0
  218. package/dist/theme-packs/fjord/fonts/OFL.txt +94 -0
  219. package/dist/theme-packs/fjord/meta.json +37 -0
  220. package/dist/theme-packs/fjord/pack.css +375 -0
  221. package/dist/theme-packs/foundry/fonts/Inter-latin-ext.woff2 +0 -0
  222. package/dist/theme-packs/foundry/fonts/Inter-latin.woff2 +0 -0
  223. package/dist/theme-packs/foundry/fonts/OFL.txt +93 -0
  224. package/dist/theme-packs/foundry/meta.json +37 -0
  225. package/dist/theme-packs/foundry/pack.css +202 -0
  226. package/dist/theme-packs/futura-editorial/fonts/Jost-latin.woff2 +0 -0
  227. package/dist/theme-packs/futura-editorial/fonts/NotoSans-italic-latin.woff2 +0 -0
  228. package/dist/theme-packs/futura-editorial/fonts/NotoSans-latin.woff2 +0 -0
  229. package/dist/theme-packs/futura-editorial/fonts/OFL.txt +95 -0
  230. package/dist/theme-packs/futura-editorial/fonts/SpaceMono-400-latin.woff2 +0 -0
  231. package/dist/theme-packs/futura-editorial/fonts/SpaceMono-700-latin.woff2 +0 -0
  232. package/dist/theme-packs/futura-editorial/meta.json +38 -0
  233. package/dist/theme-packs/futura-editorial/pack.css +313 -0
  234. package/dist/theme-packs/hearth/fonts/Fraunces-italic-latin.woff2 +0 -0
  235. package/dist/theme-packs/hearth/fonts/Fraunces-latin.woff2 +0 -0
  236. package/dist/theme-packs/hearth/fonts/Nunito-latin.woff2 +0 -0
  237. package/dist/theme-packs/hearth/fonts/OFL.txt +95 -0
  238. package/dist/theme-packs/hearth/fonts/SplineSansMono-latin.woff2 +0 -0
  239. package/dist/theme-packs/hearth/meta.json +38 -0
  240. package/dist/theme-packs/hearth/pack.css +385 -0
  241. package/dist/theme-packs/hollow/fonts/OFL.txt +94 -0
  242. package/dist/theme-packs/hollow/fonts/SpaceGrotesk-latin.woff2 +0 -0
  243. package/dist/theme-packs/hollow/fonts/SpaceMono-400-italic-latin.woff2 +0 -0
  244. package/dist/theme-packs/hollow/fonts/SpaceMono-400-latin.woff2 +0 -0
  245. package/dist/theme-packs/hollow/fonts/SpaceMono-700-latin.woff2 +0 -0
  246. package/dist/theme-packs/hollow/meta.json +37 -0
  247. package/dist/theme-packs/hollow/pack.css +428 -0
  248. package/dist/theme-packs/ledger/fonts/CrimsonPro-latin-ext-italic.woff2 +0 -0
  249. package/dist/theme-packs/ledger/fonts/CrimsonPro-latin-ext.woff2 +0 -0
  250. package/dist/theme-packs/ledger/fonts/CrimsonPro-latin-italic.woff2 +0 -0
  251. package/dist/theme-packs/ledger/fonts/CrimsonPro-latin.woff2 +0 -0
  252. package/dist/theme-packs/ledger/fonts/IBMPlexMono-400-latin-ext.woff2 +0 -0
  253. package/dist/theme-packs/ledger/fonts/IBMPlexMono-400-latin.woff2 +0 -0
  254. package/dist/theme-packs/ledger/fonts/IBMPlexMono-500-latin-ext.woff2 +0 -0
  255. package/dist/theme-packs/ledger/fonts/IBMPlexMono-500-latin.woff2 +0 -0
  256. package/dist/theme-packs/ledger/fonts/OFL.txt +94 -0
  257. package/dist/theme-packs/ledger/meta.json +37 -0
  258. package/dist/theme-packs/ledger/pack.css +463 -0
  259. package/dist/theme-packs/manuscript/fonts/CourierPrime-400-latin-ext.woff2 +0 -0
  260. package/dist/theme-packs/manuscript/fonts/CourierPrime-400-latin.woff2 +0 -0
  261. package/dist/theme-packs/manuscript/fonts/CourierPrime-700-latin-ext.woff2 +0 -0
  262. package/dist/theme-packs/manuscript/fonts/CourierPrime-700-latin.woff2 +0 -0
  263. package/dist/theme-packs/manuscript/fonts/EBGaramond-latin-italic.woff2 +0 -0
  264. package/dist/theme-packs/manuscript/fonts/EBGaramond-latin.woff2 +0 -0
  265. package/dist/theme-packs/manuscript/fonts/OFL.txt +94 -0
  266. package/dist/theme-packs/manuscript/meta.json +37 -0
  267. package/dist/theme-packs/manuscript/pack.css +376 -0
  268. package/dist/theme-packs/matcha/fonts/MPLUS1Code-latin.woff2 +0 -0
  269. package/dist/theme-packs/matcha/fonts/OFL.txt +95 -0
  270. package/dist/theme-packs/matcha/fonts/ShipporiMincho-500-latin.woff2 +0 -0
  271. package/dist/theme-packs/matcha/fonts/ShipporiMincho-700-latin.woff2 +0 -0
  272. package/dist/theme-packs/matcha/fonts/ZenKakuGothicNew-400-latin.woff2 +0 -0
  273. package/dist/theme-packs/matcha/fonts/ZenKakuGothicNew-500-latin.woff2 +0 -0
  274. package/dist/theme-packs/matcha/meta.json +38 -0
  275. package/dist/theme-packs/matcha/pack.css +409 -0
  276. package/dist/theme-packs/nocturne/fonts/CormorantGaramond-italic-latin.woff2 +0 -0
  277. package/dist/theme-packs/nocturne/fonts/CormorantGaramond-latin.woff2 +0 -0
  278. package/dist/theme-packs/nocturne/fonts/IBMPlexMono-400-latin.woff2 +0 -0
  279. package/dist/theme-packs/nocturne/fonts/IBMPlexMono-500-latin.woff2 +0 -0
  280. package/dist/theme-packs/nocturne/fonts/IBMPlexMono-italic-latin.woff2 +0 -0
  281. package/dist/theme-packs/nocturne/fonts/Manrope-latin.woff2 +0 -0
  282. package/dist/theme-packs/nocturne/fonts/OFL.txt +95 -0
  283. package/dist/theme-packs/nocturne/meta.json +38 -0
  284. package/dist/theme-packs/nocturne/pack.css +502 -0
  285. package/dist/theme-packs/observatory/fonts/JosefinSans-latin.woff2 +0 -0
  286. package/dist/theme-packs/observatory/fonts/Jost-italic-latin.woff2 +0 -0
  287. package/dist/theme-packs/observatory/fonts/Jost-latin.woff2 +0 -0
  288. package/dist/theme-packs/observatory/fonts/OFL.txt +95 -0
  289. package/dist/theme-packs/observatory/fonts/SpaceMono-400-latin.woff2 +0 -0
  290. package/dist/theme-packs/observatory/fonts/SpaceMono-700-latin.woff2 +0 -0
  291. package/dist/theme-packs/observatory/fonts/SpaceMono-italic-latin.woff2 +0 -0
  292. package/dist/theme-packs/observatory/meta.json +38 -0
  293. package/dist/theme-packs/observatory/pack.css +728 -0
  294. package/dist/theme-packs/onyx/fonts/CormorantGaramond-italic-latin.woff2 +0 -0
  295. package/dist/theme-packs/onyx/fonts/CormorantGaramond-latin.woff2 +0 -0
  296. package/dist/theme-packs/onyx/fonts/IBMPlexMono-400-latin-ext.woff2 +0 -0
  297. package/dist/theme-packs/onyx/fonts/IBMPlexMono-400-latin.woff2 +0 -0
  298. package/dist/theme-packs/onyx/fonts/IBMPlexMono-500-latin-ext.woff2 +0 -0
  299. package/dist/theme-packs/onyx/fonts/IBMPlexMono-500-latin.woff2 +0 -0
  300. package/dist/theme-packs/onyx/fonts/Jost-latin.woff2 +0 -0
  301. package/dist/theme-packs/onyx/fonts/OFL.txt +95 -0
  302. package/dist/theme-packs/onyx/meta.json +38 -0
  303. package/dist/theme-packs/onyx/pack.css +497 -0
  304. package/dist/theme-packs/phosphor/fonts/JetBrainsMono-latin-ext.woff2 +0 -0
  305. package/dist/theme-packs/phosphor/fonts/JetBrainsMono-latin.woff2 +0 -0
  306. package/dist/theme-packs/phosphor/fonts/OFL.txt +94 -0
  307. package/dist/theme-packs/phosphor/fonts/VT323-latin-ext.woff2 +0 -0
  308. package/dist/theme-packs/phosphor/fonts/VT323-latin.woff2 +0 -0
  309. package/dist/theme-packs/phosphor/meta.json +38 -0
  310. package/dist/theme-packs/phosphor/pack.css +493 -0
  311. package/dist/theme-packs/solar/fonts/OFL.txt +94 -0
  312. package/dist/theme-packs/solar/fonts/SourceCodePro-italic-latin.woff2 +0 -0
  313. package/dist/theme-packs/solar/fonts/SourceCodePro-latin.woff2 +0 -0
  314. package/dist/theme-packs/solar/fonts/SourceSans3-italic-latin.woff2 +0 -0
  315. package/dist/theme-packs/solar/fonts/SourceSans3-latin.woff2 +0 -0
  316. package/dist/theme-packs/solar/meta.json +37 -0
  317. package/dist/theme-packs/solar/pack.css +380 -0
  318. package/dist/theme-packs/sumi/fonts/IBMPlexMono-400-latin-ext.woff2 +0 -0
  319. package/dist/theme-packs/sumi/fonts/IBMPlexMono-400-latin.woff2 +0 -0
  320. package/dist/theme-packs/sumi/fonts/IBMPlexMono-500-latin-ext.woff2 +0 -0
  321. package/dist/theme-packs/sumi/fonts/IBMPlexMono-500-latin.woff2 +0 -0
  322. package/dist/theme-packs/sumi/fonts/OFL.txt +95 -0
  323. package/dist/theme-packs/sumi/fonts/ShipporiMinchoB1-600-latin.woff2 +0 -0
  324. package/dist/theme-packs/sumi/fonts/ShipporiMinchoB1-700-latin.woff2 +0 -0
  325. package/dist/theme-packs/sumi/fonts/ShipporiMinchoB1-800-latin.woff2 +0 -0
  326. package/dist/theme-packs/sumi/fonts/ZenKakuGothicNew-400-latin.woff2 +0 -0
  327. package/dist/theme-packs/sumi/fonts/ZenKakuGothicNew-500-latin.woff2 +0 -0
  328. package/dist/theme-packs/sumi/meta.json +38 -0
  329. package/dist/theme-packs/sumi/pack.css +502 -0
  330. package/dist/theme-packs/swissgrid/fonts/IBMPlexMono-400-latin-ext.woff2 +0 -0
  331. package/dist/theme-packs/swissgrid/fonts/IBMPlexMono-400-latin.woff2 +0 -0
  332. package/dist/theme-packs/swissgrid/fonts/IBMPlexMono-600-latin.woff2 +0 -0
  333. package/dist/theme-packs/swissgrid/fonts/Inter-latin-ext.woff2 +0 -0
  334. package/dist/theme-packs/swissgrid/fonts/Inter-latin.woff2 +0 -0
  335. package/dist/theme-packs/swissgrid/fonts/InterTight-latin.woff2 +0 -0
  336. package/dist/theme-packs/swissgrid/fonts/OFL.txt +95 -0
  337. package/dist/theme-packs/swissgrid/meta.json +38 -0
  338. package/dist/theme-packs/swissgrid/pack.css +518 -0
  339. package/dist/theme-packs/washi/fonts/MPlus1Code-400-latin.woff2 +0 -0
  340. package/dist/theme-packs/washi/fonts/MPlus1Code-500-latin.woff2 +0 -0
  341. package/dist/theme-packs/washi/fonts/OFL.txt +95 -0
  342. package/dist/theme-packs/washi/fonts/ShipporiMincho-500-latin.woff2 +0 -0
  343. package/dist/theme-packs/washi/fonts/ShipporiMincho-600-latin.woff2 +0 -0
  344. package/dist/theme-packs/washi/fonts/ShipporiMincho-700-latin.woff2 +0 -0
  345. package/dist/theme-packs/washi/fonts/ZenKakuGothicNew-400-latin.woff2 +0 -0
  346. package/dist/theme-packs/washi/fonts/ZenKakuGothicNew-500-latin.woff2 +0 -0
  347. package/dist/theme-packs/washi/fonts/ZenKakuGothicNew-700-latin.woff2 +0 -0
  348. package/dist/theme-packs/washi/meta.json +38 -0
  349. package/dist/theme-packs/washi/pack.css +479 -0
  350. package/dist/theme-packs-registry/index.d.ts +5 -0
  351. package/dist/theme-packs-registry/index.js +30 -0
  352. package/dist/theme-packs-registry/load-registry.d.ts +23 -0
  353. package/dist/theme-packs-registry/load-registry.js +64 -0
  354. package/dist/theme-packs-registry/meta-schema.d.ts +70 -0
  355. package/dist/theme-packs-registry/meta-schema.js +38 -0
  356. package/dist/theme-packs-registry/resolve-enabled-packs.d.ts +25 -0
  357. package/dist/theme-packs-registry/resolve-enabled-packs.js +43 -0
  358. package/dist/theme-packs-registry/token-manifest.d.ts +19 -0
  359. package/dist/theme-packs-registry/token-manifest.js +57 -0
  360. package/dist/theme-packs-registry/validator.d.ts +35 -0
  361. package/dist/theme-packs-registry/validator.js +284 -0
  362. package/dist/theme-toggle/color-scheme-sync.d.ts +2 -4
  363. package/dist/versions-page/index.d.ts +2 -2
  364. package/dist/versions-page/index.js +8 -8
  365. package/eject/breadcrumb/breadcrumb.tsx +4 -4
  366. package/eject/breadcrumb/find-path.ts +2 -2
  367. package/eject/breadcrumb/index.ts +1 -1
  368. package/eject/breadcrumb/types.ts +0 -6
  369. package/eject/code-group/index.tsx +2 -2
  370. package/eject/doc-history/index.tsx +1 -1
  371. package/eject/doc-pager/index.tsx +1 -1
  372. package/eject/footer/footer.tsx +1 -0
  373. package/eject/header/header.tsx +86 -21
  374. package/eject/header/index.ts +3 -0
  375. package/eject/header/types.ts +39 -1
  376. package/eject/site-tree-nav-island/index.tsx +15 -3
  377. package/eject/site-tree-nav-island/state.ts +9 -0
  378. package/eject/theme-toggle/color-scheme-sync.ts +2 -4
  379. package/package.json +35 -29
  380. package/routes-src/404.tsx +4 -1
  381. package/routes-src/_chrome.tsx +6 -5
  382. package/routes-src/_context.ts +4 -0
  383. package/routes-src/_docs-helpers.ts +9 -29
  384. package/routes-src/_virtual.d.ts +4 -0
  385. package/virtual-modules.d.ts +4 -0
  386. package/zfb-config-shim.d.ts +40 -18
  387. package/dist/integrations/llms-txt/index.d.ts +0 -33
  388. package/dist/theme/color-tweak-export-modal.d.ts +0 -16
  389. package/dist/theme/color-tweak-export-modal.js +0 -138
  390. package/dist/theme/design-token-serde.d.ts +0 -183
  391. package/dist/theme/design-token-serde.js +0 -346
  392. package/dist/theme/design-token-types.d.ts +0 -13
  393. package/dist/theme/design-token-types.js +0 -6
  394. package/dist/theme/iframe-bridge.d.ts +0 -42
  395. package/dist/theme/iframe-bridge.js +0 -72
  396. /package/dist/{integrations → plugins/internal}/claude-resources/escape-for-mdx.d.ts +0 -0
  397. /package/dist/{integrations → plugins/internal}/claude-resources/escape-for-mdx.js +0 -0
  398. /package/dist/{integrations → plugins/internal}/claude-resources/generate.d.ts +0 -0
  399. /package/dist/{integrations → plugins/internal}/claude-resources/generate.js +0 -0
  400. /package/dist/{integrations → plugins/internal}/doc-history/pre-build.js +0 -0
  401. /package/dist/{integrations → plugins/internal}/llms-txt/dev-middleware.d.ts +0 -0
  402. /package/dist/{integrations → plugins/internal}/llms-txt/dev-middleware.js +0 -0
  403. /package/dist/{integrations → plugins/internal}/llms-txt/emit.d.ts +0 -0
  404. /package/dist/{integrations → plugins/internal}/llms-txt/emit.js +0 -0
  405. /package/dist/{integrations → plugins/internal}/llms-txt/generate.d.ts +0 -0
  406. /package/dist/{integrations → plugins/internal}/llms-txt/generate.js +0 -0
  407. /package/dist/{integrations → plugins/internal}/llms-txt/index.js +0 -0
  408. /package/dist/{integrations → plugins/internal}/llms-txt/types.js +0 -0
  409. /package/dist/{integrations → plugins/internal}/search-index/build-emitter.d.ts +0 -0
  410. /package/dist/{integrations → plugins/internal}/search-index/build-emitter.js +0 -0
  411. /package/dist/{integrations → plugins/internal}/search-index/collect.d.ts +0 -0
  412. /package/dist/{integrations → plugins/internal}/search-index/dev-middleware.d.ts +0 -0
  413. /package/dist/{integrations → plugins/internal}/search-index/dev-middleware.js +0 -0
  414. /package/dist/{integrations → plugins/internal}/search-index/index.d.ts +0 -0
  415. /package/dist/{integrations → plugins/internal}/search-index/index.js +0 -0
  416. /package/dist/{integrations → plugins/internal}/search-index/types.d.ts +0 -0
  417. /package/dist/{integrations → plugins/internal}/search-index/types.js +0 -0
@@ -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
+ };
@@ -0,0 +1,22 @@
1
+ import type { ThemePackMeta } from "../../../theme-packs-registry/index.js";
2
+ /**
3
+ * Options threaded from `preset.ts`'s `buildPlugins()` into the
4
+ * `@takazudo/zudo-doc/plugins/theme-packs` bare-specifier descriptor — the
5
+ * settings subset `resolveEnabledPacks` needs, plus `base` for URL
6
+ * prefixing in `devMiddleware`.
7
+ */
8
+ export interface ThemePacksPluginOptions {
9
+ base?: string;
10
+ themePack?: string;
11
+ themePacks?: string[];
12
+ }
13
+ /**
14
+ * The aggregated registry manifest shape written to (postBuild) / served at
15
+ * (devMiddleware) `theme-packs/index.json` — ADR Decision 1, "registry
16
+ * manifest": `{ schemaVersion: 1, packs: ThemePackMeta[] }`, `packs` in the
17
+ * resolved `themePacks` order.
18
+ */
19
+ export interface ThemePacksIndexManifest {
20
+ schemaVersion: 1;
21
+ packs: ThemePackMeta[];
22
+ }
File without changes
@@ -1,4 +1,4 @@
1
- import { emitLlmsTxt, createLlmsTxtDevMiddleware } from "../integrations/llms-txt/index.js";
1
+ import { emitLlmsTxt, createLlmsTxtDevMiddleware } from "./internal/llms-txt/index.js";
2
2
  import { connectToZfbHandler } from "./connect-adapter.js";
3
3
  import { getBasePrefix } from "./plugin-utils.js";
4
4
  const plugin = {
@@ -2,6 +2,10 @@ import { createRequire } from "node:module";
2
2
  import { existsSync, statSync, cpSync, rmSync, mkdirSync } from "node:fs";
3
3
  import { dirname, basename, join } from "node:path";
4
4
  import { definePlugin } from "@takazudo/zfb/plugins";
5
+ import {
6
+ loadThemePackRegistry,
7
+ resolveEnabledPacks
8
+ } from "../theme-packs-registry/index.js";
5
9
  function deriveRoutes(settings) {
6
10
  const routes = [];
7
11
  const localeCodes = Object.keys(settings.locales ?? {});
@@ -70,13 +74,19 @@ const plugin = definePlugin({
70
74
  const translations = options.translations ?? {};
71
75
  const tagVocabulary = options.tagVocabulary ?? [];
72
76
  const colorSchemes = options.colorSchemes ?? null;
77
+ const themePacksDir = new URL("../theme-packs/", import.meta.url);
78
+ const themePackRegistry = resolveEnabledPacks(
79
+ loadThemePackRegistry(themePacksDir),
80
+ { themePack: settings.themePack, themePacks: settings.themePacks }
81
+ );
73
82
  ctx.addVirtualModule(
74
83
  "virtual:zudo-doc-route-context",
75
84
  () => `export const routeContext = ${JSON.stringify({
76
85
  settings,
77
86
  translations,
78
87
  tagVocabulary,
79
- colorSchemes
88
+ colorSchemes,
89
+ themePackRegistry
80
90
  })};
81
91
  `
82
92
  );
@@ -1,4 +1,4 @@
1
- import { emitSearchIndex, createSearchIndexDevMiddleware } from "../integrations/search-index/index.js";
1
+ import { emitSearchIndex, createSearchIndexDevMiddleware } from "./internal/search-index/index.js";
2
2
  import { connectToZfbHandler } from "./connect-adapter.js";
3
3
  import { getBasePrefix } from "./plugin-utils.js";
4
4
  const plugin = {
@@ -0,0 +1,3 @@
1
+ import type { ZfbPlugin } from "@takazudo/zfb/plugins";
2
+ declare const plugin: ZfbPlugin;
3
+ export default plugin;
@@ -0,0 +1,40 @@
1
+ import {
2
+ resolveThemePacksForOptions,
3
+ hasCssBearingPack,
4
+ copyEnabledThemePacks,
5
+ createThemePacksDevMiddleware
6
+ } from "./internal/theme-packs/index.js";
7
+ import { connectToZfbHandler } from "./connect-adapter.js";
8
+ import { getBasePrefix } from "./plugin-utils.js";
9
+ function themePacksDir() {
10
+ return new URL("../theme-packs/", import.meta.url);
11
+ }
12
+ const plugin = {
13
+ name: "theme-packs",
14
+ setup(ctx) {
15
+ const options = ctx.options;
16
+ resolveThemePacksForOptions(themePacksDir(), options);
17
+ },
18
+ async postBuild(ctx) {
19
+ const options = ctx.options;
20
+ const enabled = resolveThemePacksForOptions(themePacksDir(), options);
21
+ copyEnabledThemePacks({ packsDir: themePacksDir(), enabled, outDir: ctx.outDir });
22
+ },
23
+ devMiddleware(ctx) {
24
+ const options = ctx.options;
25
+ const enabled = resolveThemePacksForOptions(themePacksDir(), options);
26
+ if (!hasCssBearingPack(enabled)) return;
27
+ const basePrefix = getBasePrefix(options.base);
28
+ const routePrefix = `${basePrefix}/theme-packs`;
29
+ const middleware = createThemePacksDevMiddleware({
30
+ packsDir: themePacksDir(),
31
+ enabled,
32
+ routePrefix
33
+ });
34
+ ctx.register(routePrefix, connectToZfbHandler(middleware));
35
+ }
36
+ };
37
+ var theme_packs_default = plugin;
38
+ export {
39
+ theme_packs_default as default
40
+ };