@cbnventures/docusaurus-preset-nova 0.16.2 → 0.18.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 (1989) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +8 -0
  3. package/assets/presets/lantern/logo.svg +20 -0
  4. package/assets/presets/marshal/logo.svg +7 -0
  5. package/assets/presets/sample/logo.svg +4 -0
  6. package/assets/presets/signal/logo.svg +1 -1
  7. package/build/src/blocks/app-market-download/index.d.ts +4 -0
  8. package/build/src/blocks/app-market-download/index.d.ts.map +1 -0
  9. package/build/src/blocks/app-market-download/index.js +42 -0
  10. package/build/src/blocks/app-market-download/index.js.map +1 -0
  11. package/build/src/blocks/blog-preview/index.d.ts +4 -0
  12. package/build/src/blocks/blog-preview/index.d.ts.map +1 -0
  13. package/build/src/{components → blocks}/blog-preview/index.js +7 -6
  14. package/build/src/blocks/blog-preview/index.js.map +1 -0
  15. package/build/src/blocks/features/index.d.ts +4 -0
  16. package/build/src/blocks/features/index.d.ts.map +1 -0
  17. package/build/src/blocks/features/index.js +8 -0
  18. package/build/src/blocks/features/index.js.map +1 -0
  19. package/build/src/blocks/frame/index.d.ts +4 -0
  20. package/build/src/blocks/frame/index.d.ts.map +1 -0
  21. package/build/src/blocks/frame/index.js +6 -0
  22. package/build/src/blocks/frame/index.js.map +1 -0
  23. package/build/src/blocks/hero/index.d.ts +4 -0
  24. package/build/src/blocks/hero/index.d.ts.map +1 -0
  25. package/build/src/{components → blocks}/hero/index.js +3 -3
  26. package/build/src/blocks/hero/index.js.map +1 -0
  27. package/build/src/{components → blocks}/index.d.ts +1 -0
  28. package/build/src/blocks/index.d.ts.map +1 -0
  29. package/build/src/{components → blocks}/index.js +1 -0
  30. package/build/src/blocks/index.js.map +1 -0
  31. package/build/src/blocks/install-strip/index.d.ts +4 -0
  32. package/build/src/blocks/install-strip/index.d.ts.map +1 -0
  33. package/build/src/blocks/install-strip/index.js +39 -0
  34. package/build/src/blocks/install-strip/index.js.map +1 -0
  35. package/build/src/blocks/spotlight/index.d.ts +4 -0
  36. package/build/src/blocks/spotlight/index.d.ts.map +1 -0
  37. package/build/src/blocks/spotlight/index.js +7 -0
  38. package/build/src/blocks/spotlight/index.js.map +1 -0
  39. package/build/src/blocks/stats/index.d.ts +4 -0
  40. package/build/src/blocks/stats/index.d.ts.map +1 -0
  41. package/build/src/{components → blocks}/stats/index.js +3 -3
  42. package/build/src/blocks/stats/index.js.map +1 -0
  43. package/build/src/blocks/terminology/index.d.ts +4 -0
  44. package/build/src/blocks/terminology/index.d.ts.map +1 -0
  45. package/build/src/blocks/terminology/index.js +12 -0
  46. package/build/src/blocks/terminology/index.js.map +1 -0
  47. package/build/src/blocks/typewriter/index.d.ts +10 -0
  48. package/build/src/blocks/typewriter/index.d.ts.map +1 -0
  49. package/build/src/{components → blocks}/typewriter/index.js +10 -10
  50. package/build/src/blocks/typewriter/index.js.map +1 -0
  51. package/build/src/get-swizzle-config.d.ts.map +1 -1
  52. package/build/src/get-swizzle-config.js +80 -8
  53. package/build/src/get-swizzle-config.js.map +1 -1
  54. package/build/src/index.d.ts +4 -5
  55. package/build/src/index.d.ts.map +1 -1
  56. package/build/src/index.js +75 -52
  57. package/build/src/index.js.map +1 -1
  58. package/build/src/lib/color.d.ts +4 -4
  59. package/build/src/lib/color.d.ts.map +1 -1
  60. package/build/src/lib/color.js +8 -8
  61. package/build/src/lib/color.js.map +1 -1
  62. package/build/src/lib/compare-preset-theme-files.d.ts +3 -0
  63. package/build/src/lib/compare-preset-theme-files.d.ts.map +1 -0
  64. package/build/src/lib/compare-preset-theme-files.js +27 -0
  65. package/build/src/lib/compare-preset-theme-files.js.map +1 -0
  66. package/build/src/lib/css-generator.d.ts +3 -3
  67. package/build/src/lib/css-generator.d.ts.map +1 -1
  68. package/build/src/lib/css-generator.js +57 -22
  69. package/build/src/lib/css-generator.js.map +1 -1
  70. package/build/src/lib/filter-preset-theme-file.d.ts +3 -0
  71. package/build/src/lib/filter-preset-theme-file.d.ts.map +1 -0
  72. package/build/src/lib/filter-preset-theme-file.js +16 -0
  73. package/build/src/lib/filter-preset-theme-file.js.map +1 -0
  74. package/build/src/lib/google-fonts-url.d.ts +3 -0
  75. package/build/src/lib/google-fonts-url.d.ts.map +1 -0
  76. package/build/src/lib/google-fonts-url.js +17 -0
  77. package/build/src/lib/google-fonts-url.js.map +1 -0
  78. package/build/src/lib/mermaid.d.ts +5 -5
  79. package/build/src/lib/mermaid.d.ts.map +1 -1
  80. package/build/src/lib/mermaid.js +56 -52
  81. package/build/src/lib/mermaid.js.map +1 -1
  82. package/build/src/lib/regex.d.ts +28 -0
  83. package/build/src/lib/regex.d.ts.map +1 -1
  84. package/build/src/lib/regex.js +29 -1
  85. package/build/src/lib/regex.js.map +1 -1
  86. package/build/src/lib/rehype-shiki.d.ts +2 -2
  87. package/build/src/lib/rehype-shiki.d.ts.map +1 -1
  88. package/build/src/lib/rehype-shiki.js +68 -7
  89. package/build/src/lib/rehype-shiki.js.map +1 -1
  90. package/build/src/lib/safe-json-ld.d.ts +3 -0
  91. package/build/src/lib/safe-json-ld.d.ts.map +1 -0
  92. package/build/src/lib/safe-json-ld.js +10 -0
  93. package/build/src/lib/safe-json-ld.js.map +1 -0
  94. package/build/src/lib/search/indexer.d.ts +2 -2
  95. package/build/src/lib/search/indexer.d.ts.map +1 -1
  96. package/build/src/lib/search/indexer.js +22 -11
  97. package/build/src/lib/search/indexer.js.map +1 -1
  98. package/build/src/lib/search/perform-search.d.ts +2 -2
  99. package/build/src/lib/search/perform-search.d.ts.map +1 -1
  100. package/build/src/lib/search/perform-search.js +3 -3
  101. package/build/src/lib/search/perform-search.js.map +1 -1
  102. package/build/src/lib/search/use-search-highlight.d.ts +2 -2
  103. package/build/src/lib/search/use-search-highlight.d.ts.map +1 -1
  104. package/build/src/lib/search/use-search-highlight.js.map +1 -1
  105. package/build/src/lib/search/use-search-worker.d.ts +2 -2
  106. package/build/src/lib/search/use-search-worker.d.ts.map +1 -1
  107. package/build/src/lib/search/use-search-worker.js +36 -34
  108. package/build/src/lib/search/use-search-worker.js.map +1 -1
  109. package/build/src/lib/search/worker.d.ts +1 -6
  110. package/build/src/lib/search/worker.d.ts.map +1 -1
  111. package/build/src/lib/search/worker.js +15 -14
  112. package/build/src/lib/search/worker.js.map +1 -1
  113. package/build/src/lib/shiki-themes.d.ts +2 -2
  114. package/build/src/lib/shiki-themes.d.ts.map +1 -1
  115. package/build/src/lib/shiki-themes.js +12 -4
  116. package/build/src/lib/shiki-themes.js.map +1 -1
  117. package/build/src/lib/sticky-layout.d.ts +2 -2
  118. package/build/src/lib/sticky-layout.d.ts.map +1 -1
  119. package/build/src/lib/sticky-layout.js.map +1 -1
  120. package/build/src/lib/toc.d.ts +3 -3
  121. package/build/src/lib/toc.d.ts.map +1 -1
  122. package/build/src/lib/toc.js +4 -4
  123. package/build/src/lib/toc.js.map +1 -1
  124. package/build/src/lib/translations.d.ts +16 -0
  125. package/build/src/lib/translations.d.ts.map +1 -0
  126. package/build/src/lib/translations.js +500 -0
  127. package/build/src/lib/translations.js.map +1 -0
  128. package/build/src/lib/use-details-dismiss.d.ts +3 -0
  129. package/build/src/lib/use-details-dismiss.d.ts.map +1 -0
  130. package/build/src/lib/use-details-dismiss.js +34 -0
  131. package/build/src/lib/use-details-dismiss.js.map +1 -0
  132. package/build/src/lib/use-navbar-active-item.d.ts +3 -0
  133. package/build/src/lib/use-navbar-active-item.d.ts.map +1 -0
  134. package/build/src/lib/use-navbar-active-item.js +68 -0
  135. package/build/src/lib/use-navbar-active-item.js.map +1 -0
  136. package/build/src/lib/use-navbar-overflow.d.ts +3 -0
  137. package/build/src/lib/use-navbar-overflow.d.ts.map +1 -0
  138. package/build/src/lib/use-navbar-overflow.js +106 -0
  139. package/build/src/lib/use-navbar-overflow.js.map +1 -0
  140. package/build/src/options.d.ts +4 -4
  141. package/build/src/options.d.ts.map +1 -1
  142. package/build/src/options.js +97 -88
  143. package/build/src/options.js.map +1 -1
  144. package/build/src/plugins/mermaid-tooltip/client.d.ts +2 -0
  145. package/build/src/plugins/mermaid-tooltip/client.d.ts.map +1 -0
  146. package/build/src/plugins/mermaid-tooltip/client.js +110 -0
  147. package/build/src/plugins/mermaid-tooltip/client.js.map +1 -0
  148. package/build/src/plugins/mermaid-tooltip/index.d.ts +4 -0
  149. package/build/src/plugins/mermaid-tooltip/index.d.ts.map +1 -0
  150. package/build/src/plugins/mermaid-tooltip/index.js +13 -0
  151. package/build/src/plugins/mermaid-tooltip/index.js.map +1 -0
  152. package/build/src/preset.d.ts +2 -2
  153. package/build/src/preset.d.ts.map +1 -1
  154. package/build/src/preset.js +3 -1
  155. package/build/src/preset.js.map +1 -1
  156. package/build/src/presets/envoy/preset.d.ts +2 -2
  157. package/build/src/presets/envoy/preset.d.ts.map +1 -1
  158. package/build/src/presets/envoy/preset.js +27 -3
  159. package/build/src/presets/envoy/preset.js.map +1 -1
  160. package/build/src/presets/foundry/preset.d.ts +2 -2
  161. package/build/src/presets/foundry/preset.d.ts.map +1 -1
  162. package/build/src/presets/foundry/preset.js +27 -3
  163. package/build/src/presets/foundry/preset.js.map +1 -1
  164. package/build/src/presets/index.d.ts +3 -3
  165. package/build/src/presets/index.d.ts.map +1 -1
  166. package/build/src/presets/index.js +12 -6
  167. package/build/src/presets/index.js.map +1 -1
  168. package/build/src/presets/lantern/preset.d.ts +3 -0
  169. package/build/src/presets/lantern/preset.d.ts.map +1 -0
  170. package/build/src/presets/lantern/preset.js +60 -0
  171. package/build/src/presets/lantern/preset.js.map +1 -0
  172. package/build/src/presets/marshal/preset.d.ts +3 -0
  173. package/build/src/presets/marshal/preset.d.ts.map +1 -0
  174. package/build/src/presets/marshal/preset.js +60 -0
  175. package/build/src/presets/marshal/preset.js.map +1 -0
  176. package/build/src/presets/sample/preset.d.ts +3 -0
  177. package/build/src/presets/sample/preset.d.ts.map +1 -0
  178. package/build/src/presets/sample/preset.js +60 -0
  179. package/build/src/presets/sample/preset.js.map +1 -0
  180. package/build/src/presets/sentinel/preset.d.ts +2 -2
  181. package/build/src/presets/sentinel/preset.d.ts.map +1 -1
  182. package/build/src/presets/sentinel/preset.js +27 -3
  183. package/build/src/presets/sentinel/preset.js.map +1 -1
  184. package/build/src/presets/signal/preset.d.ts +2 -2
  185. package/build/src/presets/signal/preset.d.ts.map +1 -1
  186. package/build/src/presets/signal/preset.js +27 -3
  187. package/build/src/presets/signal/preset.js.map +1 -1
  188. package/build/src/scripts/announcement-bar-init.d.ts +2 -2
  189. package/build/src/scripts/announcement-bar-init.d.ts.map +1 -1
  190. package/build/src/scripts/announcement-bar-init.js.map +1 -1
  191. package/build/src/scripts/color-mode-init.d.ts +2 -2
  192. package/build/src/scripts/color-mode-init.d.ts.map +1 -1
  193. package/build/src/scripts/color-mode-init.js.map +1 -1
  194. package/build/src/scripts/data-attribute-query.js.map +1 -1
  195. package/build/src/styles/accessibility.css +6 -29
  196. package/build/src/styles/{components → blocks}/app-market-download/style.css +14 -5
  197. package/build/src/styles/blocks/blog-preview/style.css +127 -0
  198. package/build/src/styles/{components → blocks}/features/style.css +3 -3
  199. package/build/src/styles/blocks/frame/style.css +47 -0
  200. package/build/src/styles/{components → blocks}/hero/style.css +2 -2
  201. package/build/src/styles/{components → blocks}/install-strip/style.css +16 -8
  202. package/build/src/styles/{components → blocks}/spotlight/style.css +6 -6
  203. package/build/src/styles/{components → blocks}/stats/style.css +6 -6
  204. package/build/src/styles/{components → blocks}/terminology/style.css +1 -1
  205. package/build/src/styles/{components → blocks}/typewriter/style.css +2 -2
  206. package/build/src/styles/grid.css +53 -19
  207. package/build/src/styles/presets/envoy/{components → blocks}/app-market-download/style.css +24 -28
  208. package/build/src/styles/presets/envoy/{components → blocks}/blog-preview/style.css +19 -30
  209. package/build/src/styles/presets/envoy/{components → blocks}/features/style.css +16 -72
  210. package/build/src/styles/presets/envoy/blocks/frame/style.css +22 -0
  211. package/build/src/styles/presets/envoy/{components → blocks}/hero/style.css +6 -18
  212. package/build/src/styles/presets/envoy/{components → blocks}/install-strip/style.css +54 -43
  213. package/build/src/styles/presets/envoy/blocks/spotlight/style.css +13 -0
  214. package/build/src/styles/presets/envoy/blocks/stats/style.css +18 -0
  215. package/build/src/styles/presets/envoy/{components → blocks}/terminology/style.css +3 -3
  216. package/build/src/styles/presets/envoy/blocks/typewriter/style.css +12 -0
  217. package/build/src/styles/presets/envoy/preset.css +241 -102
  218. package/build/src/styles/presets/envoy/theme/Admonition/style.css +95 -0
  219. package/build/src/styles/presets/envoy/theme/AnnouncementBar/style.css +9 -5
  220. package/build/src/styles/presets/envoy/theme/BackToTopButton/style.css +13 -8
  221. package/build/src/styles/presets/envoy/theme/Blog/Components/Author/Socials/style.css +34 -0
  222. package/build/src/styles/presets/envoy/theme/Blog/Components/Author/style.css +9 -0
  223. package/build/src/styles/presets/envoy/theme/Blog/Pages/BlogAuthorsListPage/style.css +9 -0
  224. package/build/src/styles/presets/envoy/theme/Blog/Pages/BlogAuthorsPostsPage/style.css +9 -0
  225. package/build/src/styles/presets/envoy/theme/BlogArchivePage/style.css +11 -23
  226. package/build/src/styles/presets/envoy/theme/BlogLayout/style.css +36 -0
  227. package/build/src/styles/presets/envoy/theme/BlogListPage/style.css +9 -0
  228. package/build/src/styles/presets/envoy/theme/BlogListPaginator/style.css +48 -36
  229. package/build/src/styles/presets/envoy/theme/BlogPostItem/style.css +83 -39
  230. package/build/src/styles/presets/envoy/theme/BlogPostItems/style.css +9 -0
  231. package/build/src/styles/presets/envoy/theme/BlogPostPage/style.css +9 -0
  232. package/build/src/styles/presets/envoy/theme/BlogPostPaginator/style.css +8 -20
  233. package/build/src/styles/presets/envoy/theme/BlogSidebar/style.css +7 -13
  234. package/build/src/styles/presets/envoy/theme/BlogSidebarMobile/style.css +9 -0
  235. package/build/src/styles/presets/envoy/theme/BlogTagsListPage/style.css +9 -0
  236. package/build/src/styles/presets/envoy/theme/BlogTagsPostsPage/style.css +9 -0
  237. package/build/src/styles/presets/envoy/theme/CodeBlock/style.css +31 -37
  238. package/build/src/styles/presets/envoy/theme/CodeInline/style.css +22 -0
  239. package/build/src/styles/presets/envoy/theme/ColorModeToggle/style.css +24 -0
  240. package/build/src/styles/presets/envoy/theme/ContentFooter/Edit/style.css +9 -0
  241. package/build/src/styles/presets/envoy/theme/ContentFooter/Share/style.css +9 -0
  242. package/build/src/styles/presets/envoy/theme/ContentFooter/ShareButton/style.css +9 -0
  243. package/build/src/styles/presets/envoy/theme/ContentFooter/Tags/style.css +9 -0
  244. package/build/src/styles/presets/envoy/theme/ContentFooter/style.css +46 -37
  245. package/build/src/styles/presets/envoy/theme/ContentVisibility/Draft/style.css +9 -0
  246. package/build/src/styles/presets/envoy/theme/ContentVisibility/Unlisted/style.css +9 -0
  247. package/build/src/styles/presets/envoy/theme/ContentVisibility/style.css +9 -0
  248. package/build/src/styles/presets/envoy/theme/Details/style.css +8 -6
  249. package/build/src/styles/presets/envoy/theme/DocBreadcrumbs/style.css +12 -8
  250. package/build/src/styles/presets/envoy/theme/DocCard/style.css +13 -13
  251. package/build/src/styles/presets/envoy/theme/DocCardList/style.css +9 -0
  252. package/build/src/styles/presets/envoy/theme/DocCategoryGeneratedIndexPage/style.css +9 -0
  253. package/build/src/styles/presets/envoy/theme/DocItem/Content/style.css +7 -73
  254. package/build/src/styles/presets/envoy/theme/DocItem/Footer/style.css +6 -3
  255. package/build/src/styles/presets/envoy/theme/DocItem/Layout/style.css +9 -0
  256. package/build/src/styles/presets/envoy/theme/DocItem/Metadata/style.css +9 -0
  257. package/build/src/styles/presets/envoy/theme/DocItem/Paginator/style.css +9 -0
  258. package/build/src/styles/presets/envoy/theme/DocItem/TOC/Desktop/style.css +9 -0
  259. package/build/src/styles/presets/envoy/theme/DocItem/TOC/Mobile/style.css +9 -0
  260. package/build/src/styles/presets/envoy/theme/DocItem/style.css +15 -0
  261. package/build/src/styles/presets/envoy/theme/DocPaginator/style.css +14 -20
  262. package/build/src/styles/presets/envoy/theme/DocRoot/Layout/Main/style.css +9 -0
  263. package/build/src/styles/presets/envoy/theme/DocRoot/Layout/Sidebar/style.css +9 -0
  264. package/build/src/styles/presets/envoy/theme/DocRoot/Layout/style.css +9 -0
  265. package/build/src/styles/presets/envoy/theme/DocRoot/style.css +9 -0
  266. package/build/src/styles/presets/envoy/theme/DocSidebar/style.css +89 -131
  267. package/build/src/styles/presets/envoy/theme/DocSidebarItem/Category/style.css +85 -0
  268. package/build/src/styles/presets/envoy/theme/DocSidebarItem/Html/style.css +8 -0
  269. package/build/src/styles/presets/envoy/theme/DocSidebarItem/Link/style.css +59 -0
  270. package/build/src/styles/presets/envoy/theme/DocSidebarItem/style.css +12 -0
  271. package/build/src/styles/presets/envoy/theme/DocSidebarItems/style.css +9 -0
  272. package/build/src/styles/presets/envoy/theme/DocSidebarMobile/style.css +19 -33
  273. package/build/src/styles/presets/envoy/theme/DocTagDocListPage/style.css +14 -0
  274. package/build/src/styles/presets/envoy/theme/DocTagsListPage/style.css +14 -0
  275. package/build/src/styles/presets/envoy/theme/DocVersionBanner/style.css +51 -0
  276. package/build/src/styles/presets/envoy/theme/DocVersionRoot/style.css +9 -0
  277. package/build/src/styles/presets/envoy/theme/DocsRoot/style.css +9 -0
  278. package/build/src/styles/presets/envoy/theme/EditMetaRow/style.css +67 -0
  279. package/build/src/styles/presets/envoy/theme/EditThisPage/style.css +9 -0
  280. package/build/src/styles/presets/envoy/theme/Error/style.css +10 -0
  281. package/build/src/styles/presets/envoy/theme/ErrorPageContent/style.css +10 -0
  282. package/build/src/styles/presets/envoy/theme/Footer/Commons/style.css +76 -16
  283. package/build/src/styles/presets/envoy/theme/Footer/Embassy/style.css +76 -16
  284. package/build/src/styles/presets/envoy/theme/Footer/Launchpad/style.css +40 -28
  285. package/build/src/styles/presets/envoy/theme/Footer/Ledger/style.css +60 -35
  286. package/build/src/styles/presets/envoy/theme/Footer/style.css +11 -0
  287. package/build/src/styles/presets/envoy/theme/Heading/style.css +15 -4
  288. package/build/src/styles/presets/envoy/theme/LastUpdated/style.css +9 -0
  289. package/build/src/styles/presets/envoy/theme/Layout/Provider/style.css +9 -0
  290. package/build/src/styles/presets/envoy/theme/Layout/style.css +9 -0
  291. package/build/src/styles/presets/envoy/theme/Loading/style.css +24 -0
  292. package/build/src/styles/presets/envoy/theme/Logo/style.css +9 -0
  293. package/build/src/styles/presets/envoy/theme/MDXComponents/style.css +8 -0
  294. package/build/src/styles/presets/envoy/theme/MDXContent/style.css +66 -266
  295. package/build/src/styles/presets/envoy/theme/MDXPage/style.css +8 -0
  296. package/build/src/styles/presets/envoy/theme/Mermaid/style.css +10 -0
  297. package/build/src/styles/presets/envoy/theme/Navbar/Bridge/style.css +96 -71
  298. package/build/src/styles/presets/envoy/theme/Navbar/Canopy/style.css +100 -79
  299. package/build/src/styles/presets/envoy/theme/Navbar/Compass/style.css +98 -72
  300. package/build/src/styles/presets/envoy/theme/Navbar/Monolith/style.css +61 -87
  301. package/build/src/styles/presets/envoy/theme/Navbar/More/style.css +10 -0
  302. package/build/src/styles/presets/envoy/theme/Navbar/style.css +150 -0
  303. package/build/src/styles/presets/envoy/theme/NavbarItem/style.css +30 -0
  304. package/build/src/styles/presets/envoy/theme/NotFound/Content/style.css +10 -0
  305. package/build/src/styles/presets/envoy/theme/NotFound/style.css +10 -0
  306. package/build/src/styles/presets/envoy/theme/Root/style.css +9 -0
  307. package/build/src/styles/presets/envoy/theme/SearchBar/style.css +14 -19
  308. package/build/src/styles/presets/envoy/theme/SearchMetadata/style.css +8 -0
  309. package/build/src/styles/presets/envoy/theme/SearchPage/style.css +130 -0
  310. package/build/src/styles/presets/envoy/theme/Showcase/style.css +5 -0
  311. package/build/src/styles/presets/envoy/theme/SiteMetadata/style.css +8 -0
  312. package/build/src/styles/presets/envoy/theme/SkipToContent/style.css +17 -0
  313. package/build/src/styles/presets/envoy/theme/TOC/style.css +33 -4
  314. package/build/src/styles/presets/envoy/theme/TOCCollapsible/style.css +15 -27
  315. package/build/src/styles/presets/envoy/theme/TabItem/style.css +8 -0
  316. package/build/src/styles/presets/envoy/theme/Tabs/style.css +7 -8
  317. package/build/src/styles/presets/envoy/theme/Tag/style.css +8 -51
  318. package/build/src/styles/presets/envoy/theme/TagsListByLetter/style.css +9 -0
  319. package/build/src/styles/presets/envoy/theme/ThemeProvider/TitleFormatter/style.css +9 -0
  320. package/build/src/styles/presets/envoy/theme/ThemeProvider/style.css +9 -0
  321. package/build/src/styles/presets/envoy/theme/ThemedImage/style.css +9 -0
  322. package/build/src/styles/presets/envoy/theme/error-surface/style.css +98 -0
  323. package/build/src/styles/presets/foundry/{components → blocks}/app-market-download/style.css +27 -27
  324. package/build/src/styles/presets/foundry/{components → blocks}/blog-preview/style.css +13 -19
  325. package/build/src/styles/presets/foundry/{components → blocks}/features/style.css +11 -32
  326. package/build/src/styles/presets/foundry/blocks/frame/style.css +21 -0
  327. package/build/src/styles/presets/foundry/{components → blocks}/hero/style.css +7 -15
  328. package/build/src/styles/presets/foundry/{components → blocks}/install-strip/style.css +37 -24
  329. package/build/src/styles/presets/foundry/blocks/spotlight/style.css +13 -0
  330. package/build/src/styles/presets/foundry/blocks/stats/style.css +18 -0
  331. package/build/src/styles/presets/foundry/{components → blocks}/terminology/style.css +3 -3
  332. package/build/src/styles/presets/foundry/blocks/typewriter/style.css +12 -0
  333. package/build/src/styles/presets/foundry/preset.css +245 -172
  334. package/build/src/styles/presets/foundry/theme/Admonition/style.css +77 -0
  335. package/build/src/styles/presets/foundry/theme/AnnouncementBar/style.css +24 -4
  336. package/build/src/styles/presets/foundry/theme/BackToTopButton/style.css +9 -4
  337. package/build/src/styles/presets/foundry/theme/Blog/Components/Author/Socials/style.css +32 -0
  338. package/build/src/styles/presets/foundry/theme/Blog/Components/Author/style.css +9 -0
  339. package/build/src/styles/presets/foundry/theme/Blog/Pages/BlogAuthorsListPage/style.css +9 -0
  340. package/build/src/styles/presets/foundry/theme/Blog/Pages/BlogAuthorsPostsPage/style.css +9 -0
  341. package/build/src/styles/presets/foundry/theme/BlogArchivePage/style.css +7 -19
  342. package/build/src/styles/presets/foundry/theme/BlogLayout/style.css +38 -0
  343. package/build/src/styles/presets/foundry/theme/BlogListPage/style.css +9 -0
  344. package/build/src/styles/presets/foundry/theme/BlogListPaginator/style.css +21 -17
  345. package/build/src/styles/presets/foundry/theme/BlogPostItem/style.css +76 -29
  346. package/build/src/styles/presets/foundry/theme/BlogPostItems/style.css +9 -0
  347. package/build/src/styles/presets/foundry/theme/BlogPostPage/style.css +9 -0
  348. package/build/src/styles/presets/foundry/theme/BlogPostPaginator/style.css +6 -18
  349. package/build/src/styles/presets/foundry/theme/BlogSidebar/style.css +10 -16
  350. package/build/src/styles/presets/foundry/theme/BlogSidebarMobile/style.css +9 -0
  351. package/build/src/styles/presets/foundry/theme/BlogTagsListPage/style.css +9 -0
  352. package/build/src/styles/presets/foundry/theme/BlogTagsPostsPage/style.css +9 -0
  353. package/build/src/styles/presets/foundry/theme/CodeBlock/style.css +25 -59
  354. package/build/src/styles/presets/foundry/theme/CodeInline/style.css +21 -0
  355. package/build/src/styles/presets/foundry/theme/ColorModeToggle/style.css +24 -0
  356. package/build/src/styles/presets/foundry/theme/ContentFooter/Edit/style.css +9 -0
  357. package/build/src/styles/presets/foundry/theme/ContentFooter/Share/style.css +9 -0
  358. package/build/src/styles/presets/foundry/theme/ContentFooter/ShareButton/style.css +9 -0
  359. package/build/src/styles/presets/foundry/theme/ContentFooter/Tags/style.css +9 -0
  360. package/build/src/styles/presets/foundry/theme/ContentFooter/style.css +51 -33
  361. package/build/src/styles/presets/foundry/theme/ContentVisibility/Draft/style.css +9 -0
  362. package/build/src/styles/presets/foundry/theme/ContentVisibility/Unlisted/style.css +9 -0
  363. package/build/src/styles/presets/foundry/theme/ContentVisibility/style.css +9 -0
  364. package/build/src/styles/presets/foundry/theme/Details/style.css +52 -12
  365. package/build/src/styles/presets/foundry/theme/DocBreadcrumbs/style.css +11 -15
  366. package/build/src/styles/presets/foundry/theme/DocCard/style.css +7 -7
  367. package/build/src/styles/presets/foundry/theme/DocCardList/style.css +9 -0
  368. package/build/src/styles/presets/foundry/theme/DocCategoryGeneratedIndexPage/style.css +9 -0
  369. package/build/src/styles/presets/foundry/theme/DocItem/Content/style.css +7 -14
  370. package/build/src/styles/presets/foundry/theme/DocItem/Footer/style.css +5 -1
  371. package/build/src/styles/presets/foundry/theme/DocItem/Layout/style.css +9 -0
  372. package/build/src/styles/presets/foundry/theme/DocItem/Metadata/style.css +9 -0
  373. package/build/src/styles/presets/foundry/theme/DocItem/Paginator/style.css +9 -0
  374. package/build/src/styles/presets/foundry/theme/DocItem/TOC/Desktop/style.css +9 -0
  375. package/build/src/styles/presets/foundry/theme/DocItem/TOC/Mobile/style.css +9 -0
  376. package/build/src/styles/presets/foundry/theme/DocItem/style.css +14 -0
  377. package/build/src/styles/presets/foundry/theme/DocPaginator/style.css +10 -18
  378. package/build/src/styles/presets/foundry/theme/DocRoot/Layout/Main/style.css +9 -0
  379. package/build/src/styles/presets/foundry/theme/DocRoot/Layout/Sidebar/style.css +9 -0
  380. package/build/src/styles/presets/foundry/theme/DocRoot/Layout/style.css +9 -0
  381. package/build/src/styles/presets/foundry/theme/DocRoot/style.css +9 -0
  382. package/build/src/styles/presets/foundry/theme/DocSidebar/style.css +64 -77
  383. package/build/src/styles/presets/foundry/theme/DocSidebarItem/Category/style.css +74 -0
  384. package/build/src/styles/presets/foundry/theme/DocSidebarItem/Html/style.css +8 -0
  385. package/build/src/styles/presets/foundry/theme/DocSidebarItem/Link/style.css +53 -0
  386. package/build/src/styles/presets/foundry/theme/DocSidebarItem/style.css +12 -0
  387. package/build/src/styles/presets/foundry/theme/DocSidebarItems/style.css +9 -0
  388. package/build/src/styles/presets/foundry/theme/DocSidebarMobile/style.css +14 -20
  389. package/build/src/styles/presets/foundry/theme/DocTagDocListPage/style.css +13 -0
  390. package/build/src/styles/presets/foundry/theme/DocTagsListPage/style.css +13 -0
  391. package/build/src/styles/presets/foundry/theme/DocVersionBanner/style.css +64 -0
  392. package/build/src/styles/presets/foundry/theme/DocVersionRoot/style.css +9 -0
  393. package/build/src/styles/presets/foundry/theme/DocsRoot/style.css +9 -0
  394. package/build/src/styles/presets/foundry/theme/EditMetaRow/style.css +63 -0
  395. package/build/src/styles/presets/foundry/theme/EditThisPage/style.css +9 -0
  396. package/build/src/styles/presets/foundry/theme/Error/style.css +10 -0
  397. package/build/src/styles/presets/foundry/theme/ErrorPageContent/style.css +10 -0
  398. package/build/src/styles/presets/foundry/theme/Footer/Commons/style.css +74 -23
  399. package/build/src/styles/presets/foundry/theme/Footer/Embassy/style.css +62 -11
  400. package/build/src/styles/presets/foundry/theme/Footer/Launchpad/style.css +26 -14
  401. package/build/src/styles/presets/foundry/theme/Footer/Ledger/style.css +46 -31
  402. package/build/src/styles/presets/foundry/theme/Footer/style.css +11 -0
  403. package/build/src/styles/presets/foundry/theme/Heading/style.css +52 -18
  404. package/build/src/styles/presets/foundry/theme/LastUpdated/style.css +9 -0
  405. package/build/src/styles/presets/foundry/theme/Layout/Provider/style.css +9 -0
  406. package/build/src/styles/presets/foundry/theme/Layout/style.css +9 -0
  407. package/build/src/styles/presets/foundry/theme/Loading/style.css +27 -0
  408. package/build/src/styles/presets/foundry/theme/Logo/style.css +9 -0
  409. package/build/src/styles/presets/foundry/theme/MDXComponents/style.css +8 -0
  410. package/build/src/styles/presets/foundry/theme/MDXContent/style.css +121 -292
  411. package/build/src/styles/presets/foundry/theme/MDXPage/style.css +8 -0
  412. package/build/src/styles/presets/foundry/theme/Mermaid/style.css +10 -0
  413. package/build/src/styles/presets/foundry/theme/Navbar/Bridge/style.css +93 -74
  414. package/build/src/styles/presets/foundry/theme/Navbar/Canopy/style.css +91 -69
  415. package/build/src/styles/presets/foundry/theme/Navbar/Compass/style.css +85 -66
  416. package/build/src/styles/presets/foundry/theme/Navbar/Monolith/style.css +45 -73
  417. package/build/src/styles/presets/foundry/theme/Navbar/More/style.css +10 -0
  418. package/build/src/styles/presets/foundry/theme/Navbar/style.css +151 -0
  419. package/build/src/styles/presets/foundry/theme/NavbarItem/style.css +26 -0
  420. package/build/src/styles/presets/foundry/theme/NotFound/Content/style.css +10 -0
  421. package/build/src/styles/presets/foundry/theme/NotFound/style.css +10 -0
  422. package/build/src/styles/presets/foundry/theme/Root/style.css +9 -0
  423. package/build/src/styles/presets/foundry/theme/SearchBar/style.css +13 -14
  424. package/build/src/styles/presets/foundry/theme/SearchMetadata/style.css +8 -0
  425. package/build/src/styles/presets/foundry/theme/SearchPage/style.css +121 -0
  426. package/build/src/styles/presets/foundry/theme/Showcase/style.css +5 -0
  427. package/build/src/styles/presets/foundry/theme/SiteMetadata/style.css +8 -0
  428. package/build/src/styles/presets/foundry/theme/SkipToContent/style.css +18 -0
  429. package/build/src/styles/presets/foundry/theme/TOC/style.css +33 -4
  430. package/build/src/styles/presets/foundry/theme/TOCCollapsible/style.css +9 -21
  431. package/build/src/styles/presets/foundry/theme/TabItem/style.css +8 -0
  432. package/build/src/styles/presets/foundry/theme/Tabs/style.css +9 -10
  433. package/build/src/styles/presets/foundry/theme/Tag/style.css +6 -46
  434. package/build/src/styles/presets/foundry/theme/TagsListByLetter/style.css +9 -0
  435. package/build/src/styles/presets/foundry/theme/ThemeProvider/TitleFormatter/style.css +9 -0
  436. package/build/src/styles/presets/foundry/theme/ThemeProvider/style.css +9 -0
  437. package/build/src/styles/presets/foundry/theme/ThemedImage/style.css +9 -0
  438. package/build/src/styles/presets/foundry/theme/error-surface/style.css +77 -0
  439. package/build/src/styles/presets/lantern/blocks/app-market-download/style.css +124 -0
  440. package/build/src/styles/presets/lantern/blocks/blog-preview/style.css +222 -0
  441. package/build/src/styles/presets/lantern/blocks/features/style.css +114 -0
  442. package/build/src/styles/presets/lantern/blocks/frame/style.css +29 -0
  443. package/build/src/styles/presets/lantern/blocks/hero/style.css +117 -0
  444. package/build/src/styles/presets/lantern/blocks/install-strip/style.css +194 -0
  445. package/build/src/styles/presets/lantern/blocks/spotlight/style.css +67 -0
  446. package/build/src/styles/presets/lantern/blocks/stats/style.css +63 -0
  447. package/build/src/styles/presets/lantern/blocks/terminology/style.css +51 -0
  448. package/build/src/styles/presets/lantern/blocks/typewriter/style.css +12 -0
  449. package/build/src/styles/presets/lantern/preset.css +699 -0
  450. package/build/src/styles/presets/lantern/theme/Admonition/style.css +154 -0
  451. package/build/src/styles/presets/lantern/theme/AnnouncementBar/style.css +96 -0
  452. package/build/src/styles/presets/lantern/theme/BackToTopButton/style.css +82 -0
  453. package/build/src/styles/presets/lantern/theme/Blog/Components/Author/Socials/style.css +26 -0
  454. package/build/src/styles/presets/lantern/theme/Blog/Components/Author/style.css +9 -0
  455. package/build/src/styles/presets/lantern/theme/Blog/Pages/BlogAuthorsListPage/style.css +5 -0
  456. package/build/src/styles/presets/lantern/theme/Blog/Pages/BlogAuthorsPostsPage/style.css +5 -0
  457. package/build/src/styles/presets/lantern/theme/BlogArchivePage/style.css +50 -0
  458. package/build/src/styles/presets/lantern/theme/BlogLayout/style.css +37 -0
  459. package/build/src/styles/presets/lantern/theme/BlogListPage/style.css +5 -0
  460. package/build/src/styles/presets/lantern/theme/BlogListPaginator/style.css +106 -0
  461. package/build/src/styles/presets/lantern/theme/BlogPostItem/style.css +257 -0
  462. package/build/src/styles/presets/lantern/theme/BlogPostItems/style.css +5 -0
  463. package/build/src/styles/presets/lantern/theme/BlogPostPage/style.css +5 -0
  464. package/build/src/styles/presets/lantern/theme/BlogPostPaginator/style.css +112 -0
  465. package/build/src/styles/presets/lantern/theme/BlogSidebar/style.css +75 -0
  466. package/build/src/styles/presets/lantern/theme/BlogSidebarMobile/style.css +5 -0
  467. package/build/src/styles/presets/lantern/theme/BlogTagsListPage/style.css +5 -0
  468. package/build/src/styles/presets/lantern/theme/BlogTagsPostsPage/style.css +5 -0
  469. package/build/src/styles/presets/lantern/theme/CodeBlock/style.css +166 -0
  470. package/build/src/styles/presets/lantern/theme/CodeInline/style.css +22 -0
  471. package/build/src/styles/presets/lantern/theme/ColorModeToggle/style.css +24 -0
  472. package/build/src/styles/presets/lantern/theme/ContentFooter/Edit/style.css +9 -0
  473. package/build/src/styles/presets/lantern/theme/ContentFooter/Share/style.css +9 -0
  474. package/build/src/styles/presets/lantern/theme/ContentFooter/ShareButton/style.css +9 -0
  475. package/build/src/styles/presets/lantern/theme/ContentFooter/Tags/style.css +9 -0
  476. package/build/src/styles/presets/lantern/theme/ContentFooter/style.css +116 -0
  477. package/build/src/styles/presets/lantern/theme/ContentVisibility/Draft/style.css +5 -0
  478. package/build/src/styles/presets/lantern/theme/ContentVisibility/Unlisted/style.css +5 -0
  479. package/build/src/styles/presets/lantern/theme/ContentVisibility/style.css +5 -0
  480. package/build/src/styles/presets/lantern/theme/Details/style.css +165 -0
  481. package/build/src/styles/presets/lantern/theme/DocBreadcrumbs/style.css +84 -0
  482. package/build/src/styles/presets/lantern/theme/DocCard/style.css +98 -0
  483. package/build/src/styles/presets/lantern/theme/DocCardList/style.css +5 -0
  484. package/build/src/styles/presets/lantern/theme/DocCategoryGeneratedIndexPage/style.css +5 -0
  485. package/build/src/styles/presets/lantern/theme/DocItem/Content/style.css +11 -0
  486. package/build/src/styles/presets/lantern/theme/DocItem/Footer/style.css +25 -0
  487. package/build/src/styles/presets/lantern/theme/DocItem/Layout/style.css +9 -0
  488. package/build/src/styles/presets/lantern/theme/DocItem/Metadata/style.css +9 -0
  489. package/build/src/styles/presets/lantern/theme/DocItem/Paginator/style.css +9 -0
  490. package/build/src/styles/presets/lantern/theme/DocItem/TOC/Desktop/style.css +9 -0
  491. package/build/src/styles/presets/lantern/theme/DocItem/TOC/Mobile/style.css +9 -0
  492. package/build/src/styles/presets/lantern/theme/DocItem/style.css +14 -0
  493. package/build/src/styles/presets/lantern/theme/DocPaginator/style.css +136 -0
  494. package/build/src/styles/presets/lantern/theme/DocRoot/Layout/Main/style.css +9 -0
  495. package/build/src/styles/presets/lantern/theme/DocRoot/Layout/Sidebar/style.css +9 -0
  496. package/build/src/styles/presets/lantern/theme/DocRoot/Layout/style.css +9 -0
  497. package/build/src/styles/presets/lantern/theme/DocRoot/style.css +9 -0
  498. package/build/src/styles/presets/lantern/theme/DocSidebar/style.css +104 -0
  499. package/build/src/styles/presets/lantern/theme/DocSidebarItem/Category/style.css +75 -0
  500. package/build/src/styles/presets/lantern/theme/DocSidebarItem/Html/style.css +7 -0
  501. package/build/src/styles/presets/lantern/theme/DocSidebarItem/Link/style.css +45 -0
  502. package/build/src/styles/presets/lantern/theme/DocSidebarItem/style.css +12 -0
  503. package/build/src/styles/presets/lantern/theme/DocSidebarItems/style.css +5 -0
  504. package/build/src/styles/presets/lantern/theme/DocSidebarMobile/style.css +110 -0
  505. package/build/src/styles/presets/lantern/theme/DocTagDocListPage/style.css +5 -0
  506. package/build/src/styles/presets/lantern/theme/DocTagsListPage/style.css +5 -0
  507. package/build/src/styles/presets/lantern/theme/DocVersionBanner/style.css +53 -0
  508. package/build/src/styles/presets/lantern/theme/DocVersionRoot/style.css +9 -0
  509. package/build/src/styles/presets/lantern/theme/DocsRoot/style.css +9 -0
  510. package/build/src/styles/presets/lantern/theme/EditMetaRow/style.css +91 -0
  511. package/build/src/styles/presets/lantern/theme/EditThisPage/style.css +9 -0
  512. package/build/src/styles/presets/lantern/theme/Error/style.css +10 -0
  513. package/build/src/styles/presets/lantern/theme/ErrorPageContent/style.css +10 -0
  514. package/build/src/styles/presets/lantern/theme/Footer/Commons/style.css +207 -0
  515. package/build/src/styles/presets/lantern/theme/Footer/Embassy/style.css +263 -0
  516. package/build/src/styles/presets/lantern/theme/Footer/Launchpad/style.css +207 -0
  517. package/build/src/styles/presets/lantern/theme/Footer/Ledger/style.css +142 -0
  518. package/build/src/styles/presets/lantern/theme/Footer/style.css +11 -0
  519. package/build/src/styles/presets/lantern/theme/Heading/style.css +133 -0
  520. package/build/src/styles/presets/lantern/theme/LastUpdated/style.css +9 -0
  521. package/build/src/styles/presets/lantern/theme/Layout/Provider/style.css +9 -0
  522. package/build/src/styles/presets/lantern/theme/Layout/style.css +9 -0
  523. package/build/src/styles/presets/lantern/theme/Loading/style.css +28 -0
  524. package/build/src/styles/presets/lantern/theme/Logo/style.css +9 -0
  525. package/build/src/styles/presets/lantern/theme/MDXComponents/style.css +8 -0
  526. package/build/src/styles/presets/lantern/theme/MDXContent/style.css +213 -0
  527. package/build/src/styles/presets/lantern/theme/MDXPage/style.css +8 -0
  528. package/build/src/styles/presets/lantern/theme/Mermaid/style.css +18 -0
  529. package/build/src/styles/presets/lantern/theme/Navbar/Bridge/style.css +397 -0
  530. package/build/src/styles/presets/lantern/theme/Navbar/Canopy/style.css +432 -0
  531. package/build/src/styles/presets/lantern/theme/Navbar/Compass/style.css +401 -0
  532. package/build/src/styles/presets/lantern/theme/Navbar/Monolith/style.css +286 -0
  533. package/build/src/styles/presets/lantern/theme/Navbar/More/style.css +10 -0
  534. package/build/src/styles/presets/lantern/theme/Navbar/style.css +167 -0
  535. package/build/src/styles/presets/lantern/theme/NavbarItem/style.css +26 -0
  536. package/build/src/styles/presets/lantern/theme/NotFound/Content/style.css +10 -0
  537. package/build/src/styles/presets/lantern/theme/NotFound/style.css +10 -0
  538. package/build/src/styles/presets/lantern/theme/Root/style.css +9 -0
  539. package/build/src/styles/presets/lantern/theme/SearchBar/style.css +163 -0
  540. package/build/src/styles/presets/lantern/theme/SearchMetadata/style.css +8 -0
  541. package/build/src/styles/presets/lantern/theme/SearchPage/style.css +127 -0
  542. package/build/src/styles/presets/lantern/theme/Showcase/style.css +5 -0
  543. package/build/src/styles/presets/lantern/theme/SiteMetadata/style.css +8 -0
  544. package/build/src/styles/presets/lantern/theme/SkipToContent/style.css +18 -0
  545. package/build/src/styles/presets/lantern/theme/TOC/style.css +54 -0
  546. package/build/src/styles/presets/lantern/theme/TOCCollapsible/style.css +147 -0
  547. package/build/src/styles/presets/lantern/theme/TabItem/style.css +8 -0
  548. package/build/src/styles/presets/lantern/theme/Tabs/style.css +79 -0
  549. package/build/src/styles/presets/lantern/theme/Tag/style.css +38 -0
  550. package/build/src/styles/presets/lantern/theme/TagsListByLetter/style.css +5 -0
  551. package/build/src/styles/presets/lantern/theme/ThemeProvider/TitleFormatter/style.css +9 -0
  552. package/build/src/styles/presets/lantern/theme/ThemeProvider/style.css +9 -0
  553. package/build/src/styles/presets/lantern/theme/ThemedImage/style.css +5 -0
  554. package/build/src/styles/presets/lantern/theme/error-surface/style.css +84 -0
  555. package/build/src/styles/presets/marshal/blocks/app-market-download/style.css +145 -0
  556. package/build/src/styles/presets/marshal/blocks/blog-preview/style.css +189 -0
  557. package/build/src/styles/presets/marshal/blocks/features/style.css +104 -0
  558. package/build/src/styles/presets/marshal/blocks/frame/style.css +26 -0
  559. package/build/src/styles/presets/marshal/blocks/hero/style.css +124 -0
  560. package/build/src/styles/presets/marshal/blocks/install-strip/style.css +187 -0
  561. package/build/src/styles/presets/marshal/blocks/spotlight/style.css +13 -0
  562. package/build/src/styles/presets/marshal/blocks/stats/style.css +18 -0
  563. package/build/src/styles/presets/marshal/blocks/terminology/style.css +67 -0
  564. package/build/src/styles/presets/marshal/blocks/typewriter/style.css +12 -0
  565. package/build/src/styles/presets/marshal/preset.css +689 -0
  566. package/build/src/styles/presets/marshal/theme/Admonition/style.css +143 -0
  567. package/build/src/styles/presets/marshal/theme/AnnouncementBar/style.css +89 -0
  568. package/build/src/styles/presets/marshal/theme/BackToTopButton/style.css +80 -0
  569. package/build/src/styles/presets/marshal/theme/Blog/Components/Author/Socials/style.css +27 -0
  570. package/build/src/styles/presets/marshal/theme/Blog/Components/Author/style.css +9 -0
  571. package/build/src/styles/presets/marshal/theme/Blog/Pages/BlogAuthorsListPage/style.css +5 -0
  572. package/build/src/styles/presets/marshal/theme/Blog/Pages/BlogAuthorsPostsPage/style.css +5 -0
  573. package/build/src/styles/presets/marshal/theme/BlogArchivePage/style.css +51 -0
  574. package/build/src/styles/presets/marshal/theme/BlogLayout/style.css +38 -0
  575. package/build/src/styles/presets/marshal/theme/BlogListPage/style.css +5 -0
  576. package/build/src/styles/presets/marshal/theme/BlogListPaginator/style.css +160 -0
  577. package/build/src/styles/presets/marshal/theme/BlogPostItem/style.css +251 -0
  578. package/build/src/styles/presets/marshal/theme/BlogPostItems/style.css +5 -0
  579. package/build/src/styles/presets/marshal/theme/BlogPostPage/style.css +5 -0
  580. package/build/src/styles/presets/marshal/theme/BlogPostPaginator/style.css +128 -0
  581. package/build/src/styles/presets/marshal/theme/BlogSidebar/style.css +87 -0
  582. package/build/src/styles/presets/marshal/theme/BlogSidebarMobile/style.css +5 -0
  583. package/build/src/styles/presets/marshal/theme/BlogTagsListPage/style.css +5 -0
  584. package/build/src/styles/presets/marshal/theme/BlogTagsPostsPage/style.css +5 -0
  585. package/build/src/styles/presets/marshal/theme/CodeBlock/style.css +178 -0
  586. package/build/src/styles/presets/marshal/theme/CodeInline/style.css +23 -0
  587. package/build/src/styles/presets/marshal/theme/ColorModeToggle/style.css +25 -0
  588. package/build/src/styles/presets/marshal/theme/ContentFooter/Edit/style.css +9 -0
  589. package/build/src/styles/presets/marshal/theme/ContentFooter/Share/style.css +9 -0
  590. package/build/src/styles/presets/marshal/theme/ContentFooter/ShareButton/style.css +9 -0
  591. package/build/src/styles/presets/marshal/theme/ContentFooter/Tags/style.css +9 -0
  592. package/build/src/styles/presets/marshal/theme/ContentFooter/style.css +117 -0
  593. package/build/src/styles/presets/marshal/theme/ContentVisibility/Draft/style.css +5 -0
  594. package/build/src/styles/presets/marshal/theme/ContentVisibility/Unlisted/style.css +5 -0
  595. package/build/src/styles/presets/marshal/theme/ContentVisibility/style.css +5 -0
  596. package/build/src/styles/presets/marshal/theme/Details/style.css +167 -0
  597. package/build/src/styles/presets/marshal/theme/DocBreadcrumbs/style.css +108 -0
  598. package/build/src/styles/presets/marshal/theme/DocCard/style.css +113 -0
  599. package/build/src/styles/presets/marshal/theme/DocCardList/style.css +5 -0
  600. package/build/src/styles/presets/marshal/theme/DocCategoryGeneratedIndexPage/style.css +5 -0
  601. package/build/src/styles/presets/marshal/theme/DocItem/Content/style.css +28 -0
  602. package/build/src/styles/presets/marshal/theme/DocItem/Footer/style.css +31 -0
  603. package/build/src/styles/presets/marshal/theme/DocItem/Layout/style.css +9 -0
  604. package/build/src/styles/presets/marshal/theme/DocItem/Metadata/style.css +9 -0
  605. package/build/src/styles/presets/marshal/theme/DocItem/Paginator/style.css +9 -0
  606. package/build/src/styles/presets/marshal/theme/DocItem/TOC/Desktop/style.css +9 -0
  607. package/build/src/styles/presets/marshal/theme/DocItem/TOC/Mobile/style.css +9 -0
  608. package/build/src/styles/presets/marshal/theme/DocItem/style.css +14 -0
  609. package/build/src/styles/presets/marshal/theme/DocPaginator/style.css +147 -0
  610. package/build/src/styles/presets/marshal/theme/DocRoot/Layout/Main/style.css +9 -0
  611. package/build/src/styles/presets/marshal/theme/DocRoot/Layout/Sidebar/style.css +9 -0
  612. package/build/src/styles/presets/marshal/theme/DocRoot/Layout/style.css +9 -0
  613. package/build/src/styles/presets/marshal/theme/DocRoot/style.css +9 -0
  614. package/build/src/styles/presets/marshal/theme/DocSidebar/style.css +86 -0
  615. package/build/src/styles/presets/marshal/theme/DocSidebarItem/Category/style.css +76 -0
  616. package/build/src/styles/presets/marshal/theme/DocSidebarItem/Html/style.css +7 -0
  617. package/build/src/styles/presets/marshal/theme/DocSidebarItem/Link/style.css +64 -0
  618. package/build/src/styles/presets/marshal/theme/DocSidebarItem/style.css +11 -0
  619. package/build/src/styles/presets/marshal/theme/DocSidebarItems/style.css +5 -0
  620. package/build/src/styles/presets/marshal/theme/DocSidebarMobile/style.css +118 -0
  621. package/build/src/styles/presets/marshal/theme/DocTagDocListPage/style.css +5 -0
  622. package/build/src/styles/presets/marshal/theme/DocTagsListPage/style.css +5 -0
  623. package/build/src/styles/presets/marshal/theme/DocVersionBanner/style.css +52 -0
  624. package/build/src/styles/presets/marshal/theme/DocVersionRoot/style.css +9 -0
  625. package/build/src/styles/presets/marshal/theme/DocsRoot/style.css +9 -0
  626. package/build/src/styles/presets/marshal/theme/EditMetaRow/style.css +85 -0
  627. package/build/src/styles/presets/marshal/theme/EditThisPage/style.css +9 -0
  628. package/build/src/styles/presets/marshal/theme/Error/style.css +10 -0
  629. package/build/src/styles/presets/marshal/theme/ErrorPageContent/style.css +10 -0
  630. package/build/src/styles/presets/marshal/theme/Footer/Commons/style.css +211 -0
  631. package/build/src/styles/presets/marshal/theme/Footer/Embassy/style.css +273 -0
  632. package/build/src/styles/presets/marshal/theme/Footer/Launchpad/style.css +211 -0
  633. package/build/src/styles/presets/marshal/theme/Footer/Ledger/style.css +140 -0
  634. package/build/src/styles/presets/marshal/theme/Footer/style.css +11 -0
  635. package/build/src/styles/presets/marshal/theme/Heading/style.css +80 -0
  636. package/build/src/styles/presets/marshal/theme/LastUpdated/style.css +9 -0
  637. package/build/src/styles/presets/marshal/theme/Layout/Provider/style.css +9 -0
  638. package/build/src/styles/presets/marshal/theme/Layout/style.css +9 -0
  639. package/build/src/styles/presets/marshal/theme/Loading/style.css +26 -0
  640. package/build/src/styles/presets/marshal/theme/Logo/style.css +9 -0
  641. package/build/src/styles/presets/marshal/theme/MDXComponents/style.css +8 -0
  642. package/build/src/styles/presets/marshal/theme/MDXContent/style.css +216 -0
  643. package/build/src/styles/presets/marshal/theme/MDXPage/style.css +8 -0
  644. package/build/src/styles/presets/marshal/theme/Mermaid/style.css +17 -0
  645. package/build/src/styles/presets/marshal/theme/Navbar/Bridge/style.css +347 -0
  646. package/build/src/styles/presets/marshal/theme/Navbar/Canopy/style.css +378 -0
  647. package/build/src/styles/presets/marshal/theme/Navbar/Compass/style.css +348 -0
  648. package/build/src/styles/presets/marshal/theme/Navbar/Monolith/style.css +237 -0
  649. package/build/src/styles/presets/marshal/theme/Navbar/More/style.css +10 -0
  650. package/build/src/styles/presets/marshal/theme/Navbar/style.css +157 -0
  651. package/build/src/styles/presets/marshal/theme/NavbarItem/style.css +30 -0
  652. package/build/src/styles/presets/marshal/theme/NotFound/Content/style.css +10 -0
  653. package/build/src/styles/presets/marshal/theme/NotFound/style.css +10 -0
  654. package/build/src/styles/presets/marshal/theme/Root/style.css +9 -0
  655. package/build/src/styles/presets/marshal/theme/SearchBar/style.css +142 -0
  656. package/build/src/styles/presets/marshal/theme/SearchMetadata/style.css +8 -0
  657. package/build/src/styles/presets/marshal/theme/SearchPage/style.css +143 -0
  658. package/build/src/styles/presets/marshal/theme/Showcase/style.css +5 -0
  659. package/build/src/styles/presets/marshal/theme/SiteMetadata/style.css +8 -0
  660. package/build/src/styles/presets/marshal/theme/SkipToContent/style.css +23 -0
  661. package/build/src/styles/presets/marshal/theme/TOC/style.css +71 -0
  662. package/build/src/styles/presets/marshal/theme/TOCCollapsible/style.css +138 -0
  663. package/build/src/styles/presets/marshal/theme/TabItem/style.css +9 -0
  664. package/build/src/styles/presets/marshal/theme/Tabs/style.css +92 -0
  665. package/build/src/styles/presets/marshal/theme/Tag/style.css +54 -0
  666. package/build/src/styles/presets/marshal/theme/TagsListByLetter/style.css +5 -0
  667. package/build/src/styles/presets/marshal/theme/ThemeProvider/TitleFormatter/style.css +9 -0
  668. package/build/src/styles/presets/marshal/theme/ThemeProvider/style.css +9 -0
  669. package/build/src/styles/presets/marshal/theme/ThemedImage/style.css +5 -0
  670. package/build/src/styles/presets/marshal/theme/error-surface/style.css +82 -0
  671. package/build/src/styles/presets/sample/blocks/app-market-download/style.css +29 -0
  672. package/build/src/styles/presets/sample/blocks/blog-preview/style.css +41 -0
  673. package/build/src/styles/presets/sample/blocks/features/style.css +49 -0
  674. package/build/src/styles/presets/sample/blocks/frame/style.css +12 -0
  675. package/build/src/styles/presets/sample/blocks/hero/style.css +41 -0
  676. package/build/src/styles/presets/sample/blocks/install-strip/style.css +37 -0
  677. package/build/src/styles/presets/sample/blocks/spotlight/style.css +12 -0
  678. package/build/src/styles/presets/sample/blocks/stats/style.css +12 -0
  679. package/build/src/styles/presets/sample/blocks/terminology/style.css +21 -0
  680. package/build/src/styles/presets/sample/blocks/typewriter/style.css +12 -0
  681. package/build/src/styles/presets/sample/preset.css +340 -0
  682. package/build/src/styles/presets/sample/theme/Admonition/style.css +33 -0
  683. package/build/src/styles/presets/sample/theme/AnnouncementBar/style.css +25 -0
  684. package/build/src/styles/presets/sample/theme/BackToTopButton/style.css +21 -0
  685. package/build/src/styles/presets/sample/theme/Blog/Components/Author/Socials/style.css +12 -0
  686. package/build/src/styles/presets/sample/theme/Blog/Components/Author/style.css +12 -0
  687. package/build/src/styles/presets/sample/theme/Blog/Pages/BlogAuthorsListPage/style.css +12 -0
  688. package/build/src/styles/presets/sample/theme/Blog/Pages/BlogAuthorsPostsPage/style.css +12 -0
  689. package/build/src/styles/presets/sample/theme/BlogArchivePage/style.css +21 -0
  690. package/build/src/styles/presets/sample/theme/BlogLayout/style.css +21 -0
  691. package/build/src/styles/presets/sample/theme/BlogListPage/style.css +12 -0
  692. package/build/src/styles/presets/sample/theme/BlogListPaginator/style.css +33 -0
  693. package/build/src/styles/presets/sample/theme/BlogPostItem/style.css +45 -0
  694. package/build/src/styles/presets/sample/theme/BlogPostItems/style.css +12 -0
  695. package/build/src/styles/presets/sample/theme/BlogPostPage/style.css +12 -0
  696. package/build/src/styles/presets/sample/theme/BlogPostPaginator/style.css +37 -0
  697. package/build/src/styles/presets/sample/theme/BlogSidebar/style.css +29 -0
  698. package/build/src/styles/presets/sample/theme/BlogSidebarMobile/style.css +12 -0
  699. package/build/src/styles/presets/sample/theme/BlogTagsListPage/style.css +12 -0
  700. package/build/src/styles/presets/sample/theme/BlogTagsPostsPage/style.css +12 -0
  701. package/build/src/styles/presets/sample/theme/CodeBlock/style.css +57 -0
  702. package/build/src/styles/presets/sample/theme/CodeInline/style.css +12 -0
  703. package/build/src/styles/presets/sample/theme/ColorModeToggle/style.css +12 -0
  704. package/build/src/styles/presets/sample/theme/ContentFooter/Edit/style.css +12 -0
  705. package/build/src/styles/presets/sample/theme/ContentFooter/Share/style.css +12 -0
  706. package/build/src/styles/presets/sample/theme/ContentFooter/ShareButton/style.css +12 -0
  707. package/build/src/styles/presets/sample/theme/ContentFooter/Tags/style.css +12 -0
  708. package/build/src/styles/presets/sample/theme/ContentFooter/style.css +33 -0
  709. package/build/src/styles/presets/sample/theme/ContentVisibility/Draft/style.css +12 -0
  710. package/build/src/styles/presets/sample/theme/ContentVisibility/Unlisted/style.css +12 -0
  711. package/build/src/styles/presets/sample/theme/ContentVisibility/style.css +12 -0
  712. package/build/src/styles/presets/sample/theme/Details/style.css +33 -0
  713. package/build/src/styles/presets/sample/theme/DocBreadcrumbs/style.css +29 -0
  714. package/build/src/styles/presets/sample/theme/DocCard/style.css +29 -0
  715. package/build/src/styles/presets/sample/theme/DocCardList/style.css +12 -0
  716. package/build/src/styles/presets/sample/theme/DocCategoryGeneratedIndexPage/style.css +12 -0
  717. package/build/src/styles/presets/sample/theme/DocItem/Content/style.css +12 -0
  718. package/build/src/styles/presets/sample/theme/DocItem/Footer/style.css +17 -0
  719. package/build/src/styles/presets/sample/theme/DocItem/Layout/style.css +12 -0
  720. package/build/src/styles/presets/sample/theme/DocItem/Metadata/style.css +12 -0
  721. package/build/src/styles/presets/sample/theme/DocItem/Paginator/style.css +12 -0
  722. package/build/src/styles/presets/sample/theme/DocItem/TOC/Desktop/style.css +12 -0
  723. package/build/src/styles/presets/sample/theme/DocItem/TOC/Mobile/style.css +12 -0
  724. package/build/src/styles/presets/sample/theme/DocItem/style.css +12 -0
  725. package/build/src/styles/presets/sample/theme/DocPaginator/style.css +37 -0
  726. package/build/src/styles/presets/sample/theme/DocRoot/Layout/Main/style.css +12 -0
  727. package/build/src/styles/presets/sample/theme/DocRoot/Layout/Sidebar/style.css +12 -0
  728. package/build/src/styles/presets/sample/theme/DocRoot/Layout/style.css +12 -0
  729. package/build/src/styles/presets/sample/theme/DocRoot/style.css +12 -0
  730. package/build/src/styles/presets/sample/theme/DocSidebar/style.css +33 -0
  731. package/build/src/styles/presets/sample/theme/DocSidebarItem/Category/style.css +25 -0
  732. package/build/src/styles/presets/sample/theme/DocSidebarItem/Html/style.css +12 -0
  733. package/build/src/styles/presets/sample/theme/DocSidebarItem/Link/style.css +12 -0
  734. package/build/src/styles/presets/sample/theme/DocSidebarItem/style.css +12 -0
  735. package/build/src/styles/presets/sample/theme/DocSidebarItems/style.css +12 -0
  736. package/build/src/styles/presets/sample/theme/DocSidebarMobile/style.css +33 -0
  737. package/build/src/styles/presets/sample/theme/DocTagDocListPage/style.css +12 -0
  738. package/build/src/styles/presets/sample/theme/DocTagsListPage/style.css +12 -0
  739. package/build/src/styles/presets/sample/theme/DocVersionBanner/style.css +17 -0
  740. package/build/src/styles/presets/sample/theme/DocVersionRoot/style.css +12 -0
  741. package/build/src/styles/presets/sample/theme/DocsRoot/style.css +12 -0
  742. package/build/src/styles/presets/sample/theme/EditMetaRow/style.css +25 -0
  743. package/build/src/styles/presets/sample/theme/EditThisPage/style.css +12 -0
  744. package/build/src/styles/presets/sample/theme/Error/style.css +12 -0
  745. package/build/src/styles/presets/sample/theme/ErrorPageContent/style.css +12 -0
  746. package/build/src/styles/presets/sample/theme/Footer/Commons/style.css +45 -0
  747. package/build/src/styles/presets/sample/theme/Footer/Embassy/style.css +41 -0
  748. package/build/src/styles/presets/sample/theme/Footer/Launchpad/style.css +45 -0
  749. package/build/src/styles/presets/sample/theme/Footer/Ledger/style.css +29 -0
  750. package/build/src/styles/presets/sample/theme/Footer/style.css +12 -0
  751. package/build/src/styles/presets/sample/theme/Heading/style.css +33 -0
  752. package/build/src/styles/presets/sample/theme/LastUpdated/style.css +12 -0
  753. package/build/src/styles/presets/sample/theme/Layout/Provider/style.css +12 -0
  754. package/build/src/styles/presets/sample/theme/Layout/style.css +12 -0
  755. package/build/src/styles/presets/sample/theme/Loading/style.css +12 -0
  756. package/build/src/styles/presets/sample/theme/Logo/style.css +12 -0
  757. package/build/src/styles/presets/sample/theme/MDXComponents/style.css +12 -0
  758. package/build/src/styles/presets/sample/theme/MDXContent/style.css +49 -0
  759. package/build/src/styles/presets/sample/theme/MDXPage/style.css +12 -0
  760. package/build/src/styles/presets/sample/theme/Mermaid/style.css +12 -0
  761. package/build/src/styles/presets/sample/theme/Navbar/Bridge/style.css +53 -0
  762. package/build/src/styles/presets/sample/theme/Navbar/Canopy/style.css +61 -0
  763. package/build/src/styles/presets/sample/theme/Navbar/Compass/style.css +57 -0
  764. package/build/src/styles/presets/sample/theme/Navbar/Monolith/style.css +53 -0
  765. package/build/src/styles/presets/sample/theme/Navbar/More/style.css +12 -0
  766. package/build/src/styles/presets/sample/theme/Navbar/style.css +12 -0
  767. package/build/src/styles/presets/sample/theme/NavbarItem/style.css +12 -0
  768. package/build/src/styles/presets/sample/theme/NotFound/Content/style.css +12 -0
  769. package/build/src/styles/presets/sample/theme/NotFound/style.css +12 -0
  770. package/build/src/styles/presets/sample/theme/Root/style.css +12 -0
  771. package/build/src/styles/presets/sample/theme/SearchBar/style.css +33 -0
  772. package/build/src/styles/presets/sample/theme/SearchMetadata/style.css +12 -0
  773. package/build/src/styles/presets/sample/theme/SearchPage/style.css +29 -0
  774. package/build/src/styles/presets/sample/theme/Showcase/style.css +12 -0
  775. package/build/src/styles/presets/sample/theme/SiteMetadata/style.css +12 -0
  776. package/build/src/styles/presets/sample/theme/SkipToContent/style.css +12 -0
  777. package/build/src/styles/presets/sample/theme/TOC/style.css +21 -0
  778. package/build/src/styles/presets/sample/theme/TOCCollapsible/style.css +37 -0
  779. package/build/src/styles/presets/sample/theme/TabItem/style.css +12 -0
  780. package/build/src/styles/presets/sample/theme/Tabs/style.css +29 -0
  781. package/build/src/styles/presets/sample/theme/Tag/style.css +21 -0
  782. package/build/src/styles/presets/sample/theme/TagsListByLetter/style.css +12 -0
  783. package/build/src/styles/presets/sample/theme/ThemeProvider/TitleFormatter/style.css +12 -0
  784. package/build/src/styles/presets/sample/theme/ThemeProvider/style.css +12 -0
  785. package/build/src/styles/presets/sample/theme/ThemedImage/style.css +12 -0
  786. package/build/src/styles/presets/sample/theme/error-surface/style.css +31 -0
  787. package/build/src/styles/presets/sentinel/{components → blocks}/app-market-download/style.css +22 -29
  788. package/build/src/styles/presets/sentinel/{components → blocks}/blog-preview/style.css +14 -33
  789. package/build/src/styles/presets/sentinel/{components → blocks}/features/style.css +7 -29
  790. package/build/src/styles/presets/sentinel/blocks/frame/style.css +29 -0
  791. package/build/src/styles/presets/sentinel/{components → blocks}/hero/style.css +6 -15
  792. package/build/src/styles/presets/sentinel/{components → blocks}/install-strip/style.css +28 -37
  793. package/build/src/styles/presets/sentinel/blocks/spotlight/style.css +13 -0
  794. package/build/src/styles/presets/sentinel/blocks/stats/style.css +18 -0
  795. package/build/src/styles/presets/sentinel/{components → blocks}/terminology/style.css +6 -6
  796. package/build/src/styles/presets/sentinel/blocks/typewriter/style.css +12 -0
  797. package/build/src/styles/presets/sentinel/preset.css +271 -265
  798. package/build/src/styles/presets/sentinel/theme/Admonition/style.css +112 -0
  799. package/build/src/styles/presets/sentinel/theme/AnnouncementBar/style.css +13 -12
  800. package/build/src/styles/presets/sentinel/theme/BackToTopButton/style.css +11 -12
  801. package/build/src/styles/presets/sentinel/theme/Blog/Components/Author/Socials/style.css +28 -0
  802. package/build/src/styles/presets/sentinel/theme/Blog/Components/Author/style.css +9 -0
  803. package/build/src/styles/presets/sentinel/theme/Blog/Pages/BlogAuthorsListPage/style.css +9 -0
  804. package/build/src/styles/presets/sentinel/theme/Blog/Pages/BlogAuthorsPostsPage/style.css +9 -0
  805. package/build/src/styles/presets/sentinel/theme/BlogArchivePage/style.css +7 -30
  806. package/build/src/styles/presets/sentinel/theme/BlogLayout/style.css +58 -0
  807. package/build/src/styles/presets/sentinel/theme/BlogListPage/style.css +9 -0
  808. package/build/src/styles/presets/sentinel/theme/BlogListPaginator/style.css +19 -13
  809. package/build/src/styles/presets/sentinel/theme/BlogPostItem/style.css +71 -56
  810. package/build/src/styles/presets/sentinel/theme/BlogPostItems/style.css +9 -0
  811. package/build/src/styles/presets/sentinel/theme/BlogPostPage/style.css +9 -0
  812. package/build/src/styles/presets/sentinel/theme/BlogPostPaginator/style.css +6 -26
  813. package/build/src/styles/presets/sentinel/theme/BlogSidebar/style.css +7 -11
  814. package/build/src/styles/presets/sentinel/theme/BlogSidebarMobile/style.css +9 -0
  815. package/build/src/styles/presets/sentinel/theme/BlogTagsListPage/style.css +9 -0
  816. package/build/src/styles/presets/sentinel/theme/BlogTagsPostsPage/style.css +9 -0
  817. package/build/src/styles/presets/sentinel/theme/CodeBlock/style.css +43 -47
  818. package/build/src/styles/presets/sentinel/theme/CodeInline/style.css +21 -0
  819. package/build/src/styles/presets/sentinel/theme/ColorModeToggle/style.css +24 -0
  820. package/build/src/styles/presets/sentinel/theme/ContentFooter/Edit/style.css +9 -0
  821. package/build/src/styles/presets/sentinel/theme/ContentFooter/Share/style.css +9 -0
  822. package/build/src/styles/presets/sentinel/theme/ContentFooter/ShareButton/style.css +9 -0
  823. package/build/src/styles/presets/sentinel/theme/ContentFooter/Tags/style.css +9 -0
  824. package/build/src/styles/presets/sentinel/theme/ContentFooter/style.css +37 -34
  825. package/build/src/styles/presets/sentinel/theme/ContentVisibility/Draft/style.css +9 -0
  826. package/build/src/styles/presets/sentinel/theme/ContentVisibility/Unlisted/style.css +9 -0
  827. package/build/src/styles/presets/sentinel/theme/ContentVisibility/style.css +9 -0
  828. package/build/src/styles/presets/sentinel/theme/Details/style.css +8 -19
  829. package/build/src/styles/presets/sentinel/theme/DocBreadcrumbs/style.css +14 -14
  830. package/build/src/styles/presets/sentinel/theme/DocCard/style.css +8 -23
  831. package/build/src/styles/presets/sentinel/theme/DocCardList/style.css +9 -0
  832. package/build/src/styles/presets/sentinel/theme/DocCategoryGeneratedIndexPage/style.css +9 -0
  833. package/build/src/styles/presets/sentinel/theme/DocItem/Content/style.css +7 -15
  834. package/build/src/styles/presets/sentinel/theme/DocItem/Footer/style.css +6 -6
  835. package/build/src/styles/presets/sentinel/theme/DocItem/Layout/style.css +9 -0
  836. package/build/src/styles/presets/sentinel/theme/DocItem/Metadata/style.css +9 -0
  837. package/build/src/styles/presets/sentinel/theme/DocItem/Paginator/style.css +9 -0
  838. package/build/src/styles/presets/sentinel/theme/DocItem/TOC/Desktop/style.css +9 -0
  839. package/build/src/styles/presets/sentinel/theme/DocItem/TOC/Mobile/style.css +9 -0
  840. package/build/src/styles/presets/sentinel/theme/DocItem/style.css +14 -0
  841. package/build/src/styles/presets/sentinel/theme/DocPaginator/style.css +15 -27
  842. package/build/src/styles/presets/sentinel/theme/DocRoot/Layout/Main/style.css +9 -0
  843. package/build/src/styles/presets/sentinel/theme/DocRoot/Layout/Sidebar/style.css +9 -0
  844. package/build/src/styles/presets/sentinel/theme/DocRoot/Layout/style.css +9 -0
  845. package/build/src/styles/presets/sentinel/theme/DocRoot/style.css +9 -0
  846. package/build/src/styles/presets/sentinel/theme/DocSidebar/style.css +70 -107
  847. package/build/src/styles/presets/sentinel/theme/DocSidebarItem/Category/style.css +75 -0
  848. package/build/src/styles/presets/sentinel/theme/DocSidebarItem/Html/style.css +7 -0
  849. package/build/src/styles/presets/sentinel/theme/DocSidebarItem/Link/style.css +54 -0
  850. package/build/src/styles/presets/sentinel/theme/DocSidebarItem/style.css +11 -0
  851. package/build/src/styles/presets/sentinel/theme/DocSidebarItems/style.css +9 -0
  852. package/build/src/styles/presets/sentinel/theme/DocSidebarMobile/style.css +15 -28
  853. package/build/src/styles/presets/sentinel/theme/DocTagDocListPage/style.css +9 -0
  854. package/build/src/styles/presets/sentinel/theme/DocTagsListPage/style.css +9 -0
  855. package/build/src/styles/presets/sentinel/theme/DocVersionBanner/style.css +53 -0
  856. package/build/src/styles/presets/sentinel/theme/DocVersionRoot/style.css +9 -0
  857. package/build/src/styles/presets/sentinel/theme/DocsRoot/style.css +15 -0
  858. package/build/src/styles/presets/sentinel/theme/EditMetaRow/style.css +55 -0
  859. package/build/src/styles/presets/sentinel/theme/EditThisPage/style.css +9 -0
  860. package/build/src/styles/presets/sentinel/theme/Error/style.css +10 -0
  861. package/build/src/styles/presets/sentinel/theme/ErrorPageContent/style.css +10 -0
  862. package/build/src/styles/presets/sentinel/theme/Footer/Commons/style.css +62 -11
  863. package/build/src/styles/presets/sentinel/theme/Footer/Embassy/style.css +70 -18
  864. package/build/src/styles/presets/sentinel/theme/Footer/Launchpad/style.css +27 -14
  865. package/build/src/styles/presets/sentinel/theme/Footer/Ledger/style.css +48 -41
  866. package/build/src/styles/presets/sentinel/theme/Footer/style.css +11 -0
  867. package/build/src/styles/presets/sentinel/theme/Heading/style.css +35 -23
  868. package/build/src/styles/presets/sentinel/theme/LastUpdated/style.css +9 -0
  869. package/build/src/styles/presets/sentinel/theme/Layout/Provider/style.css +9 -0
  870. package/build/src/styles/presets/sentinel/theme/Layout/style.css +9 -0
  871. package/build/src/styles/presets/sentinel/theme/Loading/style.css +25 -0
  872. package/build/src/styles/presets/sentinel/theme/Logo/style.css +9 -0
  873. package/build/src/styles/presets/sentinel/theme/MDXComponents/style.css +8 -0
  874. package/build/src/styles/presets/sentinel/theme/MDXContent/style.css +102 -266
  875. package/build/src/styles/presets/sentinel/theme/MDXPage/style.css +8 -0
  876. package/build/src/styles/presets/sentinel/theme/Mermaid/style.css +10 -0
  877. package/build/src/styles/presets/sentinel/theme/Navbar/Bridge/style.css +90 -61
  878. package/build/src/styles/presets/sentinel/theme/Navbar/Canopy/style.css +89 -74
  879. package/build/src/styles/presets/sentinel/theme/Navbar/Compass/style.css +88 -59
  880. package/build/src/styles/presets/sentinel/theme/Navbar/Monolith/style.css +51 -70
  881. package/build/src/styles/presets/sentinel/theme/Navbar/More/style.css +10 -0
  882. package/build/src/styles/presets/sentinel/theme/Navbar/style.css +146 -0
  883. package/build/src/styles/presets/sentinel/theme/NavbarItem/style.css +26 -0
  884. package/build/src/styles/presets/sentinel/theme/NotFound/Content/style.css +10 -0
  885. package/build/src/styles/presets/sentinel/theme/NotFound/style.css +10 -0
  886. package/build/src/styles/presets/sentinel/theme/Root/style.css +9 -0
  887. package/build/src/styles/presets/sentinel/theme/SearchBar/style.css +13 -36
  888. package/build/src/styles/presets/sentinel/theme/SearchMetadata/style.css +8 -0
  889. package/build/src/styles/presets/sentinel/theme/SearchPage/style.css +104 -0
  890. package/build/src/styles/presets/sentinel/theme/Showcase/style.css +5 -0
  891. package/build/src/styles/presets/sentinel/theme/SiteMetadata/style.css +8 -0
  892. package/build/src/styles/presets/sentinel/theme/SkipToContent/style.css +18 -0
  893. package/build/src/styles/presets/sentinel/theme/TOC/style.css +39 -7
  894. package/build/src/styles/presets/sentinel/theme/TOCCollapsible/style.css +12 -49
  895. package/build/src/styles/presets/sentinel/theme/TabItem/style.css +8 -0
  896. package/build/src/styles/presets/sentinel/theme/Tabs/style.css +4 -11
  897. package/build/src/styles/presets/sentinel/theme/Tag/style.css +7 -48
  898. package/build/src/styles/presets/sentinel/theme/TagsListByLetter/style.css +9 -0
  899. package/build/src/styles/presets/sentinel/theme/ThemeProvider/TitleFormatter/style.css +9 -0
  900. package/build/src/styles/presets/sentinel/theme/ThemeProvider/style.css +9 -0
  901. package/build/src/styles/presets/sentinel/theme/ThemedImage/style.css +9 -0
  902. package/build/src/styles/presets/sentinel/theme/error-surface/style.css +63 -0
  903. package/build/src/styles/presets/signal/{components → blocks}/app-market-download/style.css +25 -26
  904. package/build/src/styles/presets/signal/{components → blocks}/blog-preview/style.css +20 -28
  905. package/build/src/styles/presets/signal/{components → blocks}/features/style.css +8 -21
  906. package/build/src/styles/presets/signal/blocks/frame/style.css +26 -0
  907. package/build/src/styles/presets/signal/{components → blocks}/hero/style.css +3 -11
  908. package/build/src/styles/presets/signal/{components → blocks}/install-strip/style.css +31 -61
  909. package/build/src/styles/presets/signal/blocks/spotlight/style.css +13 -0
  910. package/build/src/styles/presets/signal/blocks/stats/style.css +18 -0
  911. package/build/src/styles/presets/signal/{components → blocks}/terminology/style.css +6 -6
  912. package/build/src/styles/presets/signal/blocks/typewriter/style.css +12 -0
  913. package/build/src/styles/presets/signal/preset.css +205 -227
  914. package/build/src/styles/presets/signal/theme/Admonition/style.css +77 -0
  915. package/build/src/styles/presets/signal/theme/AnnouncementBar/style.css +19 -11
  916. package/build/src/styles/presets/signal/theme/BackToTopButton/style.css +15 -8
  917. package/build/src/styles/presets/signal/theme/Blog/Components/Author/Socials/style.css +33 -0
  918. package/build/src/styles/presets/signal/theme/Blog/Components/Author/style.css +9 -0
  919. package/build/src/styles/presets/signal/theme/Blog/Pages/BlogAuthorsListPage/style.css +9 -0
  920. package/build/src/styles/presets/signal/theme/Blog/Pages/BlogAuthorsPostsPage/style.css +9 -0
  921. package/build/src/styles/presets/signal/theme/BlogArchivePage/style.css +11 -26
  922. package/build/src/styles/presets/signal/theme/BlogLayout/style.css +37 -0
  923. package/build/src/styles/presets/signal/theme/BlogListPage/style.css +9 -0
  924. package/build/src/styles/presets/signal/theme/BlogListPaginator/style.css +40 -41
  925. package/build/src/styles/presets/signal/theme/BlogPostItem/style.css +80 -34
  926. package/build/src/styles/presets/signal/theme/BlogPostItems/style.css +9 -0
  927. package/build/src/styles/presets/signal/theme/BlogPostPage/style.css +9 -0
  928. package/build/src/styles/presets/signal/theme/BlogPostPaginator/style.css +9 -21
  929. package/build/src/styles/presets/signal/theme/BlogSidebar/style.css +7 -16
  930. package/build/src/styles/presets/signal/theme/BlogSidebarMobile/style.css +9 -0
  931. package/build/src/styles/presets/signal/theme/BlogTagsListPage/style.css +11 -0
  932. package/build/src/styles/presets/signal/theme/BlogTagsPostsPage/style.css +9 -0
  933. package/build/src/styles/presets/signal/theme/CodeBlock/style.css +50 -30
  934. package/build/src/styles/presets/signal/theme/CodeInline/style.css +22 -0
  935. package/build/src/styles/presets/signal/theme/ColorModeToggle/style.css +24 -0
  936. package/build/src/styles/presets/signal/theme/ContentFooter/Edit/style.css +9 -0
  937. package/build/src/styles/presets/signal/theme/ContentFooter/Share/style.css +9 -0
  938. package/build/src/styles/presets/signal/theme/ContentFooter/ShareButton/style.css +9 -0
  939. package/build/src/styles/presets/signal/theme/ContentFooter/Tags/style.css +9 -0
  940. package/build/src/styles/presets/signal/theme/ContentFooter/style.css +53 -38
  941. package/build/src/styles/presets/signal/theme/ContentVisibility/Draft/style.css +9 -0
  942. package/build/src/styles/presets/signal/theme/ContentVisibility/Unlisted/style.css +9 -0
  943. package/build/src/styles/presets/signal/theme/ContentVisibility/style.css +9 -0
  944. package/build/src/styles/presets/signal/theme/Details/style.css +29 -15
  945. package/build/src/styles/presets/signal/theme/DocBreadcrumbs/style.css +16 -7
  946. package/build/src/styles/presets/signal/theme/DocCard/style.css +8 -12
  947. package/build/src/styles/presets/signal/theme/DocCardList/style.css +9 -0
  948. package/build/src/styles/presets/signal/theme/DocCategoryGeneratedIndexPage/style.css +9 -0
  949. package/build/src/styles/presets/signal/theme/DocItem/Content/style.css +7 -11
  950. package/build/src/styles/presets/signal/theme/DocItem/Footer/style.css +6 -6
  951. package/build/src/styles/presets/signal/theme/DocItem/Layout/style.css +9 -0
  952. package/build/src/styles/presets/signal/theme/DocItem/Metadata/style.css +9 -0
  953. package/build/src/styles/presets/signal/theme/DocItem/Paginator/style.css +9 -0
  954. package/build/src/styles/presets/signal/theme/DocItem/TOC/Desktop/style.css +9 -0
  955. package/build/src/styles/presets/signal/theme/DocItem/TOC/Mobile/style.css +9 -0
  956. package/build/src/styles/presets/signal/theme/DocItem/style.css +14 -0
  957. package/build/src/styles/presets/signal/theme/DocPaginator/style.css +18 -21
  958. package/build/src/styles/presets/signal/theme/DocRoot/Layout/Main/style.css +9 -0
  959. package/build/src/styles/presets/signal/theme/DocRoot/Layout/Sidebar/style.css +9 -0
  960. package/build/src/styles/presets/signal/theme/DocRoot/Layout/style.css +9 -0
  961. package/build/src/styles/presets/signal/theme/DocRoot/style.css +9 -0
  962. package/build/src/styles/presets/signal/theme/DocSidebar/style.css +76 -119
  963. package/build/src/styles/presets/signal/theme/DocSidebarItem/Category/style.css +85 -0
  964. package/build/src/styles/presets/signal/theme/DocSidebarItem/Html/style.css +7 -0
  965. package/build/src/styles/presets/signal/theme/DocSidebarItem/Link/style.css +53 -0
  966. package/build/src/styles/presets/signal/theme/DocSidebarItem/style.css +11 -0
  967. package/build/src/styles/presets/signal/theme/DocSidebarItems/style.css +9 -0
  968. package/build/src/styles/presets/signal/theme/DocSidebarMobile/style.css +21 -19
  969. package/build/src/styles/presets/signal/theme/DocTagDocListPage/style.css +9 -0
  970. package/build/src/styles/presets/signal/theme/DocTagsListPage/style.css +9 -0
  971. package/build/src/styles/presets/signal/theme/DocVersionBanner/style.css +83 -0
  972. package/build/src/styles/presets/signal/theme/DocVersionRoot/style.css +9 -0
  973. package/build/src/styles/presets/signal/theme/DocsRoot/style.css +9 -0
  974. package/build/src/styles/presets/signal/theme/EditMetaRow/style.css +66 -0
  975. package/build/src/styles/presets/signal/theme/EditThisPage/style.css +9 -0
  976. package/build/src/styles/presets/signal/theme/Error/style.css +10 -0
  977. package/build/src/styles/presets/signal/theme/ErrorPageContent/style.css +10 -0
  978. package/build/src/styles/presets/signal/theme/Footer/Commons/style.css +65 -9
  979. package/build/src/styles/presets/signal/theme/Footer/Embassy/style.css +67 -12
  980. package/build/src/styles/presets/signal/theme/Footer/Launchpad/style.css +45 -18
  981. package/build/src/styles/presets/signal/theme/Footer/Ledger/style.css +57 -38
  982. package/build/src/styles/presets/signal/theme/Footer/style.css +11 -0
  983. package/build/src/styles/presets/signal/theme/Heading/style.css +36 -25
  984. package/build/src/styles/presets/signal/theme/LastUpdated/style.css +9 -0
  985. package/build/src/styles/presets/signal/theme/Layout/Provider/style.css +9 -0
  986. package/build/src/styles/presets/signal/theme/Layout/style.css +9 -0
  987. package/build/src/styles/presets/signal/theme/Loading/style.css +19 -0
  988. package/build/src/styles/presets/signal/theme/Logo/style.css +9 -0
  989. package/build/src/styles/presets/signal/theme/MDXComponents/style.css +8 -0
  990. package/build/src/styles/presets/signal/theme/MDXContent/style.css +113 -322
  991. package/build/src/styles/presets/signal/theme/MDXPage/style.css +8 -0
  992. package/build/src/styles/presets/signal/theme/Mermaid/style.css +17 -0
  993. package/build/src/styles/presets/signal/theme/Navbar/Bridge/style.css +85 -71
  994. package/build/src/styles/presets/signal/theme/Navbar/Canopy/style.css +111 -89
  995. package/build/src/styles/presets/signal/theme/Navbar/Compass/style.css +95 -67
  996. package/build/src/styles/presets/signal/theme/Navbar/Monolith/style.css +55 -84
  997. package/build/src/styles/presets/signal/theme/Navbar/More/style.css +8 -0
  998. package/build/src/styles/presets/signal/theme/Navbar/style.css +178 -0
  999. package/build/src/styles/presets/signal/theme/NavbarItem/style.css +31 -0
  1000. package/build/src/styles/presets/signal/theme/NotFound/Content/style.css +10 -0
  1001. package/build/src/styles/presets/signal/theme/NotFound/style.css +10 -0
  1002. package/build/src/styles/presets/signal/theme/Root/style.css +9 -0
  1003. package/build/src/styles/presets/signal/theme/SearchBar/style.css +22 -36
  1004. package/build/src/styles/presets/signal/theme/SearchMetadata/style.css +8 -0
  1005. package/build/src/styles/presets/signal/theme/SearchPage/style.css +152 -0
  1006. package/build/src/styles/presets/signal/theme/Showcase/style.css +5 -0
  1007. package/build/src/styles/presets/signal/theme/SiteMetadata/style.css +8 -0
  1008. package/build/src/styles/presets/signal/theme/SkipToContent/style.css +17 -0
  1009. package/build/src/styles/presets/signal/theme/TOC/style.css +32 -3
  1010. package/build/src/styles/presets/signal/theme/TOCCollapsible/style.css +19 -20
  1011. package/build/src/styles/presets/signal/theme/TabItem/style.css +8 -0
  1012. package/build/src/styles/presets/signal/theme/Tabs/style.css +3 -20
  1013. package/build/src/styles/presets/signal/theme/Tag/style.css +5 -46
  1014. package/build/src/styles/presets/signal/theme/TagsListByLetter/style.css +9 -0
  1015. package/build/src/styles/presets/signal/theme/ThemeProvider/TitleFormatter/style.css +9 -0
  1016. package/build/src/styles/presets/signal/theme/ThemeProvider/style.css +9 -0
  1017. package/build/src/styles/presets/signal/theme/ThemedImage/style.css +9 -0
  1018. package/build/src/styles/presets/signal/theme/error-surface/style.css +80 -0
  1019. package/build/src/styles/reset.css +30 -1
  1020. package/build/src/styles/theme/Admonition/style.css +53 -3
  1021. package/build/src/styles/theme/AnnouncementBar/style.css +4 -4
  1022. package/build/src/styles/theme/BackToTopButton/style.css +22 -2
  1023. package/build/src/styles/theme/Blog/Components/Author/Socials/style.css +38 -0
  1024. package/build/src/styles/theme/Blog/Components/Author/style.css +92 -0
  1025. package/build/src/styles/theme/Blog/Pages/BlogAuthorsListPage/style.css +23 -58
  1026. package/build/src/styles/theme/Blog/Pages/BlogAuthorsPostsPage/style.css +105 -16
  1027. package/build/src/styles/theme/BlogArchivePage/style.css +29 -16
  1028. package/build/src/styles/theme/BlogLayout/style.css +19 -19
  1029. package/build/src/styles/theme/BlogListPage/style.css +1 -1
  1030. package/build/src/styles/theme/BlogListPaginator/style.css +10 -9
  1031. package/build/src/styles/theme/BlogPostItem/style.css +46 -27
  1032. package/build/src/styles/theme/BlogPostItems/style.css +1 -1
  1033. package/build/src/styles/theme/BlogPostPage/style.css +1 -1
  1034. package/build/src/styles/theme/BlogPostPaginator/style.css +8 -7
  1035. package/build/src/styles/theme/BlogSidebar/style.css +22 -21
  1036. package/build/src/styles/theme/BlogSidebarMobile/style.css +5 -2
  1037. package/build/src/styles/theme/BlogTagsListPage/style.css +12 -3
  1038. package/build/src/styles/theme/BlogTagsPostsPage/style.css +88 -17
  1039. package/build/src/styles/theme/CodeBlock/style.css +64 -19
  1040. package/build/src/styles/theme/CodeInline/style.css +12 -1
  1041. package/build/src/styles/theme/ColorModeToggle/style.css +4 -4
  1042. package/build/src/styles/theme/ContentFooter/Edit/style.css +5 -0
  1043. package/build/src/styles/theme/ContentFooter/Share/style.css +5 -0
  1044. package/build/src/styles/theme/ContentFooter/ShareButton/style.css +5 -0
  1045. package/build/src/styles/theme/ContentFooter/Tags/style.css +5 -0
  1046. package/build/src/styles/theme/ContentFooter/style.css +10 -9
  1047. package/build/src/styles/theme/ContentVisibility/Draft/style.css +1 -1
  1048. package/build/src/styles/theme/ContentVisibility/Unlisted/style.css +1 -1
  1049. package/build/src/styles/theme/ContentVisibility/style.css +1 -1
  1050. package/build/src/styles/theme/Details/style.css +39 -6
  1051. package/build/src/styles/theme/DocBreadcrumbs/style.css +6 -6
  1052. package/build/src/styles/theme/DocCard/style.css +8 -3
  1053. package/build/src/styles/theme/DocCardList/style.css +1 -1
  1054. package/build/src/styles/theme/DocCategoryGeneratedIndexPage/style.css +1 -1
  1055. package/build/src/styles/theme/DocItem/Content/style.css +2 -2
  1056. package/build/src/styles/theme/DocItem/Footer/style.css +1 -1
  1057. package/build/src/styles/theme/DocItem/Layout/style.css +1 -1
  1058. package/build/src/styles/theme/DocItem/Metadata/style.css +1 -1
  1059. package/build/src/styles/theme/DocItem/Paginator/style.css +1 -1
  1060. package/build/src/styles/theme/DocItem/TOC/Desktop/style.css +1 -1
  1061. package/build/src/styles/theme/DocItem/TOC/Mobile/style.css +6 -18
  1062. package/build/src/styles/theme/DocItem/style.css +1 -1
  1063. package/build/src/styles/theme/DocPaginator/style.css +27 -8
  1064. package/build/src/styles/theme/DocRoot/Layout/Main/style.css +1 -1
  1065. package/build/src/styles/theme/DocRoot/Layout/Sidebar/style.css +2 -2
  1066. package/build/src/styles/theme/DocRoot/Layout/style.css +1 -1
  1067. package/build/src/styles/theme/DocRoot/style.css +1 -1
  1068. package/build/src/styles/theme/DocSidebar/style.css +29 -100
  1069. package/build/src/styles/theme/DocSidebarItem/Category/style.css +60 -1
  1070. package/build/src/styles/theme/DocSidebarItem/Html/style.css +1 -1
  1071. package/build/src/styles/theme/DocSidebarItem/Link/style.css +79 -1
  1072. package/build/src/styles/theme/DocSidebarItem/style.css +1 -1
  1073. package/build/src/styles/theme/DocSidebarItems/style.css +1 -1
  1074. package/build/src/styles/theme/DocSidebarMobile/style.css +29 -36
  1075. package/build/src/styles/theme/DocTagDocListPage/style.css +181 -1
  1076. package/build/src/styles/theme/DocTagsListPage/style.css +23 -1
  1077. package/build/src/styles/theme/DocVersionBanner/style.css +11 -1
  1078. package/build/src/styles/theme/DocVersionRoot/style.css +1 -1
  1079. package/build/src/styles/theme/DocsRoot/style.css +1 -1
  1080. package/build/src/styles/theme/EditMetaRow/style.css +1 -1
  1081. package/build/src/styles/theme/EditThisPage/style.css +1 -1
  1082. package/build/src/styles/theme/Error/style.css +24 -1
  1083. package/build/src/styles/theme/ErrorPageContent/style.css +28 -1
  1084. package/build/src/styles/theme/Footer/Commons/style.css +33 -1
  1085. package/build/src/styles/theme/Footer/Embassy/style.css +32 -13
  1086. package/build/src/styles/theme/Footer/Launchpad/style.css +35 -3
  1087. package/build/src/styles/theme/Footer/Ledger/style.css +57 -11
  1088. package/build/src/styles/theme/Footer/style.css +19 -2
  1089. package/build/src/styles/theme/Heading/style.css +78 -7
  1090. package/build/src/styles/theme/LastUpdated/style.css +1 -1
  1091. package/build/src/styles/theme/Layout/Provider/style.css +1 -1
  1092. package/build/src/styles/theme/Layout/style.css +1 -1
  1093. package/build/src/styles/theme/Loading/style.css +50 -30
  1094. package/build/src/styles/theme/Logo/style.css +9 -0
  1095. package/build/src/styles/theme/MDXComponents/style.css +13 -1
  1096. package/build/src/styles/theme/MDXContent/style.css +70 -14
  1097. package/build/src/styles/theme/MDXPage/style.css +20 -1
  1098. package/build/src/styles/theme/Mermaid/style.css +86 -24
  1099. package/build/src/styles/theme/Navbar/Bridge/style.css +25 -15
  1100. package/build/src/styles/theme/Navbar/Canopy/style.css +32 -28
  1101. package/build/src/styles/theme/Navbar/Compass/style.css +24 -15
  1102. package/build/src/styles/theme/Navbar/Monolith/style.css +38 -31
  1103. package/build/src/styles/theme/Navbar/More/style.css +101 -0
  1104. package/build/src/styles/theme/Navbar/style.css +107 -4
  1105. package/build/src/styles/theme/NavbarItem/style.css +125 -1
  1106. package/build/src/styles/theme/NotFound/Content/style.css +6 -1
  1107. package/build/src/styles/theme/NotFound/style.css +1 -1
  1108. package/build/src/styles/theme/Root/style.css +1 -1
  1109. package/build/src/styles/theme/SearchBar/style.css +208 -67
  1110. package/build/src/styles/theme/SearchMetadata/style.css +1 -1
  1111. package/build/src/styles/theme/SearchPage/style.css +168 -1
  1112. package/build/src/styles/theme/Showcase/style.css +79 -0
  1113. package/build/src/styles/theme/SiteMetadata/style.css +1 -1
  1114. package/build/src/styles/theme/SkipToContent/style.css +64 -2
  1115. package/build/src/styles/theme/TOC/style.css +5 -9
  1116. package/build/src/styles/theme/TOCCollapsible/style.css +13 -32
  1117. package/build/src/styles/theme/TabItem/style.css +9 -1
  1118. package/build/src/styles/theme/Tabs/style.css +15 -1
  1119. package/build/src/styles/theme/Tag/style.css +2 -2
  1120. package/build/src/styles/theme/TagsListByLetter/style.css +36 -1
  1121. package/build/src/styles/theme/ThemeProvider/TitleFormatter/style.css +1 -1
  1122. package/build/src/styles/theme/ThemeProvider/style.css +1 -1
  1123. package/build/src/styles/theme/ThemedImage/style.css +1 -1
  1124. package/build/src/styles/theme/error-surface/style.css +141 -0
  1125. package/build/src/styles/utilities.css +4 -4
  1126. package/build/src/tests/cascade-defensive.test.d.ts +2 -0
  1127. package/build/src/tests/cascade-defensive.test.d.ts.map +1 -0
  1128. package/build/src/tests/cascade-defensive.test.js +395 -0
  1129. package/build/src/tests/cascade-defensive.test.js.map +1 -0
  1130. package/build/src/tests/class-name-style-passthrough.test.d.ts +2 -0
  1131. package/build/src/tests/class-name-style-passthrough.test.d.ts.map +1 -0
  1132. package/build/src/tests/class-name-style-passthrough.test.js +133 -0
  1133. package/build/src/tests/class-name-style-passthrough.test.js.map +1 -0
  1134. package/build/src/tests/config-drift.test.js +81 -46
  1135. package/build/src/tests/config-drift.test.js.map +1 -1
  1136. package/build/src/tests/demo-coverage.test.d.ts +2 -0
  1137. package/build/src/tests/demo-coverage.test.d.ts.map +1 -0
  1138. package/build/src/tests/demo-coverage.test.js +180 -0
  1139. package/build/src/tests/demo-coverage.test.js.map +1 -0
  1140. package/build/src/tests/demo-logo-override.test.d.ts +2 -0
  1141. package/build/src/tests/demo-logo-override.test.d.ts.map +1 -0
  1142. package/build/src/tests/demo-logo-override.test.js +42 -0
  1143. package/build/src/tests/demo-logo-override.test.js.map +1 -0
  1144. package/build/src/tests/folder-axis.test.d.ts +2 -0
  1145. package/build/src/tests/folder-axis.test.d.ts.map +1 -0
  1146. package/build/src/tests/folder-axis.test.js +83 -0
  1147. package/build/src/tests/folder-axis.test.js.map +1 -0
  1148. package/build/src/tests/layered-scope.test.d.ts +2 -0
  1149. package/build/src/tests/layered-scope.test.d.ts.map +1 -0
  1150. package/build/src/tests/layered-scope.test.js +245 -0
  1151. package/build/src/tests/layered-scope.test.js.map +1 -0
  1152. package/build/src/tests/lib/color.test.js +1 -1
  1153. package/build/src/tests/lib/color.test.js.map +1 -1
  1154. package/build/src/tests/lib/compare-preset-theme-files.test.d.ts +2 -0
  1155. package/build/src/tests/lib/compare-preset-theme-files.test.d.ts.map +1 -0
  1156. package/build/src/tests/lib/compare-preset-theme-files.test.js +47 -0
  1157. package/build/src/tests/lib/compare-preset-theme-files.test.js.map +1 -0
  1158. package/build/src/tests/lib/css-generator.test.js +423 -54
  1159. package/build/src/tests/lib/css-generator.test.js.map +1 -1
  1160. package/build/src/tests/lib/filter-preset-theme-file.test.d.ts +2 -0
  1161. package/build/src/tests/lib/filter-preset-theme-file.test.d.ts.map +1 -0
  1162. package/build/src/tests/lib/filter-preset-theme-file.test.js +47 -0
  1163. package/build/src/tests/lib/filter-preset-theme-file.test.js.map +1 -0
  1164. package/build/src/tests/lib/rehype-shiki.test.js +87 -0
  1165. package/build/src/tests/lib/rehype-shiki.test.js.map +1 -1
  1166. package/build/src/tests/lib/search/indexer.test.js.map +1 -1
  1167. package/build/src/tests/lib/search/worker.test.js +2 -1
  1168. package/build/src/tests/lib/search/worker.test.js.map +1 -1
  1169. package/build/src/tests/lib/shiki-themes.test.js +16 -0
  1170. package/build/src/tests/lib/shiki-themes.test.js.map +1 -1
  1171. package/build/src/tests/lib/translations.test.d.ts +2 -0
  1172. package/build/src/tests/lib/translations.test.d.ts.map +1 -0
  1173. package/build/src/tests/lib/translations.test.js +829 -0
  1174. package/build/src/tests/lib/translations.test.js.map +1 -0
  1175. package/build/src/tests/nova-version-drift.test.d.ts +2 -0
  1176. package/build/src/tests/nova-version-drift.test.d.ts.map +1 -0
  1177. package/build/src/tests/nova-version-drift.test.js +31 -0
  1178. package/build/src/tests/nova-version-drift.test.js.map +1 -0
  1179. package/build/src/tests/options.test.js +135 -158
  1180. package/build/src/tests/options.test.js.map +1 -1
  1181. package/build/src/tests/overlay-completeness.test.d.ts +2 -0
  1182. package/build/src/tests/overlay-completeness.test.d.ts.map +1 -0
  1183. package/build/src/tests/overlay-completeness.test.js +35 -0
  1184. package/build/src/tests/overlay-completeness.test.js.map +1 -0
  1185. package/build/src/tests/preset-list.test.d.ts +2 -0
  1186. package/build/src/tests/preset-list.test.d.ts.map +1 -0
  1187. package/build/src/tests/preset-list.test.js +132 -0
  1188. package/build/src/tests/preset-list.test.js.map +1 -0
  1189. package/build/src/tests/preset.test.js +6 -6
  1190. package/build/src/tests/preset.test.js.map +1 -1
  1191. package/build/src/tests/presets/envoy/preset.test.js +13 -4
  1192. package/build/src/tests/presets/envoy/preset.test.js.map +1 -1
  1193. package/build/src/tests/presets/foundry/preset.test.js +23 -19
  1194. package/build/src/tests/presets/foundry/preset.test.js.map +1 -1
  1195. package/build/src/tests/presets/index.test.js +24 -14
  1196. package/build/src/tests/presets/index.test.js.map +1 -1
  1197. package/build/src/tests/presets/lantern/preset.test.d.ts +2 -0
  1198. package/build/src/tests/presets/lantern/preset.test.d.ts.map +1 -0
  1199. package/build/src/tests/presets/lantern/preset.test.js +62 -0
  1200. package/build/src/tests/presets/lantern/preset.test.js.map +1 -0
  1201. package/build/src/tests/presets/marshal/preset.test.d.ts +2 -0
  1202. package/build/src/tests/presets/marshal/preset.test.d.ts.map +1 -0
  1203. package/build/src/tests/presets/marshal/preset.test.js +62 -0
  1204. package/build/src/tests/presets/marshal/preset.test.js.map +1 -0
  1205. package/build/src/tests/presets/sample/preset.test.d.ts +2 -0
  1206. package/build/src/tests/presets/sample/preset.test.d.ts.map +1 -0
  1207. package/build/src/tests/presets/sample/preset.test.js +57 -0
  1208. package/build/src/tests/presets/sample/preset.test.js.map +1 -0
  1209. package/build/src/tests/presets/sentinel/preset.test.js +13 -4
  1210. package/build/src/tests/presets/sentinel/preset.test.js.map +1 -1
  1211. package/build/src/tests/presets/signal/preset.test.js +13 -4
  1212. package/build/src/tests/presets/signal/preset.test.js.map +1 -1
  1213. package/build/src/tests/theme/CodeBlock/live-editor.test.js.map +1 -1
  1214. package/build/src/tests/theme-drift.test.js +1 -0
  1215. package/build/src/tests/theme-drift.test.js.map +1 -1
  1216. package/build/src/tests/token-map.test.d.ts +2 -0
  1217. package/build/src/tests/token-map.test.d.ts.map +1 -0
  1218. package/build/src/tests/token-map.test.js +445 -0
  1219. package/build/src/tests/token-map.test.js.map +1 -0
  1220. package/build/src/tests/type-declarations.test.d.ts +30 -1
  1221. package/build/src/tests/type-declarations.test.d.ts.map +1 -1
  1222. package/build/src/tests/type-declarations.test.js +3221 -200
  1223. package/build/src/tests/type-declarations.test.js.map +1 -1
  1224. package/build/src/theme/Admonition/index.d.ts +2 -2
  1225. package/build/src/theme/Admonition/index.d.ts.map +1 -1
  1226. package/build/src/theme/Admonition/index.js +37 -2
  1227. package/build/src/theme/Admonition/index.js.map +1 -1
  1228. package/build/src/theme/AnnouncementBar/index.d.ts +2 -2
  1229. package/build/src/theme/AnnouncementBar/index.d.ts.map +1 -1
  1230. package/build/src/theme/AnnouncementBar/index.js +4 -2
  1231. package/build/src/theme/AnnouncementBar/index.js.map +1 -1
  1232. package/build/src/theme/BackToTopButton/index.d.ts +2 -2
  1233. package/build/src/theme/BackToTopButton/index.d.ts.map +1 -1
  1234. package/build/src/theme/BackToTopButton/index.js +3 -3
  1235. package/build/src/theme/BackToTopButton/index.js.map +1 -1
  1236. package/build/src/theme/Blog/Components/Author/Socials/index.d.ts +4 -0
  1237. package/build/src/theme/Blog/Components/Author/Socials/index.d.ts.map +1 -0
  1238. package/build/src/theme/Blog/Components/Author/Socials/index.js +58 -0
  1239. package/build/src/theme/Blog/Components/Author/Socials/index.js.map +1 -0
  1240. package/build/src/theme/Blog/Components/Author/index.d.ts +4 -0
  1241. package/build/src/theme/Blog/Components/Author/index.d.ts.map +1 -0
  1242. package/build/src/theme/Blog/Components/Author/index.js +34 -0
  1243. package/build/src/theme/Blog/Components/Author/index.js.map +1 -0
  1244. package/build/src/theme/Blog/Pages/BlogAuthorsListPage/index.d.ts +2 -2
  1245. package/build/src/theme/Blog/Pages/BlogAuthorsListPage/index.d.ts.map +1 -1
  1246. package/build/src/theme/Blog/Pages/BlogAuthorsListPage/index.js +2 -11
  1247. package/build/src/theme/Blog/Pages/BlogAuthorsListPage/index.js.map +1 -1
  1248. package/build/src/theme/Blog/Pages/BlogAuthorsPostsPage/index.d.ts +2 -2
  1249. package/build/src/theme/Blog/Pages/BlogAuthorsPostsPage/index.d.ts.map +1 -1
  1250. package/build/src/theme/Blog/Pages/BlogAuthorsPostsPage/index.js +12 -16
  1251. package/build/src/theme/Blog/Pages/BlogAuthorsPostsPage/index.js.map +1 -1
  1252. package/build/src/theme/BlogArchivePage/index.d.ts +2 -2
  1253. package/build/src/theme/BlogArchivePage/index.d.ts.map +1 -1
  1254. package/build/src/theme/BlogArchivePage/index.js +9 -4
  1255. package/build/src/theme/BlogArchivePage/index.js.map +1 -1
  1256. package/build/src/theme/BlogLayout/index.d.ts +2 -2
  1257. package/build/src/theme/BlogLayout/index.d.ts.map +1 -1
  1258. package/build/src/theme/BlogLayout/index.js +3 -2
  1259. package/build/src/theme/BlogLayout/index.js.map +1 -1
  1260. package/build/src/theme/BlogListPage/StructuredData/index.d.ts +4 -0
  1261. package/build/src/theme/BlogListPage/StructuredData/index.d.ts.map +1 -0
  1262. package/build/src/theme/BlogListPage/StructuredData/index.js +10 -0
  1263. package/build/src/theme/BlogListPage/StructuredData/index.js.map +1 -0
  1264. package/build/src/theme/BlogListPage/index.d.ts +2 -2
  1265. package/build/src/theme/BlogListPage/index.d.ts.map +1 -1
  1266. package/build/src/theme/BlogListPage/index.js +2 -1
  1267. package/build/src/theme/BlogListPage/index.js.map +1 -1
  1268. package/build/src/theme/BlogListPaginator/index.d.ts +2 -2
  1269. package/build/src/theme/BlogListPaginator/index.d.ts.map +1 -1
  1270. package/build/src/theme/BlogListPaginator/index.js +1 -1
  1271. package/build/src/theme/BlogListPaginator/index.js.map +1 -1
  1272. package/build/src/theme/BlogPostItem/index.d.ts +2 -2
  1273. package/build/src/theme/BlogPostItem/index.d.ts.map +1 -1
  1274. package/build/src/theme/BlogPostItem/index.js +7 -2
  1275. package/build/src/theme/BlogPostItem/index.js.map +1 -1
  1276. package/build/src/theme/BlogPostItems/index.d.ts +2 -2
  1277. package/build/src/theme/BlogPostItems/index.d.ts.map +1 -1
  1278. package/build/src/theme/BlogPostItems/index.js +2 -2
  1279. package/build/src/theme/BlogPostItems/index.js.map +1 -1
  1280. package/build/src/theme/BlogPostPage/Metadata/index.d.ts +3 -0
  1281. package/build/src/theme/BlogPostPage/Metadata/index.d.ts.map +1 -0
  1282. package/build/src/theme/BlogPostPage/Metadata/index.js +36 -0
  1283. package/build/src/theme/BlogPostPage/Metadata/index.js.map +1 -0
  1284. package/build/src/theme/BlogPostPage/StructuredData/index.d.ts +3 -0
  1285. package/build/src/theme/BlogPostPage/StructuredData/index.d.ts.map +1 -0
  1286. package/build/src/theme/BlogPostPage/StructuredData/index.js +10 -0
  1287. package/build/src/theme/BlogPostPage/StructuredData/index.js.map +1 -0
  1288. package/build/src/theme/BlogPostPage/index.d.ts +2 -2
  1289. package/build/src/theme/BlogPostPage/index.d.ts.map +1 -1
  1290. package/build/src/theme/BlogPostPage/index.js +4 -14
  1291. package/build/src/theme/BlogPostPage/index.js.map +1 -1
  1292. package/build/src/theme/BlogPostPaginator/index.d.ts +2 -2
  1293. package/build/src/theme/BlogPostPaginator/index.d.ts.map +1 -1
  1294. package/build/src/theme/BlogPostPaginator/index.js +33 -31
  1295. package/build/src/theme/BlogPostPaginator/index.js.map +1 -1
  1296. package/build/src/theme/BlogSidebar/index.d.ts +2 -2
  1297. package/build/src/theme/BlogSidebar/index.d.ts.map +1 -1
  1298. package/build/src/theme/BlogSidebar/index.js +2 -2
  1299. package/build/src/theme/BlogSidebar/index.js.map +1 -1
  1300. package/build/src/theme/BlogSidebarMobile/index.d.ts +2 -2
  1301. package/build/src/theme/BlogSidebarMobile/index.d.ts.map +1 -1
  1302. package/build/src/theme/BlogSidebarMobile/index.js +1 -1
  1303. package/build/src/theme/BlogSidebarMobile/index.js.map +1 -1
  1304. package/build/src/theme/BlogTagsListPage/index.d.ts +2 -2
  1305. package/build/src/theme/BlogTagsListPage/index.d.ts.map +1 -1
  1306. package/build/src/theme/BlogTagsListPage/index.js +2 -2
  1307. package/build/src/theme/BlogTagsListPage/index.js.map +1 -1
  1308. package/build/src/theme/BlogTagsPostsPage/index.d.ts +2 -2
  1309. package/build/src/theme/BlogTagsPostsPage/index.d.ts.map +1 -1
  1310. package/build/src/theme/BlogTagsPostsPage/index.js +2 -2
  1311. package/build/src/theme/BlogTagsPostsPage/index.js.map +1 -1
  1312. package/build/src/theme/CodeBlock/index.d.ts +2 -2
  1313. package/build/src/theme/CodeBlock/index.d.ts.map +1 -1
  1314. package/build/src/theme/CodeBlock/index.js +15 -3
  1315. package/build/src/theme/CodeBlock/index.js.map +1 -1
  1316. package/build/src/theme/CodeBlock/live-editor.d.ts +3 -3
  1317. package/build/src/theme/CodeBlock/live-editor.d.ts.map +1 -1
  1318. package/build/src/theme/CodeBlock/live-editor.js.map +1 -1
  1319. package/build/src/theme/CodeInline/index.d.ts +2 -2
  1320. package/build/src/theme/CodeInline/index.d.ts.map +1 -1
  1321. package/build/src/theme/CodeInline/index.js +1 -1
  1322. package/build/src/theme/CodeInline/index.js.map +1 -1
  1323. package/build/src/theme/ColorModeToggle/index.d.ts +1 -1
  1324. package/build/src/theme/ColorModeToggle/index.d.ts.map +1 -1
  1325. package/build/src/theme/ColorModeToggle/index.js +1 -1
  1326. package/build/src/theme/ColorModeToggle/index.js.map +1 -1
  1327. package/build/src/theme/ContentFooter/Edit/index.d.ts +4 -0
  1328. package/build/src/theme/ContentFooter/Edit/index.d.ts.map +1 -0
  1329. package/build/src/theme/ContentFooter/Edit/index.js +27 -0
  1330. package/build/src/theme/ContentFooter/Edit/index.js.map +1 -0
  1331. package/build/src/theme/ContentFooter/Share/index.d.ts +4 -0
  1332. package/build/src/theme/ContentFooter/Share/index.d.ts.map +1 -0
  1333. package/build/src/theme/ContentFooter/Share/index.js +23 -0
  1334. package/build/src/theme/ContentFooter/Share/index.js.map +1 -0
  1335. package/build/src/theme/ContentFooter/ShareButton/index.d.ts +4 -0
  1336. package/build/src/theme/ContentFooter/ShareButton/index.d.ts.map +1 -0
  1337. package/build/src/theme/ContentFooter/ShareButton/index.js +68 -0
  1338. package/build/src/theme/ContentFooter/ShareButton/index.js.map +1 -0
  1339. package/build/src/theme/ContentFooter/Tags/index.d.ts +4 -0
  1340. package/build/src/theme/ContentFooter/Tags/index.d.ts.map +1 -0
  1341. package/build/src/theme/ContentFooter/Tags/index.js +16 -0
  1342. package/build/src/theme/ContentFooter/Tags/index.js.map +1 -0
  1343. package/build/src/theme/ContentFooter/index.d.ts +2 -2
  1344. package/build/src/theme/ContentFooter/index.d.ts.map +1 -1
  1345. package/build/src/theme/ContentFooter/index.js +4 -98
  1346. package/build/src/theme/ContentFooter/index.js.map +1 -1
  1347. package/build/src/theme/ContentVisibility/Draft/index.d.ts +2 -2
  1348. package/build/src/theme/ContentVisibility/Draft/index.d.ts.map +1 -1
  1349. package/build/src/theme/ContentVisibility/Draft/index.js +15 -4
  1350. package/build/src/theme/ContentVisibility/Draft/index.js.map +1 -1
  1351. package/build/src/theme/ContentVisibility/Unlisted/index.d.ts +2 -2
  1352. package/build/src/theme/ContentVisibility/Unlisted/index.d.ts.map +1 -1
  1353. package/build/src/theme/ContentVisibility/Unlisted/index.js +16 -4
  1354. package/build/src/theme/ContentVisibility/Unlisted/index.js.map +1 -1
  1355. package/build/src/theme/ContentVisibility/index.d.ts +2 -2
  1356. package/build/src/theme/ContentVisibility/index.d.ts.map +1 -1
  1357. package/build/src/theme/ContentVisibility/index.js +1 -1
  1358. package/build/src/theme/ContentVisibility/index.js.map +1 -1
  1359. package/build/src/theme/Details/index.d.ts +2 -2
  1360. package/build/src/theme/Details/index.d.ts.map +1 -1
  1361. package/build/src/theme/Details/index.js +10 -3
  1362. package/build/src/theme/Details/index.js.map +1 -1
  1363. package/build/src/theme/DocBreadcrumbs/StructuredData/index.d.ts +4 -0
  1364. package/build/src/theme/DocBreadcrumbs/StructuredData/index.d.ts.map +1 -0
  1365. package/build/src/theme/DocBreadcrumbs/StructuredData/index.js +12 -0
  1366. package/build/src/theme/DocBreadcrumbs/StructuredData/index.js.map +1 -0
  1367. package/build/src/theme/DocBreadcrumbs/index.d.ts +2 -1
  1368. package/build/src/theme/DocBreadcrumbs/index.d.ts.map +1 -1
  1369. package/build/src/theme/DocBreadcrumbs/index.js +14 -13
  1370. package/build/src/theme/DocBreadcrumbs/index.js.map +1 -1
  1371. package/build/src/theme/DocCard/index.d.ts +2 -2
  1372. package/build/src/theme/DocCard/index.d.ts.map +1 -1
  1373. package/build/src/theme/DocCard/index.js +1 -1
  1374. package/build/src/theme/DocCard/index.js.map +1 -1
  1375. package/build/src/theme/DocCardList/index.d.ts +2 -2
  1376. package/build/src/theme/DocCardList/index.d.ts.map +1 -1
  1377. package/build/src/theme/DocCardList/index.js +1 -1
  1378. package/build/src/theme/DocCardList/index.js.map +1 -1
  1379. package/build/src/theme/DocCategoryGeneratedIndexPage/index.d.ts +2 -2
  1380. package/build/src/theme/DocCategoryGeneratedIndexPage/index.d.ts.map +1 -1
  1381. package/build/src/theme/DocCategoryGeneratedIndexPage/index.js +1 -2
  1382. package/build/src/theme/DocCategoryGeneratedIndexPage/index.js.map +1 -1
  1383. package/build/src/theme/DocItem/Content/index.d.ts +2 -2
  1384. package/build/src/theme/DocItem/Content/index.d.ts.map +1 -1
  1385. package/build/src/theme/DocItem/Content/index.js +1 -1
  1386. package/build/src/theme/DocItem/Content/index.js.map +1 -1
  1387. package/build/src/theme/DocItem/Footer/index.d.ts +2 -1
  1388. package/build/src/theme/DocItem/Footer/index.d.ts.map +1 -1
  1389. package/build/src/theme/DocItem/Footer/index.js +2 -2
  1390. package/build/src/theme/DocItem/Footer/index.js.map +1 -1
  1391. package/build/src/theme/DocItem/Layout/index.d.ts +2 -2
  1392. package/build/src/theme/DocItem/Layout/index.d.ts.map +1 -1
  1393. package/build/src/theme/DocItem/Layout/index.js +2 -10
  1394. package/build/src/theme/DocItem/Layout/index.js.map +1 -1
  1395. package/build/src/theme/DocItem/Metadata/index.d.ts +2 -1
  1396. package/build/src/theme/DocItem/Metadata/index.d.ts.map +1 -1
  1397. package/build/src/theme/DocItem/Metadata/index.js +4 -1
  1398. package/build/src/theme/DocItem/Metadata/index.js.map +1 -1
  1399. package/build/src/theme/DocItem/Paginator/index.d.ts +2 -1
  1400. package/build/src/theme/DocItem/Paginator/index.d.ts.map +1 -1
  1401. package/build/src/theme/DocItem/Paginator/index.js +3 -2
  1402. package/build/src/theme/DocItem/Paginator/index.js.map +1 -1
  1403. package/build/src/theme/DocItem/TOC/Desktop/index.d.ts +2 -1
  1404. package/build/src/theme/DocItem/TOC/Desktop/index.d.ts.map +1 -1
  1405. package/build/src/theme/DocItem/TOC/Desktop/index.js +3 -2
  1406. package/build/src/theme/DocItem/TOC/Desktop/index.js.map +1 -1
  1407. package/build/src/theme/DocItem/TOC/Mobile/index.d.ts +2 -1
  1408. package/build/src/theme/DocItem/TOC/Mobile/index.d.ts.map +1 -1
  1409. package/build/src/theme/DocItem/TOC/Mobile/index.js +3 -2
  1410. package/build/src/theme/DocItem/TOC/Mobile/index.js.map +1 -1
  1411. package/build/src/theme/DocItem/index.d.ts +2 -2
  1412. package/build/src/theme/DocItem/index.d.ts.map +1 -1
  1413. package/build/src/theme/DocItem/index.js +2 -2
  1414. package/build/src/theme/DocItem/index.js.map +1 -1
  1415. package/build/src/theme/DocPaginator/index.d.ts +2 -2
  1416. package/build/src/theme/DocPaginator/index.d.ts.map +1 -1
  1417. package/build/src/theme/DocPaginator/index.js +1 -1
  1418. package/build/src/theme/DocPaginator/index.js.map +1 -1
  1419. package/build/src/theme/DocRoot/Layout/Main/index.d.ts +2 -2
  1420. package/build/src/theme/DocRoot/Layout/Main/index.d.ts.map +1 -1
  1421. package/build/src/theme/DocRoot/Layout/Main/index.js +1 -1
  1422. package/build/src/theme/DocRoot/Layout/Main/index.js.map +1 -1
  1423. package/build/src/theme/DocRoot/Layout/Sidebar/index.d.ts +2 -2
  1424. package/build/src/theme/DocRoot/Layout/Sidebar/index.d.ts.map +1 -1
  1425. package/build/src/theme/DocRoot/Layout/Sidebar/index.js +3 -2
  1426. package/build/src/theme/DocRoot/Layout/Sidebar/index.js.map +1 -1
  1427. package/build/src/theme/DocRoot/Layout/index.d.ts +2 -2
  1428. package/build/src/theme/DocRoot/Layout/index.d.ts.map +1 -1
  1429. package/build/src/theme/DocRoot/Layout/index.js +2 -2
  1430. package/build/src/theme/DocRoot/Layout/index.js.map +1 -1
  1431. package/build/src/theme/DocRoot/index.d.ts +2 -2
  1432. package/build/src/theme/DocRoot/index.d.ts.map +1 -1
  1433. package/build/src/theme/DocRoot/index.js +2 -1
  1434. package/build/src/theme/DocRoot/index.js.map +1 -1
  1435. package/build/src/theme/DocSidebar/index.d.ts +2 -2
  1436. package/build/src/theme/DocSidebar/index.d.ts.map +1 -1
  1437. package/build/src/theme/DocSidebar/index.js +5 -2
  1438. package/build/src/theme/DocSidebar/index.js.map +1 -1
  1439. package/build/src/theme/DocSidebarItem/Category/index.d.ts +2 -2
  1440. package/build/src/theme/DocSidebarItem/Category/index.d.ts.map +1 -1
  1441. package/build/src/theme/DocSidebarItem/Category/index.js +27 -4
  1442. package/build/src/theme/DocSidebarItem/Category/index.js.map +1 -1
  1443. package/build/src/theme/DocSidebarItem/Html/index.d.ts +2 -2
  1444. package/build/src/theme/DocSidebarItem/Html/index.d.ts.map +1 -1
  1445. package/build/src/theme/DocSidebarItem/Html/index.js +1 -1
  1446. package/build/src/theme/DocSidebarItem/Html/index.js.map +1 -1
  1447. package/build/src/theme/DocSidebarItem/Link/index.d.ts +2 -2
  1448. package/build/src/theme/DocSidebarItem/Link/index.d.ts.map +1 -1
  1449. package/build/src/theme/DocSidebarItem/Link/index.js +1 -1
  1450. package/build/src/theme/DocSidebarItem/Link/index.js.map +1 -1
  1451. package/build/src/theme/DocSidebarItem/index.d.ts +2 -2
  1452. package/build/src/theme/DocSidebarItem/index.d.ts.map +1 -1
  1453. package/build/src/theme/DocSidebarItem/index.js +3 -3
  1454. package/build/src/theme/DocSidebarItem/index.js.map +1 -1
  1455. package/build/src/theme/DocSidebarItems/index.d.ts +2 -2
  1456. package/build/src/theme/DocSidebarItems/index.d.ts.map +1 -1
  1457. package/build/src/theme/DocSidebarItems/index.js +1 -1
  1458. package/build/src/theme/DocSidebarItems/index.js.map +1 -1
  1459. package/build/src/theme/DocSidebarMobile/index.d.ts +2 -1
  1460. package/build/src/theme/DocSidebarMobile/index.d.ts.map +1 -1
  1461. package/build/src/theme/DocSidebarMobile/index.js +2 -2
  1462. package/build/src/theme/DocSidebarMobile/index.js.map +1 -1
  1463. package/build/src/theme/DocTagDocListPage/index.d.ts +2 -2
  1464. package/build/src/theme/DocTagDocListPage/index.d.ts.map +1 -1
  1465. package/build/src/theme/DocTagDocListPage/index.js +42 -3
  1466. package/build/src/theme/DocTagDocListPage/index.js.map +1 -1
  1467. package/build/src/theme/DocTagsListPage/index.d.ts +2 -2
  1468. package/build/src/theme/DocTagsListPage/index.d.ts.map +1 -1
  1469. package/build/src/theme/DocTagsListPage/index.js +1 -1
  1470. package/build/src/theme/DocTagsListPage/index.js.map +1 -1
  1471. package/build/src/theme/DocVersionBanner/index.d.ts +2 -1
  1472. package/build/src/theme/DocVersionBanner/index.d.ts.map +1 -1
  1473. package/build/src/theme/DocVersionBanner/index.js +2 -2
  1474. package/build/src/theme/DocVersionBanner/index.js.map +1 -1
  1475. package/build/src/theme/DocVersionRoot/index.d.ts +2 -2
  1476. package/build/src/theme/DocVersionRoot/index.d.ts.map +1 -1
  1477. package/build/src/theme/DocVersionRoot/index.js.map +1 -1
  1478. package/build/src/theme/DocsRoot/index.d.ts +2 -2
  1479. package/build/src/theme/DocsRoot/index.d.ts.map +1 -1
  1480. package/build/src/theme/DocsRoot/index.js.map +1 -1
  1481. package/build/src/theme/EditMetaRow/index.d.ts +2 -2
  1482. package/build/src/theme/EditMetaRow/index.d.ts.map +1 -1
  1483. package/build/src/theme/EditMetaRow/index.js +1 -1
  1484. package/build/src/theme/EditMetaRow/index.js.map +1 -1
  1485. package/build/src/theme/EditThisPage/index.d.ts +2 -2
  1486. package/build/src/theme/EditThisPage/index.d.ts.map +1 -1
  1487. package/build/src/theme/EditThisPage/index.js +1 -1
  1488. package/build/src/theme/EditThisPage/index.js.map +1 -1
  1489. package/build/src/theme/Error/index.d.ts +2 -2
  1490. package/build/src/theme/Error/index.d.ts.map +1 -1
  1491. package/build/src/theme/Error/index.js +8 -2
  1492. package/build/src/theme/Error/index.js.map +1 -1
  1493. package/build/src/theme/ErrorPageContent/index.d.ts +2 -2
  1494. package/build/src/theme/ErrorPageContent/index.d.ts.map +1 -1
  1495. package/build/src/theme/ErrorPageContent/index.js +40 -7
  1496. package/build/src/theme/ErrorPageContent/index.js.map +1 -1
  1497. package/build/src/theme/Footer/Commons/index.d.ts +2 -2
  1498. package/build/src/theme/Footer/Commons/index.d.ts.map +1 -1
  1499. package/build/src/theme/Footer/Commons/index.js +16 -5
  1500. package/build/src/theme/Footer/Commons/index.js.map +1 -1
  1501. package/build/src/theme/Footer/Embassy/index.d.ts +2 -2
  1502. package/build/src/theme/Footer/Embassy/index.d.ts.map +1 -1
  1503. package/build/src/theme/Footer/Embassy/index.js +16 -5
  1504. package/build/src/theme/Footer/Embassy/index.js.map +1 -1
  1505. package/build/src/theme/Footer/Launchpad/index.d.ts +2 -2
  1506. package/build/src/theme/Footer/Launchpad/index.d.ts.map +1 -1
  1507. package/build/src/theme/Footer/Launchpad/index.js +15 -5
  1508. package/build/src/theme/Footer/Launchpad/index.js.map +1 -1
  1509. package/build/src/theme/Footer/Ledger/index.d.ts +2 -2
  1510. package/build/src/theme/Footer/Ledger/index.d.ts.map +1 -1
  1511. package/build/src/theme/Footer/Ledger/index.js +13 -2
  1512. package/build/src/theme/Footer/Ledger/index.js.map +1 -1
  1513. package/build/src/theme/Footer/credit.d.ts +2 -2
  1514. package/build/src/theme/Footer/credit.d.ts.map +1 -1
  1515. package/build/src/theme/Footer/credit.js +55 -19
  1516. package/build/src/theme/Footer/credit.js.map +1 -1
  1517. package/build/src/theme/Footer/cta.d.ts +4 -0
  1518. package/build/src/theme/Footer/cta.d.ts.map +1 -0
  1519. package/build/src/theme/Footer/cta.js +15 -0
  1520. package/build/src/theme/Footer/cta.js.map +1 -0
  1521. package/build/src/theme/Footer/index.d.ts +2 -1
  1522. package/build/src/theme/Footer/index.d.ts.map +1 -1
  1523. package/build/src/theme/Footer/index.js +14 -2
  1524. package/build/src/theme/Footer/index.js.map +1 -1
  1525. package/build/src/theme/Heading/index.d.ts +4 -3
  1526. package/build/src/theme/Heading/index.d.ts.map +1 -1
  1527. package/build/src/theme/Heading/index.js +1 -0
  1528. package/build/src/theme/Heading/index.js.map +1 -1
  1529. package/build/src/theme/IconExternalLink/index.d.ts +4 -0
  1530. package/build/src/theme/IconExternalLink/index.d.ts.map +1 -0
  1531. package/build/src/theme/IconExternalLink/index.js +12 -0
  1532. package/build/src/theme/IconExternalLink/index.js.map +1 -0
  1533. package/build/src/theme/LastUpdated/index.d.ts +2 -2
  1534. package/build/src/theme/LastUpdated/index.d.ts.map +1 -1
  1535. package/build/src/theme/LastUpdated/index.js +1 -1
  1536. package/build/src/theme/LastUpdated/index.js.map +1 -1
  1537. package/build/src/theme/Layout/Provider/index.d.ts +2 -2
  1538. package/build/src/theme/Layout/Provider/index.d.ts.map +1 -1
  1539. package/build/src/theme/Layout/Provider/index.js +8 -8
  1540. package/build/src/theme/Layout/Provider/index.js.map +1 -1
  1541. package/build/src/theme/Layout/index.d.ts +2 -2
  1542. package/build/src/theme/Layout/index.d.ts.map +1 -1
  1543. package/build/src/theme/Layout/index.js +1 -1
  1544. package/build/src/theme/Layout/index.js.map +1 -1
  1545. package/build/src/theme/Loading/index.d.ts +2 -2
  1546. package/build/src/theme/Loading/index.d.ts.map +1 -1
  1547. package/build/src/theme/Loading/index.js +3 -3
  1548. package/build/src/theme/Loading/index.js.map +1 -1
  1549. package/build/src/theme/Logo/index.d.ts +4 -0
  1550. package/build/src/theme/Logo/index.d.ts.map +1 -0
  1551. package/build/src/theme/Logo/index.js +52 -0
  1552. package/build/src/theme/Logo/index.js.map +1 -0
  1553. package/build/src/theme/MDXComponents/index.d.ts +15 -13
  1554. package/build/src/theme/MDXComponents/index.d.ts.map +1 -1
  1555. package/build/src/theme/MDXComponents/index.js +23 -3
  1556. package/build/src/theme/MDXComponents/index.js.map +1 -1
  1557. package/build/src/theme/MDXContent/index.d.ts +2 -2
  1558. package/build/src/theme/MDXContent/index.d.ts.map +1 -1
  1559. package/build/src/theme/MDXContent/index.js +1 -1
  1560. package/build/src/theme/MDXContent/index.js.map +1 -1
  1561. package/build/src/theme/MDXPage/index.d.ts +2 -2
  1562. package/build/src/theme/MDXPage/index.d.ts.map +1 -1
  1563. package/build/src/theme/MDXPage/index.js +20 -7
  1564. package/build/src/theme/MDXPage/index.js.map +1 -1
  1565. package/build/src/theme/Mermaid/index.d.ts +2 -2
  1566. package/build/src/theme/Mermaid/index.d.ts.map +1 -1
  1567. package/build/src/theme/Mermaid/index.js +3 -2
  1568. package/build/src/theme/Mermaid/index.js.map +1 -1
  1569. package/build/src/theme/Navbar/Bridge/index.d.ts +2 -2
  1570. package/build/src/theme/Navbar/Bridge/index.d.ts.map +1 -1
  1571. package/build/src/theme/Navbar/Bridge/index.js +22 -6
  1572. package/build/src/theme/Navbar/Bridge/index.js.map +1 -1
  1573. package/build/src/theme/Navbar/Bridge/mobile-menu.d.ts +2 -2
  1574. package/build/src/theme/Navbar/Bridge/mobile-menu.d.ts.map +1 -1
  1575. package/build/src/theme/Navbar/Bridge/mobile-menu.js +24 -24
  1576. package/build/src/theme/Navbar/Bridge/mobile-menu.js.map +1 -1
  1577. package/build/src/theme/Navbar/Canopy/index.d.ts +2 -2
  1578. package/build/src/theme/Navbar/Canopy/index.d.ts.map +1 -1
  1579. package/build/src/theme/Navbar/Canopy/index.js +22 -6
  1580. package/build/src/theme/Navbar/Canopy/index.js.map +1 -1
  1581. package/build/src/theme/Navbar/Canopy/mobile-menu.d.ts +2 -2
  1582. package/build/src/theme/Navbar/Canopy/mobile-menu.d.ts.map +1 -1
  1583. package/build/src/theme/Navbar/Canopy/mobile-menu.js +24 -23
  1584. package/build/src/theme/Navbar/Canopy/mobile-menu.js.map +1 -1
  1585. package/build/src/theme/Navbar/Compass/index.d.ts +2 -2
  1586. package/build/src/theme/Navbar/Compass/index.d.ts.map +1 -1
  1587. package/build/src/theme/Navbar/Compass/index.js +22 -6
  1588. package/build/src/theme/Navbar/Compass/index.js.map +1 -1
  1589. package/build/src/theme/Navbar/Compass/mobile-menu.d.ts +2 -2
  1590. package/build/src/theme/Navbar/Compass/mobile-menu.d.ts.map +1 -1
  1591. package/build/src/theme/Navbar/Compass/mobile-menu.js +24 -24
  1592. package/build/src/theme/Navbar/Compass/mobile-menu.js.map +1 -1
  1593. package/build/src/theme/Navbar/Monolith/index.d.ts +2 -2
  1594. package/build/src/theme/Navbar/Monolith/index.d.ts.map +1 -1
  1595. package/build/src/theme/Navbar/Monolith/index.js +9 -6
  1596. package/build/src/theme/Navbar/Monolith/index.js.map +1 -1
  1597. package/build/src/theme/Navbar/Monolith/mobile-menu.d.ts +2 -2
  1598. package/build/src/theme/Navbar/Monolith/mobile-menu.d.ts.map +1 -1
  1599. package/build/src/theme/Navbar/Monolith/mobile-menu.js +21 -17
  1600. package/build/src/theme/Navbar/Monolith/mobile-menu.js.map +1 -1
  1601. package/build/src/theme/Navbar/More/index.d.ts +4 -0
  1602. package/build/src/theme/Navbar/More/index.d.ts.map +1 -0
  1603. package/build/src/theme/Navbar/More/index.js +23 -0
  1604. package/build/src/theme/Navbar/More/index.js.map +1 -0
  1605. package/build/src/theme/Navbar/index.d.ts +2 -1
  1606. package/build/src/theme/Navbar/index.d.ts.map +1 -1
  1607. package/build/src/theme/Navbar/index.js +39 -18
  1608. package/build/src/theme/Navbar/index.js.map +1 -1
  1609. package/build/src/theme/NavbarItem/component-types.d.ts +2 -2
  1610. package/build/src/theme/NavbarItem/component-types.d.ts.map +1 -1
  1611. package/build/src/theme/NavbarItem/component-types.js +0 -2
  1612. package/build/src/theme/NavbarItem/component-types.js.map +1 -1
  1613. package/build/src/theme/NavbarItem/default-navbar-item.d.ts +2 -2
  1614. package/build/src/theme/NavbarItem/default-navbar-item.d.ts.map +1 -1
  1615. package/build/src/theme/NavbarItem/default-navbar-item.js +5 -1
  1616. package/build/src/theme/NavbarItem/default-navbar-item.js.map +1 -1
  1617. package/build/src/theme/NavbarItem/doc-navbar-item.d.ts +2 -2
  1618. package/build/src/theme/NavbarItem/doc-navbar-item.d.ts.map +1 -1
  1619. package/build/src/theme/NavbarItem/doc-navbar-item.js +3 -4
  1620. package/build/src/theme/NavbarItem/doc-navbar-item.js.map +1 -1
  1621. package/build/src/theme/NavbarItem/doc-sidebar-navbar-item.d.ts +2 -2
  1622. package/build/src/theme/NavbarItem/doc-sidebar-navbar-item.d.ts.map +1 -1
  1623. package/build/src/theme/NavbarItem/doc-sidebar-navbar-item.js +2 -4
  1624. package/build/src/theme/NavbarItem/doc-sidebar-navbar-item.js.map +1 -1
  1625. package/build/src/theme/NavbarItem/docs-version-dropdown-navbar-item.d.ts +2 -2
  1626. package/build/src/theme/NavbarItem/docs-version-dropdown-navbar-item.d.ts.map +1 -1
  1627. package/build/src/theme/NavbarItem/docs-version-dropdown-navbar-item.js +24 -13
  1628. package/build/src/theme/NavbarItem/docs-version-dropdown-navbar-item.js.map +1 -1
  1629. package/build/src/theme/NavbarItem/docs-version-navbar-item.d.ts +2 -2
  1630. package/build/src/theme/NavbarItem/docs-version-navbar-item.d.ts.map +1 -1
  1631. package/build/src/theme/NavbarItem/docs-version-navbar-item.js.map +1 -1
  1632. package/build/src/theme/NavbarItem/dropdown-navbar-item.d.ts +2 -2
  1633. package/build/src/theme/NavbarItem/dropdown-navbar-item.d.ts.map +1 -1
  1634. package/build/src/theme/NavbarItem/dropdown-navbar-item.js.map +1 -1
  1635. package/build/src/theme/NavbarItem/html-navbar-item.d.ts +2 -2
  1636. package/build/src/theme/NavbarItem/html-navbar-item.d.ts.map +1 -1
  1637. package/build/src/theme/NavbarItem/html-navbar-item.js.map +1 -1
  1638. package/build/src/theme/NavbarItem/index.d.ts +2 -2
  1639. package/build/src/theme/NavbarItem/index.d.ts.map +1 -1
  1640. package/build/src/theme/NavbarItem/index.js +2 -1
  1641. package/build/src/theme/NavbarItem/index.js.map +1 -1
  1642. package/build/src/theme/NavbarItem/locale-dropdown-navbar-item.d.ts +2 -2
  1643. package/build/src/theme/NavbarItem/locale-dropdown-navbar-item.d.ts.map +1 -1
  1644. package/build/src/theme/NavbarItem/locale-dropdown-navbar-item.js +43 -22
  1645. package/build/src/theme/NavbarItem/locale-dropdown-navbar-item.js.map +1 -1
  1646. package/build/src/theme/NavbarItem/search-navbar-item.d.ts +2 -2
  1647. package/build/src/theme/NavbarItem/search-navbar-item.d.ts.map +1 -1
  1648. package/build/src/theme/NavbarItem/search-navbar-item.js.map +1 -1
  1649. package/build/src/theme/NotFound/Content/index.d.ts +2 -1
  1650. package/build/src/theme/NotFound/Content/index.d.ts.map +1 -1
  1651. package/build/src/theme/NotFound/Content/index.js +108 -17
  1652. package/build/src/theme/NotFound/Content/index.js.map +1 -1
  1653. package/build/src/theme/NotFound/index.d.ts +2 -1
  1654. package/build/src/theme/NotFound/index.d.ts.map +1 -1
  1655. package/build/src/theme/NotFound/index.js +2 -2
  1656. package/build/src/theme/NotFound/index.js.map +1 -1
  1657. package/build/src/theme/Root/icons.js +6 -2
  1658. package/build/src/theme/Root/icons.js.map +1 -1
  1659. package/build/src/theme/Root/index.d.ts +2 -2
  1660. package/build/src/theme/Root/index.d.ts.map +1 -1
  1661. package/build/src/theme/Root/index.js.map +1 -1
  1662. package/build/src/theme/SearchBar/search-context.d.ts +3 -3
  1663. package/build/src/theme/SearchBar/search-context.d.ts.map +1 -1
  1664. package/build/src/theme/SearchBar/search-context.js.map +1 -1
  1665. package/build/src/theme/SearchBar/search-input.d.ts +2 -2
  1666. package/build/src/theme/SearchBar/search-input.d.ts.map +1 -1
  1667. package/build/src/theme/SearchBar/search-input.js +42 -3
  1668. package/build/src/theme/SearchBar/search-input.js.map +1 -1
  1669. package/build/src/theme/SearchBar/search-provider.d.ts +2 -2
  1670. package/build/src/theme/SearchBar/search-provider.d.ts.map +1 -1
  1671. package/build/src/theme/SearchBar/search-provider.js +18 -0
  1672. package/build/src/theme/SearchBar/search-provider.js.map +1 -1
  1673. package/build/src/theme/SearchBar/search-results.d.ts +2 -2
  1674. package/build/src/theme/SearchBar/search-results.d.ts.map +1 -1
  1675. package/build/src/theme/SearchBar/search-results.js +102 -4
  1676. package/build/src/theme/SearchBar/search-results.js.map +1 -1
  1677. package/build/src/theme/SearchMetadata/index.d.ts +2 -2
  1678. package/build/src/theme/SearchMetadata/index.d.ts.map +1 -1
  1679. package/build/src/theme/SearchMetadata/index.js.map +1 -1
  1680. package/build/src/theme/SearchPage/index.d.ts +2 -2
  1681. package/build/src/theme/SearchPage/index.d.ts.map +1 -1
  1682. package/build/src/theme/SearchPage/index.js +44 -4
  1683. package/build/src/theme/SearchPage/index.js.map +1 -1
  1684. package/build/src/theme/Showcase/index.d.ts +8 -0
  1685. package/build/src/theme/Showcase/index.d.ts.map +1 -0
  1686. package/build/src/theme/Showcase/index.js +61 -0
  1687. package/build/src/theme/Showcase/index.js.map +1 -0
  1688. package/build/src/theme/SiteMetadata/index.d.ts.map +1 -1
  1689. package/build/src/theme/SiteMetadata/index.js +1 -1
  1690. package/build/src/theme/SiteMetadata/index.js.map +1 -1
  1691. package/build/src/theme/SkipToContent/index.d.ts +2 -1
  1692. package/build/src/theme/SkipToContent/index.d.ts.map +1 -1
  1693. package/build/src/theme/SkipToContent/index.js +2 -2
  1694. package/build/src/theme/SkipToContent/index.js.map +1 -1
  1695. package/build/src/theme/TOC/index.d.ts +2 -2
  1696. package/build/src/theme/TOC/index.d.ts.map +1 -1
  1697. package/build/src/theme/TOC/index.js +1 -1
  1698. package/build/src/theme/TOC/index.js.map +1 -1
  1699. package/build/src/theme/TOCCollapsible/index.d.ts +2 -2
  1700. package/build/src/theme/TOCCollapsible/index.d.ts.map +1 -1
  1701. package/build/src/theme/TOCCollapsible/index.js +1 -1
  1702. package/build/src/theme/TOCCollapsible/index.js.map +1 -1
  1703. package/build/src/theme/TabItem/index.d.ts +2 -2
  1704. package/build/src/theme/TabItem/index.d.ts.map +1 -1
  1705. package/build/src/theme/TabItem/index.js +1 -1
  1706. package/build/src/theme/TabItem/index.js.map +1 -1
  1707. package/build/src/theme/Tabs/index.d.ts +2 -2
  1708. package/build/src/theme/Tabs/index.d.ts.map +1 -1
  1709. package/build/src/theme/Tabs/index.js +9 -2
  1710. package/build/src/theme/Tabs/index.js.map +1 -1
  1711. package/build/src/theme/Tag/index.d.ts +2 -2
  1712. package/build/src/theme/Tag/index.d.ts.map +1 -1
  1713. package/build/src/theme/Tag/index.js +1 -1
  1714. package/build/src/theme/Tag/index.js.map +1 -1
  1715. package/build/src/theme/TagsListByLetter/index.d.ts +2 -2
  1716. package/build/src/theme/TagsListByLetter/index.d.ts.map +1 -1
  1717. package/build/src/theme/TagsListByLetter/index.js +1 -1
  1718. package/build/src/theme/TagsListByLetter/index.js.map +1 -1
  1719. package/build/src/theme/ThemeProvider/TitleFormatter/index.d.ts +2 -2
  1720. package/build/src/theme/ThemeProvider/TitleFormatter/index.d.ts.map +1 -1
  1721. package/build/src/theme/ThemeProvider/TitleFormatter/index.js.map +1 -1
  1722. package/build/src/theme/ThemeProvider/index.d.ts +2 -2
  1723. package/build/src/theme/ThemeProvider/index.d.ts.map +1 -1
  1724. package/build/src/theme/ThemeProvider/index.js.map +1 -1
  1725. package/build/src/theme/ThemedImage/index.d.ts +2 -2
  1726. package/build/src/theme/ThemedImage/index.d.ts.map +1 -1
  1727. package/build/src/theme/ThemedImage/index.js +1 -1
  1728. package/build/src/theme/ThemedImage/index.js.map +1 -1
  1729. package/build/src/types/blocks/app-market-download/index.d.ts +41 -0
  1730. package/build/src/types/blocks/blog-preview/index.d.ts +100 -0
  1731. package/build/src/types/blocks/features/index.d.ts +41 -0
  1732. package/build/src/types/blocks/frame/index.d.ts +23 -0
  1733. package/build/src/types/blocks/hero/index.d.ts +41 -0
  1734. package/build/src/types/blocks/install-strip/index.d.ts +52 -0
  1735. package/build/src/types/blocks/spotlight/index.d.ts +26 -0
  1736. package/build/src/types/blocks/stats/index.d.ts +41 -0
  1737. package/build/src/types/blocks/terminology/index.d.ts +31 -0
  1738. package/build/src/types/blocks/typewriter/index.d.ts +122 -0
  1739. package/build/src/types/get-swizzle-config.d.ts +2 -0
  1740. package/build/src/types/index.d.ts +297 -310
  1741. package/build/src/types/lib/color.d.ts +103 -93
  1742. package/build/src/types/lib/compare-preset-theme-files.d.ts +10 -0
  1743. package/build/src/types/lib/css-generator.d.ts +93 -64
  1744. package/build/src/types/lib/filter-preset-theme-file.d.ts +12 -0
  1745. package/build/src/types/lib/google-fonts-url.d.ts +45 -0
  1746. package/build/src/types/lib/mermaid.d.ts +71 -51
  1747. package/build/src/types/lib/rehype-shiki.d.ts +277 -105
  1748. package/build/src/types/lib/safe-json-ld.d.ts +12 -0
  1749. package/build/src/types/lib/search/indexer.d.ts +280 -131
  1750. package/build/src/types/lib/search/perform-search.d.ts +194 -0
  1751. package/build/src/types/lib/search/use-search-highlight.d.ts +36 -21
  1752. package/build/src/types/lib/search/use-search-worker.d.ts +92 -60
  1753. package/build/src/types/lib/search/worker.d.ts +186 -93
  1754. package/build/src/types/lib/shiki-themes.d.ts +16 -9
  1755. package/build/src/types/lib/sticky-layout.d.ts +13 -13
  1756. package/build/src/types/lib/toc.d.ts +47 -45
  1757. package/build/src/types/lib/translations.d.ts +362 -0
  1758. package/build/src/types/lib/use-details-dismiss.d.ts +37 -0
  1759. package/build/src/types/lib/use-navbar-active-item.d.ts +79 -0
  1760. package/build/src/types/lib/use-navbar-overflow.d.ts +113 -0
  1761. package/build/src/types/options.d.ts +659 -140
  1762. package/build/src/types/plugins/mermaid-tooltip/client.d.ts +107 -0
  1763. package/build/src/types/plugins/mermaid-tooltip/index.d.ts +17 -0
  1764. package/build/src/types/preset.d.ts +79 -69
  1765. package/build/src/types/presets/envoy/preset.d.ts +2 -2
  1766. package/build/src/types/presets/foundry/preset.d.ts +2 -2
  1767. package/build/src/types/presets/index.d.ts +4 -4
  1768. package/build/src/types/presets/lantern/preset.d.ts +8 -0
  1769. package/build/src/types/presets/marshal/preset.d.ts +8 -0
  1770. package/build/src/types/presets/sample/preset.d.ts +8 -0
  1771. package/build/src/types/presets/sentinel/preset.d.ts +2 -2
  1772. package/build/src/types/presets/signal/preset.d.ts +2 -2
  1773. package/build/src/types/scripts/announcement-bar-init.d.ts +12 -12
  1774. package/build/src/types/scripts/color-mode-init.d.ts +21 -21
  1775. package/build/src/types/scripts/data-attribute-query.d.ts +1 -1
  1776. package/build/src/types/shared.d.ts +242 -184
  1777. package/build/src/types/tests/cascade-defensive.test.d.ts +324 -0
  1778. package/build/src/types/tests/class-name-style-passthrough.test.d.ts +89 -0
  1779. package/build/src/types/tests/config-drift.test.d.ts +141 -99
  1780. package/build/src/types/tests/demo-coverage.test.d.ts +176 -0
  1781. package/build/src/types/tests/demo-logo-override.test.d.ts +45 -0
  1782. package/build/src/types/tests/folder-axis.test.d.ts +103 -0
  1783. package/build/src/types/tests/layered-scope.test.d.ts +235 -0
  1784. package/build/src/types/tests/lib/color.test.d.ts +154 -52
  1785. package/build/src/types/tests/lib/compare-preset-theme-files.test.d.ts +55 -0
  1786. package/build/src/types/tests/lib/css-generator.test.d.ts +156 -75
  1787. package/build/src/types/tests/lib/filter-preset-theme-file.test.d.ts +55 -0
  1788. package/build/src/types/tests/lib/rehype-shiki.test.d.ts +198 -43
  1789. package/build/src/types/tests/lib/search/indexer.test.d.ts +135 -135
  1790. package/build/src/types/tests/lib/search/worker.test.d.ts +101 -64
  1791. package/build/src/types/tests/lib/shiki-themes.test.d.ts +71 -5
  1792. package/build/src/types/tests/lib/translations.test.d.ts +393 -0
  1793. package/build/src/types/tests/nova-version-drift.test.d.ts +39 -0
  1794. package/build/src/types/tests/options.test.d.ts +397 -39
  1795. package/build/src/types/tests/overlay-completeness.test.d.ts +38 -0
  1796. package/build/src/types/tests/preset-list.test.d.ts +158 -0
  1797. package/build/src/types/tests/preset.test.d.ts +66 -5
  1798. package/build/src/types/tests/presets/envoy/preset.test.d.ts +62 -6
  1799. package/build/src/types/tests/presets/foundry/preset.test.d.ts +37 -6
  1800. package/build/src/types/tests/presets/index.test.d.ts +45 -12
  1801. package/build/src/types/tests/presets/lantern/preset.test.d.ts +36 -0
  1802. package/build/src/types/tests/presets/marshal/preset.test.d.ts +76 -0
  1803. package/build/src/types/tests/presets/sample/preset.test.d.ts +48 -0
  1804. package/build/src/types/tests/presets/sentinel/preset.test.d.ts +62 -6
  1805. package/build/src/types/tests/presets/signal/preset.test.d.ts +49 -6
  1806. package/build/src/types/tests/theme/CodeBlock/live-editor.test.d.ts +47 -7
  1807. package/build/src/types/tests/theme-drift.test.d.ts +42 -37
  1808. package/build/src/types/tests/token-map.test.d.ts +217 -0
  1809. package/build/src/types/tests/type-declarations.test.d.ts +4683 -300
  1810. package/build/src/types/theme/Admonition/index.d.ts +30 -17
  1811. package/build/src/types/theme/AnnouncementBar/index.d.ts +31 -22
  1812. package/build/src/types/theme/BackToTopButton/index.d.ts +20 -11
  1813. package/build/src/types/theme/Blog/Components/Author/Socials/index.d.ts +45 -0
  1814. package/build/src/types/theme/Blog/Components/Author/index.d.ts +50 -0
  1815. package/build/src/types/theme/Blog/Pages/BlogAuthorsListPage/index.d.ts +31 -18
  1816. package/build/src/types/theme/Blog/Pages/BlogAuthorsPostsPage/index.d.ts +37 -18
  1817. package/build/src/types/theme/BlogArchivePage/index.d.ts +40 -34
  1818. package/build/src/types/theme/BlogLayout/index.d.ts +38 -24
  1819. package/build/src/types/theme/BlogListPage/StructuredData/index.d.ts +15 -0
  1820. package/build/src/types/theme/BlogListPage/index.d.ts +18 -11
  1821. package/build/src/types/theme/BlogListPaginator/index.d.ts +39 -32
  1822. package/build/src/types/theme/BlogPostItem/index.d.ts +48 -41
  1823. package/build/src/types/theme/BlogPostItems/index.d.ts +19 -13
  1824. package/build/src/types/theme/BlogPostPage/Metadata/index.d.ts +32 -0
  1825. package/build/src/types/theme/BlogPostPage/StructuredData/index.d.ts +10 -0
  1826. package/build/src/types/theme/BlogPostPage/index.d.ts +46 -38
  1827. package/build/src/types/theme/BlogPostPaginator/index.d.ts +84 -34
  1828. package/build/src/types/theme/BlogSidebar/index.d.ts +44 -37
  1829. package/build/src/types/theme/BlogSidebarMobile/index.d.ts +41 -35
  1830. package/build/src/types/theme/BlogTagsListPage/index.d.ts +14 -7
  1831. package/build/src/types/theme/BlogTagsPostsPage/index.d.ts +21 -14
  1832. package/build/src/types/theme/CodeBlock/index.d.ts +49 -39
  1833. package/build/src/types/theme/CodeBlock/live-editor.d.ts +12 -12
  1834. package/build/src/types/theme/CodeInline/index.d.ts +10 -4
  1835. package/build/src/types/theme/ContentFooter/Edit/index.d.ts +28 -0
  1836. package/build/src/types/theme/ContentFooter/Share/index.d.ts +29 -0
  1837. package/build/src/types/theme/ContentFooter/ShareButton/index.d.ts +44 -0
  1838. package/build/src/types/theme/ContentFooter/Tags/index.d.ts +33 -0
  1839. package/build/src/types/theme/ContentFooter/index.d.ts +32 -56
  1840. package/build/src/types/theme/ContentVisibility/Draft/index.d.ts +14 -3
  1841. package/build/src/types/theme/ContentVisibility/Unlisted/index.d.ts +14 -3
  1842. package/build/src/types/theme/ContentVisibility/index.d.ts +21 -13
  1843. package/build/src/types/theme/Details/index.d.ts +29 -22
  1844. package/build/src/types/theme/DocBreadcrumbs/StructuredData/index.d.ts +24 -0
  1845. package/build/src/types/theme/DocBreadcrumbs/index.d.ts +29 -17
  1846. package/build/src/types/theme/DocCard/index.d.ts +48 -37
  1847. package/build/src/types/theme/DocCardList/index.d.ts +15 -7
  1848. package/build/src/types/theme/DocCategoryGeneratedIndexPage/index.d.ts +42 -34
  1849. package/build/src/types/theme/DocItem/Content/index.d.ts +20 -14
  1850. package/build/src/types/theme/DocItem/Footer/index.d.ts +29 -17
  1851. package/build/src/types/theme/DocItem/Layout/index.d.ts +12 -8
  1852. package/build/src/types/theme/DocItem/Metadata/index.d.ts +15 -3
  1853. package/build/src/types/theme/DocItem/Paginator/index.d.ts +17 -5
  1854. package/build/src/types/theme/DocItem/TOC/Desktop/index.d.ts +16 -2
  1855. package/build/src/types/theme/DocItem/TOC/Mobile/index.d.ts +15 -3
  1856. package/build/src/types/theme/DocItem/index.d.ts +14 -6
  1857. package/build/src/types/theme/DocPaginator/index.d.ts +26 -21
  1858. package/build/src/types/theme/DocRoot/Layout/Main/index.d.ts +13 -4
  1859. package/build/src/types/theme/DocRoot/Layout/Sidebar/index.d.ts +34 -27
  1860. package/build/src/types/theme/DocRoot/Layout/index.d.ts +17 -8
  1861. package/build/src/types/theme/DocRoot/index.d.ts +21 -9
  1862. package/build/src/types/theme/DocSidebar/index.d.ts +20 -10
  1863. package/build/src/types/theme/DocSidebarItem/Category/index.d.ts +95 -75
  1864. package/build/src/types/theme/DocSidebarItem/Html/index.d.ts +18 -10
  1865. package/build/src/types/theme/DocSidebarItem/Link/index.d.ts +21 -13
  1866. package/build/src/types/theme/DocSidebarItem/index.d.ts +16 -9
  1867. package/build/src/types/theme/DocSidebarItems/index.d.ts +18 -11
  1868. package/build/src/types/theme/DocSidebarMobile/index.d.ts +45 -33
  1869. package/build/src/types/theme/DocTagDocListPage/index.d.ts +87 -31
  1870. package/build/src/types/theme/DocTagsListPage/index.d.ts +11 -4
  1871. package/build/src/types/theme/DocVersionBanner/index.d.ts +19 -7
  1872. package/build/src/types/theme/DocVersionRoot/index.d.ts +9 -9
  1873. package/build/src/types/theme/DocsRoot/index.d.ts +6 -6
  1874. package/build/src/types/theme/EditMetaRow/index.d.ts +15 -10
  1875. package/build/src/types/theme/EditThisPage/index.d.ts +12 -4
  1876. package/build/src/types/theme/Error/index.d.ts +25 -7
  1877. package/build/src/types/theme/ErrorPageContent/index.d.ts +37 -8
  1878. package/build/src/types/theme/Footer/Commons/index.d.ts +79 -47
  1879. package/build/src/types/theme/Footer/Embassy/index.d.ts +79 -47
  1880. package/build/src/types/theme/Footer/Launchpad/index.d.ts +76 -51
  1881. package/build/src/types/theme/Footer/Ledger/index.d.ts +80 -48
  1882. package/build/src/types/theme/Footer/credit.d.ts +22 -14
  1883. package/build/src/types/theme/Footer/cta.d.ts +36 -0
  1884. package/build/src/types/theme/Footer/index.d.ts +90 -55
  1885. package/build/src/types/theme/Heading/index.d.ts +21 -18
  1886. package/build/src/types/theme/IconExternalLink/index.d.ts +17 -0
  1887. package/build/src/types/theme/LastUpdated/index.d.ts +24 -17
  1888. package/build/src/types/theme/Layout/Provider/index.d.ts +7 -7
  1889. package/build/src/types/theme/Layout/index.d.ts +19 -13
  1890. package/build/src/types/theme/Loading/index.d.ts +24 -16
  1891. package/build/src/types/theme/Logo/index.d.ts +75 -0
  1892. package/build/src/types/theme/MDXComponents/index.d.ts +36 -14
  1893. package/build/src/types/theme/MDXContent/index.d.ts +11 -5
  1894. package/build/src/types/theme/MDXPage/index.d.ts +56 -30
  1895. package/build/src/types/theme/Mermaid/index.d.ts +38 -22
  1896. package/build/src/types/theme/Navbar/Bridge/index.d.ts +116 -54
  1897. package/build/src/types/theme/Navbar/Bridge/mobile-menu.d.ts +114 -75
  1898. package/build/src/types/theme/Navbar/Canopy/index.d.ts +116 -54
  1899. package/build/src/types/theme/Navbar/Canopy/mobile-menu.d.ts +126 -69
  1900. package/build/src/types/theme/Navbar/Compass/index.d.ts +108 -54
  1901. package/build/src/types/theme/Navbar/Compass/mobile-menu.d.ts +112 -71
  1902. package/build/src/types/theme/Navbar/Monolith/index.d.ts +114 -52
  1903. package/build/src/types/theme/Navbar/Monolith/mobile-menu.d.ts +51 -44
  1904. package/build/src/types/theme/Navbar/More/index.d.ts +43 -0
  1905. package/build/src/types/theme/Navbar/index.d.ts +199 -142
  1906. package/build/src/types/theme/NavbarItem/index.d.ts +179 -124
  1907. package/build/src/types/theme/NotFound/Content/index.d.ts +59 -3
  1908. package/build/src/types/theme/NotFound/index.d.ts +13 -1
  1909. package/build/src/types/theme/Root/index.d.ts +3 -3
  1910. package/build/src/types/theme/SearchBar/search-context.d.ts +69 -26
  1911. package/build/src/types/theme/SearchBar/search-input.d.ts +44 -28
  1912. package/build/src/types/theme/SearchBar/search-provider.d.ts +32 -22
  1913. package/build/src/types/theme/SearchBar/search-results.d.ts +73 -30
  1914. package/build/src/types/theme/SearchMetadata/index.d.ts +7 -7
  1915. package/build/src/types/theme/SearchPage/index.d.ts +50 -24
  1916. package/build/src/types/theme/Showcase/index.d.ts +91 -0
  1917. package/build/src/types/theme/SiteMetadata/index.d.ts +26 -26
  1918. package/build/src/types/theme/SkipToContent/index.d.ts +15 -0
  1919. package/build/src/types/theme/TOC/index.d.ts +44 -30
  1920. package/build/src/types/theme/TOCCollapsible/index.d.ts +62 -60
  1921. package/build/src/types/theme/TabItem/index.d.ts +19 -11
  1922. package/build/src/types/theme/Tabs/index.d.ts +57 -32
  1923. package/build/src/types/theme/Tag/index.d.ts +17 -9
  1924. package/build/src/types/theme/TagsListByLetter/index.d.ts +13 -6
  1925. package/build/src/types/theme/ThemeProvider/TitleFormatter/index.d.ts +3 -3
  1926. package/build/src/types/theme/ThemeProvider/index.d.ts +3 -3
  1927. package/build/src/types/theme/ThemedImage/index.d.ts +27 -24
  1928. package/build/src/types/worker-globals.d.ts +56 -56
  1929. package/nova-config.d.ts +151 -72
  1930. package/nova-theme.d.ts +210 -44
  1931. package/package.json +11 -7
  1932. package/translations/locales/ar/theme-nova.json +170 -0
  1933. package/translations/locales/en/theme-nova.json +3 -0
  1934. package/translations/locales/zh-Hans/theme-nova.json +170 -0
  1935. package/build/src/components/app-market-download/index.d.ts +0 -4
  1936. package/build/src/components/app-market-download/index.d.ts.map +0 -1
  1937. package/build/src/components/app-market-download/index.js +0 -42
  1938. package/build/src/components/app-market-download/index.js.map +0 -1
  1939. package/build/src/components/blog-preview/index.d.ts +0 -4
  1940. package/build/src/components/blog-preview/index.d.ts.map +0 -1
  1941. package/build/src/components/blog-preview/index.js.map +0 -1
  1942. package/build/src/components/features/index.d.ts +0 -4
  1943. package/build/src/components/features/index.d.ts.map +0 -1
  1944. package/build/src/components/features/index.js +0 -8
  1945. package/build/src/components/features/index.js.map +0 -1
  1946. package/build/src/components/hero/index.d.ts +0 -4
  1947. package/build/src/components/hero/index.d.ts.map +0 -1
  1948. package/build/src/components/hero/index.js.map +0 -1
  1949. package/build/src/components/index.d.ts.map +0 -1
  1950. package/build/src/components/index.js.map +0 -1
  1951. package/build/src/components/install-strip/index.d.ts +0 -4
  1952. package/build/src/components/install-strip/index.d.ts.map +0 -1
  1953. package/build/src/components/install-strip/index.js +0 -39
  1954. package/build/src/components/install-strip/index.js.map +0 -1
  1955. package/build/src/components/spotlight/index.d.ts +0 -4
  1956. package/build/src/components/spotlight/index.d.ts.map +0 -1
  1957. package/build/src/components/spotlight/index.js +0 -7
  1958. package/build/src/components/spotlight/index.js.map +0 -1
  1959. package/build/src/components/stats/index.d.ts +0 -4
  1960. package/build/src/components/stats/index.d.ts.map +0 -1
  1961. package/build/src/components/stats/index.js.map +0 -1
  1962. package/build/src/components/terminology/index.d.ts +0 -4
  1963. package/build/src/components/terminology/index.d.ts.map +0 -1
  1964. package/build/src/components/terminology/index.js +0 -11
  1965. package/build/src/components/terminology/index.js.map +0 -1
  1966. package/build/src/components/typewriter/index.d.ts +0 -10
  1967. package/build/src/components/typewriter/index.d.ts.map +0 -1
  1968. package/build/src/components/typewriter/index.js.map +0 -1
  1969. package/build/src/styles/components/blog-preview/style.css +0 -73
  1970. package/build/src/styles/presets/envoy/theme/DocVersionBadge/style.css +0 -51
  1971. package/build/src/styles/presets/foundry/theme/DocVersionBadge/style.css +0 -37
  1972. package/build/src/styles/presets/sentinel/theme/DocVersionBadge/style.css +0 -40
  1973. package/build/src/styles/presets/signal/theme/DocVersionBadge/style.css +0 -47
  1974. package/build/src/styles/theme/DocVersionBadge/style.css +0 -12
  1975. package/build/src/theme/DocVersionBadge/index.d.ts +0 -3
  1976. package/build/src/theme/DocVersionBadge/index.d.ts.map +0 -1
  1977. package/build/src/theme/DocVersionBadge/index.js +0 -13
  1978. package/build/src/theme/DocVersionBadge/index.js.map +0 -1
  1979. package/build/src/types/components/app-market-download/index.d.ts +0 -33
  1980. package/build/src/types/components/blog-preview/index.d.ts +0 -93
  1981. package/build/src/types/components/features/index.d.ts +0 -35
  1982. package/build/src/types/components/hero/index.d.ts +0 -35
  1983. package/build/src/types/components/install-strip/index.d.ts +0 -45
  1984. package/build/src/types/components/spotlight/index.d.ts +0 -20
  1985. package/build/src/types/components/stats/index.d.ts +0 -33
  1986. package/build/src/types/components/terminology/index.d.ts +0 -25
  1987. package/build/src/types/components/typewriter/index.d.ts +0 -95
  1988. package/build/src/types/theme/DocVersionBadge/index.d.ts +0 -14
  1989. /package/assets/{components → blocks}/app-market-download/google-play.svg +0 -0
@@ -1,8 +1,10 @@
1
- import { strictEqual } from 'node:assert/strict';
1
+ import { deepStrictEqual, ok, strictEqual } from 'node:assert/strict';
2
+ import { existsSync } from 'node:fs';
2
3
  import { readFile } from 'node:fs/promises';
3
4
  import { dirname, relative, resolve, sep, } from 'node:path';
4
5
  import { fileURLToPath } from 'node:url';
5
6
  import { glob } from 'glob';
7
+ import { createSourceFile, forEachChild, isArrowFunction, isCallExpression, isClassDeclaration, isClassExpression, isConstructorDeclaration, isFunctionDeclaration, isFunctionExpression, isGetAccessorDeclaration, isIdentifier, isMethodDeclaration, isPrivateIdentifier, isSetAccessorDeclaration, isStringLiteral, isTypePredicateNode, isTypeReferenceNode, isVariableStatement, ScriptTarget, } from 'typescript';
6
8
  import { describe, it } from 'vitest';
7
9
  const testConfig = {
8
10
  standaloneTypeFiles: [
@@ -14,6 +16,193 @@ const testConfig = {
14
16
  'utils',
15
17
  ],
16
18
  };
19
+ describe('buildSourceSectionMap', () => {
20
+ it.skipIf(existsSync(resolve(getPackageRoot(), 'src/lib/utility.ts')) === false)('tags function declaration line and body var lines with the function section', async () => {
21
+ const filePath = resolve(getPackageRoot(), 'src/lib/utility.ts');
22
+ const content = await readFile(filePath, 'utf-8');
23
+ const classPrefix = deriveClassPrefix(filePath);
24
+ const sectionMap = buildSourceSectionMap(filePath, content, classPrefix);
25
+ strictEqual(sectionMap.get(325), 'Lib_Utility_CurrentTimestamp');
26
+ strictEqual(sectionMap.get(326), 'Lib_Utility_CurrentTimestamp');
27
+ return;
28
+ });
29
+ it.skipIf(existsSync(resolve(getPackageRoot(), 'src/lib/utility.ts')) === false)('tags nested const-arrow-function body lines with the sub-section while keeping the const declaration in the parent section', async () => {
30
+ const filePath = resolve(getPackageRoot(), 'src/lib/utility.ts');
31
+ const content = await readFile(filePath, 'utf-8');
32
+ const classPrefix = deriveClassPrefix(filePath);
33
+ const sectionMap = buildSourceSectionMap(filePath, content, classPrefix);
34
+ strictEqual(sectionMap.get(343), 'Lib_Utility_CurrentTimestamp');
35
+ strictEqual(sectionMap.get(344), 'Lib_Utility_CurrentTimestamp_PadLeft');
36
+ return;
37
+ });
38
+ it.skipIf(existsSync(resolve(getPackageRoot(), 'src/toolkit/markdown-table.ts')) === false)('tags method declaration and body lines with the method section', async () => {
39
+ const filePath = resolve(getPackageRoot(), 'src/toolkit/markdown-table.ts');
40
+ const content = await readFile(filePath, 'utf-8');
41
+ const classPrefix = deriveClassPrefix(filePath);
42
+ const sectionMap = buildSourceSectionMap(filePath, content, classPrefix);
43
+ strictEqual(sectionMap.get(142), 'Toolkit_MarkdownTable_Runner_AddRow');
44
+ return;
45
+ });
46
+ it.skipIf(existsSync(resolve(getPackageRoot(), 'src/tests/cli/utility/initialize.test.ts')) === false)('tags describe block contents with the describe-derived section', async () => {
47
+ const filePath = resolve(getPackageRoot(), 'src/tests/cli/utility/initialize.test.ts');
48
+ const content = await readFile(filePath, 'utf-8');
49
+ const classPrefix = deriveClassPrefix(filePath);
50
+ const sectionMap = buildSourceSectionMap(filePath, content, classPrefix);
51
+ strictEqual(sectionMap.get(92), 'Tests_Cli_Utility_Initialize_CliUtilityInitializeRun');
52
+ return;
53
+ });
54
+ return;
55
+ });
56
+ describe('extractBodyDeclarations', () => {
57
+ it('extracts const x: T = ... and let x: T = ... lines, skips for-of and untyped', () => {
58
+ const lines = [
59
+ 'function foo() {',
60
+ ' const a: Some_Type_A = 1;',
61
+ ' let b: Some_Type_B = 2;',
62
+ ' const c = 3;',
63
+ ' for (const d of items) { }',
64
+ '}',
65
+ ];
66
+ const result = extractBodyDeclarations(lines);
67
+ strictEqual(result.length, 2);
68
+ strictEqual((result[0] !== undefined) ? result[0]['varName'] : undefined, 'a');
69
+ strictEqual((result[0] !== undefined) ? result[0]['typeName'] : undefined, 'Some_Type_A');
70
+ strictEqual((result[0] !== undefined) ? result[0]['lineNumber'] : undefined, 2);
71
+ strictEqual((result[1] !== undefined) ? result[1]['varName'] : undefined, 'b');
72
+ strictEqual((result[1] !== undefined) ? result[1]['typeName'] : undefined, 'Some_Type_B');
73
+ strictEqual((result[1] !== undefined) ? result[1]['lineNumber'] : undefined, 3);
74
+ return;
75
+ });
76
+ return;
77
+ });
78
+ describe('extractFunctionParams', () => {
79
+ it.skipIf(existsSync(resolve(getPackageRoot(), 'src/toolkit/markdown-table.ts')) === false)('extracts typed params from method declarations', async () => {
80
+ const filePath = resolve(getPackageRoot(), 'src/toolkit/markdown-table.ts');
81
+ const content = await readFile(filePath, 'utf-8');
82
+ const result = extractFunctionParams(filePath, content);
83
+ const addRowParam = result.find((p) => p['paramName'] === 'row');
84
+ ok(addRowParam !== undefined, 'should find row param of addRow method');
85
+ strictEqual(addRowParam['typeName'], 'Toolkit_MarkdownTable_Runner_AddRow_Row');
86
+ return;
87
+ });
88
+ it.skipIf(existsSync(resolve(getPackageRoot(), 'src/lib/utility.ts')) === false)('extracts typed params from top-level function declarations', async () => {
89
+ const filePath = resolve(getPackageRoot(), 'src/lib/utility.ts');
90
+ const content = await readFile(filePath, 'utf-8');
91
+ const result = extractFunctionParams(filePath, content);
92
+ const isExecuteShellErrorParam = result.find((p) => p['paramName'] === 'error' && p['typeName'] === 'Lib_Utility_IsExecuteShellError_Error');
93
+ ok(isExecuteShellErrorParam !== undefined, 'should find error param of isExecuteShellError function');
94
+ return;
95
+ });
96
+ return;
97
+ });
98
+ describe('deriveClassPrefix', () => {
99
+ it('joins path segments with underscore, kebab-case stays one chunk', () => {
100
+ const filePath = resolve(getPackageRoot(), 'src/types/toolkit/markdown-table.d.ts');
101
+ const result = deriveClassPrefix(filePath);
102
+ strictEqual(result, 'Toolkit_MarkdownTable');
103
+ return;
104
+ });
105
+ it('drops .test from test files', () => {
106
+ const filePath = resolve(getPackageRoot(), 'src/types/tests/cli/utility/initialize.test.d.ts');
107
+ const result = deriveClassPrefix(filePath);
108
+ strictEqual(result, 'Tests_Cli_Utility_Initialize');
109
+ return;
110
+ });
111
+ it('handles deep paths', () => {
112
+ const filePath = resolve(getPackageRoot(), 'src/types/cli/recipe/package-json/cleanup.d.ts');
113
+ const result = deriveClassPrefix(filePath);
114
+ strictEqual(result, 'Cli_Recipe_PackageJson_Cleanup');
115
+ return;
116
+ });
117
+ return;
118
+ });
119
+ describe('extractReferencedTypes', () => {
120
+ it('matches types starting with classPrefix followed by underscore', () => {
121
+ const line = 'export type Lib_Utility_Foo = Lib_Utility_Bar | Lib_Utility_Baz;';
122
+ const classPrefix = 'Lib_Utility';
123
+ const result = extractReferencedTypes(line, classPrefix);
124
+ deepStrictEqual(result, [
125
+ 'Lib_Utility_Bar',
126
+ 'Lib_Utility_Baz',
127
+ ]);
128
+ return;
129
+ });
130
+ it('does not match unrelated module types', () => {
131
+ const line = 'export type Lib_Utility_Foo = Other_Module_Type;';
132
+ const classPrefix = 'Lib_Utility';
133
+ const result = extractReferencedTypes(line, classPrefix);
134
+ deepStrictEqual(result, []);
135
+ return;
136
+ });
137
+ it('captures multi-segment leaves greedily', () => {
138
+ const line = 'export type Cli_Foo_Bar = Cli_Foo_Baz_Qux_Quux;';
139
+ const classPrefix = 'Cli_Foo';
140
+ const result = extractReferencedTypes(line, classPrefix);
141
+ deepStrictEqual(result, ['Cli_Foo_Baz_Qux_Quux']);
142
+ return;
143
+ });
144
+ it('rejects malformed types that lack the underscore boundary after classPrefix', () => {
145
+ const line = 'export type Cli_Foo_Bar = Cli_FooBadJoin | Cli_Foo_Valid;';
146
+ const classPrefix = 'Cli_Foo';
147
+ const result = extractReferencedTypes(line, classPrefix);
148
+ deepStrictEqual(result, ['Cli_Foo_Valid']);
149
+ return;
150
+ });
151
+ return;
152
+ });
153
+ describe('discoverSourceFiles', () => {
154
+ it.skipIf(existsSync(resolve(getPackageRoot(), 'src/toolkit/markdown-table.ts')) === false)('returns absolute paths to .ts source files, excluding .d.ts', async () => {
155
+ const files = await discoverSourceFiles();
156
+ ok(files.length > 0, 'should find at least one source file');
157
+ ok(files.every((file) => file.endsWith('.ts')), 'all results should end with .ts');
158
+ ok(files.every((file) => file.endsWith('.d.ts') === false), 'no result should end with .d.ts');
159
+ ok(files.some((file) => file.endsWith('toolkit/markdown-table.ts')), 'should include markdown-table.ts');
160
+ return;
161
+ });
162
+ return;
163
+ });
164
+ describe('parseDescribeString', () => {
165
+ it('splits Class.method form and joins as one PascalCase chunk', () => {
166
+ const input = 'CliUtilityInitialize.run';
167
+ const result = parseDescribeString(input);
168
+ strictEqual(result, 'CliUtilityInitializeRun');
169
+ return;
170
+ });
171
+ it('handles space-separated descriptions', () => {
172
+ const input = 'does the thing';
173
+ const result = parseDescribeString(input);
174
+ strictEqual(result, 'DoesTheThing');
175
+ return;
176
+ });
177
+ it('handles single-word strings', () => {
178
+ const input = 'run';
179
+ const result = parseDescribeString(input);
180
+ strictEqual(result, 'Run');
181
+ return;
182
+ });
183
+ return;
184
+ });
185
+ describe('stripUnderscorePrefix', () => {
186
+ it('strips a single leading underscore', () => {
187
+ const input = '_prev';
188
+ const result = stripUnderscorePrefix(input);
189
+ strictEqual(result, 'prev');
190
+ return;
191
+ });
192
+ it('returns the name unchanged when there is no leading underscore', () => {
193
+ const input = 'value';
194
+ const result = stripUnderscorePrefix(input);
195
+ strictEqual(result, 'value');
196
+ return;
197
+ });
198
+ it('only strips ONE leading underscore', () => {
199
+ const input = '__double';
200
+ const result = stripUnderscorePrefix(input);
201
+ strictEqual(result, '_double');
202
+ return;
203
+ });
204
+ return;
205
+ });
17
206
  describe('type declaration cross-section references', async () => {
18
207
  const files = await discoverTypeFiles();
19
208
  const crossSectionCurrentDirectory = getPackageRoot();
@@ -23,11 +212,19 @@ describe('type declaration cross-section references', async () => {
23
212
  if (testConfig['standaloneTypeFiles'].some((pattern) => file.endsWith(pattern)) === true) {
24
213
  return;
25
214
  }
215
+ const sourcePath = deriveSourcePath(file);
216
+ const sourceExists = await fileExists(sourcePath);
217
+ if (sourceExists === false) {
218
+ return;
219
+ }
26
220
  const content = await readFile(file, 'utf-8');
27
221
  const lines = content.split('\n');
222
+ const sourceContent = await readFile(sourcePath, 'utf-8');
28
223
  const classPrefix = deriveClassPrefix(file);
224
+ const sectionMap = buildSourceSectionMap(sourcePath, sourceContent, classPrefix);
225
+ const sourceSectionSet = new Set(sectionMap.values());
29
226
  const importedNames = extractImportedNames(lines);
30
- const sections = extractSections(lines);
227
+ const sections = buildDtsSections(lines, sourceSectionSet, classPrefix);
31
228
  const sectionPrefixes = sections.map((section) => section['prefix']);
32
229
  const violations = [];
33
230
  for (const section of sections) {
@@ -62,9 +259,21 @@ describe('type declaration section alphabetical order', async () => {
62
259
  for (const file of files) {
63
260
  const sectionOrderRelativePath = relative(sectionOrderCurrentDirectory, file);
64
261
  it(`sections alphabetical in ${sectionOrderRelativePath}`, async () => {
262
+ if (testConfig['standaloneTypeFiles'].some((pattern) => file.endsWith(pattern)) === true) {
263
+ return;
264
+ }
265
+ const sourcePath = deriveSourcePath(file);
266
+ const sourceExists = await fileExists(sourcePath);
267
+ if (sourceExists === false) {
268
+ return;
269
+ }
65
270
  const content = await readFile(file, 'utf-8');
66
271
  const lines = content.split('\n');
67
- const sections = extractSections(lines);
272
+ const sourceContent = await readFile(sourcePath, 'utf-8');
273
+ const classPrefix = deriveClassPrefix(file);
274
+ const sectionMap = buildSourceSectionMap(sourcePath, sourceContent, classPrefix);
275
+ const sourceSectionSet = new Set(sectionMap.values());
276
+ const sections = buildDtsSections(lines, sourceSectionSet, classPrefix);
68
277
  const violations = [];
69
278
  for (let i = 1; i < sections.length; i += 1) {
70
279
  const previous = sections[i - 1];
@@ -74,7 +283,7 @@ describe('type declaration section alphabetical order', async () => {
74
283
  }
75
284
  const compareResult = previous['prefix'].localeCompare(current['prefix']);
76
285
  if (compareResult > 0) {
77
- const violation = `Section "${current['prefix']}" should come before "${previous['prefix']}"`;
286
+ const violation = `Section "${current['prefix']}" appears after section "${previous['prefix']}" but should come before it. Sections in a .d.ts file must be alphabetical by section prefix; move "${current['prefix']}"'s types above "${previous['prefix']}"'s types.`;
78
287
  violations.push(violation);
79
288
  }
80
289
  }
@@ -110,7 +319,7 @@ describe('type declaration import specifier order', async () => {
110
319
  if (previousSpecifier !== undefined
111
320
  && currentSpecifier !== undefined
112
321
  && previousSpecifier.localeCompare(currentSpecifier) > 0) {
113
- const violation = `Import specifier "${currentSpecifier}" should come before "${previousSpecifier}"`;
322
+ const violation = `Import specifier "${currentSpecifier}" appears after "${previousSpecifier}" but should come before it. Specifiers within a single import block must be alphabetical; reorder so "${currentSpecifier}" comes before "${previousSpecifier}".`;
114
323
  violations.push(violation);
115
324
  }
116
325
  }
@@ -122,13 +331,13 @@ describe('type declaration import specifier order', async () => {
122
331
  const trimmed = line.trim().replace(',', '');
123
332
  if (trimmed.startsWith('}') === true) {
124
333
  for (let i = 1; i < specifierBuffer.length; i += 1) {
125
- const previousSpecifier = specifierBuffer[i - 1];
126
- const currentSpecifier = specifierBuffer[i];
127
- if (previousSpecifier !== undefined
128
- && currentSpecifier !== undefined
129
- && previousSpecifier.localeCompare(currentSpecifier) > 0) {
130
- const violation = `Import specifier "${currentSpecifier}" should come before "${previousSpecifier}"`;
131
- violations.push(violation);
334
+ const previousSpecifier2 = specifierBuffer[i - 1];
335
+ const currentSpecifier2 = specifierBuffer[i];
336
+ if (previousSpecifier2 !== undefined
337
+ && currentSpecifier2 !== undefined
338
+ && previousSpecifier2.localeCompare(currentSpecifier2) > 0) {
339
+ const violation2 = `Import specifier "${currentSpecifier2}" appears after "${previousSpecifier2}" but should come before it. Specifiers within a single import block must be alphabetical; reorder so "${currentSpecifier2}" comes before "${previousSpecifier2}".`;
340
+ violations.push(violation2);
132
341
  }
133
342
  }
134
343
  inImportBlock = false;
@@ -170,15 +379,22 @@ describe('type declaration first-come-first-serve order', async () => {
170
379
  const sourceLines = sourceContent.split('\n');
171
380
  const dtsContent = await readFile(file, 'utf-8');
172
381
  const dtsLines = dtsContent.split('\n');
173
- const sections = extractSections(dtsLines);
174
382
  const classPrefix = deriveClassPrefix(file);
383
+ const sectionMap = buildSourceSectionMap(sourcePath, sourceContent, classPrefix);
384
+ const sourceSectionSet = new Set(sectionMap.values());
385
+ const sections = buildDtsSections(dtsLines, sourceSectionSet, classPrefix);
175
386
  const objectTypes = extractObjectTypes(dtsLines, classPrefix);
176
387
  const objectPropertyTypeNames = new Set();
388
+ const arrayElementTypeNames = new Set();
177
389
  for (const objectType of objectTypes) {
178
390
  for (const property of objectType['properties']) {
179
391
  objectPropertyTypeNames.add(property['valueType']);
180
392
  }
181
393
  }
394
+ const arrayTypesForOrder = extractArrayTypes(dtsLines);
395
+ for (const arrayType of arrayTypesForOrder) {
396
+ arrayElementTypeNames.add(arrayType['elementTypeName']);
397
+ }
182
398
  const violations = [];
183
399
  for (const section of sections) {
184
400
  const typeNames = extractTypeNames(section['typeLines']);
@@ -187,6 +403,9 @@ describe('type declaration first-come-first-serve order', async () => {
187
403
  if (objectPropertyTypeNames.has(typeName) === true) {
188
404
  continue;
189
405
  }
406
+ if (arrayElementTypeNames.has(typeName) === true) {
407
+ continue;
408
+ }
190
409
  const sourceLineIndex = findFirstOccurrence(sourceLines, typeName);
191
410
  if (sourceLineIndex === -1) {
192
411
  continue;
@@ -204,7 +423,7 @@ describe('type declaration first-come-first-serve order', async () => {
204
423
  continue;
205
424
  }
206
425
  if (actual['name'] !== expected['name']) {
207
- const violation = `Section "${section['prefix']}": type "${actual['name']}" (source line ${actual['sourceLine'] + 1}) is at .d.ts position ${j + 1}, but should be "${expected['name']}" (source line ${expected['sourceLine'] + 1}).`;
426
+ const violation = `Section "${section['prefix']}": at .d.ts position ${j + 1}, found "${actual['name']}" (first appears at source line ${actual['sourceLine'] + 1}) but expected "${expected['name']}" (first appears at source line ${expected['sourceLine'] + 1}, which comes earlier in source). Move "${expected['name']}" to position ${j + 1} so the .d.ts mirrors the source's first-come-first-serve order.`;
208
427
  violations.push(violation);
209
428
  }
210
429
  }
@@ -247,16 +466,55 @@ describe('type declaration object property types', async () => {
247
466
  continue;
248
467
  }
249
468
  if (definedTypes.has(property['valueType']) === false) {
250
- const violation = `"${objectType['name']}": property type "${property['valueType']}" is not defined in this file.`;
251
- violations.push(violation);
469
+ const violation2 = `"${objectType['name']}": property type "${property['valueType']}" is not defined in this file.`;
470
+ violations.push(violation2);
252
471
  continue;
253
472
  }
254
473
  if (property['typeLineIndex'] > objectType['lineIndex']) {
255
- const violation = `"${objectType['name']}": property type "${property['valueType']}" (line ${property['typeLineIndex'] + 1}) must be defined before the object type (line ${objectType['lineIndex'] + 1}).`;
256
- violations.push(violation);
474
+ const violation3 = `"${objectType['name']}": property type "${property['valueType']}" (line ${property['typeLineIndex'] + 1}) must be defined before the object type (line ${objectType['lineIndex'] + 1}).`;
475
+ violations.push(violation3);
257
476
  }
258
477
  }
259
478
  }
479
+ const importedNames = extractImportedNames(lines);
480
+ const arrayTypes = extractArrayTypes(lines);
481
+ const typeDefLines = new Map();
482
+ for (let i = 0; i < lines.length; i += 1) {
483
+ const line2 = lines[i];
484
+ if (line2 === undefined) {
485
+ continue;
486
+ }
487
+ const defMatch = line2.match(new RegExp('^export type (\\w+)'));
488
+ if (defMatch !== null
489
+ && defMatch[1] !== undefined
490
+ && typeDefLines.has(defMatch[1]) === false) {
491
+ typeDefLines.set(defMatch[1], i);
492
+ }
493
+ }
494
+ for (const arrayType of arrayTypes) {
495
+ if (arrayType['arrayTypeName'].endsWith('Returns') === true
496
+ || arrayType['arrayTypeName'].endsWith('_Returns') === true
497
+ || arrayType['arrayTypeName'].endsWith('TypeGuard') === true
498
+ || arrayType['arrayTypeName'].endsWith('_TypeGuard') === true
499
+ || arrayType['arrayTypeName'].endsWith('Return') === true
500
+ || arrayType['arrayTypeName'].endsWith('_Return') === true) {
501
+ continue;
502
+ }
503
+ if (importedNames.has(arrayType['elementTypeName']) === true) {
504
+ continue;
505
+ }
506
+ if (definedTypes.has(arrayType['elementTypeName']) === false) {
507
+ continue;
508
+ }
509
+ const elementLine = typeDefLines.get(arrayType['elementTypeName']) ?? -1;
510
+ if (elementLine === -1) {
511
+ continue;
512
+ }
513
+ if (elementLine > arrayType['lineIndex']) {
514
+ const violation4 = `"${arrayType['arrayTypeName']}" (line ${arrayType['lineIndex'] + 1}): array element type "${arrayType['elementTypeName']}" (line ${elementLine + 1}) must be defined before the array type.`;
515
+ violations.push(violation4);
516
+ }
517
+ }
260
518
  const violationMessage = violations.join('\n');
261
519
  strictEqual(violations.length, 0, violationMessage);
262
520
  return;
@@ -284,26 +542,73 @@ describe('type declaration section coverage', async () => {
284
542
  }
285
543
  }
286
544
  const sourceContent = await readFile(sourcePath, 'utf-8');
287
- const sourceLines = sourceContent.split('\n');
288
545
  const dtsContent = await readFile(file, 'utf-8');
289
546
  const dtsLines = dtsContent.split('\n');
290
- const sourceSections = extractSourceSections(sourceLines);
291
- const dtsSections = extractSections(dtsLines);
292
- const dtsSectionPrefixes = dtsSections.map((section) => section['prefix']);
547
+ const classPrefix = deriveClassPrefix(file);
548
+ const sectionMap = buildSourceSectionMap(sourcePath, sourceContent, classPrefix);
549
+ const sourceSectionSet = new Set(sectionMap.values());
550
+ const dtsSections = buildDtsSections(dtsLines, sourceSectionSet, classPrefix);
551
+ const dtsSectionPrefixes = new Set(dtsSections.map((section) => section['prefix']));
293
552
  const violations = [];
294
- for (const sourceSection of sourceSections) {
295
- const sourceSectionPrefix = sourceSection['prefix'];
296
- const isParent = sourceSections.some((otherSection) => {
297
- return otherSection['prefix'] !== sourceSectionPrefix && otherSection['prefix'].startsWith(sourceSectionPrefix) === true;
553
+ for (const sourceSectionPrefix of sourceSectionSet) {
554
+ if (sourceSectionPrefix === classPrefix) {
555
+ continue;
556
+ }
557
+ const isParent = Array.from(sourceSectionSet).some((otherSection) => {
558
+ return otherSection !== sourceSectionPrefix && otherSection.startsWith(`${sourceSectionPrefix}_`) === true;
298
559
  });
299
560
  if (isParent === true) {
300
561
  continue;
301
562
  }
302
- if (dtsSectionPrefixes.includes(sourceSectionPrefix) === false) {
303
- const violation = `Source has section "${sourceSectionPrefix}" but .d.ts does not.`;
563
+ if (dtsSectionPrefixes.has(sourceSectionPrefix) === false) {
564
+ const violation = `Source has section "${sourceSectionPrefix}" but .d.ts has no types belonging to it. Add an "export type" with that prefix, or remove the corresponding source identifier.`;
304
565
  violations.push(violation);
305
566
  }
306
567
  }
568
+ const singleChunkTopLevelTypes = new Set();
569
+ for (const line of dtsLines) {
570
+ if (line.startsWith('export type ') === false) {
571
+ continue;
572
+ }
573
+ const singleChunkMatch = line.match(new RegExp('^export type (\\w+)'));
574
+ if (singleChunkMatch === null || singleChunkMatch[1] === undefined) {
575
+ continue;
576
+ }
577
+ const singleChunkTypeName = singleChunkMatch[1];
578
+ if (singleChunkTypeName.startsWith(`${classPrefix}_`) === false) {
579
+ continue;
580
+ }
581
+ const singleChunkAfterClassPrefix = singleChunkTypeName.slice(classPrefix.length + 1);
582
+ if (singleChunkAfterClassPrefix.includes('_') === false) {
583
+ singleChunkTopLevelTypes.add(singleChunkTypeName);
584
+ }
585
+ }
586
+ for (const line of dtsLines) {
587
+ if (line.startsWith('export type ') === false) {
588
+ continue;
589
+ }
590
+ const reverseMatch = line.match(new RegExp('^export type (\\w+)'));
591
+ if (reverseMatch === null || reverseMatch[1] === undefined) {
592
+ continue;
593
+ }
594
+ const reverseTypeName = reverseMatch[1];
595
+ if (reverseTypeName.startsWith(`${classPrefix}_`) === false) {
596
+ continue;
597
+ }
598
+ const reverseAfterClassPrefix = reverseTypeName.slice(classPrefix.length + 1);
599
+ const reverseChunks = reverseAfterClassPrefix.split('_');
600
+ if (reverseChunks.length <= 1) {
601
+ continue;
602
+ }
603
+ const reverseExpectedMethodSection = `${classPrefix}_${reverseChunks[0]}`;
604
+ if (singleChunkTopLevelTypes.has(reverseExpectedMethodSection) === true) {
605
+ continue;
606
+ }
607
+ if (sourceSectionSet.has(reverseExpectedMethodSection) === false) {
608
+ const violation2 = `.d.ts type "${reverseTypeName}" expects source section "${reverseExpectedMethodSection}" but no class/method/function/(string, fn) call by that name exists in the source file. Fix options: (a) rename the .d.ts type to match an existing source section, (b) add a matching source identifier (class, method, top-level function, or function-typed const), or (c) add this file to testConfig.standaloneTypeFiles if the .d.ts is a domain type file with no source mirror.`;
609
+ violations.push(violation2);
610
+ }
611
+ }
307
612
  const violationMessage = violations.join('\n');
308
613
  strictEqual(violations.length, 0, violationMessage);
309
614
  return;
@@ -311,159 +616,2411 @@ describe('type declaration section coverage', async () => {
311
616
  }
312
617
  return;
313
618
  });
314
- async function discoverTypeFiles() {
315
- const patterns = testConfig['typeRoots'].map((typeRoot) => `${typeRoot}/types/**/*.d.ts`);
316
- const matched = await glob(patterns, {
317
- cwd: getPackageRoot(),
318
- absolute: true,
319
- });
320
- return matched.sort();
321
- }
322
- function deriveClassPrefix(filePath) {
323
- const currentDirectory = getPackageRoot();
324
- const relativePath = relative(currentDirectory, filePath);
325
- let relativeCleaned = relativePath;
326
- for (const typeRoot of testConfig['typeRoots']) {
327
- relativeCleaned = relativeCleaned.replace(`${typeRoot}/types/`, '');
328
- }
329
- const segments = relativeCleaned
330
- .replace('.d.ts', '')
331
- .replace('.test', '')
332
- .split(sep)
333
- .join('/')
334
- .split('/');
335
- return segments.map((segment) => {
336
- return segment.split('-').map((part) => {
337
- return part.charAt(0).toUpperCase() + part.slice(1);
338
- }).join('');
339
- }).join('');
340
- }
341
- function extractImportedNames(lines) {
342
- const importedNames = new Set();
343
- let inImportBlock = false;
344
- for (const line of lines) {
345
- if (line.startsWith('import type') === true) {
346
- inImportBlock = true;
347
- const inlineMatch = line.match(new RegExp('^import type \\{ (.+) \\} from'));
348
- if (inlineMatch !== null && inlineMatch[1] !== undefined) {
349
- const inlineMatchCapture = inlineMatch[1];
350
- const specifiers = inlineMatchCapture.split(',').map((specifier) => specifier.trim());
351
- for (const specifier of specifiers) {
352
- importedNames.add(specifier);
619
+ describe('type declaration variable type symmetry', async () => {
620
+ const files = await discoverSourceFiles();
621
+ const symmetryCurrentDirectory = getPackageRoot();
622
+ for (const file of files) {
623
+ const symmetryRelativePath = relative(symmetryCurrentDirectory, file);
624
+ it(`variable type symmetry in ${symmetryRelativePath}`, async () => {
625
+ const content = await readFile(file, 'utf-8');
626
+ const lines = content.split('\n');
627
+ const classPrefix = deriveClassPrefix(file);
628
+ const sectionMap = buildSourceSectionMap(file, content, classPrefix);
629
+ const dtsPath = file.replace('/src/', '/src/types/').replace('.ts', '.d.ts');
630
+ const dtsExists = await fileExists(dtsPath);
631
+ const dtsContent = (dtsExists === true) ? await readFile(dtsPath, 'utf-8') : '';
632
+ const violations = [];
633
+ const inlineCallbacks = detectInlineTypedCallbacks(file, content);
634
+ for (const callback of inlineCallbacks) {
635
+ const violation = `${symmetryRelativePath}:${callback['lineNumber']}: rule 7.4 violation: inline typed callback param "${callback['paramName']}: ${callback['typeName']}" is forbidden. Extract the callback to a named const so it follows rule 7.1.`;
636
+ violations.push(violation);
637
+ }
638
+ const bodyDecls = extractBodyDeclarations(lines);
639
+ const expectedNames = [];
640
+ for (const decl of bodyDecls) {
641
+ const sourceSection = sectionMap.get(decl['lineNumber']) ?? classPrefix;
642
+ if (isReservedSuffix(decl['typeName']) === true) {
643
+ const violation2 = `${symmetryRelativePath}:${decl['lineNumber']}: rule 7.3 violation: body var "${decl['varName']}: ${decl['typeName']}" uses a return-position-only suffix (Returns/TypeGuard/Return). Use a different type name without that suffix.`;
644
+ violations.push(violation2);
645
+ continue;
353
646
  }
354
- inImportBlock = false;
647
+ const leafResult = validateLeaf(decl['varName'], decl['typeName'], sourceSection, classPrefix);
648
+ if (leafResult !== null) {
649
+ const violation3 = `${symmetryRelativePath}:${decl['lineNumber']}: rule 7.1 violation: body var "${decl['varName']}: ${decl['typeName']}" — expected leaf "${leafResult['expectedLeaf']}" but found "${leafResult['actualLeaf']}". Rename the type to "${sourceSection}_${leafResult['expectedLeaf']}" or "${classPrefix}_${leafResult['expectedLeaf']}".`;
650
+ violations.push(violation3);
651
+ }
652
+ if (dtsExists === true) {
653
+ if (isLocallyDefined(decl['typeName'], dtsContent) === false) {
654
+ const relativeDtsPath = dtsPath.replace(symmetryCurrentDirectory, '');
655
+ const cleanedDtsPath = (relativeDtsPath.startsWith('/') === true) ? relativeDtsPath.slice(1) : relativeDtsPath;
656
+ const violation4 = `${symmetryRelativePath}:${decl['lineNumber']}: rule 7.2 violation: body var type "${decl['typeName']}" is not defined in the corresponding .d.ts. Cross-module body-var types are forbidden -- define the type concretely in ${cleanedDtsPath}, or promote the shape to shared.d.ts, or skip the typed body var.`;
657
+ violations.push(violation4);
658
+ }
659
+ else if (isAliasToForeignType(decl['typeName'], dtsContent, classPrefix) === true) {
660
+ const relativeDtsPath2 = dtsPath.replace(symmetryCurrentDirectory, '');
661
+ const cleanedDtsPath2 = (relativeDtsPath2.startsWith('/') === true) ? relativeDtsPath2.slice(1) : relativeDtsPath2;
662
+ const violation5 = `${symmetryRelativePath}:${decl['lineNumber']}: rule 7.2 violation: body var type "${decl['typeName']}" is locally defined but only as an alias to a foreign type. Cross-module body-var types are forbidden -- escape hatches: (a) promote the shape to shared.d.ts, (b) redefine the concrete shape in ${cleanedDtsPath2}, or (c) inline the call to skip the typed body var.`;
663
+ violations.push(violation5);
664
+ }
665
+ }
666
+ const stripped = stripUnderscorePrefix(decl['varName']);
667
+ const titleVar = stripped.charAt(0).toUpperCase() + stripped.slice(1);
668
+ expectedNames.push({
669
+ name: decl['varName'],
670
+ typeName: `${sourceSection}_${titleVar}`,
671
+ lineNumber: decl['lineNumber'],
672
+ });
355
673
  }
356
- continue;
357
- }
358
- if (inImportBlock === true) {
359
- const trimmed = line.trim().replace(',', '');
360
- if (trimmed.startsWith('}') === true) {
361
- inImportBlock = false;
674
+ const params = extractFunctionParams(file, content);
675
+ for (const param of params) {
676
+ const sourceSection2 = sectionMap.get(param['lineNumber']) ?? classPrefix;
677
+ if (isReservedSuffix(param['typeName']) === true) {
678
+ const violation6 = `${symmetryRelativePath}:${param['lineNumber']}: rule 7.3 violation: param "${param['paramName']}: ${param['typeName']}" uses a return-position-only suffix (Returns/TypeGuard/Return). Use a different type name without that suffix.`;
679
+ violations.push(violation6);
680
+ continue;
681
+ }
682
+ const leafResult2 = validateLeaf(param['paramName'], param['typeName'], sourceSection2, classPrefix);
683
+ if (leafResult2 !== null) {
684
+ const violation7 = `${symmetryRelativePath}:${param['lineNumber']}: rule 7.1 violation: param "${param['paramName']}: ${param['typeName']}" — expected leaf "${leafResult2['expectedLeaf']}" but found "${leafResult2['actualLeaf']}". Rename the type to "${sourceSection2}_${leafResult2['expectedLeaf']}" or "${classPrefix}_${leafResult2['expectedLeaf']}".`;
685
+ violations.push(violation7);
686
+ }
687
+ const stripped2 = stripUnderscorePrefix(param['paramName']);
688
+ const titleVar2 = stripped2.charAt(0).toUpperCase() + stripped2.slice(1);
689
+ expectedNames.push({
690
+ name: param['paramName'],
691
+ typeName: `${sourceSection2}_${titleVar2}`,
692
+ lineNumber: param['lineNumber'],
693
+ });
362
694
  }
363
- else if (trimmed !== '' && trimmed.startsWith('//') === false) {
364
- importedNames.add(trimmed);
695
+ const fnReturnRecords = extractFunctionReturns(file, content);
696
+ for (const ret of fnReturnRecords) {
697
+ const returnValidationReason = validateReturnType(ret['returnType'], ret['isTypeGuard']);
698
+ if (returnValidationReason !== null) {
699
+ const violation8 = `${symmetryRelativePath}:${ret['lineNumber']}: rule 7.5/7.6/7.7 violation: ${returnValidationReason}`;
700
+ violations.push(violation8);
701
+ }
365
702
  }
366
- }
367
- }
368
- return importedNames;
369
- }
370
- function extractSections(lines) {
371
- const sections = [];
372
- let currentSection = undefined;
373
- for (let i = 0; i < lines.length; i += 1) {
374
- const line = lines[i];
375
- if (line === undefined) {
376
- continue;
377
- }
378
- const sectionComment = line.match(new RegExp('^ \\* (.+)\\.$'));
379
- if (sectionComment !== null
380
- && sectionComment[1] !== undefined
381
- && line.includes('@') === false) {
382
- const rawPrefix = sectionComment[1];
383
- const segments = rawPrefix.split(' - ');
384
- const methodName = segments.map((segment) => {
385
- return segment.split(new RegExp('[\\s.]+', 'g')).map((word) => {
386
- return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();
387
- }).join('');
388
- }).join('');
389
- if (currentSection !== undefined) {
390
- sections.push(currentSection);
703
+ const uniquenessViolations = checkTypeNameUniqueness(expectedNames);
704
+ for (const uniquenessViolation of uniquenessViolations) {
705
+ const violation9 = `${symmetryRelativePath}: rule 7.8 violation: ${uniquenessViolation}`;
706
+ violations.push(violation9);
391
707
  }
392
- currentSection = {
393
- prefix: methodName,
394
- typeLines: [],
395
- };
396
- continue;
397
- }
398
- if (currentSection !== undefined && line.startsWith('export type ') === true) {
399
- currentSection['typeLines'].push(line);
400
- }
401
- }
402
- if (currentSection !== undefined) {
403
- sections.push(currentSection);
404
- }
405
- return sections;
406
- }
407
- function extractReferencedTypes(line, classPrefix) {
408
- const match = line.match(new RegExp('^export type (\\w+)'));
409
- if (match === null || match[1] === undefined) {
410
- return [];
411
- }
412
- const typeName = match[1];
413
- const rightSide = line.slice(line.indexOf('=') + 1);
414
- const referencedTypes = [];
415
- const typePattern = new RegExp(`${classPrefix}\\w+`, 'g');
416
- let typeMatch = typePattern.exec(rightSide);
417
- while (typeMatch !== null) {
418
- const referencedType = typeMatch[0];
419
- if (referencedType !== typeName) {
420
- referencedTypes.push(referencedType);
421
- }
422
- typeMatch = typePattern.exec(rightSide);
708
+ const violationMessage = violations.join('\n');
709
+ strictEqual(violations.length, 0, violationMessage);
710
+ return;
711
+ });
423
712
  }
424
- return referencedTypes;
425
- }
426
- function deriveSourcePath(dtsPath) {
427
- return dtsPath.replace('/types/', '/').replace('.d.ts', '.ts');
428
- }
429
- async function fileExists(filePath) {
430
- try {
431
- await readFile(filePath, 'utf-8');
432
- return true;
713
+ return;
714
+ });
715
+ describe('type declaration identifier vs file name', async () => {
716
+ const files = await discoverSourceFiles();
717
+ const identifierVsFileNameCurrentDirectory = getPackageRoot();
718
+ for (const file of files) {
719
+ const identifierVsFileNameRelativePath = relative(identifierVsFileNameCurrentDirectory, file);
720
+ it(`top-level identifiers in ${identifierVsFileNameRelativePath} do not equal file name`, async () => {
721
+ const content = await readFile(file, 'utf-8');
722
+ const classPrefix = deriveClassPrefix(file);
723
+ const segments = classPrefix.split('_');
724
+ const fileName = segments[segments.length - 1] ?? '';
725
+ const identifiers = extractTopLevelIdentifiers(file, content);
726
+ const violations = [];
727
+ for (const identifier of identifiers) {
728
+ if (identifier['name'] === fileName) {
729
+ const violation = `${identifierVsFileNameRelativePath}:${identifier['lineNumber']}: rule C1/C2/C3 violation: top-level ${identifier['kind']} name "${identifier['name']}" equals file name "${fileName}". Rename the ${identifier['kind']} (use a barrel re-export if consumers need to import the file-name as the public name).`;
730
+ violations.push(violation);
731
+ }
732
+ }
733
+ const violationMessage = violations.join('\n');
734
+ strictEqual(violations.length, 0, violationMessage);
735
+ return;
736
+ });
433
737
  }
434
- catch {
435
- return false;
738
+ return;
739
+ });
740
+ describe('type declaration filename validation', async () => {
741
+ const sourceFiles = await discoverSourceFiles();
742
+ const dtsFiles = await discoverTypeFiles();
743
+ const allFiles = [
744
+ ...sourceFiles,
745
+ ...dtsFiles,
746
+ ];
747
+ const filenameValidationCurrentDirectory = getPackageRoot();
748
+ for (const file of allFiles) {
749
+ const filenameValidationRelativePath = relative(filenameValidationCurrentDirectory, file);
750
+ it(`filename and path segments in ${filenameValidationRelativePath} are valid`, () => {
751
+ let cleaned = filenameValidationRelativePath;
752
+ for (const typeRoot of testConfig['typeRoots']) {
753
+ cleaned = cleaned.replace(`${typeRoot}/types/`, '');
754
+ cleaned = cleaned.replace(`${typeRoot}/`, '');
755
+ }
756
+ cleaned = cleaned.replace(new RegExp('\\.d\\.ts$'), '');
757
+ cleaned = cleaned.replace(new RegExp('\\.d\\.mts$'), '');
758
+ cleaned = cleaned.replace(new RegExp('\\.d\\.cts$'), '');
759
+ cleaned = cleaned.replace(new RegExp('\\.tsx$'), '');
760
+ cleaned = cleaned.replace(new RegExp('\\.ts$'), '');
761
+ cleaned = cleaned.replace(new RegExp('\\.mts$'), '');
762
+ cleaned = cleaned.replace(new RegExp('\\.cts$'), '');
763
+ cleaned = cleaned.replace(new RegExp('\\.jsx$'), '');
764
+ cleaned = cleaned.replace(new RegExp('\\.js$'), '');
765
+ cleaned = cleaned.replace(new RegExp('\\.mjs$'), '');
766
+ cleaned = cleaned.replace(new RegExp('\\.cjs$'), '');
767
+ cleaned = cleaned.replace(new RegExp('\\.test$'), '');
768
+ const segments = cleaned.split(sep).join('/').split('/').filter((segment) => segment.length > 0);
769
+ const pattern = new RegExp('^[a-z][a-z0-9-]*$');
770
+ const pascalCasePattern = new RegExp('^[A-Z][A-Za-z0-9]*$');
771
+ const violations = [];
772
+ for (const segment of segments) {
773
+ const matchesKebab = pattern.test(segment);
774
+ const matchesPascal = pascalCasePattern.test(segment);
775
+ if (matchesKebab === false && matchesPascal === false) {
776
+ const violation = `${filenameValidationRelativePath}: invalid path segment "${segment}". Path segments must be kebab-case (/^[a-z][a-z0-9-]*$/) or PascalCase (/^[A-Z][A-Za-z0-9]*$/). Recognized strippable suffixes: .d.ts, .d.mts, .d.cts, .tsx, .ts, .mts, .cts, .jsx, .js, .mjs, .cjs, .test. Underscores, dots, spaces, camelCase, and leading digits are rejected.`;
777
+ violations.push(violation);
778
+ }
779
+ }
780
+ const violationMessage = violations.join('\n');
781
+ strictEqual(violations.length, 0, violationMessage);
782
+ return;
783
+ });
436
784
  }
437
- }
438
- function getPackageRoot() {
439
- const currentFilePath = fileURLToPath(import.meta.url);
440
- const currentFileDirectory = dirname(currentFilePath);
441
- return resolve(currentFileDirectory, '..', '..');
442
- }
443
- function extractTypeNames(typeLines) {
444
- const typeNames = [];
445
- for (const line of typeLines) {
446
- const match = line.match(new RegExp('^export type (\\w+)'));
447
- if (match !== null && match[1] !== undefined) {
448
- typeNames.push(match[1]);
785
+ return;
786
+ });
787
+ describe('type declaration standalone type files', async () => {
788
+ const standaloneSourceFiles = await discoverSourceFiles();
789
+ const standaloneDtsFiles = await discoverTypeFiles();
790
+ const topLevelPathPrefixes = new Set();
791
+ for (const sourceFile of standaloneSourceFiles) {
792
+ const sourceClassPrefix = deriveClassPrefix(sourceFile);
793
+ const firstChunk = sourceClassPrefix.split('_')[0];
794
+ if (firstChunk !== undefined && firstChunk !== '') {
795
+ topLevelPathPrefixes.add(firstChunk);
449
796
  }
450
797
  }
451
- return typeNames;
452
- }
453
- function findFirstOccurrence(sourceLines, typeName) {
454
- let inImportBlock = false;
455
- for (let i = 0; i < sourceLines.length; i += 1) {
456
- const line = sourceLines[i];
457
- if (line === undefined) {
458
- continue;
459
- }
460
- if (line.startsWith('import ') === true || line.startsWith('import type') === true) {
461
- inImportBlock = true;
462
- }
463
- if (inImportBlock === true) {
464
- if (line.includes(' from ') === true) {
465
- inImportBlock = false;
466
- }
798
+ const standaloneFiles = standaloneDtsFiles.filter((dtsFile) => testConfig['standaloneTypeFiles'].some((pattern) => dtsFile.endsWith(pattern)));
799
+ const standaloneCurrentDirectory = getPackageRoot();
800
+ for (const file of standaloneFiles) {
801
+ const standaloneRelativePath = relative(standaloneCurrentDirectory, file);
802
+ it(`standalone file rules in ${standaloneRelativePath}`, async () => {
803
+ const content = await readFile(file, 'utf-8');
804
+ const lines = content.split('\n');
805
+ const typeLines = lines.filter((line) => line.startsWith('export type '));
806
+ const typeNames = extractTypeNames(typeLines);
807
+ const localTypeSet = new Set(typeNames);
808
+ const primitiveSet = new Set([
809
+ 'string',
810
+ 'number',
811
+ 'boolean',
812
+ 'unknown',
813
+ 'never',
814
+ 'void',
815
+ 'null',
816
+ 'undefined',
817
+ 'any',
818
+ 'object',
819
+ 'symbol',
820
+ 'bigint',
821
+ ]);
822
+ const pascalCasePattern = new RegExp('^[A-Z][A-Za-z0-9]*(_[A-Z][A-Za-z0-9]*)*$');
823
+ const brandCasePattern = new RegExp('[A-Z]{3,}');
824
+ const violations = [];
825
+ for (const typeName of typeNames) {
826
+ if (pascalCasePattern.test(typeName) === false) {
827
+ const violation = `${standaloneRelativePath}: rule S1 violation: type "${typeName}" is not PascalCase. Standalone-file types must be PascalCase, optionally underscore-separated for nested properties (e.g., EntryItem, EntryItem_Category).`;
828
+ violations.push(violation);
829
+ continue;
830
+ }
831
+ if (brandCasePattern.test(typeName) === true) {
832
+ const violation2 = `${standaloneRelativePath}: rule S1 violation: type "${typeName}" uses brand casing (3+ consecutive uppercase letters). Use Pascal-cased acronyms instead (e.g., Url, Api, Cli — not URL, API, CLI).`;
833
+ violations.push(violation2);
834
+ }
835
+ }
836
+ for (const typeName of typeNames) {
837
+ for (const pathPrefix of topLevelPathPrefixes) {
838
+ if (typeName.startsWith(`${pathPrefix}_`) === true) {
839
+ const violation3 = `${standaloneRelativePath}: rule S2 violation: type "${typeName}" looks like a path-prefix-style name (starts with "${pathPrefix}_" — a known source-file top-level segment). Standalone-file types must be domain concepts, not path-derived.`;
840
+ violations.push(violation3);
841
+ break;
842
+ }
843
+ }
844
+ }
845
+ const objectTypes = extractObjectTypes(lines, '');
846
+ for (const objectType of objectTypes) {
847
+ const expectedPropertyPrefix = `${objectType['name']}_`;
848
+ for (const property of objectType['properties']) {
849
+ if (primitiveSet.has(property['valueType']) === true) {
850
+ continue;
851
+ }
852
+ if (localTypeSet.has(property['valueType']) === false) {
853
+ continue;
854
+ }
855
+ if (property['valueType'].startsWith(expectedPropertyPrefix) === false) {
856
+ const violation4 = `${standaloneRelativePath}: rule S3 violation: object type "${objectType['name']}" property "${property['key']}" uses local type "${property['valueType']}" which does not start with "${expectedPropertyPrefix}". Add an intermediate alias (e.g., "${expectedPropertyPrefix}${property['key'].charAt(0).toUpperCase() + property['key'].slice(1)} = ${property['valueType']};") to use the Parent_Property nesting form.`;
857
+ violations.push(violation4);
858
+ }
859
+ }
860
+ }
861
+ const arrayTypes = extractArrayTypes(lines);
862
+ const typePositions = new Map();
863
+ for (let i = 0; i < lines.length; i += 1) {
864
+ const lineToScan = lines[i];
865
+ if (lineToScan === undefined) {
866
+ continue;
867
+ }
868
+ const positionMatch = lineToScan.match(new RegExp('^export type (\\w+)'));
869
+ if (positionMatch !== null
870
+ && positionMatch[1] !== undefined
871
+ && typePositions.has(positionMatch[1]) === false) {
872
+ typePositions.set(positionMatch[1], i);
873
+ }
874
+ }
875
+ for (const arrayType of arrayTypes) {
876
+ const elementLine = typePositions.get(arrayType['elementTypeName']) ?? -1;
877
+ if (elementLine === -1) {
878
+ continue;
879
+ }
880
+ if (elementLine >= arrayType['lineIndex']) {
881
+ const violation5 = `${standaloneRelativePath}:${arrayType['lineIndex'] + 1}: rule S4 violation: array type "${arrayType['arrayTypeName']}" defined before its element type "${arrayType['elementTypeName']}" (element at line ${elementLine + 1}). Define element types before arrays.`;
882
+ violations.push(violation5);
883
+ }
884
+ }
885
+ const violationMessage = violations.join('\n');
886
+ strictEqual(violations.length, 0, violationMessage);
887
+ return;
888
+ });
889
+ }
890
+ return;
891
+ });
892
+ describe('parseDescribeString comprehensive', () => {
893
+ it('returns empty string for purely non-alphanumeric input', () => {
894
+ strictEqual(parseDescribeString('!@#$%^&*()'), '');
895
+ return;
896
+ });
897
+ it('handles digits-only input by preserving the digit run', () => {
898
+ strictEqual(parseDescribeString('123abc'), '123abc');
899
+ return;
900
+ });
901
+ it('parses path-style /users into Users', () => {
902
+ strictEqual(parseDescribeString('/users'), 'Users');
903
+ return;
904
+ });
905
+ it('joins multiple non-alphanumeric separators', () => {
906
+ strictEqual(parseDescribeString('foo.bar-baz/qux'), 'FooBarBazQux');
907
+ return;
908
+ });
909
+ it('preserves CamelCase parts within a piece', () => {
910
+ strictEqual(parseDescribeString('CliUtility runner'), 'CliUtilityRunner');
911
+ return;
912
+ });
913
+ it('handles single character', () => {
914
+ strictEqual(parseDescribeString('a'), 'A');
915
+ return;
916
+ });
917
+ it('handles empty string', () => {
918
+ strictEqual(parseDescribeString(''), '');
919
+ return;
920
+ });
921
+ it('handles unicode by treating non-ASCII letters as separators', () => {
922
+ strictEqual(parseDescribeString('fooébar'), 'FooBar');
923
+ return;
924
+ });
925
+ return;
926
+ });
927
+ describe('stripUnderscorePrefix comprehensive', () => {
928
+ it('strips a single leading underscore', () => {
929
+ strictEqual(stripUnderscorePrefix('_prev'), 'prev');
930
+ return;
931
+ });
932
+ it('preserves only-underscore input as empty', () => {
933
+ strictEqual(stripUnderscorePrefix('_'), '');
934
+ return;
935
+ });
936
+ it('does not strip non-prefix underscores', () => {
937
+ strictEqual(stripUnderscorePrefix('foo_bar'), 'foo_bar');
938
+ return;
939
+ });
940
+ it('does not strip when input has no underscore', () => {
941
+ strictEqual(stripUnderscorePrefix('plain'), 'plain');
942
+ return;
943
+ });
944
+ it('strips only the first underscore', () => {
945
+ strictEqual(stripUnderscorePrefix('__double'), '_double');
946
+ return;
947
+ });
948
+ return;
949
+ });
950
+ describe('isReservedSuffix comprehensive', () => {
951
+ it('detects underscore-separated _Returns', () => {
952
+ strictEqual(isReservedSuffix('Foo_Bar_Returns'), true);
953
+ return;
954
+ });
955
+ it('detects glued Returns', () => {
956
+ strictEqual(isReservedSuffix('FooBarReturns'), true);
957
+ return;
958
+ });
959
+ it('detects underscore-separated _TypeGuard', () => {
960
+ strictEqual(isReservedSuffix('Foo_Bar_TypeGuard'), true);
961
+ return;
962
+ });
963
+ it('detects glued TypeGuard', () => {
964
+ strictEqual(isReservedSuffix('FooBarTypeGuard'), true);
965
+ return;
966
+ });
967
+ it('detects underscore-separated _Return (singular)', () => {
968
+ strictEqual(isReservedSuffix('Foo_Bar_Return'), true);
969
+ return;
970
+ });
971
+ it('detects glued Return (singular)', () => {
972
+ strictEqual(isReservedSuffix('FooBarReturn'), true);
973
+ return;
974
+ });
975
+ it('does not match Result', () => {
976
+ strictEqual(isReservedSuffix('Foo_Bar_Result'), false);
977
+ return;
978
+ });
979
+ it('does not match Returnable (false suffix)', () => {
980
+ strictEqual(isReservedSuffix('Foo_Bar_Returnable'), false);
981
+ return;
982
+ });
983
+ it('does not match TypeGuardian (false suffix)', () => {
984
+ strictEqual(isReservedSuffix('Foo_TypeGuardian'), false);
985
+ return;
986
+ });
987
+ it('does match Reborn -- banned because endsWith Return matches the substring', () => {
988
+ strictEqual(isReservedSuffix('Reborn'), false);
989
+ return;
990
+ });
991
+ return;
992
+ });
993
+ describe('validateLeaf comprehensive', () => {
994
+ it('returns null when leaf matches sourceSection_titleVar', () => {
995
+ const reasonResult = validateLeaf('items', 'Cli_Foo_Run_Items', 'Cli_Foo_Run', 'Cli_Foo');
996
+ strictEqual(reasonResult, null);
997
+ return;
998
+ });
999
+ it('returns null when leaf matches classPrefix_titleVar (passthrough)', () => {
1000
+ const reasonResult = validateLeaf('items', 'Cli_Foo_Items', 'Cli_Foo_Run', 'Cli_Foo');
1001
+ strictEqual(reasonResult, null);
1002
+ return;
1003
+ });
1004
+ it('returns reason when leaf does not match', () => {
1005
+ const reasonResult = validateLeaf('items', 'Cli_Foo_Run_Things', 'Cli_Foo_Run', 'Cli_Foo');
1006
+ deepStrictEqual(reasonResult, {
1007
+ actualLeaf: 'Things', expectedLeaf: 'Items',
1008
+ });
1009
+ return;
1010
+ });
1011
+ it('strips underscore prefix from var name before comparison', () => {
1012
+ const reasonResult = validateLeaf('_prev', 'Cli_Foo_Run_Prev', 'Cli_Foo_Run', 'Cli_Foo');
1013
+ strictEqual(reasonResult, null);
1014
+ return;
1015
+ });
1016
+ it('handles single-character var name', () => {
1017
+ const reasonResult = validateLeaf('i', 'Cli_Foo_Run_I', 'Cli_Foo_Run', 'Cli_Foo');
1018
+ strictEqual(reasonResult, null);
1019
+ return;
1020
+ });
1021
+ it('returns the actualLeaf when typeName starts with sourceSection but leaf differs', () => {
1022
+ const reasonResult = validateLeaf('items', 'Cli_Foo_Run_Things', 'Cli_Foo_Run', 'Cli_Foo');
1023
+ deepStrictEqual(reasonResult, {
1024
+ actualLeaf: 'Things', expectedLeaf: 'Items',
1025
+ });
1026
+ return;
1027
+ });
1028
+ it('returns the actualLeaf when typeName starts with classPrefix passthrough but leaf differs', () => {
1029
+ const reasonResult = validateLeaf('items', 'Cli_Foo_Things', 'Cli_Foo_Run', 'Cli_Foo');
1030
+ deepStrictEqual(reasonResult, {
1031
+ actualLeaf: 'Things', expectedLeaf: 'Items',
1032
+ });
1033
+ return;
1034
+ });
1035
+ it('returns full typeName as actualLeaf when no prefix matches', () => {
1036
+ const reasonResult = validateLeaf('items', 'Foreign_Type', 'Cli_Foo_Run', 'Cli_Foo');
1037
+ deepStrictEqual(reasonResult, {
1038
+ actualLeaf: 'Foreign_Type', expectedLeaf: 'Items',
1039
+ });
1040
+ return;
1041
+ });
1042
+ return;
1043
+ });
1044
+ describe('validateReturnType comprehensive', () => {
1045
+ it('passes _Returns at non-type-guard return', () => {
1046
+ strictEqual(validateReturnType('Foo_Bar_Returns', false), null);
1047
+ return;
1048
+ });
1049
+ it('passes Returns at non-type-guard return', () => {
1050
+ strictEqual(validateReturnType('FooBarReturns', false), null);
1051
+ return;
1052
+ });
1053
+ it('passes _TypeGuard at type-guard return', () => {
1054
+ strictEqual(validateReturnType('Foo_Bar_TypeGuard', true), null);
1055
+ return;
1056
+ });
1057
+ it('passes TypeGuard at type-guard return', () => {
1058
+ strictEqual(validateReturnType('FooBarTypeGuard', true), null);
1059
+ return;
1060
+ });
1061
+ it('rejects singular _Return at any return position (rule 7.6)', () => {
1062
+ ok((validateReturnType('Foo_Bar_Return', false) ?? '').includes('singular'));
1063
+ return;
1064
+ });
1065
+ it('rejects glued Return at any return position', () => {
1066
+ ok((validateReturnType('FooBarReturn', false) ?? '').includes('singular'));
1067
+ return;
1068
+ });
1069
+ it('rejects non-Returns at non-type-guard (rule 7.5)', () => {
1070
+ ok((validateReturnType('Foo_Bar_Result', false) ?? '').includes('Returns'));
1071
+ return;
1072
+ });
1073
+ it('rejects TypeGuard at non-type-guard return position (rule 7.7)', () => {
1074
+ ok((validateReturnType('Foo_Bar_TypeGuard', false) ?? '').includes('value is T'));
1075
+ return;
1076
+ });
1077
+ it('rejects non-TypeGuard at type-guard position (rule 7.7)', () => {
1078
+ ok((validateReturnType('Foo_Bar_Returns', true) ?? '').includes('TypeGuard'));
1079
+ return;
1080
+ });
1081
+ it('rejects Result at type-guard position', () => {
1082
+ ok((validateReturnType('Foo_Bar_Result', true) ?? '').includes('TypeGuard'));
1083
+ return;
1084
+ });
1085
+ return;
1086
+ });
1087
+ describe('isLocallyDefined comprehensive', () => {
1088
+ it('returns true for export type X = ...;', () => {
1089
+ const dtsContent = 'export type Cli_Foo_Bar = string;\n';
1090
+ strictEqual(isLocallyDefined('Cli_Foo_Bar', dtsContent), true);
1091
+ return;
1092
+ });
1093
+ it('returns false for missing type', () => {
1094
+ const dtsContent = 'export type Cli_Foo_Bar = string;\n';
1095
+ strictEqual(isLocallyDefined('Cli_Foo_NotThere', dtsContent), false);
1096
+ return;
1097
+ });
1098
+ it('only matches at line start with export type prefix', () => {
1099
+ const dtsContent = '// some comment about Cli_Foo_Bar\n';
1100
+ strictEqual(isLocallyDefined('Cli_Foo_Bar', dtsContent), false);
1101
+ return;
1102
+ });
1103
+ it('matches with word boundary (does not partial-match)', () => {
1104
+ const dtsContent = 'export type Cli_Foo_BarExtended = string;\n';
1105
+ strictEqual(isLocallyDefined('Cli_Foo_Bar', dtsContent), false);
1106
+ return;
1107
+ });
1108
+ it('handles type defined at end of file without trailing newline', () => {
1109
+ const dtsContent = 'export type Cli_Foo_Bar = string;';
1110
+ strictEqual(isLocallyDefined('Cli_Foo_Bar', dtsContent), true);
1111
+ return;
1112
+ });
1113
+ return;
1114
+ });
1115
+ describe('isAliasToForeignType comprehensive', () => {
1116
+ it('detects direct alias to a foreign-prefix type', () => {
1117
+ const dtsContent = 'export type Cli_Foo_Run_Data = Lib_Utility_FetchData_Returns;\n';
1118
+ strictEqual(isAliasToForeignType('Cli_Foo_Run_Data', dtsContent, 'Cli_Foo'), true);
1119
+ return;
1120
+ });
1121
+ it('does not flag alias to same-prefix type', () => {
1122
+ const dtsContent = 'export type Cli_Foo_Run_Data = Cli_Foo_Helper_Result;\n';
1123
+ strictEqual(isAliasToForeignType('Cli_Foo_Run_Data', dtsContent, 'Cli_Foo'), false);
1124
+ return;
1125
+ });
1126
+ it('does not flag concrete object shape', () => {
1127
+ const dtsContent = 'export type Cli_Foo_Run_Data = { name: string; version: string };\n';
1128
+ strictEqual(isAliasToForeignType('Cli_Foo_Run_Data', dtsContent, 'Cli_Foo'), false);
1129
+ return;
1130
+ });
1131
+ it('does not flag primitive alias', () => {
1132
+ const dtsContent = 'export type Cli_Foo_Run_Data = string;\n';
1133
+ strictEqual(isAliasToForeignType('Cli_Foo_Run_Data', dtsContent, 'Cli_Foo'), false);
1134
+ return;
1135
+ });
1136
+ it('does not flag union types', () => {
1137
+ const dtsContent = 'export type Cli_Foo_Run_Data = Lib_Utility_X | null;\n';
1138
+ strictEqual(isAliasToForeignType('Cli_Foo_Run_Data', dtsContent, 'Cli_Foo'), false);
1139
+ return;
1140
+ });
1141
+ it('handles array form: alias to foreign[]', () => {
1142
+ const dtsContent = 'export type Cli_Foo_Run_Data = Lib_Utility_X[];\n';
1143
+ strictEqual(isAliasToForeignType('Cli_Foo_Run_Data', dtsContent, 'Cli_Foo'), true);
1144
+ return;
1145
+ });
1146
+ it('strips generics before checking', () => {
1147
+ const dtsContent = 'export type Cli_Foo_Run_Data = Promise<Lib_Utility_X>;\n';
1148
+ strictEqual(isAliasToForeignType('Cli_Foo_Run_Data', dtsContent, 'Cli_Foo'), false);
1149
+ return;
1150
+ });
1151
+ it('does not flag unprefixed PascalCase type', () => {
1152
+ const dtsContent = 'export type Cli_Foo_Run_Data = SomeType;\n';
1153
+ strictEqual(isAliasToForeignType('Cli_Foo_Run_Data', dtsContent, 'Cli_Foo'), false);
1154
+ return;
1155
+ });
1156
+ it('returns false when type not present in dts', () => {
1157
+ const dtsContent = '\n';
1158
+ strictEqual(isAliasToForeignType('Cli_Foo_Run_Data', dtsContent, 'Cli_Foo'), false);
1159
+ return;
1160
+ });
1161
+ return;
1162
+ });
1163
+ describe('buildSourceSectionMap comprehensive', () => {
1164
+ it('class declaration adds class name as a chunk (Mode 2)', () => {
1165
+ const sectionMap = buildSourceSectionMap('/fake/cli/foo.ts', [
1166
+ 'class Runner {',
1167
+ ' public bar(): void {}',
1168
+ '}',
1169
+ '',
1170
+ ].join('\n'), 'Cli_Foo');
1171
+ strictEqual(sectionMap.get(1), 'Cli_Foo_Runner');
1172
+ strictEqual(sectionMap.get(2), 'Cli_Foo_Runner_Bar');
1173
+ return;
1174
+ });
1175
+ it('anonymous class declaration (default export without name) does NOT add chunk', () => {
1176
+ const sectionMap = buildSourceSectionMap('/fake/cli/foo.ts', 'export default class {}\n', 'Cli_Foo');
1177
+ strictEqual(sectionMap.get(1), 'Cli_Foo');
1178
+ return;
1179
+ });
1180
+ it('constructor adds Constructor chunk', () => {
1181
+ const sectionMap = buildSourceSectionMap('/fake/cli/foo.ts', [
1182
+ 'class Runner {',
1183
+ ' constructor(name: string) {}',
1184
+ '}',
1185
+ '',
1186
+ ].join('\n'), 'Cli_Foo');
1187
+ strictEqual(sectionMap.get(2), 'Cli_Foo_Runner_Constructor');
1188
+ return;
1189
+ });
1190
+ it('method declaration adds method chunk', () => {
1191
+ const sectionMap = buildSourceSectionMap('/fake/cli/foo.ts', [
1192
+ 'class Runner {',
1193
+ ' public addRow(): void {}',
1194
+ '}',
1195
+ '',
1196
+ ].join('\n'), 'Cli_Foo');
1197
+ strictEqual(sectionMap.get(2), 'Cli_Foo_Runner_AddRow');
1198
+ return;
1199
+ });
1200
+ it('private # method strips # and adds chunk', () => {
1201
+ const sectionMap = buildSourceSectionMap('/fake/cli/foo.ts', [
1202
+ 'class Runner {',
1203
+ ' #helper(): void {}',
1204
+ '}',
1205
+ '',
1206
+ ].join('\n'), 'Cli_Foo');
1207
+ strictEqual(sectionMap.get(2), 'Cli_Foo_Runner_Helper');
1208
+ return;
1209
+ });
1210
+ it('top-level function declaration adds function chunk', () => {
1211
+ const sectionMap = buildSourceSectionMap('/fake/lib/utility.ts', [
1212
+ 'function getCurrentTimestamp(): number {',
1213
+ ' return Date.now();',
1214
+ '}',
1215
+ '',
1216
+ ].join('\n'), 'Lib_Utility');
1217
+ strictEqual(sectionMap.get(1), 'Lib_Utility_GetCurrentTimestamp');
1218
+ return;
1219
+ });
1220
+ it('top-level function-typed const adds const chunk', () => {
1221
+ const sectionMap = buildSourceSectionMap('/fake/lib/utility.ts', [
1222
+ 'const formatRow = (row: string[]) => {',
1223
+ ' return row.join(\'|\');',
1224
+ '};',
1225
+ '',
1226
+ ].join('\n'), 'Lib_Utility');
1227
+ strictEqual(sectionMap.get(2), 'Lib_Utility_FormatRow');
1228
+ return;
1229
+ });
1230
+ it('function expression const adds chunk', () => {
1231
+ const sectionMap = buildSourceSectionMap('/fake/lib/utility.ts', [
1232
+ 'const handler = function (x: number) {',
1233
+ ' return x;',
1234
+ '};',
1235
+ '',
1236
+ ].join('\n'), 'Lib_Utility');
1237
+ strictEqual(sectionMap.get(2), 'Lib_Utility_Handler');
1238
+ return;
1239
+ });
1240
+ it('nested function declaration adds chunk under outer', () => {
1241
+ const sectionMap = buildSourceSectionMap('/fake/lib/utility.ts', [
1242
+ 'function process() {',
1243
+ ' function visit() {',
1244
+ ' const x: number = 1;',
1245
+ ' }',
1246
+ '}',
1247
+ '',
1248
+ ].join('\n'), 'Lib_Utility');
1249
+ strictEqual(sectionMap.get(3), 'Lib_Utility_Process_Visit');
1250
+ return;
1251
+ });
1252
+ it('generic (string, fn) call adds chunk via parseDescribeString', () => {
1253
+ const sectionMap = buildSourceSectionMap('/fake/cli/server.ts', [
1254
+ 'function start() {',
1255
+ ' app.get(\'/users\', (req, res) => {',
1256
+ ' const x: number = 1;',
1257
+ ' });',
1258
+ '}',
1259
+ '',
1260
+ ].join('\n'), 'Cli_Server');
1261
+ strictEqual(sectionMap.get(3), 'Cli_Server_Start_Users');
1262
+ return;
1263
+ });
1264
+ it('describe call adds chunk via generic (string, fn)', () => {
1265
+ const sectionMap = buildSourceSectionMap('/fake/tests/foo.test.ts', [
1266
+ 'describe(\'Foo\', () => {',
1267
+ ' const x: number = 1;',
1268
+ '});',
1269
+ '',
1270
+ ].join('\n'), 'Tests_Foo');
1271
+ strictEqual(sectionMap.get(2), 'Tests_Foo_Foo');
1272
+ return;
1273
+ });
1274
+ it('it call adds chunk via generic (string, fn)', () => {
1275
+ const sectionMap = buildSourceSectionMap('/fake/tests/foo.test.ts', [
1276
+ 'describe(\'Foo\', () => {',
1277
+ ' it(\'does something\', () => {',
1278
+ ' const x: number = 1;',
1279
+ ' });',
1280
+ '});',
1281
+ '',
1282
+ ].join('\n'), 'Tests_Foo');
1283
+ strictEqual(sectionMap.get(3), 'Tests_Foo_Foo_DoesSomething');
1284
+ return;
1285
+ });
1286
+ it('template string in (string, fn) does NOT add chunk (EC23)', () => {
1287
+ const interp = [
1288
+ '$',
1289
+ '{',
1290
+ '1}',
1291
+ ].join('');
1292
+ const sourceContent = [
1293
+ 'describe(\'Foo\', () => {',
1294
+ ` it(\`test ${interp}\`, () => {`,
1295
+ ' const x: number = 1;',
1296
+ ' });',
1297
+ '});',
1298
+ '',
1299
+ ].join('\n');
1300
+ const sectionMap = buildSourceSectionMap('/fake/tests/foo.test.ts', sourceContent, 'Tests_Foo');
1301
+ strictEqual(sectionMap.get(3), 'Tests_Foo_Foo');
1302
+ return;
1303
+ });
1304
+ it('variable in (string, fn) arg[0] does NOT add chunk (EC23)', () => {
1305
+ const sectionMap = buildSourceSectionMap('/fake/tests/foo.test.ts', [
1306
+ 'const name = \'Foo\';',
1307
+ 'describe(name, () => {',
1308
+ ' const x: number = 1;',
1309
+ '});',
1310
+ '',
1311
+ ].join('\n'), 'Tests_Foo');
1312
+ strictEqual(sectionMap.get(3), 'Tests_Foo');
1313
+ return;
1314
+ });
1315
+ it('async arrow function callback in (string, fn) works (EC24)', () => {
1316
+ const sectionMap = buildSourceSectionMap('/fake/tests/foo.test.ts', [
1317
+ 'describe(\'Foo\', async () => {',
1318
+ ' const x: number = 1;',
1319
+ '});',
1320
+ '',
1321
+ ].join('\n'), 'Tests_Foo');
1322
+ strictEqual(sectionMap.get(2), 'Tests_Foo_Foo');
1323
+ return;
1324
+ });
1325
+ it('multiple top-level classes each add their own chunk (EC1)', () => {
1326
+ const sectionMap = buildSourceSectionMap('/fake/cli/multi.ts', [
1327
+ 'class Foo {',
1328
+ ' process(): void {}',
1329
+ '}',
1330
+ 'class Bar {',
1331
+ ' process(): void {}',
1332
+ '}',
1333
+ '',
1334
+ ].join('\n'), 'Cli_Multi');
1335
+ strictEqual(sectionMap.get(2), 'Cli_Multi_Foo_Process');
1336
+ strictEqual(sectionMap.get(5), 'Cli_Multi_Bar_Process');
1337
+ return;
1338
+ });
1339
+ it('static method adds chunk (EC26)', () => {
1340
+ const sectionMap = buildSourceSectionMap('/fake/cli/foo.ts', [
1341
+ 'class Runner {',
1342
+ ' public static doThing(): void {}',
1343
+ '}',
1344
+ '',
1345
+ ].join('\n'), 'Cli_Foo');
1346
+ strictEqual(sectionMap.get(2), 'Cli_Foo_Runner_DoThing');
1347
+ return;
1348
+ });
1349
+ it('getter adds chunk based on property name (EC25)', () => {
1350
+ const sectionMap = buildSourceSectionMap('/fake/cli/foo.ts', [
1351
+ 'class Runner {',
1352
+ ' public get bar(): number { return 1; }',
1353
+ '}',
1354
+ '',
1355
+ ].join('\n'), 'Cli_Foo');
1356
+ strictEqual(sectionMap.get(2), 'Cli_Foo_Runner_Bar');
1357
+ return;
1358
+ });
1359
+ it('nested class inside method adds chunk under method (EC33)', () => {
1360
+ const sectionMap = buildSourceSectionMap('/fake/cli/foo.ts', [
1361
+ 'class Outer {',
1362
+ ' run(): void {',
1363
+ ' class Inner {}',
1364
+ ' }',
1365
+ '}',
1366
+ '',
1367
+ ].join('\n'), 'Cli_Foo');
1368
+ strictEqual(sectionMap.get(3), 'Cli_Foo_Outer_Run_Inner');
1369
+ return;
1370
+ });
1371
+ it('default export class adds chunk (EC11)', () => {
1372
+ const sectionMap = buildSourceSectionMap('/fake/cli/foo.ts', [
1373
+ 'export default class Runner {',
1374
+ ' bar(): void {}',
1375
+ '}',
1376
+ '',
1377
+ ].join('\n'), 'Cli_Foo');
1378
+ strictEqual(sectionMap.get(2), 'Cli_Foo_Runner_Bar');
1379
+ return;
1380
+ });
1381
+ it('vitest bench / suite calls add chunks generically (EC34)', () => {
1382
+ const sectionMap = buildSourceSectionMap('/fake/tests/foo.test.ts', [
1383
+ 'bench(\'fast\', () => {',
1384
+ ' const x: number = 1;',
1385
+ '});',
1386
+ '',
1387
+ ].join('\n'), 'Tests_Foo');
1388
+ strictEqual(sectionMap.get(2), 'Tests_Foo_Fast');
1389
+ return;
1390
+ });
1391
+ it('describe.skip adds chunk (EC30)', () => {
1392
+ const sectionMap = buildSourceSectionMap('/fake/tests/foo.test.ts', [
1393
+ 'describe.skip(\'Foo\', () => {',
1394
+ ' const x: number = 1;',
1395
+ '});',
1396
+ '',
1397
+ ].join('\n'), 'Tests_Foo');
1398
+ strictEqual(sectionMap.get(2), 'Tests_Foo_Foo');
1399
+ return;
1400
+ });
1401
+ it('class method body section overrides class section for body lines', () => {
1402
+ const sectionMap = buildSourceSectionMap('/fake/cli/foo.ts', [
1403
+ 'class Runner {',
1404
+ ' bar(): void {',
1405
+ ' const x: number = 1;',
1406
+ ' }',
1407
+ '}',
1408
+ '',
1409
+ ].join('\n'), 'Cli_Foo');
1410
+ strictEqual(sectionMap.get(3), 'Cli_Foo_Runner_Bar');
1411
+ return;
1412
+ });
1413
+ it('arrow function const at file root adds chunk (EC2 -- file with only top-level const)', () => {
1414
+ const sectionMap = buildSourceSectionMap('/fake/lib/foo.ts', [
1415
+ 'export const helper = () => {',
1416
+ ' const x: number = 1;',
1417
+ '};',
1418
+ '',
1419
+ ].join('\n'), 'Lib_Foo');
1420
+ strictEqual(sectionMap.get(2), 'Lib_Foo_Helper');
1421
+ return;
1422
+ });
1423
+ it('non-fn-typed const (string value) does NOT add chunk', () => {
1424
+ const sectionMap = buildSourceSectionMap('/fake/lib/foo.ts', 'const constant = \'value\';\n', 'Lib_Foo');
1425
+ strictEqual(sectionMap.get(1), 'Lib_Foo');
1426
+ return;
1427
+ });
1428
+ it('only-string-no-fn call expression does NOT add chunk', () => {
1429
+ const sectionMap = buildSourceSectionMap('/fake/lib/foo.ts', [
1430
+ 'function bar() {',
1431
+ ' console.log(\'hello\');',
1432
+ ' const x: number = 1;',
1433
+ '}',
1434
+ '',
1435
+ ].join('\n'), 'Lib_Foo');
1436
+ strictEqual(sectionMap.get(3), 'Lib_Foo_Bar');
1437
+ return;
1438
+ });
1439
+ it('(string, options-object, fn) call adds chunk -- function in arg[2]', () => {
1440
+ const sectionMap = buildSourceSectionMap('/fake/tests/foo.test.ts', [
1441
+ 'describe(\'Foo\', { skip: true }, () => {',
1442
+ ' const x: number = 1;',
1443
+ '});',
1444
+ '',
1445
+ ].join('\n'), 'Tests_Foo');
1446
+ strictEqual(sectionMap.get(2), 'Tests_Foo_Foo');
1447
+ return;
1448
+ });
1449
+ it('(string, string, fn) call uses arg[0] for chunk -- picks first function in any later arg', () => {
1450
+ const sectionMap = buildSourceSectionMap('/fake/tests/foo.test.ts', [
1451
+ 'foo(\'first\', \'second\', () => {',
1452
+ ' const x: number = 1;',
1453
+ '});',
1454
+ '',
1455
+ ].join('\n'), 'Tests_Foo');
1456
+ strictEqual(sectionMap.get(2), 'Tests_Foo_First');
1457
+ return;
1458
+ });
1459
+ it('(fn, string) -- function in arg[0] (not a string), rule does NOT match -- covers setTimeout-style', () => {
1460
+ const sectionMap = buildSourceSectionMap('/fake/lib/foo.ts', [
1461
+ 'function bar() {',
1462
+ ' setTimeout(() => {',
1463
+ ' const x: number = 1;',
1464
+ ' }, 1000);',
1465
+ '}',
1466
+ '',
1467
+ ].join('\n'), 'Lib_Foo');
1468
+ strictEqual(sectionMap.get(3), 'Lib_Foo_Bar');
1469
+ return;
1470
+ });
1471
+ it('(string, fn, fn) call uses the first function arg only, ignores the second', () => {
1472
+ const sectionMap = buildSourceSectionMap('/fake/tests/foo.test.ts', [
1473
+ 'foo(\'Bar\', () => {',
1474
+ ' const a: number = 1;',
1475
+ '}, () => {',
1476
+ ' const b: number = 2;',
1477
+ '});',
1478
+ '',
1479
+ ].join('\n'), 'Tests_Foo');
1480
+ strictEqual(sectionMap.get(2), 'Tests_Foo_Bar');
1481
+ return;
1482
+ });
1483
+ return;
1484
+ });
1485
+ describe('extractTopLevelIdentifiers comprehensive', () => {
1486
+ it('extracts top-level class', () => {
1487
+ const identifiers = extractTopLevelIdentifiers('/fake/cli/foo.ts', 'export class Runner {}\n');
1488
+ strictEqual(identifiers.length, 1);
1489
+ strictEqual((identifiers[0] !== undefined) ? identifiers[0]['name'] : undefined, 'Runner');
1490
+ strictEqual((identifiers[0] !== undefined) ? identifiers[0]['kind'] : undefined, 'class');
1491
+ return;
1492
+ });
1493
+ it('extracts top-level function', () => {
1494
+ const identifiers = extractTopLevelIdentifiers('/fake/lib/foo.ts', 'export function getNow() { return Date.now(); }\n');
1495
+ strictEqual(identifiers.length, 1);
1496
+ strictEqual((identifiers[0] !== undefined) ? identifiers[0]['name'] : undefined, 'getNow');
1497
+ strictEqual((identifiers[0] !== undefined) ? identifiers[0]['kind'] : undefined, 'function');
1498
+ return;
1499
+ });
1500
+ it('extracts top-level function-typed const', () => {
1501
+ const identifiers = extractTopLevelIdentifiers('/fake/lib/foo.ts', 'const helper = () => 1;\n');
1502
+ strictEqual(identifiers.length, 1);
1503
+ strictEqual((identifiers[0] !== undefined) ? identifiers[0]['name'] : undefined, 'helper');
1504
+ strictEqual((identifiers[0] !== undefined) ? identifiers[0]['kind'] : undefined, 'const');
1505
+ return;
1506
+ });
1507
+ it('skips non-function const (primitive)', () => {
1508
+ const identifiers = extractTopLevelIdentifiers('/fake/lib/foo.ts', 'const value = 42;\n');
1509
+ strictEqual(identifiers.length, 0);
1510
+ return;
1511
+ });
1512
+ it('skips nested function inside class method', () => {
1513
+ const identifiers = extractTopLevelIdentifiers('/fake/cli/foo.ts', [
1514
+ 'class Runner {',
1515
+ ' bar() {',
1516
+ ' function nested() {}',
1517
+ ' }',
1518
+ '}',
1519
+ '',
1520
+ ].join('\n'));
1521
+ strictEqual(identifiers.length, 1);
1522
+ strictEqual((identifiers[0] !== undefined) ? identifiers[0]['name'] : undefined, 'Runner');
1523
+ return;
1524
+ });
1525
+ it('handles multiple top-level identifiers (EC1)', () => {
1526
+ const identifiers = extractTopLevelIdentifiers('/fake/cli/multi.ts', [
1527
+ 'export class Foo {}',
1528
+ 'export class Bar {}',
1529
+ 'export function baz() {}',
1530
+ '',
1531
+ ].join('\n'));
1532
+ strictEqual(identifiers.length, 3);
1533
+ strictEqual((identifiers[0] !== undefined) ? identifiers[0]['name'] : undefined, 'Foo');
1534
+ strictEqual((identifiers[1] !== undefined) ? identifiers[1]['name'] : undefined, 'Bar');
1535
+ strictEqual((identifiers[2] !== undefined) ? identifiers[2]['name'] : undefined, 'baz');
1536
+ return;
1537
+ });
1538
+ it('returns line numbers (1-indexed)', () => {
1539
+ const identifiers = extractTopLevelIdentifiers('/fake/cli/foo.ts', [
1540
+ '',
1541
+ '',
1542
+ 'export class Runner {}',
1543
+ '',
1544
+ ].join('\n'));
1545
+ strictEqual((identifiers[0] !== undefined) ? identifiers[0]['lineNumber'] : undefined, 3);
1546
+ return;
1547
+ });
1548
+ it('skips anonymous default export class', () => {
1549
+ const identifiers = extractTopLevelIdentifiers('/fake/cli/foo.ts', 'export default class {}\n');
1550
+ strictEqual(identifiers.length, 0);
1551
+ return;
1552
+ });
1553
+ it('extracts class-expression-typed const as kind "const" (EC9 -- class Wrapper = class {})', () => {
1554
+ const identifiers = extractTopLevelIdentifiers('/fake/lib/foo.ts', 'const Wrapper = class { run() {} };\n');
1555
+ strictEqual(identifiers.length, 1);
1556
+ strictEqual((identifiers[0] !== undefined) ? identifiers[0]['name'] : undefined, 'Wrapper');
1557
+ strictEqual((identifiers[0] !== undefined) ? identifiers[0]['kind'] : undefined, 'const');
1558
+ return;
1559
+ });
1560
+ return;
1561
+ });
1562
+ describe('deriveClassPrefix comprehensive', () => {
1563
+ it('derives Cli_Utility_Changelog from src/cli/utility/changelog.ts', () => {
1564
+ const prefix = deriveClassPrefix(resolve(getPackageRoot(), 'src/cli/utility/changelog.ts'));
1565
+ strictEqual(prefix, 'Cli_Utility_Changelog');
1566
+ return;
1567
+ });
1568
+ it('flattens hyphenated segments (package-json -> PackageJson)', () => {
1569
+ const prefix = deriveClassPrefix(resolve(getPackageRoot(), 'src/cli/recipe/package-json/cleanup.ts'));
1570
+ strictEqual(prefix, 'Cli_Recipe_PackageJson_Cleanup');
1571
+ return;
1572
+ });
1573
+ it('strips .test marker for test files', () => {
1574
+ const prefix = deriveClassPrefix(resolve(getPackageRoot(), 'src/tests/cli/utility/initialize.test.ts'));
1575
+ strictEqual(prefix, 'Tests_Cli_Utility_Initialize');
1576
+ return;
1577
+ });
1578
+ it('handles .d.ts type files', () => {
1579
+ const prefix = deriveClassPrefix(resolve(getPackageRoot(), 'src/types/cli/utility/changelog.d.ts'));
1580
+ strictEqual(prefix, 'Cli_Utility_Changelog');
1581
+ return;
1582
+ });
1583
+ it('handles index files (no segment stripping per Mode 2)', () => {
1584
+ const prefix = deriveClassPrefix(resolve(getPackageRoot(), 'src/cli/index.ts'));
1585
+ strictEqual(prefix, 'Cli_Index');
1586
+ return;
1587
+ });
1588
+ it('handles single-segment path (file at typeRoot)', () => {
1589
+ const prefix = deriveClassPrefix(resolve(getPackageRoot(), 'src/main.ts'));
1590
+ strictEqual(prefix, 'Main');
1591
+ return;
1592
+ });
1593
+ return;
1594
+ });
1595
+ describe('extractTypeNames comprehensive', () => {
1596
+ it('extracts type names from export type lines', () => {
1597
+ const lines = [
1598
+ 'export type Foo = string;',
1599
+ 'export type Bar_Baz = number;',
1600
+ 'export type Cli_Foo_Run_Returns = void;',
1601
+ ];
1602
+ deepStrictEqual(extractTypeNames(lines), [
1603
+ 'Foo',
1604
+ 'Bar_Baz',
1605
+ 'Cli_Foo_Run_Returns',
1606
+ ]);
1607
+ return;
1608
+ });
1609
+ it('returns empty for non-export-type lines', () => {
1610
+ const lines = [
1611
+ 'import { foo } from \'./bar.js\';',
1612
+ '// comment',
1613
+ '',
1614
+ ];
1615
+ deepStrictEqual(extractTypeNames(lines), []);
1616
+ return;
1617
+ });
1618
+ it('handles type with object body', () => {
1619
+ const lines = ['export type Foo_Bar = { x: number };'];
1620
+ deepStrictEqual(extractTypeNames(lines), ['Foo_Bar']);
1621
+ return;
1622
+ });
1623
+ return;
1624
+ });
1625
+ describe('extractImportedNames comprehensive', () => {
1626
+ it('extracts inline imports', () => {
1627
+ const lines = ['import type { Foo, Bar } from \'./baz.d.ts\';'];
1628
+ const names = extractImportedNames(lines);
1629
+ ok(names.has('Foo'));
1630
+ ok(names.has('Bar'));
1631
+ return;
1632
+ });
1633
+ it('extracts multi-line imports', () => {
1634
+ const lines = [
1635
+ 'import type {',
1636
+ ' Foo,',
1637
+ ' Bar,',
1638
+ '} from \'./baz.d.ts\';',
1639
+ ];
1640
+ const names = extractImportedNames(lines);
1641
+ ok(names.has('Foo'));
1642
+ ok(names.has('Bar'));
1643
+ return;
1644
+ });
1645
+ it('returns empty set for no imports', () => {
1646
+ const lines = ['export type Foo = string;'];
1647
+ const names = extractImportedNames(lines);
1648
+ strictEqual(names.size, 0);
1649
+ return;
1650
+ });
1651
+ return;
1652
+ });
1653
+ describe('extractReferencedTypes comprehensive', () => {
1654
+ it('extracts same-prefix referenced type from export type alias', () => {
1655
+ const refs = extractReferencedTypes('export type Cli_Foo_Run_Data = Cli_Foo_Helper_Result;', 'Cli_Foo');
1656
+ deepStrictEqual(refs, ['Cli_Foo_Helper_Result']);
1657
+ return;
1658
+ });
1659
+ it('returns empty for foreign-prefix references (only same-prefix counted)', () => {
1660
+ const refs = extractReferencedTypes('export type Cli_Foo_Run_Data = Lib_Utility_X;', 'Cli_Foo');
1661
+ strictEqual(refs.length, 0);
1662
+ return;
1663
+ });
1664
+ it('extracts multiple same-prefix references', () => {
1665
+ const refs = extractReferencedTypes('export type Cli_Foo_X = Cli_Foo_A | Cli_Foo_B | Cli_Foo_C;', 'Cli_Foo');
1666
+ strictEqual(refs.length, 3);
1667
+ return;
1668
+ });
1669
+ it('excludes the type being defined from references (self-ref)', () => {
1670
+ const refs = extractReferencedTypes('export type Cli_Foo_Bar = Cli_Foo_Bar;', 'Cli_Foo');
1671
+ strictEqual(refs.length, 0);
1672
+ return;
1673
+ });
1674
+ it('returns empty for primitive RHS', () => {
1675
+ const refs = extractReferencedTypes('export type Cli_Foo_X = string;', 'Cli_Foo');
1676
+ strictEqual(refs.length, 0);
1677
+ return;
1678
+ });
1679
+ return;
1680
+ });
1681
+ describe('extractObjectTypes comprehensive', () => {
1682
+ it('extracts object type with properties', () => {
1683
+ const lines = [
1684
+ 'export type Cli_Foo_Run_Status = string;',
1685
+ 'export type Cli_Foo_Run_Result = {',
1686
+ ' status: Cli_Foo_Run_Status;',
1687
+ '};',
1688
+ ];
1689
+ const objectTypes = extractObjectTypes(lines, 'Cli_Foo');
1690
+ strictEqual(objectTypes.length, 1);
1691
+ strictEqual((objectTypes[0] !== undefined) ? objectTypes[0]['name'] : undefined, 'Cli_Foo_Run_Result');
1692
+ strictEqual((objectTypes[0] !== undefined) ? objectTypes[0]['properties'].length : undefined, 1);
1693
+ strictEqual((objectTypes[0] !== undefined && objectTypes[0]['properties'][0] !== undefined) ? objectTypes[0]['properties'][0]['key'] : undefined, 'status');
1694
+ return;
1695
+ });
1696
+ it('handles empty classPrefix (matches any prefix)', () => {
1697
+ const lines = [
1698
+ 'export type Anything = {',
1699
+ ' foo: string;',
1700
+ '};',
1701
+ ];
1702
+ const objectTypes = extractObjectTypes(lines, '');
1703
+ strictEqual(objectTypes.length, 1);
1704
+ return;
1705
+ });
1706
+ it('handles Readonly<...> wrapper', () => {
1707
+ const lines = [
1708
+ 'export type Cli_Foo_X = Readonly<{',
1709
+ ' bar: number;',
1710
+ '}>;',
1711
+ ];
1712
+ const objectTypes = extractObjectTypes(lines, 'Cli_Foo');
1713
+ strictEqual(objectTypes.length, 1);
1714
+ strictEqual((objectTypes[0] !== undefined && objectTypes[0]['properties'][0] !== undefined) ? objectTypes[0]['properties'][0]['key'] : undefined, 'bar');
1715
+ return;
1716
+ });
1717
+ return;
1718
+ });
1719
+ describe('extractArrayTypes comprehensive', () => {
1720
+ it('extracts simple array form X = Y[]', () => {
1721
+ const lines = ['export type Cli_Foo_Items = Cli_Foo_Item[];'];
1722
+ const arrays = extractArrayTypes(lines);
1723
+ strictEqual(arrays.length, 1);
1724
+ strictEqual((arrays[0] !== undefined) ? arrays[0]['arrayTypeName'] : undefined, 'Cli_Foo_Items');
1725
+ strictEqual((arrays[0] !== undefined) ? arrays[0]['elementTypeName'] : undefined, 'Cli_Foo_Item');
1726
+ return;
1727
+ });
1728
+ it('skips multi-dim arrays X = Y[][] (EC7)', () => {
1729
+ const lines = ['export type Cli_Foo_Matrix = Cli_Foo_Cell[][];'];
1730
+ const arrays = extractArrayTypes(lines);
1731
+ strictEqual(arrays.length, 0);
1732
+ return;
1733
+ });
1734
+ it('skips union types X = Y | Z[]', () => {
1735
+ const lines = ['export type Cli_Foo_Mix = Cli_Foo_X | Cli_Foo_Y[];'];
1736
+ const arrays = extractArrayTypes(lines);
1737
+ strictEqual(arrays.length, 0);
1738
+ return;
1739
+ });
1740
+ it('skips generic-wrapped X = Map<...> (EC6)', () => {
1741
+ const lines = ['export type Cli_Foo_Cache = Map<string, Cli_Foo_Item>;'];
1742
+ const arrays = extractArrayTypes(lines);
1743
+ strictEqual(arrays.length, 0);
1744
+ return;
1745
+ });
1746
+ return;
1747
+ });
1748
+ describe('extractBodyDeclarations comprehensive', () => {
1749
+ it('extracts typed const declarations', () => {
1750
+ const lines = [' const foo: Cli_X_Foo = 1;'];
1751
+ const decls = extractBodyDeclarations(lines);
1752
+ strictEqual(decls.length, 1);
1753
+ strictEqual((decls[0] !== undefined) ? decls[0]['varName'] : undefined, 'foo');
1754
+ strictEqual((decls[0] !== undefined) ? decls[0]['typeName'] : undefined, 'Cli_X_Foo');
1755
+ strictEqual((decls[0] !== undefined) ? decls[0]['keyword'] : undefined, 'const');
1756
+ return;
1757
+ });
1758
+ it('extracts typed let declarations', () => {
1759
+ const lines = [' let counter: Cli_X_Counter = 0;'];
1760
+ const decls = extractBodyDeclarations(lines);
1761
+ strictEqual((decls[0] !== undefined) ? decls[0]['keyword'] : undefined, 'let');
1762
+ return;
1763
+ });
1764
+ it('skips untyped const', () => {
1765
+ const lines = [' const foo = 1;'];
1766
+ const decls = extractBodyDeclarations(lines);
1767
+ strictEqual(decls.length, 0);
1768
+ return;
1769
+ });
1770
+ it('skips destructured assignments (EC13)', () => {
1771
+ const lines = [' const { foo, bar } = options;'];
1772
+ const decls = extractBodyDeclarations(lines);
1773
+ strictEqual(decls.length, 0);
1774
+ return;
1775
+ });
1776
+ return;
1777
+ });
1778
+ describe('extractFunctionParams comprehensive', () => {
1779
+ it('extracts function declaration params', () => {
1780
+ const params = extractFunctionParams('/fake/lib/foo.ts', 'function bar(name: Lib_Foo_Bar_Name): void {}\n');
1781
+ strictEqual(params.length, 1);
1782
+ strictEqual((params[0] !== undefined) ? params[0]['paramName'] : undefined, 'name');
1783
+ strictEqual((params[0] !== undefined) ? params[0]['typeName'] : undefined, 'Lib_Foo_Bar_Name');
1784
+ return;
1785
+ });
1786
+ it('extracts method params', () => {
1787
+ const params = extractFunctionParams('/fake/cli/foo.ts', [
1788
+ 'class Runner {',
1789
+ ' bar(x: Cli_Foo_Runner_Bar_X): void {}',
1790
+ '}',
1791
+ '',
1792
+ ].join('\n'));
1793
+ strictEqual((params[0] !== undefined) ? params[0]['paramName'] : undefined, 'x');
1794
+ return;
1795
+ });
1796
+ it('extracts constructor params', () => {
1797
+ const params = extractFunctionParams('/fake/cli/foo.ts', [
1798
+ 'class Runner {',
1799
+ ' constructor(name: Cli_Foo_Runner_Constructor_Name) {}',
1800
+ '}',
1801
+ '',
1802
+ ].join('\n'));
1803
+ strictEqual((params[0] !== undefined) ? params[0]['paramName'] : undefined, 'name');
1804
+ return;
1805
+ });
1806
+ it('extracts function-typed const params', () => {
1807
+ const params = extractFunctionParams('/fake/lib/foo.ts', 'const helper = (x: Lib_Foo_Helper_X) => x;\n');
1808
+ strictEqual((params[0] !== undefined) ? params[0]['paramName'] : undefined, 'x');
1809
+ return;
1810
+ });
1811
+ it('handles multiple params', () => {
1812
+ const params = extractFunctionParams('/fake/lib/foo.ts', 'function bar(a: A, b: B, c: C): void {}\n');
1813
+ strictEqual(params.length, 3);
1814
+ return;
1815
+ });
1816
+ return;
1817
+ });
1818
+ describe('extractFunctionReturns comprehensive', () => {
1819
+ it('extracts function declaration return type', () => {
1820
+ const returnRecords = extractFunctionReturns('/fake/lib/foo.ts', 'function bar(): Lib_Foo_Bar_Returns { return; }\n');
1821
+ strictEqual((returnRecords[0] !== undefined) ? returnRecords[0]['returnType'] : undefined, 'Lib_Foo_Bar_Returns');
1822
+ strictEqual((returnRecords[0] !== undefined) ? returnRecords[0]['isTypeGuard'] : undefined, false);
1823
+ return;
1824
+ });
1825
+ it('detects type-guard returns (value is X)', () => {
1826
+ const returnRecords = extractFunctionReturns('/fake/lib/foo.ts', 'function isFoo(x: unknown): x is Lib_Foo_IsFoo_TypeGuard { return true; }\n');
1827
+ strictEqual((returnRecords[0] !== undefined) ? returnRecords[0]['isTypeGuard'] : undefined, true);
1828
+ return;
1829
+ });
1830
+ it('extracts method return type', () => {
1831
+ const returnRecords = extractFunctionReturns('/fake/cli/foo.ts', [
1832
+ 'class Runner {',
1833
+ ' bar(): Cli_Foo_Runner_Bar_Returns { return; }',
1834
+ '}',
1835
+ '',
1836
+ ].join('\n'));
1837
+ strictEqual((returnRecords[0] !== undefined) ? returnRecords[0]['returnType'] : undefined, 'Cli_Foo_Runner_Bar_Returns');
1838
+ return;
1839
+ });
1840
+ it('[gap] does NOT extract arrow function const returns -- extractFunctionReturns only inspects function/method/constructor declarations', () => {
1841
+ const returnRecords = extractFunctionReturns('/fake/lib/foo.ts', 'const helper = (): Lib_Foo_Helper_Returns => 42;\n');
1842
+ strictEqual(returnRecords.length, 0);
1843
+ return;
1844
+ });
1845
+ return;
1846
+ });
1847
+ describe('detectInlineTypedCallbacks comprehensive', () => {
1848
+ it('detects typed arrow callback param', () => {
1849
+ const callbacks = detectInlineTypedCallbacks('/fake/cli/foo.ts', [
1850
+ 'function run() {',
1851
+ ' items.filter((item: Cli_Foo_Item) => item.active);',
1852
+ '}',
1853
+ '',
1854
+ ].join('\n'));
1855
+ strictEqual(callbacks.length, 1);
1856
+ strictEqual((callbacks[0] !== undefined) ? callbacks[0]['paramName'] : undefined, 'item');
1857
+ strictEqual((callbacks[0] !== undefined) ? callbacks[0]['typeName'] : undefined, 'Cli_Foo_Item');
1858
+ return;
1859
+ });
1860
+ it('skips untyped callback param (rule 7.4 H2)', () => {
1861
+ const callbacks = detectInlineTypedCallbacks('/fake/cli/foo.ts', [
1862
+ 'function run() {',
1863
+ ' items.filter((item) => item.active);',
1864
+ '}',
1865
+ '',
1866
+ ].join('\n'));
1867
+ strictEqual(callbacks.length, 0);
1868
+ return;
1869
+ });
1870
+ it('detects typed function expression callback', () => {
1871
+ const callbacks = detectInlineTypedCallbacks('/fake/cli/foo.ts', [
1872
+ 'function run() {',
1873
+ ' items.filter(function (item: Cli_Foo_Item) { return item.active; });',
1874
+ '}',
1875
+ '',
1876
+ ].join('\n'));
1877
+ strictEqual(callbacks.length, 1);
1878
+ return;
1879
+ });
1880
+ return;
1881
+ });
1882
+ describe('checkTypeNameUniqueness comprehensive', () => {
1883
+ it('returns no violations for unique names', () => {
1884
+ const violations = checkTypeNameUniqueness([
1885
+ {
1886
+ name: 'foo', typeName: 'Cli_X_Foo', lineNumber: 1,
1887
+ },
1888
+ {
1889
+ name: 'bar', typeName: 'Cli_X_Bar', lineNumber: 2,
1890
+ },
1891
+ ]);
1892
+ strictEqual(violations.length, 0);
1893
+ return;
1894
+ });
1895
+ it('detects duplicate expected names (rule 7.8)', () => {
1896
+ const violations = checkTypeNameUniqueness([
1897
+ {
1898
+ name: 'foo', typeName: 'Cli_X_Foo', lineNumber: 1,
1899
+ },
1900
+ {
1901
+ name: 'foo', typeName: 'Cli_X_Foo', lineNumber: 5,
1902
+ },
1903
+ ]);
1904
+ strictEqual(violations.length, 1);
1905
+ return;
1906
+ });
1907
+ return;
1908
+ });
1909
+ describe('buildDtsSections comprehensive', () => {
1910
+ it('groups types by source section', () => {
1911
+ const dtsLines = [
1912
+ 'export type Cli_Foo_Run_X = string;',
1913
+ 'export type Cli_Foo_Helper_Y = string;',
1914
+ ];
1915
+ const sourceSections = new Set([
1916
+ 'Cli_Foo_Run',
1917
+ 'Cli_Foo_Helper',
1918
+ ]);
1919
+ const sections = buildDtsSections(dtsLines, sourceSections, 'Cli_Foo');
1920
+ strictEqual(sections.length, 2);
1921
+ return;
1922
+ });
1923
+ it('uses longest prefix match', () => {
1924
+ const dtsLines = ['export type Cli_Foo_Run_Helper_X = string;'];
1925
+ const sourceSections = new Set([
1926
+ 'Cli_Foo_Run',
1927
+ 'Cli_Foo_Run_Helper',
1928
+ ]);
1929
+ const sections = buildDtsSections(dtsLines, sourceSections, 'Cli_Foo');
1930
+ strictEqual((sections[0] !== undefined) ? sections[0]['prefix'] : undefined, 'Cli_Foo_Run_Helper');
1931
+ return;
1932
+ });
1933
+ it('falls back to classPrefix for unmatched types', () => {
1934
+ const dtsLines = ['export type Cli_Foo_OrphanType = string;'];
1935
+ const sourceSections = new Set();
1936
+ const sections = buildDtsSections(dtsLines, sourceSections, 'Cli_Foo');
1937
+ strictEqual((sections[0] !== undefined) ? sections[0]['prefix'] : undefined, 'Cli_Foo');
1938
+ return;
1939
+ });
1940
+ it('skips types not starting with classPrefix or any source section', () => {
1941
+ const dtsLines = ['export type ForeignType = string;'];
1942
+ const sourceSections = new Set(['Cli_Foo_Run']);
1943
+ const sections = buildDtsSections(dtsLines, sourceSections, 'Cli_Foo');
1944
+ strictEqual(sections.length, 0);
1945
+ return;
1946
+ });
1947
+ return;
1948
+ });
1949
+ describe('Rule C1/C2/C3 integration', () => {
1950
+ it('detects class name == file name (C1)', () => {
1951
+ const identifiers = extractTopLevelIdentifiers('/fake/cli/utility/changelog.ts', 'export class Changelog {}\n');
1952
+ const fileName = 'Changelog';
1953
+ const violations = identifiers
1954
+ .filter((identifier) => identifier['name'] === fileName)
1955
+ .map((identifier) => `${identifier['kind']}:${identifier['name']}`);
1956
+ deepStrictEqual(violations, ['class:Changelog']);
1957
+ return;
1958
+ });
1959
+ it('detects function name == file name (C2)', () => {
1960
+ const identifiers = extractTopLevelIdentifiers('/fake/lib/utility.ts', 'export function utility() {}\n');
1961
+ const fileName = 'utility';
1962
+ const violations = identifiers
1963
+ .filter((identifier) => identifier['name'] === fileName)
1964
+ .map((identifier) => identifier['name']);
1965
+ strictEqual(violations.length, 1);
1966
+ return;
1967
+ });
1968
+ it('detects function-typed const name == file name (C2)', () => {
1969
+ const identifiers = extractTopLevelIdentifiers('/fake/lib/utility.ts', 'const utility = () => 1;\n');
1970
+ const fileName = 'utility';
1971
+ const violations = identifiers
1972
+ .filter((identifier) => identifier['name'] === fileName)
1973
+ .map((identifier) => identifier['name']);
1974
+ strictEqual(violations.length, 1);
1975
+ return;
1976
+ });
1977
+ it('detects hyphenated file name flattened (C3)', () => {
1978
+ const filePath = resolve(getPackageRoot(), 'src/toolkit/markdown-table.ts');
1979
+ const classPrefix = deriveClassPrefix(filePath);
1980
+ const segments = classPrefix.split('_');
1981
+ const fileName = segments[segments.length - 1] ?? '';
1982
+ strictEqual(fileName, 'MarkdownTable');
1983
+ const identifiers = extractTopLevelIdentifiers(filePath, 'export class MarkdownTable {}\n');
1984
+ strictEqual(identifiers.filter((identifier) => identifier['name'] === fileName).length, 1);
1985
+ return;
1986
+ });
1987
+ it('does NOT fire for non-matching name', () => {
1988
+ const identifiers = extractTopLevelIdentifiers('/fake/cli/utility/changelog.ts', 'export class Runner {}\n');
1989
+ const fileName = 'Changelog';
1990
+ strictEqual(identifiers.filter((identifier) => identifier['name'] === fileName).length, 0);
1991
+ return;
1992
+ });
1993
+ it('does NOT fire for nested class with same name as file', () => {
1994
+ const identifiers = extractTopLevelIdentifiers('/fake/cli/utility/changelog.ts', [
1995
+ 'export class Runner {',
1996
+ ' doStuff() {',
1997
+ ' class Changelog {}',
1998
+ ' }',
1999
+ '}',
2000
+ '',
2001
+ ].join('\n'));
2002
+ const fileName = 'Changelog';
2003
+ strictEqual(identifiers.filter((identifier) => identifier['name'] === fileName).length, 0);
2004
+ return;
2005
+ });
2006
+ return;
2007
+ });
2008
+ describe('Rule 7.2 integration', () => {
2009
+ it('passes when type is locally defined as a concrete shape', () => {
2010
+ const dtsContent = 'export type Cli_Foo_Run_Data = { name: string };\n';
2011
+ strictEqual(isLocallyDefined('Cli_Foo_Run_Data', dtsContent), true);
2012
+ strictEqual(isAliasToForeignType('Cli_Foo_Run_Data', dtsContent, 'Cli_Foo'), false);
2013
+ return;
2014
+ });
2015
+ it('fires when type is not defined locally', () => {
2016
+ const dtsContent = '';
2017
+ strictEqual(isLocallyDefined('Cli_Foo_Run_Data', dtsContent), false);
2018
+ return;
2019
+ });
2020
+ it('fires when locally defined as alias to foreign type (Mode 2 tightening)', () => {
2021
+ const dtsContent = 'export type Cli_Foo_Run_Data = Lib_Utility_X;\n';
2022
+ strictEqual(isLocallyDefined('Cli_Foo_Run_Data', dtsContent), true);
2023
+ strictEqual(isAliasToForeignType('Cli_Foo_Run_Data', dtsContent, 'Cli_Foo'), true);
2024
+ return;
2025
+ });
2026
+ it('passes when alias is to same-prefix type (not foreign)', () => {
2027
+ const dtsContent = 'export type Cli_Foo_Run_Data = Cli_Foo_Helper_Result;\n';
2028
+ strictEqual(isAliasToForeignType('Cli_Foo_Run_Data', dtsContent, 'Cli_Foo'), false);
2029
+ return;
2030
+ });
2031
+ return;
2032
+ });
2033
+ describe('Rule 7.3 integration', () => {
2034
+ it('rejects body var typed Foo_Returns', () => {
2035
+ strictEqual(isReservedSuffix('Foo_Bar_Returns'), true);
2036
+ return;
2037
+ });
2038
+ it('rejects body var typed Foo_TypeGuard', () => {
2039
+ strictEqual(isReservedSuffix('Foo_Bar_TypeGuard'), true);
2040
+ return;
2041
+ });
2042
+ it('rejects body var typed Foo_Return', () => {
2043
+ strictEqual(isReservedSuffix('Foo_Bar_Return'), true);
2044
+ return;
2045
+ });
2046
+ it('passes body var typed Foo_Result (not reserved)', () => {
2047
+ strictEqual(isReservedSuffix('Foo_Bar_Result'), false);
2048
+ return;
2049
+ });
2050
+ return;
2051
+ });
2052
+ describe('Rule 7.4 integration', () => {
2053
+ it('detects typed inline arrow callback', () => {
2054
+ const callbacks = detectInlineTypedCallbacks('/fake/cli/foo.ts', [
2055
+ 'function run() {',
2056
+ ' items.filter((item: Cli_Foo_Item) => item.active);',
2057
+ '}',
2058
+ '',
2059
+ ].join('\n'));
2060
+ strictEqual(callbacks.length, 1);
2061
+ return;
2062
+ });
2063
+ it('passes named const callback (extracted) -- items.filter(isActive) has no inline arrow arg', () => {
2064
+ const callbacks = detectInlineTypedCallbacks('/fake/cli/foo.ts', [
2065
+ 'function run() {',
2066
+ ' const isActive = (item: Cli_Foo_Item) => item.active;',
2067
+ ' items.filter(isActive);',
2068
+ '}',
2069
+ '',
2070
+ ].join('\n'));
2071
+ strictEqual(callbacks.length, 0);
2072
+ return;
2073
+ });
2074
+ it('passes untyped inline callback (rule H2 exemption)', () => {
2075
+ const callbacks = detectInlineTypedCallbacks('/fake/cli/foo.ts', [
2076
+ 'function run() {',
2077
+ ' items.filter((item) => item.active);',
2078
+ '}',
2079
+ '',
2080
+ ].join('\n'));
2081
+ strictEqual(callbacks.length, 0);
2082
+ return;
2083
+ });
2084
+ return;
2085
+ });
2086
+ describe('Rule 7.5/7.6/7.7 integration', () => {
2087
+ it('rule 7.5: function returning Foo_Returns passes', () => {
2088
+ strictEqual(validateReturnType('Foo_Bar_Returns', false), null);
2089
+ return;
2090
+ });
2091
+ it('rule 7.5: function returning Foo_Result fails (must end in Returns)', () => {
2092
+ ok(validateReturnType('Foo_Bar_Result', false) !== null);
2093
+ return;
2094
+ });
2095
+ it('rule 7.6: function returning Foo_Return (singular) fails', () => {
2096
+ ok(validateReturnType('Foo_Bar_Return', false) !== null);
2097
+ return;
2098
+ });
2099
+ it('rule 7.7: type-guard returning Foo_TypeGuard passes', () => {
2100
+ strictEqual(validateReturnType('Foo_Bar_TypeGuard', true), null);
2101
+ return;
2102
+ });
2103
+ it('rule 7.7: function returning Foo_TypeGuard at non-type-guard fails', () => {
2104
+ ok(validateReturnType('Foo_Bar_TypeGuard', false) !== null);
2105
+ return;
2106
+ });
2107
+ it('rule 7.7: type-guard returning Foo_Returns at type-guard fails', () => {
2108
+ ok(validateReturnType('Foo_Bar_Returns', true) !== null);
2109
+ return;
2110
+ });
2111
+ return;
2112
+ });
2113
+ describe('Rule 7.8 integration', () => {
2114
+ it('passes when all expected names unique', () => {
2115
+ const violations = checkTypeNameUniqueness([
2116
+ {
2117
+ name: 'foo', typeName: 'Cli_X_Foo', lineNumber: 1,
2118
+ },
2119
+ {
2120
+ name: 'bar', typeName: 'Cli_X_Bar', lineNumber: 2,
2121
+ },
2122
+ ]);
2123
+ strictEqual(violations.length, 0);
2124
+ return;
2125
+ });
2126
+ it('fires when two body vars produce the same expected type name (rule 7.8)', () => {
2127
+ const violations = checkTypeNameUniqueness([
2128
+ {
2129
+ name: 'foo', typeName: 'Cli_X_Run_Foo', lineNumber: 5,
2130
+ },
2131
+ {
2132
+ name: 'foo', typeName: 'Cli_X_Run_Foo', lineNumber: 12,
2133
+ },
2134
+ ]);
2135
+ strictEqual(violations.length, 1);
2136
+ return;
2137
+ });
2138
+ return;
2139
+ });
2140
+ describe('Rule E3 integration (Mode 2 expansion to Returns | TypeGuard | Return)', () => {
2141
+ it('Returns suffix array IS exempt from element-before-array', () => {
2142
+ const arrayName = 'Cli_Foo_Run_Returns';
2143
+ const exempt = arrayName.endsWith('Returns') === true || arrayName.endsWith('_Returns') === true;
2144
+ strictEqual(exempt, true);
2145
+ return;
2146
+ });
2147
+ it('TypeGuard suffix array IS exempt (Mode 2)', () => {
2148
+ const arrayName = 'Cli_Foo_IsUser_TypeGuard';
2149
+ const exempt = arrayName.endsWith('TypeGuard') === true || arrayName.endsWith('_TypeGuard') === true;
2150
+ strictEqual(exempt, true);
2151
+ return;
2152
+ });
2153
+ it('Return (singular) suffix array IS exempt (Mode 2 defensive)', () => {
2154
+ const arrayName = 'Cli_Foo_Run_Return';
2155
+ const exempt = arrayName.endsWith('Return') === true || arrayName.endsWith('_Return') === true;
2156
+ strictEqual(exempt, true);
2157
+ return;
2158
+ });
2159
+ it('Items suffix array is NOT exempt (must define element first)', () => {
2160
+ const arrayName = 'Cli_Foo_Run_Items';
2161
+ const exempt = (arrayName.endsWith('Returns') === true
2162
+ || arrayName.endsWith('_Returns') === true
2163
+ || arrayName.endsWith('TypeGuard') === true
2164
+ || arrayName.endsWith('_TypeGuard') === true
2165
+ || arrayName.endsWith('Return') === true
2166
+ || arrayName.endsWith('_Return') === true);
2167
+ strictEqual(exempt, false);
2168
+ return;
2169
+ });
2170
+ return;
2171
+ });
2172
+ describe('Rule S1/S2/S3/S4 integration', () => {
2173
+ it('S1: PascalCase top-level type passes', () => {
2174
+ const pascalCasePattern = new RegExp('^[A-Z][A-Za-z0-9]*(_[A-Z][A-Za-z0-9]*)*$');
2175
+ strictEqual(pascalCasePattern.test('EntryCategory'), true);
2176
+ strictEqual(pascalCasePattern.test('EntryItem_Category'), true);
2177
+ return;
2178
+ });
2179
+ it('S1: snake_case fails', () => {
2180
+ const pascalCasePattern = new RegExp('^[A-Z][A-Za-z0-9]*(_[A-Z][A-Za-z0-9]*)*$');
2181
+ strictEqual(pascalCasePattern.test('entry_category'), false);
2182
+ return;
2183
+ });
2184
+ it('S1: brand casing (3+ caps) fails', () => {
2185
+ const brandCasePattern = new RegExp('[A-Z]{3,}');
2186
+ strictEqual(brandCasePattern.test('CLIEntryCategory'), true);
2187
+ strictEqual(brandCasePattern.test('URLBuilder'), true);
2188
+ return;
2189
+ });
2190
+ it('S1: standalone 2-cap acronyms pass when followed by lowercase', () => {
2191
+ const brandCasePattern = new RegExp('[A-Z]{3,}');
2192
+ strictEqual(brandCasePattern.test('UiCore'), false);
2193
+ strictEqual(brandCasePattern.test('IoError'), false);
2194
+ strictEqual(brandCasePattern.test('UICore'), true);
2195
+ strictEqual(brandCasePattern.test('IOError'), true);
2196
+ return;
2197
+ });
2198
+ it('S2: path-prefix-style names detected', () => {
2199
+ const knownTopLevels = new Set([
2200
+ 'Cli',
2201
+ 'Lib',
2202
+ 'Tests',
2203
+ ]);
2204
+ const typeName = 'Cli_Foo_Bar';
2205
+ const isPathPrefixStyle = [...knownTopLevels].some((prefix) => typeName.startsWith(`${prefix}_`));
2206
+ strictEqual(isPathPrefixStyle, true);
2207
+ return;
2208
+ });
2209
+ it('S2: domain concept names pass', () => {
2210
+ const knownTopLevels = new Set([
2211
+ 'Cli',
2212
+ 'Lib',
2213
+ 'Tests',
2214
+ ]);
2215
+ const typeName = 'EntryCategory';
2216
+ const isPathPrefixStyle = [...knownTopLevels].some((prefix) => typeName.startsWith(`${prefix}_`));
2217
+ strictEqual(isPathPrefixStyle, false);
2218
+ return;
2219
+ });
2220
+ it('S3: property type using Parent_Property form passes', () => {
2221
+ const objectName = 'EntryItem';
2222
+ const propertyValueType = 'EntryItem_Category';
2223
+ strictEqual(propertyValueType.startsWith(`${objectName}_`), true);
2224
+ return;
2225
+ });
2226
+ it('S3: property type without parent prefix fails', () => {
2227
+ const objectName = 'EntryItem';
2228
+ const propertyValueType = 'EntryCategory';
2229
+ strictEqual(propertyValueType.startsWith(`${objectName}_`), false);
2230
+ return;
2231
+ });
2232
+ it('S4: array element types defined before array', () => {
2233
+ const lines = [
2234
+ 'export type EntryItem_Tag = string;',
2235
+ 'export type EntryItem_Tags = EntryItem_Tag[];',
2236
+ ];
2237
+ const arrays = extractArrayTypes(lines);
2238
+ const elementLine = lines.findIndex((line) => line.startsWith('export type EntryItem_Tag '));
2239
+ const arrayLine = (arrays[0] !== undefined) ? arrays[0]['lineIndex'] : -1;
2240
+ ok(elementLine < arrayLine);
2241
+ return;
2242
+ });
2243
+ return;
2244
+ });
2245
+ describe('Rule EC19/EC20/EC21 integration', () => {
2246
+ it('passes plain filename foo.ts', () => {
2247
+ const pattern = new RegExp('^[a-z][a-z0-9-]*$');
2248
+ strictEqual(pattern.test('foo'), true);
2249
+ return;
2250
+ });
2251
+ it('passes hyphenated foo-bar.ts', () => {
2252
+ const pattern = new RegExp('^[a-z][a-z0-9-]*$');
2253
+ strictEqual(pattern.test('foo-bar'), true);
2254
+ return;
2255
+ });
2256
+ it('passes filename with trailing digits foo123.ts', () => {
2257
+ const pattern = new RegExp('^[a-z][a-z0-9-]*$');
2258
+ strictEqual(pattern.test('foo123'), true);
2259
+ return;
2260
+ });
2261
+ it('fails filename starting with digit (EC20)', () => {
2262
+ const pattern = new RegExp('^[a-z][a-z0-9-]*$');
2263
+ strictEqual(pattern.test('123foo'), false);
2264
+ return;
2265
+ });
2266
+ it('fails filename with underscore (EC21)', () => {
2267
+ const pattern = new RegExp('^[a-z][a-z0-9-]*$');
2268
+ strictEqual(pattern.test('foo_bar'), false);
2269
+ return;
2270
+ });
2271
+ it('fails filename with special character (EC21)', () => {
2272
+ const pattern = new RegExp('^[a-z][a-z0-9-]*$');
2273
+ strictEqual(pattern.test('foo$bar'), false);
2274
+ strictEqual(pattern.test('foo bar'), false);
2275
+ return;
2276
+ });
2277
+ it('fails filename with uppercase', () => {
2278
+ const pattern = new RegExp('^[a-z][a-z0-9-]*$');
2279
+ strictEqual(pattern.test('Foo'), false);
2280
+ return;
2281
+ });
2282
+ it('fails dotted segment after stripping recognized suffixes (EC19)', () => {
2283
+ const pattern = new RegExp('^[a-z][a-z0-9-]*$');
2284
+ strictEqual(pattern.test('foo.spec'), false);
2285
+ return;
2286
+ });
2287
+ return;
2288
+ });
2289
+ describe('Edge cases EC1-EC10', () => {
2290
+ it('EC1: multiple top-level classes each contribute their own chunk', () => {
2291
+ const sectionMap = buildSourceSectionMap('/fake/cli/multi.ts', [
2292
+ 'class Foo {',
2293
+ ' process(): void {}',
2294
+ '}',
2295
+ 'class Bar {',
2296
+ ' process(): void {}',
2297
+ '}',
2298
+ '',
2299
+ ].join('\n'), 'Cli_Multi');
2300
+ strictEqual(sectionMap.get(2), 'Cli_Multi_Foo_Process');
2301
+ strictEqual(sectionMap.get(5), 'Cli_Multi_Bar_Process');
2302
+ return;
2303
+ });
2304
+ it('EC2: file with only top-level functions, no class', () => {
2305
+ const sectionMap = buildSourceSectionMap('/fake/lib/utility.ts', [
2306
+ 'export function getCurrentTimestamp(): number {',
2307
+ ' return Date.now();',
2308
+ '}',
2309
+ '',
2310
+ ].join('\n'), 'Lib_Utility');
2311
+ strictEqual(sectionMap.get(1), 'Lib_Utility_GetCurrentTimestamp');
2312
+ return;
2313
+ });
2314
+ it('EC3: generic type parameters do not get their own chunks', () => {
2315
+ const sectionMap = buildSourceSectionMap('/fake/cli/foo.ts', 'function getItems<T>(): T[] { return []; }\n', 'Cli_Foo');
2316
+ strictEqual(sectionMap.get(1), 'Cli_Foo_GetItems');
2317
+ return;
2318
+ });
2319
+ it('EC5: tuple types are not subject to E3 (only X[] form)', () => {
2320
+ const lines = ['export type Cli_Foo_Run_Pair = [string, number];'];
2321
+ const arrays = extractArrayTypes(lines);
2322
+ strictEqual(arrays.length, 0);
2323
+ return;
2324
+ });
2325
+ it('EC6: Map/Set/Promise generic collection types not subject to E3', () => {
2326
+ const lines = [
2327
+ 'export type Cli_Foo_Run_Cache = Map<string, Cli_Foo_Run_Item>;',
2328
+ 'export type Cli_Foo_Run_Promise = Promise<Cli_Foo_Run_Item>;',
2329
+ ];
2330
+ const arrays = extractArrayTypes(lines);
2331
+ strictEqual(arrays.length, 0);
2332
+ return;
2333
+ });
2334
+ it('EC7: multi-dimensional arrays X[][] not checked by E3', () => {
2335
+ const lines = ['export type Cli_Foo_Run_Matrix = Cli_Foo_Run_Cell[][];'];
2336
+ const arrays = extractArrayTypes(lines);
2337
+ strictEqual(arrays.length, 0);
2338
+ return;
2339
+ });
2340
+ it('EC8: type-level operations (extends/conditional) inside body do not add chunks', () => {
2341
+ const sectionMap = buildSourceSectionMap('/fake/lib/foo.ts', [
2342
+ 'function bar() {',
2343
+ ' type Conditional = string extends string ? number : never;',
2344
+ '}',
2345
+ '',
2346
+ ].join('\n'), 'Lib_Foo');
2347
+ strictEqual(sectionMap.get(1), 'Lib_Foo_Bar');
2348
+ return;
2349
+ });
2350
+ it('EC9: anonymous class expression in const uses const name as chunk (Mode 2: closes prior gap)', () => {
2351
+ const sectionMap = buildSourceSectionMap('/fake/lib/foo.ts', 'const Wrapper = class { run() {} };\n', 'Lib_Foo');
2352
+ strictEqual(sectionMap.get(1), 'Lib_Foo_Wrapper_Run');
2353
+ return;
2354
+ });
2355
+ return;
2356
+ });
2357
+ describe('Edge cases EC11-EC20', () => {
2358
+ it('EC11: default export class adds chunk like regular class', () => {
2359
+ const sectionMap = buildSourceSectionMap('/fake/cli/foo.ts', [
2360
+ 'export default class Runner {',
2361
+ ' bar(): void {}',
2362
+ '}',
2363
+ '',
2364
+ ].join('\n'), 'Cli_Foo');
2365
+ strictEqual(sectionMap.get(2), 'Cli_Foo_Runner_Bar');
2366
+ return;
2367
+ });
2368
+ it('EC12: this parameters do not pollute body var rule (skipped from extractFunctionParams)', () => {
2369
+ const params = extractFunctionParams('/fake/lib/foo.ts', 'function bar(this: SomeType, x: Lib_Foo_Bar_X): void {}\n');
2370
+ const nonThisParams = params.filter((param) => param['paramName'] !== 'this');
2371
+ ok(nonThisParams.length >= 1);
2372
+ return;
2373
+ });
2374
+ it('EC13: destructured parameter does not get its own type extracted via extractBodyDeclarations', () => {
2375
+ const lines = [' const { foo } = options;'];
2376
+ const decls = extractBodyDeclarations(lines);
2377
+ strictEqual(decls.length, 0);
2378
+ return;
2379
+ });
2380
+ it('EC14: parameter property (TS shorthand) is treated as a normal constructor param', () => {
2381
+ const params = extractFunctionParams('/fake/cli/foo.ts', [
2382
+ 'class Runner {',
2383
+ ' constructor(public name: Cli_Foo_Runner_Constructor_Name) {}',
2384
+ '}',
2385
+ '',
2386
+ ].join('\n'));
2387
+ strictEqual((params[0] !== undefined) ? params[0]['paramName'] : undefined, 'name');
2388
+ return;
2389
+ });
2390
+ it('EC15: index signature is not detected as a regular property', () => {
2391
+ const lines = [
2392
+ 'export type Cli_Foo_Run_Map = {',
2393
+ ' [key: string]: Cli_Foo_Run_Item;',
2394
+ '};',
2395
+ ];
2396
+ const objectTypes = extractObjectTypes(lines, 'Cli_Foo');
2397
+ strictEqual((objectTypes[0] !== undefined) ? objectTypes[0]['properties'].length : undefined, 0);
2398
+ return;
2399
+ });
2400
+ it('[gap] EC16: optional/readonly modifiers -- extractObjectTypes property regex requires bare `key: Type;` form, so `readonly id: ...` is silently skipped', () => {
2401
+ const lines = [
2402
+ 'export type Cli_Foo_Run_Result = {',
2403
+ ' readonly id: Cli_Foo_Run_Result_Id;',
2404
+ ' status: Cli_Foo_Run_Result_Status;',
2405
+ '};',
2406
+ ];
2407
+ const objectTypes = extractObjectTypes(lines, 'Cli_Foo');
2408
+ strictEqual((objectTypes[0] !== undefined) ? objectTypes[0]['properties'].length : undefined, 1);
2409
+ strictEqual((objectTypes[0] !== undefined && objectTypes[0]['properties'][0] !== undefined) ? objectTypes[0]['properties'][0]['key'] : undefined, 'status');
2410
+ return;
2411
+ });
2412
+ it('EC17: underscore-prefixed var name strips underscore for leaf comparison', () => {
2413
+ strictEqual(stripUnderscorePrefix('_prev'), 'prev');
2414
+ strictEqual(validateLeaf('_prev', 'Cli_Foo_Run_Prev', 'Cli_Foo_Run', 'Cli_Foo'), null);
2415
+ return;
2416
+ });
2417
+ it('EC18: single-character var name title-cases the single character', () => {
2418
+ strictEqual(validateLeaf('i', 'Cli_Foo_Run_I', 'Cli_Foo_Run', 'Cli_Foo'), null);
2419
+ return;
2420
+ });
2421
+ it('EC19: dotted filename like foo.spec fails segment regex', () => {
2422
+ const pattern = new RegExp('^[a-z][a-z0-9-]*$');
2423
+ strictEqual(pattern.test('foo.spec'), false);
2424
+ strictEqual(pattern.test('foo.bar'), false);
2425
+ return;
2426
+ });
2427
+ it('EC20: filename starting with digit fails segment regex', () => {
2428
+ const pattern = new RegExp('^[a-z][a-z0-9-]*$');
2429
+ strictEqual(pattern.test('123foo'), false);
2430
+ return;
2431
+ });
2432
+ return;
2433
+ });
2434
+ describe('Edge cases EC21-EC30', () => {
2435
+ it('EC21: filename with underscore/space/special-char fails segment regex', () => {
2436
+ const pattern = new RegExp('^[a-z][a-z0-9-]*$');
2437
+ strictEqual(pattern.test('foo_bar'), false);
2438
+ strictEqual(pattern.test('foo bar'), false);
2439
+ strictEqual(pattern.test('foo$bar'), false);
2440
+ return;
2441
+ });
2442
+ it('EC22: file at typeRoot produces single-chunk classPrefix', () => {
2443
+ const prefix = deriveClassPrefix(resolve(getPackageRoot(), 'src/main.ts'));
2444
+ strictEqual(prefix, 'Main');
2445
+ return;
2446
+ });
2447
+ it('EC23: template string in (string, fn) arg[0] does NOT add chunk', () => {
2448
+ const interp = [
2449
+ '$',
2450
+ '{',
2451
+ '1}',
2452
+ ].join('');
2453
+ const sourceContent = [
2454
+ `describe(\`Foo ${interp}\`, () => {`,
2455
+ ' const x: number = 1;',
2456
+ '});',
2457
+ '',
2458
+ ].join('\n');
2459
+ const sectionMap = buildSourceSectionMap('/fake/tests/foo.test.ts', sourceContent, 'Tests_Foo');
2460
+ strictEqual(sectionMap.get(2), 'Tests_Foo');
2461
+ return;
2462
+ });
2463
+ it('EC24: async arrow function callback in (string, fn) is accepted', () => {
2464
+ const sectionMap = buildSourceSectionMap('/fake/tests/foo.test.ts', [
2465
+ 'describe(\'Foo\', async () => {',
2466
+ ' const x: number = 1;',
2467
+ '});',
2468
+ '',
2469
+ ].join('\n'), 'Tests_Foo');
2470
+ strictEqual(sectionMap.get(2), 'Tests_Foo_Foo');
2471
+ return;
2472
+ });
2473
+ it('EC24b: async function expression callback in (string, fn) is accepted', () => {
2474
+ const sectionMap = buildSourceSectionMap('/fake/tests/foo.test.ts', [
2475
+ 'describe(\'Foo\', async function () {',
2476
+ ' const x: number = 1;',
2477
+ '});',
2478
+ '',
2479
+ ].join('\n'), 'Tests_Foo');
2480
+ strictEqual(sectionMap.get(2), 'Tests_Foo_Foo');
2481
+ return;
2482
+ });
2483
+ it('EC25: class getter adds chunk based on property name', () => {
2484
+ const sectionMap = buildSourceSectionMap('/fake/cli/foo.ts', [
2485
+ 'class Runner {',
2486
+ ' get bar(): number { return 1; }',
2487
+ '}',
2488
+ '',
2489
+ ].join('\n'), 'Cli_Foo');
2490
+ strictEqual(sectionMap.get(2), 'Cli_Foo_Runner_Bar');
2491
+ return;
2492
+ });
2493
+ it('EC25b: class setter adds chunk based on property name', () => {
2494
+ const sectionMap = buildSourceSectionMap('/fake/cli/foo.ts', [
2495
+ 'class Runner {',
2496
+ ' set bar(value: number) {}',
2497
+ '}',
2498
+ '',
2499
+ ].join('\n'), 'Cli_Foo');
2500
+ strictEqual(sectionMap.get(2), 'Cli_Foo_Runner_Bar');
2501
+ return;
2502
+ });
2503
+ it('EC26: static method adds chunk like an instance method', () => {
2504
+ const sectionMap = buildSourceSectionMap('/fake/cli/foo.ts', [
2505
+ 'class Runner {',
2506
+ ' static doThing(): void {}',
2507
+ '}',
2508
+ '',
2509
+ ].join('\n'), 'Cli_Foo');
2510
+ strictEqual(sectionMap.get(2), 'Cli_Foo_Runner_DoThing');
2511
+ return;
2512
+ });
2513
+ it('EC28: nested function declaration adds chunk under the outer function', () => {
2514
+ const sectionMap = buildSourceSectionMap('/fake/lib/foo.ts', [
2515
+ 'function processItems() {',
2516
+ ' function visit(node: any) {',
2517
+ ' const result: any = node;',
2518
+ ' }',
2519
+ '}',
2520
+ '',
2521
+ ].join('\n'), 'Lib_Foo');
2522
+ strictEqual(sectionMap.get(3), 'Lib_Foo_ProcessItems_Visit');
2523
+ return;
2524
+ });
2525
+ it('EC30: describe.skip(string, fn) adds chunk via generic rule', () => {
2526
+ const sectionMap = buildSourceSectionMap('/fake/tests/foo.test.ts', [
2527
+ 'describe.skip(\'Foo\', () => {',
2528
+ ' const x: number = 1;',
2529
+ '});',
2530
+ '',
2531
+ ].join('\n'), 'Tests_Foo');
2532
+ strictEqual(sectionMap.get(2), 'Tests_Foo_Foo');
2533
+ return;
2534
+ });
2535
+ it('EC30b: describe.only(string, fn) adds chunk via generic rule', () => {
2536
+ const sectionMap = buildSourceSectionMap('/fake/tests/foo.test.ts', [
2537
+ 'describe.only(\'Foo\', () => {',
2538
+ ' const x: number = 1;',
2539
+ '});',
2540
+ '',
2541
+ ].join('\n'), 'Tests_Foo');
2542
+ strictEqual(sectionMap.get(2), 'Tests_Foo_Foo');
2543
+ return;
2544
+ });
2545
+ return;
2546
+ });
2547
+ describe('Edge cases EC31-EC55', () => {
2548
+ it('EC31: primitive-like return types (void, never, etc.) pass validateLeaf at body var', () => {
2549
+ const result = validateLeaf('result', 'unknown', 'Cli_Foo_Run', 'Cli_Foo');
2550
+ strictEqual((result !== null) ? result['actualLeaf'] : undefined, 'unknown');
2551
+ return;
2552
+ });
2553
+ it('EC33: nested class inside method adds chunk under method', () => {
2554
+ const sectionMap = buildSourceSectionMap('/fake/cli/foo.ts', [
2555
+ 'class Outer {',
2556
+ ' run(): void {',
2557
+ ' class Inner {}',
2558
+ ' }',
2559
+ '}',
2560
+ '',
2561
+ ].join('\n'), 'Cli_Foo');
2562
+ strictEqual(sectionMap.get(3), 'Cli_Foo_Outer_Run_Inner');
2563
+ return;
2564
+ });
2565
+ it('EC34: vitest bench(string, fn) adds chunk via generic rule', () => {
2566
+ const sectionMap = buildSourceSectionMap('/fake/tests/foo.bench.ts', [
2567
+ 'bench(\'fast op\', () => {',
2568
+ ' const x: number = 1;',
2569
+ '});',
2570
+ '',
2571
+ ].join('\n'), 'Tests_Foo');
2572
+ strictEqual(sectionMap.get(2), 'Tests_Foo_FastOp');
2573
+ return;
2574
+ });
2575
+ it('EC35: rule 7.8 catches two body vars producing the same expected type name', () => {
2576
+ const violations = checkTypeNameUniqueness([
2577
+ {
2578
+ name: 'foo', typeName: 'Cli_X_Foo', lineNumber: 10,
2579
+ },
2580
+ {
2581
+ name: 'foo', typeName: 'Cli_X_Foo', lineNumber: 20,
2582
+ },
2583
+ ]);
2584
+ strictEqual(violations.length, 1);
2585
+ return;
2586
+ });
2587
+ it('EC37/EC42: JSX function component name == file name fires C2', () => {
2588
+ const identifiers = extractTopLevelIdentifiers('/fake/components/logo.tsx', 'export default function Logo(): null { return null; }\n');
2589
+ strictEqual((identifiers[0] !== undefined) ? identifiers[0]['name'] : undefined, 'Logo');
2590
+ strictEqual((identifiers[0] !== undefined) ? identifiers[0]['kind'] : undefined, 'function');
2591
+ return;
2592
+ });
2593
+ it('EC43: JSX class component name == file name fires C1', () => {
2594
+ const identifiers = extractTopLevelIdentifiers('/fake/components/logo.tsx', [
2595
+ 'export default class Logo {',
2596
+ ' render() { return null; }',
2597
+ '}',
2598
+ '',
2599
+ ].join('\n'));
2600
+ strictEqual((identifiers[0] !== undefined) ? identifiers[0]['name'] : undefined, 'Logo');
2601
+ strictEqual((identifiers[0] !== undefined) ? identifiers[0]['kind'] : undefined, 'class');
2602
+ return;
2603
+ });
2604
+ it('EC44: branded types follow standard naming', () => {
2605
+ const lines = ['export type Cli_Foo_UserId = string & { __brand: \'UserId\' };'];
2606
+ deepStrictEqual(extractTypeNames(lines), ['Cli_Foo_UserId']);
2607
+ return;
2608
+ });
2609
+ it('EC46: recursive type definition is detected as self-reference (no infinite loop)', () => {
2610
+ const refs = extractReferencedTypes('export type Cli_Foo_Node = { value: string; next: Cli_Foo_Node | null };', 'Cli_Foo');
2611
+ strictEqual(refs.length, 0);
2612
+ return;
2613
+ });
2614
+ it('EC47: enum declaration is not subject to type-naming rules (out of helper scope)', () => {
2615
+ const lines = ['export enum Cli_Foo_Run_Status { Pending, Done }'];
2616
+ deepStrictEqual(extractTypeNames(lines), []);
2617
+ return;
2618
+ });
2619
+ it('[gap] EC52: same-line multi-declaration -- extractBodyDeclarations regex matches one declarator per line, so only the first is captured', () => {
2620
+ const lines = [' const a: A = 1, b: B = 2;'];
2621
+ const decls = extractBodyDeclarations(lines);
2622
+ strictEqual(decls.length, 1);
2623
+ return;
2624
+ });
2625
+ it('EC54: empty source file produces empty section map (just classPrefix at top-level lines)', () => {
2626
+ const sectionMap = buildSourceSectionMap('/fake/lib/empty.ts', 'export {};\n', 'Lib_Empty');
2627
+ strictEqual(sectionMap.get(1), 'Lib_Empty');
2628
+ return;
2629
+ });
2630
+ return;
2631
+ });
2632
+ describe('Rule 7.1 integration', () => {
2633
+ it('passes when leaf matches sourceSection_titleVar', () => {
2634
+ strictEqual(validateLeaf('items', 'Cli_Foo_Run_Items', 'Cli_Foo_Run', 'Cli_Foo'), null);
2635
+ return;
2636
+ });
2637
+ it('passes class-prefix passthrough form (skip method chunk)', () => {
2638
+ strictEqual(validateLeaf('items', 'Cli_Foo_Items', 'Cli_Foo_Run', 'Cli_Foo'), null);
2639
+ return;
2640
+ });
2641
+ it('fails when leaf differs from var name', () => {
2642
+ const result = validateLeaf('items', 'Cli_Foo_Run_Things', 'Cli_Foo_Run', 'Cli_Foo');
2643
+ deepStrictEqual(result, {
2644
+ actualLeaf: 'Things', expectedLeaf: 'Items',
2645
+ });
2646
+ return;
2647
+ });
2648
+ it('integrates with extractBodyDeclarations + buildSourceSectionMap', () => {
2649
+ const sourceContent = [
2650
+ 'class Runner {',
2651
+ ' bar() {',
2652
+ ' const items: Cli_Foo_Runner_Bar_Items = [];',
2653
+ ' }',
2654
+ '}',
2655
+ '',
2656
+ ].join('\n');
2657
+ const sectionMap = buildSourceSectionMap('/fake/cli/foo.ts', sourceContent, 'Cli_Foo');
2658
+ const decls = extractBodyDeclarations(sourceContent.split('\n'));
2659
+ strictEqual(decls.length, 1);
2660
+ const firstDecl = decls[0];
2661
+ const sourceSection = sectionMap.get((firstDecl !== undefined) ? firstDecl['lineNumber'] : 0) ?? '';
2662
+ strictEqual(sourceSection, 'Cli_Foo_Runner_Bar');
2663
+ strictEqual(validateLeaf((firstDecl !== undefined) ? firstDecl['varName'] : '', (firstDecl !== undefined) ? firstDecl['typeName'] : '', sourceSection, 'Cli_Foo'), null);
2664
+ return;
2665
+ });
2666
+ return;
2667
+ });
2668
+ describe('Rule E1/E2 integration', () => {
2669
+ it('E1: property type starts with parent type name (passes)', () => {
2670
+ const lines = [
2671
+ 'export type Cli_Foo_Run_Result_Status = string;',
2672
+ 'export type Cli_Foo_Run_Result = {',
2673
+ ' status: Cli_Foo_Run_Result_Status;',
2674
+ '};',
2675
+ ];
2676
+ const objectTypes = extractObjectTypes(lines, 'Cli_Foo');
2677
+ const result = objectTypes.find((objectType) => objectType['name'] === 'Cli_Foo_Run_Result');
2678
+ strictEqual((result !== undefined && result['properties'][0] !== undefined) ? result['properties'][0]['valueType'].startsWith('Cli_Foo_Run_Result') : false, true);
2679
+ return;
2680
+ });
2681
+ it('E1: property type does not start with parent type name (fails)', () => {
2682
+ const lines = [
2683
+ 'export type Cli_Foo_Run_Status = string;',
2684
+ 'export type Cli_Foo_Run_Result = {',
2685
+ ' status: Cli_Foo_Run_Status;',
2686
+ '};',
2687
+ ];
2688
+ const objectTypes = extractObjectTypes(lines, 'Cli_Foo');
2689
+ const result = objectTypes.find((objectType) => objectType['name'] === 'Cli_Foo_Run_Result');
2690
+ strictEqual((result !== undefined && result['properties'][0] !== undefined) ? result['properties'][0]['valueType'].startsWith('Cli_Foo_Run_Result') : false, false);
2691
+ return;
2692
+ });
2693
+ it('E2: property type defined before parent (passes)', () => {
2694
+ const lines = [
2695
+ 'export type Cli_Foo_Run_Result_Status = string;',
2696
+ 'export type Cli_Foo_Run_Result = {',
2697
+ ' status: Cli_Foo_Run_Result_Status;',
2698
+ '};',
2699
+ ];
2700
+ const objectTypes = extractObjectTypes(lines, 'Cli_Foo');
2701
+ const result = objectTypes.find((objectType) => objectType['name'] === 'Cli_Foo_Run_Result');
2702
+ const propertyTypeLine = (result !== undefined && result['properties'][0] !== undefined) ? result['properties'][0]['typeLineIndex'] : -1;
2703
+ const parentLine = (result !== undefined) ? result['lineIndex'] : -1;
2704
+ ok(propertyTypeLine < parentLine);
2705
+ return;
2706
+ });
2707
+ it('E2: property type defined after parent (fails)', () => {
2708
+ const lines = [
2709
+ 'export type Cli_Foo_Run_Result = {',
2710
+ ' status: Cli_Foo_Run_Result_Status;',
2711
+ '};',
2712
+ 'export type Cli_Foo_Run_Result_Status = string;',
2713
+ ];
2714
+ const objectTypes = extractObjectTypes(lines, 'Cli_Foo');
2715
+ const result = objectTypes.find((objectType) => objectType['name'] === 'Cli_Foo_Run_Result');
2716
+ const propertyTypeLine = (result !== undefined && result['properties'][0] !== undefined) ? result['properties'][0]['typeLineIndex'] : -1;
2717
+ const parentLine = (result !== undefined) ? result['lineIndex'] : -1;
2718
+ ok(propertyTypeLine > parentLine);
2719
+ return;
2720
+ });
2721
+ return;
2722
+ });
2723
+ describe('Section F coverage integration', () => {
2724
+ it('F1: same-section references are allowed', () => {
2725
+ const refs = extractReferencedTypes('export type Cli_Foo_Run_X = Cli_Foo_Run_Y;', 'Cli_Foo');
2726
+ deepStrictEqual(refs, ['Cli_Foo_Run_Y']);
2727
+ return;
2728
+ });
2729
+ it('F2: sections in alphabetical order check (compare strings directly)', () => {
2730
+ const sectionA = 'Cli_Foo_Bar';
2731
+ const sectionB = 'Cli_Foo_Foo';
2732
+ ok(sectionA < sectionB);
2733
+ return;
2734
+ });
2735
+ it('F4: within section, first-come-first-serve order via findFirstOccurrence', () => {
2736
+ const sourceLines = [
2737
+ 'class Runner {',
2738
+ ' bar() {',
2739
+ ' const items: Cli_Foo_Runner_Bar_Items = [];',
2740
+ ' const result: Cli_Foo_Runner_Bar_Result = items;',
2741
+ ' }',
2742
+ '}',
2743
+ ];
2744
+ const itemsLine = findFirstOccurrence(sourceLines, 'Cli_Foo_Runner_Bar_Items');
2745
+ const resultLine = findFirstOccurrence(sourceLines, 'Cli_Foo_Runner_Bar_Result');
2746
+ ok(itemsLine < resultLine);
2747
+ return;
2748
+ });
2749
+ it('F6 forward: every source section should have at least one matching .d.ts type', () => {
2750
+ const dtsLines = ['export type Cli_Foo_Run_X = string;'];
2751
+ const sourceSections = new Set(['Cli_Foo_Run']);
2752
+ const sections = buildDtsSections(dtsLines, sourceSections, 'Cli_Foo');
2753
+ strictEqual(sections.length, 1);
2754
+ strictEqual((sections[0] !== undefined) ? sections[0]['prefix'] : undefined, 'Cli_Foo_Run');
2755
+ return;
2756
+ });
2757
+ it('F6 reverse: orphan multi-chunk type without source section', () => {
2758
+ const dtsLines = ['export type Cli_Foo_NoSource_X = string;'];
2759
+ const sourceSections = new Set();
2760
+ const sections = buildDtsSections(dtsLines, sourceSections, 'Cli_Foo');
2761
+ strictEqual((sections[0] !== undefined) ? sections[0]['prefix'] : undefined, 'Cli_Foo');
2762
+ return;
2763
+ });
2764
+ return;
2765
+ });
2766
+ describe('Section G imports integration', () => {
2767
+ it('G1: extractImportedNames captures alphabetized inline imports', () => {
2768
+ const lines = ['import type { Apple, Banana, Cherry } from \'./fruits.d.ts\';'];
2769
+ const names = extractImportedNames(lines);
2770
+ ok(names.has('Apple'));
2771
+ ok(names.has('Banana'));
2772
+ ok(names.has('Cherry'));
2773
+ return;
2774
+ });
2775
+ it('G1: multi-line import block alphabetical order can be checked', () => {
2776
+ const specifiers = [
2777
+ 'Apple',
2778
+ 'Banana',
2779
+ 'Cherry',
2780
+ ];
2781
+ const sortedSpecifiers = [...specifiers].sort();
2782
+ deepStrictEqual(specifiers, sortedSpecifiers);
2783
+ return;
2784
+ });
2785
+ it('G1: detects out-of-order specifiers', () => {
2786
+ const specifiers = [
2787
+ 'Banana',
2788
+ 'Apple',
2789
+ 'Cherry',
2790
+ ];
2791
+ const sortedSpecifiers = [...specifiers].sort();
2792
+ ok(specifiers[0] !== sortedSpecifiers[0]);
2793
+ return;
2794
+ });
2795
+ return;
2796
+ });
2797
+ describe('end-to-end fixture pipeline', () => {
2798
+ it('catches the expected violations across rules 7.1 / 7.2 / 7.3 / 7.4 / 7.5 in a single fixture', () => {
2799
+ const sourceContent = [
2800
+ 'class Runner {',
2801
+ ' bar() {',
2802
+ ' const items: Cli_Foo_Wrong_Leaf = [];',
2803
+ ' const result: Cli_Foo_Bar_Result_Returns = [];',
2804
+ ' const data: Cli_Foo_Bar_Data = {};',
2805
+ ' items.filter((x: Cli_Foo_Item) => x);',
2806
+ ' }',
2807
+ ' bad(): Cli_Foo_Runner_Bad_Result { return null; }',
2808
+ '}',
2809
+ '',
2810
+ ].join('\n');
2811
+ const dtsContent = [
2812
+ 'export type Cli_Foo_Wrong_Leaf = unknown;',
2813
+ 'export type Cli_Foo_Bar_Result_Returns = unknown;',
2814
+ 'export type Cli_Foo_Bar_Data = Lib_Utility_X;',
2815
+ 'export type Cli_Foo_Item = unknown;',
2816
+ '',
2817
+ ].join('\n');
2818
+ const violations = runRulePipeline('/fake/cli/foo.ts', sourceContent, dtsContent, 'Cli_Foo');
2819
+ ok(violations.some((violation) => violation.startsWith('7.1:')), `7.1 expected, got: ${violations.join(' | ')}`);
2820
+ ok(violations.some((violation) => violation.startsWith('7.2-alias:')), `7.2-alias expected, got: ${violations.join(' | ')}`);
2821
+ ok(violations.some((violation) => violation.startsWith('7.3:')), `7.3 expected, got: ${violations.join(' | ')}`);
2822
+ ok(violations.some((violation) => violation.startsWith('7.4:')), `7.4 expected, got: ${violations.join(' | ')}`);
2823
+ ok(violations.some((violation) => violation.startsWith('7.5/6/7:')), `7.5/6/7 expected, got: ${violations.join(' | ')}`);
2824
+ return;
2825
+ });
2826
+ it('clean fixture (no violations) produces empty violation list', () => {
2827
+ const sourceContent = [
2828
+ 'class Runner {',
2829
+ ' bar(): Cli_Foo_Runner_Bar_Returns {',
2830
+ ' const items: Cli_Foo_Runner_Bar_Items = [];',
2831
+ ' return items;',
2832
+ ' }',
2833
+ '}',
2834
+ '',
2835
+ ].join('\n');
2836
+ const dtsContent = [
2837
+ 'export type Cli_Foo_Runner_Bar_Items = unknown[];',
2838
+ 'export type Cli_Foo_Runner_Bar_Returns = Cli_Foo_Runner_Bar_Items;',
2839
+ '',
2840
+ ].join('\n');
2841
+ const violations = runRulePipeline('/fake/cli/foo.ts', sourceContent, dtsContent, 'Cli_Foo');
2842
+ strictEqual(violations.length, 0, violations.join(' | '));
2843
+ return;
2844
+ });
2845
+ return;
2846
+ });
2847
+ export async function discoverSourceFiles() {
2848
+ const patterns = testConfig['typeRoots'].map((typeRoot) => `${typeRoot}/**/*.ts`);
2849
+ const ignorePatterns = testConfig['typeRoots'].map((typeRoot) => `${typeRoot}/**/*.d.ts`);
2850
+ const matched = await glob(patterns, {
2851
+ cwd: getPackageRoot(),
2852
+ absolute: true,
2853
+ ignore: ignorePatterns,
2854
+ });
2855
+ return matched.sort();
2856
+ }
2857
+ export async function discoverTypeFiles() {
2858
+ const patterns = testConfig['typeRoots'].map((typeRoot) => `${typeRoot}/types/**/*.d.ts`);
2859
+ const matched = await glob(patterns, {
2860
+ cwd: getPackageRoot(),
2861
+ absolute: true,
2862
+ });
2863
+ return matched.sort();
2864
+ }
2865
+ export function deriveClassPrefix(filePath) {
2866
+ const currentDirectory = getPackageRoot();
2867
+ const relativePath = relative(currentDirectory, filePath);
2868
+ let relativeCleaned = relativePath;
2869
+ for (const typeRoot of testConfig['typeRoots']) {
2870
+ relativeCleaned = relativeCleaned.replace(`${typeRoot}/types/`, '');
2871
+ relativeCleaned = relativeCleaned.replace(`${typeRoot}/`, '');
2872
+ }
2873
+ const segments = relativeCleaned
2874
+ .replace('.d.ts', '')
2875
+ .replace('.ts', '')
2876
+ .replace('.test', '')
2877
+ .split(sep)
2878
+ .join('/')
2879
+ .split('/');
2880
+ const camelCaseWordsPattern = new RegExp('[a-z]+|[A-Z]{2,}(?=[A-Z][a-z]|\\b|$)|[A-Z][a-z]*', 'g');
2881
+ return segments.map((segment) => {
2882
+ if (segment.includes('-') === false
2883
+ && segment.charAt(0) === segment.charAt(0).toUpperCase()
2884
+ && segment.length > 0) {
2885
+ const words = segment.match(camelCaseWordsPattern);
2886
+ if (words !== null) {
2887
+ return words.map((word) => {
2888
+ return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();
2889
+ }).join('');
2890
+ }
2891
+ }
2892
+ return segment.split('-').map((part) => {
2893
+ return part.charAt(0).toUpperCase() + part.slice(1);
2894
+ }).join('');
2895
+ }).join('_');
2896
+ }
2897
+ export function extractImportedNames(lines) {
2898
+ const importedNames = new Set();
2899
+ let inImportBlock = false;
2900
+ for (const line of lines) {
2901
+ if (line.startsWith('import type') === true) {
2902
+ inImportBlock = true;
2903
+ const inlineMatch = line.match(new RegExp('^import type \\{ (.+) \\} from'));
2904
+ if (inlineMatch !== null && inlineMatch[1] !== undefined) {
2905
+ const inlineMatchCapture = inlineMatch[1];
2906
+ const specifiers = inlineMatchCapture.split(',').map((specifier) => specifier.trim());
2907
+ for (const specifier of specifiers) {
2908
+ importedNames.add(specifier);
2909
+ }
2910
+ inImportBlock = false;
2911
+ }
2912
+ continue;
2913
+ }
2914
+ if (inImportBlock === true) {
2915
+ const trimmed = line.trim().replace(',', '');
2916
+ if (trimmed.startsWith('}') === true) {
2917
+ inImportBlock = false;
2918
+ }
2919
+ else if (trimmed !== '' && trimmed.startsWith('//') === false) {
2920
+ importedNames.add(trimmed);
2921
+ }
2922
+ }
2923
+ }
2924
+ return importedNames;
2925
+ }
2926
+ export function buildDtsSections(dtsLines, sourceSections, classPrefix) {
2927
+ const sortedSections = [...sourceSections].sort((sectionA, sectionB) => sectionB.length - sectionA.length);
2928
+ const sectionMap = new Map();
2929
+ const sectionOrder = [];
2930
+ for (const line of dtsLines) {
2931
+ if (line.startsWith('export type ') === false) {
2932
+ continue;
2933
+ }
2934
+ const match = line.match(new RegExp('^export type (\\w+)'));
2935
+ if (match === null || match[1] === undefined) {
2936
+ continue;
2937
+ }
2938
+ const typeName = match[1];
2939
+ let owningSection = '';
2940
+ for (const candidate of sortedSections) {
2941
+ if (typeName.startsWith(`${candidate}_`) === true) {
2942
+ owningSection = candidate;
2943
+ break;
2944
+ }
2945
+ }
2946
+ if (owningSection === '' && typeName.startsWith(`${classPrefix}_`) === true) {
2947
+ owningSection = classPrefix;
2948
+ }
2949
+ if (owningSection === '') {
2950
+ continue;
2951
+ }
2952
+ if (sectionMap.has(owningSection) === false) {
2953
+ sectionMap.set(owningSection, {
2954
+ prefix: owningSection,
2955
+ typeLines: [],
2956
+ });
2957
+ sectionOrder.push(owningSection);
2958
+ }
2959
+ const section = sectionMap.get(owningSection);
2960
+ section['typeLines'].push(line);
2961
+ }
2962
+ return sectionOrder.map((prefix) => sectionMap.get(prefix));
2963
+ }
2964
+ export function extractReferencedTypes(line, classPrefix) {
2965
+ const match = line.match(new RegExp('^export type (\\w+)'));
2966
+ if (match === null || match[1] === undefined) {
2967
+ return [];
2968
+ }
2969
+ const typeName = match[1];
2970
+ const rightSide = line.slice(line.indexOf('=') + 1);
2971
+ const referencedTypes = [];
2972
+ const typePattern = new RegExp(`${classPrefix}_\\w+`, 'g');
2973
+ let typeMatch = typePattern.exec(rightSide);
2974
+ while (typeMatch !== null) {
2975
+ const referencedType = typeMatch[0];
2976
+ if (referencedType !== typeName) {
2977
+ referencedTypes.push(referencedType);
2978
+ }
2979
+ typeMatch = typePattern.exec(rightSide);
2980
+ }
2981
+ return referencedTypes;
2982
+ }
2983
+ export function deriveSourcePath(dtsPath) {
2984
+ return dtsPath.replace('/types/', '/').replace('.d.ts', '.ts');
2985
+ }
2986
+ export async function fileExists(filePath) {
2987
+ try {
2988
+ await readFile(filePath, 'utf-8');
2989
+ return true;
2990
+ }
2991
+ catch {
2992
+ return false;
2993
+ }
2994
+ }
2995
+ export function getPackageRoot() {
2996
+ const currentFilePath = fileURLToPath(import.meta.url);
2997
+ const currentFileDirectory = dirname(currentFilePath);
2998
+ return resolve(currentFileDirectory, '..', '..');
2999
+ }
3000
+ export function extractTypeNames(typeLines) {
3001
+ const typeNames = [];
3002
+ for (const line of typeLines) {
3003
+ const match = line.match(new RegExp('^export type (\\w+)'));
3004
+ if (match !== null && match[1] !== undefined) {
3005
+ typeNames.push(match[1]);
3006
+ }
3007
+ }
3008
+ return typeNames;
3009
+ }
3010
+ export function findFirstOccurrence(sourceLines, typeName) {
3011
+ let inImportBlock = false;
3012
+ for (let i = 0; i < sourceLines.length; i += 1) {
3013
+ const line = sourceLines[i];
3014
+ if (line === undefined) {
3015
+ continue;
3016
+ }
3017
+ if (line.startsWith('import ') === true || line.startsWith('import type') === true) {
3018
+ inImportBlock = true;
3019
+ }
3020
+ if (inImportBlock === true) {
3021
+ if (line.includes(' from ') === true) {
3022
+ inImportBlock = false;
3023
+ }
467
3024
  continue;
468
3025
  }
469
3026
  const typeNamePattern = new RegExp(`\\b${typeName}\\b`);
@@ -473,7 +3030,7 @@ function findFirstOccurrence(sourceLines, typeName) {
473
3030
  }
474
3031
  return -1;
475
3032
  }
476
- function extractObjectTypes(lines, classPrefix) {
3033
+ export function extractObjectTypes(lines, classPrefix) {
477
3034
  const objectTypes = [];
478
3035
  const typeLineMap = new Map();
479
3036
  for (let i = 0; i < lines.length; i += 1) {
@@ -487,11 +3044,11 @@ function extractObjectTypes(lines, classPrefix) {
487
3044
  }
488
3045
  }
489
3046
  for (let i = 0; i < lines.length; i += 1) {
490
- const line = lines[i];
491
- if (line === undefined) {
3047
+ const line2 = lines[i];
3048
+ if (line2 === undefined) {
492
3049
  continue;
493
3050
  }
494
- const objectMatch = line.match(new RegExp(`^export type (${classPrefix}\\w+) = (?:Readonly<)?\\{$`));
3051
+ const objectMatch = line2.match(new RegExp(`^export type (${classPrefix}\\w+) = (?:Readonly<)?\\{$`));
495
3052
  if (objectMatch === null || objectMatch[1] === undefined) {
496
3053
  continue;
497
3054
  }
@@ -530,35 +3087,499 @@ function extractObjectTypes(lines, classPrefix) {
530
3087
  }
531
3088
  return objectTypes;
532
3089
  }
533
- function extractSourceSections(lines) {
534
- const sections = [];
535
- let nextIsSummary = false;
536
- for (const line of lines) {
537
- if (line.trim() === '/**') {
538
- nextIsSummary = true;
3090
+ const sourceFileCache = new Map();
3091
+ export function parseSourceFile(filePath, content) {
3092
+ const cached = sourceFileCache.get(filePath);
3093
+ if (cached !== undefined && cached['content'] === content) {
3094
+ return cached['sourceFile'];
3095
+ }
3096
+ const sourceFile = createSourceFile(filePath, content, ScriptTarget.Latest, true);
3097
+ sourceFileCache.set(filePath, {
3098
+ content, sourceFile,
3099
+ });
3100
+ return sourceFile;
3101
+ }
3102
+ export function extractFunctionParams(filePath, content) {
3103
+ const sourceFile = parseSourceFile(filePath, content);
3104
+ const params = [];
3105
+ function visit(node) {
3106
+ let parameterList = undefined;
3107
+ if (isFunctionDeclaration(node) === true
3108
+ || isMethodDeclaration(node) === true
3109
+ || isConstructorDeclaration(node) === true) {
3110
+ parameterList = node['parameters'];
3111
+ }
3112
+ else if (isVariableStatement(node) === true) {
3113
+ for (const decl of node.declarationList.declarations) {
3114
+ if (decl.initializer !== undefined
3115
+ && (isArrowFunction(decl.initializer) === true
3116
+ || isFunctionExpression(decl.initializer) === true)) {
3117
+ parameterList = decl.initializer.parameters;
3118
+ }
3119
+ }
3120
+ }
3121
+ if (parameterList !== undefined) {
3122
+ for (const param of parameterList) {
3123
+ const paramNode = param;
3124
+ if (paramNode['name'] !== undefined
3125
+ && isIdentifier(paramNode['name']) === true
3126
+ && paramNode['type'] !== undefined
3127
+ && isTypeReferenceNode(paramNode['type']) === true
3128
+ && isIdentifier(paramNode['type']['typeName']) === true) {
3129
+ const lineNumber = sourceFile.getLineAndCharacterOfPosition((param).getStart()).line + 1;
3130
+ const paramRecord = {
3131
+ paramName: paramNode['name']['text'],
3132
+ typeName: paramNode['type']['typeName']['text'],
3133
+ lineNumber,
3134
+ };
3135
+ params.push(paramRecord);
3136
+ }
3137
+ }
3138
+ }
3139
+ forEachChild(node, visit);
3140
+ return;
3141
+ }
3142
+ forEachChild(sourceFile, visit);
3143
+ return params;
3144
+ }
3145
+ export function extractBodyDeclarations(lines) {
3146
+ const declarations = [];
3147
+ for (let i = 0; i < lines.length; i += 1) {
3148
+ const line = lines[i];
3149
+ if (line === undefined) {
539
3150
  continue;
540
3151
  }
541
- if (nextIsSummary === true) {
542
- nextIsSummary = false;
543
- const sectionComment = line.match(new RegExp('^\\s*\\* (.+)\\.$'));
544
- if (sectionComment !== null
545
- && sectionComment[1] !== undefined
546
- && line.includes('@') === false
547
- && sectionComment[1].includes(' - ') === true) {
548
- const rawPrefix = sectionComment[1];
549
- const segments = rawPrefix.split(' - ');
550
- const methodName = segments.map((segment) => {
551
- return segment.split(new RegExp('[\\s.]+', 'g')).map((word) => {
552
- return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();
553
- }).join('');
554
- }).join('');
555
- sections.push({
556
- prefix: methodName,
557
- typeLines: [],
558
- });
3152
+ const match = line.match(new RegExp('^\\s*(const|let)\\s+(\\w+):\\s+(\\w+)\\s*='));
3153
+ if (match !== null
3154
+ && match[1] !== undefined
3155
+ && match[2] !== undefined
3156
+ && match[3] !== undefined) {
3157
+ const declaration = {
3158
+ keyword: match[1],
3159
+ varName: match[2],
3160
+ typeName: match[3],
3161
+ lineNumber: i + 1,
3162
+ };
3163
+ declarations.push(declaration);
3164
+ }
3165
+ }
3166
+ return declarations;
3167
+ }
3168
+ export function extractTopLevelIdentifiers(filePath, content) {
3169
+ const sourceFile = parseSourceFile(filePath, content);
3170
+ const identifiers = [];
3171
+ function getLine(node) {
3172
+ return sourceFile.getLineAndCharacterOfPosition(node.getStart()).line + 1;
3173
+ }
3174
+ forEachChild(sourceFile, (node) => {
3175
+ if (isClassDeclaration(node) === true && node.name !== undefined) {
3176
+ const identifier = {
3177
+ name: node.name.text,
3178
+ kind: 'class',
3179
+ lineNumber: getLine(node),
3180
+ };
3181
+ identifiers.push(identifier);
3182
+ return;
3183
+ }
3184
+ if (isFunctionDeclaration(node) === true && node.name !== undefined) {
3185
+ const identifier2 = {
3186
+ name: node.name.text,
3187
+ kind: 'function',
3188
+ lineNumber: getLine(node),
3189
+ };
3190
+ identifiers.push(identifier2);
3191
+ return;
3192
+ }
3193
+ if (isVariableStatement(node) === true) {
3194
+ for (const decl of node.declarationList.declarations) {
3195
+ if (decl.name !== undefined
3196
+ && isIdentifier(decl.name) === true
3197
+ && decl.initializer !== undefined
3198
+ && (isArrowFunction(decl.initializer) === true
3199
+ || isFunctionExpression(decl.initializer) === true
3200
+ || isClassExpression(decl.initializer) === true)) {
3201
+ const identifier3 = {
3202
+ name: decl.name.text,
3203
+ kind: 'const',
3204
+ lineNumber: getLine(decl),
3205
+ };
3206
+ identifiers.push(identifier3);
3207
+ }
3208
+ }
3209
+ }
3210
+ return;
3211
+ });
3212
+ return identifiers;
3213
+ }
3214
+ export function buildSourceSectionMap(filePath, content, classPrefix) {
3215
+ const sourceFile = parseSourceFile(filePath, content);
3216
+ const sectionMap = new Map();
3217
+ const maxDepth = 5000;
3218
+ function getLine(node) {
3219
+ return sourceFile.getLineAndCharacterOfPosition(node.getStart()).line + 1;
3220
+ }
3221
+ function pascalCase(name) {
3222
+ return name.charAt(0).toUpperCase() + name.slice(1);
3223
+ }
3224
+ let currentDepth = 0;
3225
+ function tagAllChildren(node, section) {
3226
+ if (currentDepth >= maxDepth) {
3227
+ return;
3228
+ }
3229
+ currentDepth += 1;
3230
+ forEachChild(node, (child) => visit(child, section));
3231
+ currentDepth -= 1;
3232
+ return;
3233
+ }
3234
+ function visit(node, section) {
3235
+ if (isClassDeclaration(node) === true && node.name !== undefined) {
3236
+ const newSection = `${section}_${pascalCase(node.name.text)}`;
3237
+ sectionMap.set(getLine(node), newSection);
3238
+ tagAllChildren(node, newSection);
3239
+ return;
3240
+ }
3241
+ const accessor = node;
3242
+ if ((isMethodDeclaration(node) === true
3243
+ || isGetAccessorDeclaration(node) === true
3244
+ || isSetAccessorDeclaration(node) === true)
3245
+ && accessor.name !== undefined
3246
+ && (isIdentifier(accessor.name) === true
3247
+ || isPrivateIdentifier(accessor.name) === true)) {
3248
+ const rawMethodName = accessor.name.text;
3249
+ const cleanMethodName = (rawMethodName.startsWith('#') === true) ? rawMethodName.slice(1) : rawMethodName;
3250
+ const newSection2 = `${section}_${pascalCase(cleanMethodName)}`;
3251
+ sectionMap.set(getLine(node), newSection2);
3252
+ tagAllChildren(node, newSection2);
3253
+ return;
3254
+ }
3255
+ if (isConstructorDeclaration(node) === true) {
3256
+ const newSection3 = `${section}_Constructor`;
3257
+ sectionMap.set(getLine(node), newSection3);
3258
+ tagAllChildren(node, newSection3);
3259
+ return;
3260
+ }
3261
+ if (isFunctionDeclaration(node) === true && node.name !== undefined) {
3262
+ const newSection4 = `${section}_${pascalCase(node.name.text)}`;
3263
+ sectionMap.set(getLine(node), newSection4);
3264
+ tagAllChildren(node, newSection4);
3265
+ return;
3266
+ }
3267
+ if (isVariableStatement(node) === true) {
3268
+ let hasInitializer = false;
3269
+ let subSection = section;
3270
+ for (const decl of node.declarationList.declarations) {
3271
+ if (decl.name !== undefined
3272
+ && isIdentifier(decl.name) === true
3273
+ && decl.initializer !== undefined
3274
+ && (isArrowFunction(decl.initializer) === true
3275
+ || isFunctionExpression(decl.initializer) === true
3276
+ || isClassExpression(decl.initializer) === true)) {
3277
+ hasInitializer = true;
3278
+ subSection = `${section}_${pascalCase(decl.name.text)}`;
3279
+ }
3280
+ }
3281
+ sectionMap.set(getLine(node), section);
3282
+ if (hasInitializer === true) {
3283
+ for (const decl of node.declarationList.declarations) {
3284
+ if (decl.initializer === undefined) {
3285
+ continue;
3286
+ }
3287
+ if (isArrowFunction(decl.initializer) === true || isFunctionExpression(decl.initializer) === true) {
3288
+ if (decl.initializer.body !== undefined) {
3289
+ tagAllChildren(decl.initializer.body, subSection);
3290
+ }
3291
+ }
3292
+ else if (isClassExpression(decl.initializer) === true) {
3293
+ tagAllChildren(decl.initializer, subSection);
3294
+ }
3295
+ }
3296
+ }
3297
+ else {
3298
+ tagAllChildren(node, section);
3299
+ }
3300
+ return;
3301
+ }
3302
+ if (isCallExpression(node) === true
3303
+ && node.arguments.length >= 2
3304
+ && node.arguments[0] !== undefined
3305
+ && isStringLiteral(node.arguments[0]) === true) {
3306
+ let callbackArg = undefined;
3307
+ for (let argIndex = 1; argIndex < node.arguments.length; argIndex += 1) {
3308
+ const arg = node.arguments[argIndex];
3309
+ if (arg !== undefined
3310
+ && (isArrowFunction(arg) === true
3311
+ || isFunctionExpression(arg) === true)) {
3312
+ callbackArg = arg;
3313
+ break;
3314
+ }
3315
+ }
3316
+ if (callbackArg !== undefined) {
3317
+ const stringArg = node.arguments[0];
3318
+ const chunk = parseDescribeString(stringArg.text);
3319
+ if (chunk !== '') {
3320
+ const newSection5 = `${section}_${chunk}`;
3321
+ sectionMap.set(getLine(node), section);
3322
+ tagAllChildren(callbackArg, newSection5);
3323
+ return;
3324
+ }
3325
+ }
3326
+ }
3327
+ sectionMap.set(getLine(node), section);
3328
+ tagAllChildren(node, section);
3329
+ return;
3330
+ }
3331
+ forEachChild(sourceFile, (child) => visit(child, classPrefix));
3332
+ return sectionMap;
3333
+ }
3334
+ export function parseDescribeString(input) {
3335
+ const pieces = input
3336
+ .split(new RegExp('[^A-Za-z0-9]+'))
3337
+ .filter((piece) => piece.length > 0)
3338
+ .map((piece) => piece.charAt(0).toUpperCase() + piece.slice(1));
3339
+ return pieces.join('');
3340
+ }
3341
+ export function stripUnderscorePrefix(input) {
3342
+ if (input.startsWith('_') === true) {
3343
+ return input.slice(1);
3344
+ }
3345
+ return input;
3346
+ }
3347
+ export function checkTypeNameUniqueness(declarations) {
3348
+ const violations = [];
3349
+ const seen = new Map();
3350
+ for (const declaration of declarations) {
3351
+ const existing = seen.get(declaration['typeName']);
3352
+ if (existing !== undefined) {
3353
+ const violation = `Two declarations would produce the same type name '${declaration['typeName']}'. First: line ${existing['lineNumber']} ('${existing['name']}'); duplicate: line ${declaration['lineNumber']} ('${declaration['name']}'). Rename one of the declarations so the type names differ.`;
3354
+ violations.push(violation);
3355
+ }
3356
+ else {
3357
+ seen.set(declaration['typeName'], {
3358
+ name: declaration['name'],
3359
+ lineNumber: declaration['lineNumber'],
3360
+ });
3361
+ }
3362
+ }
3363
+ return violations;
3364
+ }
3365
+ export function detectInlineTypedCallbacks(filePath, content) {
3366
+ const sourceFile = parseSourceFile(filePath, content);
3367
+ const callbacks = [];
3368
+ function visit(node) {
3369
+ if ((isArrowFunction(node) === true
3370
+ || isFunctionExpression(node) === true)
3371
+ && node.parent !== undefined) {
3372
+ let isFunctionTypedConst = false;
3373
+ let walker = node.parent;
3374
+ while (walker !== undefined) {
3375
+ if (isVariableStatement(walker) === true) {
3376
+ isFunctionTypedConst = true;
3377
+ break;
3378
+ }
3379
+ if (walker['kind'] !== undefined
3380
+ && (isCallExpression(walker) === true
3381
+ || isArrowFunction(walker) === true
3382
+ || isFunctionExpression(walker) === true)) {
3383
+ break;
3384
+ }
3385
+ walker = walker['parent'];
3386
+ }
3387
+ if (isFunctionTypedConst === false) {
3388
+ for (const param of node.parameters) {
3389
+ const paramNode = param;
3390
+ if (paramNode['name'] !== undefined
3391
+ && isIdentifier(paramNode['name']) === true
3392
+ && paramNode['type'] !== undefined
3393
+ && isTypeReferenceNode(paramNode['type']) === true
3394
+ && isIdentifier(paramNode['type']['typeName']) === true) {
3395
+ const lineNumber = sourceFile.getLineAndCharacterOfPosition(param.getStart()).line + 1;
3396
+ const callback = {
3397
+ paramName: paramNode['name']['text'],
3398
+ typeName: paramNode['type']['typeName']['text'],
3399
+ lineNumber,
3400
+ };
3401
+ callbacks.push(callback);
3402
+ }
3403
+ }
3404
+ }
3405
+ }
3406
+ forEachChild(node, visit);
3407
+ return;
3408
+ }
3409
+ forEachChild(sourceFile, visit);
3410
+ return callbacks;
3411
+ }
3412
+ export function extractArrayTypes(lines) {
3413
+ const arrayTypes = [];
3414
+ for (let i = 0; i < lines.length; i += 1) {
3415
+ const line = lines[i];
3416
+ if (line === undefined) {
3417
+ continue;
3418
+ }
3419
+ const match = line.match(new RegExp('^export type (\\w+) = (\\w+)\\[\\];?$'));
3420
+ if (match !== null
3421
+ && match[1] !== undefined
3422
+ && match[2] !== undefined) {
3423
+ const arrayType = {
3424
+ arrayTypeName: match[1],
3425
+ elementTypeName: match[2],
3426
+ lineIndex: i,
3427
+ };
3428
+ arrayTypes.push(arrayType);
3429
+ }
3430
+ }
3431
+ return arrayTypes;
3432
+ }
3433
+ export function extractFunctionReturns(filePath, content) {
3434
+ const sourceFile = parseSourceFile(filePath, content);
3435
+ const returnRecords = [];
3436
+ function visit(node) {
3437
+ if (isFunctionDeclaration(node) === true
3438
+ || isMethodDeclaration(node) === true
3439
+ || isConstructorDeclaration(node) === true) {
3440
+ const fnNode = node;
3441
+ const typeNode = fnNode['type'];
3442
+ if (typeNode !== undefined) {
3443
+ let returnType = '';
3444
+ let typeGuardFlag = false;
3445
+ if (isTypePredicateNode(typeNode) === true) {
3446
+ typeGuardFlag = true;
3447
+ const predicateNode = typeNode;
3448
+ if (predicateNode['type'] !== undefined
3449
+ && isTypeReferenceNode(predicateNode['type']) === true
3450
+ && isIdentifier(predicateNode['type']['typeName']) === true) {
3451
+ returnType = predicateNode['type']['typeName']['text'];
3452
+ }
3453
+ }
3454
+ else if (isTypeReferenceNode(typeNode) === true && isIdentifier(typeNode['typeName']) === true) {
3455
+ returnType = typeNode['typeName']['text'];
3456
+ }
3457
+ if (returnType !== '') {
3458
+ const lineNumber = sourceFile.getLineAndCharacterOfPosition(node.getStart()).line + 1;
3459
+ const returnRecord = {
3460
+ returnType,
3461
+ isTypeGuard: typeGuardFlag,
3462
+ lineNumber,
3463
+ };
3464
+ returnRecords.push(returnRecord);
3465
+ }
559
3466
  }
560
3467
  }
3468
+ forEachChild(node, visit);
3469
+ return;
3470
+ }
3471
+ forEachChild(sourceFile, visit);
3472
+ return returnRecords;
3473
+ }
3474
+ export function isAliasToForeignType(typeName, dtsContent, classPrefix) {
3475
+ const escapedTypeName = typeName.replace(new RegExp('[.*+?^${}()|[\\]\\\\]', 'g'), '\\$&');
3476
+ const pattern = new RegExp(`^export type ${escapedTypeName}\\s*=\\s*([^;]+);`, 'm');
3477
+ const match = dtsContent.match(pattern);
3478
+ if (match === null || match[1] === undefined) {
3479
+ return false;
3480
+ }
3481
+ let rhs = match[1].trim();
3482
+ rhs = rhs.replace(new RegExp('<[^>]*>', 'g'), '');
3483
+ rhs = rhs.replace(new RegExp('\\[\\]', 'g'), '');
3484
+ if (new RegExp('[|&{}();,]').test(rhs) === true) {
3485
+ return false;
3486
+ }
3487
+ const typeMatch = rhs.trim().match(new RegExp('^([A-Z][A-Za-z0-9_]*)$'));
3488
+ if (typeMatch === null || typeMatch[1] === undefined) {
3489
+ return false;
3490
+ }
3491
+ const leftmostType = typeMatch[1];
3492
+ if (leftmostType.includes('_') === false) {
3493
+ return false;
3494
+ }
3495
+ if (leftmostType.startsWith(`${classPrefix}_`) === true) {
3496
+ return false;
3497
+ }
3498
+ return true;
3499
+ }
3500
+ export function isLocallyDefined(typeName, dtsContent) {
3501
+ const escapedTypeName = typeName.replace(new RegExp('[.*+?^${}()|[\\]\\\\]', 'g'), '\\$&');
3502
+ const pattern = new RegExp(`^export type ${escapedTypeName}\\b`, 'm');
3503
+ return pattern.test(dtsContent);
3504
+ }
3505
+ export function isReservedSuffix(typeName) {
3506
+ return (typeName.endsWith('_Returns') === true
3507
+ || typeName.endsWith('_TypeGuard') === true
3508
+ || typeName.endsWith('_Return') === true
3509
+ || typeName.endsWith('Returns') === true
3510
+ || typeName.endsWith('TypeGuard') === true
3511
+ || typeName.endsWith('Return') === true);
3512
+ }
3513
+ export function validateLeaf(varName, typeName, sourceSection, classPrefix) {
3514
+ const stripped = stripUnderscorePrefix(varName);
3515
+ const titleVar = stripped.charAt(0).toUpperCase() + stripped.slice(1);
3516
+ const expectedSection = `${sourceSection}_${titleVar}`;
3517
+ const expectedClass = `${classPrefix}_${titleVar}`;
3518
+ if (typeName === expectedSection || typeName === expectedClass) {
3519
+ return null;
3520
+ }
3521
+ let actualLeaf = typeName;
3522
+ if (typeName.startsWith(`${sourceSection}_`) === true) {
3523
+ actualLeaf = typeName.slice(sourceSection.length + 1);
3524
+ }
3525
+ else if (typeName.startsWith(`${classPrefix}_`) === true) {
3526
+ actualLeaf = typeName.slice(classPrefix.length + 1);
3527
+ }
3528
+ return {
3529
+ actualLeaf,
3530
+ expectedLeaf: titleVar,
3531
+ };
3532
+ }
3533
+ export function validateReturnType(returnType, typeGuardFlag) {
3534
+ if (returnType.endsWith('_Return') === true || returnType.endsWith('Return') === true) {
3535
+ return `Return type '${returnType}' uses banned singular 'Return' suffix; rename to use 'Returns' (plural).`;
3536
+ }
3537
+ if (typeGuardFlag === true) {
3538
+ if (returnType.endsWith('_TypeGuard') === false && returnType.endsWith('TypeGuard') === false) {
3539
+ return `Type-guard return type '${returnType}' must end in 'TypeGuard'.`;
3540
+ }
3541
+ }
3542
+ else if (returnType.endsWith('_Returns') === false && returnType.endsWith('Returns') === false) {
3543
+ if (returnType.endsWith('_TypeGuard') === true || returnType.endsWith('TypeGuard') === true) {
3544
+ return `Return type '${returnType}' ends in 'TypeGuard' but the function does not use 'value is T' form; either rename to '_Returns' or rewrite as a type guard.`;
3545
+ }
3546
+ return `Function return type '${returnType}' must end in 'Returns' (plural).`;
3547
+ }
3548
+ return null;
3549
+ }
3550
+ export function runRulePipeline(filePath, sourceContent, dtsContent, classPrefix) {
3551
+ const sectionMap = buildSourceSectionMap(filePath, sourceContent, classPrefix);
3552
+ const lines = sourceContent.split('\n');
3553
+ const declarations = extractBodyDeclarations(lines);
3554
+ const callbacks = detectInlineTypedCallbacks(filePath, sourceContent);
3555
+ const fnReturnRecords = extractFunctionReturns(filePath, sourceContent);
3556
+ const violations = [];
3557
+ for (const callback of callbacks) {
3558
+ violations.push(`7.4: ${callback['paramName']}: ${callback['typeName']}`);
3559
+ }
3560
+ for (const declaration of declarations) {
3561
+ const sourceSection = sectionMap.get(declaration['lineNumber']) ?? classPrefix;
3562
+ if (isReservedSuffix(declaration['typeName']) === true) {
3563
+ violations.push(`7.3: ${declaration['varName']}: ${declaration['typeName']}`);
3564
+ continue;
3565
+ }
3566
+ const leafResult = validateLeaf(declaration['varName'], declaration['typeName'], sourceSection, classPrefix);
3567
+ if (leafResult !== null) {
3568
+ violations.push(`7.1: ${declaration['varName']}: ${declaration['typeName']}`);
3569
+ }
3570
+ if (isLocallyDefined(declaration['typeName'], dtsContent) === false) {
3571
+ violations.push(`7.2-not-defined: ${declaration['typeName']}`);
3572
+ }
3573
+ else if (isAliasToForeignType(declaration['typeName'], dtsContent, classPrefix) === true) {
3574
+ violations.push(`7.2-alias: ${declaration['typeName']}`);
3575
+ }
3576
+ }
3577
+ for (const fnReturn of fnReturnRecords) {
3578
+ const reason = validateReturnType(fnReturn['returnType'], fnReturn['isTypeGuard']);
3579
+ if (reason !== null) {
3580
+ violations.push(`7.5/6/7: ${fnReturn['returnType']}`);
3581
+ }
561
3582
  }
562
- return sections;
3583
+ return violations;
563
3584
  }
564
3585
  //# sourceMappingURL=type-declarations.test.js.map