-
Couldn't load subscription status.
- Fork 6
internal: Implements build cache for API files #120
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
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Deployment failed with the following error: Learn More: https://vercel.com/docs/concepts/projects/project-configuration |
47f65b4 to
b9f7016
Compare
b9f7016 to
03d631d
Compare
dae3f32 to
46ebf38
Compare
| // Set GENERATE_API_DOCS=false since we already handled it via cache | ||
| const env = { ...process.env, GENERATE_API_DOCS: 'false' }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2/5 (minor preference, non-blocking)
do we still need GENERATE_API_DOCS?
| log(message, level = 'info') { | ||
| // Skip verbose-only logs if not in verbose mode | ||
| if (!this.verbose && level === 'verbose') { | ||
| return; | ||
| } | ||
|
|
||
| // Use appropriate logger method based on level | ||
| switch (level) { | ||
| case 'error': | ||
| logger.error(message); | ||
| break; | ||
| case 'warn': | ||
| logger.warn(message); | ||
| break; | ||
| case 'success': | ||
| logger.success(message); | ||
| break; | ||
| case 'verbose': | ||
| // Verbose-only messages - show as regular info in verbose mode | ||
| if (this.verbose) { | ||
| // Use cyan for cache operations to make them stand out | ||
| console.log(logger.cyan('[Cache]') + ' ' + message); | ||
| } | ||
| break; | ||
| case 'info': | ||
| default: | ||
| // Only show info messages in verbose mode unless they're important | ||
| if (this.verbose || message.includes('✓') || message.includes('✗')) { | ||
| logger.info(message); | ||
| } | ||
| break; | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1/5 (nit, non-blocking)
kinda weird to have log inlined here instead of in a log.ts or something.
|
|
||
| this.log('Initializing build cache...', 'verbose'); | ||
|
|
||
| // Create cache directory if it doesn't exist |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2/5 (minor preference, non-blocking)
Most, if not all, of the comments in this file add no value (i.e. they just say what is about to happen)
OpenAPI Build Performance Optimization
Problem Solved
The OpenAPI documentation generation was extremely slow (~10-15 minutes) because it embedded massive base64-encoded specs (~1.4MB → ~2MB) in every MDX file's front matter, processing 134+ API endpoint files on every build.
Solution Implemented
Built an advanced caching system that:
Key Changes
scripts/advanced-openapi-cache.mjs,scripts/openapi-regenerate.mjs)GENERATE_API_DOCSenvironment variable)INFRASTRUCTURE_OPTIMIZATION_ROADMAP.md)Performance Results
Files Modified
package.json- Updated scripts and dependenciesscripts/- Added caching system, improved existing scriptsdocusaurus.config.ts- Removed conditional API doc generationsidebars.ts- Simplified conditional logicscripts/generate-changelog-data.mjs- Enhanced caching.gitignore- Added cache directoryMigration Notes
GENERATE_API_DOCSenvironment variable removed (no longer needed)Testing