-
Notifications
You must be signed in to change notification settings - Fork 21
docs(typed-express-router): Refactor documentation into Diátaxis Reference section #1041
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…rence section This commit 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:** 1. **Diátaxis Reference Structure:** Established a dedicated directory (`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). 2. **Component-Focused File Organization:** Divided the reference documentation into distinct MDX files, each dedicated to a specific component or concept of the library: * `index.mdx`: Serves as the entry point and overview for the typed-express-router reference section. * `create-router.mdx`: Details the `createRouter` function. * `wrap-router.mdx`: Details the `wrapRouter` function. * `typed-router.mdx`: Describes the `TypedRouter` object itself, including its typed route methods (e.g., `.get`, `.getUnchecked`) and middleware handling (`.use`). * `request-response.mdx`: Explains the augmented `req` (with `req.decoded`) and `res` (with `res.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`), and `routeAliases`. * `typed-request-handler.mdx`: Describes the `TypedRequestHandler` helper type for improved type safety in handler definitions. 3. **Content Migration & Refinement:** Technical information previously embedded in the README's "Usage" section has been extracted, expanded, and reformatted into precise reference documentation within the new structure. This includes: * Clear function/type signatures. * Detailed descriptions of parameters and return values. * Explicit explanations of component behavior (e.g., checked vs. unchecked routes, hook triggering conditions). * Code examples focused on illustrating the specific component being documented. **Benefits (Impact on Users & Maintainers):** * **Improved Discoverability:** Users needing technical details about `createRouter`, `req.decoded`, configuration hooks, or other specific features can now find dedicated pages quickly. * **Enhanced Clarity & Precision:** Technical specifications are presented directly and unambiguously, separate from introductory narratives. * **Better Maintainability:** Isolating documentation for each component makes future updates easier and less error-prone. * **Standardized Structure:** Adopts a recognized documentation pattern (Diátaxis), improving consistency potentially across multiple related packages. * **Increased Comprehensiveness:** Provides more explicit detail on the library's features and types than previously available in the consolidated README. This refactoring represents a significant improvement in the quality, usability, and maintainability of the `@api-ts/typed-express-router` technical documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
🎉 This PR is included in version @api-ts/[email protected] 🎉 The release is available on npm package (@beta dist-tag) Your semantic-release bot 📦🚀 |
🎉 This PR is included in version @api-ts/[email protected] 🎉 The release is available on npm package (@beta dist-tag) Your semantic-release bot 📦🚀 |
🎉 This PR is included in version @api-ts/[email protected] 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
🎉 This PR is included in version @api-ts/[email protected] 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
🎉 This PR is included in version @api-ts/[email protected] 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
🎉 This PR is included in version @api-ts/[email protected] 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
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.