Skip to content

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
@github-actions
Copy link

🎉 This PR is included in version @api-ts/typed-express-router@2.0.0-beta.1 🎉

The release is available on npm package (@beta dist-tag)

Your semantic-release bot 📦🚀

@github-actions
Copy link

🎉 This PR is included in version @api-ts/express-wrapper@2.0.0-beta.1 🎉

The release is available on npm package (@beta dist-tag)

Your semantic-release bot 📦🚀

@github-actions
Copy link

🎉 This PR is included in version @api-ts/typed-express-router@1.1.14 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

@github-actions
Copy link

🎉 This PR is included in version @api-ts/express-wrapper@1.0.34 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

@github-actions
Copy link

🎉 This PR is included in version @api-ts/superagent-wrapper@1.3.4 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

@github-actions
Copy link

🎉 This PR is included in version @api-ts/openapi-generator@5.8.0 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants