Overview System Refactoring Notes
Changes Made
Consolidated Scripts
- Removed:
scripts/validate-descriptions.js(standalone) - Removed:
scripts/sync-tag-descriptions.js(standalone) - Removed:
scripts/lib/mdx-content-injector.js(unused library) - Enhanced:
scripts/update-v2-descriptions.jsnow includes:validateDescriptions()- Validates all APIs have markdown filessyncTagDescriptions()- Syncs basic descriptions to OpenAPI specsmapAndUpdateDescriptions()- Existing MDX post-processing
Build Integration
scripts/main.jsstep 2/10 now calls validation and sync from consolidated script- Validation and sync run automatically during every build
Documentation
- Created:
docs/internal/overview-system.md- System documentation - Created:
docs/internal/refactoring-notes.md- This file - Removed: Redundant README files from scripts and markdown_descriptions
Why This Approach?
After evaluating whether to inject content into swagger files before generation vs. after:
Decision: Keep current approach (post-generation injection)
Reasoning:
- OpenAPI tag descriptions are limited to plain text
- Rich markdown in separate files allows:
- Docusaurus admonitions (:::note, :::warning)
- React components
- Complex formatting
- Better maintainability
Key Points
- Two-tier system: Basic descriptions in OpenAPI specs + rich markdown for docs
- Validation built-in: Every build checks for completeness
- One script: All description management in
update-v2-descriptions.js - Clean structure: Documentation in
docs/internal/, not scattered
Future Work
If further improvements needed:
- Consider refactoring old MDX manipulation code in
update-v2-descriptions.js - Add unit tests for validation/sync functions
- Create pre-commit hook for validation