Skip to content

Conversation

@adrianschmidt
Copy link
Collaborator

@adrianschmidt adrianschmidt commented Dec 1, 2025

When using a typeroot that includes src/components.d.ts, the generated documentation included unwanted types. Implemented filtering to exclude:

  • Third-party types (node_modules)
  • Examples and test files
  • Stencil auto-generated types (components.d.ts, HTML*Element, *CustomEvent)
  • Types in Components namespace (already documented elsewhere)

Uses three-layer strategy: source path filtering, namespace detection, and name pattern matching. Includes cross-platform path support and integration tests with representative fixtures.

Testing

This branch of Kompendium has been packed and installed in Lundalogik/lime-elements#3708, and can be tested at https://lundalogik.github.io/lime-elements/versions/PR-3708/

The @stencil/router package has been abandoned and does not support
Stencil v4. Replace it with @limetech/stencil-router, a lightweight
hash-based router built for Stencil applications.

- Update app.tsx to use stencil-router, stencil-route-switch, stencil-route
- Update MatchResults imports to use @limetech/stencil-router
- Remove @stencil/router re-export from index.ts
Upgraded Stencil and related dependencies:
- @stencil/core: 2.6.0 → 4.38.0
- @stencil/sass: 1.4.1 → 3.2.2
- jest: 27.0.3 → 29.7.0
- jest-cli: 24.9.0 → 29.7.0 (updated to match jest version)
- puppeteer: 1.19.0 → 22.15.0
- Removed @types/puppeteer (Puppeteer v10+ provides own types)

Configuration changes:
- Set preferBuiltins: false in nodeResolve config to allow
  rollup-plugin-polyfill-node to intercept Node.js built-ins (path,
  process, etc.) before Rollup treats them as external modules. This
  enables runtime markdown processing with unified/remark libraries by
  bundling polyfilled implementations instead of leaving bare imports.

- Replaced rollup-plugin-node-polyfills (v0.2.1, 2019) with
  rollup-plugin-polyfill-node (v0.13.0, 2023) for better modern
  module support.

Code changes:
- Fixed event handler type in search.tsx (KeyboardEvent → InputEvent)
- Updated TypeScript target to es2018 (required for regex dotAll flag)
Upgraded TypeDoc from v0.17.8 to v0.23.28 to enable documentation
generation for projects using Stencil v4 and modern TypeScript
configurations.

Primary motivation:
TypeDoc 0.17.8 (July 2020) couldn't properly resolve module paths in
Stencil v4 projects using TypeScript 4.7+, causing missing
documentation in modern code bases.

New capabilities:
- Proper module path resolution with TypeScript 4.7+ configurations
- @inheritdoc tag support: properties and methods can now inherit
  documentation from implemented interfaces

TypeDoc 0.23 API migration:
- Adapted to new comment structure (summary instead of shortText/text)
- Updated tag handling (blockTags with content arrays)
- Changed method detection (reflection type signatures)
- Fixed enum value extraction (type.value for literals)
- Added AST parsing workaround for decorator information (TypeDoc 0.23
  removed the decorators property)
- Improved error handling for file operations in generator cache
- Fixed incorrect capitalization of `@inheritDoc` in fixtures

BREAKING CHANGE: Kompendium now requires consumers to use TypeScript
4.6.x or higher (previously >= 3.8.3). Projects using TypeScript 3.x
or 4.0-4.5 must upgrade their TypeScript version to generate docs.
When using a typeroot that includes `src/components.d.ts`, the generated
documentation included unwanted types. Implemented filtering to exclude:

- Third-party types (node_modules)
- Examples and test files
- Stencil auto-generated types (components.d.ts, HTML*Element, *CustomEvent)
- Types in Components namespace (already documented elsewhere)

Uses three-layer strategy: source path filtering, namespace detection,
and name pattern matching. Includes cross-platform path support and
integration tests with representative fixtures.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants