docs(typed-express-router): Refactor documentation into Diátaxis Reference section #1041
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR significantly restructures and enhances the documentation for the
@api-ts/typed-express-router
package by adopting the Diátaxis framework and creating a dedicated, multi-file Reference section.Motivation:
The previous documentation, primarily located in the README, mixed introductory guides with technical details. This made it difficult for users to quickly find precise information about specific functions, types, or configuration options without reading through narrative content. A formal Reference section, following Diátaxis principles, provides a much clearer, more accessible, and maintainable structure for technical documentation.
Changes Implemented:
docs/reference/typed-express-router/
) for technical reference material, separating it from other documentation types (like Tutorials or How-To Guides, which might exist elsewhere).index.mdx
: Serves as the entry point and overview for the typed-express-router reference section.create-router.mdx
: Details thecreateRouter
function.wrap-router.mdx
: Details thewrapRouter
function.typed-router.mdx
: Describes theTypedRouter
object itself, including its typed route methods (e.g.,.get
,.getUnchecked
) and middleware handling (.use
).request-response.mdx
: Explains the augmentedreq
(withreq.decoded
) andres
(withres.sendEncoded
) objects provided to route handlers.configuration.mdx
: Documents the global (TypedRouterOptions
) and per-route (RouteOptions
) configuration, including error hooks (onDecodeError
,onEncodeError
), the post-response hook (afterEncodedResponseSent
), androuteAliases
.typed-request-handler.mdx
: Describes theTypedRequestHandler
helper type for improved type safety in handler definitions.Benefits (Impact on Users & Maintainers):
createRouter
,req.decoded
, configuration hooks, or other specific features can now find dedicated pages quickly.This refactoring represents a significant improvement in the quality, usability, and maintainability of the
@api-ts/typed-express-router
technical documentation.