Skip to content

Conversation

steve-calvert-glean
Copy link
Owner

@steve-calvert-glean steve-calvert-glean commented Jun 28, 2025

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

  • Added a new cache option to the plugin configuration, defaulting to true, 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]
  • Implemented caching logic using SHA-1 hashing to detect changes in the OpenAPI specification files. If the hash matches the previously stored value, generation is skipped, and a message is logged. (packages/docusaurus-plugin-openapi-docs/src/index.ts, [1] [2]
  • Added cleanup functionality to remove the hash file during cleanup operations. (packages/docusaurus-plugin-openapi-docs/src/index.ts, packages/docusaurus-plugin-openapi-docs/src/index.tsR577-R590)

Documentation Updates

  • Updated the plugin's README and demo documentation to include the new cache option and its default behavior. (packages/docusaurus-plugin-openapi-docs/README.md, demo/docs/intro.mdx, [1] [2] [3]

Codebase Improvements

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant