chore: improve output with metadata processing#91
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR updates the TypeDoc → Markdown → doc-kit pipeline to generate docs that better align with the doc-kit specification by enriching reflections with source-file JSDoc metadata, reorganizing routing/output structure (including synthetic “types” pages), and adjusting theme partials/helpers to emit doc-kit-shaped Markdown.
Changes:
- Introduces a processor-layer router and metadata pass to enrich reflections from
webpack/libsource comments and to reorganize output pages/anchors (including category “types” pages). - Refactors theme partials/helpers to keep titles/anchors in sync with the router and to format examples/signatures in a doc-kit-friendly way.
- Tweaks generation configuration (plugin entrypoints, TypeDoc options, doc-kit config inputs and web settings).
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/markdown.mjs | Switches to the new processor plugin entrypoint and adjusts TypeDoc output options. |
| plugins/theme/router.mjs | Removes the theme-owned router (routing moved into the processor plugin). |
| plugins/theme/partials/index.mjs | Major partial overrides for doc-kit-style headings/lists and type-page-aware titles. |
| plugins/theme/index.mjs | Stops registering a router from the theme plugin (theme-only registration remains). |
| plugins/theme/helpers/index.mjs | Updates example rendering to fence bare snippets and align with doc-kit expectations. |
| plugins/shared/titles.mjs | Centralizes title/signature formatting to keep router + theme anchors consistent. |
| plugins/shared/categories.mjs | Adds category inference rules used by routing/type-page generation. |
| plugins/processor/router.mjs | Adds a processor-owned router with synthetic type pages and doc-kit slugging/anchors. |
| plugins/processor/metadata.mjs | Adds source-metadata extraction from webpack/lib JS files and applies it to reflections. |
| plugins/processor/index.mjs | Wires router registration, metadata enrichment, and writes the final type-map using router URLs. |
| doc-kit.config.mjs | Adjusts doc-kit input globbing and web generation settings (threads/remote config). |
Comments suppressed due to low confidence (1)
plugins/processor/index.mjs:18
typeMapKey()duplicates the same “prefix project root name if missing” logic that also exists inplugins/shared/titles.mjs(fullName()). Duplicating this logic risks drift between rendered titles/anchors and the generated type-map keys; consider importing and reusing the shared helper instead of reimplementing it here.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9f1f20f to
7825947
Compare
|
@moshams272 Thanks for pushing those commits! Unfortunately, I ended up overwriting them during my push because I had already incorporated the same ideas in a slightly different way. For example, the |
|
@ryzrr @moshams272 Unless you have more comments, could you approve this so it can land? We can iterate in follow-ups, but I feel like I (and this is my fault) am making this PR very large |
This reverts commit 4b9b3d2.
| { | ||
| category: 'assets', | ||
| label: 'Assets', | ||
| pattern: /^Asset|AssetInfo$/, |
| { | ||
| category: 'externals', | ||
| label: 'Externals', | ||
| pattern: /^External|Externals/, |
| headingLevel: options.headingLevel, | ||
| showTags: false, | ||
| }), | ||
| ctx.helpers.examples(comment, options), |
I really enjoyed reviewing this code. Don't worry about the PR size at all, it's totally worth it. |
This PR improves the
doc-kitgeneration pipeline by:types.d.tsby reading source files directlydeclarationoutputs to better adhere to https://raw.githubusercontent.com/nodejs/doc-kit/refs/heads/main/docs/specification.md.cc @webpack/gsoc-2026: I’d appreciate reviews and feedback on any mistakes, edge cases, or changes that should be made.
Additionally, this PR refactors the processor into several smaller modules:
export=consolidationAt the moment, sitemap categories are defined using regular expressions, though this can be adjusted later if needed.
source.mjscan eventually be removed once either:types.d.tsincludes all source comments, or