This folder contains tools for managing and maintaining documentation consistency across the Recharts project.
Automated tests that verify documentation is synchronized across:
- TypeScript source code comments
- API documentation in
www/src/docs/api - Storybook documentation
Run with:
npm run test-omnidocAuto-generates API documentation files from TypeScript source code. This tool:
- Reads TypeScript comments and type definitions from source code
- Generates API documentation in the
www/src/docs/apifolder - Only generates
en-USdescriptions (from TypeScript docs) - Always overwrites existing files (no merging)
Generate documentation for specific components:
npm run omnidoc [component1] [component2] ...Generate documentation for all allowlisted components:
npm run omnidocExamples:
npm run omnidoc
npm run omnidoc CartesianGrid
npm run omnidoc XAxis YAxis ZAxisAfter generating API documentation:
- Review the generated files for correctness
- Update
www/src/docs/api/index.tsto import and export the new API docs - Run
npm run test-omnidocto verify consistency - Optional: add new API examples in appropriate subfolder in
www/src/docs/apiExamples - Optional: add the new component to appropriate category in
www/src/docs/apiCates.ts - Commit the changes
- ProjectDocReader (
readProject.ts): Reads documentation from TypeScript source code using ts-morph - ApiDocReader (
readApiDoc.ts): Reads documentation from the website's API docs - StorybookDocReader (
readStorybookDoc.ts): Reads documentation from Storybook stories
All readers implement the DocReader interface defined in DocReader.ts.
- componentsAndDefaultPropsMap.ts: Manual mapping of component default props
- componentsWithInconsistentCommentsInApiDoc.ts: Temporary list of components with known inconsistencies
- util/: Helper functions for text normalization and diffing