Add caching for generated API docs #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces a caching mechanism to the
docusaurus-plugin-openapi-docs
plugin, which skips documentation generation if the source specification has not changed. The changes include updates to the plugin's configuration, implementation of the caching logic, and documentation updates. Below are the most important changes:Plugin Enhancements
cache
option to the plugin configuration, defaulting totrue
, to enable skipping generation when the source specification remains unchanged. (packages/docusaurus-plugin-openapi-docs/src/options.ts
,packages/docusaurus-plugin-openapi-docs/src/types.ts
, [1] [2]packages/docusaurus-plugin-openapi-docs/src/index.ts
, [1] [2]packages/docusaurus-plugin-openapi-docs/src/index.ts
, packages/docusaurus-plugin-openapi-docs/src/index.tsR577-R590)Documentation Updates
cache
option and its default behavior. (packages/docusaurus-plugin-openapi-docs/README.md
,demo/docs/intro.mdx
, [1] [2] [3]Codebase Improvements
getSpecHashPath
to manage the path for the hash file. (packages/docusaurus-plugin-openapi-docs/src/index.ts
, packages/docusaurus-plugin-openapi-docs/src/index.tsR39-R44)crypto
module for hashing functionality. (packages/docusaurus-plugin-openapi-docs/src/index.ts
, packages/docusaurus-plugin-openapi-docs/src/index.tsR11)