@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.
- package/LICENSE +21 -0
- package/README.md +313 -0
- package/dist/cjs/_commonjsHelpers-BJu3ubxk.js +13 -0
- package/dist/cjs/_commonjsHelpers-BJu3ubxk.js.map +1 -0
- package/dist/cjs/anchor-scroll-BmplAyR0.js +69 -0
- package/dist/cjs/anchor-scroll-BmplAyR0.js.map +1 -0
- package/dist/cjs/index-DYiJ6dQL.js +1866 -0
- package/dist/cjs/index-DYiJ6dQL.js.map +1 -0
- package/dist/cjs/index.cjs.js +3 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- 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
- package/dist/cjs/kompendium-app_7.cjs.entry.js +2924 -0
- package/dist/cjs/kompendium-code.cjs.entry.js +2724 -0
- package/dist/cjs/kompendium-code.entry.cjs.js.map +1 -0
- package/dist/cjs/kompendium-component.cjs.entry.js +207 -0
- package/dist/cjs/kompendium-component.entry.cjs.js.map +1 -0
- package/dist/cjs/kompendium-debug.cjs.entry.js +47 -0
- package/dist/cjs/kompendium-debug.entry.cjs.js.map +1 -0
- package/dist/cjs/kompendium-example-code.cjs.entry.js +20 -0
- package/dist/cjs/kompendium-example-code.entry.cjs.js.map +1 -0
- package/dist/cjs/kompendium-example-markdown.cjs.entry.js +165 -0
- package/dist/cjs/kompendium-example-markdown.entry.cjs.js.map +1 -0
- package/dist/cjs/kompendium-guide.cjs.entry.js +33 -0
- package/dist/cjs/kompendium-guide.entry.cjs.js.map +1 -0
- package/dist/cjs/kompendium-markdown.cjs.entry.js +48923 -0
- package/dist/cjs/kompendium-markdown.entry.cjs.js.map +1 -0
- package/dist/cjs/kompendium-playground.cjs.entry.js +89 -0
- package/dist/cjs/kompendium-playground.entry.cjs.js.map +1 -0
- package/dist/cjs/kompendium-proplist.kompendium-taglist.entry.cjs.js.map +1 -0
- package/dist/cjs/kompendium-proplist_2.cjs.entry.js +49 -0
- package/dist/cjs/kompendium-type.cjs.entry.js +83 -0
- package/dist/cjs/kompendium-type.entry.cjs.js.map +1 -0
- package/dist/cjs/kompendium.cjs.js +25 -0
- package/dist/cjs/kompendium.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +13 -0
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/cjs/markdown-types-B884tLd-.js +15 -0
- package/dist/cjs/markdown-types-B884tLd-.js.map +1 -0
- package/dist/cjs/methods-DoA78dOH.js +97 -0
- package/dist/cjs/methods-DoA78dOH.js.map +1 -0
- package/dist/cjs/types-SjA7Kcy_.js +8 -0
- package/dist/cjs/types-SjA7Kcy_.js.map +1 -0
- package/dist/collection/assets/favicon.svg +65 -0
- package/dist/collection/assets/icons/bookmark-fill.svg +1 -0
- package/dist/collection/assets/icons/danger.svg +1 -0
- package/dist/collection/assets/icons/debug.svg +1 -0
- package/dist/collection/assets/icons/important.svg +1 -0
- package/dist/collection/assets/icons/info.svg +1 -0
- package/dist/collection/assets/icons/logo.svg +1 -0
- package/dist/collection/assets/icons/note.svg +1 -0
- package/dist/collection/assets/icons/search.svg +1 -0
- package/dist/collection/assets/icons/tip.svg +1 -0
- package/dist/collection/assets/icons/warning.svg +1 -0
- package/dist/collection/assets/logotype.svg +64 -0
- package/dist/collection/collection-manifest.json +35 -0
- package/dist/collection/components/anchor-scroll.js +61 -0
- package/dist/collection/components/anchor-scroll.js.map +1 -0
- package/dist/collection/components/app/app.css +125 -0
- package/dist/collection/components/app/app.js +149 -0
- package/dist/collection/components/app/app.js.map +1 -0
- package/dist/collection/components/code/code.css +250 -0
- package/dist/collection/components/code/code.js +82 -0
- package/dist/collection/components/code/code.js.map +1 -0
- package/dist/collection/components/code/examples/code.js +14 -0
- package/dist/collection/components/code/examples/code.js.map +1 -0
- package/dist/collection/components/component/component.css +383 -0
- package/dist/collection/components/component/component.js +191 -0
- package/dist/collection/components/component/component.js.map +1 -0
- package/dist/collection/components/component/templates/events.js +32 -0
- package/dist/collection/components/component/templates/events.js.map +1 -0
- package/dist/collection/components/component/templates/examples.js +17 -0
- package/dist/collection/components/component/templates/examples.js.map +1 -0
- package/dist/collection/components/component/templates/methods.js +54 -0
- package/dist/collection/components/component/templates/methods.js.map +1 -0
- package/dist/collection/components/component/templates/props.js +36 -0
- package/dist/collection/components/component/templates/props.js.map +1 -0
- package/dist/collection/components/component/templates/slots.js +14 -0
- package/dist/collection/components/component/templates/slots.js.map +1 -0
- package/dist/collection/components/component/templates/style.js +14 -0
- package/dist/collection/components/component/templates/style.js.map +1 -0
- package/dist/collection/components/darkmode-switch/darkmode-switch.css +141 -0
- package/dist/collection/components/darkmode-switch/darkmode-switch.js +90 -0
- package/dist/collection/components/darkmode-switch/darkmode-switch.js.map +1 -0
- package/dist/collection/components/darkmode-switch/types.js +2 -0
- package/dist/collection/components/darkmode-switch/types.js.map +1 -0
- package/dist/collection/components/debug/debug.js +146 -0
- package/dist/collection/components/debug/debug.js.map +1 -0
- package/dist/collection/components/guide/guide.js +61 -0
- package/dist/collection/components/guide/guide.js.map +1 -0
- package/dist/collection/components/markdown/examples/markdown-example.js +150 -0
- package/dist/collection/components/markdown/examples/markdown-example.js.map +1 -0
- package/dist/collection/components/markdown/examples/markdown.js +14 -0
- package/dist/collection/components/markdown/examples/markdown.js.map +1 -0
- package/dist/collection/components/markdown/markdown-types.js +8 -0
- package/dist/collection/components/markdown/markdown-types.js.map +1 -0
- package/dist/collection/components/markdown/markdown.css +660 -0
- package/dist/collection/components/markdown/markdown.js +83 -0
- package/dist/collection/components/markdown/markdown.js.map +1 -0
- package/dist/collection/components/navigation/navigation.css +403 -0
- package/dist/collection/components/navigation/navigation.js +184 -0
- package/dist/collection/components/navigation/navigation.js.map +1 -0
- package/dist/collection/components/playground/playground.css +198 -0
- package/dist/collection/components/playground/playground.js +174 -0
- package/dist/collection/components/playground/playground.js.map +1 -0
- package/dist/collection/components/playground/playground.types.js +2 -0
- package/dist/collection/components/playground/playground.types.js.map +1 -0
- package/dist/collection/components/proplist/proplist.css +334 -0
- package/dist/collection/components/proplist/proplist.js +53 -0
- package/dist/collection/components/proplist/proplist.js.map +1 -0
- package/dist/collection/components/search/search.css +183 -0
- package/dist/collection/components/search/search.js +76 -0
- package/dist/collection/components/search/search.js.map +1 -0
- package/dist/collection/components/taglist/taglist.css +58 -0
- package/dist/collection/components/taglist/taglist.js +82 -0
- package/dist/collection/components/taglist/taglist.js.map +1 -0
- package/dist/collection/components/type/templates/alias.js +11 -0
- package/dist/collection/components/type/templates/alias.js.map +1 -0
- package/dist/collection/components/type/templates/enum.js +25 -0
- package/dist/collection/components/type/templates/enum.js.map +1 -0
- package/dist/collection/components/type/templates/interface.js +13 -0
- package/dist/collection/components/type/templates/interface.js.map +1 -0
- package/dist/collection/components/type/type.js +97 -0
- package/dist/collection/components/type/type.js.map +1 -0
- package/dist/collection/index.js +4 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/kompendium/config.js +7 -0
- package/dist/collection/kompendium/config.js.map +1 -0
- package/dist/collection/kompendium/filesystem.js +9 -0
- package/dist/collection/kompendium/filesystem.js.map +1 -0
- package/dist/collection/kompendium/generator.js +217 -0
- package/dist/collection/kompendium/generator.js.map +1 -0
- package/dist/collection/kompendium/guides.js +30 -0
- package/dist/collection/kompendium/guides.js.map +1 -0
- package/dist/collection/kompendium/index.js +2 -0
- package/dist/collection/kompendium/index.js.map +1 -0
- package/dist/collection/kompendium/markdown-admonitions.js +82 -0
- package/dist/collection/kompendium/markdown-admonitions.js.map +1 -0
- package/dist/collection/kompendium/markdown-code.js +40 -0
- package/dist/collection/kompendium/markdown-code.js.map +1 -0
- package/dist/collection/kompendium/markdown-frontmatter.js +12 -0
- package/dist/collection/kompendium/markdown-frontmatter.js.map +1 -0
- package/dist/collection/kompendium/markdown-nodes.js +10 -0
- package/dist/collection/kompendium/markdown-nodes.js.map +1 -0
- package/dist/collection/kompendium/markdown-typelinks.js +115 -0
- package/dist/collection/kompendium/markdown-typelinks.js.map +1 -0
- package/dist/collection/kompendium/markdown.js +35 -0
- package/dist/collection/kompendium/markdown.js.map +1 -0
- package/dist/collection/kompendium/menu.js +149 -0
- package/dist/collection/kompendium/menu.js.map +1 -0
- package/dist/collection/kompendium/schema.js +167 -0
- package/dist/collection/kompendium/schema.js.map +1 -0
- package/dist/collection/kompendium/search.js +144 -0
- package/dist/collection/kompendium/search.js.map +1 -0
- package/dist/collection/kompendium/source.js +81 -0
- package/dist/collection/kompendium/source.js.map +1 -0
- package/dist/collection/kompendium/test/fixtures/basic.js +48 -0
- package/dist/collection/kompendium/test/fixtures/basic.js.map +1 -0
- package/dist/collection/kompendium/test/fixtures/filtering/example-type.js +2 -0
- package/dist/collection/kompendium/test/fixtures/filtering/example-type.js.map +1 -0
- package/dist/collection/kompendium/test/fixtures/filtering/node-modules-type.js +2 -0
- package/dist/collection/kompendium/test/fixtures/filtering/node-modules-type.js.map +1 -0
- package/dist/collection/kompendium/test/fixtures/filtering/private-types.js +2 -0
- package/dist/collection/kompendium/test/fixtures/filtering/private-types.js.map +1 -0
- package/dist/collection/kompendium/test/fixtures/filtering/stencil-component-types.js +2 -0
- package/dist/collection/kompendium/test/fixtures/filtering/stencil-component-types.js.map +1 -0
- package/dist/collection/kompendium/test/fixtures/filtering/test-helper-type.js +2 -0
- package/dist/collection/kompendium/test/fixtures/filtering/test-helper-type.js.map +1 -0
- package/dist/collection/kompendium/test/fixtures/filtering/valid-types.js +29 -0
- package/dist/collection/kompendium/test/fixtures/filtering/valid-types.js.map +1 -0
- package/dist/collection/kompendium/typedoc.js +481 -0
- package/dist/collection/kompendium/typedoc.js.map +1 -0
- package/dist/collection/kompendium/watch.js +9 -0
- package/dist/collection/kompendium/watch.js.map +1 -0
- package/dist/collection/types.js +2 -0
- package/dist/collection/types.js.map +1 -0
- package/dist/config.ts +8 -0
- package/dist/esm/_commonjsHelpers-BFTU3MAI.js +10 -0
- package/dist/esm/_commonjsHelpers-BFTU3MAI.js.map +1 -0
- package/dist/esm/anchor-scroll-BAGXN2n6.js +65 -0
- package/dist/esm/anchor-scroll-BAGXN2n6.js.map +1 -0
- package/dist/esm/index-9UrzenzW.js +1857 -0
- package/dist/esm/index-9UrzenzW.js.map +1 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/kompendium-app.kompendium-darkmode-switch.kompendium-navigation.kompendium-search.stencil-route.stencil-route-switch.stencil-router.entry.js.map +1 -0
- package/dist/esm/kompendium-app_7.entry.js +2916 -0
- package/dist/esm/kompendium-code.entry.js +2722 -0
- package/dist/esm/kompendium-code.entry.js.map +1 -0
- package/dist/esm/kompendium-component.entry.js +205 -0
- package/dist/esm/kompendium-component.entry.js.map +1 -0
- package/dist/esm/kompendium-debug.entry.js +45 -0
- package/dist/esm/kompendium-debug.entry.js.map +1 -0
- package/dist/esm/kompendium-example-code.entry.js +18 -0
- package/dist/esm/kompendium-example-code.entry.js.map +1 -0
- package/dist/esm/kompendium-example-markdown.entry.js +163 -0
- package/dist/esm/kompendium-example-markdown.entry.js.map +1 -0
- package/dist/esm/kompendium-guide.entry.js +31 -0
- package/dist/esm/kompendium-guide.entry.js.map +1 -0
- package/dist/esm/kompendium-markdown.entry.js +48921 -0
- package/dist/esm/kompendium-markdown.entry.js.map +1 -0
- package/dist/esm/kompendium-playground.entry.js +87 -0
- package/dist/esm/kompendium-playground.entry.js.map +1 -0
- package/dist/esm/kompendium-proplist.kompendium-taglist.entry.js.map +1 -0
- package/dist/esm/kompendium-proplist_2.entry.js +46 -0
- package/dist/esm/kompendium-type.entry.js +81 -0
- package/dist/esm/kompendium-type.entry.js.map +1 -0
- package/dist/esm/kompendium.js +21 -0
- package/dist/esm/kompendium.js.map +1 -0
- package/dist/esm/loader.js +11 -0
- package/dist/esm/loader.js.map +1 -0
- package/dist/esm/markdown-types-Ajsawr_9.js +12 -0
- package/dist/esm/markdown-types-Ajsawr_9.js.map +1 -0
- package/dist/esm/methods-BAjd6f7g.js +94 -0
- package/dist/esm/methods-BAjd6f7g.js.map +1 -0
- package/dist/esm/types-BIPLEi1G.js +6 -0
- package/dist/esm/types-BIPLEi1G.js.map +1 -0
- package/dist/filesystem.ts +9 -0
- package/dist/generator.ts +302 -0
- package/dist/guides.ts +49 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/index.ts +1 -0
- package/dist/kompendium/index.esm.js +2 -0
- package/dist/kompendium/index.esm.js.map +1 -0
- 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
- package/dist/kompendium/kompendium-code.entry.esm.js.map +1 -0
- package/dist/kompendium/kompendium-component.entry.esm.js.map +1 -0
- package/dist/kompendium/kompendium-debug.entry.esm.js.map +1 -0
- package/dist/kompendium/kompendium-example-code.entry.esm.js.map +1 -0
- package/dist/kompendium/kompendium-example-markdown.entry.esm.js.map +1 -0
- package/dist/kompendium/kompendium-guide.entry.esm.js.map +1 -0
- package/dist/kompendium/kompendium-markdown.entry.esm.js.map +1 -0
- package/dist/kompendium/kompendium-playground.entry.esm.js.map +1 -0
- package/dist/kompendium/kompendium-proplist.kompendium-taglist.entry.esm.js.map +1 -0
- package/dist/kompendium/kompendium-type.entry.esm.js.map +1 -0
- package/dist/kompendium/kompendium.css +47 -0
- package/dist/kompendium/kompendium.esm.js +2 -0
- package/dist/kompendium/kompendium.esm.js.map +1 -0
- package/dist/kompendium/loader.esm.js.map +1 -0
- package/dist/kompendium/p-15e4b2c0.entry.js +2 -0
- package/dist/kompendium/p-15e4b2c0.entry.js.map +1 -0
- package/dist/kompendium/p-1cf0168f.entry.js +2 -0
- package/dist/kompendium/p-1cf0168f.entry.js.map +1 -0
- package/dist/kompendium/p-29c23c89.entry.js +2 -0
- package/dist/kompendium/p-29c23c89.entry.js.map +1 -0
- package/dist/kompendium/p-3981d11f.entry.js +2 -0
- package/dist/kompendium/p-3981d11f.entry.js.map +1 -0
- package/dist/kompendium/p-93f0548d.entry.js +2 -0
- package/dist/kompendium/p-93f0548d.entry.js.map +1 -0
- package/dist/kompendium/p-97b02575.entry.js +2 -0
- package/dist/kompendium/p-97b02575.entry.js.map +1 -0
- package/dist/kompendium/p-9UrzenzW.js +3 -0
- package/dist/kompendium/p-9UrzenzW.js.map +1 -0
- package/dist/kompendium/p-Ajsawr_9.js +2 -0
- package/dist/kompendium/p-Ajsawr_9.js.map +1 -0
- package/dist/kompendium/p-BAGXN2n6.js +2 -0
- package/dist/kompendium/p-BAGXN2n6.js.map +1 -0
- package/dist/kompendium/p-BFTU3MAI.js +2 -0
- package/dist/kompendium/p-BFTU3MAI.js.map +1 -0
- package/dist/kompendium/p-BIPLEi1G.js +2 -0
- package/dist/kompendium/p-BIPLEi1G.js.map +1 -0
- package/dist/kompendium/p-CnQEA7KO.js +2 -0
- package/dist/kompendium/p-CnQEA7KO.js.map +1 -0
- package/dist/kompendium/p-b0f95bd6.entry.js +2 -0
- package/dist/kompendium/p-b0f95bd6.entry.js.map +1 -0
- package/dist/kompendium/p-d9bcc473.entry.js +10 -0
- package/dist/kompendium/p-d9bcc473.entry.js.map +1 -0
- package/dist/kompendium/p-e36f3f1e.entry.js +2 -0
- package/dist/kompendium/p-e36f3f1e.entry.js.map +1 -0
- package/dist/kompendium/p-e52a2f57.entry.js +2 -0
- package/dist/kompendium/p-e52a2f57.entry.js.map +1 -0
- package/dist/kompendium/p-ec5861de.entry.js +2 -0
- package/dist/kompendium/p-ec5861de.entry.js.map +1 -0
- package/dist/markdown-admonitions.ts +112 -0
- package/dist/markdown-code.ts +51 -0
- package/dist/markdown-frontmatter.ts +19 -0
- package/dist/markdown-nodes.ts +23 -0
- package/dist/markdown-typelinks.ts +166 -0
- package/dist/markdown.ts +49 -0
- package/dist/menu.ts +189 -0
- package/dist/schema.ts +233 -0
- package/dist/search.ts +197 -0
- package/dist/source.ts +129 -0
- package/dist/typedoc.ts +665 -0
- package/dist/types/components/anchor-scroll.d.ts +36 -0
- package/dist/types/components/app/app.d.ts +22 -0
- package/dist/types/components/code/code.d.ts +26 -0
- package/dist/types/components/code/examples/code.d.ts +3 -0
- package/dist/types/components/component/component.d.ts +32 -0
- package/dist/types/components/component/templates/events.d.ts +5 -0
- package/dist/types/components/component/templates/examples.d.ts +9 -0
- package/dist/types/components/component/templates/methods.d.ts +5 -0
- package/dist/types/components/component/templates/props.d.ts +5 -0
- package/dist/types/components/component/templates/slots.d.ts +5 -0
- package/dist/types/components/component/templates/style.d.ts +5 -0
- package/dist/types/components/darkmode-switch/darkmode-switch.d.ts +18 -0
- package/dist/types/components/darkmode-switch/types.d.ts +2 -0
- package/dist/types/components/debug/debug.d.ts +24 -0
- package/dist/types/components/guide/guide.d.ts +14 -0
- package/dist/types/components/markdown/examples/markdown-example.d.ts +1 -0
- package/dist/types/components/markdown/examples/markdown.d.ts +7 -0
- package/dist/types/components/markdown/markdown-types.d.ts +2 -0
- package/dist/types/components/markdown/markdown.d.ts +20 -0
- package/dist/types/components/navigation/navigation.d.ts +35 -0
- package/dist/types/components/playground/playground.d.ts +32 -0
- package/dist/types/components/playground/playground.types.d.ts +1 -0
- package/dist/types/components/proplist/proplist.d.ts +12 -0
- package/dist/types/components/search/search.d.ts +15 -0
- package/dist/types/components/taglist/taglist.d.ts +16 -0
- package/dist/types/components/type/templates/alias.d.ts +4 -0
- package/dist/types/components/type/templates/enum.d.ts +4 -0
- package/dist/types/components/type/templates/interface.d.ts +4 -0
- package/dist/types/components/type/type.d.ts +15 -0
- package/dist/types/components.d.ts +517 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/kompendium/config.d.ts +2 -0
- package/dist/types/kompendium/filesystem.d.ts +1 -0
- package/dist/types/kompendium/generator.d.ts +4 -0
- package/dist/types/kompendium/guides.d.ts +9 -0
- package/dist/types/kompendium/index.d.ts +1 -0
- package/dist/types/kompendium/markdown-admonitions.d.ts +3 -0
- package/dist/types/kompendium/markdown-code.d.ts +2 -0
- package/dist/types/kompendium/markdown-frontmatter.d.ts +6 -0
- package/dist/types/kompendium/markdown-nodes.d.ts +12 -0
- package/dist/types/kompendium/markdown-typelinks.d.ts +21 -0
- package/dist/types/kompendium/markdown.d.ts +8 -0
- package/dist/types/kompendium/menu.d.ts +12 -0
- package/dist/types/kompendium/schema.d.ts +9 -0
- package/dist/types/kompendium/search.d.ts +3 -0
- package/dist/types/kompendium/source.d.ts +10 -0
- package/dist/types/kompendium/test/fixtures/basic.d.ts +65 -0
- package/dist/types/kompendium/test/fixtures/filtering/example-type.d.ts +8 -0
- package/dist/types/kompendium/test/fixtures/filtering/node-modules-type.d.ts +8 -0
- package/dist/types/kompendium/test/fixtures/filtering/private-types.d.ts +23 -0
- package/dist/types/kompendium/test/fixtures/filtering/stencil-component-types.d.ts +19 -0
- package/dist/types/kompendium/test/fixtures/filtering/test-helper-type.d.ts +8 -0
- package/dist/types/kompendium/test/fixtures/filtering/valid-types.d.ts +42 -0
- package/dist/types/kompendium/typedoc.d.ts +2 -0
- package/dist/types/kompendium/watch.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1746 -0
- package/dist/types/types.d.ts +119 -0
- package/dist/watch.ts +14 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/package.json +116 -0
|
@@ -0,0 +1,481 @@
|
|
|
1
|
+
import { Application, ReflectionKind, TypeDocReader, TSConfigReader, } from "typedoc";
|
|
2
|
+
import { existsSync, readFileSync } from "fs";
|
|
3
|
+
import ts from "typescript";
|
|
4
|
+
export function parseFile(filename, tsconfig) {
|
|
5
|
+
if (!existsSync(filename)) {
|
|
6
|
+
// eslint-disable-next-line no-console
|
|
7
|
+
console.warn('typeRoot file does not exist', filename);
|
|
8
|
+
return [];
|
|
9
|
+
}
|
|
10
|
+
const app = new Application();
|
|
11
|
+
// Use current working directory as TypeDoc's base path for clean relative paths
|
|
12
|
+
const projectRoot = process.cwd();
|
|
13
|
+
const options = {
|
|
14
|
+
entryPoints: [filename],
|
|
15
|
+
skipErrorChecking: true,
|
|
16
|
+
basePath: projectRoot,
|
|
17
|
+
};
|
|
18
|
+
if (tsconfig) {
|
|
19
|
+
options.tsconfig = tsconfig;
|
|
20
|
+
}
|
|
21
|
+
if (filename.endsWith('.d.ts')) {
|
|
22
|
+
options.exclude = ['**/+(*test*|node_modules)/**'];
|
|
23
|
+
}
|
|
24
|
+
app.options.addReader(new TypeDocReader());
|
|
25
|
+
app.options.addReader(new TSConfigReader());
|
|
26
|
+
app.bootstrap(options);
|
|
27
|
+
const project = app.convert();
|
|
28
|
+
if (!project) {
|
|
29
|
+
// eslint-disable-next-line no-console
|
|
30
|
+
console.warn('Could not find any type information');
|
|
31
|
+
return [];
|
|
32
|
+
}
|
|
33
|
+
const data = [];
|
|
34
|
+
const allInterfaces = project.getReflectionsByKind(ReflectionKind.Interface);
|
|
35
|
+
const allClasses = project.getReflectionsByKind(ReflectionKind.Class);
|
|
36
|
+
const allTypeAliases = project.getReflectionsByKind(ReflectionKind.TypeAlias);
|
|
37
|
+
const allEnums = project.getReflectionsByKind(ReflectionKind.Enum);
|
|
38
|
+
const interfaces = allInterfaces.filter((r) => shouldIncludeType(r));
|
|
39
|
+
const classes = allClasses.filter((r) => shouldIncludeType(r));
|
|
40
|
+
const typeAliases = allTypeAliases.filter((r) => shouldIncludeType(r));
|
|
41
|
+
const enums = allEnums.filter((r) => shouldIncludeType(r));
|
|
42
|
+
interfaces.forEach((reflection) => addInterface(reflection, data));
|
|
43
|
+
classes.forEach((reflection) => addClass(reflection, data));
|
|
44
|
+
typeAliases.forEach((reflection) => addType(reflection, data));
|
|
45
|
+
enums.forEach((reflection) => {
|
|
46
|
+
var _a;
|
|
47
|
+
const members = [];
|
|
48
|
+
const enumReflection = reflection;
|
|
49
|
+
(_a = enumReflection.children) === null || _a === void 0 ? void 0 : _a.forEach((child) => {
|
|
50
|
+
if (child.kind === ReflectionKind.EnumMember) {
|
|
51
|
+
addEnumMember(child, members);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
data.push({
|
|
55
|
+
type: 'enum',
|
|
56
|
+
name: enumReflection.name,
|
|
57
|
+
docs: getDocs(enumReflection),
|
|
58
|
+
docsTags: getDocsTags(enumReflection),
|
|
59
|
+
members: members,
|
|
60
|
+
sources: getSources(enumReflection),
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
return data;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Determines if a type should be included in the documentation based on its source location
|
|
67
|
+
* and documentation tags.
|
|
68
|
+
*
|
|
69
|
+
* Excludes types from:
|
|
70
|
+
* - node_modules (third-party dependencies)
|
|
71
|
+
* - examples directories
|
|
72
|
+
* - test files (.test., .spec., /test/, /tests/)
|
|
73
|
+
* - Types marked with @private or @internal tags
|
|
74
|
+
* - Stencil auto-generated types (components.d.ts, Components namespace, CustomEvent wrappers)
|
|
75
|
+
* @param {DeclarationReflection} reflection - The TypeDoc reflection to check
|
|
76
|
+
* @returns {boolean} true if the type should be documented, false otherwise
|
|
77
|
+
*/
|
|
78
|
+
function shouldIncludeType(reflection) {
|
|
79
|
+
var _a;
|
|
80
|
+
if (!reflection.sources || reflection.sources.length === 0) {
|
|
81
|
+
// No source information - include by default
|
|
82
|
+
return true;
|
|
83
|
+
}
|
|
84
|
+
for (const source of reflection.sources) {
|
|
85
|
+
const sourcePath = source.fullFileName || source.fileName || '';
|
|
86
|
+
if (shouldExcludeSource(sourcePath)) {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
// Exclude CustomEvent wrapper types
|
|
91
|
+
// These are generic wrappers around CustomEvent<T> that don't add useful
|
|
92
|
+
// documentation
|
|
93
|
+
if (reflection.name.endsWith('CustomEvent')) {
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
// Exclude HTML element interface types
|
|
97
|
+
// These are DOM element interfaces (HTMLLimelButtonElement, etc.) already
|
|
98
|
+
// documented in the Components section
|
|
99
|
+
if (reflection.name.startsWith('HTML') &&
|
|
100
|
+
reflection.name.endsWith('Element')) {
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
// Exclude types in Stencil's Components namespace
|
|
104
|
+
// Belt-and-suspenders: catches any component interfaces that were not
|
|
105
|
+
// excluded based on source location
|
|
106
|
+
if (isInComponentsNamespace(reflection)) {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
// Don't include anything marked @private or @internal
|
|
110
|
+
if ((_a = reflection.comment) === null || _a === void 0 ? void 0 : _a.blockTags) {
|
|
111
|
+
const hasPrivateTag = reflection.comment.blockTags.some((tag) => tag.tag === '@private' || tag.tag === '@internal');
|
|
112
|
+
if (hasPrivateTag) {
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
// Include this type
|
|
117
|
+
return true;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Checks if a source path should be excluded from documentation.
|
|
121
|
+
* @param {string} sourcePath - The file path to check
|
|
122
|
+
* @returns {boolean} true if the source should be excluded, false otherwise
|
|
123
|
+
*/
|
|
124
|
+
function shouldExcludeSource(sourcePath) {
|
|
125
|
+
const normalizedPath = sourcePath.replaceAll('\\', '/');
|
|
126
|
+
if (normalizedPath.includes('node_modules/')) {
|
|
127
|
+
return true;
|
|
128
|
+
}
|
|
129
|
+
if (normalizedPath.includes('/examples/') ||
|
|
130
|
+
normalizedPath.includes('/example/')) {
|
|
131
|
+
return true;
|
|
132
|
+
}
|
|
133
|
+
if (normalizedPath.includes('.test.') ||
|
|
134
|
+
normalizedPath.includes('.spec.')) {
|
|
135
|
+
return true;
|
|
136
|
+
}
|
|
137
|
+
// This file contains component prop interfaces and HTML element types that
|
|
138
|
+
// are already documented in the Components section
|
|
139
|
+
return normalizedPath.endsWith('components.d.ts');
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Checks if a TypeDoc reflection is defined within Stencil's Components namespace.
|
|
143
|
+
*
|
|
144
|
+
* Stencil generates a Components namespace in components.d.ts containing interfaces
|
|
145
|
+
* for component props. These types are already documented in the Components section
|
|
146
|
+
* and should not be duplicated in the Types section.
|
|
147
|
+
* @param {DeclarationReflection} reflection - The TypeDoc reflection to check
|
|
148
|
+
* @returns {boolean} true if the reflection is in a Components namespace, false otherwise
|
|
149
|
+
*/
|
|
150
|
+
function isInComponentsNamespace(reflection) {
|
|
151
|
+
let current = reflection.parent;
|
|
152
|
+
while (current) {
|
|
153
|
+
if (current.kind === ReflectionKind.Namespace &&
|
|
154
|
+
current.name === 'Components') {
|
|
155
|
+
return true;
|
|
156
|
+
}
|
|
157
|
+
current = current.parent;
|
|
158
|
+
}
|
|
159
|
+
return false;
|
|
160
|
+
}
|
|
161
|
+
const fns = {
|
|
162
|
+
[ReflectionKind.Interface]: addInterface,
|
|
163
|
+
[ReflectionKind.Class]: addClass,
|
|
164
|
+
[ReflectionKind.TypeAlias]: addType,
|
|
165
|
+
[ReflectionKind.Enum]: addEnum,
|
|
166
|
+
[ReflectionKind.EnumMember]: addEnumMember,
|
|
167
|
+
};
|
|
168
|
+
const traverseCallback = (data) => (reflection) => {
|
|
169
|
+
const fn = fns[reflection.kind];
|
|
170
|
+
if (fn) {
|
|
171
|
+
fn(reflection, data);
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
reflection.traverse(traverseCallback(data));
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
function addInterface(reflection, data) {
|
|
178
|
+
var _a, _b;
|
|
179
|
+
data.push({
|
|
180
|
+
type: 'interface',
|
|
181
|
+
name: reflection.name,
|
|
182
|
+
typeParams: getTypeParams(reflection),
|
|
183
|
+
docs: getDocs(reflection),
|
|
184
|
+
docsTags: getDocsTags(reflection),
|
|
185
|
+
props: ((_a = reflection.children) === null || _a === void 0 ? void 0 : _a.filter(isProperty).map(getProperty)) || [],
|
|
186
|
+
methods: ((_b = reflection.children) === null || _b === void 0 ? void 0 : _b.filter(isMethod).map(getMethod)) || [],
|
|
187
|
+
sources: getSources(reflection),
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
function addClass(reflection, data) {
|
|
191
|
+
var _a, _b;
|
|
192
|
+
const decorators = getDecorators(reflection);
|
|
193
|
+
const implementedInterfaces = getImplementedInterfaces(reflection);
|
|
194
|
+
data.push({
|
|
195
|
+
type: 'class',
|
|
196
|
+
name: reflection.name,
|
|
197
|
+
typeParams: getTypeParams(reflection),
|
|
198
|
+
docs: getDocs(reflection),
|
|
199
|
+
docsTags: getDocsTags(reflection),
|
|
200
|
+
props: ((_a = reflection.children) === null || _a === void 0 ? void 0 : _a.filter(isProperty).map((prop) => getPropertyWithInheritDoc(prop, implementedInterfaces))) || [],
|
|
201
|
+
methods: ((_b = reflection.children) === null || _b === void 0 ? void 0 : _b.filter(isMethod).map((method) => getMethodWithInheritDoc(method, implementedInterfaces))) || [],
|
|
202
|
+
sources: getSources(reflection),
|
|
203
|
+
decorators: decorators,
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
function addType(reflection, data) {
|
|
207
|
+
data.push({
|
|
208
|
+
type: 'alias',
|
|
209
|
+
name: reflection.name,
|
|
210
|
+
docs: getDocs(reflection),
|
|
211
|
+
docsTags: getDocsTags(reflection),
|
|
212
|
+
alias: reflection.type.toString(),
|
|
213
|
+
sources: getSources(reflection),
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
function addEnum(reflection, data) {
|
|
217
|
+
const members = [];
|
|
218
|
+
reflection.traverse(traverseCallback(members));
|
|
219
|
+
data.push({
|
|
220
|
+
type: 'enum',
|
|
221
|
+
name: reflection.name,
|
|
222
|
+
docs: getDocs(reflection),
|
|
223
|
+
docsTags: getDocsTags(reflection),
|
|
224
|
+
members: members,
|
|
225
|
+
sources: getSources(reflection),
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
function addEnumMember(reflection, data) {
|
|
229
|
+
let value;
|
|
230
|
+
if (reflection.type && reflection.type.type === 'literal') {
|
|
231
|
+
const literalValue = reflection.type.value;
|
|
232
|
+
if (typeof literalValue === 'string') {
|
|
233
|
+
value = `"${literalValue}"`;
|
|
234
|
+
}
|
|
235
|
+
else {
|
|
236
|
+
value = String(literalValue);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
else {
|
|
240
|
+
value = reflection.defaultValue;
|
|
241
|
+
}
|
|
242
|
+
data.push({
|
|
243
|
+
name: reflection.name,
|
|
244
|
+
docs: getDocs(reflection),
|
|
245
|
+
docsTags: getDocsTags(reflection),
|
|
246
|
+
value: value,
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
function getDocs(reflection) {
|
|
250
|
+
var _a;
|
|
251
|
+
if (!reflection.comment) {
|
|
252
|
+
return '';
|
|
253
|
+
}
|
|
254
|
+
const text = ((_a = reflection.comment.summary) === null || _a === void 0 ? void 0 : _a.map((part) => part.text).join('').trim()) || '';
|
|
255
|
+
// Normalize multiple newlines to single newlines
|
|
256
|
+
return text.replaceAll(/\n\n+/g, '\n');
|
|
257
|
+
}
|
|
258
|
+
function getDocsTags(reflection) {
|
|
259
|
+
var _a, _b;
|
|
260
|
+
return ((_b = (_a = reflection.comment) === null || _a === void 0 ? void 0 : _a.blockTags) === null || _b === void 0 ? void 0 : _b.map(getTag)) || [];
|
|
261
|
+
}
|
|
262
|
+
function getTag(tag) {
|
|
263
|
+
var _a;
|
|
264
|
+
// tag already has @ prefix, so remove it
|
|
265
|
+
const tagName = tag.tag.replace(/^@+/, '');
|
|
266
|
+
return {
|
|
267
|
+
name: tagName,
|
|
268
|
+
text: ((_a = tag.content) === null || _a === void 0 ? void 0 : _a.map((part) => part.text).join('').trim()) || '',
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
function isProperty(reflection) {
|
|
272
|
+
var _a;
|
|
273
|
+
if (reflection.kind !== ReflectionKind.Property) {
|
|
274
|
+
return false;
|
|
275
|
+
}
|
|
276
|
+
const type = reflection.type;
|
|
277
|
+
return !((type === null || type === void 0 ? void 0 : type.type) === 'reflection' && ((_a = type.declaration) === null || _a === void 0 ? void 0 : _a.signatures));
|
|
278
|
+
}
|
|
279
|
+
function isMethod(reflection) {
|
|
280
|
+
var _a;
|
|
281
|
+
if (reflection.kind !== ReflectionKind.Property) {
|
|
282
|
+
return false;
|
|
283
|
+
}
|
|
284
|
+
const type = reflection.type;
|
|
285
|
+
return (type === null || type === void 0 ? void 0 : type.type) === 'reflection' && ((_a = type.declaration) === null || _a === void 0 ? void 0 : _a.signatures);
|
|
286
|
+
}
|
|
287
|
+
function getProperty(reflection) {
|
|
288
|
+
return {
|
|
289
|
+
name: reflection.name,
|
|
290
|
+
type: reflection.type.toString(),
|
|
291
|
+
docs: getDocs(reflection),
|
|
292
|
+
docsTags: getDocsTags(reflection),
|
|
293
|
+
default: reflection.defaultValue,
|
|
294
|
+
optional: reflection.flags.isOptional,
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
function getMethod(reflection) {
|
|
298
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
299
|
+
const type = reflection.type;
|
|
300
|
+
const signature = (_b = (_a = type === null || type === void 0 ? void 0 : type.declaration) === null || _a === void 0 ? void 0 : _a.signatures) === null || _b === void 0 ? void 0 : _b[0];
|
|
301
|
+
if (!signature) {
|
|
302
|
+
return {
|
|
303
|
+
name: reflection.name,
|
|
304
|
+
docs: getDocs(reflection),
|
|
305
|
+
docsTags: [],
|
|
306
|
+
parameters: [],
|
|
307
|
+
returns: { type: 'void', docs: '' },
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
let docs = ((_d = (_c = signature.comment) === null || _c === void 0 ? void 0 : _c.summary) === null || _d === void 0 ? void 0 : _d.map((part) => part.text).join('').trim()) || '';
|
|
311
|
+
// Normalize multiple newlines to single newlines
|
|
312
|
+
docs = docs.replaceAll(/\n\n+/g, '\n');
|
|
313
|
+
const parameters = ((_e = signature.parameters) === null || _e === void 0 ? void 0 : _e.map((param) => {
|
|
314
|
+
var _a, _b, _c, _d;
|
|
315
|
+
return ({
|
|
316
|
+
name: param.name,
|
|
317
|
+
type: ((_a = param.type) === null || _a === void 0 ? void 0 : _a.toString()) || 'any',
|
|
318
|
+
docs: ((_c = (_b = param.comment) === null || _b === void 0 ? void 0 : _b.summary) === null || _c === void 0 ? void 0 : _c.map((part) => part.text).join('').trim()) || '',
|
|
319
|
+
default: param.defaultValue,
|
|
320
|
+
optional: ((_d = param.flags) === null || _d === void 0 ? void 0 : _d.isOptional) || false,
|
|
321
|
+
});
|
|
322
|
+
})) || [];
|
|
323
|
+
const returnsTag = (_g = (_f = signature.comment) === null || _f === void 0 ? void 0 : _f.blockTags) === null || _g === void 0 ? void 0 : _g.find((tag) => tag.tag === '@returns');
|
|
324
|
+
const returnsText = ((_h = returnsTag === null || returnsTag === void 0 ? void 0 : returnsTag.content) === null || _h === void 0 ? void 0 : _h.map((part) => part.text).join('').trim()) || '';
|
|
325
|
+
const returns = {
|
|
326
|
+
type: ((_j = signature.type) === null || _j === void 0 ? void 0 : _j.toString()) || 'void',
|
|
327
|
+
docs: returnsText,
|
|
328
|
+
};
|
|
329
|
+
const docsTags = ((_l = (_k = signature.comment) === null || _k === void 0 ? void 0 : _k.blockTags) === null || _l === void 0 ? void 0 : _l.filter((tag) => tag.tag !== '@param' && tag.tag !== '@returns').map(getTag)) || [];
|
|
330
|
+
return {
|
|
331
|
+
name: reflection.name,
|
|
332
|
+
docs: docs,
|
|
333
|
+
docsTags: docsTags,
|
|
334
|
+
parameters: parameters,
|
|
335
|
+
returns: returns,
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
function getImplementedInterfaces(reflection) {
|
|
339
|
+
const interfaces = [];
|
|
340
|
+
const implemented = reflection.implementedTypes;
|
|
341
|
+
if (implemented) {
|
|
342
|
+
implemented.forEach((type) => {
|
|
343
|
+
if (type.reflection) {
|
|
344
|
+
interfaces.push(type.reflection);
|
|
345
|
+
}
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
return interfaces;
|
|
349
|
+
}
|
|
350
|
+
function getPropertyWithInheritDoc(reflection, interfaces) {
|
|
351
|
+
var _a, _b, _c;
|
|
352
|
+
const prop = getProperty(reflection);
|
|
353
|
+
const hasInheritDoc = (_b = (_a = reflection.comment) === null || _a === void 0 ? void 0 : _a.blockTags) === null || _b === void 0 ? void 0 : _b.some((tag) => tag.tag.toLowerCase() === '@inheritdoc');
|
|
354
|
+
if (hasInheritDoc && interfaces.length > 0) {
|
|
355
|
+
// Try to find the property in implemented interfaces
|
|
356
|
+
for (const iface of interfaces) {
|
|
357
|
+
const interfaceProp = (_c = iface.children) === null || _c === void 0 ? void 0 : _c.find((child) => child.name === reflection.name);
|
|
358
|
+
if (interfaceProp) {
|
|
359
|
+
return {
|
|
360
|
+
...prop,
|
|
361
|
+
docs: getDocs(interfaceProp),
|
|
362
|
+
docsTags: getDocsTags(interfaceProp),
|
|
363
|
+
};
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
return prop;
|
|
368
|
+
}
|
|
369
|
+
function getMethodWithInheritDoc(reflection, interfaces) {
|
|
370
|
+
var _a, _b, _c, _d, _e;
|
|
371
|
+
const type = reflection.type;
|
|
372
|
+
const signature = (_b = (_a = type === null || type === void 0 ? void 0 : type.declaration) === null || _a === void 0 ? void 0 : _a.signatures) === null || _b === void 0 ? void 0 : _b[0];
|
|
373
|
+
const hasInheritDoc = (_d = (_c = signature === null || signature === void 0 ? void 0 : signature.comment) === null || _c === void 0 ? void 0 : _c.blockTags) === null || _d === void 0 ? void 0 : _d.some((tag) => tag.tag.toLowerCase() === '@inheritdoc');
|
|
374
|
+
if (hasInheritDoc && interfaces.length > 0) {
|
|
375
|
+
for (const iface of interfaces) {
|
|
376
|
+
const interfaceMethod = (_e = iface.children) === null || _e === void 0 ? void 0 : _e.find((child) => child.name === reflection.name);
|
|
377
|
+
if (interfaceMethod) {
|
|
378
|
+
return getMethod(interfaceMethod);
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
return getMethod(reflection);
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* Extract decorator information from TypeScript source code using AST parsing
|
|
386
|
+
*
|
|
387
|
+
* TypeDoc 0.23 removed the decorators property from DeclarationReflection,
|
|
388
|
+
* which was present in 0.17. This function works around that limitation by
|
|
389
|
+
* parsing the original TypeScript source files to extract decorator information.
|
|
390
|
+
* @param {DeclarationReflection} reflection - The TypeDoc reflection to extract decorators from
|
|
391
|
+
* @returns {DecoratorDescription[]} Array of decorator descriptions with names and arguments
|
|
392
|
+
* @remarks
|
|
393
|
+
* This is a workaround for incomplete TypeDoc 0.23 API. TypeDoc removed
|
|
394
|
+
* decorator information from their reflection model, but decorators are
|
|
395
|
+
* essential for documenting Stencil components (e.g., @Component, @Prop).
|
|
396
|
+
*
|
|
397
|
+
* Performance considerations:
|
|
398
|
+
* - Reads and parses source files on demand (I/O + parsing overhead)
|
|
399
|
+
* - Caches nothing - each call re-parses the file
|
|
400
|
+
* - For large codebases, consider caching parsed source files
|
|
401
|
+
*
|
|
402
|
+
* Known limitations:
|
|
403
|
+
* - Only extracts class-level decorators, not property/method decorators
|
|
404
|
+
* - Decorator arguments are captured as raw text, not parsed
|
|
405
|
+
* - Fails silently if source file is unavailable or parsing fails
|
|
406
|
+
* - Depends on TypeScript AST structure (may break with TS version changes)
|
|
407
|
+
* @example
|
|
408
|
+
* ```typescript
|
|
409
|
+
* // For a class like:
|
|
410
|
+
* @Component({ tag: 'my-component' })
|
|
411
|
+
* class MyComponent { }
|
|
412
|
+
*
|
|
413
|
+
* // Returns:
|
|
414
|
+
* [{
|
|
415
|
+
* name: 'Component',
|
|
416
|
+
* arguments: { _config: "{ tag: 'my-component' }" }
|
|
417
|
+
* }]
|
|
418
|
+
* ```
|
|
419
|
+
*/
|
|
420
|
+
function getDecorators(reflection) {
|
|
421
|
+
if (!reflection.sources || reflection.sources.length === 0) {
|
|
422
|
+
return [];
|
|
423
|
+
}
|
|
424
|
+
const source = reflection.sources[0];
|
|
425
|
+
const fileName = source.fullFileName || source.fileName;
|
|
426
|
+
if (!existsSync(fileName)) {
|
|
427
|
+
return [];
|
|
428
|
+
}
|
|
429
|
+
try {
|
|
430
|
+
const sourceFile = ts.createSourceFile(fileName, readFileSync(fileName, 'utf8'), ts.ScriptTarget.Latest, true);
|
|
431
|
+
let decorators = [];
|
|
432
|
+
const visit = (node) => {
|
|
433
|
+
var _a;
|
|
434
|
+
if (ts.isClassDeclaration(node) &&
|
|
435
|
+
((_a = node.name) === null || _a === void 0 ? void 0 : _a.getText()) === reflection.name) {
|
|
436
|
+
let nodeDecorators;
|
|
437
|
+
if (ts.canHaveDecorators(node)) {
|
|
438
|
+
nodeDecorators = ts.getDecorators(node);
|
|
439
|
+
}
|
|
440
|
+
if (nodeDecorators) {
|
|
441
|
+
decorators = nodeDecorators.map((decorator) => {
|
|
442
|
+
const expression = decorator.expression;
|
|
443
|
+
let name = '';
|
|
444
|
+
let args = {};
|
|
445
|
+
if (ts.isCallExpression(expression)) {
|
|
446
|
+
name = expression.expression.getText();
|
|
447
|
+
if (expression.arguments.length > 0) {
|
|
448
|
+
args = {
|
|
449
|
+
_config: expression.arguments[0].getText(),
|
|
450
|
+
};
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
else {
|
|
454
|
+
name = expression.getText();
|
|
455
|
+
}
|
|
456
|
+
return { name: name, arguments: args };
|
|
457
|
+
});
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
ts.forEachChild(node, visit);
|
|
461
|
+
};
|
|
462
|
+
visit(sourceFile);
|
|
463
|
+
return decorators;
|
|
464
|
+
}
|
|
465
|
+
catch (error) {
|
|
466
|
+
// eslint-disable-next-line no-console
|
|
467
|
+
console.warn('Failed to parse decorators:', error);
|
|
468
|
+
return [];
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
function getTypeParams(reflection) {
|
|
472
|
+
var _a;
|
|
473
|
+
return (((_a = reflection.typeParameters) === null || _a === void 0 ? void 0 : _a.map((param) => ({
|
|
474
|
+
name: param.name,
|
|
475
|
+
}))) || []);
|
|
476
|
+
}
|
|
477
|
+
function getSources(reflection) {
|
|
478
|
+
var _a;
|
|
479
|
+
return ((_a = reflection.sources) === null || _a === void 0 ? void 0 : _a.map((source) => source.fileName)) || [];
|
|
480
|
+
}
|
|
481
|
+
//# sourceMappingURL=typedoc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typedoc.js","sourceRoot":"","sources":["../../src/kompendium/typedoc.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,WAAW,EAEX,cAAc,EAId,aAAa,EACb,cAAc,GACjB,MAAM,SAAS,CAAC;AAajB,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,MAAM,UAAU,SAAS,CACrB,QAAgB,EAChB,QAAiB;IAEjB,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QACxB,sCAAsC;QACtC,OAAO,CAAC,IAAI,CAAC,8BAA8B,EAAE,QAAQ,CAAC,CAAC;QAEvD,OAAO,EAAE,CAAC;IACd,CAAC;IAED,MAAM,GAAG,GAAG,IAAI,WAAW,EAAE,CAAC;IAE9B,gFAAgF;IAChF,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAElC,MAAM,OAAO,GAA4B;QACrC,WAAW,EAAE,CAAC,QAAQ,CAAC;QACvB,iBAAiB,EAAE,IAAI;QACvB,QAAQ,EAAE,WAAW;KACxB,CAAC;IAEF,IAAI,QAAQ,EAAE,CAAC;QACX,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAChC,CAAC;IAED,IAAI,QAAQ,CAAC,QAAQ,CAAC,OA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C;YACL,CAAC;YAED,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACjC,CAAC,CAAC;QAEF,KAAK,CAAC,UAAU,CAAC,CAAC;QAElB,OAAO,UAAU,CAAC;IACtB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,sCAAsC;QACtC,OAAO,CAAC,IAAI,CAAC,6BAA6B,EAAE,KAAK,CAAC,CAAC;QAEnD,OAAO,EAAE,CAAC;IACd,CAAC;AACL,CAAC;AAED,SAAS,aAAa,CAAC,UAAiC;;IACpD,OAAO,CACH,CAAA,MAAA,UAAU,CAAC,cAAc,0CAAE,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACvC,IAAI,EAAE,KAAK,CAAC,IAAI;KACnB,CAAC,CAAC,KAAI,EAAE,CACZ,CAAC;AACN,CAAC;AAED,SAAS,UAAU,CAAC,UAAiC;;IACjD,OAAO,CAAA,MAAA,UAAU,CAAC,OAAO,0CAAE,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAI,EAAE,CAAC;AACtE,CAAC","sourcesContent":["import {\n Application,\n Reflection,\n ReflectionKind,\n DeclarationReflection,\n TypeDocOptions,\n CommentTag,\n TypeDocReader,\n TSConfigReader,\n} from 'typedoc';\nimport { JsonDocsTag, JsonDocsProp } from '@stencil/core/internal';\nimport {\n InterfaceDescription,\n AliasDescription,\n EnumDescription,\n EnumMember,\n TypeDescription,\n MethodDescription,\n ParameterDescription,\n ClassDescription,\n DecoratorDescription,\n} from '../types';\nimport { existsSync, readFileSync } from 'fs';\nimport ts from 'typescript';\n\nexport function parseFile(\n filename: string,\n tsconfig?: string,\n): TypeDescription[] {\n if (!existsSync(filename)) {\n // eslint-disable-next-line no-console\n console.warn('typeRoot file does not exist', filename);\n\n return [];\n }\n\n const app = new Application();\n\n // Use current working directory as TypeDoc's base path for clean relative paths\n const projectRoot = process.cwd();\n\n const options: Partial<TypeDocOptions> = {\n entryPoints: [filename],\n skipErrorChecking: true,\n basePath: projectRoot,\n };\n\n if (tsconfig) {\n options.tsconfig = tsconfig;\n }\n\n if (filename.endsWith('.d.ts')) {\n options.exclude = ['**/+(*test*|node_modules)/**'];\n }\n\n app.options.addReader(new TypeDocReader());\n app.options.addReader(new TSConfigReader());\n app.bootstrap(options);\n\n const project = app.convert();\n if (!project) {\n // eslint-disable-next-line no-console\n console.warn('Could not find any type information');\n\n return [];\n }\n\n const data: TypeDescription[] = [];\n\n const allInterfaces = project.getReflectionsByKind(\n ReflectionKind.Interface,\n );\n const allClasses = project.getReflectionsByKind(ReflectionKind.Class);\n const allTypeAliases = project.getReflectionsByKind(\n ReflectionKind.TypeAlias,\n );\n const allEnums = project.getReflectionsByKind(ReflectionKind.Enum);\n\n const interfaces = allInterfaces.filter((r) =>\n shouldIncludeType(r as DeclarationReflection),\n );\n const classes = allClasses.filter((r) =>\n shouldIncludeType(r as DeclarationReflection),\n );\n const typeAliases = allTypeAliases.filter((r) =>\n shouldIncludeType(r as DeclarationReflection),\n );\n const enums = allEnums.filter((r) =>\n shouldIncludeType(r as DeclarationReflection),\n );\n\n interfaces.forEach((reflection) =>\n addInterface(reflection as DeclarationReflection, data as any),\n );\n classes.forEach((reflection) =>\n addClass(reflection as DeclarationReflection, data as any),\n );\n typeAliases.forEach((reflection) =>\n addType(reflection as DeclarationReflection, data as any),\n );\n enums.forEach((reflection) => {\n const members: EnumMember[] = [];\n const enumReflection = reflection as DeclarationReflection;\n enumReflection.children?.forEach((child) => {\n if (child.kind === ReflectionKind.EnumMember) {\n addEnumMember(child, members);\n }\n });\n data.push({\n type: 'enum',\n name: enumReflection.name,\n docs: getDocs(enumReflection),\n docsTags: getDocsTags(enumReflection),\n members: members,\n sources: getSources(enumReflection),\n } as EnumDescription);\n });\n\n return data;\n}\n\n/**\n * Determines if a type should be included in the documentation based on its source location\n * and documentation tags.\n *\n * Excludes types from:\n * - node_modules (third-party dependencies)\n * - examples directories\n * - test files (.test., .spec., /test/, /tests/)\n * - Types marked with @private or @internal tags\n * - Stencil auto-generated types (components.d.ts, Components namespace, CustomEvent wrappers)\n * @param {DeclarationReflection} reflection - The TypeDoc reflection to check\n * @returns {boolean} true if the type should be documented, false otherwise\n */\nfunction shouldIncludeType(reflection: DeclarationReflection): boolean {\n if (!reflection.sources || reflection.sources.length === 0) {\n // No source information - include by default\n return true;\n }\n\n for (const source of reflection.sources) {\n const sourcePath = source.fullFileName || source.fileName || '';\n\n if (shouldExcludeSource(sourcePath)) {\n return false;\n }\n }\n\n // Exclude CustomEvent wrapper types\n // These are generic wrappers around CustomEvent<T> that don't add useful\n // documentation\n if (reflection.name.endsWith('CustomEvent')) {\n return false;\n }\n\n // Exclude HTML element interface types\n // These are DOM element interfaces (HTMLLimelButtonElement, etc.) already\n // documented in the Components section\n if (\n reflection.name.startsWith('HTML') &&\n reflection.name.endsWith('Element')\n ) {\n return false;\n }\n\n // Exclude types in Stencil's Components namespace\n // Belt-and-suspenders: catches any component interfaces that were not\n // excluded based on source location\n if (isInComponentsNamespace(reflection)) {\n return false;\n }\n\n // Don't include anything marked @private or @internal\n if (reflection.comment?.blockTags) {\n const hasPrivateTag = reflection.comment.blockTags.some(\n (tag: any) => tag.tag === '@private' || tag.tag === '@internal',\n );\n if (hasPrivateTag) {\n return false;\n }\n }\n\n // Include this type\n return true;\n}\n\n/**\n * Checks if a source path should be excluded from documentation.\n * @param {string} sourcePath - The file path to check\n * @returns {boolean} true if the source should be excluded, false otherwise\n */\nfunction shouldExcludeSource(sourcePath: string): boolean {\n const normalizedPath = sourcePath.replaceAll('\\\\', '/');\n\n if (normalizedPath.includes('node_modules/')) {\n return true;\n }\n\n if (\n normalizedPath.includes('/examples/') ||\n normalizedPath.includes('/example/')\n ) {\n return true;\n }\n\n if (\n normalizedPath.includes('.test.') ||\n normalizedPath.includes('.spec.')\n ) {\n return true;\n }\n\n // This file contains component prop interfaces and HTML element types that\n // are already documented in the Components section\n return normalizedPath.endsWith('components.d.ts');\n}\n\n/**\n * Checks if a TypeDoc reflection is defined within Stencil's Components namespace.\n *\n * Stencil generates a Components namespace in components.d.ts containing interfaces\n * for component props. These types are already documented in the Components section\n * and should not be duplicated in the Types section.\n * @param {DeclarationReflection} reflection - The TypeDoc reflection to check\n * @returns {boolean} true if the reflection is in a Components namespace, false otherwise\n */\nfunction isInComponentsNamespace(reflection: DeclarationReflection): boolean {\n let current: Reflection | undefined = reflection.parent;\n while (current) {\n if (\n current.kind === ReflectionKind.Namespace &&\n current.name === 'Components'\n ) {\n return true;\n }\n\n current = current.parent;\n }\n\n return false;\n}\n\nconst fns = {\n [ReflectionKind.Interface]: addInterface,\n [ReflectionKind.Class]: addClass,\n [ReflectionKind.TypeAlias]: addType,\n [ReflectionKind.Enum]: addEnum,\n [ReflectionKind.EnumMember]: addEnumMember,\n};\n\nconst traverseCallback = (data: any) => (reflection: Reflection) => {\n const fn = fns[reflection.kind];\n if (fn) {\n fn(reflection, data);\n } else {\n reflection.traverse(traverseCallback(data));\n }\n};\n\nfunction addInterface(\n reflection: DeclarationReflection,\n data: InterfaceDescription[],\n) {\n data.push({\n type: 'interface',\n name: reflection.name,\n typeParams: getTypeParams(reflection),\n docs: getDocs(reflection),\n docsTags: getDocsTags(reflection),\n props: reflection.children?.filter(isProperty).map(getProperty) || [],\n methods: reflection.children?.filter(isMethod).map(getMethod) || [],\n sources: getSources(reflection),\n });\n}\n\nfunction addClass(reflection: DeclarationReflection, data: ClassDescription[]) {\n const decorators = getDecorators(reflection);\n\n const implementedInterfaces = getImplementedInterfaces(reflection);\n\n data.push({\n type: 'class',\n name: reflection.name,\n typeParams: getTypeParams(reflection),\n docs: getDocs(reflection),\n docsTags: getDocsTags(reflection),\n props:\n reflection.children\n ?.filter(isProperty)\n .map((prop) =>\n getPropertyWithInheritDoc(prop, implementedInterfaces),\n ) || [],\n methods:\n reflection.children\n ?.filter(isMethod)\n .map((method) =>\n getMethodWithInheritDoc(method, implementedInterfaces),\n ) || [],\n sources: getSources(reflection),\n decorators: decorators,\n });\n}\n\nfunction addType(reflection: DeclarationReflection, data: AliasDescription[]) {\n data.push({\n type: 'alias',\n name: reflection.name,\n docs: getDocs(reflection),\n docsTags: getDocsTags(reflection),\n alias: reflection.type.toString(),\n sources: getSources(reflection),\n });\n}\n\nfunction addEnum(reflection: DeclarationReflection, data: EnumDescription[]) {\n const members = [];\n reflection.traverse(traverseCallback(members));\n\n data.push({\n type: 'enum',\n name: reflection.name,\n docs: getDocs(reflection),\n docsTags: getDocsTags(reflection),\n members: members,\n sources: getSources(reflection),\n });\n}\n\nfunction addEnumMember(reflection: DeclarationReflection, data: EnumMember[]) {\n let value: string;\n if (reflection.type && (reflection.type as any).type === 'literal') {\n const literalValue = (reflection.type as any).value;\n if (typeof literalValue === 'string') {\n value = `\"${literalValue}\"`;\n } else {\n value = String(literalValue);\n }\n } else {\n value = reflection.defaultValue;\n }\n\n data.push({\n name: reflection.name,\n docs: getDocs(reflection),\n docsTags: getDocsTags(reflection),\n value: value,\n });\n}\n\nfunction getDocs(reflection: Reflection): string {\n if (!reflection.comment) {\n return '';\n }\n\n const text =\n reflection.comment.summary\n ?.map((part: any) => part.text)\n .join('')\n .trim() || '';\n\n // Normalize multiple newlines to single newlines\n return text.replaceAll(/\\n\\n+/g, '\\n');\n}\n\nfunction getDocsTags(reflection: DeclarationReflection) {\n return reflection.comment?.blockTags?.map(getTag) || [];\n}\n\nfunction getTag(tag: CommentTag): JsonDocsTag {\n // tag already has @ prefix, so remove it\n const tagName = (tag.tag as string).replace(/^@+/, '');\n\n return {\n name: tagName,\n text:\n tag.content\n ?.map((part: any) => part.text)\n .join('')\n .trim() || '',\n };\n}\n\nfunction isProperty(reflection: DeclarationReflection): boolean {\n if (reflection.kind !== ReflectionKind.Property) {\n return false;\n }\n\n const type = reflection.type as any;\n\n return !(type?.type === 'reflection' && type.declaration?.signatures);\n}\n\nfunction isMethod(reflection: DeclarationReflection): boolean {\n if (reflection.kind !== ReflectionKind.Property) {\n return false;\n }\n\n const type = reflection.type as any;\n\n return type?.type === 'reflection' && type.declaration?.signatures;\n}\n\nfunction getProperty(reflection: DeclarationReflection): Partial<JsonDocsProp> {\n return {\n name: reflection.name,\n type: reflection.type.toString(),\n docs: getDocs(reflection),\n docsTags: getDocsTags(reflection),\n default: reflection.defaultValue,\n optional: reflection.flags.isOptional,\n };\n}\n\nfunction getMethod(reflection: DeclarationReflection): MethodDescription {\n const type = reflection.type as any;\n const signature = type?.declaration?.signatures?.[0];\n\n if (!signature) {\n return {\n name: reflection.name,\n docs: getDocs(reflection),\n docsTags: [],\n parameters: [],\n returns: { type: 'void', docs: '' },\n };\n }\n\n let docs =\n signature.comment?.summary\n ?.map((part: any) => part.text)\n .join('')\n .trim() || '';\n // Normalize multiple newlines to single newlines\n docs = docs.replaceAll(/\\n\\n+/g, '\\n');\n\n const parameters: ParameterDescription[] =\n signature.parameters?.map((param: any) => ({\n name: param.name,\n type: param.type?.toString() || 'any',\n docs:\n param.comment?.summary\n ?.map((part: any) => part.text)\n .join('')\n .trim() || '',\n default: param.defaultValue,\n optional: param.flags?.isOptional || false,\n })) || [];\n\n const returnsTag = signature.comment?.blockTags?.find(\n (tag: any) => tag.tag === '@returns',\n );\n const returnsText =\n returnsTag?.content\n ?.map((part: any) => part.text)\n .join('')\n .trim() || '';\n\n const returns = {\n type: signature.type?.toString() || 'void',\n docs: returnsText,\n };\n\n const docsTags =\n signature.comment?.blockTags\n ?.filter(\n (tag: any) => tag.tag !== '@param' && tag.tag !== '@returns',\n )\n .map(getTag) || [];\n\n return {\n name: reflection.name,\n docs: docs,\n docsTags: docsTags,\n parameters: parameters,\n returns: returns,\n };\n}\n\nfunction getImplementedInterfaces(\n reflection: DeclarationReflection,\n): DeclarationReflection[] {\n const interfaces: DeclarationReflection[] = [];\n\n const implemented = (reflection as any).implementedTypes;\n if (implemented) {\n implemented.forEach((type: any) => {\n if (type.reflection) {\n interfaces.push(type.reflection);\n }\n });\n }\n\n return interfaces;\n}\n\nfunction getPropertyWithInheritDoc(\n reflection: DeclarationReflection,\n interfaces: DeclarationReflection[],\n): Partial<JsonDocsProp> {\n const prop = getProperty(reflection);\n\n const hasInheritDoc = reflection.comment?.blockTags?.some(\n (tag: any) => tag.tag.toLowerCase() === '@inheritdoc',\n );\n\n if (hasInheritDoc && interfaces.length > 0) {\n // Try to find the property in implemented interfaces\n for (const iface of interfaces) {\n const interfaceProp = iface.children?.find(\n (child) => child.name === reflection.name,\n );\n if (interfaceProp) {\n return {\n ...prop,\n docs: getDocs(interfaceProp),\n docsTags: getDocsTags(interfaceProp),\n };\n }\n }\n }\n\n return prop;\n}\n\nfunction getMethodWithInheritDoc(\n reflection: DeclarationReflection,\n interfaces: DeclarationReflection[],\n): MethodDescription {\n const type = reflection.type as any;\n const signature = type?.declaration?.signatures?.[0];\n const hasInheritDoc = signature?.comment?.blockTags?.some(\n (tag: any) => tag.tag.toLowerCase() === '@inheritdoc',\n );\n\n if (hasInheritDoc && interfaces.length > 0) {\n for (const iface of interfaces) {\n const interfaceMethod = iface.children?.find(\n (child) => child.name === reflection.name,\n );\n if (interfaceMethod) {\n return getMethod(interfaceMethod);\n }\n }\n }\n\n return getMethod(reflection);\n}\n\n/**\n * Extract decorator information from TypeScript source code using AST parsing\n *\n * TypeDoc 0.23 removed the decorators property from DeclarationReflection,\n * which was present in 0.17. This function works around that limitation by\n * parsing the original TypeScript source files to extract decorator information.\n * @param {DeclarationReflection} reflection - The TypeDoc reflection to extract decorators from\n * @returns {DecoratorDescription[]} Array of decorator descriptions with names and arguments\n * @remarks\n * This is a workaround for incomplete TypeDoc 0.23 API. TypeDoc removed\n * decorator information from their reflection model, but decorators are\n * essential for documenting Stencil components (e.g., @Component, @Prop).\n *\n * Performance considerations:\n * - Reads and parses source files on demand (I/O + parsing overhead)\n * - Caches nothing - each call re-parses the file\n * - For large codebases, consider caching parsed source files\n *\n * Known limitations:\n * - Only extracts class-level decorators, not property/method decorators\n * - Decorator arguments are captured as raw text, not parsed\n * - Fails silently if source file is unavailable or parsing fails\n * - Depends on TypeScript AST structure (may break with TS version changes)\n * @example\n * ```typescript\n * // For a class like:\n * @Component({ tag: 'my-component' })\n * class MyComponent { }\n *\n * // Returns:\n * [{\n * name: 'Component',\n * arguments: { _config: \"{ tag: 'my-component' }\" }\n * }]\n * ```\n */\nfunction getDecorators(\n reflection: DeclarationReflection,\n): DecoratorDescription[] {\n if (!reflection.sources || reflection.sources.length === 0) {\n return [];\n }\n\n const source = reflection.sources[0];\n const fileName = source.fullFileName || source.fileName;\n\n if (!existsSync(fileName)) {\n return [];\n }\n\n try {\n const sourceFile = ts.createSourceFile(\n fileName,\n readFileSync(fileName, 'utf8'),\n ts.ScriptTarget.Latest,\n true,\n );\n\n let decorators: DecoratorDescription[] = [];\n\n const visit = (node: ts.Node): void => {\n if (\n ts.isClassDeclaration(node) &&\n node.name?.getText() === reflection.name\n ) {\n let nodeDecorators;\n if (ts.canHaveDecorators(node)) {\n nodeDecorators = ts.getDecorators(node);\n }\n\n if (nodeDecorators) {\n decorators = nodeDecorators.map((decorator: any) => {\n const expression = decorator.expression;\n let name = '';\n let args: any = {};\n\n if (ts.isCallExpression(expression)) {\n name = expression.expression.getText();\n if (expression.arguments.length > 0) {\n args = {\n _config: expression.arguments[0].getText(),\n };\n }\n } else {\n name = expression.getText();\n }\n\n return { name: name, arguments: args };\n });\n }\n }\n\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n\n return decorators;\n } catch (error) {\n // eslint-disable-next-line no-console\n console.warn('Failed to parse decorators:', error);\n\n return [];\n }\n}\n\nfunction getTypeParams(reflection: DeclarationReflection) {\n return (\n reflection.typeParameters?.map((param) => ({\n name: param.name,\n })) || []\n );\n}\n\nfunction getSources(reflection: DeclarationReflection) {\n return reflection.sources?.map((source) => source.fileName) || [];\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import chokidar from "chokidar";
|
|
2
|
+
import nodeCleanup from "node-cleanup";
|
|
3
|
+
export function createWatcher(path, type, callback) {
|
|
4
|
+
const watcher = chokidar.watch(path).on(type, callback);
|
|
5
|
+
nodeCleanup(async () => {
|
|
6
|
+
await watcher.close();
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=watch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watch.js","sourceRoot":"","sources":["../../src/kompendium/watch.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,WAAW,MAAM,cAAc,CAAC;AAEvC,MAAM,UAAU,aAAa,CACzB,IAAY,EACZ,IAAY,EACZ,QAAkC;IAElC,MAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAExD,WAAW,CAAC,KAAK,IAAI,EAAE;QACnB,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;IAC1B,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["import chokidar from 'chokidar';\nimport nodeCleanup from 'node-cleanup';\n\nexport function createWatcher(\n path: string,\n type: string,\n callback: (...args: any[]) => void,\n): void {\n const watcher = chokidar.watch(path).on(type, callback);\n\n nodeCleanup(async () => {\n await watcher.close();\n });\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import {\n JsonDocs,\n JsonDocsTag,\n JsonDocsProp,\n JsonDocsMethod,\n JsonDocMethodParameter,\n} from '@stencil/core/internal';\n\nexport interface KompendiumConfig {\n /**\n * Output path\n */\n path: string;\n\n /**\n * www\n */\n publicPath: string;\n\n /**\n * Title to display in the header\n */\n title?: string;\n\n /**\n * Logo to display of the title in the header\n */\n logo?: string;\n\n typeRoot: string;\n\n guides: Guide[];\n}\n\nexport type Guide = string | { name: string; children: Guide[] };\n\nexport interface MenuItem {\n title?: string;\n path: string;\n icon?: string;\n children?: MenuItem[];\n}\n\nexport interface KompendiumData {\n title: string;\n logo?: string;\n docs: JsonDocs;\n menu: MenuItem[];\n readme?: string;\n guides: KompendiumGuide[];\n types: TypeDescription[];\n schemas: Array<Record<string, any>>;\n index: {\n documents: KompendiumDocument[];\n data: any;\n };\n}\n\nexport interface KompendiumDocument {\n tags?: string[];\n title: string;\n path: string;\n text: string | string[];\n props?: Array<{\n name: string;\n text: string;\n tags: string[];\n type: string;\n }>;\n events?: Array<{\n name: string;\n text: string;\n tags: string[];\n type: string;\n }>;\n}\n\nexport interface KompendiumGuide {\n dirPath?: string;\n fileName?: string;\n filePath?: string;\n data: Record<string, any>;\n content: string;\n}\n\nexport type TypeDescriptionType = 'interface' | 'alias' | 'enum' | 'class';\n\nexport interface TypeDescription {\n type: TypeDescriptionType;\n name: string;\n docs: string;\n docsTags: JsonDocsTag[];\n sources: string[];\n}\n\nexport interface InterfaceDescription extends TypeDescription {\n type: 'interface';\n typeParams: TypeParam[];\n props: Array<Partial<JsonDocsProp>>;\n methods: MethodDescription[];\n}\n\nexport interface ClassDescription extends TypeDescription {\n type: 'class';\n typeParams: TypeParam[];\n props: Array<Partial<JsonDocsProp>>;\n methods: MethodDescription[];\n decorators: DecoratorDescription[];\n}\n\nexport interface TypeParam {\n name: string;\n}\n\nexport interface AliasDescription extends TypeDescription {\n type: 'alias';\n alias: string;\n}\n\nexport interface EnumDescription extends TypeDescription {\n type: 'enum';\n members: EnumMember[];\n}\n\nexport interface EnumMember {\n name: string;\n docs: string;\n docsTags: JsonDocsTag[];\n value: string;\n}\n\nexport interface MethodDescription extends Partial<JsonDocsMethod> {\n parameters: ParameterDescription[];\n}\n\nexport interface ParameterDescription extends JsonDocMethodParameter {\n default: string;\n optional: boolean;\n}\n\nexport interface DecoratorDescription {\n name: string;\n arguments: any;\n}\n"]}
|
package/dist/config.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
2
|
+
|
|
3
|
+
function getDefaultExportFromCjs (x) {
|
|
4
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export { commonjsGlobal as c, getDefaultExportFromCjs as g };
|
|
8
|
+
//# sourceMappingURL=_commonjsHelpers-BFTU3MAI.js.map
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=_commonjsHelpers-BFTU3MAI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_commonjsHelpers-BFTU3MAI.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|