-
Notifications
You must be signed in to change notification settings - Fork 1.3k
feat(docs): add hash-based caching for API docs generation #4437
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
d4b07ca to
742022b
Compare
12c6b52 to
92e888b
Compare
|
hmmm, I wonder if this is worth the tradeoff of having all of these new files in the codebase, will see what others think though the issue talks about an incremental build, so I guess this solves that, right? I am just not sure if there is a better way to do an incremental build? |
Def open to other concrete ideas - FWIW, note
|
785b486 to
156452a
Compare
|
I'd rather not add 3MB to the main repo. It seems like the following should be possible. @nathan-weinberg can you check?
|
I will take these actions - in the meantime, going to see if there are any other small steps I can take to reduce the local time here as well - otherwise I will close this PR. |
Add caching layer to skip regenerating API documentation when OpenAPI specs haven't changed. This significantly speeds up documentation builds by avoiding redundant work. Changes: - Add docs/scripts/gen-api-docs.js with SHA-256 hash-based caching - Add scripts/build-docs.sh wrapper script for building docs - Update docs/package.json with new npm scripts for selective generation - Support parallel generation with --parallel flag - Support individual spec generation (stable/experimental/deprecated) Fixes llamastack#4315 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
156452a to
70ce8c9
Compare
What does this PR do?
Add caching layer to skip regenerating API documentation when OpenAPI specs haven't changed. This significantly speeds up documentation builds by avoiding redundant work.
The
docusaurus-plugin-openapi-docswas regenerating 148 API documentation files from scratch on every build, generating code samples in 4 languages for each endpoint. This was leading to extremely long build times.Changes
docs/scripts/gen-api-docs.jswith SHA-256 hash-based cachingscripts/build-docs.shwrapper script for building docsdocs/package.jsonwith new npm scripts for selective generation--parallelflagPerformance Impact
New npm Scripts
npm run gen-api-docsnpm run gen-api-docs:forcenpm run gen-api-docs:parallelnpm run gen-api-docs:stablenpm run gen-api-docs:experimentalnpm run gen-api-docs:deprecatedCloses #4315
Test Plan
🤖 Generated with Claude Code