Skip to content

Add TypeScript API documentation generation to website #1471

@dannywillems

Description

@dannywillems

Problem

The frontend uses TypeScript interfaces to define configuration parameters (e.g., MinaEnv, MinaNode, FeaturesConfig in frontend/src/app/shared/types/core/environment/mina-env.type.ts), but developers must manually navigate to the source files to understand the complete API.

The current environment configuration documentation at website/docs/developers/frontend/environment-configuration.mdx contains copied code examples that need manual synchronization with the source code.

Solution

Integrate TypeScript documentation generation into the Docusaurus website to:

  1. Automatically generate API reference from TypeScript interfaces and JSDoc comments
  2. Keep documentation synchronized with source code changes
  3. Provide better developer experience with searchable, linkable API docs
  4. Reduce maintenance overhead by eliminating manually copied code examples

Implementation Options

Option 1: TypeDoc + docusaurus-plugin-typedoc (Recommended)

  • Native TypeScript support with JSDoc parsing
  • Seamless Docusaurus integration
  • Automatic sidebar generation
  • Maintains type links and cross-references

Option 2: Custom script using TypeScript Compiler API

  • Full control over output format
  • Generate custom Docusaurus markdown pages
  • Can integrate with existing documentation structure

Scope

Initial focus:

  • frontend/src/app/shared/types/core/environment/mina-env.type.ts (environment configuration types)
  • Generate API reference at website/docs/developers/frontend/api/
  • Add to frontend sidebar navigation

Future expansion:

  • Other frontend TypeScript interfaces and services
  • Node/core Rust documentation (separate effort)

Acceptance Criteria

  • TypeScript interfaces automatically generate API documentation
  • Generated docs integrate with Docusaurus website navigation
  • JSDoc comments are preserved and formatted correctly
  • Documentation builds are integrated with CI/CD
  • Links between generated API docs and manual documentation work correctly

Labels

  • enhancement
  • documentation
  • frontend

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentation

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions