@limetech/kompendium 1.1.1

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 (348) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +313 -0
  3. package/dist/cjs/_commonjsHelpers-BJu3ubxk.js +13 -0
  4. package/dist/cjs/_commonjsHelpers-BJu3ubxk.js.map +1 -0
  5. package/dist/cjs/anchor-scroll-BmplAyR0.js +69 -0
  6. package/dist/cjs/anchor-scroll-BmplAyR0.js.map +1 -0
  7. package/dist/cjs/index-DYiJ6dQL.js +1866 -0
  8. package/dist/cjs/index-DYiJ6dQL.js.map +1 -0
  9. package/dist/cjs/index.cjs.js +3 -0
  10. package/dist/cjs/index.cjs.js.map +1 -0
  11. package/dist/cjs/kompendium-app.kompendium-darkmode-switch.kompendium-navigation.kompendium-search.stencil-route.stencil-route-switch.stencil-router.entry.cjs.js.map +1 -0
  12. package/dist/cjs/kompendium-app_7.cjs.entry.js +2924 -0
  13. package/dist/cjs/kompendium-code.cjs.entry.js +2724 -0
  14. package/dist/cjs/kompendium-code.entry.cjs.js.map +1 -0
  15. package/dist/cjs/kompendium-component.cjs.entry.js +207 -0
  16. package/dist/cjs/kompendium-component.entry.cjs.js.map +1 -0
  17. package/dist/cjs/kompendium-debug.cjs.entry.js +47 -0
  18. package/dist/cjs/kompendium-debug.entry.cjs.js.map +1 -0
  19. package/dist/cjs/kompendium-example-code.cjs.entry.js +20 -0
  20. package/dist/cjs/kompendium-example-code.entry.cjs.js.map +1 -0
  21. package/dist/cjs/kompendium-example-markdown.cjs.entry.js +165 -0
  22. package/dist/cjs/kompendium-example-markdown.entry.cjs.js.map +1 -0
  23. package/dist/cjs/kompendium-guide.cjs.entry.js +33 -0
  24. package/dist/cjs/kompendium-guide.entry.cjs.js.map +1 -0
  25. package/dist/cjs/kompendium-markdown.cjs.entry.js +48923 -0
  26. package/dist/cjs/kompendium-markdown.entry.cjs.js.map +1 -0
  27. package/dist/cjs/kompendium-playground.cjs.entry.js +89 -0
  28. package/dist/cjs/kompendium-playground.entry.cjs.js.map +1 -0
  29. package/dist/cjs/kompendium-proplist.kompendium-taglist.entry.cjs.js.map +1 -0
  30. package/dist/cjs/kompendium-proplist_2.cjs.entry.js +49 -0
  31. package/dist/cjs/kompendium-type.cjs.entry.js +83 -0
  32. package/dist/cjs/kompendium-type.entry.cjs.js.map +1 -0
  33. package/dist/cjs/kompendium.cjs.js +25 -0
  34. package/dist/cjs/kompendium.cjs.js.map +1 -0
  35. package/dist/cjs/loader.cjs.js +13 -0
  36. package/dist/cjs/loader.cjs.js.map +1 -0
  37. package/dist/cjs/markdown-types-B884tLd-.js +15 -0
  38. package/dist/cjs/markdown-types-B884tLd-.js.map +1 -0
  39. package/dist/cjs/methods-DoA78dOH.js +97 -0
  40. package/dist/cjs/methods-DoA78dOH.js.map +1 -0
  41. package/dist/cjs/types-SjA7Kcy_.js +8 -0
  42. package/dist/cjs/types-SjA7Kcy_.js.map +1 -0
  43. package/dist/collection/assets/favicon.svg +65 -0
  44. package/dist/collection/assets/icons/bookmark-fill.svg +1 -0
  45. package/dist/collection/assets/icons/danger.svg +1 -0
  46. package/dist/collection/assets/icons/debug.svg +1 -0
  47. package/dist/collection/assets/icons/important.svg +1 -0
  48. package/dist/collection/assets/icons/info.svg +1 -0
  49. package/dist/collection/assets/icons/logo.svg +1 -0
  50. package/dist/collection/assets/icons/note.svg +1 -0
  51. package/dist/collection/assets/icons/search.svg +1 -0
  52. package/dist/collection/assets/icons/tip.svg +1 -0
  53. package/dist/collection/assets/icons/warning.svg +1 -0
  54. package/dist/collection/assets/logotype.svg +64 -0
  55. package/dist/collection/collection-manifest.json +35 -0
  56. package/dist/collection/components/anchor-scroll.js +61 -0
  57. package/dist/collection/components/anchor-scroll.js.map +1 -0
  58. package/dist/collection/components/app/app.css +125 -0
  59. package/dist/collection/components/app/app.js +149 -0
  60. package/dist/collection/components/app/app.js.map +1 -0
  61. package/dist/collection/components/code/code.css +250 -0
  62. package/dist/collection/components/code/code.js +82 -0
  63. package/dist/collection/components/code/code.js.map +1 -0
  64. package/dist/collection/components/code/examples/code.js +14 -0
  65. package/dist/collection/components/code/examples/code.js.map +1 -0
  66. package/dist/collection/components/component/component.css +383 -0
  67. package/dist/collection/components/component/component.js +191 -0
  68. package/dist/collection/components/component/component.js.map +1 -0
  69. package/dist/collection/components/component/templates/events.js +32 -0
  70. package/dist/collection/components/component/templates/events.js.map +1 -0
  71. package/dist/collection/components/component/templates/examples.js +17 -0
  72. package/dist/collection/components/component/templates/examples.js.map +1 -0
  73. package/dist/collection/components/component/templates/methods.js +54 -0
  74. package/dist/collection/components/component/templates/methods.js.map +1 -0
  75. package/dist/collection/components/component/templates/props.js +36 -0
  76. package/dist/collection/components/component/templates/props.js.map +1 -0
  77. package/dist/collection/components/component/templates/slots.js +14 -0
  78. package/dist/collection/components/component/templates/slots.js.map +1 -0
  79. package/dist/collection/components/component/templates/style.js +14 -0
  80. package/dist/collection/components/component/templates/style.js.map +1 -0
  81. package/dist/collection/components/darkmode-switch/darkmode-switch.css +141 -0
  82. package/dist/collection/components/darkmode-switch/darkmode-switch.js +90 -0
  83. package/dist/collection/components/darkmode-switch/darkmode-switch.js.map +1 -0
  84. package/dist/collection/components/darkmode-switch/types.js +2 -0
  85. package/dist/collection/components/darkmode-switch/types.js.map +1 -0
  86. package/dist/collection/components/debug/debug.js +146 -0
  87. package/dist/collection/components/debug/debug.js.map +1 -0
  88. package/dist/collection/components/guide/guide.js +61 -0
  89. package/dist/collection/components/guide/guide.js.map +1 -0
  90. package/dist/collection/components/markdown/examples/markdown-example.js +150 -0
  91. package/dist/collection/components/markdown/examples/markdown-example.js.map +1 -0
  92. package/dist/collection/components/markdown/examples/markdown.js +14 -0
  93. package/dist/collection/components/markdown/examples/markdown.js.map +1 -0
  94. package/dist/collection/components/markdown/markdown-types.js +8 -0
  95. package/dist/collection/components/markdown/markdown-types.js.map +1 -0
  96. package/dist/collection/components/markdown/markdown.css +660 -0
  97. package/dist/collection/components/markdown/markdown.js +83 -0
  98. package/dist/collection/components/markdown/markdown.js.map +1 -0
  99. package/dist/collection/components/navigation/navigation.css +403 -0
  100. package/dist/collection/components/navigation/navigation.js +184 -0
  101. package/dist/collection/components/navigation/navigation.js.map +1 -0
  102. package/dist/collection/components/playground/playground.css +198 -0
  103. package/dist/collection/components/playground/playground.js +174 -0
  104. package/dist/collection/components/playground/playground.js.map +1 -0
  105. package/dist/collection/components/playground/playground.types.js +2 -0
  106. package/dist/collection/components/playground/playground.types.js.map +1 -0
  107. package/dist/collection/components/proplist/proplist.css +334 -0
  108. package/dist/collection/components/proplist/proplist.js +53 -0
  109. package/dist/collection/components/proplist/proplist.js.map +1 -0
  110. package/dist/collection/components/search/search.css +183 -0
  111. package/dist/collection/components/search/search.js +76 -0
  112. package/dist/collection/components/search/search.js.map +1 -0
  113. package/dist/collection/components/taglist/taglist.css +58 -0
  114. package/dist/collection/components/taglist/taglist.js +82 -0
  115. package/dist/collection/components/taglist/taglist.js.map +1 -0
  116. package/dist/collection/components/type/templates/alias.js +11 -0
  117. package/dist/collection/components/type/templates/alias.js.map +1 -0
  118. package/dist/collection/components/type/templates/enum.js +25 -0
  119. package/dist/collection/components/type/templates/enum.js.map +1 -0
  120. package/dist/collection/components/type/templates/interface.js +13 -0
  121. package/dist/collection/components/type/templates/interface.js.map +1 -0
  122. package/dist/collection/components/type/type.js +97 -0
  123. package/dist/collection/components/type/type.js.map +1 -0
  124. package/dist/collection/index.js +4 -0
  125. package/dist/collection/index.js.map +1 -0
  126. package/dist/collection/kompendium/config.js +7 -0
  127. package/dist/collection/kompendium/config.js.map +1 -0
  128. package/dist/collection/kompendium/filesystem.js +9 -0
  129. package/dist/collection/kompendium/filesystem.js.map +1 -0
  130. package/dist/collection/kompendium/generator.js +217 -0
  131. package/dist/collection/kompendium/generator.js.map +1 -0
  132. package/dist/collection/kompendium/guides.js +30 -0
  133. package/dist/collection/kompendium/guides.js.map +1 -0
  134. package/dist/collection/kompendium/index.js +2 -0
  135. package/dist/collection/kompendium/index.js.map +1 -0
  136. package/dist/collection/kompendium/markdown-admonitions.js +82 -0
  137. package/dist/collection/kompendium/markdown-admonitions.js.map +1 -0
  138. package/dist/collection/kompendium/markdown-code.js +40 -0
  139. package/dist/collection/kompendium/markdown-code.js.map +1 -0
  140. package/dist/collection/kompendium/markdown-frontmatter.js +12 -0
  141. package/dist/collection/kompendium/markdown-frontmatter.js.map +1 -0
  142. package/dist/collection/kompendium/markdown-nodes.js +10 -0
  143. package/dist/collection/kompendium/markdown-nodes.js.map +1 -0
  144. package/dist/collection/kompendium/markdown-typelinks.js +115 -0
  145. package/dist/collection/kompendium/markdown-typelinks.js.map +1 -0
  146. package/dist/collection/kompendium/markdown.js +35 -0
  147. package/dist/collection/kompendium/markdown.js.map +1 -0
  148. package/dist/collection/kompendium/menu.js +149 -0
  149. package/dist/collection/kompendium/menu.js.map +1 -0
  150. package/dist/collection/kompendium/schema.js +167 -0
  151. package/dist/collection/kompendium/schema.js.map +1 -0
  152. package/dist/collection/kompendium/search.js +144 -0
  153. package/dist/collection/kompendium/search.js.map +1 -0
  154. package/dist/collection/kompendium/source.js +81 -0
  155. package/dist/collection/kompendium/source.js.map +1 -0
  156. package/dist/collection/kompendium/test/fixtures/basic.js +48 -0
  157. package/dist/collection/kompendium/test/fixtures/basic.js.map +1 -0
  158. package/dist/collection/kompendium/test/fixtures/filtering/example-type.js +2 -0
  159. package/dist/collection/kompendium/test/fixtures/filtering/example-type.js.map +1 -0
  160. package/dist/collection/kompendium/test/fixtures/filtering/node-modules-type.js +2 -0
  161. package/dist/collection/kompendium/test/fixtures/filtering/node-modules-type.js.map +1 -0
  162. package/dist/collection/kompendium/test/fixtures/filtering/private-types.js +2 -0
  163. package/dist/collection/kompendium/test/fixtures/filtering/private-types.js.map +1 -0
  164. package/dist/collection/kompendium/test/fixtures/filtering/stencil-component-types.js +2 -0
  165. package/dist/collection/kompendium/test/fixtures/filtering/stencil-component-types.js.map +1 -0
  166. package/dist/collection/kompendium/test/fixtures/filtering/test-helper-type.js +2 -0
  167. package/dist/collection/kompendium/test/fixtures/filtering/test-helper-type.js.map +1 -0
  168. package/dist/collection/kompendium/test/fixtures/filtering/valid-types.js +29 -0
  169. package/dist/collection/kompendium/test/fixtures/filtering/valid-types.js.map +1 -0
  170. package/dist/collection/kompendium/typedoc.js +481 -0
  171. package/dist/collection/kompendium/typedoc.js.map +1 -0
  172. package/dist/collection/kompendium/watch.js +9 -0
  173. package/dist/collection/kompendium/watch.js.map +1 -0
  174. package/dist/collection/types.js +2 -0
  175. package/dist/collection/types.js.map +1 -0
  176. package/dist/config.ts +8 -0
  177. package/dist/esm/_commonjsHelpers-BFTU3MAI.js +10 -0
  178. package/dist/esm/_commonjsHelpers-BFTU3MAI.js.map +1 -0
  179. package/dist/esm/anchor-scroll-BAGXN2n6.js +65 -0
  180. package/dist/esm/anchor-scroll-BAGXN2n6.js.map +1 -0
  181. package/dist/esm/index-9UrzenzW.js +1857 -0
  182. package/dist/esm/index-9UrzenzW.js.map +1 -0
  183. package/dist/esm/index.js +2 -0
  184. package/dist/esm/index.js.map +1 -0
  185. package/dist/esm/kompendium-app.kompendium-darkmode-switch.kompendium-navigation.kompendium-search.stencil-route.stencil-route-switch.stencil-router.entry.js.map +1 -0
  186. package/dist/esm/kompendium-app_7.entry.js +2916 -0
  187. package/dist/esm/kompendium-code.entry.js +2722 -0
  188. package/dist/esm/kompendium-code.entry.js.map +1 -0
  189. package/dist/esm/kompendium-component.entry.js +205 -0
  190. package/dist/esm/kompendium-component.entry.js.map +1 -0
  191. package/dist/esm/kompendium-debug.entry.js +45 -0
  192. package/dist/esm/kompendium-debug.entry.js.map +1 -0
  193. package/dist/esm/kompendium-example-code.entry.js +18 -0
  194. package/dist/esm/kompendium-example-code.entry.js.map +1 -0
  195. package/dist/esm/kompendium-example-markdown.entry.js +163 -0
  196. package/dist/esm/kompendium-example-markdown.entry.js.map +1 -0
  197. package/dist/esm/kompendium-guide.entry.js +31 -0
  198. package/dist/esm/kompendium-guide.entry.js.map +1 -0
  199. package/dist/esm/kompendium-markdown.entry.js +48921 -0
  200. package/dist/esm/kompendium-markdown.entry.js.map +1 -0
  201. package/dist/esm/kompendium-playground.entry.js +87 -0
  202. package/dist/esm/kompendium-playground.entry.js.map +1 -0
  203. package/dist/esm/kompendium-proplist.kompendium-taglist.entry.js.map +1 -0
  204. package/dist/esm/kompendium-proplist_2.entry.js +46 -0
  205. package/dist/esm/kompendium-type.entry.js +81 -0
  206. package/dist/esm/kompendium-type.entry.js.map +1 -0
  207. package/dist/esm/kompendium.js +21 -0
  208. package/dist/esm/kompendium.js.map +1 -0
  209. package/dist/esm/loader.js +11 -0
  210. package/dist/esm/loader.js.map +1 -0
  211. package/dist/esm/markdown-types-Ajsawr_9.js +12 -0
  212. package/dist/esm/markdown-types-Ajsawr_9.js.map +1 -0
  213. package/dist/esm/methods-BAjd6f7g.js +94 -0
  214. package/dist/esm/methods-BAjd6f7g.js.map +1 -0
  215. package/dist/esm/types-BIPLEi1G.js +6 -0
  216. package/dist/esm/types-BIPLEi1G.js.map +1 -0
  217. package/dist/filesystem.ts +9 -0
  218. package/dist/generator.ts +302 -0
  219. package/dist/guides.ts +49 -0
  220. package/dist/index.cjs.js +1 -0
  221. package/dist/index.js +1 -0
  222. package/dist/index.ts +1 -0
  223. package/dist/kompendium/index.esm.js +2 -0
  224. package/dist/kompendium/index.esm.js.map +1 -0
  225. package/dist/kompendium/kompendium-app.kompendium-darkmode-switch.kompendium-navigation.kompendium-search.stencil-route.stencil-route-switch.stencil-router.entry.esm.js.map +1 -0
  226. package/dist/kompendium/kompendium-code.entry.esm.js.map +1 -0
  227. package/dist/kompendium/kompendium-component.entry.esm.js.map +1 -0
  228. package/dist/kompendium/kompendium-debug.entry.esm.js.map +1 -0
  229. package/dist/kompendium/kompendium-example-code.entry.esm.js.map +1 -0
  230. package/dist/kompendium/kompendium-example-markdown.entry.esm.js.map +1 -0
  231. package/dist/kompendium/kompendium-guide.entry.esm.js.map +1 -0
  232. package/dist/kompendium/kompendium-markdown.entry.esm.js.map +1 -0
  233. package/dist/kompendium/kompendium-playground.entry.esm.js.map +1 -0
  234. package/dist/kompendium/kompendium-proplist.kompendium-taglist.entry.esm.js.map +1 -0
  235. package/dist/kompendium/kompendium-type.entry.esm.js.map +1 -0
  236. package/dist/kompendium/kompendium.css +47 -0
  237. package/dist/kompendium/kompendium.esm.js +2 -0
  238. package/dist/kompendium/kompendium.esm.js.map +1 -0
  239. package/dist/kompendium/loader.esm.js.map +1 -0
  240. package/dist/kompendium/p-15e4b2c0.entry.js +2 -0
  241. package/dist/kompendium/p-15e4b2c0.entry.js.map +1 -0
  242. package/dist/kompendium/p-1cf0168f.entry.js +2 -0
  243. package/dist/kompendium/p-1cf0168f.entry.js.map +1 -0
  244. package/dist/kompendium/p-29c23c89.entry.js +2 -0
  245. package/dist/kompendium/p-29c23c89.entry.js.map +1 -0
  246. package/dist/kompendium/p-3981d11f.entry.js +2 -0
  247. package/dist/kompendium/p-3981d11f.entry.js.map +1 -0
  248. package/dist/kompendium/p-93f0548d.entry.js +2 -0
  249. package/dist/kompendium/p-93f0548d.entry.js.map +1 -0
  250. package/dist/kompendium/p-97b02575.entry.js +2 -0
  251. package/dist/kompendium/p-97b02575.entry.js.map +1 -0
  252. package/dist/kompendium/p-9UrzenzW.js +3 -0
  253. package/dist/kompendium/p-9UrzenzW.js.map +1 -0
  254. package/dist/kompendium/p-Ajsawr_9.js +2 -0
  255. package/dist/kompendium/p-Ajsawr_9.js.map +1 -0
  256. package/dist/kompendium/p-BAGXN2n6.js +2 -0
  257. package/dist/kompendium/p-BAGXN2n6.js.map +1 -0
  258. package/dist/kompendium/p-BFTU3MAI.js +2 -0
  259. package/dist/kompendium/p-BFTU3MAI.js.map +1 -0
  260. package/dist/kompendium/p-BIPLEi1G.js +2 -0
  261. package/dist/kompendium/p-BIPLEi1G.js.map +1 -0
  262. package/dist/kompendium/p-CnQEA7KO.js +2 -0
  263. package/dist/kompendium/p-CnQEA7KO.js.map +1 -0
  264. package/dist/kompendium/p-b0f95bd6.entry.js +2 -0
  265. package/dist/kompendium/p-b0f95bd6.entry.js.map +1 -0
  266. package/dist/kompendium/p-d9bcc473.entry.js +10 -0
  267. package/dist/kompendium/p-d9bcc473.entry.js.map +1 -0
  268. package/dist/kompendium/p-e36f3f1e.entry.js +2 -0
  269. package/dist/kompendium/p-e36f3f1e.entry.js.map +1 -0
  270. package/dist/kompendium/p-e52a2f57.entry.js +2 -0
  271. package/dist/kompendium/p-e52a2f57.entry.js.map +1 -0
  272. package/dist/kompendium/p-ec5861de.entry.js +2 -0
  273. package/dist/kompendium/p-ec5861de.entry.js.map +1 -0
  274. package/dist/markdown-admonitions.ts +112 -0
  275. package/dist/markdown-code.ts +51 -0
  276. package/dist/markdown-frontmatter.ts +19 -0
  277. package/dist/markdown-nodes.ts +23 -0
  278. package/dist/markdown-typelinks.ts +166 -0
  279. package/dist/markdown.ts +49 -0
  280. package/dist/menu.ts +189 -0
  281. package/dist/schema.ts +233 -0
  282. package/dist/search.ts +197 -0
  283. package/dist/source.ts +129 -0
  284. package/dist/typedoc.ts +665 -0
  285. package/dist/types/components/anchor-scroll.d.ts +36 -0
  286. package/dist/types/components/app/app.d.ts +22 -0
  287. package/dist/types/components/code/code.d.ts +26 -0
  288. package/dist/types/components/code/examples/code.d.ts +3 -0
  289. package/dist/types/components/component/component.d.ts +32 -0
  290. package/dist/types/components/component/templates/events.d.ts +5 -0
  291. package/dist/types/components/component/templates/examples.d.ts +9 -0
  292. package/dist/types/components/component/templates/methods.d.ts +5 -0
  293. package/dist/types/components/component/templates/props.d.ts +5 -0
  294. package/dist/types/components/component/templates/slots.d.ts +5 -0
  295. package/dist/types/components/component/templates/style.d.ts +5 -0
  296. package/dist/types/components/darkmode-switch/darkmode-switch.d.ts +18 -0
  297. package/dist/types/components/darkmode-switch/types.d.ts +2 -0
  298. package/dist/types/components/debug/debug.d.ts +24 -0
  299. package/dist/types/components/guide/guide.d.ts +14 -0
  300. package/dist/types/components/markdown/examples/markdown-example.d.ts +1 -0
  301. package/dist/types/components/markdown/examples/markdown.d.ts +7 -0
  302. package/dist/types/components/markdown/markdown-types.d.ts +2 -0
  303. package/dist/types/components/markdown/markdown.d.ts +20 -0
  304. package/dist/types/components/navigation/navigation.d.ts +35 -0
  305. package/dist/types/components/playground/playground.d.ts +32 -0
  306. package/dist/types/components/playground/playground.types.d.ts +1 -0
  307. package/dist/types/components/proplist/proplist.d.ts +12 -0
  308. package/dist/types/components/search/search.d.ts +15 -0
  309. package/dist/types/components/taglist/taglist.d.ts +16 -0
  310. package/dist/types/components/type/templates/alias.d.ts +4 -0
  311. package/dist/types/components/type/templates/enum.d.ts +4 -0
  312. package/dist/types/components/type/templates/interface.d.ts +4 -0
  313. package/dist/types/components/type/type.d.ts +15 -0
  314. package/dist/types/components.d.ts +517 -0
  315. package/dist/types/index.d.ts +5 -0
  316. package/dist/types/kompendium/config.d.ts +2 -0
  317. package/dist/types/kompendium/filesystem.d.ts +1 -0
  318. package/dist/types/kompendium/generator.d.ts +4 -0
  319. package/dist/types/kompendium/guides.d.ts +9 -0
  320. package/dist/types/kompendium/index.d.ts +1 -0
  321. package/dist/types/kompendium/markdown-admonitions.d.ts +3 -0
  322. package/dist/types/kompendium/markdown-code.d.ts +2 -0
  323. package/dist/types/kompendium/markdown-frontmatter.d.ts +6 -0
  324. package/dist/types/kompendium/markdown-nodes.d.ts +12 -0
  325. package/dist/types/kompendium/markdown-typelinks.d.ts +21 -0
  326. package/dist/types/kompendium/markdown.d.ts +8 -0
  327. package/dist/types/kompendium/menu.d.ts +12 -0
  328. package/dist/types/kompendium/schema.d.ts +9 -0
  329. package/dist/types/kompendium/search.d.ts +3 -0
  330. package/dist/types/kompendium/source.d.ts +10 -0
  331. package/dist/types/kompendium/test/fixtures/basic.d.ts +65 -0
  332. package/dist/types/kompendium/test/fixtures/filtering/example-type.d.ts +8 -0
  333. package/dist/types/kompendium/test/fixtures/filtering/node-modules-type.d.ts +8 -0
  334. package/dist/types/kompendium/test/fixtures/filtering/private-types.d.ts +23 -0
  335. package/dist/types/kompendium/test/fixtures/filtering/stencil-component-types.d.ts +19 -0
  336. package/dist/types/kompendium/test/fixtures/filtering/test-helper-type.d.ts +8 -0
  337. package/dist/types/kompendium/test/fixtures/filtering/valid-types.d.ts +42 -0
  338. package/dist/types/kompendium/typedoc.d.ts +2 -0
  339. package/dist/types/kompendium/watch.d.ts +1 -0
  340. package/dist/types/stencil-public-runtime.d.ts +1746 -0
  341. package/dist/types/types.d.ts +119 -0
  342. package/dist/watch.ts +14 -0
  343. package/loader/cdn.js +1 -0
  344. package/loader/index.cjs.js +1 -0
  345. package/loader/index.d.ts +24 -0
  346. package/loader/index.es2017.js +1 -0
  347. package/loader/index.js +2 -0
  348. package/package.json +116 -0
