Closed enzonotario closed 1 month ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
vitepress-openapi | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Oct 16, 2024 10:13pm |
[!CAUTION]
Review failed
The pull request is closed.
The changes in this pull request enhance the integration and configuration of the OpenAPI instance within a VitePress project. The enhanceApp
method in the theme files has been refactored to streamline the initialization of the OpenAPI instance. Documentation updates reflect these changes, including new sections on configuring the OpenAPI specification and utilizing custom slots in components. Additionally, the method of obtaining the OpenAPI instance has been standardized across various components, and new helper functions have been introduced to improve organization.
File | Change Summary |
---|---|
dev/.vitepress/theme/index.ts | Refactored enhanceApp method to initialize OpenAPI with { spec } and provide it to the app context. Removed i18n configuration. |
docs/.vitepress/theme/index.ts | Updated enhanceApp method to simplify OpenAPI setup by passing spec directly to useOpenapi and providing it to the app context. Removed i18n configuration. |
docs/guide/getting-started.md | Updated documentation to include new section on configuring OpenAPI specification, with emphasis on using app.provide for context availability. |
docs/layouts/custom-slots.md | Added section on custom slots for OAOperation component, referencing an external example file. |
docs/layouts/parts/custom-slots-example.md | New file demonstrating the use of custom slots in Vue components with OAOperation . |
src/components/Common/OAInfo.vue | Updated OpenAPI instantiation to use getOpenApiInstance with injected OpenAPI context. |
src/components/Common/OAServers.vue | Updated OpenAPI instantiation to use getOpenApiInstance with injected OpenAPI context. |
src/components/Path/OAPath.vue | Updated OpenAPI instantiation to use getOpenApiInstance with injected OpenAPI context. |
src/components/Path/OAPathsByTags.vue | Enhanced to optionally receive an array of tags. |
src/composables/useOpenapi.ts | Introduced setupOpenApi function to encapsulate OpenAPI initialization logic. |
src/lib/getOpenApiInstance.ts | New file that defines getOpenApiInstance function for retrieving OpenAPI instances based on custom and injected parameters. |
src/lib/OpenApi.ts | Modified to ensure it returns an empty object instead of undefined when no paths are present. |
package.json | Updated peer dependencies for vue and vitepress , reflecting version changes. |
vite.config.ts | Modified to treat both vue and vitepress as external dependencies during the build process. |
src/locales/en.json | Added new localization key for "Default". |
src/locales/es.json | Added new localization key for "Default". |
docs/.vitepress/theme/index.ts
file related to the enhanceApp
method, focusing on OpenAPI integration.OAInfo
and OAServers
components, which are also modified in the main PR, indicating a direct relationship in functionality.OASpec
component, relevant to the integration and usage of OpenAPI instances.Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
pnpm add https://pkg.pr.new/vitepress-openapi@90
pnpm add https://pkg.pr.new/vitepress-openapi@90
commit: a32ba0b
Description
Use provide/inject to re-use already parsed Specs, for better performance
Related issues/external references
65
Types of changes