Skip to content

docs(superagent-wrapper): Restructure documentation as Diátaxis #1039

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

Merged
merged 1 commit into from
Apr 24, 2025

Conversation

youngjungithub
Copy link
Contributor

This PR refactors the documentation for the @api-ts/superagent-wrapper package, migrating technical details from the main README into a dedicated, structured Reference section following the Diátaxis framework.

Motivation:

Adopting the Diátaxis framework provides a standardized, clear structure for technical information, improving user experience and maintainability.

Changes Implemented:

  1. Established Diátaxis Reference Structure: Created a new documentation structure under docs/reference/superagent-wrapper/ specifically for reference material.
  2. Component-Based File Organization: Split the reference documentation into multiple MDX files, each focusing on a distinct component or concept:
    • index.mdx: Provides an overview and entry point for the @api-ts/superagent-wrapper reference section.
    • superagent-request-factory.mdx: Contains the detailed technical reference for the superagentRequestFactory function.
    • supertest-request-factory.mdx: Contains the detailed technical reference for the supertestRequestFactory function.
    • build-api-client.mdx: Contains the detailed technical reference for the buildApiClient function.
    • api-client.mdx: Provides a comprehensive description of the structure of the ApiClient object returned by buildApiClient, including its operation methods, the PreparedRequest methods (.decode(), .decodeExpecting()), and the structure of the ApiResponse/SpecificApiResponse objects.
  3. Content Migration and Enhancement: Extracted technical details and examples from the original README and rewrote them into formal reference documentation. This includes:
    • Precise descriptions of each function's purpose.
    • Clear representation of function signatures (including conceptual type definitions where applicable).
    • Detailed breakdown of parameters and return values.
    • Technical explanation of the generated ApiClient object's structure and behavior.
    • Explicit documentation of the .decode() and .decodeExpecting() methods and the response objects they return, including notes on type narrowing.

Benefits (Impact on Users):

  • Improved Findability: Users can now directly navigate to the specific component they need information about (e.g., buildApiClient, .decode()).
  • Enhanced Clarity: Provides clear, unambiguous technical descriptions separate from narrative guides.
  • Better Organization: Structured according to a well-regarded documentation framework (Diátaxis).
  • Increased Detail: Offers more explicit information on signatures, types, and the behavior of the generated client than was previously available.
  • Consistency: Aligns the documentation approach with other packages potentially using the same framework (e.g., @api-ts/io-ts-http).

This restructuring significantly improves the quality and usability of the technical documentation for @api-ts/superagent-wrapper.

…ence section

This commit refactors the documentation for the `@api-ts/superagent-wrapper` package, migrating technical details from the main README into a dedicated, structured Reference section following the Diátaxis framework.

**Motivation:**

The previous documentation, while providing a getting started guide, lacked a formal, easily navigable technical reference for the package's core components. Users needing specific details about function signatures, parameters, return types, or the structure of the generated API client had to infer them from the narrative guide and examples. Adopting the Diátaxis framework provides a standardized, clear structure for technical information, improving user experience and maintainability.

**Changes Implemented:**

1.  **Established Diátaxis Reference Structure:** Created a new documentation structure under `docs/reference/superagent-wrapper/` specifically for reference material.
2.  **Component-Based File Organization:** Split the reference documentation into multiple MDX files, each focusing on a distinct component or concept:
    * `index.mdx`: Provides an overview and entry point for the `@api-ts/superagent-wrapper` reference section.
    * `superagent-request-factory.mdx`: Contains the detailed technical reference for the `superagentRequestFactory` function.
    * `supertest-request-factory.mdx`: Contains the detailed technical reference for the `supertestRequestFactory` function.
    * `build-api-client.mdx`: Contains the detailed technical reference for the `buildApiClient` function.
    * `api-client.mdx`: Provides a comprehensive description of the structure of the `ApiClient` object returned by `buildApiClient`, including its operation methods, the `PreparedRequest` methods (`.decode()`, `.decodeExpecting()`), and the structure of the `ApiResponse`/`SpecificApiResponse` objects.
3.  **Content Migration and Enhancement:** Extracted technical details and examples from the original README and rewrote them into formal reference documentation. This includes:
    * Precise descriptions of each function's purpose.
    * Clear representation of function signatures (including conceptual type definitions where applicable).
    * Detailed breakdown of parameters and return values.
    * Technical explanation of the generated `ApiClient` object's structure and behavior.
    * Explicit documentation of the `.decode()` and `.decodeExpecting()` methods and the response objects they return, including notes on type narrowing.

**Benefits (Impact on Users):**

* **Improved Findability:** Users can now directly navigate to the specific component they need information about (e.g., `buildApiClient`, `.decode()`).
* **Enhanced Clarity:** Provides clear, unambiguous technical descriptions separate from narrative guides.
* **Better Organization:** Structured according to a well-regarded documentation framework (Diátaxis).
* **Increased Detail:** Offers more explicit information on signatures, types, and the behavior of the generated client than was previously available.
* **Consistency:** Aligns the documentation approach with other packages potentially using the same framework (e.g., `@api-ts/io-ts-http`).

This restructuring significantly improves the quality and usability of the technical documentation for `@api-ts/superagent-wrapper`.
@youngjungithub youngjungithub requested review from a team as code owners April 24, 2025 14:40
Copy link
Contributor

@vmccarty vmccarty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@omeradeel26 omeradeel26 merged commit c7289f9 into master Apr 24, 2025
6 checks passed
@omeradeel26 omeradeel26 deleted the docs/refactor-superagent-wrapper branch April 24, 2025 19:06
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.

3 participants