@@ -0,0 +1,58 @@
1
+ :host {
2
+ isolation: isolate;
3
+ display: flex;
4
+ flex-direction: column;
5
+ align-items: flex-start;
6
+ gap: 0.5rem;
7
+ padding: 0.5rem 0 0 0;
8
+ }
9
+
10
+ .tag-list {
11
+ position: relative;
12
+ display: flex;
13
+ gap: 0.25rem;
14
+ align-items: center;
15
+ justify-content: center;
16
+ padding: 0.125rem 0.25rem 0.125rem 0.25rem;
17
+ border-radius: 0.25rem;
18
+ }
19
+ .tag-list:before, .tag-list:after {
20
+ content: "";
21
+ position: absolute;
22
+ inset: 0;
23
+ border-radius: inherit;
24
+ pointer-events: none;
25
+ }
26
+ .tag-list:before {
27
+ border: 1px dotted;
28
+ opacity: 0.4;
29
+ }
30
+ .tag-list:after {
31
+ background-color: currentColor;
32
+ opacity: 0.04;
33
+ }
34
+ .tag-list {
35
+ color: rgb(var(--kompendium-contrast-1100));
36
+ }
37
+
38
+ .tag--private {
39
+ color: rgb(var(--kompendium-color-orange-default));
40
+ }
41
+
42
+ .tag--beta {
43
+ color: rgb(var(--kompendium-color-blue-default));
44
+ }
45
+
46
+ .tag--deprecated {
47
+ color: rgb(var(--kompendium-color-red-default));
48
+ }
49
+
50
+ code {
51
+ font-family: var(--kompendium-font-code);
52
+ font-size: 0.75rem;
53
+ }
54
+
55
+ svg {
56
+ width: 0.75rem;
57
+ opacity: 0.7;
58
+ }
@@ -0,0 +1,82 @@
1
+ import { h } from "@stencil/core";
2
+ /**
3
+ * asd
4
+ */
5
+ export class Taglist {
6
+ constructor() {
7
+ /**
8
+ * Set to `true` if the list should be rendered in compact mode
9
+ */
10
+ this.compact = false;
11
+ }
12
+ render() {
13
+ return this.tags.map(this.renderTag);
14
+ }
15
+ renderTag(tag) {
16
+ const classList = {
17
+ 'tag-list': true,
18
+ };
19
+ classList[`tag--${tag.name}`] = true;
20
+ return (h("div", { class: classList }, h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, h("path", { d: "M5 2h14a1 1 0 0 1 1 1v19.143a.5.5 0 0 1-.766.424L12 18.03l-7.234 4.536A.5.5 0 0 1 4 22.143V3a1 1 0 0 1 1-1z", fill: "currentColor" })), h("code", null, "@", tag.name), h("kompendium-markdown", { text: tag.text })));
21
+ }
22
+ static get is() { return "kompendium-taglist"; }
23
+ static get encapsulation() { return "shadow"; }
24
+ static get originalStyleUrls() {
25
+ return {
26
+ "$": ["taglist.scss"]
27
+ };
28
+ }
29
+ static get styleUrls() {
30
+ return {
31
+ "$": ["taglist.css"]
32
+ };
33
+ }
34
+ static get properties() {
35
+ return {
36
+ "tags": {
37
+ "type": "unknown",
38
+ "mutable": false,
39
+ "complexType": {
40
+ "original": "JsonDocsTag[]",
41
+ "resolved": "JsonDocsTag[]",
42
+ "references": {
43
+ "JsonDocsTag": {
44
+ "location": "import",
45
+ "path": "@stencil/core/internal",
46
+ "id": "node_modules::JsonDocsTag"
47
+ }
48
+ }
49
+ },
50
+ "required": false,
51
+ "optional": false,
52
+ "docs": {
53
+ "tags": [],
54
+ "text": "List of tags to render"
55
+ },
56
+ "getter": false,
57
+ "setter": false
58
+ },
59
+ "compact": {
60
+ "type": "boolean",
61
+ "mutable": false,
62
+ "complexType": {
63
+ "original": "boolean",
64
+ "resolved": "boolean",
65
+ "references": {}
66
+ },
67
+ "required": false,
68
+ "optional": false,
69
+ "docs": {
70
+ "tags": [],
71
+ "text": "Set to `true` if the list should be rendered in compact mode"
72
+ },
73
+ "getter": false,
74
+ "setter": false,
75
+ "reflect": false,
76
+ "attribute": "compact",
77
+ "defaultValue": "false"
78
+ }
79
+ };
80
+ }
81
+ }
82
+ //# sourceMappingURL=taglist.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"taglist.js","sourceRoot":"","sources":["../../../src/components/taglist/taglist.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAGnD;;GAEG;AAMH,MAAM,OAAO,OAAO;IALpB;QAYI;;WAEG;QAEI,YAAO,GAAG,KAAK,CAAC;KA0B1B;IAxBG,MAAM;QACF,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACzC,CAAC;IAEO,SAAS,CAAC,GAAgB;QAC9B,MAAM,SAAS,GAAG;YACd,UAAU,EAAE,IAAI;SACnB,CAAC;QAEF,SAAS,CAAC,QAAQ,GAAG,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC;QAErC,OAAO,CACH,WAAK,KAAK,EAAE,SAAS;YACjB,WAAK,KAAK,EAAC,4BAA4B,EAAC,OAAO,EAAC,WAAW;gBACvD,YACI,CAAC,EAAC,6GAA6G,EAC/G,IAAI,EAAC,cAAc,GACf,CACN;YACN;;gBAAQ,GAAG,CAAC,IAAI,CAAQ;YACxB,2BAAqB,IAAI,EAAE,GAAG,CAAC,IAAI,GAAI,CACrC,CACT,CAAC;IACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, h, Prop } from '@stencil/core';\nimport { JsonDocsTag } from '@stencil/core/internal';\n\n/**\n * asd\n */\n@Component({\n tag: 'kompendium-taglist',\n shadow: true,\n styleUrl: 'taglist.scss',\n})\nexport class Taglist {\n /**\n * List of tags to render\n */\n @Prop()\n public tags: JsonDocsTag[];\n\n /**\n * Set to `true` if the list should be rendered in compact mode\n */\n @Prop()\n public compact = false;\n\n render(): HTMLElement[] {\n return this.tags.map(this.renderTag);\n }\n\n private renderTag(tag: JsonDocsTag) {\n const classList = {\n 'tag-list': true,\n };\n\n classList[`tag--${tag.name}`] = true;\n\n return (\n <div class={classList}>\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <path\n d=\"M5 2h14a1 1 0 0 1 1 1v19.143a.5.5 0 0 1-.766.424L12 18.03l-7.234 4.536A.5.5 0 0 1 4 22.143V3a1 1 0 0 1 1-1z\"\n fill=\"currentColor\"\n ></path>\n </svg>\n <code>@{tag.name}</code>\n <kompendium-markdown text={tag.text} />\n </div>\n );\n }\n}\n"]}
@@ -0,0 +1,11 @@
1
+ import { h } from "@stencil/core";
2
+ export function Alias({ type }) {
3
+ const alias = '`' + type.alias + '`';
4
+ return [
5
+ h("h1", { id: type.name }, type.name),
6
+ h("kompendium-markdown", { text: type.docs }),
7
+ h("kompendium-taglist", { tags: type.docsTags }),
8
+ h("kompendium-markdown", { text: alias }),
9
+ ];
10
+ }
11
+ //# sourceMappingURL=alias.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alias.js","sourceRoot":"","sources":["../../../../src/components/type/templates/alias.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAGlC,MAAM,UAAU,KAAK,CAAC,EAAE,IAAI,EAA8B;IACtD,MAAM,KAAK,GAAG,GAAG,GAAG,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC;IAErC,OAAO;QACH,UAAI,EAAE,EAAE,IAAI,CAAC,IAAI,IAAG,IAAI,CAAC,IAAI,CAAM;QACnC,2BAAqB,IAAI,EAAE,IAAI,CAAC,IAAI,GAAI;QACxC,0BAAoB,IAAI,EAAE,IAAI,CAAC,QAAQ,GAAI;QAC3C,2BAAqB,IAAI,EAAE,KAAK,GAAI;KACvC,CAAC;AACN,CAAC","sourcesContent":["import { h } from '@stencil/core';\nimport { AliasDescription } from '../../../types';\n\nexport function Alias({ type }: { type: AliasDescription }): HTMLElement[] {\n const alias = '`' + type.alias + '`';\n\n return [\n <h1 id={type.name}>{type.name}</h1>,\n <kompendium-markdown text={type.docs} />,\n <kompendium-taglist tags={type.docsTags} />,\n <kompendium-markdown text={alias} />,\n ];\n}\n"]}
@@ -0,0 +1,25 @@
1
+ import { h } from "@stencil/core";
2
+ export function Enum({ type }) {
3
+ return [
4
+ h("h1", { id: type.name }, type.name),
5
+ h("kompendium-markdown", { text: type.docs }),
6
+ h("kompendium-taglist", { tags: type.docsTags }),
7
+ h(MemberList, { members: type.members }),
8
+ ];
9
+ }
10
+ function MemberList({ members }) {
11
+ if (!members.length) {
12
+ return;
13
+ }
14
+ return [h("h3", null, "Members"), ...members.map(renderMember)];
15
+ }
16
+ function renderMember(member) {
17
+ const items = [
18
+ {
19
+ key: 'Value',
20
+ value: member.value,
21
+ },
22
+ ];
23
+ return (h("div", null, h("h4", null, member.name), h("kompendium-markdown", { text: member.docs }), h("kompendium-taglist", { tags: member.docsTags }), h("kompendium-proplist", { items: items })));
24
+ }
25
+ //# sourceMappingURL=enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enum.js","sourceRoot":"","sources":["../../../../src/components/type/templates/enum.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAIlC,MAAM,UAAU,IAAI,CAAC,EAAE,IAAI,EAA6B;IACpD,OAAO;QACH,UAAI,EAAE,EAAE,IAAI,CAAC,IAAI,IAAG,IAAI,CAAC,IAAI,CAAM;QACnC,2BAAqB,IAAI,EAAE,IAAI,CAAC,IAAI,GAAI;QACxC,0BAAoB,IAAI,EAAE,IAAI,CAAC,QAAQ,GAAI;QAC3C,EAAC,UAAU,IAAC,OAAO,EAAE,IAAI,CAAC,OAAO,GAAI;KACxC,CAAC;AACN,CAAC;AAED,SAAS,UAAU,CAAC,EAAE,OAAO,EAA6B;IACtD,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;QAClB,OAAO;IACX,CAAC;IAED,OAAO,CAAC,wBAAgB,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC;AAC5D,CAAC;AAED,SAAS,YAAY,CAAC,MAAkB;IACpC,MAAM,KAAK,GAAmB;QAC1B;YACI,GAAG,EAAE,OAAO;YACZ,KAAK,EAAE,MAAM,CAAC,KAAK;SACtB;KACJ,CAAC;IAEF,OAAO,CACH;QACI,cAAK,MAAM,CAAC,IAAI,CAAM;QACtB,2BAAqB,IAAI,EAAE,MAAM,CAAC,IAAI,GAAI;QAC1C,0BAAoB,IAAI,EAAE,MAAM,CAAC,QAAQ,GAAI;QAC7C,2BAAqB,KAAK,EAAE,KAAK,GAAI,CACnC,CACT,CAAC;AACN,CAAC","sourcesContent":["import { h } from '@stencil/core';\nimport { EnumDescription, EnumMember } from '../../../types';\nimport { ProplistItem } from '../../proplist/proplist';\n\nexport function Enum({ type }: { type: EnumDescription }): HTMLElement[] {\n return [\n <h1 id={type.name}>{type.name}</h1>,\n <kompendium-markdown text={type.docs} />,\n <kompendium-taglist tags={type.docsTags} />,\n <MemberList members={type.members} />,\n ];\n}\n\nfunction MemberList({ members }: { members: EnumMember[] }): HTMLElement[] {\n if (!members.length) {\n return;\n }\n\n return [<h3>Members</h3>, ...members.map(renderMember)];\n}\n\nfunction renderMember(member: EnumMember) {\n const items: ProplistItem[] = [\n {\n key: 'Value',\n value: member.value,\n },\n ];\n\n return (\n <div>\n <h4>{member.name}</h4>\n <kompendium-markdown text={member.docs} />\n <kompendium-taglist tags={member.docsTags} />\n <kompendium-proplist items={items} />\n </div>\n );\n}\n"]}
@@ -0,0 +1,13 @@
1
+ import { h } from "@stencil/core";
2
+ import { PropertyList } from "../../component/templates/props";
3
+ import { MethodList } from "../../component/templates/methods";
4
+ export function Interface({ type, }) {
5
+ return [
6
+ h("h1", { id: type.name }, type.name),
7
+ h("kompendium-markdown", { text: type.docs }),
8
+ h("kompendium-taglist", { tags: type.docsTags }),
9
+ h(PropertyList, { props: type.props }),
10
+ h(MethodList, { methods: type.methods }),
11
+ ];
12
+ }
13
+ //# sourceMappingURL=interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../../src/components/type/templates/interface.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAElC,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAE/D,MAAM,UAAU,SAAS,CAAC,EACtB,IAAI,GAGP;IACG,OAAO;QACH,UAAI,EAAE,EAAE,IAAI,CAAC,IAAI,IAAG,IAAI,CAAC,IAAI,CAAM;QACnC,2BAAqB,IAAI,EAAE,IAAI,CAAC,IAAI,GAAI;QACxC,0BAAoB,IAAI,EAAE,IAAI,CAAC,QAAQ,GAAI;QAC3C,EAAC,YAAY,IAAC,KAAK,EAAE,IAAI,CAAC,KAAK,GAAI;QACnC,EAAC,UAAU,IAAC,OAAO,EAAE,IAAI,CAAC,OAAO,GAAI;KACxC,CAAC;AACN,CAAC","sourcesContent":["import { h } from '@stencil/core';\nimport { InterfaceDescription } from '../../../types';\nimport { PropertyList } from '../../component/templates/props';\nimport { MethodList } from '../../component/templates/methods';\n\nexport function Interface({\n type,\n}: {\n type: InterfaceDescription;\n}): HTMLElement[] {\n return [\n <h1 id={type.name}>{type.name}</h1>,\n <kompendium-markdown text={type.docs} />,\n <kompendium-taglist tags={type.docsTags} />,\n <PropertyList props={type.props} />,\n <MethodList methods={type.methods} />,\n ];\n}\n"]}
@@ -0,0 +1,97 @@
1
+ import { h } from "@stencil/core";
2
+ import { Interface } from "./templates/interface";
3
+ import { Alias } from "./templates/alias";
4
+ import { Enum } from "./templates/enum";
5
+ export class Type {
6
+ componentWillRender() {
7
+ this.findType();
8
+ }
9
+ render() {
10
+ if (!this.type) {
11
+ return;
12
+ }
13
+ const type = this.type;
14
+ const componentMap = {
15
+ interface: Interface,
16
+ alias: Alias,
17
+ enum: Enum,
18
+ class: Interface,
19
+ };
20
+ const TypeComponent = componentMap[this.type.type];
21
+ return (h("article", { class: "type" }, h("section", { class: "docs" }, h(TypeComponent, { type: type }))));
22
+ }
23
+ findType() {
24
+ const type = this.types.find((type) => type.name === this.match.params.name);
25
+ if (type) {
26
+ this.type = type;
27
+ }
28
+ }
29
+ static get is() { return "kompendium-type"; }
30
+ static get encapsulation() { return "shadow"; }
31
+ static get originalStyleUrls() {
32
+ return {
33
+ "$": ["../component/component.scss"]
34
+ };
35
+ }
36
+ static get styleUrls() {
37
+ return {
38
+ "$": ["../component/component.css"]
39
+ };
40
+ }
41
+ static get properties() {
42
+ return {
43
+ "types": {
44
+ "type": "unknown",
45
+ "mutable": false,
46
+ "complexType": {
47
+ "original": "TypeDescription[]",
48
+ "resolved": "TypeDescription[]",
49
+ "references": {
50
+ "TypeDescription": {
51
+ "location": "import",
52
+ "path": "../../types",
53
+ "id": "src/types.ts::TypeDescription"
54
+ }
55
+ }
56
+ },
57
+ "required": false,
58
+ "optional": false,
59
+ "docs": {
60
+ "tags": [],
61
+ "text": ""
62
+ },
63
+ "getter": false,
64
+ "setter": false
65
+ },
66
+ "match": {
67
+ "type": "unknown",
68
+ "mutable": false,
69
+ "complexType": {
70
+ "original": "MatchResults",
71
+ "resolved": "MatchResults",
72
+ "references": {
73
+ "MatchResults": {
74
+ "location": "import",
75
+ "path": "@limetech/stencil-router",
76
+ "id": "node_modules::MatchResults"
77
+ }
78
+ }
79
+ },
80
+ "required": false,
81
+ "optional": false,
82
+ "docs": {
83
+ "tags": [],
84
+ "text": "Matched route parameters"
85
+ },
86
+ "getter": false,
87
+ "setter": false
88
+ }
89
+ };
90
+ }
91
+ static get states() {
92
+ return {
93
+ "type": {}
94
+ };
95
+ }
96
+ }
97
+ //# sourceMappingURL=type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.js","sourceRoot":"","sources":["../../../src/components/type/type.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAG1D,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAOxC,MAAM,OAAO,IAAI;IAeN,mBAAmB;QACtB,IAAI,CAAC,QAAQ,EAAE,CAAC;IACpB,CAAC;IAED,MAAM;QACF,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YACb,OAAO;QACX,CAAC;QAED,MAAM,IAAI,GAAQ,IAAI,CAAC,IAAI,CAAC;QAC5B,MAAM,YAAY,GAAqC;YACnD,SAAS,EAAE,SAAS;YACpB,KAAK,EAAE,KAAK;YACZ,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,SAAS;SACnB,CAAC;QACF,MAAM,aAAa,GAAG,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEnD,OAAO,CACH,eAAS,KAAK,EAAC,MAAM;YACjB,eAAS,KAAK,EAAC,MAAM;gBACjB,EAAC,aAAa,IAAC,IAAI,EAAE,IAAI,GAAI,CACvB,CACJ,CACb,CAAC;IACN,CAAC;IAEO,QAAQ;QACZ,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CACxB,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CACjD,CAAC;QAEF,IAAI,IAAI,EAAE,CAAC;YACP,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACrB,CAAC;IACL,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, h, Prop, State } from '@stencil/core';\nimport { TypeDescription, TypeDescriptionType } from '../../types';\nimport { MatchResults } from '@limetech/stencil-router';\nimport { Interface } from './templates/interface';\nimport { Alias } from './templates/alias';\nimport { Enum } from './templates/enum';\n\n@Component({\n tag: 'kompendium-type',\n shadow: true,\n styleUrl: '../component/component.scss',\n})\nexport class Type {\n /**\n */\n @Prop()\n public types: TypeDescription[];\n\n /**\n * Matched route parameters\n */\n @Prop()\n public match: MatchResults;\n\n @State()\n private type: TypeDescription;\n\n public componentWillRender(): void {\n this.findType();\n }\n\n render(): HTMLElement {\n if (!this.type) {\n return;\n }\n\n const type: any = this.type;\n const componentMap: Record<TypeDescriptionType, any> = {\n interface: Interface,\n alias: Alias,\n enum: Enum,\n class: Interface,\n };\n const TypeComponent = componentMap[this.type.type];\n\n return (\n <article class=\"type\">\n <section class=\"docs\">\n <TypeComponent type={type} />\n </section>\n </article>\n );\n }\n\n private findType() {\n const type = this.types.find(\n (type) => type.name === this.match.params.name,\n );\n\n if (type) {\n this.type = type;\n }\n }\n}\n"]}
@@ -0,0 +1,4 @@
1
+ export * from './components';
2
+ import "@limetech/stencil-router";
3
+ export * from './types';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,OAAO,0BAA0B,CAAC;AAClC,cAAc,SAAS,CAAC","sourcesContent":["export * from './components';\nimport '@limetech/stencil-router';\nexport * from './types';\nimport { KompendiumConfig } from './types';\nexport declare const kompendium: (\n config?: Partial<KompendiumConfig>,\n) => ((docs: any) => Promise<void>) | (() => any);\n"]}
@@ -0,0 +1,7 @@
1
+ export const defaultConfig = {
2
+ path: '.kompendium',
3
+ publicPath: 'www',
4
+ typeRoot: './src/types.ts',
5
+ guides: [],
6
+ };
7
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/kompendium/config.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,aAAa,GAAqB;IAC3C,IAAI,EAAE,aAAa;IACnB,UAAU,EAAE,KAAK;IACjB,QAAQ,EAAE,gBAAgB;IAC1B,MAAM,EAAE,EAAE;CACb,CAAC","sourcesContent":["import { KompendiumConfig } from '../types';\n\nexport const defaultConfig: KompendiumConfig = {\n path: '.kompendium',\n publicPath: 'www',\n typeRoot: './src/types.ts',\n guides: [],\n};\n"]}
@@ -0,0 +1,9 @@
1
+ import { access, constants } from "fs";
2
+ export function exists(path) {
3
+ return new Promise((resolve) => {
4
+ access(path, constants.F_OK, (error) => {
5
+ resolve(!error);
6
+ });
7
+ });
8
+ }
9
+ //# sourceMappingURL=filesystem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filesystem.js","sourceRoot":"","sources":["../../src/kompendium/filesystem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAEvC,MAAM,UAAU,MAAM,CAAC,IAAY;IAC/B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC3B,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,EAAE;YACnC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC;QACpB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["import { access, constants } from 'fs';\n\nexport function exists(path: string): Promise<boolean> {\n return new Promise((resolve) => {\n access(path, constants.F_OK, (error) => {\n resolve(!error);\n });\n });\n}\n"]}
@@ -0,0 +1,217 @@
1
+ import { defaultConfig } from "./config";
2
+ import { addSources } from "./source";
3
+ import lnk from "lnk";
4
+ import { createMenu } from "./menu";
5
+ import { copyFile, mkdir, readFile, stat, writeFile } from "fs/promises";
6
+ import { exists } from "./filesystem";
7
+ import { createWatcher } from "./watch";
8
+ import { findGuides } from "./guides";
9
+ import { parseFile } from "./typedoc";
10
+ import { createSchemas } from "./schema";
11
+ import { createIndex } from "./search";
12
+ export const kompendium = (config = {}) => {
13
+ if (!generateDocs()) {
14
+ return () => null;
15
+ }
16
+ return kompendiumGenerator(config);
17
+ };
18
+ let logger;
19
+ export function kompendiumGenerator(config) {
20
+ config = {
21
+ ...defaultConfig,
22
+ ...config,
23
+ };
24
+ initialize(config);
25
+ return async (docs, stencilConfig) => {
26
+ logger = stencilConfig.logger;
27
+ const timeSpan = logger.createTimeSpan('kompendium started');
28
+ const [jsonDocs, title, readme, guides, types] = await Promise.all([
29
+ addSources(docs),
30
+ getProjectTitle(config),
31
+ getReadme(),
32
+ findGuides(config),
33
+ getTypes(config, stencilConfig.tsconfig),
34
+ ]);
35
+ const data = {
36
+ docs: jsonDocs,
37
+ title: title,
38
+ logo: config.logo,
39
+ menu: createMenu(docs, guides, types),
40
+ readme: readme,
41
+ guides: guides,
42
+ types: types,
43
+ schemas: createSchemas(docs.components, types),
44
+ index: null,
45
+ };
46
+ data.index = createIndex(data);
47
+ await writeData(config, data);
48
+ timeSpan.finish('kompendium finished');
49
+ };
50
+ }
51
+ async function initialize(config) {
52
+ const path = `${config.publicPath}/kompendium.json`;
53
+ if (isWatcher()) {
54
+ createWatcher(path, 'unlink', onUnlink(config));
55
+ }
56
+ await createOutputDirs(config);
57
+ }
58
+ const onUnlink = (config) => () => {
59
+ createSymlink(config);
60
+ };
61
+ async function createSymlink(config) {
62
+ const source = `${config.path}/kompendium.json`;
63
+ const target = `${config.publicPath}/kompendium.json`;
64
+ if (!(await exists(source))) {
65
+ return;
66
+ }
67
+ if (await exists(target)) {
68
+ return;
69
+ }
70
+ lnk([source], config.publicPath);
71
+ }
72
+ async function getProjectTitle(config) {
73
+ if (config.title) {
74
+ return config.title;
75
+ }
76
+ const json = await readFile('./package.json', 'utf8');
77
+ const data = JSON.parse(json);
78
+ return data.name
79
+ .replace(/^@[^/]+?\//, '')
80
+ .split('-')
81
+ .join(' ');
82
+ }
83
+ async function writeData(config, data) {
84
+ // Always write to the kompendium config folder (typically `.kompendium` in
85
+ // the root of the project) to avoid Stencil deleting the file during build.
86
+ const filePath = `${config.path}/kompendium.json`;
87
+ await writeFile(filePath, JSON.stringify(data), 'utf8');
88
+ if (isProd()) {
89
+ // In production, we used to write the kompendium.json file to the
90
+ // public path. We now copy the file to the public path for backwards
91
+ // compatibility with projects that do not have problems with Stencil
92
+ // deleting the file during build. For projects that do have this
93
+ // problem, they can always copy the file from the config folder.
94
+ const publicFilePath = `${config.publicPath}/kompendium.json`;
95
+ if (!(await exists(config.publicPath))) {
96
+ await mkdir(config.publicPath, { recursive: true });
97
+ }
98
+ await copyFile(filePath, publicFilePath);
99
+ }
100
+ if (isWatcher()) {
101
+ createSymlink(config);
102
+ }
103
+ }
104
+ async function createOutputDirs(config) {
105
+ let path = config.path;
106
+ if (!(await exists(path))) {
107
+ mkdir(path, { recursive: true });
108
+ }
109
+ path = config.publicPath;
110
+ if (!(await exists(path))) {
111
+ mkdir(path, { recursive: true });
112
+ }
113
+ }
114
+ async function getReadme() {
115
+ const files = ['readme.md', 'README.md', 'README', 'readme'];
116
+ let data = null;
117
+ for (const file of files) {
118
+ if (data) {
119
+ continue;
120
+ }
121
+ if (!(await exists(file))) {
122
+ continue;
123
+ }
124
+ data = await readFile(file, 'utf8');
125
+ }
126
+ if (!data) {
127
+ logger.warn('README did not exist');
128
+ }
129
+ return data;
130
+ }
131
+ function generateDocs() {
132
+ return !!process.argv.includes('--docs');
133
+ }
134
+ function isWatcher() {
135
+ return !!process.argv.includes('--watch');
136
+ }
137
+ function isProd() {
138
+ return !(process.argv.includes('--dev') ||
139
+ process.argv.includes('test') ||
140
+ process.argv.find((arg) => arg.includes('jest-worker')));
141
+ }
142
+ async function getTypes(config, tsconfig) {
143
+ logger.debug('Getting type information...');
144
+ let types = await readTypes(config);
145
+ const cache = await readCache(config);
146
+ if (types.length === 0 || (await isModified(types, cache))) {
147
+ logger.debug('Parsing types...');
148
+ const data = parseFile(config.typeRoot, tsconfig);
149
+ await saveData(config, data);
150
+ types = data;
151
+ }
152
+ return types;
153
+ }
154
+ async function isModified(types, cache) {
155
+ if (Object.keys(cache).length === 0) {
156
+ return true;
157
+ }
158
+ const filenames = getUniqueSourceFilenames(types);
159
+ const stats = await Promise.all(filenames.map(tryStatFile));
160
+ return stats.some((fileStat, index) => hasFileChangedSinceCached(filenames[index], fileStat, cache));
161
+ }
162
+ function getUniqueSourceFilenames(types) {
163
+ const filenames = types.map((t) => t.sources).flat();
164
+ return [...new Set(filenames)];
165
+ }
166
+ function tryStatFile(filename) {
167
+ return stat(filename).catch(() => null);
168
+ }
169
+ function hasFileChangedSinceCached(filename, fileStat, cache) {
170
+ if (!fileStat) {
171
+ logger.debug(`${filename} cannot be accessed, marking as modified`);
172
+ return true;
173
+ }
174
+ const result = cache[filename] !== fileStat.mtimeMs;
175
+ logger.debug(`${filename} was ${result ? '' : 'not'} modified!`);
176
+ return result;
177
+ }
178
+ async function saveData(config, types) {
179
+ const filenames = getUniqueSourceFilenames(types);
180
+ const stats = await Promise.all(filenames.map(tryStatFile));
181
+ const cache = buildCacheFromFileStats(filenames, stats);
182
+ await Promise.all([writeCache(config, cache), writeTypes(config, types)]);
183
+ }
184
+ function buildCacheFromFileStats(filenames, stats) {
185
+ const cache = {};
186
+ stats.forEach((fileStat, index) => {
187
+ if (fileStat) {
188
+ cache[filenames[index]] = fileStat.mtimeMs;
189
+ }
190
+ });
191
+ return cache;
192
+ }
193
+ async function readCache(config) {
194
+ try {
195
+ const data = await readFile(`${config.path}/cache.json`, 'utf8');
196
+ return JSON.parse(data);
197
+ }
198
+ catch (_a) {
199
+ return {};
200
+ }
201
+ }
202
+ async function writeCache(config, data) {
203
+ await writeFile(`${config.path}/cache.json`, JSON.stringify(data), 'utf8');
204
+ }
205
+ async function readTypes(config) {
206
+ try {
207
+ const data = await readFile(`${config.path}/types.json`, 'utf8');
208
+ return JSON.parse(data);
209
+ }
210
+ catch (_a) {
211
+ return [];
212
+ }
213
+ }
214
+ async function writeTypes(config, data) {
215
+ await writeFile(`${config.path}/types.json`, JSON.stringify(data), 'utf8');
216
+ }
217
+ //# sourceMappingURL=generator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generator.js","sourceRoot":"","sources":["../../src/kompendium/generator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,SAAoC,EAAE,EAAE,EAAE;IACjE,IAAI,CAAC,YAAY,EAAE,EAAE,CAAC;QAClB,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC;IACtB,CAAC;IAED,OAAO,mBAAmB,CAAC,MAAM,CAAC,CAAC;AACvC,CAAC,CAAC;AAEF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,SAAS,CAAC,MAAiC;IACtD,IAAI,CAAC;QACD,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,GAAG,MAAM,CAAC,IAAI,aAAa,EAAE,MAAM,CAAC,CAAC;QAEjE,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IAAC,WAAM,CAAC;QACL,OAAO,EAAE,CAAC;IACd,CAAC;AACL,CAAC;AAED,KAAK,UAAU,UAAU,CAAC,MAAiC,EAAE,IAAS;IAClE,MAAM,SAAS,CAAC,GAAG,MAAM,CAAC,IAAI,aAAa,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;AAC/E,CAAC;AAED,KAAK,UAAU,SAAS,CAAC,MAAiC;IACtD,IAAI,CAAC;QACD,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,GAAG,MAAM,CAAC,IAAI,aAAa,EAAE,MAAM,CAAC,CAAC;QAEjE,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IAAC,WAAM,CAAC;QACL,OAAO,EAAE,CAAC;IACd,CAAC;AACL,CAAC;AAED,KAAK,UAAU,UAAU,CAAC,MAAiC,EAAE,IAAS;IAClE,MAAM,SAAS,CAAC,GAAG,MAAM,CAAC,IAAI,aAAa,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;AAC/E,CAAC","sourcesContent":["import { JsonDocs, Config, Logger } from '@stencil/core/internal';\nimport { defaultConfig } from './config';\nimport { addSources } from './source';\nimport lnk from 'lnk';\nimport { createMenu } from './menu';\nimport { copyFile, mkdir, readFile, stat, writeFile } from 'fs/promises';\nimport { exists } from './filesystem';\nimport { createWatcher } from './watch';\nimport { findGuides } from './guides';\nimport { KompendiumConfig, KompendiumData, TypeDescription } from '../types';\nimport { parseFile } from './typedoc';\nimport { createSchemas } from './schema';\nimport { createIndex } from './search';\n\nexport const kompendium = (config: Partial<KompendiumConfig> = {}) => {\n if (!generateDocs()) {\n return () => null;\n }\n\n return kompendiumGenerator(config);\n};\n\nlet logger: Logger;\n\nexport function kompendiumGenerator(\n config: Partial<KompendiumConfig>,\n): (docs: JsonDocs, stencilConfig: Config) => Promise<void> {\n config = {\n ...defaultConfig,\n ...config,\n };\n initialize(config);\n\n return async (docs: JsonDocs, stencilConfig: Config) => {\n logger = stencilConfig.logger;\n const timeSpan = logger.createTimeSpan('kompendium started');\n\n const [jsonDocs, title, readme, guides, types] = await Promise.all([\n addSources(docs),\n getProjectTitle(config),\n getReadme(),\n findGuides(config),\n getTypes(config, stencilConfig.tsconfig),\n ]);\n\n const data: KompendiumData = {\n docs: jsonDocs,\n title: title,\n logo: config.logo,\n menu: createMenu(docs, guides, types),\n readme: readme,\n guides: guides,\n types: types,\n schemas: createSchemas(docs.components, types),\n index: null,\n };\n\n data.index = createIndex(data);\n\n await writeData(config, data);\n\n timeSpan.finish('kompendium finished');\n };\n}\n\nasync function initialize(config: Partial<KompendiumConfig>) {\n const path = `${config.publicPath}/kompendium.json`;\n\n if (isWatcher()) {\n createWatcher(path, 'unlink', onUnlink(config));\n }\n\n await createOutputDirs(config);\n}\n\nconst onUnlink = (config: Partial<KompendiumConfig>) => () => {\n createSymlink(config);\n};\n\nasync function createSymlink(config: Partial<KompendiumConfig>) {\n const source = `${config.path}/kompendium.json`;\n const target = `${config.publicPath}/kompendium.json`;\n\n if (!(await exists(source))) {\n return;\n }\n\n if (await exists(target)) {\n return;\n }\n\n lnk([source], config.publicPath);\n}\n\nasync function getProjectTitle(\n config: Partial<KompendiumConfig>,\n): Promise<string> {\n if (config.title) {\n return config.title;\n }\n\n const json = await readFile('./package.json', 'utf8');\n const data = JSON.parse(json);\n\n return data.name\n .replace(/^@[^/]+?\\//, '')\n .split('-')\n .join(' ');\n}\n\nasync function writeData(\n config: Partial<KompendiumConfig>,\n data: KompendiumData,\n) {\n // Always write to the kompendium config folder (typically `.kompendium` in\n // the root of the project) to avoid Stencil deleting the file during build.\n const filePath = `${config.path}/kompendium.json`;\n\n await writeFile(filePath, JSON.stringify(data), 'utf8');\n\n if (isProd()) {\n // In production, we used to write the kompendium.json file to the\n // public path. We now copy the file to the public path for backwards\n // compatibility with projects that do not have problems with Stencil\n // deleting the file during build. For projects that do have this\n // problem, they can always copy the file from the config folder.\n const publicFilePath = `${config.publicPath}/kompendium.json`;\n if (!(await exists(config.publicPath))) {\n await mkdir(config.publicPath, { recursive: true });\n }\n\n await copyFile(filePath, publicFilePath);\n }\n\n if (isWatcher()) {\n createSymlink(config);\n }\n}\n\nasync function createOutputDirs(config: Partial<KompendiumConfig>) {\n let path = config.path;\n if (!(await exists(path))) {\n mkdir(path, { recursive: true });\n }\n\n path = config.publicPath;\n if (!(await exists(path))) {\n mkdir(path, { recursive: true });\n }\n}\n\nasync function getReadme(): Promise<string> {\n const files = ['readme.md', 'README.md', 'README', 'readme'];\n let data = null;\n\n for (const file of files) {\n if (data) {\n continue;\n }\n\n if (!(await exists(file))) {\n continue;\n }\n\n data = await readFile(file, 'utf8');\n }\n\n if (!data) {\n logger.warn('README did not exist');\n }\n\n return data;\n}\n\nfunction generateDocs(): boolean {\n return !!process.argv.includes('--docs');\n}\n\nfunction isWatcher(): boolean {\n return !!process.argv.includes('--watch');\n}\n\nfunction isProd(): boolean {\n return !(\n process.argv.includes('--dev') ||\n process.argv.includes('test') ||\n process.argv.find((arg) => arg.includes('jest-worker'))\n );\n}\n\nasync function getTypes(\n config: Partial<KompendiumConfig>,\n tsconfig?: string,\n): Promise<TypeDescription[]> {\n logger.debug('Getting type information...');\n let types = await readTypes(config);\n const cache = await readCache(config);\n\n if (types.length === 0 || (await isModified(types, cache))) {\n logger.debug('Parsing types...');\n const data = parseFile(config.typeRoot, tsconfig);\n await saveData(config, data);\n types = data;\n }\n\n return types;\n}\n\nasync function isModified(types: any[], cache: Record<string, number>) {\n if (Object.keys(cache).length === 0) {\n return true;\n }\n\n const filenames = getUniqueSourceFilenames(types);\n const stats = await Promise.all(filenames.map(tryStatFile));\n\n return stats.some((fileStat, index) =>\n hasFileChangedSinceCached(filenames[index], fileStat, cache),\n );\n}\n\nfunction getUniqueSourceFilenames(types: any[]): string[] {\n const filenames = types.map((t) => t.sources).flat();\n\n return [...new Set(filenames)];\n}\n\nfunction tryStatFile(filename: string) {\n return stat(filename).catch(() => null);\n}\n\nfunction hasFileChangedSinceCached(\n filename: string,\n fileStat: Awaited<ReturnType<typeof stat>> | null,\n cache: Record<string, number>,\n): boolean {\n if (!fileStat) {\n logger.debug(`${filename} cannot be accessed, marking as modified`);\n\n return true;\n }\n\n const result = cache[filename] !== fileStat.mtimeMs;\n\n logger.debug(`${filename} was ${result ? '' : 'not'} modified!`);\n\n return result;\n}\n\nasync function saveData(\n config: Partial<KompendiumConfig>,\n types: TypeDescription[],\n) {\n const filenames = getUniqueSourceFilenames(types);\n const stats = await Promise.all(filenames.map(tryStatFile));\n const cache = buildCacheFromFileStats(filenames, stats);\n\n await Promise.all([writeCache(config, cache), writeTypes(config, types)]);\n}\n\nfunction buildCacheFromFileStats(\n filenames: string[],\n stats: Array<Awaited<ReturnType<typeof stat>> | null>,\n): Record<string, number> {\n const cache: Record<string, number> = {};\n\n stats.forEach((fileStat, index) => {\n if (fileStat) {\n cache[filenames[index]] = fileStat.mtimeMs;\n }\n });\n\n return cache;\n}\n\nasync function readCache(config: Partial<KompendiumConfig>) {\n try {\n const data = await readFile(`${config.path}/cache.json`, 'utf8');\n\n return JSON.parse(data);\n } catch {\n return {};\n }\n}\n\nasync function writeCache(config: Partial<KompendiumConfig>, data: any) {\n await writeFile(`${config.path}/cache.json`, JSON.stringify(data), 'utf8');\n}\n\nasync function readTypes(config: Partial<KompendiumConfig>) {\n try {\n const data = await readFile(`${config.path}/types.json`, 'utf8');\n\n return JSON.parse(data);\n } catch {\n return [];\n }\n}\n\nasync function writeTypes(config: Partial<KompendiumConfig>, data: any) {\n await writeFile(`${config.path}/types.json`, JSON.stringify(data), 'utf8');\n}\n"]}
@@ -0,0 +1,30 @@
1
+ import { basename, dirname, resolve } from "path";
2
+ import { readFile } from "fs/promises";
3
+ export async function findGuides(config) {
4
+ const nodes = config.guides.map(createMenuNode('/')).flat();
5
+ const promises = nodes.map(createGuide);
6
+ return Promise.all(promises);
7
+ }
8
+ export const createMenuNode = (path) => (guide) => {
9
+ if (typeof guide !== 'string') {
10
+ const newPath = path + guide.name + '/';
11
+ return guide.children.map(createMenuNode(newPath)).flat();
12
+ }
13
+ return {
14
+ menupath: path,
15
+ filepath: guide,
16
+ };
17
+ };
18
+ export const createGuide = async ({ menupath: path, filepath, }) => {
19
+ const content = await readFile(filepath, 'utf8');
20
+ return {
21
+ dirPath: dirname(filepath),
22
+ fileName: basename(filepath),
23
+ filePath: resolve(filepath),
24
+ data: {
25
+ path: path + basename(filepath),
26
+ },
27
+ content: content,
28
+ };
29
+ };
30
+ //# sourceMappingURL=guides.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guides.js","sourceRoot":"","sources":["../../src/kompendium/guides.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGvC,MAAM,CAAC,KAAK,UAAU,UAAU,CAC5B,MAAiC;IAEjC,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAC5D,MAAM,QAAQ,GAAG,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAExC,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AACjC,CAAC;AAOD,MAAM,CAAC,MAAM,cAAc,GACvB,CAAC,IAAY,EAAE,EAAE,CACjB,CAAC,KAAY,EAAyB,EAAE;IACpC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC5B,MAAM,OAAO,GAAG,IAAI,GAAG,KAAK,CAAC,IAAI,GAAG,GAAG,CAAC;QAExC,OAAO,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAC9D,CAAC;IAED,OAAO;QACH,QAAQ,EAAE,IAAI;QACd,QAAQ,EAAE,KAAK;KAClB,CAAC;AACN,CAAC,CAAC;AAEN,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,EAAE,EAC9B,QAAQ,EAAE,IAAI,EACd,QAAQ,GACD,EAA4B,EAAE;IACrC,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAEjD,OAAO;QACH,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC;QAC1B,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC;QAC5B,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC;QAC3B,IAAI,EAAE;YACF,IAAI,EAAE,IAAI,GAAG,QAAQ,CAAC,QAAQ,CAAC;SAClC;QACD,OAAO,EAAE,OAAO;KACnB,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { basename, dirname, resolve } from 'path';\nimport { readFile } from 'fs/promises';\nimport { KompendiumGuide, KompendiumConfig, Guide } from '../types';\n\nexport async function findGuides(\n config: Partial<KompendiumConfig>,\n): Promise<KompendiumGuide[]> {\n const nodes = config.guides.map(createMenuNode('/')).flat();\n const promises = nodes.map(createGuide);\n\n return Promise.all(promises);\n}\n\ninterface MenuNode {\n menupath: string;\n filepath: string;\n}\n\nexport const createMenuNode =\n (path: string) =>\n (guide: Guide): MenuNode | MenuNode[] => {\n if (typeof guide !== 'string') {\n const newPath = path + guide.name + '/';\n\n return guide.children.map(createMenuNode(newPath)).flat();\n }\n\n return {\n menupath: path,\n filepath: guide,\n };\n };\n\nexport const createGuide = async ({\n menupath: path,\n filepath,\n}: MenuNode): Promise<KompendiumGuide> => {\n const content = await readFile(filepath, 'utf8');\n\n return {\n dirPath: dirname(filepath),\n fileName: basename(filepath),\n filePath: resolve(filepath),\n data: {\n path: path + basename(filepath),\n },\n content: content,\n };\n};\n"]}